@agent-native/core 0.102.1 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +15 -0
- package/corpus/core/docs/content/local-file-mode.mdx +99 -489
- package/corpus/core/docs/content/locales/ar-SA/local-file-mode.mdx +35 -490
- package/corpus/core/docs/content/locales/ar-SA/template-content.mdx +10 -24
- package/corpus/core/docs/content/locales/de-DE/local-file-mode.mdx +37 -491
- package/corpus/core/docs/content/locales/de-DE/template-content.mdx +10 -24
- package/corpus/core/docs/content/locales/es-ES/local-file-mode.mdx +35 -493
- package/corpus/core/docs/content/locales/es-ES/template-content.mdx +10 -24
- package/corpus/core/docs/content/locales/fr-FR/local-file-mode.mdx +38 -491
- package/corpus/core/docs/content/locales/fr-FR/template-content.mdx +10 -24
- package/corpus/core/docs/content/locales/hi-IN/local-file-mode.mdx +33 -492
- package/corpus/core/docs/content/locales/hi-IN/template-content.mdx +10 -24
- package/corpus/core/docs/content/locales/ja-JP/local-file-mode.mdx +36 -492
- package/corpus/core/docs/content/locales/ja-JP/template-content.mdx +10 -24
- package/corpus/core/docs/content/locales/ko-KR/local-file-mode.mdx +35 -490
- package/corpus/core/docs/content/locales/ko-KR/template-content.mdx +10 -24
- package/corpus/core/docs/content/locales/pt-BR/local-file-mode.mdx +35 -493
- package/corpus/core/docs/content/locales/pt-BR/template-content.mdx +10 -24
- package/corpus/core/docs/content/locales/zh-CN/local-file-mode.mdx +31 -489
- package/corpus/core/docs/content/locales/zh-CN/template-content.mdx +9 -24
- package/corpus/core/docs/content/locales/zh-TW/local-file-mode.mdx +31 -489
- package/corpus/core/docs/content/locales/zh-TW/template-content.mdx +9 -24
- package/corpus/core/docs/content/template-content.mdx +26 -42
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/content-local.ts +86 -18
- package/corpus/core/src/cli/index.ts +2 -2
- package/corpus/core/src/cli/skills-content/content-skill.ts +36 -25
- package/corpus/core/src/cli/skills.ts +47 -13
- package/corpus/core/src/client/AgentPanel.tsx +7 -0
- package/corpus/core/src/client/AssistantChat.tsx +7 -0
- package/corpus/core/src/client/agent-chat-adapter.ts +7 -1
- package/corpus/core/src/client/chat/message-components.tsx +17 -3
- package/corpus/core/src/client/composer/ComposerPlusMenu.tsx +96 -6
- package/corpus/core/src/client/composer/asset-picker-url.ts +80 -0
- package/corpus/core/src/client/error-format.ts +24 -0
- package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +8 -1
- package/corpus/core/src/local-artifacts/index.ts +65 -0
- package/corpus/templates/assets/app/components/library/GenerationPresetsPanel.tsx +325 -0
- package/corpus/templates/assets/app/hooks/use-navigation-state.ts +12 -0
- package/corpus/templates/assets/app/i18n/zh-TW.ts +21 -0
- package/corpus/templates/assets/app/i18n-data.ts +215 -0
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +19 -479
- package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +1 -1
- package/corpus/templates/assets/app/routes/brand-kits.$id_.settings.tsx +446 -0
- package/corpus/templates/assets/app/routes/library.tsx +69 -0
- package/corpus/templates/assets/changelog/2026-07-15-fixed-top-level-image-picker-selections-returning-to-the-com.md +6 -0
- package/corpus/templates/clips/actions/disconnect-calendar.ts +57 -9
- package/corpus/templates/clips/actions/generate-workflow.ts +102 -59
- package/corpus/templates/clips/actions/get-recording-player-data.ts +64 -1
- package/corpus/templates/clips/actions/regenerate-summary.ts +7 -0
- package/corpus/templates/clips/actions/regenerate-title.ts +29 -11
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +34 -13
- package/corpus/templates/clips/app/components/editor/thumbnail-picker.tsx +87 -9
- package/corpus/templates/clips/app/components/editor/trim-handles.tsx +15 -0
- package/corpus/templates/clips/app/components/editor/waveform.tsx +21 -8
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +52 -0
- package/corpus/templates/clips/app/components/player/settings-panel.tsx +116 -58
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +43 -37
- package/corpus/templates/clips/app/components/player/video-player.tsx +50 -2
- package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +22 -3
- package/corpus/templates/clips/app/i18n/ar-SA.ts +5 -2
- package/corpus/templates/clips/app/i18n/de-DE.ts +6 -2
- package/corpus/templates/clips/app/i18n/en-US.ts +5 -2
- package/corpus/templates/clips/app/i18n/es-ES.ts +6 -2
- package/corpus/templates/clips/app/i18n/fr-FR.ts +5 -2
- package/corpus/templates/clips/app/i18n/hi-IN.ts +5 -2
- package/corpus/templates/clips/app/i18n/ja-JP.ts +6 -1
- package/corpus/templates/clips/app/i18n/ko-KR.ts +5 -2
- package/corpus/templates/clips/app/i18n/pt-BR.ts +6 -2
- package/corpus/templates/clips/app/i18n/zh-CN.ts +5 -2
- package/corpus/templates/clips/app/i18n/zh-TW.ts +5 -2
- package/corpus/templates/clips/app/lib/timestamp-mapping.ts +14 -0
- package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -2
- package/corpus/templates/clips/app/routes/_index.tsx +1 -2
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +98 -32
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +4 -1
- package/corpus/templates/clips/changelog/2026-07-15-ai-workflow-generation-now-stays-visible-avoids-duplicate-re.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-clip-playback-and-cta-controls-remain-interactive-through-ed.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-clip-titles-no-longer-describe-the-product-as-a-loom-alterna.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-description-regeneration-now-opens-the-agent-chat-so-progres.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-direct-recording-urls-now-respect-share-link-and-password-ac.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-disconnecting-a-calendar-now-clears-unrecorded-synced-meetin.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-folders-now-expose-rename-and-delete-actions-directly-in-the.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-recording-pages-now-explain-sign-in-access-and-avoid-showing.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-the-clips-extension-quick-actions-toolbar-can-be-moved-out-o.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-the-editor-now-skips-cut-sections-during-preview-and-keeps-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-thumbnail-capture-now-updates-previews-while-scrubbing-and-l.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-windows-permission-links-open-the-matching-settings-page.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/content-script.ts +117 -2
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +27 -0
- package/corpus/templates/clips/desktop/src-tauri/tauri.conf.json +1 -1
- package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +139 -101
- package/corpus/templates/clips/server/lib/recording-page-access.ts +35 -0
- package/corpus/templates/clips/server/lib/share-password.ts +6 -3
- package/corpus/templates/content/.agents/skills/content/SKILL.md +26 -39
- package/corpus/templates/content/AGENTS.md +25 -30
- package/corpus/templates/content/actions/_builder-docs-client.ts +23 -0
- package/corpus/templates/content/actions/_content-database-source-adapters.ts +21 -3
- package/corpus/templates/content/actions/_content-files.ts +338 -0
- package/corpus/templates/content/actions/_content-space-access.ts +135 -0
- package/corpus/templates/content/actions/_content-spaces.ts +640 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +90 -7
- package/corpus/templates/content/actions/_database-utils.ts +7 -1
- package/corpus/templates/content/actions/_local-file-documents.ts +0 -9
- package/corpus/templates/content/actions/_local-folder-source.ts +53 -0
- package/corpus/templates/content/actions/_property-utils.ts +9 -4
- package/corpus/templates/content/actions/add-database-item.ts +108 -65
- package/corpus/templates/content/actions/backfill-content-files.ts +22 -0
- package/corpus/templates/content/actions/connect-local-folder-source.ts +221 -0
- package/corpus/templates/content/actions/create-content-database.ts +129 -3
- package/corpus/templates/content/actions/create-document.ts +65 -55
- package/corpus/templates/content/actions/create-inline-content-database.ts +6 -1
- package/corpus/templates/content/actions/delete-content-database.ts +3 -0
- package/corpus/templates/content/actions/delete-document.ts +7 -11
- package/corpus/templates/content/actions/disconnect-local-folder-source.ts +175 -0
- package/corpus/templates/content/actions/duplicate-database-item.ts +10 -0
- package/corpus/templates/content/actions/duplicate-database-items.ts +13 -0
- package/corpus/templates/content/actions/edit-document.ts +2 -28
- package/corpus/templates/content/actions/ensure-content-spaces.ts +26 -0
- package/corpus/templates/content/actions/export-content-source.ts +47 -9
- package/corpus/templates/content/actions/get-document.ts +0 -14
- package/corpus/templates/content/actions/import-content-source.ts +43 -3
- package/corpus/templates/content/actions/list-content-spaces.ts +103 -0
- package/corpus/templates/content/actions/list-documents.ts +12 -9
- package/corpus/templates/content/actions/move-document.ts +3 -14
- package/corpus/templates/content/actions/pull-document.ts +0 -23
- package/corpus/templates/content/actions/remove-local-file-source.ts +50 -29
- package/corpus/templates/content/actions/resolve-local-folder-conflict.ts +442 -0
- package/corpus/templates/content/actions/reveal-local-source-file.ts +6 -17
- package/corpus/templates/content/actions/search-documents.ts +0 -34
- package/corpus/templates/content/actions/share-local-file-document.ts +25 -1
- package/corpus/templates/content/actions/submit-content-database-form.ts +12 -0
- package/corpus/templates/content/actions/sync-local-folder-source.ts +731 -0
- package/corpus/templates/content/actions/sync-manifest-local-folder-source.ts +123 -0
- package/corpus/templates/content/actions/update-content-database-view.ts +10 -1
- package/corpus/templates/content/actions/update-document.ts +0 -15
- package/corpus/templates/content/actions/view-screen.ts +2 -50
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +76 -62
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +70 -22
- package/corpus/templates/content/app/components/editor/database/grouping.ts +2 -1
- package/corpus/templates/content/app/components/editor/database/settings.tsx +23 -20
- package/corpus/templates/content/app/components/editor/database/shared.tsx +2 -0
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +330 -0
- package/corpus/templates/content/app/components/editor/database/types.ts +1 -0
- package/corpus/templates/content/app/components/editor/database/view-config.ts +3 -1
- package/corpus/templates/content/app/components/layout/Layout.tsx +25 -1
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +209 -113
- package/corpus/templates/content/app/components/sidebar/select-content-space.ts +31 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +16 -0
- package/corpus/templates/content/app/hooks/use-content-spaces.ts +39 -0
- package/corpus/templates/content/app/i18n/zh-TW.ts +11 -0
- package/corpus/templates/content/app/i18n-data.ts +75 -0
- package/corpus/templates/content/app/routes/_app.local-files.tsx +174 -65
- package/corpus/templates/content/changelog/2026-07-16-content-callouts-can-now-be-reviewed-and-published-to-builder.md +6 -0
- package/corpus/templates/content/changelog/2026-07-16-heading-5-and-heading-6-are-available-from-the-editor-slash-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-16-organize-every-workspace-through-a-customizable-files-databa.md +6 -0
- package/corpus/templates/content/parity/matrix.md +2 -1
- package/corpus/templates/content/parity/matrix.ts +37 -1
- package/corpus/templates/content/scripts/dev-database.mjs +7 -5
- package/corpus/templates/content/server/db/schema.ts +113 -40
- package/corpus/templates/content/server/lib/document-context.ts +15 -1
- package/corpus/templates/content/server/lib/notion-sync.ts +6 -0
- package/corpus/templates/content/server/plugins/db.ts +153 -0
- package/corpus/templates/content/shared/api.ts +17 -3
- package/corpus/templates/content/shared/builder-mdx.ts +163 -16
- package/corpus/templates/design/.agents/skills/design-templates/SKILL.md +59 -0
- package/corpus/templates/design/AGENTS.md +6 -1
- package/corpus/templates/design/actions/create-design-from-template.ts +19 -7
- package/corpus/templates/design/actions/list-design-templates.ts +69 -21
- package/corpus/templates/design/actions/navigate.ts +2 -2
- package/corpus/templates/design/actions/view-screen.ts +15 -2
- package/corpus/templates/design/agent-native.app-skill.json +5 -0
- package/corpus/templates/design/app/components/design/design-canvas/external-preview.ts +7 -3
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +281 -56
- package/corpus/templates/design/app/components/templates/TemplatePreview.tsx +14 -2
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +3 -2
- package/corpus/templates/design/app/i18n/zh-TW.ts +3 -3
- package/corpus/templates/design/app/i18n-data.ts +21 -2
- package/corpus/templates/design/app/i18n-template-feature.ts +218 -10
- package/corpus/templates/design/app/pages/Index.tsx +195 -24
- package/corpus/templates/design/app/pages/Templates.tsx +144 -55
- package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +12 -1
- package/corpus/templates/design/changelog/2026-07-14-templates-now-appear-in-the-new-design-picker-with-previews-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-15-prototype-print-and-download-buttons-now-work-in-preview.md +6 -0
- package/corpus/templates/design/changelog/2026-07-15-templates-now-open-immediately-after-copying-even-while-the-.md +6 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/mail/AGENTS.md +23 -18
- package/corpus/templates/mail/actions/bulk-archive.ts +32 -28
- package/corpus/templates/mail/actions/mark-read.ts +131 -20
- package/corpus/templates/mail/actions/mark-thread-read.ts +1 -1
- package/corpus/templates/mail/actions/move-email.ts +30 -24
- package/corpus/templates/mail/actions/send-email.ts +73 -68
- package/corpus/templates/mail/changelog/2026-07-15-unread-inbox-cleanup-now-completes-reliably.md +6 -0
- package/corpus/templates/mail/server/handlers/emails.ts +218 -209
- package/corpus/templates/mail/server/lib/bulk-mark-read.ts +30 -0
- package/corpus/templates/mail/server/lib/email-state.ts +198 -113
- package/corpus/templates/mail/server/lib/google-auth.ts +218 -25
- package/corpus/templates/mail/server/lib/jobs.ts +69 -74
- package/corpus/templates/mail/server/lib/local-email-store.ts +265 -0
- package/corpus/templates/mail/server/plugins/agent-chat.ts +6 -0
- package/corpus/templates/slides/actions/extract-pdf.ts +1 -1
- package/corpus/templates/slides/actions/import-file.ts +4 -1
- package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +9 -12
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +29 -21
- package/corpus/templates/slides/app/i18n/ar-SA.ts +1 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +1 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +1 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +1 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +1 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +1 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +1 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +1 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +1 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/slides/changelog/2026-07-15-image-search-and-generation-controls-now-use-the-registered-.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-15-pdf-deck-references-can-be-imported-for-slide-inspiration-ag.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-15-stable-style-inspector-dock.md +6 -0
- package/dist/cli/content-local.d.ts +1 -0
- package/dist/cli/content-local.d.ts.map +1 -1
- package/dist/cli/content-local.js +75 -17
- package/dist/cli/content-local.js.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/skills-content/content-skill.d.ts +1 -1
- package/dist/cli/skills-content/content-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/content-skill.js +36 -25
- package/dist/cli/skills-content/content-skill.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +47 -14
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +5 -0
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +7 -0
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +8 -1
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +4 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +10 -3
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/composer/ComposerPlusMenu.d.ts.map +1 -1
- package/dist/client/composer/ComposerPlusMenu.js +58 -6
- package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
- package/dist/client/composer/asset-picker-url.d.ts +16 -0
- package/dist/client/composer/asset-picker-url.d.ts.map +1 -0
- package/dist/client/composer/asset-picker-url.js +64 -0
- package/dist/client/composer/asset-picker-url.js.map +1 -0
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +17 -0
- package/dist/client/error-format.js.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.js +6 -1
- package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/local-artifacts/index.d.ts +10 -0
- package/dist/local-artifacts/index.d.ts.map +1 -1
- package/dist/local-artifacts/index.js +39 -0
- package/dist/local-artifacts/index.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/docs/content/local-file-mode.mdx +99 -489
- package/docs/content/locales/ar-SA/local-file-mode.mdx +35 -490
- package/docs/content/locales/ar-SA/template-content.mdx +10 -24
- package/docs/content/locales/de-DE/local-file-mode.mdx +37 -491
- package/docs/content/locales/de-DE/template-content.mdx +10 -24
- package/docs/content/locales/es-ES/local-file-mode.mdx +35 -493
- package/docs/content/locales/es-ES/template-content.mdx +10 -24
- package/docs/content/locales/fr-FR/local-file-mode.mdx +38 -491
- package/docs/content/locales/fr-FR/template-content.mdx +10 -24
- package/docs/content/locales/hi-IN/local-file-mode.mdx +33 -492
- package/docs/content/locales/hi-IN/template-content.mdx +10 -24
- package/docs/content/locales/ja-JP/local-file-mode.mdx +36 -492
- package/docs/content/locales/ja-JP/template-content.mdx +10 -24
- package/docs/content/locales/ko-KR/local-file-mode.mdx +35 -490
- package/docs/content/locales/ko-KR/template-content.mdx +10 -24
- package/docs/content/locales/pt-BR/local-file-mode.mdx +35 -493
- package/docs/content/locales/pt-BR/template-content.mdx +10 -24
- package/docs/content/locales/zh-CN/local-file-mode.mdx +31 -489
- package/docs/content/locales/zh-CN/template-content.mdx +9 -24
- package/docs/content/locales/zh-TW/local-file-mode.mdx +31 -489
- package/docs/content/locales/zh-TW/template-content.mdx +9 -24
- package/docs/content/template-content.mdx +26 -42
- package/package.json +1 -1
- package/corpus/templates/assets/app/components/library/EditLibraryDialog.tsx +0 -126
|
@@ -8,17 +8,30 @@ import {
|
|
|
8
8
|
EmbeddedApp,
|
|
9
9
|
type EmbeddedAppRef,
|
|
10
10
|
} from "@agent-native/core/embedding/react";
|
|
11
|
+
import {
|
|
12
|
+
Command,
|
|
13
|
+
CommandEmpty,
|
|
14
|
+
CommandGroup,
|
|
15
|
+
CommandInput,
|
|
16
|
+
CommandItem,
|
|
17
|
+
CommandList,
|
|
18
|
+
} from "@agent-native/toolkit/ui/command";
|
|
11
19
|
import {
|
|
12
20
|
IconApps,
|
|
21
|
+
IconCheck,
|
|
22
|
+
IconChevronDown,
|
|
13
23
|
IconPalette,
|
|
14
24
|
IconPhoto,
|
|
15
25
|
IconPlus,
|
|
26
|
+
IconTemplate,
|
|
16
27
|
IconUpload,
|
|
17
28
|
IconX,
|
|
18
29
|
} from "@tabler/icons-react";
|
|
19
30
|
import { useState, useEffect, useCallback, useRef } from "react";
|
|
20
31
|
import { toast } from "sonner";
|
|
21
32
|
|
|
33
|
+
import { TemplatePreview } from "@/components/templates/TemplatePreview";
|
|
34
|
+
import { Badge } from "@/components/ui/badge";
|
|
22
35
|
import { Button } from "@/components/ui/button";
|
|
23
36
|
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
|
|
24
37
|
import {
|
|
@@ -32,9 +45,14 @@ import {
|
|
|
32
45
|
SelectContent,
|
|
33
46
|
SelectItem,
|
|
34
47
|
SelectTrigger,
|
|
35
|
-
SelectValue,
|
|
36
48
|
} from "@/components/ui/select";
|
|
37
49
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
50
|
+
import {
|
|
51
|
+
Tooltip,
|
|
52
|
+
TooltipContent,
|
|
53
|
+
TooltipTrigger,
|
|
54
|
+
} from "@/components/ui/tooltip";
|
|
55
|
+
import { cn } from "@/lib/utils";
|
|
38
56
|
|
|
39
57
|
export interface UploadedFile {
|
|
40
58
|
path: string;
|
|
@@ -296,7 +314,9 @@ interface PromptPopoverProps {
|
|
|
296
314
|
onOpenChange: (open: boolean) => void;
|
|
297
315
|
title: string;
|
|
298
316
|
placeholder?: string;
|
|
299
|
-
|
|
317
|
+
/** Return false when the caller navigates and the popover must not issue a
|
|
318
|
+
* competing close-state navigation after the handoff completes. */
|
|
319
|
+
onSkip?: () => void | boolean | Promise<void | boolean>;
|
|
300
320
|
skipLabel?: string;
|
|
301
321
|
onSubmit: (
|
|
302
322
|
prompt: string,
|
|
@@ -311,6 +331,10 @@ interface PromptPopoverProps {
|
|
|
311
331
|
selectedDesignSystemId?: string | null;
|
|
312
332
|
onDesignSystemChange?: (id: string | null) => void;
|
|
313
333
|
onCreateDesignSystem?: () => void;
|
|
334
|
+
templateOptions?: PromptTemplateOption[];
|
|
335
|
+
templatesLoading?: boolean;
|
|
336
|
+
selectedTemplateId?: string | null;
|
|
337
|
+
onTemplateChange?: (id: string | null) => void;
|
|
314
338
|
/**
|
|
315
339
|
* "Design" (inline prototype, default) vs "Full app" (Builder Fusion cloud
|
|
316
340
|
* container). Omit both this and `onCreationModeChange` to hide the mode
|
|
@@ -338,12 +362,24 @@ export interface PromptDesignSystemOption {
|
|
|
338
362
|
isDefault?: boolean;
|
|
339
363
|
}
|
|
340
364
|
|
|
365
|
+
export interface PromptTemplateOption {
|
|
366
|
+
id: string;
|
|
367
|
+
title: string;
|
|
368
|
+
description?: string | null;
|
|
369
|
+
category?: string;
|
|
370
|
+
width?: number | null;
|
|
371
|
+
height?: number | null;
|
|
372
|
+
previewHtml?: string | null;
|
|
373
|
+
designSystemId?: string | null;
|
|
374
|
+
isBuiltIn: boolean;
|
|
375
|
+
}
|
|
376
|
+
|
|
341
377
|
function isNestedPromptPopoverTarget(target: EventTarget | null) {
|
|
342
378
|
return (
|
|
343
379
|
target instanceof Element &&
|
|
344
380
|
Boolean(
|
|
345
381
|
target.closest(
|
|
346
|
-
"[data-agent-native-composer-popover],[data-assets-picker-dialog],[data-agent-native-prompt-select]",
|
|
382
|
+
"[data-agent-native-composer-popover],[data-assets-picker-dialog],[data-agent-native-prompt-select],[data-agent-native-template-popover]",
|
|
347
383
|
),
|
|
348
384
|
)
|
|
349
385
|
);
|
|
@@ -371,7 +407,8 @@ function hasOpenNestedPromptPopoverSurface() {
|
|
|
371
407
|
document.querySelector(
|
|
372
408
|
'[data-agent-native-composer-popover][data-state="open"],' +
|
|
373
409
|
"[data-assets-picker-dialog]," +
|
|
374
|
-
'[data-agent-native-prompt-select][data-state="open"]'
|
|
410
|
+
'[data-agent-native-prompt-select][data-state="open"],' +
|
|
411
|
+
'[data-agent-native-template-popover][data-state="open"]',
|
|
375
412
|
),
|
|
376
413
|
);
|
|
377
414
|
}
|
|
@@ -392,6 +429,10 @@ export default function PromptPopover({
|
|
|
392
429
|
selectedDesignSystemId,
|
|
393
430
|
onDesignSystemChange,
|
|
394
431
|
onCreateDesignSystem,
|
|
432
|
+
templateOptions = [],
|
|
433
|
+
templatesLoading = false,
|
|
434
|
+
selectedTemplateId,
|
|
435
|
+
onTemplateChange,
|
|
395
436
|
creationMode,
|
|
396
437
|
onCreationModeChange,
|
|
397
438
|
draftScope,
|
|
@@ -403,6 +444,7 @@ export default function PromptPopover({
|
|
|
403
444
|
const [pickedAssets, setPickedAssets] = useState<UploadedFile[]>([]);
|
|
404
445
|
const [selectedUploadFiles, setSelectedUploadFiles] = useState<File[]>([]);
|
|
405
446
|
const [assetsPickerOpen, setAssetsPickerOpen] = useState(false);
|
|
447
|
+
const [templatePickerOpen, setTemplatePickerOpen] = useState(false);
|
|
406
448
|
// Restores a typed prompt into the composer after a failed submit. The
|
|
407
449
|
// composer optimistically clears its text as soon as onSubmit is invoked
|
|
408
450
|
// (see TiptapComposer.submitComposer), so without this an upload failure or
|
|
@@ -459,6 +501,7 @@ export default function PromptPopover({
|
|
|
459
501
|
useEffect(() => {
|
|
460
502
|
if (open) return;
|
|
461
503
|
setAssetsPickerOpen(false);
|
|
504
|
+
setTemplatePickerOpen(false);
|
|
462
505
|
setPickedAssets([]);
|
|
463
506
|
setSelectedUploadFiles([]);
|
|
464
507
|
// Only sticks for the session immediately following a failed submit; a
|
|
@@ -659,6 +702,9 @@ export default function PromptPopover({
|
|
|
659
702
|
},
|
|
660
703
|
},
|
|
661
704
|
}));
|
|
705
|
+
const selectedDesignSystem =
|
|
706
|
+
designSystems.find((system) => system.id === selectedDesignSystemId) ??
|
|
707
|
+
null;
|
|
662
708
|
|
|
663
709
|
return (
|
|
664
710
|
<Popover open={open} onOpenChange={handlePopoverOpenChange}>
|
|
@@ -718,6 +764,7 @@ export default function PromptPopover({
|
|
|
718
764
|
|
|
719
765
|
<div className="px-2 pb-2">
|
|
720
766
|
<PromptComposer
|
|
767
|
+
key={placeholder ?? t("home.describeBuild")}
|
|
721
768
|
autoFocus
|
|
722
769
|
attachmentsEnabled
|
|
723
770
|
disabled={loading || uploading}
|
|
@@ -738,58 +785,94 @@ export default function PromptPopover({
|
|
|
738
785
|
/>
|
|
739
786
|
</div>
|
|
740
787
|
|
|
741
|
-
{(onDesignSystemChange || onCreateDesignSystem) && (
|
|
742
|
-
<div className="
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
<
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
{
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
788
|
+
{(onTemplateChange || onDesignSystemChange || onCreateDesignSystem) && (
|
|
789
|
+
<div className="grid grid-cols-[minmax(0,1fr)_2.25rem] gap-2 border-t border-border px-3.5 py-2.5">
|
|
790
|
+
{onTemplateChange ? (
|
|
791
|
+
<>
|
|
792
|
+
<TemplatePickerControl
|
|
793
|
+
open={templatePickerOpen}
|
|
794
|
+
onOpenChange={setTemplatePickerOpen}
|
|
795
|
+
options={templateOptions}
|
|
796
|
+
loading={templatesLoading}
|
|
797
|
+
selectedId={selectedTemplateId ?? null}
|
|
798
|
+
onChange={onTemplateChange}
|
|
799
|
+
/>
|
|
800
|
+
<span aria-hidden="true" className="size-9" />
|
|
801
|
+
</>
|
|
802
|
+
) : null}
|
|
803
|
+
{onDesignSystemChange || onCreateDesignSystem ? (
|
|
804
|
+
<>
|
|
805
|
+
{designSystemsLoading ? (
|
|
806
|
+
<Skeleton className="h-9 w-full rounded-md" />
|
|
807
|
+
) : designSystems.length > 0 ? (
|
|
808
|
+
<Select
|
|
809
|
+
value={selectedDesignSystemId ?? "none"}
|
|
810
|
+
onValueChange={(value) =>
|
|
811
|
+
onDesignSystemChange?.(value === "none" ? null : value)
|
|
812
|
+
}
|
|
813
|
+
onOpenChange={(nextOpen) => {
|
|
814
|
+
if (!nextOpen) markNestedSelectJustClosed();
|
|
815
|
+
}}
|
|
816
|
+
>
|
|
817
|
+
<SelectTrigger className="h-9 min-w-0 justify-start gap-2 px-2.5 text-xs [&>svg:last-child]:ms-auto">
|
|
818
|
+
<IconPalette className="size-4 shrink-0 text-muted-foreground" />
|
|
819
|
+
<span
|
|
820
|
+
className="min-w-0 flex-1 truncate text-start"
|
|
821
|
+
title={
|
|
822
|
+
selectedDesignSystem?.title ??
|
|
823
|
+
t("promptDialog.noDesignSystem")
|
|
824
|
+
}
|
|
768
825
|
>
|
|
769
|
-
{
|
|
770
|
-
|
|
826
|
+
{selectedDesignSystem?.title ??
|
|
827
|
+
t("promptDialog.noDesignSystem")}
|
|
828
|
+
</span>
|
|
829
|
+
</SelectTrigger>
|
|
830
|
+
<SelectContent data-agent-native-prompt-select>
|
|
831
|
+
<SelectItem value="none" className="text-xs">
|
|
832
|
+
{t("promptDialog.noDesignSystem")}
|
|
771
833
|
</SelectItem>
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
834
|
+
{designSystems.map((system) => (
|
|
835
|
+
<SelectItem
|
|
836
|
+
key={system.id}
|
|
837
|
+
value={system.id}
|
|
838
|
+
className="text-xs"
|
|
839
|
+
>
|
|
840
|
+
{system.title}
|
|
841
|
+
</SelectItem>
|
|
842
|
+
))}
|
|
843
|
+
</SelectContent>
|
|
844
|
+
</Select>
|
|
845
|
+
) : (
|
|
846
|
+
<div className="flex h-9 min-w-0 items-center gap-2 rounded-md border border-input px-2.5 text-xs text-muted-foreground">
|
|
847
|
+
<IconPalette className="size-4 shrink-0" />
|
|
848
|
+
<span className="truncate">
|
|
849
|
+
{t("promptDialog.noDesignSystem")}
|
|
850
|
+
</span>
|
|
851
|
+
</div>
|
|
852
|
+
)}
|
|
853
|
+
{onCreateDesignSystem ? (
|
|
854
|
+
<Tooltip>
|
|
855
|
+
<TooltipTrigger asChild>
|
|
856
|
+
<Button
|
|
857
|
+
type="button"
|
|
858
|
+
variant="outline"
|
|
859
|
+
size="icon"
|
|
860
|
+
className="size-9 shrink-0"
|
|
861
|
+
onClick={onCreateDesignSystem}
|
|
862
|
+
aria-label={t("promptDialog.createDesignSystem")}
|
|
863
|
+
>
|
|
864
|
+
<IconPlus className="size-4" />
|
|
865
|
+
</Button>
|
|
866
|
+
</TooltipTrigger>
|
|
867
|
+
<TooltipContent>
|
|
868
|
+
{t("promptDialog.createDesignSystem")}
|
|
869
|
+
</TooltipContent>
|
|
870
|
+
</Tooltip>
|
|
871
|
+
) : (
|
|
872
|
+
<span aria-hidden="true" className="size-9" />
|
|
873
|
+
)}
|
|
874
|
+
</>
|
|
875
|
+
) : null}
|
|
793
876
|
</div>
|
|
794
877
|
)}
|
|
795
878
|
|
|
@@ -845,8 +928,8 @@ export default function PromptPopover({
|
|
|
845
928
|
setSkipInFlight(true);
|
|
846
929
|
void (async () => {
|
|
847
930
|
try {
|
|
848
|
-
await onSkip();
|
|
849
|
-
onOpenChange(false);
|
|
931
|
+
const shouldClose = await onSkip();
|
|
932
|
+
if (shouldClose !== false) onOpenChange(false);
|
|
850
933
|
} catch {
|
|
851
934
|
// The caller owns error presentation. Keep the prompt open
|
|
852
935
|
// and usable so the user can retry or submit a prompt.
|
|
@@ -874,6 +957,148 @@ export default function PromptPopover({
|
|
|
874
957
|
);
|
|
875
958
|
}
|
|
876
959
|
|
|
960
|
+
function TemplatePickerControl({
|
|
961
|
+
open,
|
|
962
|
+
onOpenChange,
|
|
963
|
+
options,
|
|
964
|
+
loading,
|
|
965
|
+
selectedId,
|
|
966
|
+
onChange,
|
|
967
|
+
}: {
|
|
968
|
+
open: boolean;
|
|
969
|
+
onOpenChange: (open: boolean) => void;
|
|
970
|
+
options: PromptTemplateOption[];
|
|
971
|
+
loading: boolean;
|
|
972
|
+
selectedId: string | null;
|
|
973
|
+
onChange: (id: string | null) => void;
|
|
974
|
+
}) {
|
|
975
|
+
const t = useT();
|
|
976
|
+
const selected = options.find((option) => option.id === selectedId) ?? null;
|
|
977
|
+
const userTemplates = options.filter((option) => !option.isBuiltIn);
|
|
978
|
+
const builtInTemplates = options.filter((option) => option.isBuiltIn);
|
|
979
|
+
|
|
980
|
+
const choose = (id: string | null) => {
|
|
981
|
+
onChange(id);
|
|
982
|
+
onOpenChange(false);
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
const item = (template: PromptTemplateOption) => (
|
|
986
|
+
<CommandItem
|
|
987
|
+
key={template.id}
|
|
988
|
+
value={`${template.title} ${template.description ?? ""} ${template.category ?? ""}`}
|
|
989
|
+
onSelect={() => choose(template.id)}
|
|
990
|
+
data-template-option={template.id}
|
|
991
|
+
className="min-h-12 py-2"
|
|
992
|
+
>
|
|
993
|
+
<TemplatePreview
|
|
994
|
+
html={template.previewHtml}
|
|
995
|
+
title={template.title}
|
|
996
|
+
width={template.width}
|
|
997
|
+
height={template.height}
|
|
998
|
+
className="h-8 w-12 shrink-0 rounded-md border bg-muted/40"
|
|
999
|
+
/>
|
|
1000
|
+
<span className="min-w-0 flex-1 truncate">{template.title}</span>
|
|
1001
|
+
{template.isBuiltIn ? (
|
|
1002
|
+
<Badge
|
|
1003
|
+
variant="secondary"
|
|
1004
|
+
className="h-5 shrink-0 px-1.5 text-[10px] font-medium"
|
|
1005
|
+
>
|
|
1006
|
+
{t("promptDialog.builtIn")}
|
|
1007
|
+
</Badge>
|
|
1008
|
+
) : null}
|
|
1009
|
+
{selectedId === template.id ? (
|
|
1010
|
+
<IconCheck className="size-4 shrink-0" />
|
|
1011
|
+
) : null}
|
|
1012
|
+
</CommandItem>
|
|
1013
|
+
);
|
|
1014
|
+
|
|
1015
|
+
return (
|
|
1016
|
+
<Popover open={open} onOpenChange={onOpenChange}>
|
|
1017
|
+
<PopoverTrigger asChild>
|
|
1018
|
+
<Button
|
|
1019
|
+
type="button"
|
|
1020
|
+
variant="outline"
|
|
1021
|
+
size="sm"
|
|
1022
|
+
className="h-9 w-full min-w-0 justify-start gap-2 px-2.5 text-xs"
|
|
1023
|
+
aria-label={t("promptDialog.chooseTemplate")}
|
|
1024
|
+
disabled={loading}
|
|
1025
|
+
data-template-picker-trigger
|
|
1026
|
+
>
|
|
1027
|
+
{selected ? (
|
|
1028
|
+
<TemplatePreview
|
|
1029
|
+
html={selected.previewHtml}
|
|
1030
|
+
title={selected.title}
|
|
1031
|
+
width={selected.width}
|
|
1032
|
+
height={selected.height}
|
|
1033
|
+
className="h-4 w-7 shrink-0 rounded-[3px] border bg-muted/40"
|
|
1034
|
+
/>
|
|
1035
|
+
) : (
|
|
1036
|
+
<IconTemplate className="size-4 shrink-0 text-muted-foreground" />
|
|
1037
|
+
)}
|
|
1038
|
+
<span
|
|
1039
|
+
className={cn(
|
|
1040
|
+
"min-w-0 truncate",
|
|
1041
|
+
selected ? "text-foreground" : "text-muted-foreground",
|
|
1042
|
+
)}
|
|
1043
|
+
>
|
|
1044
|
+
{t("promptDialog.template")} ·{" "}
|
|
1045
|
+
{selected ? selected.title : t("promptDialog.blank")}
|
|
1046
|
+
</span>
|
|
1047
|
+
{selected?.isBuiltIn ? (
|
|
1048
|
+
<Badge
|
|
1049
|
+
variant="secondary"
|
|
1050
|
+
className="h-5 shrink-0 px-1.5 text-[10px] font-medium"
|
|
1051
|
+
>
|
|
1052
|
+
{t("promptDialog.builtIn")}
|
|
1053
|
+
</Badge>
|
|
1054
|
+
) : null}
|
|
1055
|
+
<IconChevronDown className="ms-auto size-4 shrink-0 text-muted-foreground" />
|
|
1056
|
+
</Button>
|
|
1057
|
+
</PopoverTrigger>
|
|
1058
|
+
<PopoverContent
|
|
1059
|
+
align="start"
|
|
1060
|
+
side="top"
|
|
1061
|
+
sideOffset={8}
|
|
1062
|
+
data-agent-native-template-popover
|
|
1063
|
+
className="w-[min(360px,calc(100vw-32px))] p-0"
|
|
1064
|
+
>
|
|
1065
|
+
<Command>
|
|
1066
|
+
<CommandInput placeholder={t("promptDialog.searchTemplates")} />
|
|
1067
|
+
<CommandList className="max-h-[min(420px,60vh)]">
|
|
1068
|
+
<CommandEmpty>{t("promptDialog.noTemplatesFound")}</CommandEmpty>
|
|
1069
|
+
<CommandGroup>
|
|
1070
|
+
<CommandItem
|
|
1071
|
+
value={t("promptDialog.blank")}
|
|
1072
|
+
onSelect={() => choose(null)}
|
|
1073
|
+
data-template-option="blank"
|
|
1074
|
+
className="min-h-11"
|
|
1075
|
+
>
|
|
1076
|
+
<span className="flex h-8 w-12 shrink-0 items-center justify-center rounded-md border bg-muted/40 text-muted-foreground">
|
|
1077
|
+
<IconTemplate className="size-4" />
|
|
1078
|
+
</span>
|
|
1079
|
+
<span className="min-w-0 flex-1 truncate">
|
|
1080
|
+
{t("promptDialog.blank")}
|
|
1081
|
+
</span>
|
|
1082
|
+
{!selectedId ? <IconCheck className="size-4 shrink-0" /> : null}
|
|
1083
|
+
</CommandItem>
|
|
1084
|
+
</CommandGroup>
|
|
1085
|
+
{userTemplates.length > 0 ? (
|
|
1086
|
+
<CommandGroup heading={t("promptDialog.yourTemplates")}>
|
|
1087
|
+
{userTemplates.map(item)}
|
|
1088
|
+
</CommandGroup>
|
|
1089
|
+
) : null}
|
|
1090
|
+
{builtInTemplates.length > 0 ? (
|
|
1091
|
+
<CommandGroup heading={t("promptDialog.builtInTemplates")}>
|
|
1092
|
+
{builtInTemplates.map(item)}
|
|
1093
|
+
</CommandGroup>
|
|
1094
|
+
) : null}
|
|
1095
|
+
</CommandList>
|
|
1096
|
+
</Command>
|
|
1097
|
+
</PopoverContent>
|
|
1098
|
+
</Popover>
|
|
1099
|
+
);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
877
1102
|
function PromptAttachmentMenu({
|
|
878
1103
|
disabled,
|
|
879
1104
|
onUploadFiles,
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { IconTemplate } from "@tabler/icons-react";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
|
|
4
6
|
export function TemplatePreview({
|
|
5
7
|
html,
|
|
6
8
|
title,
|
|
7
9
|
width,
|
|
8
10
|
height,
|
|
11
|
+
className,
|
|
9
12
|
}: {
|
|
10
13
|
html?: string | null;
|
|
11
14
|
title: string;
|
|
12
15
|
width?: number | null;
|
|
13
16
|
height?: number | null;
|
|
17
|
+
className?: string;
|
|
14
18
|
}) {
|
|
15
19
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
16
20
|
const [scale, setScale] = useState(0.25);
|
|
@@ -40,7 +44,12 @@ export function TemplatePreview({
|
|
|
40
44
|
|
|
41
45
|
if (!html) {
|
|
42
46
|
return (
|
|
43
|
-
<div
|
|
47
|
+
<div
|
|
48
|
+
className={cn(
|
|
49
|
+
"flex aspect-video items-center justify-center bg-muted/50",
|
|
50
|
+
className,
|
|
51
|
+
)}
|
|
52
|
+
>
|
|
44
53
|
<IconTemplate className="size-8 text-muted-foreground/35" />
|
|
45
54
|
</div>
|
|
46
55
|
);
|
|
@@ -49,7 +58,10 @@ export function TemplatePreview({
|
|
|
49
58
|
return (
|
|
50
59
|
<div
|
|
51
60
|
ref={containerRef}
|
|
52
|
-
className=
|
|
61
|
+
className={cn(
|
|
62
|
+
"relative aspect-video overflow-hidden bg-white",
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
53
65
|
>
|
|
54
66
|
<iframe
|
|
55
67
|
title={`${title} preview`}
|
|
@@ -267,8 +267,6 @@ export function useNavigationState(enabled = true) {
|
|
|
267
267
|
if (designSystemId) state.designSystemId = designSystemId;
|
|
268
268
|
} else if (pathname.startsWith("/templates")) {
|
|
269
269
|
state.view = "templates";
|
|
270
|
-
const templateId = searchParams.get("templateId");
|
|
271
|
-
if (templateId) state.templateId = templateId;
|
|
272
270
|
} else if (pathname.startsWith("/present/")) {
|
|
273
271
|
state.view = "present";
|
|
274
272
|
state.designId = params.id;
|
|
@@ -276,6 +274,9 @@ export function useNavigationState(enabled = true) {
|
|
|
276
274
|
state.view = "settings";
|
|
277
275
|
}
|
|
278
276
|
|
|
277
|
+
const templateId = searchParams.get("templateId");
|
|
278
|
+
if (templateId) state.templateId = templateId;
|
|
279
|
+
|
|
279
280
|
return state;
|
|
280
281
|
},
|
|
281
282
|
getCommandPath: (cmd) => {
|
|
@@ -982,6 +982,7 @@ const messages = {
|
|
|
982
982
|
decideDescription: "用判斷力繼續推進。",
|
|
983
983
|
},
|
|
984
984
|
promptDialog: {
|
|
985
|
+
...designTemplateFeatureOverrides["zh-TW"].promptDialog,
|
|
985
986
|
assetsTitle: "Assets",
|
|
986
987
|
assetsImagePicker: "Assets圖片選取器",
|
|
987
988
|
loadingAssetsPicker: "載入 Assets 選取器",
|
|
@@ -1121,9 +1122,8 @@ const messages = {
|
|
|
1121
1122
|
},
|
|
1122
1123
|
templatesPage: {
|
|
1123
1124
|
...designTemplateFeatureOverrides["zh-TW"].templatesPage,
|
|
1124
|
-
title: "
|
|
1125
|
-
description:
|
|
1126
|
-
"用於發布、廣告、簡報、活動和 PDF 講義的尺寸可編輯的入門設計。",
|
|
1125
|
+
title: "範本",
|
|
1126
|
+
description: "從正確的尺寸與預設值開始,再用提示調整未鎖定的內容。",
|
|
1127
1127
|
brand: "品牌: {{title}}",
|
|
1128
1128
|
useTemplate: "使用範本",
|
|
1129
1129
|
socialSquare: "社交廣場",
|
|
@@ -1123,6 +1123,18 @@ const enUS = {
|
|
|
1123
1123
|
designSystem: "Design system",
|
|
1124
1124
|
noDesignSystem: "No design system",
|
|
1125
1125
|
newDesignSystem: "New",
|
|
1126
|
+
createDesignSystem: "Create design system",
|
|
1127
|
+
template: "Template",
|
|
1128
|
+
blank: "Blank",
|
|
1129
|
+
builtIn: "Built-in",
|
|
1130
|
+
chooseTemplate: "Choose a template",
|
|
1131
|
+
searchTemplates: "Search templates...",
|
|
1132
|
+
noTemplatesFound: "No templates found.",
|
|
1133
|
+
yourTemplates: "Your templates",
|
|
1134
|
+
builtInTemplates: "Built-in templates",
|
|
1135
|
+
templatePromptPlaceholder: "Describe how to adapt {{title}}...",
|
|
1136
|
+
reskinTemplatePrompt:
|
|
1137
|
+
"Apply the {{system}} design system to {{title}} while preserving its structure and locked layers.",
|
|
1126
1138
|
addAttachment: "Add",
|
|
1127
1139
|
removeAttachment: "Remove {{name}}",
|
|
1128
1140
|
uploadFile: "Upload file",
|
|
@@ -1256,11 +1268,18 @@ const enUS = {
|
|
|
1256
1268
|
description:
|
|
1257
1269
|
"Start with the right dimensions and defaults, then prompt the unlocked content into place.",
|
|
1258
1270
|
searchPlaceholder: "Search templates...",
|
|
1259
|
-
starterTemplates: "
|
|
1260
|
-
savedTemplates: "
|
|
1271
|
+
starterTemplates: "Built-in templates",
|
|
1272
|
+
savedTemplates: "Your templates",
|
|
1261
1273
|
savedTemplatesDescription:
|
|
1262
1274
|
"Save any Design project as a reusable template from its editor menu.",
|
|
1263
1275
|
savedEmpty: "Open a design and choose Save as template to add it here.",
|
|
1276
|
+
yourTemplates: "Your templates",
|
|
1277
|
+
yourTemplatesDescription:
|
|
1278
|
+
"Save any Design project as a reusable template from its editor menu.",
|
|
1279
|
+
yourTemplatesEmpty:
|
|
1280
|
+
"Open a design and choose Save as template to add it here.",
|
|
1281
|
+
builtInTemplates: "Built-in templates",
|
|
1282
|
+
builtIn: "Built-in",
|
|
1264
1283
|
brand: "Brand: {{title}}",
|
|
1265
1284
|
useTemplate: "Use template",
|
|
1266
1285
|
useAsIs: "Use template as-is",
|