From df2d28f0e596906b0b07dc863797073adb538522 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Sun, 20 Oct 2024 21:54:33 -0700 Subject: [PATCH] panel options --- website/.astro/astro/content.d.ts | 256 +++++++++++++++ website/.astro/settings.json | 3 + website/.astro/types.d.ts | 292 +----------------- website/src/repl/components/ReplEditor.jsx | 6 +- website/src/repl/components/panel/Forms.jsx | 1 + website/src/repl/components/panel/Panel.jsx | 122 +++++--- .../src/repl/components/panel/SettingsTab.jsx | 26 ++ .../src/repl/components/panel/SoundsTab.jsx | 4 +- website/src/settings.mjs | 11 +- 9 files changed, 385 insertions(+), 336 deletions(-) create mode 100644 website/.astro/astro/content.d.ts diff --git a/website/.astro/astro/content.d.ts b/website/.astro/astro/content.d.ts new file mode 100644 index 00000000..b4ac1c72 --- /dev/null +++ b/website/.astro/astro/content.d.ts @@ -0,0 +1,256 @@ +declare module 'astro:content' { + interface Render { + '.mdx': Promise<{ + Content: import('astro').MarkdownInstance<{}>['Content']; + headings: import('astro').MarkdownHeading[]; + remarkPluginFrontmatter: Record; + }>; + } +} + +declare module 'astro:content' { + interface RenderResult { + Content: import('astro/runtime/server/index.js').AstroComponentFactory; + headings: import('astro').MarkdownHeading[]; + remarkPluginFrontmatter: Record; + } + interface Render { + '.md': Promise; + } + + export interface RenderedContent { + html: string; + metadata?: { + imagePaths: Array; + [key: string]: unknown; + }; + } +} + +declare module 'astro:content' { + type Flatten = T extends { [K: string]: infer U } ? U : never; + + export type CollectionKey = keyof AnyEntryMap; + export type CollectionEntry = Flatten; + + export type ContentCollectionKey = keyof ContentEntryMap; + export type DataCollectionKey = keyof DataEntryMap; + + type AllValuesOf = T extends any ? T[keyof T] : never; + type ValidContentEntrySlug = AllValuesOf< + ContentEntryMap[C] + >['slug']; + + /** @deprecated Use `getEntry` instead. */ + export function getEntryBySlug< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >( + collection: C, + // Note that this has to accept a regular string too, for SSR + entrySlug: E, + ): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + + /** @deprecated Use `getEntry` instead. */ + export function getDataEntryById( + collection: C, + entryId: E, + ): Promise>; + + export function getCollection>( + collection: C, + filter?: (entry: CollectionEntry) => entry is E, + ): Promise; + export function getCollection( + collection: C, + filter?: (entry: CollectionEntry) => unknown, + ): Promise[]>; + + export function getEntry< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >(entry: { + collection: C; + slug: E; + }): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + export function getEntry< + C extends keyof DataEntryMap, + E extends keyof DataEntryMap[C] | (string & {}), + >(entry: { + collection: C; + id: E; + }): E extends keyof DataEntryMap[C] + ? Promise + : Promise | undefined>; + export function getEntry< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >( + collection: C, + slug: E, + ): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + export function getEntry< + C extends keyof DataEntryMap, + E extends keyof DataEntryMap[C] | (string & {}), + >( + collection: C, + id: E, + ): E extends keyof DataEntryMap[C] + ? Promise + : Promise | undefined>; + + /** Resolve an array of entry references from the same collection */ + export function getEntries( + entries: { + collection: C; + slug: ValidContentEntrySlug; + }[], + ): Promise[]>; + export function getEntries( + entries: { + collection: C; + id: keyof DataEntryMap[C]; + }[], + ): Promise[]>; + + export function render( + entry: AnyEntryMap[C][string], + ): Promise; + + export function reference( + collection: C, + ): import('astro/zod').ZodEffects< + import('astro/zod').ZodString, + C extends keyof ContentEntryMap + ? { + collection: C; + slug: ValidContentEntrySlug; + } + : { + collection: C; + id: keyof DataEntryMap[C]; + } + >; + // Allow generic `string` to avoid excessive type errors in the config + // if `dev` is not running to update as you edit. + // Invalid collection names will be caught at build time. + export function reference( + collection: C, + ): import('astro/zod').ZodEffects; + + type ReturnTypeOrOriginal = T extends (...args: any[]) => infer R ? R : T; + type InferEntrySchema = import('astro/zod').infer< + ReturnTypeOrOriginal['schema']> + >; + + type ContentEntryMap = { + "blog": { +"release-0.0.2-schwindlig.mdx": { + id: "release-0.0.2-schwindlig.mdx"; + slug: "release-002-schwindlig"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.0.2.1-stuermisch.mdx": { + id: "release-0.0.2.1-stuermisch.mdx"; + slug: "release-0021-stuermisch"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.0.3-maelstrom.mdx": { + id: "release-0.0.3-maelstrom.mdx"; + slug: "release-003-maelstrom"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.0.4-gischt.mdx": { + id: "release-0.0.4-gischt.mdx"; + slug: "release-004-gischt"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.3.0-donauwelle.mdx": { + id: "release-0.3.0-donauwelle.mdx"; + slug: "release-030-donauwelle"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.4.0-brandung.mdx": { + id: "release-0.4.0-brandung.mdx"; + slug: "release-040-brandung"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.5.0-wirbel.mdx": { + id: "release-0.5.0-wirbel.mdx"; + slug: "release-050-wirbel"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.6.0-zimtschnecke.mdx": { + id: "release-0.6.0-zimtschnecke.mdx"; + slug: "release-060-zimtschnecke"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.7.0-zuckerguss.mdx": { + id: "release-0.7.0-zuckerguss.mdx"; + slug: "release-070-zuckerguss"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.8.0-himbeermuffin.mdx": { + id: "release-0.8.0-himbeermuffin.mdx"; + slug: "release-080-himbeermuffin"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-0.9.0-bananenbrot.mdx": { + id: "release-0.9.0-bananenbrot.mdx"; + slug: "release-090-bananenbrot"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"release-1.0.0-geburtstagskuchen.mdx": { + id: "release-1.0.0-geburtstagskuchen.mdx"; + slug: "release-100-geburtstagskuchen"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +"year-2.mdx": { + id: "year-2.mdx"; + slug: "year-2"; + body: string; + collection: "blog"; + data: InferEntrySchema<"blog"> +} & { render(): Render[".mdx"] }; +}; + + }; + + type DataEntryMap = { + + }; + + type AnyEntryMap = ContentEntryMap & DataEntryMap; + + export type ContentConfig = typeof import("../../src/content/config.js"); +} diff --git a/website/.astro/settings.json b/website/.astro/settings.json index bf82959b..109959d7 100644 --- a/website/.astro/settings.json +++ b/website/.astro/settings.json @@ -1,5 +1,8 @@ { "devToolbar": { "enabled": false + }, + "_variables": { + "lastUpdateCheck": 1729351618095 } } \ No newline at end of file diff --git a/website/.astro/types.d.ts b/website/.astro/types.d.ts index f091daa1..9a2a78c1 100644 --- a/website/.astro/types.d.ts +++ b/website/.astro/types.d.ts @@ -1,290 +1,2 @@ -declare module 'astro:content' { - interface Render { - '.mdx': Promise<{ - Content: import('astro').MarkdownInstance<{}>['Content']; - headings: import('astro').MarkdownHeading[]; - remarkPluginFrontmatter: Record; - }>; - } -} - -declare module 'astro:content' { - interface Render { - '.md': Promise<{ - Content: import('astro').MarkdownInstance<{}>['Content']; - headings: import('astro').MarkdownHeading[]; - remarkPluginFrontmatter: Record; - }>; - } -} - -declare module 'astro:content' { - export { z } from 'astro/zod'; - - type Flatten = T extends { [K: string]: infer U } ? U : never; - - export type CollectionKey = keyof AnyEntryMap; - export type CollectionEntry = Flatten; - - export type ContentCollectionKey = keyof ContentEntryMap; - export type DataCollectionKey = keyof DataEntryMap; - - // This needs to be in sync with ImageMetadata - export type ImageFunction = () => import('astro/zod').ZodObject<{ - src: import('astro/zod').ZodString; - width: import('astro/zod').ZodNumber; - height: import('astro/zod').ZodNumber; - format: import('astro/zod').ZodUnion< - [ - import('astro/zod').ZodLiteral<'png'>, - import('astro/zod').ZodLiteral<'jpg'>, - import('astro/zod').ZodLiteral<'jpeg'>, - import('astro/zod').ZodLiteral<'tiff'>, - import('astro/zod').ZodLiteral<'webp'>, - import('astro/zod').ZodLiteral<'gif'>, - import('astro/zod').ZodLiteral<'svg'>, - import('astro/zod').ZodLiteral<'avif'>, - ] - >; - }>; - - type BaseSchemaWithoutEffects = - | import('astro/zod').AnyZodObject - | import('astro/zod').ZodUnion<[BaseSchemaWithoutEffects, ...BaseSchemaWithoutEffects[]]> - | import('astro/zod').ZodDiscriminatedUnion - | import('astro/zod').ZodIntersection; - - type BaseSchema = - | BaseSchemaWithoutEffects - | import('astro/zod').ZodEffects; - - export type SchemaContext = { image: ImageFunction }; - - type DataCollectionConfig = { - type: 'data'; - schema?: S | ((context: SchemaContext) => S); - }; - - type ContentCollectionConfig = { - type?: 'content'; - schema?: S | ((context: SchemaContext) => S); - }; - - type CollectionConfig = ContentCollectionConfig | DataCollectionConfig; - - export function defineCollection( - input: CollectionConfig - ): CollectionConfig; - - type AllValuesOf = T extends any ? T[keyof T] : never; - type ValidContentEntrySlug = AllValuesOf< - ContentEntryMap[C] - >['slug']; - - export function getEntryBySlug< - C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}), - >( - collection: C, - // Note that this has to accept a regular string too, for SSR - entrySlug: E - ): E extends ValidContentEntrySlug - ? Promise> - : Promise | undefined>; - - export function getDataEntryById( - collection: C, - entryId: E - ): Promise>; - - export function getCollection>( - collection: C, - filter?: (entry: CollectionEntry) => entry is E - ): Promise; - export function getCollection( - collection: C, - filter?: (entry: CollectionEntry) => unknown - ): Promise[]>; - - export function getEntry< - C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}), - >(entry: { - collection: C; - slug: E; - }): E extends ValidContentEntrySlug - ? Promise> - : Promise | undefined>; - export function getEntry< - C extends keyof DataEntryMap, - E extends keyof DataEntryMap[C] | (string & {}), - >(entry: { - collection: C; - id: E; - }): E extends keyof DataEntryMap[C] - ? Promise - : Promise | undefined>; - export function getEntry< - C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}), - >( - collection: C, - slug: E - ): E extends ValidContentEntrySlug - ? Promise> - : Promise | undefined>; - export function getEntry< - C extends keyof DataEntryMap, - E extends keyof DataEntryMap[C] | (string & {}), - >( - collection: C, - id: E - ): E extends keyof DataEntryMap[C] - ? Promise - : Promise | undefined>; - - /** Resolve an array of entry references from the same collection */ - export function getEntries( - entries: { - collection: C; - slug: ValidContentEntrySlug; - }[] - ): Promise[]>; - export function getEntries( - entries: { - collection: C; - id: keyof DataEntryMap[C]; - }[] - ): Promise[]>; - - export function reference( - collection: C - ): import('astro/zod').ZodEffects< - import('astro/zod').ZodString, - C extends keyof ContentEntryMap - ? { - collection: C; - slug: ValidContentEntrySlug; - } - : { - collection: C; - id: keyof DataEntryMap[C]; - } - >; - // Allow generic `string` to avoid excessive type errors in the config - // if `dev` is not running to update as you edit. - // Invalid collection names will be caught at build time. - export function reference( - collection: C - ): import('astro/zod').ZodEffects; - - type ReturnTypeOrOriginal = T extends (...args: any[]) => infer R ? R : T; - type InferEntrySchema = import('astro/zod').infer< - ReturnTypeOrOriginal['schema']> - >; - - type ContentEntryMap = { - "blog": { -"release-0.0.2-schwindlig.mdx": { - id: "release-0.0.2-schwindlig.mdx"; - slug: "release-002-schwindlig"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.0.2.1-stuermisch.mdx": { - id: "release-0.0.2.1-stuermisch.mdx"; - slug: "release-0021-stuermisch"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.0.3-maelstrom.mdx": { - id: "release-0.0.3-maelstrom.mdx"; - slug: "release-003-maelstrom"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.0.4-gischt.mdx": { - id: "release-0.0.4-gischt.mdx"; - slug: "release-004-gischt"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.3.0-donauwelle.mdx": { - id: "release-0.3.0-donauwelle.mdx"; - slug: "release-030-donauwelle"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.4.0-brandung.mdx": { - id: "release-0.4.0-brandung.mdx"; - slug: "release-040-brandung"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.5.0-wirbel.mdx": { - id: "release-0.5.0-wirbel.mdx"; - slug: "release-050-wirbel"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.6.0-zimtschnecke.mdx": { - id: "release-0.6.0-zimtschnecke.mdx"; - slug: "release-060-zimtschnecke"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.7.0-zuckerguss.mdx": { - id: "release-0.7.0-zuckerguss.mdx"; - slug: "release-070-zuckerguss"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.8.0-himbeermuffin.mdx": { - id: "release-0.8.0-himbeermuffin.mdx"; - slug: "release-080-himbeermuffin"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-0.9.0-bananenbrot.mdx": { - id: "release-0.9.0-bananenbrot.mdx"; - slug: "release-090-bananenbrot"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"release-1.0.0-geburtstagskuchen.mdx": { - id: "release-1.0.0-geburtstagskuchen.mdx"; - slug: "release-100-geburtstagskuchen"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -"year-2.mdx": { - id: "year-2.mdx"; - slug: "year-2"; - body: string; - collection: "blog"; - data: InferEntrySchema<"blog"> -} & { render(): Render[".mdx"] }; -}; - - }; - - type DataEntryMap = { - - }; - - type AnyEntryMap = ContentEntryMap & DataEntryMap; - - type ContentConfig = typeof import("../src/content/config"); -} +/// +/// \ No newline at end of file diff --git a/website/src/repl/components/ReplEditor.jsx b/website/src/repl/components/ReplEditor.jsx index 5a1c2e67..c96fbbfd 100644 --- a/website/src/repl/components/ReplEditor.jsx +++ b/website/src/repl/components/ReplEditor.jsx @@ -13,7 +13,7 @@ export default function ReplEditor(Props) { const { context } = Props; const { containerRef, editorRef, error, init, pending } = context; const settings = useSettings(); - const { panelPosition } = settings; + const { panelPosition, isZen } = settings; return (
@@ -21,10 +21,10 @@ export default function ReplEditor(Props) {
- {panelPosition === 'right' && } + {!isZen && panelPosition === 'right' && }
- {panelPosition === 'bottom' && } + {!isZen && panelPosition === 'bottom' && }
); } diff --git a/website/src/repl/components/panel/Forms.jsx b/website/src/repl/components/panel/Forms.jsx index c5b22002..4cb73a46 100644 --- a/website/src/repl/components/panel/Forms.jsx +++ b/website/src/repl/components/panel/Forms.jsx @@ -6,6 +6,7 @@ export function ButtonGroup({ value, onChange, items }) { {Object.entries(items).map(([key, label], i, arr) => ( + )} ); } @@ -78,11 +82,27 @@ if (TAURI) { tabNames.files = 'files'; } -function PanelNav({ children, className, ...props }) { +function PanelNav({ children, className, settings, ...props }) { + const isHoverBehavior = settings.togglePanelTrigger === 'hover'; return (