diff --git a/packages/@svelte-in-motion-builtin-extensions/src/extensions/commands.ts b/packages/@svelte-in-motion-builtin-extensions/src/extensions/commands.ts index 71d7ba9..eb14a3f 100644 --- a/packages/@svelte-in-motion-builtin-extensions/src/extensions/commands.ts +++ b/packages/@svelte-in-motion-builtin-extensions/src/extensions/commands.ts @@ -112,7 +112,6 @@ export const EXTENSION_COMMANDS = define_extension({ args = ( await prompts.prompt_form({ is_dismissible: true, - title: `commands-${command.identifier}-label`, type: command.type, }) diff --git a/packages/@svelte-in-motion-builtin-extensions/src/extensions/export.ts b/packages/@svelte-in-motion-builtin-extensions/src/extensions/export.ts index 5167e85..76ee2e9 100644 --- a/packages/@svelte-in-motion-builtin-extensions/src/extensions/export.ts +++ b/packages/@svelte-in-motion-builtin-extensions/src/extensions/export.ts @@ -3,54 +3,29 @@ import {get} from "svelte/store"; import type {IAppContext, IKeybindEvent} from "@svelte-in-motion/extension"; import {define_extension} from "@svelte-in-motion/extension"; import {ICodecNames, IPixelFormatNames} from "@svelte-in-motion/encoding"; -import {Default, Description, Label, Minimum, Namespace, Placeholder} from "@svelte-in-motion/type"; +import {Default, Minimum} from "@svelte-in-motion/type"; import {typeOf} from "@svelte-in-motion/type"; import {PromptDismissError, download_blob, download_buffer} from "@svelte-in-motion/utilities"; import {NoEditorUserError, NoPreviewUserError, NoWorkspaceUserError} from "../util/errors"; import {zip_frames} from "../util/io"; -interface IFramesExportConfiguration { - start: number & - Default<0> & - Minimum<0> & - Label<"ui-prompt-form-frames-export-start-label"> & - Description<"ui-prompt-form-frames-export-start-description">; - - end: number & - Default<0> & - Minimum<0> & - Label<"ui-prompt-form-frames-export-end-label"> & - Description<"ui-prompt-form-frames-export-end-description">; +interface FramesExport { + start: number & Default<0> & Minimum<0>; + + end: number & Default<0> & Minimum<0>; } -interface IVideoExportConfiguration { - start: number & - Default<0> & - Minimum<0> & - Label<"ui-prompt-form-video-export-start-label"> & - Description<"ui-prompt-form-video-export-start-description">; - - end: number & - Default<0> & - Minimum<0> & - Label<"ui-prompt-form-video-export-end-label"> & - Description<"ui-prompt-form-video-export-end-description">; - - codec: ICodecNames & - Label<"ui-prompt-form-video-export-codec-label"> & - Placeholder<"ui-prompt-form-video-export-codec-placeholder"> & - Namespace<"ui-prompt-form-video-export-codec-${identifier}-label">; - - crf: number & - Minimum<0> & - Label<"ui-prompt-form-video-export-crf-label"> & - Description<"ui-prompt-form-video-export-crf-description">; - - pixel_format: IPixelFormatNames & - Label<"ui-prompt-form-video-export-pixel_format-label"> & - Placeholder<"ui-prompt-form-video-export-pixel_format-placeholder"> & - Namespace<"ui-prompt-form-video-export-pixel_format-${identifier}-label">; +interface VideoExport { + start: number & Default<0> & Minimum<0>; + + end: number & Default<0> & Minimum<0>; + + codec: ICodecNames; + + crf: number & Minimum<0>; + + pixel_format: IPixelFormatNames; } export const EXTENSION_EXPORT = define_extension({ @@ -97,14 +72,13 @@ export const EXTENSION_EXPORT = define_extension({ const {maxframes} = get(configuration); - let result: IFramesExportConfiguration; + let result: FramesExport; try { result = ( - await prompts.prompt_form({ + await prompts.prompt_form({ is_dismissible: true, - title: "ui-prompt-form-frames-export-title", - type: typeOf(), + type: typeOf(), model: { // TODO: Make prompt configuration dynamic to support this as runtime validation end: maxframes as number, @@ -172,14 +146,13 @@ export const EXTENSION_EXPORT = define_extension({ default_codec ); - let result: IVideoExportConfiguration; + let result: VideoExport; try { result = ( - await prompts.prompt_form({ + await prompts.prompt_form({ is_dismissible: true, - title: "ui-prompt-form-video-export-title", - type: typeOf(), + type: typeOf(), model: { // TODO: Make prompt configuration dynamic to support this as runtime validation end: maxframes as number, diff --git a/packages/@svelte-in-motion-builtin-extensions/src/extensions/workspace.ts b/packages/@svelte-in-motion-builtin-extensions/src/extensions/workspace.ts index bb3b6aa..2be574a 100644 --- a/packages/@svelte-in-motion-builtin-extensions/src/extensions/workspace.ts +++ b/packages/@svelte-in-motion-builtin-extensions/src/extensions/workspace.ts @@ -3,7 +3,7 @@ import {get} from "svelte/store"; import {WorkspacesItemConfiguration} from "@svelte-in-motion/configuration"; import type {IAppContext, IKeybindEvent, ISearchPromptEvent} from "@svelte-in-motion/extension"; import {define_extension} from "@svelte-in-motion/extension"; -import {Default, Description, Label, MinLength, Pattern} from "@svelte-in-motion/type"; +import {Default, MinLength, Pattern} from "@svelte-in-motion/type"; import {typeOf} from "@svelte-in-motion/type"; import {PromptDismissError} from "@svelte-in-motion/utilities"; @@ -11,13 +11,8 @@ import {NoWorkspaceUserError} from "../util/errors"; const EXPRESSION_NAME = /^[\w ]+$/; -interface IWorkspaceNewConfiguration { - name: string & - Default<""> & - MinLength<0> & - Pattern & - Label<"ui-prompt-form-workspace-new-name-label"> & - Description<"ui-prompt-form-workspace-new-name-description">; +interface WorkspaceNew { + name: string & Default<""> & MinLength<0> & Pattern; } async function render_template( @@ -105,14 +100,13 @@ export const EXTENSION_WORKSPACE = define_extension({ async command_prompt_new(app: IAppContext) { const {prompts} = app; - let result: IWorkspaceNewConfiguration; + let result: WorkspaceNew; try { result = ( - await prompts.prompt_form({ + await prompts.prompt_form({ is_dismissible: true, - title: "ui-prompt-form-workspace-new-title", - type: typeOf(), + type: typeOf(), }) ).model; } catch (err) { @@ -170,14 +164,13 @@ export const EXTENSION_WORKSPACE = define_extension({ throw err; } - let form_result: IWorkspaceNewConfiguration; + let form_result: WorkspaceNew; try { form_result = ( - await prompts.prompt_form({ + await prompts.prompt_form({ is_dismissible: true, - title: "ui-prompt-form-workspace-new-title", - type: typeOf(), + type: typeOf(), }) ).model; } catch (err) { @@ -193,7 +186,6 @@ export const EXTENSION_WORKSPACE = define_extension({ tokens = ( await prompts.prompt_form({ is_dismissible: true, - title: `templates-${template.identifier}-label`, type: template.type, }) diff --git a/packages/@svelte-in-motion-editor/public/assets/translations/en-US.ftl b/packages/@svelte-in-motion-editor/public/assets/translations/en-US.ftl index 28ef983..23b6e00 100644 --- a/packages/@svelte-in-motion-editor/public/assets/translations/en-US.ftl +++ b/packages/@svelte-in-motion-editor/public/assets/translations/en-US.ftl @@ -40,54 +40,57 @@ commands-workspace-prompt-open_recent-label = Workspaces: Open Recent templates-welcome-label = Welcome to Svelte-In-Motion templates-welcome-description = Simple welcome message template to introduce syntax and concepts. -errors-no_editor_user_error-label= Error +errors-no_editor_user_error-label = Error errors-no_editor_user_error-description = No File is currently loaded. -errors-no_preview_user_error-label= Error +errors-no_preview_user_error-label = Error errors-no_preview_user_error-description = No Preview is currently loaded. -errors-no_workspace_user_error-label= Error +errors-no_workspace_user_error-label = Error errors-no_workspace_user_error-description = No Workspace is currently loaded. -ui-view-dashboard-brand-label = Svelte-In-Motion -ui-view-dashboard-start-label = Start -ui-view-dashboard-new_workspace-label = New Workspace -ui-view-dashboard-new_workspace_from_template-label = New Workspace from Template -ui-view-dashboard-open_recent_workspace-label = Open Recent Workspace -ui-view-dashboard-recent-label = Recent -ui-view-dashboard-more-label = ...More +prompts-about-label = About Svelte-In-Motion +prompts-about-version-label = VERSION +prompts-about-source-label = SOURCE +prompts-about-dismiss-label = Dismiss -ui-prompt-about-title = About Svelte-In-Motion -ui-prompt-about-version-label = VERSION -ui-prompt-about-source-label = SOURCE -ui-prompt-about-dismiss-label = Dismiss +prompts-alert-dismiss-label = Dismiss -ui-prompt-alert-dismiss-label = Dismiss +prompts-confirm-dismiss-label = Cancel +prompts-confirm-submit-label = Yes -ui-prompt-confirm-dismiss-label = Cancel -ui-prompt-confirm-submit-label = Yes +prompts-frames_export-label = Export Frames +prompts-frames_export-start-label = Starting Frame +prompts-frames_export-start-description = Enter the first frame you want to export. +prompts-frames_export-end-label = Ending Frame +prompts-frames_export-end-description = Enter the last frame you want to export. +prompts-frames_export-dismiss-label = Dismiss +prompts-frames_export-submit-label = Export -ui-prompt-form-dismiss-label = Dismiss -ui-prompt-form-submit-label = Submit +prompts-video_export-label = Export Video +prompts-video_export-start-label = Starting Frame +prompts-video_export-start-description = Enter the first frame you want to export. +prompts-video_export-end-label = Ending Frame +prompts-video_export-end-description = Enter the last frame you want to export. +prompts-video_export-codec-label = Codec +prompts-video_export-codec-placeholder = Select the video encoding. +prompts-video_export-codec-vp9-label = vp9 (.webm) +prompts-video_export-crf-label = CRF +prompts-video_export-crf-description = Enter constant rate factor you want to encode as. +prompts-video_export-pixel_format-label = Pixel Format +prompts-video_export-pixel_format-placeholder = Select the encoded pixel format. +prompts-video_export-pixel_format-yuv420p-label = yuv420p +prompts-video_export-dismiss-label = Dismiss +prompts-video_export-submit-label = Export -ui-prompt-form-frames-export-title = Export Frames -ui-prompt-form-frames-export-start-label = Starting Frame -ui-prompt-form-frames-export-start-description = Enter the first frame you want to export. -ui-prompt-form-frames-export-end-label = Ending Frame -ui-prompt-form-frames-export-end-description = Enter the last frame you want to export. +prompts-workspace_new-label = New Workspace +prompts-workspace_new-name-label = Name +prompts-workspace_new-name-description = Enter an alphanumeric name for the Workspace. +prompts-workspace_new-dismiss-label = Dismiss +prompts-workspace_new-submit-label = Create Workspace -ui-prompt-form-video-export-title = Export Video -ui-prompt-form-video-export-start-label = Starting Frame -ui-prompt-form-video-export-start-description = Enter the first frame you want to export. -ui-prompt-form-video-export-end-label = Ending Frame -ui-prompt-form-video-export-end-description = Enter the last frame you want to export. -ui-prompt-form-video-export-codec-label = Codec -ui-prompt-form-video-export-codec-placeholder = Select the video encoding. -ui-prompt-form-video-export-codec-vp9-label = vp9 (.webm) -ui-prompt-form-video-export-crf-label = CRF -ui-prompt-form-video-export-crf-description = Enter constant rate factor you want to encode as. -ui-prompt-form-video-export-pixel_format-label = Pixel Format -ui-prompt-form-video-export-pixel_format-placeholder = Select the encoded pixel format. -ui-prompt-form-video-export-pixel_format-yuv420p-label = yuv420p - -ui-prompt-form-workspace-new-title = New Workspace -ui-prompt-form-workspace-new-name-label = Name -ui-prompt-form-workspace-new-name-description = Enter an alphanumeric name for the Workspace. +view-dashboard-brand-label = Svelte-In-Motion +view-dashboard-start-label = Start +view-dashboard-new_workspace-label = New Workspace +view-dashboard-new_workspace_from_template-label = New Workspace from Template +view-dashboard-open_recent_workspace-label = Open Recent Workspace +view-dashboard-recent-label = Recent +view-dashboard-more-label = ...More diff --git a/packages/@svelte-in-motion-editor/src/components/form/FormBoolean.svelte b/packages/@svelte-in-motion-editor/src/components/form/FormBoolean.svelte index 821a76c..a826a35 100644 --- a/packages/@svelte-in-motion-editor/src/components/form/FormBoolean.svelte +++ b/packages/@svelte-in-motion-editor/src/components/form/FormBoolean.svelte @@ -2,32 +2,36 @@ import {Form, Spacer, Stack, Switch} from "@kahi-ui/framework"; import type {TypeBoolean, TypePropertySignature} from "@svelte-in-motion/type"; - import {metaAnnotation, resolveMetaLiteral} from "@svelte-in-motion/type"; + import {format_dash_case, format_snake_case} from "@svelte-in-motion/utilities"; import {CONTEXT_APP} from "../../lib/app"; const {translations} = CONTEXT_APP.get()!; - export let identifier: string; export let type: TypeBoolean; export let signature: TypePropertySignature; export let value: boolean = false; - $: meta = metaAnnotation.getAnnotations(type); + $: form_identifier = `prompts-${format_dash_case( + signature.parent.typeName! + )}-${format_dash_case(signature.name.toString())}`; + $: translation_identifier = `prompts-${format_snake_case( + signature.parent.typeName! + )}-${format_snake_case(signature.name.toString())}`; - $: description = resolveMetaLiteral(meta, "description"); - $: label = resolveMetaLiteral(meta, "label"); + $: description = `${translation_identifier}-description`; + $: label = `${translation_identifier}-label`; - + {#if description || label} - {#if label} + {#if $translations.has(label)} {$translations.format(label)} {/if} - {#if description} + {#if $translations.has(description)} {$translations.format(description)} diff --git a/packages/@svelte-in-motion-editor/src/components/form/FormNumber.svelte b/packages/@svelte-in-motion-editor/src/components/form/FormNumber.svelte index ad8c6a5..4bc5975 100644 --- a/packages/@svelte-in-motion-editor/src/components/form/FormNumber.svelte +++ b/packages/@svelte-in-motion-editor/src/components/form/FormNumber.svelte @@ -3,23 +3,31 @@ import type {TypeNumber, TypePropertySignature} from "@svelte-in-motion/type"; import { - metaAnnotation, - resolveMetaLiteral, resolveValidationLiteral, validationAnnotation, validates, } from "@svelte-in-motion/type"; + import {format_dash_case, format_snake_case} from "@svelte-in-motion/utilities"; import {CONTEXT_APP} from "../../lib/app"; const {translations} = CONTEXT_APP.get()!; - export let identifier: string; export let type: TypeNumber; export let signature: TypePropertySignature; export let value: number = 0; - $: meta = metaAnnotation.getAnnotations(type); + $: form_identifier = `prompts-${format_dash_case( + signature.parent.typeName! + )}-${format_dash_case(signature.name.toString())}`; + $: translation_identifier = `prompts-${format_snake_case( + signature.parent.typeName! + )}-${format_snake_case(signature.name.toString())}`; + + $: description = `${translation_identifier}-description`; + $: label = `${translation_identifier}-label`; + $: placeholder = `${translation_identifier}-placeholder`; + $: validations = validationAnnotation.getAnnotations(type); $: max = resolveValidationLiteral(validations, "maximum"); @@ -28,22 +36,18 @@ $: required = !signature.optional; $: readonly = signature.readonly; - $: description = resolveMetaLiteral(meta, "description"); - $: label = resolveMetaLiteral(meta, "label"); - $: placeholder = resolveMetaLiteral(meta, "placeholder"); - $: is_valid = validates(value, type); - - {#if label} + + {#if $translations.has(label)} {$translations.format(label)} {/if} - {#if description} + {#if $translations.has(description)} {$translations.format(description)} diff --git a/packages/@svelte-in-motion-editor/src/components/form/FormRender.svelte b/packages/@svelte-in-motion-editor/src/components/form/FormRender.svelte index 552c50c..4ae7a0e 100644 --- a/packages/@svelte-in-motion-editor/src/components/form/FormRender.svelte +++ b/packages/@svelte-in-motion-editor/src/components/form/FormRender.svelte @@ -76,7 +76,6 @@ - - {#if label} + + {#if $translations.has(label)} {$translations.format(label)} {/if} - {#if description} + {#if $translations.has(description)} {$translations.format(description)} diff --git a/packages/@svelte-in-motion-editor/src/components/form/FormUnion.svelte b/packages/@svelte-in-motion-editor/src/components/form/FormUnion.svelte index 0c3a309..c7dfe45 100644 --- a/packages/@svelte-in-motion-editor/src/components/form/FormUnion.svelte +++ b/packages/@svelte-in-motion-editor/src/components/form/FormUnion.svelte @@ -3,8 +3,8 @@ import {DataSelect, Form} from "@kahi-ui/framework"; import type {TypeLiteral, TypePropertySignature, TypeUnion} from "@svelte-in-motion/type"; - import {metaAnnotation, resolveMetaLiteral, validates} from "@svelte-in-motion/type"; - import {format_dash_case, replace_tokens} from "@svelte-in-motion/utilities"; + import {validates} from "@svelte-in-motion/type"; + import {format_dash_case, format_snake_case} from "@svelte-in-motion/utilities"; import {CONTEXT_APP} from "../../lib/app"; @@ -12,24 +12,31 @@ const {translations} = CONTEXT_APP.get()!; - export let identifier: string; export let type: TypeUnion; export let signature: TypePropertySignature; export let value: string = ""; - $: meta = metaAnnotation.getAnnotations(type); + $: form_identifier = `prompts-${format_dash_case( + signature.parent.typeName! + )}-${format_dash_case(signature.name.toString())}`; + $: translation_identifier = `prompts-${format_snake_case( + signature.parent.typeName! + )}-${format_snake_case(signature.name.toString())}`; - $: namespace = resolveMetaLiteral(meta, "namespace"); + $: description = `${translation_identifier}-description`; + $: label = `${translation_identifier}-label`; + $: placeholder = `${translation_identifier}-placeholder`; $: items = ( type.types.filter((type) => type.kind === ReflectionKind.literal) as TypeLiteral[] ).map((type) => { - if (namespace) { - const identifier = format_dash_case(type.literal as string); - const translation = replace_tokens(namespace, {identifier}); + const type_identifier = `${translation_identifier}-${format_dash_case( + type.literal as string + )}-label`; + if ($translations.has(type_identifier)) { return { - text: $translations.format(translation), + text: $translations.format(type_identifier), id: type.literal as string, palette: "accent" as PROPERTY_PALETTE, }; @@ -42,28 +49,24 @@ }; }); - $: description = resolveMetaLiteral(meta, "description"); - $: label = resolveMetaLiteral(meta, "label"); - $: placeholder = resolveMetaLiteral(meta, "placeholder"); - $: is_valid = validates(value, type); - - {#if label} + + {#if $translations.has(label)} {$translations.format(label)} {/if} - {#if description} + {#if $translations.has(description)} {$translations.format(description)} diff --git a/packages/@svelte-in-motion-editor/src/components/prompts/AboutPrompt.svelte b/packages/@svelte-in-motion-editor/src/components/prompts/AboutPrompt.svelte index c271e87..b371f2d 100755 --- a/packages/@svelte-in-motion-editor/src/components/prompts/AboutPrompt.svelte +++ b/packages/@svelte-in-motion-editor/src/components/prompts/AboutPrompt.svelte @@ -28,7 +28,7 @@ - {$translations.format("ui-prompt-about-version-label")} + {$translations.format("prompts-about-version-label")} v{APPLICATION_VERSION} @@ -36,7 +36,7 @@ - {$translations.format("ui-prompt-about-source-label")} + {$translations.format("prompts-about-source-label")} diff --git a/packages/@svelte-in-motion-editor/src/components/prompts/AlertPrompt.svelte b/packages/@svelte-in-motion-editor/src/components/prompts/AlertPrompt.svelte index b37167f..f06abab 100644 --- a/packages/@svelte-in-motion-editor/src/components/prompts/AlertPrompt.svelte +++ b/packages/@svelte-in-motion-editor/src/components/prompts/AlertPrompt.svelte @@ -16,7 +16,7 @@ const dispatch = createEventDispatcher(); - export let text: string; + export let namespace: string; function on_dismiss_click(event: MouseEvent): void { dispatch("reject", { @@ -27,12 +27,12 @@ - {$translations.format(text)} + {$translations.format(`prompts-${namespace}-description`)} diff --git a/packages/@svelte-in-motion-editor/src/components/prompts/ConfirmPrompt.svelte b/packages/@svelte-in-motion-editor/src/components/prompts/ConfirmPrompt.svelte index 27e424d..00b9e50 100644 --- a/packages/@svelte-in-motion-editor/src/components/prompts/ConfirmPrompt.svelte +++ b/packages/@svelte-in-motion-editor/src/components/prompts/ConfirmPrompt.svelte @@ -14,11 +14,11 @@ reject: CustomEvent; }; - const {prompts, translations} = CONTEXT_APP.get()!; + const {translations} = CONTEXT_APP.get()!; const dispatch = createEventDispatcher(); - export let text: string; + export let namespace: string; function on_dismiss_click(event: MouseEvent): void { dispatch("reject", { @@ -33,18 +33,16 @@ - {$translations.format(text)} + {$translations.format(`prompts-${namespace}-description`)} - {#if $prompts?.is_dismissible} - - {/if} + diff --git a/packages/@svelte-in-motion-editor/src/components/prompts/FormPrompt.svelte b/packages/@svelte-in-motion-editor/src/components/prompts/FormPrompt.svelte index 08e205a..8c84fe2 100644 --- a/packages/@svelte-in-motion-editor/src/components/prompts/FormPrompt.svelte +++ b/packages/@svelte-in-motion-editor/src/components/prompts/FormPrompt.svelte @@ -4,7 +4,7 @@ import type {TypeObjectLiteral} from "@svelte-in-motion/type"; import {validates} from "@svelte-in-motion/type"; - import {PromptDismissError} from "@svelte-in-motion/utilities"; + import {PromptDismissError, format_snake_case} from "@svelte-in-motion/utilities"; import type {IFormPromptEvent, IPromptRejectEvent} from "../../lib/stores/prompts"; @@ -40,6 +40,8 @@ }); } + $: translation_identifier = `prompts-${format_snake_case(type.typeName!)}`; + $: is_valid = validates(model, type); @@ -56,7 +58,7 @@ {#if $prompts?.is_dismissible} {/if} @@ -67,6 +69,6 @@ disabled={!is_valid} on:click={on_submit} > - {$translations.format("ui-prompt-form-submit-label")} + {$translations.format(`${translation_identifier}-submit-label`)} diff --git a/packages/@svelte-in-motion-editor/src/lib/stores/prompts.ts b/packages/@svelte-in-motion-editor/src/lib/stores/prompts.ts index df0db4b..3e3026a 100755 --- a/packages/@svelte-in-motion-editor/src/lib/stores/prompts.ts +++ b/packages/@svelte-in-motion-editor/src/lib/stores/prompts.ts @@ -10,6 +10,7 @@ import {writable} from "svelte/store"; import type {ClassProperties, Type} from "@svelte-in-motion/type"; import type {IEvent} from "@svelte-in-motion/utilities"; +import {format_snake_case} from "@svelte-in-motion/utilities"; import {event} from "@svelte-in-motion/utilities"; import AboutPrompt from "../../components/prompts/AboutPrompt.svelte"; @@ -19,25 +20,21 @@ import FormPrompt from "../../components/prompts/FormPrompt.svelte"; import LoaderPrompt from "../../components/prompts/LoaderPrompt.svelte"; import SearchPrompt from "../../components/prompts/SearchPrompt.svelte"; -export interface ICommonPromptProps { - is_dismissible?: boolean; - - title?: string; -} - -export interface IAlertPromptProps extends Omit { - text: string; +export interface IAlertPromptProps { + namespace: string; } -export interface IConfirmPromptProps extends ICommonPromptProps { - text: string; +export interface IConfirmPromptProps { + namespace: string; } export interface IFormPromptEvent { model: ClassProperties; } -export interface IFormPromptProps extends ICommonPromptProps { +export interface IFormPromptProps { + is_dismissible?: boolean; + model?: Partial>; type: Type; @@ -51,7 +48,7 @@ export interface ISearchPromptEvent { identifier: string; } -export interface ISearchPromptProps extends ICommonPromptProps { +export interface ISearchPromptProps { badge?: string; description?: string; @@ -60,6 +57,8 @@ export interface ISearchPromptProps extends ICommonPromptProps { identifier: string; + is_dismissible?: boolean; + index: string[]; label: string; @@ -79,7 +78,7 @@ export interface IPromptRejectEvent { error: Error; } -export interface IPrompt> extends ICommonPromptProps { +export interface IPrompt> { Component: typeof SvelteComponent; alignment_x?: PROPERTY_ALIGNMENT_X_BREAKPOINT; @@ -93,6 +92,10 @@ export interface IPrompt> extends ICommonPromptPro height?: PROPERTY_SIZE_BREAKPOINT; width?: PROPERTY_SIZE_BREAKPOINT; + is_dismissible?: boolean; + + title?: string; + props?: T; } @@ -163,7 +166,7 @@ export function prompts(): IPromptsStore { Component: AboutPrompt, is_dismissible: true, - title: "ui-prompt-about-title", + title: "prompts-about-label", }); }, @@ -172,7 +175,7 @@ export function prompts(): IPromptsStore { Component: AlertPrompt, is_dismissible: true, - title: props.title, + title: `prompts-${props.namespace}-label`, props, }); }, @@ -181,8 +184,8 @@ export function prompts(): IPromptsStore { return prompt({ Component: ConfirmPrompt, - is_dismissible: props.is_dismissible, - title: props.title, + is_dismissible: true, + title: `prompts-${props.namespace}-label`, props, }); }, @@ -192,7 +195,7 @@ export function prompts(): IPromptsStore { Component: FormPrompt, is_dismissible: props.is_dismissible, - title: props.title, + title: `prompts-${format_snake_case(props.type.typeName!)}-label`, props, }); }, @@ -213,7 +216,6 @@ export function prompts(): IPromptsStore { width: "prose", is_dismissible: props.is_dismissible, - title: props.title, props, }); }, diff --git a/packages/@svelte-in-motion-editor/src/routes/dashboard.svelte b/packages/@svelte-in-motion-editor/src/routes/dashboard.svelte index ede1e7b..4805f0a 100644 --- a/packages/@svelte-in-motion-editor/src/routes/dashboard.svelte +++ b/packages/@svelte-in-motion-editor/src/routes/dashboard.svelte @@ -62,21 +62,21 @@ padding_x="massive" > - {$translations.format("ui-view-dashboard-brand-label")} + {$translations.format("view-dashboard-brand-label")}
- {$translations.format("ui-view-dashboard-start-label")} + {$translations.format("view-dashboard-start-label")} - {$translations.format("ui-view-dashboard-new_workspace-label")} + {$translations.format("view-dashboard-new_workspace-label")} - {$translations.format("ui-view-dashboard-new_workspace_from_template-label")} + {$translations.format("view-dashboard-new_workspace_from_template-label")}
@@ -84,7 +84,7 @@ {#if recent_workspaces.length > 0}
- {$translations.format("ui-view-dashboard-recent-label")} + {$translations.format("view-dashboard-recent-label")} @@ -115,7 +115,7 @@ max_width="content-max" on:click={on_recent_click} > - {$translations.format("ui-view-dashboard-more-label")} + {$translations.format("view-dashboard-more-label")} {/if} diff --git a/packages/@svelte-in-motion-extension/src/types.ts b/packages/@svelte-in-motion-extension/src/types.ts index bb6e71f..2b8642f 100644 --- a/packages/@svelte-in-motion-extension/src/types.ts +++ b/packages/@svelte-in-motion-extension/src/types.ts @@ -45,7 +45,6 @@ export type { } from "@svelte-in-motion/editor/src/lib/stores/notifications"; export type { IAlertPromptProps, - ICommonPromptProps, IConfirmPromptProps, ILoaderPromptProps, IFormPromptEvent,