@agent-native/core 0.92.7 → 0.92.8
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 +1 -1
- package/corpus/core/CHANGELOG.md +12 -0
- package/corpus/core/docs/content/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/ar-SA/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/ar-SA/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/ar-SA/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/de-DE/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/de-DE/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/es-ES/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/es-ES/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/es-ES/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/fr-FR/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/fr-FR/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/fr-FR/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/hi-IN/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/hi-IN/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/hi-IN/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/ja-JP/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/ja-JP/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/ja-JP/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/ko-KR/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/ko-KR/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/ko-KR/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/pt-BR/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/pt-BR/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/pt-BR/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/zh-CN/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/zh-CN/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-CN/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/locales/zh-TW/a2a-protocol.mdx +12 -0
- package/corpus/core/docs/content/locales/zh-TW/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-TW/pure-agent-apps.mdx +4 -0
- package/corpus/core/docs/content/pr-visual-recap.mdx +3 -3
- package/corpus/core/docs/content/pure-agent-apps.mdx +22 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/engine/builtin.ts +1 -1
- package/corpus/core/src/agent/model-config.ts +30 -30
- package/corpus/core/src/agent/production-agent.ts +129 -7
- package/corpus/core/src/cli/design-connect.ts +438 -83
- package/corpus/core/src/cli/recap.ts +2 -2
- package/corpus/core/src/client/AgentPanel.tsx +8 -1
- package/corpus/core/src/client/agent-chat-adapter.ts +12 -7
- package/corpus/core/src/client/composer/TiptapComposer.tsx +1 -1
- package/corpus/core/src/client/index.ts +4 -0
- package/corpus/core/src/client/org/TeamPage.tsx +41 -26
- package/corpus/core/src/client/use-action.ts +113 -1
- package/corpus/core/src/db/client.ts +12 -2
- package/corpus/core/src/db/create-get-db.ts +4 -1
- package/corpus/core/src/scripts/agent-engines/manage-agent-engine.ts +1 -1
- package/corpus/core/src/scripts/agent-engines/set-agent-engine.ts +1 -1
- package/corpus/core/src/server/transcribe-voice.ts +1 -1
- package/corpus/core/src/usage/store.ts +13 -4
- package/corpus/core/src/vite/client.ts +38 -1
- package/corpus/templates/analytics/AGENTS.md +3 -0
- package/corpus/templates/analytics/actions/get-data-program.ts +78 -0
- package/corpus/templates/analytics/actions/list-data-programs.ts +49 -0
- package/corpus/templates/analytics/app/global.css +11 -0
- package/corpus/templates/analytics/app/hooks/use-dashboard-chat-context.ts +163 -17
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/analytics/app/i18n-data.ts +20 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +96 -3
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +3 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +61 -4
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +40 -2
- package/corpus/templates/analytics/changelog/2026-07-09-analytics-no-longer-forgets-successful-data-queries-when-a-l.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-09-dashboard-charts-keep-consistent-spacing-when-they-stack-ver.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-09-dashboard-charts-tables-and-extensions-can-be-selected-and-d.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-09-long-running-analytics-requests-now-recover-automatically-wh.md +6 -0
- package/corpus/templates/analytics/server/db/index.ts +6 -0
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +1 -7
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +102 -15
- package/corpus/templates/content/app/hooks/use-content-database.ts +52 -0
- package/corpus/templates/content/app/hooks/use-document-properties.ts +50 -6
- package/corpus/templates/content/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/content/app/i18n-data.ts +28 -0
- package/corpus/templates/content/changelog/2026-07-09-notion-conflict-warnings-no-longer-flash-during-normal-synce.md +6 -0
- package/corpus/templates/content/changelog/2026-07-09-property-menus-and-delete-confirmations-now-open-visibly-and.md +6 -0
- package/corpus/templates/content/server/lib/notion-sync.ts +130 -28
- package/corpus/templates/design/actions/add-breakpoint.ts +48 -68
- package/corpus/templates/design/actions/add-localhost-screens.ts +496 -61
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +2 -18
- package/corpus/templates/design/actions/apply-design-token-edit.ts +51 -82
- package/corpus/templates/design/actions/apply-tweaks.ts +63 -41
- package/corpus/templates/design/actions/capture-design-state.ts +2 -2
- package/corpus/templates/design/actions/connect-localhost.ts +58 -12
- package/corpus/templates/design/actions/create-component.ts +2 -18
- package/corpus/templates/design/actions/create-design-branch.ts +38 -18
- package/corpus/templates/design/actions/create-fusion-app.ts +15 -11
- package/corpus/templates/design/actions/delete-file.ts +19 -34
- package/corpus/templates/design/actions/deploy-design-preview.ts +59 -27
- package/corpus/templates/design/actions/deploy-fusion-app.ts +22 -15
- package/corpus/templates/design/actions/export-pdf.ts +2 -1
- package/corpus/templates/design/actions/export-zip.ts +9 -3
- package/corpus/templates/design/actions/generate-design.ts +107 -70
- package/corpus/templates/design/actions/get-component-details.ts +2 -18
- package/corpus/templates/design/actions/get-design-branch-diff.ts +2 -3
- package/corpus/templates/design/actions/get-design-surface-index.ts +2 -18
- package/corpus/templates/design/actions/get-design.ts +2 -1
- package/corpus/templates/design/actions/grant-localhost-write-consent.ts +7 -1
- package/corpus/templates/design/actions/import-design-tokens.ts +114 -76
- package/corpus/templates/design/actions/index-components.ts +2 -18
- package/corpus/templates/design/actions/list-design-source-capabilities.ts +23 -28
- package/corpus/templates/design/actions/list-local-files.ts +9 -2
- package/corpus/templates/design/actions/migrate-board-objects-to-file.ts +82 -98
- package/corpus/templates/design/actions/open-component-source.ts +2 -18
- package/corpus/templates/design/actions/open-visual-edit.ts +19 -1
- package/corpus/templates/design/actions/present-design-variants.ts +70 -70
- package/corpus/templates/design/actions/preview-component-prop-edit.ts +4 -14
- package/corpus/templates/design/actions/read-local-file.ts +9 -2
- package/corpus/templates/design/actions/remove-breakpoint.ts +40 -61
- package/corpus/templates/design/actions/rename-screen.ts +425 -0
- package/corpus/templates/design/actions/request-localhost-write-consent.ts +12 -2
- package/corpus/templates/design/actions/revoke-localhost-write-consent.ts +9 -2
- package/corpus/templates/design/actions/sync-fusion-app.ts +56 -39
- package/corpus/templates/design/actions/update-design.ts +376 -61
- package/corpus/templates/design/actions/update-file.ts +455 -188
- package/corpus/templates/design/actions/write-local-file.ts +10 -2
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +685 -608
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +43 -15
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +576 -2015
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +62 -14
- package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +263 -25
- package/corpus/templates/design/app/components/design/design-canvas/annotation-submit.ts +34 -0
- package/corpus/templates/design/app/components/design/design-canvas/coordinate-transforms.ts +40 -0
- package/corpus/templates/design/app/components/design/design-canvas/creation.ts +47 -0
- package/corpus/templates/design/app/components/design/design-canvas/element-payload.ts +27 -0
- package/corpus/templates/design/app/components/design/design-canvas/embedded-frame.ts +62 -0
- package/corpus/templates/design/app/components/design/design-canvas/external-preview.ts +137 -0
- package/corpus/templates/design/app/components/design/design-canvas/file-drop.ts +10 -0
- package/corpus/templates/design/app/components/design/design-canvas/hit-test.ts +23 -0
- package/corpus/templates/design/app/components/design/design-canvas/iframe-events.ts +23 -0
- package/corpus/templates/design/app/components/design/design-canvas/iframe-pan.ts +177 -0
- package/corpus/templates/design/app/components/design/design-canvas/motion-types.ts +7 -0
- package/corpus/templates/design/app/components/design/design-canvas/pending-text-edit.ts +62 -0
- package/corpus/templates/design/app/components/design/index.ts +2 -2
- package/corpus/templates/design/app/components/design/multi-screen/canvas-tools.ts +100 -0
- package/corpus/templates/design/app/components/design/multi-screen/coordinate-transforms.ts +81 -0
- package/corpus/templates/design/app/components/design/multi-screen/cross-screen-drop.ts +23 -13
- package/corpus/templates/design/app/components/design/multi-screen/culling.ts +238 -19
- package/corpus/templates/design/app/components/design/multi-screen/draft-primitives.ts +424 -0
- package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +341 -0
- package/corpus/templates/design/app/components/design/multi-screen/iframe-targeting.ts +52 -0
- package/corpus/templates/design/app/components/design/multi-screen/overview-layout.ts +62 -0
- package/corpus/templates/design/app/components/design/multi-screen/primitive-drop-target.ts +283 -0
- package/corpus/templates/design/app/components/design/multi-screen/screen-content-cache.ts +272 -0
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +5 -1
- package/corpus/templates/design/app/components/design/multi-screen/wheel-gesture-state.ts +12 -0
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +325 -84
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +15 -1
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +119 -47
- package/corpus/templates/design/app/i18n/zh-TW.ts +9 -0
- package/corpus/templates/design/app/i18n-data.ts +223 -0
- package/corpus/templates/design/app/lib/design-save-outbox.ts +379 -0
- package/corpus/templates/design/app/lib/png-clipboard.ts +113 -0
- package/corpus/templates/design/app/pages/design-editor/canvas-primitives.ts +229 -0
- package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +918 -0
- package/corpus/templates/design/app/pages/design-editor/collab-sync.ts +43 -0
- package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +336 -0
- package/corpus/templates/design/app/pages/design-editor/data-operations.ts +270 -0
- package/corpus/templates/design/app/pages/design-editor/dom-guards.ts +24 -0
- package/corpus/templates/design/app/pages/design-editor/dom-utils.ts +11 -0
- package/corpus/templates/design/app/pages/design-editor/editor-session.ts +20 -0
- package/corpus/templates/design/app/pages/design-editor/editor-state.ts +408 -0
- package/corpus/templates/design/app/pages/design-editor/export-capture.ts +115 -0
- package/corpus/templates/design/app/pages/design-editor/geometry-persistence.ts +93 -0
- package/corpus/templates/design/app/pages/design-editor/history.ts +169 -0
- package/corpus/templates/design/app/pages/design-editor/layout-operations.ts +185 -0
- package/corpus/templates/design/app/pages/design-editor/motion-state.ts +309 -0
- package/corpus/templates/design/app/pages/design-editor/overview-camera.ts +438 -0
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +510 -0
- package/corpus/templates/design/app/pages/design-editor/portable-style.ts +115 -0
- package/corpus/templates/design/app/pages/design-editor/selection-state.ts +337 -0
- package/corpus/templates/design/app/pages/design-editor/style-utils.ts +5 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +92 -0
- package/corpus/templates/design/app/pages/design-editor/tweak-save.ts +87 -0
- package/corpus/templates/design/app/pages/design-editor/types.ts +36 -0
- package/corpus/templates/design/app/routes/design.$id.tsx +11 -1
- package/corpus/templates/design/changelog/2026-07-09-design-edits-canvas-positions-tools-and-tab-context-now-pers.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-figma-style-shortcuts-drawing-annotations-and-cross-screen-d.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-hand-and-scale-tools-now-keep-their-active-toolbar-identity-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-large-multi-screen-designs-now-stay-responsive-during-long-c.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-layer-drags-now-land-exactly-where-the-insertion-indicator-s.md +6 -0
- package/corpus/templates/design/server/db/index.ts +2 -52
- package/corpus/templates/design/server/db/schema.ts +16 -0
- package/corpus/templates/design/server/lib/design-data-access.ts +70 -0
- package/corpus/templates/design/server/lib/design-data-mutation.ts +249 -0
- package/corpus/templates/design/server/lib/fusion-screens.ts +89 -76
- package/corpus/templates/design/server/lib/import-design-files.ts +76 -35
- package/corpus/templates/design/server/lib/verify-write-grant.ts +7 -2
- package/corpus/templates/design/server/plugins/db.ts +19 -0
- package/corpus/templates/design/server/source-workspace.ts +12 -13
- package/corpus/templates/design/shared/resolve-tweaks.ts +15 -0
- package/corpus/templates/design/shared/screen-rename.ts +42 -0
- package/corpus/templates/design/shared/source-mode.ts +84 -4
- package/dist/agent/engine/builder-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builtin.js +1 -1
- package/dist/agent/engine/builtin.js.map +1 -1
- package/dist/agent/model-config.d.ts +9 -9
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +30 -30
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/production-agent.d.ts +60 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +106 -7
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/design-connect.d.ts +30 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +359 -75
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/recap.js +2 -2
- package/dist/cli/recap.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +10 -5
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/composer/TiptapComposer.js +1 -1
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/org/TeamPage.d.ts.map +1 -1
- package/dist/client/org/TeamPage.js +6 -5
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/use-action.d.ts +32 -0
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +68 -1
- package/dist/client/use-action.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.d.ts +3 -0
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +7 -2
- package/dist/db/client.js.map +1 -1
- package/dist/db/create-get-db.d.ts.map +1 -1
- package/dist/db/create-get-db.js +2 -2
- package/dist/db/create-get-db.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/scripts/agent-engines/manage-agent-engine.js +1 -1
- package/dist/scripts/agent-engines/manage-agent-engine.js.map +1 -1
- package/dist/scripts/agent-engines/set-agent-engine.js +1 -1
- package/dist/scripts/agent-engines/set-agent-engine.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/transcribe-voice.js +1 -1
- package/dist/server/transcribe-voice.js.map +1 -1
- package/dist/usage/store.d.ts.map +1 -1
- package/dist/usage/store.js +13 -4
- package/dist/usage/store.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +36 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/a2a-protocol.mdx +12 -0
- package/docs/content/locales/ar-SA/a2a-protocol.mdx +12 -0
- package/docs/content/locales/ar-SA/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/ar-SA/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/de-DE/a2a-protocol.mdx +12 -0
- package/docs/content/locales/de-DE/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/de-DE/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/es-ES/a2a-protocol.mdx +12 -0
- package/docs/content/locales/es-ES/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/es-ES/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/fr-FR/a2a-protocol.mdx +12 -0
- package/docs/content/locales/fr-FR/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/fr-FR/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/hi-IN/a2a-protocol.mdx +12 -0
- package/docs/content/locales/hi-IN/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/hi-IN/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/ja-JP/a2a-protocol.mdx +12 -0
- package/docs/content/locales/ja-JP/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/ja-JP/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/ko-KR/a2a-protocol.mdx +12 -0
- package/docs/content/locales/ko-KR/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/ko-KR/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/pt-BR/a2a-protocol.mdx +12 -0
- package/docs/content/locales/pt-BR/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/pt-BR/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/zh-CN/a2a-protocol.mdx +12 -0
- package/docs/content/locales/zh-CN/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/zh-CN/pure-agent-apps.mdx +4 -0
- package/docs/content/locales/zh-TW/a2a-protocol.mdx +12 -0
- package/docs/content/locales/zh-TW/pr-visual-recap.mdx +3 -3
- package/docs/content/locales/zh-TW/pure-agent-apps.mdx +4 -0
- package/docs/content/pr-visual-recap.mdx +3 -3
- package/docs/content/pure-agent-apps.mdx +22 -0
- package/package.json +2 -2
|
@@ -14,6 +14,7 @@ export type DesignHotkeyTool =
|
|
|
14
14
|
| "pen"
|
|
15
15
|
| "hand"
|
|
16
16
|
| "comment"
|
|
17
|
+
| "draw"
|
|
17
18
|
| "scale";
|
|
18
19
|
|
|
19
20
|
export type DesignHotkeyDirection = "up" | "right" | "down" | "left";
|
|
@@ -97,17 +98,26 @@ export interface UseDesignHotkeysProps {
|
|
|
97
98
|
onPenTool?: DesignHotkeyHandler;
|
|
98
99
|
onHandTool?: DesignHotkeyHandler;
|
|
99
100
|
onCommentTool?: DesignHotkeyHandler;
|
|
101
|
+
onDrawTool?: DesignHotkeyHandler;
|
|
100
102
|
onScaleTool?: DesignHotkeyHandler;
|
|
101
103
|
onCopy?: DesignHotkeyHandler;
|
|
104
|
+
/** Figma's Shift+Cmd/Ctrl+C — render the current selection and write it to
|
|
105
|
+
* the system clipboard as a real image/png ClipboardItem. */
|
|
106
|
+
onCopyAsPng?: DesignHotkeyHandler;
|
|
102
107
|
onCut?: DesignHotkeyHandler;
|
|
103
108
|
onPaste?: DesignHotkeyHandler;
|
|
104
109
|
onPasteOver?: DesignHotkeyHandler;
|
|
105
110
|
onCopyProps?: DesignHotkeyHandler;
|
|
106
111
|
onPasteProps?: DesignHotkeyHandler;
|
|
107
|
-
onCopyAsCode?: DesignHotkeyHandler;
|
|
108
112
|
onDuplicate?: DesignHotkeyHandler;
|
|
109
113
|
onDelete?: DesignHotkeyHandler;
|
|
110
114
|
onRename?: DesignHotkeyHandler;
|
|
115
|
+
/** Figma's Cmd/Ctrl+F — open and focus the layer search surface. */
|
|
116
|
+
onFind?: DesignHotkeyHandler;
|
|
117
|
+
/** Figma's Option/Alt+1 — open the File/Layers navigation panel. */
|
|
118
|
+
onShowLayersPanel?: DesignHotkeyHandler;
|
|
119
|
+
/** Figma's Option/Alt+2 — open the Assets navigation panel. */
|
|
120
|
+
onShowAssetsPanel?: DesignHotkeyHandler;
|
|
111
121
|
onSelectAll?: DesignHotkeyHandler;
|
|
112
122
|
onGroup?: DesignHotkeyHandler;
|
|
113
123
|
onUngroup?: DesignHotkeyHandler;
|
|
@@ -122,15 +132,16 @@ export interface UseDesignHotkeysProps {
|
|
|
122
132
|
onSendToBack?: DesignHotkeyHandler;
|
|
123
133
|
onEscape?: DesignHotkeyHandler;
|
|
124
134
|
onEnter?: DesignHotkeyHandler;
|
|
135
|
+
onSelectParent?: DesignHotkeyHandler;
|
|
125
136
|
onTab?: DesignHotkeyTabHandler;
|
|
137
|
+
onNextFrame?: DesignHotkeyHandler;
|
|
138
|
+
onPreviousFrame?: DesignHotkeyHandler;
|
|
126
139
|
onNudge?: DesignHotkeyNudgeHandler;
|
|
127
140
|
onZoomIn?: DesignHotkeyHandler;
|
|
128
141
|
onZoomOut?: DesignHotkeyHandler;
|
|
129
142
|
onZoomReset?: DesignHotkeyHandler;
|
|
130
143
|
onZoomToFit?: DesignHotkeyHandler;
|
|
131
144
|
onZoomToSelection?: DesignHotkeyHandler;
|
|
132
|
-
/** Figma's Shift+0 — zoom to 100%. Distinct from onZoomReset (Cmd+0). */
|
|
133
|
-
onZoomTo100?: DesignHotkeyHandler;
|
|
134
145
|
/** Figma's Cmd+Alt+K — create component from the current selection. */
|
|
135
146
|
onCreateComponent?: DesignHotkeyHandler;
|
|
136
147
|
/**
|
|
@@ -155,9 +166,9 @@ export interface UseDesignHotkeysProps {
|
|
|
155
166
|
* internal canvas clipboard's contents. */
|
|
156
167
|
onPasteToReplace?: DesignHotkeyHandler;
|
|
157
168
|
/**
|
|
158
|
-
* Figma's
|
|
159
|
-
* apply it to the current selection. A one-shot
|
|
160
|
-
*
|
|
169
|
+
* Figma's Control+C on Apple platforms — eyedropper: sample a color from
|
|
170
|
+
* anywhere on screen and apply it to the current selection. A one-shot
|
|
171
|
+
* action, not a persistent tool.
|
|
161
172
|
*/
|
|
162
173
|
onEyedropper?: DesignHotkeyHandler;
|
|
163
174
|
/**
|
|
@@ -168,8 +179,8 @@ export interface UseDesignHotkeysProps {
|
|
|
168
179
|
*/
|
|
169
180
|
onAlignSelection?: DesignHotkeyAlignHandler;
|
|
170
181
|
/**
|
|
171
|
-
* Figma's Alt+
|
|
172
|
-
*
|
|
182
|
+
* Figma's Ctrl+Alt+H / Ctrl+Alt+V — distribute the selection evenly along
|
|
183
|
+
* the horizontal/vertical axis (3+ objects; first/last stay put).
|
|
173
184
|
*/
|
|
174
185
|
onDistributeSelection?: DesignHotkeyDistributeHandler;
|
|
175
186
|
/** Figma's Ctrl+Alt+T (literal Control on every platform, not Cmd) — Tidy
|
|
@@ -194,18 +205,15 @@ const TOOL_SHORTCUTS: Record<
|
|
|
194
205
|
> = {
|
|
195
206
|
v: { tool: "move", handler: "onMoveTool" },
|
|
196
207
|
f: { tool: "frame", handler: "onFrameTool" },
|
|
197
|
-
// Figma binds BOTH F and A to the frame tool; A is the muscle-memory
|
|
198
|
-
// favorite. Cmd+A (select all) is unaffected — tool shortcuts only fire
|
|
199
|
-
// with no modifiers held.
|
|
200
|
-
a: { tool: "frame", handler: "onFrameTool" },
|
|
201
208
|
r: { tool: "rectangle", handler: "onRectangleTool" },
|
|
202
209
|
o: { tool: "ellipse", handler: "onEllipseTool" },
|
|
203
210
|
l: { tool: "line", handler: "onLineTool" },
|
|
204
211
|
t: { tool: "text", handler: "onTextTool" },
|
|
205
212
|
p: { tool: "pen", handler: "onPenTool" },
|
|
206
213
|
h: { tool: "hand", handler: "onHandTool" },
|
|
207
|
-
c: { tool: "comment", handler: "onCommentTool" },
|
|
208
214
|
k: { tool: "scale", handler: "onScaleTool" },
|
|
215
|
+
c: { tool: "comment", handler: "onCommentTool" },
|
|
216
|
+
y: { tool: "draw", handler: "onDrawTool" },
|
|
209
217
|
};
|
|
210
218
|
|
|
211
219
|
// H1: shift+key variants of a base tool shortcut (Figma muscle-memory), e.g.
|
|
@@ -410,12 +418,6 @@ function handleDesignHotkey(
|
|
|
410
418
|
props[toolShortcut.handler] as DesignHotkeyHandler | undefined,
|
|
411
419
|
);
|
|
412
420
|
}
|
|
413
|
-
// Figma's "I" — eyedropper. Deliberately NOT in TOOL_SHORTCUTS: it's a
|
|
414
|
-
// one-shot sample-and-apply action, not a persistent armed tool (no
|
|
415
|
-
// onToolChange call, no cursor mode to stay in).
|
|
416
|
-
if (key === "i") {
|
|
417
|
-
return run(props.onEyedropper);
|
|
418
|
-
}
|
|
419
421
|
}
|
|
420
422
|
|
|
421
423
|
if (event.key in ARROW_DIRECTIONS && !primary && !event.altKey) {
|
|
@@ -424,12 +426,16 @@ function handleDesignHotkey(
|
|
|
424
426
|
|
|
425
427
|
if (event.key === "Escape") return run(props.onEscape);
|
|
426
428
|
if (event.key === "Enter") return run(props.onEnter);
|
|
429
|
+
if (!primary && !event.altKey && !event.shiftKey && key === "\\") {
|
|
430
|
+
return run(props.onSelectParent);
|
|
431
|
+
}
|
|
427
432
|
if (
|
|
428
433
|
event.key === "Tab" &&
|
|
429
434
|
props.onTab &&
|
|
430
435
|
// Ignore synthetic (non-trusted) Tab events dispatched by handleIframeHotkey
|
|
431
436
|
// unless they carry the iframe-hotkey marker. This keeps inspector field
|
|
432
|
-
// tabbing native while allowing real iframe canvas Tab presses to
|
|
437
|
+
// tabbing native while allowing real iframe canvas Tab presses to traverse
|
|
438
|
+
// layer siblings.
|
|
433
439
|
(event.isTrusted !== false ||
|
|
434
440
|
(event as KeyboardEvent & { __agentNativeIframeHotkey?: boolean })
|
|
435
441
|
.__agentNativeIframeHotkey === true) &&
|
|
@@ -444,15 +450,59 @@ function handleDesignHotkey(
|
|
|
444
450
|
return run(props.onDelete);
|
|
445
451
|
}
|
|
446
452
|
|
|
453
|
+
// Current Figma: Cmd+Backspace ungroups. This intentionally differs from
|
|
454
|
+
// the historical Shift+Cmd+G binding and must be checked after plain
|
|
455
|
+
// Backspace deletion has been ruled out.
|
|
456
|
+
if (primary && !event.altKey && !event.shiftKey && key === "Backspace") {
|
|
457
|
+
return run(props.onUngroup);
|
|
458
|
+
}
|
|
459
|
+
|
|
447
460
|
if (primary && key === "z") {
|
|
448
461
|
return event.shiftKey ? run(props.onRedo) : run(props.onUndo);
|
|
449
462
|
}
|
|
450
463
|
if (primary && key === "y") return run(props.onRedo);
|
|
451
|
-
|
|
464
|
+
// Figma Find uses the operating system's primary modifier, rather than
|
|
465
|
+
// treating literal Control and Command as interchangeable on macOS. Keep
|
|
466
|
+
// Ctrl+F available for platform/browser behavior on Apple devices while
|
|
467
|
+
// routing Cmd+F there and Ctrl+F everywhere else.
|
|
468
|
+
if (
|
|
469
|
+
isPlatformPrimaryModifier(event) &&
|
|
470
|
+
!event.altKey &&
|
|
471
|
+
!event.shiftKey &&
|
|
472
|
+
key === "f"
|
|
473
|
+
) {
|
|
474
|
+
return run(props.onFind);
|
|
475
|
+
}
|
|
476
|
+
if (primary && !event.altKey && !event.shiftKey && key === "a") {
|
|
477
|
+
return run(props.onSelectAll);
|
|
478
|
+
}
|
|
452
479
|
if (primary && key === "x") return run(props.onCut);
|
|
480
|
+
|
|
481
|
+
// Current Figma: Ctrl+Alt+H / Ctrl+Alt+V — distribute evenly. These use
|
|
482
|
+
// literal Control even on macOS, so resolve them before the primary+V
|
|
483
|
+
// Paste properties family can claim Ctrl+Alt+V.
|
|
484
|
+
if (event.ctrlKey && event.altKey && !event.metaKey && !event.shiftKey) {
|
|
485
|
+
if (key === "h") return runDistribute("horizontal");
|
|
486
|
+
if (key === "v") return runDistribute("vertical");
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// On macOS Figma reserves literal Control+C for Pick color while Cmd+C
|
|
490
|
+
// remains Copy. Keep Ctrl+C as Copy on non-Apple platforms, where Ctrl is
|
|
491
|
+
// the platform's primary modifier and Figma presents platform-specific
|
|
492
|
+
// shortcuts.
|
|
493
|
+
if (
|
|
494
|
+
isApplePlatform() &&
|
|
495
|
+
event.ctrlKey &&
|
|
496
|
+
!event.metaKey &&
|
|
497
|
+
!event.altKey &&
|
|
498
|
+
!event.shiftKey &&
|
|
499
|
+
key === "c"
|
|
500
|
+
) {
|
|
501
|
+
return run(props.onEyedropper);
|
|
502
|
+
}
|
|
453
503
|
if (primary && key === "c") {
|
|
454
504
|
if (event.altKey) return run(props.onCopyProps);
|
|
455
|
-
if (event.shiftKey) return run(props.
|
|
505
|
+
if (event.shiftKey) return run(props.onCopyAsPng);
|
|
456
506
|
return run(props.onCopy);
|
|
457
507
|
}
|
|
458
508
|
if (primary && key === "v") {
|
|
@@ -468,10 +518,8 @@ function handleDesignHotkey(
|
|
|
468
518
|
return run(props.onPasteToReplace);
|
|
469
519
|
}
|
|
470
520
|
if (primary && key === "r") return run(props.onRename);
|
|
471
|
-
// Cmd+Shift+H/L (hide/lock the current selection) must take precedence
|
|
472
|
-
//
|
|
473
|
-
// fires with no modifiers held, so there's no real conflict, but this is
|
|
474
|
-
// checked first defensively to guarantee primary+shift+h/l always wins).
|
|
521
|
+
// Cmd+Shift+H/L (hide/lock the current selection) must take precedence over
|
|
522
|
+
// the unmodified/shift-only h/l transform and alignment families.
|
|
475
523
|
if (primary && event.shiftKey && key === "h") {
|
|
476
524
|
return run(props.onToggleHidden);
|
|
477
525
|
}
|
|
@@ -479,10 +527,11 @@ function handleDesignHotkey(
|
|
|
479
527
|
return run(props.onToggleLocked);
|
|
480
528
|
}
|
|
481
529
|
if (primary && key === "g") {
|
|
482
|
-
// Figma:
|
|
483
|
-
//
|
|
484
|
-
|
|
530
|
+
// Figma: ⌥⌘G is "Frame selection". Current Figma ungroups with
|
|
531
|
+
// Cmd+Backspace, so the historical Shift+Cmd+G binding is deliberately
|
|
532
|
+
// left unhandled.
|
|
485
533
|
if (event.altKey) return run(props.onFrameSelection);
|
|
534
|
+
if (event.shiftKey) return false;
|
|
486
535
|
return run(props.onGroup);
|
|
487
536
|
}
|
|
488
537
|
|
|
@@ -515,17 +564,20 @@ function handleDesignHotkey(
|
|
|
515
564
|
}
|
|
516
565
|
|
|
517
566
|
const digit = digitFromEvent(event);
|
|
567
|
+
// Figma navigation tabs use literal Option/Alt, on both platforms. Resolve
|
|
568
|
+
// these before digit opacity so the physical Digit1/Digit2 keys never leak
|
|
569
|
+
// into selection styling when Alt is held (including Option-composed keys
|
|
570
|
+
// such as ¡ on macOS).
|
|
571
|
+
if (!primary && event.altKey && !event.shiftKey) {
|
|
572
|
+
if (digit === "1") return run(props.onShowLayersPanel);
|
|
573
|
+
if (digit === "2") return run(props.onShowAssetsPanel);
|
|
574
|
+
}
|
|
518
575
|
if (event.shiftKey && !primary && digit === "1") {
|
|
519
576
|
return run(props.onZoomToFit);
|
|
520
577
|
}
|
|
521
578
|
if (event.shiftKey && !primary && digit === "2") {
|
|
522
579
|
return run(props.onZoomToSelection);
|
|
523
580
|
}
|
|
524
|
-
// H2: Shift+0 — zoom to 100%. Distinct from Cmd+0 (onZoomReset above).
|
|
525
|
-
if (event.shiftKey && !primary && !event.altKey && digit === "0") {
|
|
526
|
-
return run(props.onZoomTo100);
|
|
527
|
-
}
|
|
528
|
-
|
|
529
581
|
// H2: plain digit 1-9/0 (no modifier) — set selection opacity. Figma maps
|
|
530
582
|
// 1-9 to 10%-90% and 0 to 100%. Only handled when nothing else claimed the
|
|
531
583
|
// digit (e.g. Shift+1/Shift+2 zoom above) and no modifier is held; the
|
|
@@ -562,6 +614,12 @@ function handleDesignHotkey(
|
|
|
562
614
|
return run(props.onSendToBack);
|
|
563
615
|
}
|
|
564
616
|
|
|
617
|
+
// Current Figma reserves N / Shift+N for moving to the next / previous
|
|
618
|
+
// frame. Tab remains layer-sibling traversal and is handled above.
|
|
619
|
+
if (!primary && !event.altKey && key === "n") {
|
|
620
|
+
return event.shiftKey ? run(props.onPreviousFrame) : run(props.onNextFrame);
|
|
621
|
+
}
|
|
622
|
+
|
|
565
623
|
// H3: Shift+H / Shift+V — flip selection horizontal/vertical. Checked
|
|
566
624
|
// after the primary+shift h/l (hide/lock) branch above so Cmd+Shift+H
|
|
567
625
|
// still wins; h/v aren't in SHIFT_TOOL_SHORTCUTS so there's no real
|
|
@@ -579,15 +637,6 @@ function handleDesignHotkey(
|
|
|
579
637
|
return run(props.onSwapFillStroke);
|
|
580
638
|
}
|
|
581
639
|
|
|
582
|
-
// Figma: Alt+Shift+H / Alt+Shift+V — distribute the selection evenly along
|
|
583
|
-
// the horizontal/vertical axis. Checked BEFORE the plain Alt+H/Alt+V align
|
|
584
|
-
// bindings below so the shift-held distribute variant always wins over the
|
|
585
|
-
// no-shift align variant for the same letter.
|
|
586
|
-
if (!primary && event.altKey && event.shiftKey) {
|
|
587
|
-
if (key === "h") return runDistribute("horizontal");
|
|
588
|
-
if (key === "v") return runDistribute("vertical");
|
|
589
|
-
}
|
|
590
|
-
|
|
591
640
|
// Figma: Alt+A/D/W/S/H/V — align the selection to left/right/top/bottom/
|
|
592
641
|
// center-h/center-v. Alt-only (no cmd, no shift — shift+h/v are the
|
|
593
642
|
// distribute bindings just above, shift+a is Add auto layout below).
|
|
@@ -603,13 +652,18 @@ function handleDesignHotkey(
|
|
|
603
652
|
// Figma: Ctrl+Alt+T — Tidy up. A rare Figma shortcut that stays literal
|
|
604
653
|
// Control on every platform (never remapped to Cmd on Mac), so this checks
|
|
605
654
|
// event.ctrlKey directly instead of the combined `primary` flag.
|
|
606
|
-
if (
|
|
655
|
+
if (
|
|
656
|
+
event.ctrlKey &&
|
|
657
|
+
event.altKey &&
|
|
658
|
+
!event.metaKey &&
|
|
659
|
+
!event.shiftKey &&
|
|
660
|
+
key === "t"
|
|
661
|
+
) {
|
|
607
662
|
return run(props.onTidyUp);
|
|
608
663
|
}
|
|
609
664
|
|
|
610
|
-
// Figma: Shift+A — Add auto layout.
|
|
611
|
-
//
|
|
612
|
-
// no "a" entry, so this can't shadow either.
|
|
665
|
+
// Figma: Shift+A — Add auto layout. Plain A is intentionally unbound in
|
|
666
|
+
// current Figma, so this shift-only command cannot shadow another tool.
|
|
613
667
|
if (!primary && !event.altKey && event.shiftKey && key === "a") {
|
|
614
668
|
return run(props.onAddAutoLayout);
|
|
615
669
|
}
|
|
@@ -668,6 +722,24 @@ const ALT_CODE_KEYS: Record<string, string> = {
|
|
|
668
722
|
BracketLeft: "[",
|
|
669
723
|
};
|
|
670
724
|
|
|
725
|
+
function isApplePlatform() {
|
|
726
|
+
if (typeof navigator === "undefined") return false;
|
|
727
|
+
const userAgentDataPlatform = (
|
|
728
|
+
navigator as Navigator & {
|
|
729
|
+
userAgentData?: { platform?: string };
|
|
730
|
+
}
|
|
731
|
+
).userAgentData?.platform;
|
|
732
|
+
return /Mac|iPhone|iPad|iPod/i.test(
|
|
733
|
+
userAgentDataPlatform || navigator.platform || "",
|
|
734
|
+
);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
function isPlatformPrimaryModifier(event: KeyboardEvent) {
|
|
738
|
+
return isApplePlatform()
|
|
739
|
+
? event.metaKey && !event.ctrlKey
|
|
740
|
+
: event.ctrlKey && !event.metaKey;
|
|
741
|
+
}
|
|
742
|
+
|
|
671
743
|
function normalizedKey(event: KeyboardEvent) {
|
|
672
744
|
if (event.key === " ") return "space";
|
|
673
745
|
// Alt-held combos: derive the letter/punctuation from the physical key
|
|
@@ -620,8 +620,11 @@ const messages = {
|
|
|
620
620
|
"agent-structural-edit": "結構移動需要代理",
|
|
621
621
|
},
|
|
622
622
|
toasts: {
|
|
623
|
+
annotationSendError: "無法傳送註解。你的繪圖仍保留在這裡,請再試一次。",
|
|
623
624
|
componentCreated: "元件已建立",
|
|
624
625
|
componentCreateFailed: "無法建立元件",
|
|
626
|
+
tweakConflict: "調整已在其他地方變更。請重新整理設計後再試一次。",
|
|
627
|
+
tweakSaveNotDurable: "調整尚未儲存。請保持此分頁開啟並再試一次。",
|
|
625
628
|
codingHandoffError: "無法建立編碼交接",
|
|
626
629
|
codingHandoffCopied: "編碼交接已複製",
|
|
627
630
|
clipboardBlocked: "剪貼簿被阻止",
|
|
@@ -634,6 +637,12 @@ const messages = {
|
|
|
634
637
|
openScreenPng: "匯出 PNG 前請先開啟一個螢幕",
|
|
635
638
|
pngCreateError: "無法建立 PNG 下載",
|
|
636
639
|
pngDownloaded: "PNG 已下載",
|
|
640
|
+
pngCopied: "PNG 已複製到剪貼簿",
|
|
641
|
+
pngClipboardUnsupported: "此瀏覽器無法將 PNG 圖像複製到剪貼簿",
|
|
642
|
+
pngClipboardBlocked: "請允許存取剪貼簿以複製此 PNG",
|
|
643
|
+
pngClipboardWriteError: "無法將 PNG 複製到剪貼簿",
|
|
644
|
+
pngLivePreviewUnavailable: "URL 支援的畫面暫不支援 PNG 擷取",
|
|
645
|
+
pngReadOnlyUnavailable: "唯讀預覽不支援 PNG 擷取",
|
|
637
646
|
pngSaveError: "無法儲存 PNG",
|
|
638
647
|
pngExportError: "無法匯出 PNG",
|
|
639
648
|
openScreenSvg: "匯出 SVG 前請先開啟一個螢幕",
|