@agent-native/core 0.80.4 → 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 +21 -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 +21 -0
- package/corpus/core/src/agent/durable-background.ts +32 -11
- package/corpus/core/src/agent/production-agent.ts +11 -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/skills.ts +18 -3
- 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/agent-chat-plugin.ts +20 -0
- 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/recorder/recorder-engine.ts +1 -1
- 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.md +1 -1
- package/corpus/templates/plan/actions/create-plan-design.ts +1 -1
- package/corpus/templates/plan/actions/validate-local-plan-source.ts +2 -10
- 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/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 +15 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +6 -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 +7 -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/skills.d.ts +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +18 -3
- 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/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/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +3 -3
- 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/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/server/agent-engine-api-key-route.d.ts +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
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* --inspectorTab Inspector tab for designs: design, tweaks, or extensions
|
|
22
22
|
* --fileId Screen/file id to focus in the design editor
|
|
23
23
|
* --filename Screen filename to focus in the design editor
|
|
24
|
+
* --tool Design editor tool to activate
|
|
24
25
|
* --designSystemId Design system ID (for design-systems view)
|
|
25
26
|
* --path URL path to navigate to
|
|
26
27
|
*/
|
|
@@ -29,61 +30,110 @@ import { defineAction } from "@agent-native/core";
|
|
|
29
30
|
import { writeAppState } from "@agent-native/core/application-state";
|
|
30
31
|
import { z } from "zod";
|
|
31
32
|
|
|
33
|
+
const designEditorToolSchema = z.enum([
|
|
34
|
+
"move",
|
|
35
|
+
"frame",
|
|
36
|
+
"rect",
|
|
37
|
+
"line",
|
|
38
|
+
"arrow",
|
|
39
|
+
"ellipse",
|
|
40
|
+
"polygon",
|
|
41
|
+
"star",
|
|
42
|
+
"text",
|
|
43
|
+
"pen",
|
|
44
|
+
"hand",
|
|
45
|
+
"comment",
|
|
46
|
+
"draw",
|
|
47
|
+
"scale",
|
|
48
|
+
]);
|
|
49
|
+
|
|
32
50
|
export default defineAction({
|
|
33
51
|
description:
|
|
34
|
-
"Navigate the UI to a specific view or path. Views: list, editor, design-systems, present, templates, settings. Use --designId with editor/present views and --designSystemId with design-systems. For designs, use editorView=overview to show the infinite screens canvas, or editorView=single with fileId/filename/screen to focus a screen. Use inspectorTab=extensions to focus the in-editor extension panel.",
|
|
35
|
-
schema: z
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
52
|
+
"Navigate the UI to a specific view or path. Views: list, editor, design-systems, present, templates, settings. Use --designId with editor/present views and --designSystemId with design-systems. For designs, use editorView=overview to show the infinite screens canvas, or editorView=single with fileId/filename/screen to focus a screen. Use inspectorTab=extensions to focus the in-editor extension panel. Use tool to activate a design editor tool.",
|
|
53
|
+
schema: z
|
|
54
|
+
.object({
|
|
55
|
+
view: z
|
|
56
|
+
.enum([
|
|
57
|
+
"list",
|
|
58
|
+
"editor",
|
|
59
|
+
"design-systems",
|
|
60
|
+
"present",
|
|
61
|
+
"templates",
|
|
62
|
+
"examples",
|
|
63
|
+
"settings",
|
|
64
|
+
])
|
|
65
|
+
.optional()
|
|
66
|
+
.describe("View name to navigate to"),
|
|
67
|
+
designId: z.string().optional().describe("Design ID for editor/present"),
|
|
68
|
+
editorView: z
|
|
69
|
+
.enum(["single", "overview"])
|
|
70
|
+
.optional()
|
|
71
|
+
.describe(
|
|
72
|
+
"Design editor view: overview for the infinite screens canvas, single for a focused screen",
|
|
73
|
+
),
|
|
74
|
+
viewMode: z
|
|
75
|
+
.enum(["single", "overview"])
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("Alias for editorView"),
|
|
78
|
+
inspectorTab: z
|
|
79
|
+
.enum(["design", "tweaks", "extensions"])
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("Design editor inspector tab to focus"),
|
|
82
|
+
inspector: z
|
|
83
|
+
.enum(["design", "tweaks", "extensions"])
|
|
84
|
+
.optional()
|
|
85
|
+
.describe("Alias for inspectorTab"),
|
|
86
|
+
fileId: z.string().optional().describe("Design file/screen ID to focus"),
|
|
87
|
+
screenId: z.string().optional().describe("Alias for fileId"),
|
|
88
|
+
filename: z
|
|
89
|
+
.string()
|
|
90
|
+
.optional()
|
|
91
|
+
.describe("Design screen filename to focus, such as checkout.html"),
|
|
92
|
+
screen: z
|
|
93
|
+
.string()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe("Screen id, filename, or name to focus"),
|
|
96
|
+
zoom: z
|
|
97
|
+
.number()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe("Optional design canvas zoom percentage"),
|
|
100
|
+
tool: designEditorToolSchema
|
|
101
|
+
.optional()
|
|
102
|
+
.describe("Optional design editor tool to activate"),
|
|
103
|
+
designSystemId: z
|
|
104
|
+
.string()
|
|
105
|
+
.optional()
|
|
106
|
+
.describe("Design system ID for design-systems view"),
|
|
107
|
+
path: z.string().optional().describe("URL path to navigate to"),
|
|
108
|
+
})
|
|
109
|
+
.superRefine((args, ctx) => {
|
|
110
|
+
const editorView = args.editorView ?? args.viewMode;
|
|
111
|
+
if (
|
|
112
|
+
(args.view === "editor" || args.view === "present") &&
|
|
113
|
+
!args.designId
|
|
114
|
+
) {
|
|
115
|
+
ctx.addIssue({
|
|
116
|
+
code: z.ZodIssueCode.custom,
|
|
117
|
+
path: ["designId"],
|
|
118
|
+
message: `designId is required for ${args.view} view`,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (
|
|
122
|
+
args.view === "editor" &&
|
|
123
|
+
editorView === "single" &&
|
|
124
|
+
!args.fileId &&
|
|
125
|
+
!args.screenId &&
|
|
126
|
+
!args.filename &&
|
|
127
|
+
!args.screen
|
|
128
|
+
) {
|
|
129
|
+
ctx.addIssue({
|
|
130
|
+
code: z.ZodIssueCode.custom,
|
|
131
|
+
path: ["editorView"],
|
|
132
|
+
message:
|
|
133
|
+
"single editor view requires a fileId, screenId, filename, or screen",
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}),
|
|
87
137
|
http: false,
|
|
88
138
|
run: async (args) => {
|
|
89
139
|
if (!args.view && !args.path) {
|
|
@@ -101,6 +151,7 @@ export default defineAction({
|
|
|
101
151
|
if (args.filename) nav.filename = args.filename;
|
|
102
152
|
if (args.screen) nav.screen = args.screen;
|
|
103
153
|
if (args.zoom !== undefined) nav.zoom = args.zoom;
|
|
154
|
+
if (args.tool) nav.tool = args.tool;
|
|
104
155
|
if (args.designSystemId) nav.designSystemId = args.designSystemId;
|
|
105
156
|
if (args.path) nav.path = args.path;
|
|
106
157
|
await writeAppState("navigate", nav);
|
|
@@ -112,6 +163,6 @@ export default defineAction({
|
|
|
112
163
|
args.fileId || args.screenId || args.filename || args.screen
|
|
113
164
|
? ` (screen: ${args.fileId ?? args.screenId ?? args.filename ?? args.screen})`
|
|
114
165
|
: ""
|
|
115
|
-
}${args.designSystemId ? ` (design system: ${args.designSystemId})` : ""}`;
|
|
166
|
+
}${args.tool ? ` (${args.tool} tool)` : ""}${args.designSystemId ? ` (design system: ${args.designSystemId})` : ""}`;
|
|
116
167
|
},
|
|
117
168
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getRequestOrgId,
|
|
4
|
+
getRequestUserEmail,
|
|
5
|
+
} from "@agent-native/core/server/request-context";
|
|
3
6
|
import { assertAccess } from "@agent-native/core/sharing";
|
|
4
|
-
import { and, eq } from "drizzle-orm";
|
|
7
|
+
import { and, eq, isNull } from "drizzle-orm";
|
|
5
8
|
import { z } from "zod";
|
|
6
9
|
|
|
7
10
|
import { getDb, schema } from "../server/db/index.js";
|
|
@@ -20,6 +23,7 @@ export default defineAction({
|
|
|
20
23
|
|
|
21
24
|
const userEmail = getRequestUserEmail();
|
|
22
25
|
if (!userEmail) throw new Error("no authenticated user");
|
|
26
|
+
const orgId = getRequestOrgId();
|
|
23
27
|
|
|
24
28
|
const [target] = await db
|
|
25
29
|
.select({ ownerEmail: schema.designSystems.ownerEmail })
|
|
@@ -35,7 +39,17 @@ export default defineAction({
|
|
|
35
39
|
await tx
|
|
36
40
|
.update(schema.designSystems)
|
|
37
41
|
.set({ isDefault: false, updatedAt: now })
|
|
38
|
-
.where(
|
|
42
|
+
.where(
|
|
43
|
+
orgId
|
|
44
|
+
? and(
|
|
45
|
+
eq(schema.designSystems.ownerEmail, userEmail),
|
|
46
|
+
eq(schema.designSystems.orgId, orgId),
|
|
47
|
+
)
|
|
48
|
+
: and(
|
|
49
|
+
eq(schema.designSystems.ownerEmail, userEmail),
|
|
50
|
+
isNull(schema.designSystems.orgId),
|
|
51
|
+
),
|
|
52
|
+
);
|
|
39
53
|
|
|
40
54
|
await tx
|
|
41
55
|
.update(schema.designSystems)
|
|
@@ -4,6 +4,8 @@ import { buildDeepLink } from "@agent-native/core/server";
|
|
|
4
4
|
import { assertAccess } from "@agent-native/core/sharing";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
|
+
import "../server/db/index.js"; // ensure registerShareableResource runs
|
|
8
|
+
|
|
7
9
|
function designDeepLink(designId: string): string {
|
|
8
10
|
return buildDeepLink({
|
|
9
11
|
app: "design",
|
|
@@ -20,6 +20,7 @@ export default defineAction({
|
|
|
20
20
|
.describe("Updated project type"),
|
|
21
21
|
designSystemId: z
|
|
22
22
|
.string()
|
|
23
|
+
.min(1)
|
|
23
24
|
.nullable()
|
|
24
25
|
.optional()
|
|
25
26
|
.describe("Design system ID to link, or null to unlink"),
|
|
@@ -41,7 +42,7 @@ export default defineAction({
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
await assertAccess("design", id, "editor");
|
|
44
|
-
if (designSystemId) {
|
|
45
|
+
if (designSystemId != null) {
|
|
45
46
|
await assertAccess("design-system", designSystemId, "viewer");
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -26,9 +26,8 @@ export default defineAction({
|
|
|
26
26
|
schema: z.object({}),
|
|
27
27
|
http: false,
|
|
28
28
|
run: async () => {
|
|
29
|
-
const [navigation,
|
|
29
|
+
const [navigation, designSelection] = await Promise.all([
|
|
30
30
|
readAppStateForCurrentTab("navigation"),
|
|
31
|
-
readAppState("design-variants"),
|
|
32
31
|
readAppStateForCurrentTab("design-selection"),
|
|
33
32
|
]);
|
|
34
33
|
const designId =
|
|
@@ -44,6 +43,14 @@ export default defineAction({
|
|
|
44
43
|
const generationSession = designId
|
|
45
44
|
? await readAppState(designGenerationSessionKey(designId))
|
|
46
45
|
: undefined;
|
|
46
|
+
const designVariants = designId
|
|
47
|
+
? await readAppState("design-variants").then((value) => {
|
|
48
|
+
if (!value || typeof value !== "object") return undefined;
|
|
49
|
+
return (value as { designId?: unknown }).designId === designId
|
|
50
|
+
? value
|
|
51
|
+
: undefined;
|
|
52
|
+
})
|
|
53
|
+
: undefined;
|
|
47
54
|
|
|
48
55
|
const screen: Record<string, unknown> = {};
|
|
49
56
|
if (navigation) screen.navigation = navigation;
|
|
@@ -95,10 +102,9 @@ export default defineAction({
|
|
|
95
102
|
id: designId,
|
|
96
103
|
title: (access.resource as { title?: unknown }).title ?? null,
|
|
97
104
|
screens: files,
|
|
98
|
-
activeScreen:
|
|
99
|
-
files.find((file) => file.id === activeFileId) ??
|
|
100
|
-
files.find((file) => file.filename === activeFilename) ??
|
|
101
|
-
null,
|
|
105
|
+
activeScreen: activeFileId
|
|
106
|
+
? (files.find((file) => file.id === activeFileId) ?? null)
|
|
107
|
+
: (files.find((file) => file.filename === activeFilename) ?? null),
|
|
102
108
|
canvasFrames: parseCanvasFrameGeometryById(data.canvasFrames),
|
|
103
109
|
};
|
|
104
110
|
}
|
|
@@ -209,7 +209,7 @@ const DEFAULT_LABELS: CanvasContextMenuLabels = {
|
|
|
209
209
|
};
|
|
210
210
|
|
|
211
211
|
const DEFAULT_SHORTCUTS: CanvasContextMenuShortcuts = {
|
|
212
|
-
pasteHere: "
|
|
212
|
+
pasteHere: "",
|
|
213
213
|
selectAll: "⌘A",
|
|
214
214
|
zoomToFit: "⇧1",
|
|
215
215
|
zoomToSelection: "⇧2",
|
|
@@ -234,16 +234,16 @@ type ActionCallbackMap = Partial<
|
|
|
234
234
|
Record<CanvasContextMenuAction, CanvasContextMenuActionHandler>
|
|
235
235
|
>;
|
|
236
236
|
|
|
237
|
-
//
|
|
237
|
+
// design-editor menu chrome: compact, dark-border, subtle shadow, no animation jitter
|
|
238
238
|
const MENU_CONTENT_CLASS =
|
|
239
239
|
"w-52 min-w-[200px] rounded-[6px] border border-[var(--design-editor-control-border)] bg-[var(--design-editor-panel-bg)] py-[3px] px-[3px] text-[12px] text-foreground shadow-[0_4px_16px_rgba(0,0,0,0.16),0_0_0_0.5px_rgba(0,0,0,0.08)] outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-[0.97] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 duration-100";
|
|
240
|
-
//
|
|
240
|
+
// design row height ~28px, full-width highlight on hover, no icon gap waste
|
|
241
241
|
const MENU_ITEM_CLASS =
|
|
242
242
|
"flex h-7 cursor-default select-none items-center rounded-[4px] px-2 py-0 text-[12px] leading-none gap-0 focus:bg-[var(--design-editor-selection-color)] focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-35";
|
|
243
243
|
// Submenu trigger mirrors item styles + chevron sizing
|
|
244
244
|
const MENU_SUB_TRIGGER_CLASS =
|
|
245
245
|
"flex h-7 cursor-default select-none items-center rounded-[4px] px-2 py-0 text-[12px] leading-none focus:bg-[var(--design-editor-selection-color)] focus:text-white data-[state=open]:bg-[var(--design-editor-selection-color)] data-[state=open]:text-white [&>svg:last-child]:ms-auto [&>svg:last-child]:size-3 [&>svg:last-child]:opacity-50";
|
|
246
|
-
// Separator: 1px, full-width flush,
|
|
246
|
+
// Separator: 1px, full-width flush, design-editor muted line
|
|
247
247
|
const MENU_SEPARATOR_CLASS =
|
|
248
248
|
"mx-0 my-[3px] h-px bg-[var(--design-editor-control-border)] opacity-80";
|
|
249
249
|
// Shortcut: right-aligned, muted, use system UI for symbol rendering
|