@agent-native/core 0.80.2 → 0.80.5
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 +66 -2
- package/corpus/core/docs/content/locales/ar-SA/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/real-time-collaboration.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +1 -1
- package/corpus/core/docs/content/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/template-design.mdx +1 -1
- package/corpus/core/package.json +3 -7
- package/corpus/core/src/action.ts +32 -0
- package/corpus/core/src/agent/durable-background.ts +32 -11
- package/corpus/core/src/agent/production-agent.ts +14 -1
- package/corpus/core/src/agent/run-loop-with-resume.ts +3 -1
- package/corpus/core/src/brand-kit/fig/index.ts +17 -37
- package/corpus/core/src/cli/index.ts +1 -1
- package/corpus/core/src/cli/mcp-config-writers.ts +187 -51
- package/corpus/core/src/cli/plan-local.ts +445 -108
- package/corpus/core/src/cli/skills.ts +32 -8
- package/corpus/core/src/client/AssistantChat.tsx +11 -1
- package/corpus/core/src/client/agent-chat.ts +12 -1
- package/corpus/core/src/client/composer/PromptComposer.tsx +100 -41
- package/corpus/core/src/client/org/OrgSwitcher.tsx +1 -1
- package/corpus/core/src/client/sharing/ShareButton.tsx +3 -27
- package/corpus/core/src/collab/presence.ts +1 -1
- package/corpus/core/src/mcp/connect-route.ts +34 -5
- package/corpus/core/src/server/action-discovery.ts +4 -0
- package/corpus/core/src/server/action-routes.ts +14 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +20 -0
- package/corpus/core/src/vite/client.ts +15 -1
- package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +2 -0
- package/corpus/templates/analytics/actions/update-dashboard.ts +8 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +117 -33
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +4 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +7 -0
- package/corpus/templates/analytics/changelog/2026-06-27-dashboards-can-now-nest-under-a-parent-in-the-sidebar-via-a-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-29-analytics-pages-now-sit-closer-under-the-header-with-tighter.md +6 -0
- package/corpus/templates/assets/actions/generate-image-batch.ts +3 -0
- package/corpus/templates/assets/actions/generate-image.ts +3 -0
- package/corpus/templates/assets/changelog/2026-06-29-longer-agent-generation-window.md +6 -0
- package/corpus/templates/assets/netlify.toml +3 -3
- package/corpus/templates/assets/server/plugins/agent-chat.ts +4 -1
- package/corpus/templates/clips/app/components/capture-install-options.tsx +7 -8
- package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +162 -0
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +1 -1
- package/corpus/templates/clips/app/i18n/ar-SA.ts +4 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +4 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +4 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +4 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +4 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +4 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +4 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +4 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +4 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +42 -18
- package/corpus/templates/content/AGENTS.md +12 -0
- package/corpus/templates/content/app/blocks/BuilderDocsBlocks.tsx +10 -0
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -0
- package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +185 -0
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +3 -0
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +19 -0
- package/corpus/templates/content/app/components/editor/extensions/ContentReferenceNode.tsx +82 -0
- package/corpus/templates/content/app/global.css +9 -0
- package/corpus/templates/content/app/i18n/zh-TW.ts +12 -0
- package/corpus/templates/content/app/i18n-data.ts +140 -0
- package/corpus/templates/content/changelog/2026-06-29-reusable-mdx-references-now-preview-linked-local-documents-i.md +6 -0
- package/corpus/templates/content/shared/builder-docs-blocks.ts +8 -0
- package/corpus/templates/content/shared/builder-mdx.ts +141 -4
- package/corpus/templates/content/shared/nfm.ts +62 -0
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +10 -11
- package/corpus/templates/design/AGENTS.md +5 -0
- package/corpus/templates/design/_gitignore +7 -0
- package/corpus/templates/design/actions/apply-visual-edit.ts +22 -12
- package/corpus/templates/design/actions/create-design-system.ts +15 -4
- package/corpus/templates/design/actions/create-file.ts +20 -1
- package/corpus/templates/design/actions/delete-design-system.ts +2 -2
- package/corpus/templates/design/actions/duplicate-design.ts +35 -9
- package/corpus/templates/design/actions/generate-design.ts +146 -69
- package/corpus/templates/design/actions/generate-screens.ts +51 -19
- package/corpus/templates/design/actions/get-design-snapshot.ts +5 -1
- package/corpus/templates/design/actions/get-design.ts +2 -0
- package/corpus/templates/design/actions/import-design-project.ts +28 -9
- package/corpus/templates/design/actions/import-document.ts +22 -8
- package/corpus/templates/design/actions/index-design-system-with-builder.ts +6 -153
- package/corpus/templates/design/actions/navigate.ts +105 -54
- package/corpus/templates/design/actions/set-default-design-system.ts +17 -3
- package/corpus/templates/design/actions/show-design-questions.ts +2 -0
- package/corpus/templates/design/actions/update-design.ts +2 -1
- package/corpus/templates/design/actions/view-screen.ts +12 -6
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +4 -4
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +159 -41
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +8 -4
- package/corpus/templates/design/app/components/design/DrawOverlay.tsx +37 -42
- package/corpus/templates/design/app/components/design/EditPanel.tsx +336 -183
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +153 -34
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +135 -33
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +6 -0
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +2 -1
- package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +4 -10
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +84 -43
- package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +4 -4
- package/corpus/templates/design/app/components/design/inspector/{FigmaColorPicker.tsx → DesignColorPicker.tsx} +89 -62
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +14 -26
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +40 -12
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +13 -4
- package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +13 -13
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +13 -9
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +13 -4
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design/inspector/{figma-icons.tsx → design-icons.tsx} +2 -2
- package/corpus/templates/design/app/components/design/inspector/index.ts +12 -12
- package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +5 -2
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -3
- package/corpus/templates/design/app/components/layout/Layout.tsx +5 -2
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +167 -91
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +16 -3
- package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +15 -0
- package/corpus/templates/design/app/global.css +4 -0
- package/corpus/templates/design/app/hooks/use-design-system.ts +4 -1
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +38 -3
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +9 -2
- package/corpus/templates/design/app/i18n/zh-TW.ts +22 -0
- package/corpus/templates/design/app/i18n-data.ts +527 -0
- package/corpus/templates/design/app/lib/design-systems.ts +6 -4
- package/corpus/templates/design/app/lib/design-templates.ts +15 -3
- package/corpus/templates/design/app/pages/DesignEditor.tsx +641 -158
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +42 -34
- package/corpus/templates/design/app/pages/VisualEdit.tsx +100 -0
- package/corpus/templates/design/app/root.tsx +42 -9
- package/corpus/templates/design/app/routes/visual-edit.tsx +7 -0
- package/corpus/templates/design/changelog/2026-06-28-live-cursors-now-keep-names-beside-a-cleaner-pointer-marker.md +1 -1
- package/corpus/templates/design/changelog/2026-06-28-mode-switching-now-lives-in-a-compact-bottom-right-icon-dock.md +1 -1
- package/corpus/templates/design/changelog/2026-06-28-visual-code-design-mode.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-generation-prompts-now-show-connect-ai-before-sending.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-mode-top-chrome-now-groups-collaborators-preview-shar.md +1 -1
- package/corpus/templates/design/changelog/2026-06-29-fixed-design-editor-exports-and-gradient-edits-so-multi-scre.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-longer-hosted-agent-turns.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-png-export-handles-modern-css-color-functions-more-reliably.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-png-export-now-ignores-duplicate-clicks-while-a-download-is-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-public-visual-edit-and-shared-design-links-now-invite-visito.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-visual-edit-actions-now-reject-missing-design-targets-before.md +6 -0
- package/corpus/templates/design/e2e/README.md +71 -0
- package/corpus/templates/design/e2e/global-setup.ts +157 -0
- package/corpus/templates/design/e2e/helpers.ts +148 -0
- package/corpus/templates/design/netlify.toml +3 -4
- package/corpus/templates/design/package.json +5 -1
- package/corpus/templates/design/playwright.config.ts +51 -0
- package/corpus/templates/design/server/handlers/index-design-system-with-builder.ts +121 -0
- package/corpus/templates/design/server/handlers/uploads.ts +89 -38
- package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +181 -0
- package/corpus/templates/design/server/lib/coding-handoff.ts +33 -4
- package/corpus/templates/design/server/lib/design-export.ts +35 -8
- package/corpus/templates/design/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/design/server/plugins/auth.ts +10 -1
- package/corpus/templates/design/server/routes/api/index-design-system-with-builder.post.ts +1 -0
- package/corpus/templates/design/shared/api.ts +2 -0
- package/corpus/templates/design/shared/apply-edits.ts +12 -8
- package/corpus/templates/design/shared/canvas-math.ts +19 -1
- package/corpus/templates/design/shared/code-layer.ts +87 -28
- package/corpus/templates/design/shared/generation-session.ts +1 -0
- package/corpus/templates/design/shared/resolve-tweaks.ts +4 -3
- package/corpus/templates/design/shared/shader-presets.ts +10 -0
- package/corpus/templates/design/shared/source-mode.ts +9 -0
- package/corpus/templates/design/vitest.config.ts +2 -1
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +1 -1
- package/corpus/templates/plan/.agents/skills/visual-plan/references/canvas.md +1 -1
- package/corpus/templates/plan/.agents/skills/visual-plan/references/local-files.md +14 -5
- package/corpus/templates/plan/.agents/skills/visual-recap/references/local-files.md +14 -5
- package/corpus/templates/plan/AGENTS.md +1 -1
- package/corpus/templates/plan/actions/create-plan-design.ts +1 -1
- package/corpus/templates/plan/actions/validate-local-plan-source.ts +110 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +1 -0
- package/corpus/templates/plan/docs/commenting-ux-plan.md +2 -2
- package/corpus/templates/plan/server/lib/plan-connector-catalog.ts +1 -0
- package/corpus/templates/plan/server/lib/public-action-paths.ts +1 -0
- package/corpus/templates/plan/server/plan-content.ts +1 -1
- package/corpus/templates/plan/server/ui-plan-html.ts +2 -2
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +6 -153
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +53 -38
- package/corpus/templates/slides/app/components/design-system/{fig-import-response.ts → builder-index-response.ts} +9 -6
- package/corpus/templates/slides/app/components/visual-editor/MultiSelectChip.tsx +1 -1
- package/corpus/templates/slides/changelog/2026-06-29-design-system-setup-now-indexes-uploaded-design-files-throug.md +6 -0
- package/corpus/templates/slides/changelog/2026-06-29-longer-hosted-agent-turns.md +6 -0
- package/corpus/templates/slides/netlify.toml +3 -6
- package/corpus/templates/slides/server/handlers/index-design-system-with-builder.ts +116 -0
- package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +179 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +4 -1
- package/corpus/templates/slides/server/routes/api/index-design-system-with-builder.post.ts +1 -0
- package/dist/action.d.ts +23 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +9 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/durable-background.d.ts +9 -7
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +27 -11
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/production-agent.d.ts +10 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +4 -1
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts +2 -1
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +2 -2
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/brand-kit/fig/index.d.ts +4 -4
- package/dist/brand-kit/fig/index.d.ts.map +1 -1
- package/dist/brand-kit/fig/index.js +14 -27
- package/dist/brand-kit/fig/index.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-config-writers.d.ts +15 -7
- package/dist/cli/mcp-config-writers.d.ts.map +1 -1
- package/dist/cli/mcp-config-writers.js +198 -45
- package/dist/cli/mcp-config-writers.js.map +1 -1
- package/dist/cli/plan-local.d.ts +30 -0
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +281 -56
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/skills.d.ts +2 -2
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +32 -8
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +11 -1
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +15 -2
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/composer/PromptComposer.d.ts.map +1 -1
- package/dist/client/composer/PromptComposer.js +35 -1
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/org/OrgSwitcher.js +1 -1
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +1 -1
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +2 -15
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/collab/presence.d.ts +1 -1
- package/dist/collab/presence.js +1 -1
- package/dist/collab/presence.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/mcp/connect-route.d.ts.map +1 -1
- package/dist/mcp/connect-route.js +34 -5
- package/dist/mcp/connect-route.js.map +1 -1
- package/dist/observability/routes.d.ts +2 -2
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +5 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +14 -0
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +6 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +12 -3
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +12 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/locales/ar-SA/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/ar-SA/template-design.mdx +1 -1
- package/docs/content/locales/de-DE/real-time-collaboration.mdx +3 -3
- package/docs/content/locales/de-DE/template-design.mdx +1 -1
- package/docs/content/locales/es-ES/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/es-ES/template-design.mdx +1 -1
- package/docs/content/locales/fr-FR/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/fr-FR/template-design.mdx +1 -1
- package/docs/content/locales/hi-IN/template-design.mdx +1 -1
- package/docs/content/locales/ja-JP/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/ja-JP/template-design.mdx +1 -1
- package/docs/content/locales/ko-KR/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/ko-KR/template-design.mdx +1 -1
- package/docs/content/locales/pt-BR/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/pt-BR/template-design.mdx +1 -1
- package/docs/content/locales/zh-CN/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/zh-CN/template-design.mdx +1 -1
- package/docs/content/locales/zh-TW/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/zh-TW/template-design.mdx +1 -1
- package/docs/content/real-time-collaboration.mdx +2 -2
- package/docs/content/template-design.mdx +1 -1
- package/package.json +3 -7
- package/corpus/core/src/brand-kit/fig/decode.ts +0 -410
- package/corpus/core/src/brand-kit/fig/extract-design-system.ts +0 -947
- package/corpus/core/src/brand-kit/fig/fig-to-html.ts +0 -1906
- package/corpus/templates/design/actions/import-figma.ts +0 -55
- package/corpus/templates/design/changelog/2026-06-28-figma-style-code-design-mode.md +0 -6
- package/corpus/templates/design/server/handlers/import-figma-system.ts +0 -86
- package/corpus/templates/design/server/routes/api/import-figma-system.post.ts +0 -1
- package/corpus/templates/slides/server/handlers/import-figma-system.ts +0 -101
- package/corpus/templates/slides/server/routes/api/import-figma-system.post.ts +0 -1
- package/dist/brand-kit/fig/decode.d.ts +0 -33
- package/dist/brand-kit/fig/decode.d.ts.map +0 -1
- package/dist/brand-kit/fig/decode.js +0 -358
- package/dist/brand-kit/fig/decode.js.map +0 -1
- package/dist/brand-kit/fig/extract-design-system.d.ts +0 -44
- package/dist/brand-kit/fig/extract-design-system.d.ts.map +0 -1
- package/dist/brand-kit/fig/extract-design-system.js +0 -752
- package/dist/brand-kit/fig/extract-design-system.js.map +0 -1
- package/dist/brand-kit/fig/fig-to-html.d.ts +0 -246
- package/dist/brand-kit/fig/fig-to-html.d.ts.map +0 -1
- package/dist/brand-kit/fig/fig-to-html.js +0 -1506
- package/dist/brand-kit/fig/fig-to-html.js.map +0 -1
|
@@ -301,6 +301,9 @@ export function CanvasCommentPins({
|
|
|
301
301
|
const containerRef = useRef<HTMLElement | null>(null);
|
|
302
302
|
const lastSubmitQueuedSignalRef = useRef(submitQueuedSignal);
|
|
303
303
|
const [canvasEl, setCanvasEl] = useState<HTMLElement | null>(null);
|
|
304
|
+
// Dummy tick forces a re-render (and a fresh getBoundingClientRect()) whenever
|
|
305
|
+
// the canvas scrolls or resizes, keeping pin overlays in sync.
|
|
306
|
+
const [, setLayoutTick] = useState(0);
|
|
304
307
|
|
|
305
308
|
// Reset pins when the context (slide) changes — they're scoped to one view.
|
|
306
309
|
useEffect(() => {
|
|
@@ -324,6 +327,32 @@ export function CanvasCommentPins({
|
|
|
324
327
|
return () => clearTimeout(t);
|
|
325
328
|
}, [active, canvasSelector, contextId]);
|
|
326
329
|
|
|
330
|
+
// Re-render when the canvas element moves in the viewport (scroll or resize),
|
|
331
|
+
// so getBoundingClientRect() returns fresh coordinates for pin overlays.
|
|
332
|
+
useEffect(() => {
|
|
333
|
+
const canvas = containerRef.current ?? canvasEl;
|
|
334
|
+
if (!canvas) return;
|
|
335
|
+
|
|
336
|
+
const bump = () => setLayoutTick((t) => t + 1);
|
|
337
|
+
|
|
338
|
+
// ResizeObserver fires when the canvas element's own size changes.
|
|
339
|
+
const ro = new ResizeObserver(bump);
|
|
340
|
+
ro.observe(canvas);
|
|
341
|
+
|
|
342
|
+
// Scroll listeners on the canvas's scrollable ancestor(s) and window cover
|
|
343
|
+
// both page-level scrolling and container-level panning.
|
|
344
|
+
const scrollTarget =
|
|
345
|
+
canvas.closest<HTMLElement>("[class*='overflow']") ?? window;
|
|
346
|
+
scrollTarget.addEventListener("scroll", bump, { passive: true });
|
|
347
|
+
window.addEventListener("resize", bump, { passive: true });
|
|
348
|
+
|
|
349
|
+
return () => {
|
|
350
|
+
ro.disconnect();
|
|
351
|
+
scrollTarget.removeEventListener("scroll", bump);
|
|
352
|
+
window.removeEventListener("resize", bump);
|
|
353
|
+
};
|
|
354
|
+
}, [canvasEl]);
|
|
355
|
+
|
|
327
356
|
const dropPinAt = useCallback(
|
|
328
357
|
(clientX: number, clientY: number, target?: HTMLElement | null) => {
|
|
329
358
|
const canvas = containerRef.current;
|
|
@@ -538,13 +567,24 @@ export function CanvasCommentPins({
|
|
|
538
567
|
setActivePinId(null);
|
|
539
568
|
};
|
|
540
569
|
|
|
570
|
+
// Refs for drag-detection on the click overlay (Bug 3 fix).
|
|
571
|
+
// A pin is only dropped on a completed click, not on any drag gesture.
|
|
572
|
+
const overlayDownPos = useRef<{ x: number; y: number } | null>(null);
|
|
573
|
+
const overlayDidDrag = useRef(false);
|
|
574
|
+
|
|
541
575
|
if (!active && pins.length === 0) return null;
|
|
542
576
|
|
|
543
577
|
// Render pins as portaled overlays positioned on top of the canvas
|
|
544
578
|
const canvas = containerRef.current ?? canvasEl;
|
|
545
579
|
if (!canvas) return null;
|
|
546
580
|
const rect = canvas.getBoundingClientRect();
|
|
547
|
-
|
|
581
|
+
// Clamp summaryLeft so the w-64 (256px) panel, which is shifted left by
|
|
582
|
+
// -translate-x-full, never overflows the left viewport edge.
|
|
583
|
+
// 264 = 256 (panel width) + 8 (minimum margin from the viewport left edge).
|
|
584
|
+
const summaryLeft = Math.max(
|
|
585
|
+
264,
|
|
586
|
+
Math.min(rect.right - 8, window.innerWidth - 8),
|
|
587
|
+
);
|
|
548
588
|
const summaryTop = Math.max(rect.top + 8, 72);
|
|
549
589
|
|
|
550
590
|
return (
|
|
@@ -565,13 +605,25 @@ export function CanvasCommentPins({
|
|
|
565
605
|
height: rect.height,
|
|
566
606
|
}}
|
|
567
607
|
onPointerDown={(e) => {
|
|
568
|
-
e.
|
|
608
|
+
overlayDownPos.current = { x: e.clientX, y: e.clientY };
|
|
609
|
+
overlayDidDrag.current = false;
|
|
569
610
|
e.stopPropagation();
|
|
570
|
-
|
|
611
|
+
}}
|
|
612
|
+
onPointerMove={(e) => {
|
|
613
|
+
if (overlayDownPos.current) {
|
|
614
|
+
const dx = e.clientX - overlayDownPos.current.x;
|
|
615
|
+
const dy = e.clientY - overlayDownPos.current.y;
|
|
616
|
+
if (dx * dx + dy * dy > 16) overlayDidDrag.current = true;
|
|
617
|
+
}
|
|
571
618
|
}}
|
|
572
619
|
onClick={(e) => {
|
|
573
620
|
e.preventDefault();
|
|
574
621
|
e.stopPropagation();
|
|
622
|
+
if (!overlayDidDrag.current) {
|
|
623
|
+
dropPinAt(e.clientX, e.clientY);
|
|
624
|
+
}
|
|
625
|
+
overlayDownPos.current = null;
|
|
626
|
+
overlayDidDrag.current = false;
|
|
575
627
|
}}
|
|
576
628
|
/>
|
|
577
629
|
)}
|
|
@@ -714,96 +766,120 @@ export function CanvasCommentPins({
|
|
|
714
766
|
|
|
715
767
|
{/* Inline composer. z-[260] keeps it above the shadcn floating-UI
|
|
716
768
|
* tier (z-[250] — Tooltip, Popover, Dialog overlay, etc.) so a
|
|
717
|
-
* stray tooltip that pops over the pin can't swallow Send clicks.
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
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
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
className="
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
disabled={!(pin.draft || "").trim()}
|
|
789
|
-
>
|
|
790
|
-
{t("visualEditor.queue")}
|
|
791
|
-
</Button>
|
|
792
|
-
{submitMode === "direct" && (
|
|
793
|
-
<Button
|
|
794
|
-
size="sm"
|
|
795
|
-
className="h-6 gap-1 px-2 text-[10px] cursor-pointer"
|
|
796
|
-
onClick={() => submitPin(pin)}
|
|
797
|
-
disabled={!(pin.draft || "").trim()}
|
|
798
|
-
>
|
|
799
|
-
<IconSend className="w-3 h-3" />
|
|
800
|
-
{t("visualEditor.send")}
|
|
801
|
-
</Button>
|
|
769
|
+
* stray tooltip that pops over the pin can't swallow Send clicks.
|
|
770
|
+
* Composer is flipped horizontally and/or vertically when the pin
|
|
771
|
+
* is near a viewport edge so it stays fully on-screen. */}
|
|
772
|
+
{isActive &&
|
|
773
|
+
!pin.submitted &&
|
|
774
|
+
(() => {
|
|
775
|
+
const composerW = 288; // w-72
|
|
776
|
+
const composerH = 220; // estimated height
|
|
777
|
+
const flipX = left + 12 + composerW > window.innerWidth;
|
|
778
|
+
const flipY = top + 4 + composerH > window.innerHeight;
|
|
779
|
+
return (
|
|
780
|
+
<div
|
|
781
|
+
data-pin-popover
|
|
782
|
+
className="absolute z-[260] w-72 rounded-lg border border-border bg-popover shadow-xl p-2"
|
|
783
|
+
style={{
|
|
784
|
+
...(flipX
|
|
785
|
+
? { right: "calc(100% + 4px)", left: "auto" }
|
|
786
|
+
: { left: "0.75rem" }),
|
|
787
|
+
...(flipY
|
|
788
|
+
? { bottom: "calc(100% + 4px)", top: "auto" }
|
|
789
|
+
: { top: "0.25rem" }),
|
|
790
|
+
}}
|
|
791
|
+
>
|
|
792
|
+
<div className="mb-2 flex items-center justify-between gap-2">
|
|
793
|
+
<p className="text-xs font-semibold text-foreground">
|
|
794
|
+
{t("visualEditor.editDesign")}
|
|
795
|
+
</p>
|
|
796
|
+
<PinStatusBadge status={status} />
|
|
797
|
+
</div>
|
|
798
|
+
<Textarea
|
|
799
|
+
autoFocus
|
|
800
|
+
value={pin.draft || ""}
|
|
801
|
+
onChange={(e) =>
|
|
802
|
+
updatePin(pin.id, {
|
|
803
|
+
draft: e.target.value,
|
|
804
|
+
queued: false,
|
|
805
|
+
})
|
|
806
|
+
}
|
|
807
|
+
onKeyDown={(e) => {
|
|
808
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
809
|
+
e.preventDefault();
|
|
810
|
+
submitPin(pin);
|
|
811
|
+
}
|
|
812
|
+
if (e.key === "Escape") {
|
|
813
|
+
// Stop propagation so the window Escape listener (which
|
|
814
|
+
// calls onClose) does not also fire. Collapse the composer
|
|
815
|
+
// back to the pin dot while preserving the draft text —
|
|
816
|
+
// the pin and any typed draft survive. A second Escape
|
|
817
|
+
// with no composer open exits pin mode, matching Figma.
|
|
818
|
+
e.stopPropagation();
|
|
819
|
+
e.preventDefault();
|
|
820
|
+
setActivePinId(null);
|
|
821
|
+
}
|
|
822
|
+
}}
|
|
823
|
+
placeholder={t("visualEditor.tellAgentWhatToChange")}
|
|
824
|
+
className="resize-none text-xs min-h-[60px]"
|
|
825
|
+
/>
|
|
826
|
+
<p className="mt-1 text-[10px] leading-4 text-muted-foreground">
|
|
827
|
+
{status.detail}
|
|
828
|
+
</p>
|
|
829
|
+
{pin.targetAnchorId && (
|
|
830
|
+
<div className="mt-1 truncate rounded-md bg-muted/45 px-2 py-1 text-[10px] text-muted-foreground">
|
|
831
|
+
{t("visualEditor.anchorLabel", {
|
|
832
|
+
id: pin.targetAnchorId,
|
|
833
|
+
})}
|
|
834
|
+
</div>
|
|
835
|
+
)}
|
|
836
|
+
{pin.targetText && (
|
|
837
|
+
<div className="text-[10px] text-muted-foreground mt-1 italic line-clamp-1">
|
|
838
|
+
{t("visualEditor.nearText", { text: pin.targetText })}
|
|
839
|
+
</div>
|
|
802
840
|
)}
|
|
841
|
+
<div className="flex items-center justify-between mt-2">
|
|
842
|
+
<span className="text-[10px] text-muted-foreground">
|
|
843
|
+
{t("visualEditor.submitShortcut", {
|
|
844
|
+
mod: /Mac|iPhone|iPad/.test(navigator.userAgent)
|
|
845
|
+
? "⌘"
|
|
846
|
+
: "Ctrl",
|
|
847
|
+
})}
|
|
848
|
+
</span>
|
|
849
|
+
<div className="flex gap-1">
|
|
850
|
+
<Button
|
|
851
|
+
size="sm"
|
|
852
|
+
variant="ghost"
|
|
853
|
+
className="h-6 px-2 text-[10px] cursor-pointer"
|
|
854
|
+
onClick={() => removePin(pin.id)}
|
|
855
|
+
>
|
|
856
|
+
<IconX className="w-3 h-3" />
|
|
857
|
+
</Button>
|
|
858
|
+
<Button
|
|
859
|
+
size="sm"
|
|
860
|
+
variant="outline"
|
|
861
|
+
className="h-6 gap-1 px-2 text-[10px] cursor-pointer"
|
|
862
|
+
onClick={() => queuePin(pin)}
|
|
863
|
+
disabled={!(pin.draft || "").trim()}
|
|
864
|
+
>
|
|
865
|
+
{t("visualEditor.queue")}
|
|
866
|
+
</Button>
|
|
867
|
+
{submitMode === "direct" && (
|
|
868
|
+
<Button
|
|
869
|
+
size="sm"
|
|
870
|
+
className="h-6 gap-1 px-2 text-[10px] cursor-pointer"
|
|
871
|
+
onClick={() => submitPin(pin)}
|
|
872
|
+
disabled={!(pin.draft || "").trim()}
|
|
873
|
+
>
|
|
874
|
+
<IconSend className="w-3 h-3" />
|
|
875
|
+
{t("visualEditor.send")}
|
|
876
|
+
</Button>
|
|
877
|
+
)}
|
|
878
|
+
</div>
|
|
879
|
+
</div>
|
|
803
880
|
</div>
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
)}
|
|
881
|
+
);
|
|
882
|
+
})()}
|
|
807
883
|
</div>
|
|
808
884
|
);
|
|
809
885
|
})}
|
|
@@ -125,6 +125,7 @@ export function DrawOverlay({
|
|
|
125
125
|
} | null>(null);
|
|
126
126
|
const [instruction, setInstruction] = useState("");
|
|
127
127
|
const drawing = useRef(false);
|
|
128
|
+
const canvasSizeRef = useRef({ w: 0, h: 0 });
|
|
128
129
|
|
|
129
130
|
// Clear all state on hide so the next open starts fresh.
|
|
130
131
|
useEffect(() => {
|
|
@@ -146,9 +147,15 @@ export function DrawOverlay({
|
|
|
146
147
|
if (!ctx) return;
|
|
147
148
|
|
|
148
149
|
const rect = canvas.getBoundingClientRect();
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
const dpr = window.devicePixelRatio;
|
|
151
|
+
const newW = rect.width * dpr;
|
|
152
|
+
const newH = rect.height * dpr;
|
|
153
|
+
if (newW !== canvasSizeRef.current.w || newH !== canvasSizeRef.current.h) {
|
|
154
|
+
canvas.width = newW;
|
|
155
|
+
canvas.height = newH;
|
|
156
|
+
canvasSizeRef.current = { w: newW, h: newH };
|
|
157
|
+
ctx.scale(dpr, dpr);
|
|
158
|
+
}
|
|
152
159
|
|
|
153
160
|
ctx.clearRect(0, 0, rect.width, rect.height);
|
|
154
161
|
|
|
@@ -212,6 +219,11 @@ export function DrawOverlay({
|
|
|
212
219
|
setCurrentStroke(null);
|
|
213
220
|
}, [currentStroke, color, lineWidth]);
|
|
214
221
|
|
|
222
|
+
const handlePointerCancel = useCallback(() => {
|
|
223
|
+
drawing.current = false;
|
|
224
|
+
setCurrentStroke(null);
|
|
225
|
+
}, []);
|
|
226
|
+
|
|
215
227
|
const undo = () => {
|
|
216
228
|
setStrokes((prev) => {
|
|
217
229
|
if (prev.length === 0) return prev;
|
|
@@ -328,6 +340,7 @@ export function DrawOverlay({
|
|
|
328
340
|
onPointerDown={handlePointerDown}
|
|
329
341
|
onPointerMove={handlePointerMove}
|
|
330
342
|
onPointerUp={handlePointerUp}
|
|
343
|
+
onPointerCancel={handlePointerCancel}
|
|
331
344
|
/>
|
|
332
345
|
|
|
333
346
|
{/* Rendered text annotations */}
|
|
@@ -17,6 +17,7 @@ interface SaveStatusIndicatorProps {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function SaveStatusIndicator({
|
|
20
|
+
saving,
|
|
20
21
|
offline,
|
|
21
22
|
className,
|
|
22
23
|
}: SaveStatusIndicatorProps) {
|
|
@@ -45,5 +46,19 @@ export function SaveStatusIndicator({
|
|
|
45
46
|
);
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
if (saving) {
|
|
50
|
+
return (
|
|
51
|
+
<span
|
|
52
|
+
data-save-status="saving"
|
|
53
|
+
className={cn(
|
|
54
|
+
"animate-pulse text-[11px] text-muted-foreground",
|
|
55
|
+
className,
|
|
56
|
+
)}
|
|
57
|
+
>
|
|
58
|
+
{t("visualEditor.saving")}
|
|
59
|
+
</span>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
return null;
|
|
49
64
|
}
|
|
@@ -188,6 +188,10 @@
|
|
|
188
188
|
--agent-native-raised-shadow-right: 1px 0 0 var(--design-shell-divider);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
.agent-layout-shell .agent-sidebar-main-surface::before {
|
|
192
|
+
box-shadow: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
191
195
|
.dark .agent-layout-shell,
|
|
192
196
|
.dark .agent-sidebar-shell,
|
|
193
197
|
.dark.agent-layout-shell,
|
|
@@ -33,7 +33,10 @@ export function useDesignSystem(designSystemId?: string | null) {
|
|
|
33
33
|
}>("get-design-system", designSystemId ? { id: designSystemId } : undefined);
|
|
34
34
|
|
|
35
35
|
if (!designSystemId || !data?.data) {
|
|
36
|
-
return {
|
|
36
|
+
return {
|
|
37
|
+
designSystem: DEFAULT_DESIGN_SYSTEM,
|
|
38
|
+
isLoading: !!designSystemId && isLoading,
|
|
39
|
+
};
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
try {
|
|
@@ -17,9 +17,27 @@ export interface NavigationState {
|
|
|
17
17
|
filename?: string;
|
|
18
18
|
screen?: string;
|
|
19
19
|
zoom?: number;
|
|
20
|
+
tool?: string;
|
|
20
21
|
path?: string;
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
const DESIGN_EDITOR_TOOLS = [
|
|
25
|
+
"move",
|
|
26
|
+
"frame",
|
|
27
|
+
"rect",
|
|
28
|
+
"line",
|
|
29
|
+
"arrow",
|
|
30
|
+
"ellipse",
|
|
31
|
+
"polygon",
|
|
32
|
+
"star",
|
|
33
|
+
"text",
|
|
34
|
+
"pen",
|
|
35
|
+
"hand",
|
|
36
|
+
"comment",
|
|
37
|
+
"draw",
|
|
38
|
+
"scale",
|
|
39
|
+
] as const;
|
|
40
|
+
|
|
23
41
|
export interface DesignEditorCommand {
|
|
24
42
|
designId: string;
|
|
25
43
|
editorView?: "single" | "overview";
|
|
@@ -62,6 +80,13 @@ function normalizeInspectorTab(
|
|
|
62
80
|
: undefined;
|
|
63
81
|
}
|
|
64
82
|
|
|
83
|
+
function normalizeDesignTool(value: unknown): string | undefined {
|
|
84
|
+
return typeof value === "string" &&
|
|
85
|
+
DESIGN_EDITOR_TOOLS.includes(value as (typeof DESIGN_EDITOR_TOOLS)[number])
|
|
86
|
+
? value
|
|
87
|
+
: undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
65
90
|
export function editorPathFromCommand(cmd: NavigationState): string | null {
|
|
66
91
|
if (cmd.path) return cmd.path;
|
|
67
92
|
if (cmd.view !== "editor" || !cmd.designId) return null;
|
|
@@ -78,6 +103,8 @@ export function editorPathFromCommand(cmd: NavigationState): string | null {
|
|
|
78
103
|
} else if (editorView === "single") {
|
|
79
104
|
params.set("zoom", String(FOCUSED_SCREEN_ZOOM));
|
|
80
105
|
}
|
|
106
|
+
const tool = normalizeDesignTool(cmd.tool);
|
|
107
|
+
if (tool) params.set("tool", tool);
|
|
81
108
|
|
|
82
109
|
const query = params.toString();
|
|
83
110
|
return `/design/${encodeURIComponent(cmd.designId)}${query ? `?${query}` : ""}`;
|
|
@@ -106,10 +133,12 @@ export function editorCommandFromNavigate(
|
|
|
106
133
|
} else if (editorView === "single") {
|
|
107
134
|
command.zoom = FOCUSED_SCREEN_ZOOM;
|
|
108
135
|
}
|
|
136
|
+
const tool = normalizeDesignTool(cmd.tool);
|
|
137
|
+
if (tool) command.tool = tool;
|
|
109
138
|
return command;
|
|
110
139
|
}
|
|
111
140
|
|
|
112
|
-
export function useNavigationState() {
|
|
141
|
+
export function useNavigationState(enabled = true) {
|
|
113
142
|
const params = useParams();
|
|
114
143
|
const browserTabId = getBrowserTabId();
|
|
115
144
|
|
|
@@ -134,8 +163,13 @@ export function useNavigationState() {
|
|
|
134
163
|
if (fileId) state.fileId = fileId;
|
|
135
164
|
const filename = searchParams.get("filename");
|
|
136
165
|
if (filename) state.filename = filename;
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
166
|
+
const rawZoom = searchParams.get("zoom");
|
|
167
|
+
if (rawZoom !== null) {
|
|
168
|
+
const zoom = Number(rawZoom);
|
|
169
|
+
if (Number.isFinite(zoom)) state.zoom = zoom;
|
|
170
|
+
}
|
|
171
|
+
const tool = normalizeDesignTool(searchParams.get("tool"));
|
|
172
|
+
if (tool) state.tool = tool;
|
|
139
173
|
} else if (pathname.startsWith("/design-systems")) {
|
|
140
174
|
state.view = "design-systems";
|
|
141
175
|
const designSystemId = searchParams.get("designSystemId");
|
|
@@ -177,5 +211,6 @@ export function useNavigationState() {
|
|
|
177
211
|
setClientAppState(key, command).catch(() => {});
|
|
178
212
|
}
|
|
179
213
|
},
|
|
214
|
+
enabled,
|
|
180
215
|
});
|
|
181
216
|
}
|
|
@@ -127,6 +127,12 @@ export function isDesignHotkeyEditableTarget(target: EventTarget | null) {
|
|
|
127
127
|
if (editable instanceof HTMLElement && editable.isContentEditable) {
|
|
128
128
|
return true;
|
|
129
129
|
}
|
|
130
|
+
if (
|
|
131
|
+
editable instanceof HTMLElement &&
|
|
132
|
+
editable.hasAttribute("data-hotkeys-scope")
|
|
133
|
+
) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
130
136
|
const tagName = editable.tagName.toLowerCase();
|
|
131
137
|
return tagName === "input" || tagName === "textarea" || tagName === "select";
|
|
132
138
|
}
|
|
@@ -292,6 +298,7 @@ function handleDesignHotkey(
|
|
|
292
298
|
return run(props.onPaste);
|
|
293
299
|
}
|
|
294
300
|
if (primary && key === "d") return run(props.onDuplicate);
|
|
301
|
+
if (primary && key === "r") return run(props.onRename);
|
|
295
302
|
if (primary && key === "g") {
|
|
296
303
|
return event.shiftKey ? run(props.onUngroup) : run(props.onGroup);
|
|
297
304
|
}
|
|
@@ -301,10 +308,10 @@ function handleDesignHotkey(
|
|
|
301
308
|
if (primary && key === "0") return run(props.onZoomReset);
|
|
302
309
|
|
|
303
310
|
const digit = digitFromEvent(event);
|
|
304
|
-
if (
|
|
311
|
+
if (event.shiftKey && !primary && digit === "1") {
|
|
305
312
|
return run(props.onZoomToFit);
|
|
306
313
|
}
|
|
307
|
-
if (
|
|
314
|
+
if (event.shiftKey && !primary && digit === "2") {
|
|
308
315
|
return run(props.onZoomToSelection);
|
|
309
316
|
}
|
|
310
317
|
|
|
@@ -248,6 +248,12 @@ const messages = {
|
|
|
248
248
|
backToDesigns: "返回設計",
|
|
249
249
|
clickToRename: "點選重新命名",
|
|
250
250
|
collaborators: "協作者",
|
|
251
|
+
share: "分享",
|
|
252
|
+
signUpToSave: "儲存副本",
|
|
253
|
+
signUpToSaveDescription: "登入即可儲存這個設計的可編輯副本。",
|
|
254
|
+
signUpToShare: "登入以分享",
|
|
255
|
+
shareEditorLink: "編輯器連結",
|
|
256
|
+
shareEditorLinkDescription: "分享可在編輯器中開啟這個設計的連結。",
|
|
251
257
|
modes: {
|
|
252
258
|
annotate: "註解",
|
|
253
259
|
comment: "評論",
|
|
@@ -335,6 +341,7 @@ const messages = {
|
|
|
335
341
|
"建立一個小型檢查器擴充功能,用來讀取所選元素、呼叫操作,或請代理更新畫板。",
|
|
336
342
|
extensionsAvailable: "可用",
|
|
337
343
|
extensionsInstall: "新增",
|
|
344
|
+
extensionsInstallError: "安裝擴充功能失敗",
|
|
338
345
|
generatePlaceholder: "描述您想要建置的內容...",
|
|
339
346
|
tweaksPromptTitle: "您想要哪些調整?",
|
|
340
347
|
tweaksPlaceholder: "強調色選項、密度、圓角、深色模式...",
|
|
@@ -402,6 +409,7 @@ const messages = {
|
|
|
402
409
|
propsPasted: "屬性已貼上",
|
|
403
410
|
primitiveInsertFailed: "無法將該圖層新增到畫面",
|
|
404
411
|
layerMoveFailed: "無法移動該圖層",
|
|
412
|
+
saveCopyError: "無法儲存這個設計的副本",
|
|
405
413
|
},
|
|
406
414
|
},
|
|
407
415
|
layersPanel: {
|
|
@@ -475,6 +483,7 @@ const messages = {
|
|
|
475
483
|
assetsTitle: "Assets",
|
|
476
484
|
assetsImagePicker: "Assets圖片選取器",
|
|
477
485
|
loadingAssetsPicker: "載入 Assets 選取器",
|
|
486
|
+
assetsNoImageUrl: "Assets 未回傳圖片 URL。",
|
|
478
487
|
assetAdded: "新增資產",
|
|
479
488
|
failedToUploadFile: "上傳檔案失敗",
|
|
480
489
|
designSystem: "Design系統",
|
|
@@ -503,6 +512,7 @@ const messages = {
|
|
|
503
512
|
tellAgentWhatToChange: "告訴代理要更改什麼...",
|
|
504
513
|
changesSaveWhenReconnected: "重新連線時將儲存更改",
|
|
505
514
|
offline: "離線",
|
|
515
|
+
saving: "儲存...",
|
|
506
516
|
clearedAllAnnotations: "已清除所有批注",
|
|
507
517
|
undo: "復原",
|
|
508
518
|
send: "傳送",
|
|
@@ -548,6 +558,17 @@ const messages = {
|
|
|
548
558
|
blocked: "阻擋 {{count}}",
|
|
549
559
|
},
|
|
550
560
|
},
|
|
561
|
+
visualEdit: {
|
|
562
|
+
eyebrow: "視覺編輯",
|
|
563
|
+
title: "登入前先檢查本機應用畫面",
|
|
564
|
+
description:
|
|
565
|
+
"無需帳號即可開啟 visual-edit。只有在想儲存設計、保留畫面版面、與他人分享或生成新方向時才需要註冊。",
|
|
566
|
+
saveCta: "免費註冊以儲存",
|
|
567
|
+
openDesign: "開啟 Design",
|
|
568
|
+
templatesCta: "瀏覽範本",
|
|
569
|
+
previewLabel: "本機預覽",
|
|
570
|
+
layoutLabel: "畫面版面已可儲存",
|
|
571
|
+
},
|
|
551
572
|
home: {
|
|
552
573
|
pageTitle: "Design",
|
|
553
574
|
searchPlaceholder: "搜尋設計...",
|
|
@@ -610,6 +631,7 @@ const messages = {
|
|
|
610
631
|
designPreview: "Design 預覽",
|
|
611
632
|
settingsDesign: "設定 — Design",
|
|
612
633
|
teamDesign: "團隊 - Design",
|
|
634
|
+
visualEdit: "視覺編輯 - Design",
|
|
613
635
|
},
|
|
614
636
|
designSystemSetup: {
|
|
615
637
|
importedBrand: "進口品牌",
|