@agent-native/core 0.92.10 → 0.92.11
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 +23 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +181 -15
- package/corpus/core/src/agent/run-manager.ts +31 -4
- package/corpus/core/src/agent/run-store.ts +80 -0
- package/corpus/core/src/cli/design-connect.ts +433 -151
- package/corpus/core/src/cli/skills.ts +14 -0
- package/corpus/core/src/client/AssistantChat.tsx +25 -0
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +40 -6
- package/corpus/core/src/client/agent-chat.ts +165 -1
- package/corpus/core/src/client/chat/index.ts +9 -1
- package/corpus/core/src/client/extensions/EmbeddedExtension.tsx +38 -2
- package/corpus/core/src/client/index.ts +5 -0
- package/corpus/core/src/client/rich-markdown-editor/useCollabReconcile.ts +18 -7
- package/corpus/core/src/collab/awareness-store.ts +23 -12
- package/corpus/core/src/collab/client.ts +16 -5
- package/corpus/core/src/collab/index.ts +4 -0
- package/corpus/core/src/collab/recent-edits.ts +65 -2
- package/corpus/core/src/index.browser.ts +1 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +98 -11
- package/corpus/core/src/server/builder-design-systems.ts +30 -4
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +1 -1
- package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +12 -6
- package/corpus/templates/clips/AGENTS.md +4 -0
- package/corpus/templates/clips/actions/create-recording.ts +2 -0
- package/corpus/templates/clips/actions/lib/create-recording-schema.ts +5 -3
- package/corpus/templates/clips/actions/request-transcript.ts +102 -33
- package/corpus/templates/clips/app/components/library/library-grid.tsx +1 -0
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +59 -19
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +48 -4
- package/corpus/templates/clips/app/components/player/video-player.tsx +17 -12
- package/corpus/templates/clips/app/i18n/ar-SA.ts +1 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +1 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +1 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +1 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +1 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +1 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +1 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +1 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +1 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +1 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +70 -37
- package/corpus/templates/clips/app/routes/record.tsx +17 -4
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +2 -0
- package/corpus/templates/clips/changelog/2026-07-09-desktop-popover-sits-closer-to-the-menu-bar.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-desktop-recording-optimization-progress-stays-visible-until-the-clip-opens.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-fixed-large-video-file-uploads-failing-before-their-resumabl.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-fixed-new-video-uploads-defaulting-to-private.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-long-recordings-now-get-enough-time-to-download-their-media-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-meeting-notes-no-longer-lowers-your-microphone-volume-for-ot.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-on-mobile-tapping-a-playing-clip-reveals-playback-controls-w.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-regenerate-any-clip-transcript-from-its-saved-recording-or-r.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-09-slack-previews-now-show-the-clip-length-alongside-its-descri.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +12 -2
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +8 -1
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +8 -5
- package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +5 -5
- package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +3 -0
- package/corpus/templates/clips/desktop/src/styles.css +6 -3
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +29 -11
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1 -1
- package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +103 -21
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +117 -39
- package/corpus/templates/clips/server/lib/slack-unfurls.ts +20 -1
- package/corpus/templates/clips/server/lib/streaming-upload-mode.ts +10 -4
- package/corpus/templates/clips/shared/recording-core.ts +12 -0
- package/corpus/templates/content/AGENTS.md +7 -6
- package/corpus/templates/content/actions/_document-flush.ts +132 -17
- package/corpus/templates/content/actions/_notion-action-utils.ts +15 -0
- package/corpus/templates/content/actions/create-and-link-notion-page.ts +2 -0
- package/corpus/templates/content/actions/link-notion-page.ts +2 -0
- package/corpus/templates/content/actions/pull-document.ts +5 -7
- package/corpus/templates/content/actions/pull-notion-page.ts +2 -0
- package/corpus/templates/content/actions/push-notion-page.ts +10 -0
- package/corpus/templates/content/actions/resolve-notion-sync-conflict.ts +2 -0
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +88 -23
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +32 -2
- package/corpus/templates/content/app/hooks/use-notion.ts +6 -6
- package/corpus/templates/content/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/content/app/i18n-data.ts +18 -0
- package/corpus/templates/content/changelog/2026-07-09-notion-conflict-choices-and-version-restores-preserve-docume.md +6 -0
- package/corpus/templates/content/server/lib/notion-sync.ts +80 -64
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +29 -2
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +86 -0
- package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +57 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +11 -0
- package/corpus/templates/design/AGENTS.md +45 -10
- package/corpus/templates/design/actions/add-localhost-screens.ts +66 -13
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +45 -36
- package/corpus/templates/design/actions/apply-motion-edit.ts +25 -31
- package/corpus/templates/design/actions/apply-shader-fill.ts +29 -42
- package/corpus/templates/design/actions/detach-component-instance.ts +337 -0
- package/corpus/templates/design/actions/export-design-as-figma-svg.ts +219 -0
- package/corpus/templates/design/actions/generate-design.ts +79 -12
- package/corpus/templates/design/actions/generate-screens.ts +57 -12
- package/corpus/templates/design/actions/get-figma-styles.ts +115 -0
- package/corpus/templates/design/actions/go-to-main-component.ts +254 -0
- package/corpus/templates/design/actions/grant-localhost-write-consent.ts +4 -3
- package/corpus/templates/design/actions/import-design-source.ts +4 -31
- package/corpus/templates/design/actions/import-figma-clipboard.ts +134 -0
- package/corpus/templates/design/actions/import-figma-frame.ts +95 -0
- package/corpus/templates/design/actions/index-design-system-with-builder.ts +16 -1
- package/corpus/templates/design/actions/list-design-components.ts +104 -0
- package/corpus/templates/design/actions/list-figma-library-assets.ts +1 -24
- package/corpus/templates/design/actions/open-component-source.ts +2 -4
- package/corpus/templates/design/actions/present-design-variants.ts +412 -16
- package/corpus/templates/design/actions/preview-source-edit.ts +14 -1
- package/corpus/templates/design/actions/run-design-audit.ts +25 -3
- package/corpus/templates/design/actions/show-design-questions.ts +10 -0
- package/corpus/templates/design/actions/swap-component-instance.ts +544 -0
- package/corpus/templates/design/actions/take-design-screenshot.ts +45 -60
- package/corpus/templates/design/actions/write-local-file.ts +25 -1
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +152 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1077 -58
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +5 -5
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +73 -21
- package/corpus/templates/design/app/components/design/EditPanel.tsx +16 -11
- package/corpus/templates/design/app/components/design/KeyboardShortcutsPanel.tsx +364 -0
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +180 -53
- package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +0 -2
- package/corpus/templates/design/app/components/design/MotionDock.tsx +144 -21
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1152 -167
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +27 -5
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +23 -2
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +63 -49
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +1293 -54
- package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +7 -0
- package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +6 -1
- package/corpus/templates/design/app/components/design/bridge/motion-preview.bridge.ts +23 -6
- package/corpus/templates/design/app/components/design/bridge/sample.bridge.ts +7 -0
- package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +5 -0
- package/corpus/templates/design/app/components/design/code-workbench/editor/MonacoHost.tsx +14 -2
- package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +37 -2
- package/corpus/templates/design/app/components/design/code-workbench/format/format-on-open-guard.ts +25 -0
- package/corpus/templates/design/app/components/design/code-workbench/format/format-on-open.ts +19 -1
- package/corpus/templates/design/app/components/design/code-workbench/model-registry.ts +43 -5
- package/corpus/templates/design/app/components/design/code-workbench/search/SearchView.tsx +27 -2
- package/corpus/templates/design/app/components/design/code-workbench/search/search-engine.ts +10 -1
- package/corpus/templates/design/app/components/design/code-workbench/store.tsx +19 -2
- package/corpus/templates/design/app/components/design/design-canvas/annotation-snapshot.ts +265 -0
- package/corpus/templates/design/app/components/design/design-canvas/annotation-submit.ts +16 -5
- package/corpus/templates/design/app/components/design/design-canvas/coordinate-transforms.ts +16 -2
- package/corpus/templates/design/app/components/design/design-canvas/embedded-frame.ts +7 -2
- package/corpus/templates/design/app/components/design/design-canvas/iframe-events.ts +3 -1
- package/corpus/templates/design/app/components/design/edit-panel/code-inspect-helpers.tsx +78 -8
- package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +451 -73
- package/corpus/templates/design/app/components/design/edit-panel/document-colors.ts +12 -4
- package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +398 -272
- package/corpus/templates/design/app/components/design/edit-panel/element-classification.ts +41 -7
- package/corpus/templates/design/app/components/design/edit-panel/element-identity.ts +16 -3
- package/corpus/templates/design/app/components/design/edit-panel/field-primitives.tsx +24 -4
- package/corpus/templates/design/app/components/design/edit-panel/fill-gradient-helpers.ts +222 -4
- package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +171 -78
- package/corpus/templates/design/app/components/design/edit-panel/inspector-controls.tsx +45 -5
- package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +299 -28
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +120 -150
- package/corpus/templates/design/app/components/design/edit-panel/position-helpers.ts +53 -1
- package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +284 -117
- package/corpus/templates/design/app/components/design/edit-panel/selection-helpers.ts +81 -0
- package/corpus/templates/design/app/components/design/edit-panel/stroke-properties.tsx +19 -14
- package/corpus/templates/design/app/components/design/edit-panel/style-options.ts +7 -0
- package/corpus/templates/design/app/components/design/edit-panel/typography-helpers.ts +155 -0
- package/corpus/templates/design/app/components/design/edit-panel/typography-properties.tsx +268 -46
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +350 -31
- package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +13 -4
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +233 -23
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +72 -2
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +51 -11
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +84 -11
- package/corpus/templates/design/app/components/design/inspector/index.ts +3 -0
- package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +552 -0
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +157 -0
- package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +53 -0
- package/corpus/templates/design/app/components/design/multi-screen/overview-layout.ts +184 -0
- package/corpus/templates/design/app/components/design/multi-screen/primitive-drop-target.ts +403 -26
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +20 -1
- package/corpus/templates/design/app/components/design/types.ts +33 -0
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +59 -7
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +119 -17
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +275 -63
- package/corpus/templates/design/app/hooks/use-question-flow.ts +14 -3
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +67 -10
- package/corpus/templates/design/app/i18n/zh-TW.ts +91 -1
- package/corpus/templates/design/app/i18n-data.ts +1217 -10
- package/corpus/templates/design/app/i18n-keyboard-shortcuts.ts +577 -0
- package/corpus/templates/design/app/lib/agent-chat.ts +23 -0
- package/corpus/templates/design/app/lib/design-import.ts +24 -0
- package/corpus/templates/design/app/lib/figma-clipboard.ts +157 -0
- package/corpus/templates/design/app/lib/figma-svg-copy.ts +221 -0
- package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +143 -30
- package/corpus/templates/design/app/pages/design-editor/collab-sync.ts +15 -0
- package/corpus/templates/design/app/pages/design-editor/editor-session.ts +33 -0
- package/corpus/templates/design/app/pages/design-editor/editor-state.ts +38 -0
- package/corpus/templates/design/app/pages/design-editor/overview-annotation-context.ts +157 -0
- package/corpus/templates/design/app/pages/design-editor/overview-camera.ts +62 -6
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +245 -0
- package/corpus/templates/design/app/pages/design-editor/react-semantic-handoff.ts +586 -0
- package/corpus/templates/design/app/pages/design-editor/screen-auto-layout.ts +169 -0
- package/corpus/templates/design/app/pages/design-editor/selection-state.ts +201 -1
- package/corpus/templates/design/changelog/2026-07-09-added-underline-strikethrough-and-text-case-uppercase-lowerc.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-annotate-now-draws-across-the-all-screens-canvas-without-swi.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-auto-layout-children-can-now-be-dragged-into-freeform-screen.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-board-shapes-now-stay-visible-and-nest-correctly-across-the-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-component-source-navigation-now-opens-reliably-from-the-insp.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-cross-screen-local-react-layer-moves-now-hand-off-exact-sour.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-cross-screen-moves-undo-and-redo-now-keep-both-screens-stabl.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-detach-a-component-instance-into-plain-editable-eleme.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-dragging-layers-into-auto-layout-now-respects-ignore-auto-la.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-drawing-annotations-sent-to-the-agent-now-include-a-rendered.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-editor-sidebars-now-use-figma-matched-default-widths-for-a-r.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-empty-frames-and-rectangles-now-expose-full-auto-layout-cont.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-export-any-design-screen-as-a-real-vector-svg-for-figma-with.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-grid-auto-layout-now-uses-true-responsive-rows-and-columns-w.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-hidden-and-locked-screens-now-behave-consistently-between-la.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-image-fills-now-preserve-valid-urls-and-layered-fit-settings.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-import-figma-frames-as-pixel-accurate-design-screens-via-a-s.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-inspect-code-now-hides-internal-styling-metadata-and-wraps-l.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-inspector-blur-and-shadow-effects-now-preserve-other-effects.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-jump-to-a-components-other-instances-from-the-inspecto.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-keyboard-shortcuts-are-now-discoverable-in-a-figma-style-bot.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-layer-selection-now-keeps-cmd-or-ctrl-toggles-and-shift-rang.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-layers-dropped-into-auto-layout-now-participate-correctly-in.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-live-edit-screens-now-enter-and-leave-full-view-withou.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-preview-urls-now-live-in-the-inspector-instead-of-taki.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-react-layers-can-now-be-hidden-and-locked-from-layers-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-react-layers-now-keep-exact-source-provenance-and-supp.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-local-react-visual-editing-now-loads-reliably-and-shows-live.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-paste-from-figma-cmd-v-now-imports-exact-editable-nodes-when.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-pressing-escape-after-selecting-a-screen-now-reveals-page-pr.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-right-click-overlapping-or-nested-objects-to-choose-the-exac.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-scale-edge-stretch-and-center-constraints-now-preserve-layer.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-screen-rows-can-now-be-reordered-in-layers-with-matching-can.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-screen-selection-stays-responsive-in-designs-with-hundreds-o.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-shift-a-now-enables-auto-layout-on-a-selected-screen-with-fl.md +6 -0
- package/corpus/templates/design/changelog/2026-07-09-swap-a-component-instance-for-another-from-the-libra.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-drawing-annotations-now-stay-available-to-retry-when-the.md +6 -0
- package/corpus/templates/design/e2e/global-setup.ts +3 -6
- package/corpus/templates/design/e2e/helpers.ts +27 -6
- package/corpus/templates/design/server/lib/design-to-figma-svg.ts +1412 -0
- package/corpus/templates/design/server/lib/figma-clipboard-match.ts +196 -0
- package/corpus/templates/design/server/lib/figma-node-import.ts +311 -0
- package/corpus/templates/design/server/lib/figma-node-to-html.ts +1334 -0
- package/corpus/templates/design/server/lib/figma-paste-fallback.ts +64 -0
- package/corpus/templates/design/server/lib/playwright-runtime.ts +78 -0
- package/corpus/templates/design/server/plugins/db.ts +41 -0
- package/corpus/templates/design/server/source-workspace.ts +64 -0
- package/corpus/templates/design/shared/board-file.ts +13 -2
- package/corpus/templates/design/shared/canvas-math.ts +231 -33
- package/corpus/templates/design/shared/code-layer.ts +122 -8
- package/corpus/templates/design/shared/component-library.ts +161 -0
- package/corpus/templates/design/shared/db-conflict.ts +27 -0
- package/corpus/templates/design/shared/design-source-capabilities.ts +2 -1
- package/corpus/templates/design/shared/figma-url.ts +149 -0
- package/corpus/templates/design/shared/pen-path.ts +16 -7
- package/corpus/templates/design/shared/source-mode.ts +1 -0
- package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +7 -19
- package/corpus/templates/plan/changelog/2026-07-09-canvas-panning-now-keeps-zoom-fixed-even-at-the-edges.md +6 -0
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +16 -1
- package/corpus/templates/slides/app/context/DeckContext.tsx +311 -70
- package/corpus/templates/slides/changelog/2026-07-09-fixed-the-slide-rail-going-permanently-stale-during-a-long-a.md +6 -0
- package/dist/agent/production-agent.d.ts +79 -6
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +161 -14
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +29 -5
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +46 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +61 -0
- package/dist/agent/run-store.js.map +1 -1
- package/dist/cli/design-connect.d.ts +6 -0
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +336 -139
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +14 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +2 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +19 -3
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +38 -18
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat.d.ts +60 -0
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +122 -1
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/chat/index.d.ts +1 -1
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js +1 -1
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/extensions/EmbeddedExtension.d.ts +12 -0
- package/dist/client/extensions/EmbeddedExtension.d.ts.map +1 -1
- package/dist/client/extensions/EmbeddedExtension.js +36 -2
- package/dist/client/extensions/EmbeddedExtension.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/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js +18 -6
- package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -1
- package/dist/collab/awareness-store.d.ts +5 -0
- package/dist/collab/awareness-store.d.ts.map +1 -1
- package/dist/collab/awareness-store.js +19 -12
- package/dist/collab/awareness-store.js.map +1 -1
- package/dist/collab/client.d.ts.map +1 -1
- package/dist/collab/client.js +13 -5
- package/dist/collab/client.js.map +1 -1
- package/dist/collab/index.d.ts +1 -0
- package/dist/collab/index.d.ts.map +1 -1
- package/dist/collab/index.js +1 -0
- package/dist/collab/index.js.map +1 -1
- package/dist/collab/recent-edits.d.ts +3 -1
- package/dist/collab/recent-edits.d.ts.map +1 -1
- package/dist/collab/recent-edits.js +57 -2
- package/dist/collab/recent-edits.js.map +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +87 -10
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/builder-design-systems.d.ts +15 -0
- package/dist/server/builder-design-systems.d.ts.map +1 -1
- package/dist/server/builder-design-systems.js +9 -4
- package/dist/server/builder-design-systems.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
IconMinus,
|
|
7
7
|
IconPlus,
|
|
8
8
|
} from "@tabler/icons-react";
|
|
9
|
-
import { useEffect, useState } from "react";
|
|
9
|
+
import { useEffect, useRef, useState } from "react";
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
Tooltip,
|
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
AutoLayoutMatrix,
|
|
20
20
|
ScrubInput,
|
|
21
21
|
SizingField,
|
|
22
|
+
type AutoLayoutFlow,
|
|
23
|
+
type AutoLayoutGridTrackSizing,
|
|
24
|
+
type AutoLayoutGridValue,
|
|
22
25
|
type AutoLayoutMatrixValue,
|
|
23
26
|
type ScrubInputChangeMeta,
|
|
24
27
|
} from "../inspector";
|
|
@@ -29,7 +32,6 @@ import {
|
|
|
29
32
|
commitElementMinMax,
|
|
30
33
|
commitElementSizing,
|
|
31
34
|
cssElementSize,
|
|
32
|
-
elementHasLayoutChildren,
|
|
33
35
|
horizontalToJustify,
|
|
34
36
|
inferElementSizing,
|
|
35
37
|
isContainerElement,
|
|
@@ -40,7 +42,7 @@ import {
|
|
|
40
42
|
} from "./element-classification";
|
|
41
43
|
import {
|
|
42
44
|
deriveLockedAspectSize,
|
|
43
|
-
|
|
45
|
+
elementStableKey,
|
|
44
46
|
useAspectRatioLock,
|
|
45
47
|
} from "./element-identity";
|
|
46
48
|
import { FieldTrailer, ScrubStyleInput } from "./field-primitives";
|
|
@@ -66,6 +68,146 @@ import {
|
|
|
66
68
|
parseNumericValue,
|
|
67
69
|
} from "./style-options";
|
|
68
70
|
|
|
71
|
+
/**
|
|
72
|
+
* The `justifyContent` to write when the primary-axis gap-mode toggle
|
|
73
|
+
* changes. "Auto" gap mode IS `justify-content: space-between` (see
|
|
74
|
+
* `spaceBetween` on `AutoLayoutMatrixValue`); switching back to "Fixed"
|
|
75
|
+
* should restore whichever packed alignment (flex-start/center/flex-end) was
|
|
76
|
+
* in effect before "Auto" was turned on, not hard-reset to flex-start —
|
|
77
|
+
* mirrors Figma, where turning off "Space between" returns to the
|
|
78
|
+
* previously chosen start/center/end packing instead of silently
|
|
79
|
+
* re-aligning everything to the start. `lastPackedJustify` is the caller's
|
|
80
|
+
* best-known non-"space-between" `justifyContent` (see
|
|
81
|
+
* `lastPackedJustifyRef` at the call site). Exported for tests.
|
|
82
|
+
*/
|
|
83
|
+
export function justifyContentForGapMode(
|
|
84
|
+
gapMode: "auto" | "fixed",
|
|
85
|
+
lastPackedJustify: string,
|
|
86
|
+
): string {
|
|
87
|
+
return gapMode === "auto" ? "space-between" : lastPackedJustify;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function autoLayoutStylesForFlow(
|
|
91
|
+
flow: AutoLayoutFlow,
|
|
92
|
+
currentStyles: Record<string, string> = {},
|
|
93
|
+
): Record<string, string> {
|
|
94
|
+
if (flow === "normal") return { display: "block" };
|
|
95
|
+
if (flow === "vertical") {
|
|
96
|
+
return { display: "flex", flexDirection: "column", flexWrap: "nowrap" };
|
|
97
|
+
}
|
|
98
|
+
if (flow === "grid") {
|
|
99
|
+
const authoredColumns = currentStyles.gridTemplateColumns;
|
|
100
|
+
const authoredRows = currentStyles.gridTemplateRows;
|
|
101
|
+
return {
|
|
102
|
+
display: "grid",
|
|
103
|
+
gridTemplateColumns:
|
|
104
|
+
authoredColumns && authoredColumns !== "none"
|
|
105
|
+
? authoredColumns
|
|
106
|
+
: "repeat(2, minmax(0, 1fr))",
|
|
107
|
+
gridTemplateRows:
|
|
108
|
+
authoredRows && authoredRows !== "none"
|
|
109
|
+
? authoredRows
|
|
110
|
+
: "repeat(1, max-content)",
|
|
111
|
+
gridAutoFlow: currentStyles.gridAutoFlow || "row",
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return { display: "flex", flexDirection: "row", flexWrap: "nowrap" };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function splitGridTracks(template: string): string[] {
|
|
118
|
+
const tracks: string[] = [];
|
|
119
|
+
let depth = 0;
|
|
120
|
+
let start = 0;
|
|
121
|
+
for (let index = 0; index < template.length; index += 1) {
|
|
122
|
+
const character = template[index];
|
|
123
|
+
if (character === "(") depth += 1;
|
|
124
|
+
if (character === ")") depth = Math.max(0, depth - 1);
|
|
125
|
+
if (/\s/.test(character) && depth === 0) {
|
|
126
|
+
const track = template.slice(start, index).trim();
|
|
127
|
+
if (track) tracks.push(track);
|
|
128
|
+
start = index + 1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const last = template.slice(start).trim();
|
|
132
|
+
if (last) tracks.push(last);
|
|
133
|
+
return tracks;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Parse the common uniform grid forms while preserving arbitrary authored CSS. */
|
|
137
|
+
export function parseGridTemplate(template: string): {
|
|
138
|
+
count: number;
|
|
139
|
+
sizing: AutoLayoutGridTrackSizing;
|
|
140
|
+
fixedSize?: number;
|
|
141
|
+
} {
|
|
142
|
+
const normalized = template.trim();
|
|
143
|
+
const repeat = normalized.match(/^repeat\(\s*(\d+)\s*,\s*(.+)\)$/i);
|
|
144
|
+
const count = repeat
|
|
145
|
+
? Math.max(1, Number.parseInt(repeat[1], 10))
|
|
146
|
+
: Math.max(1, splitGridTracks(normalized).length);
|
|
147
|
+
const tracks = repeat ? [repeat[2].trim()] : splitGridTracks(normalized);
|
|
148
|
+
const first = tracks[0] || "";
|
|
149
|
+
const uniform = tracks.every((track) => track === first);
|
|
150
|
+
if (!uniform) return { count, sizing: "custom" };
|
|
151
|
+
if (/^(?:minmax\(\s*0(?:px)?\s*,\s*)?1fr\)?$/i.test(first)) {
|
|
152
|
+
return { count, sizing: "fill" };
|
|
153
|
+
}
|
|
154
|
+
if (/^(?:max-content|min-content|auto)$/i.test(first)) {
|
|
155
|
+
return { count, sizing: "hug" };
|
|
156
|
+
}
|
|
157
|
+
const fixed = first.match(/^(-?\d+(?:\.\d+)?)px$/i);
|
|
158
|
+
if (fixed) {
|
|
159
|
+
return { count, sizing: "fixed", fixedSize: Number(fixed[1]) };
|
|
160
|
+
}
|
|
161
|
+
return { count, sizing: "custom" };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function gridTemplateForTracks(
|
|
165
|
+
count: number,
|
|
166
|
+
sizing: AutoLayoutGridTrackSizing,
|
|
167
|
+
fixedSize: number | undefined,
|
|
168
|
+
authoredTemplate: string | undefined,
|
|
169
|
+
): string {
|
|
170
|
+
const safeCount = Math.max(1, Math.round(count));
|
|
171
|
+
if (sizing === "custom" && authoredTemplate) return authoredTemplate;
|
|
172
|
+
if (sizing === "hug") return `repeat(${safeCount}, max-content)`;
|
|
173
|
+
if (sizing === "fixed") {
|
|
174
|
+
return `repeat(${safeCount}, ${Math.max(0, fixedSize ?? 100)}px)`;
|
|
175
|
+
}
|
|
176
|
+
return `repeat(${safeCount}, minmax(0, 1fr))`;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function authoredGridTemplate(
|
|
180
|
+
element: ElementInfo,
|
|
181
|
+
property: "gridTemplateColumns" | "gridTemplateRows",
|
|
182
|
+
): string {
|
|
183
|
+
return (
|
|
184
|
+
element.inlineStyles?.[property] || element.computedStyles[property] || ""
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function gridValueForElement(element: ElementInfo): AutoLayoutGridValue {
|
|
189
|
+
const columnsTemplate = authoredGridTemplate(element, "gridTemplateColumns");
|
|
190
|
+
const rowsTemplate = authoredGridTemplate(element, "gridTemplateRows");
|
|
191
|
+
const columns = parseGridTemplate(columnsTemplate);
|
|
192
|
+
const rows = parseGridTemplate(rowsTemplate);
|
|
193
|
+
return {
|
|
194
|
+
columns: columns.count,
|
|
195
|
+
rows: rows.count,
|
|
196
|
+
columnSizing: columns.sizing,
|
|
197
|
+
rowSizing: rows.sizing,
|
|
198
|
+
columnSize: columns.fixedSize,
|
|
199
|
+
rowSize: rows.fixedSize,
|
|
200
|
+
columnTemplate: columnsTemplate,
|
|
201
|
+
rowTemplate: rowsTemplate,
|
|
202
|
+
columnGap: parseNumericValue(element.computedStyles.columnGap || "0"),
|
|
203
|
+
rowGap: parseNumericValue(element.computedStyles.rowGap || "0"),
|
|
204
|
+
columnsMixed: isMixedValue(columnsTemplate),
|
|
205
|
+
rowsMixed: isMixedValue(rowsTemplate),
|
|
206
|
+
columnGapMixed: isMixedValue(element.computedStyles.columnGap),
|
|
207
|
+
rowGapMixed: isMixedValue(element.computedStyles.rowGap),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
|
|
69
211
|
/** Flex container properties */
|
|
70
212
|
function FlexContainerControls({
|
|
71
213
|
element,
|
|
@@ -84,13 +226,41 @@ function FlexContainerControls({
|
|
|
84
226
|
// control can show the right state (normal vs horizontal/vertical/wrap)
|
|
85
227
|
// instead of an empty "add" affordance.
|
|
86
228
|
const display = (styles.display || "").toLowerCase();
|
|
229
|
+
const isGrid = element.isGridContainer || display.includes("grid");
|
|
87
230
|
const isFlex = element.isFlexContainer || display.includes("flex");
|
|
88
|
-
const displayMode: AutoLayoutMatrixValue["display"] =
|
|
89
|
-
? "
|
|
90
|
-
:
|
|
91
|
-
|
|
231
|
+
const displayMode: AutoLayoutMatrixValue["display"] = isGrid
|
|
232
|
+
? "grid"
|
|
233
|
+
: isFlex
|
|
234
|
+
? "flex"
|
|
235
|
+
: "block";
|
|
236
|
+
const flowMixed = [
|
|
237
|
+
styles.display,
|
|
238
|
+
styles.flexDirection,
|
|
239
|
+
styles.flexWrap,
|
|
240
|
+
styles.gridTemplateColumns,
|
|
241
|
+
styles.gridTemplateRows,
|
|
242
|
+
].some(isMixedValue);
|
|
92
243
|
const flexDirection: AutoLayoutMatrixValue["direction"] =
|
|
93
244
|
styles.flexDirection?.includes("column") ? "vertical" : "horizontal";
|
|
245
|
+
// `justifyContent` is always the main-axis property in flexbox regardless
|
|
246
|
+
// of direction, so it doubles as the "packed" (start/center/end) main-axis
|
|
247
|
+
// alignment AND the gap-mode signal ("space-between" = Auto gap, see
|
|
248
|
+
// `spaceBetween` below). Remember the last non-"space-between" value here
|
|
249
|
+
// so turning gap mode back to Fixed can restore the user's chosen packed
|
|
250
|
+
// alignment (see onGapModeChange) instead of hard-resetting to flex-start
|
|
251
|
+
// — mirrors Figma, where switching a container's primary-axis distribution
|
|
252
|
+
// away from "Space between" returns to whichever start/center/end packing
|
|
253
|
+
// was previously selected.
|
|
254
|
+
const lastPackedJustifyRef = useRef(
|
|
255
|
+
styles.justifyContent && styles.justifyContent !== "space-between"
|
|
256
|
+
? styles.justifyContent
|
|
257
|
+
: "flex-start",
|
|
258
|
+
);
|
|
259
|
+
useEffect(() => {
|
|
260
|
+
if (styles.justifyContent && styles.justifyContent !== "space-between") {
|
|
261
|
+
lastPackedJustifyRef.current = styles.justifyContent;
|
|
262
|
+
}
|
|
263
|
+
}, [styles.justifyContent]);
|
|
94
264
|
const mainGapAxis =
|
|
95
265
|
flexDirection === "horizontal" ? "horizontal" : "vertical";
|
|
96
266
|
// When the element is in normal flow (not flex yet), picking any flow option
|
|
@@ -107,7 +277,11 @@ function FlexContainerControls({
|
|
|
107
277
|
* For 'block': sets display:block and leaves children unchanged — mirrors
|
|
108
278
|
* the { kind:"autoLayout", enabled:false } substrate intent exactly.
|
|
109
279
|
*/
|
|
110
|
-
const handleDisplayChange = (nextDisplay: "flex" | "block") => {
|
|
280
|
+
const handleDisplayChange = (nextDisplay: "flex" | "grid" | "block") => {
|
|
281
|
+
if (nextDisplay === "grid") {
|
|
282
|
+
onStyleChange("display", "grid");
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
111
285
|
if (nextDisplay === "flex") {
|
|
112
286
|
ensureFlex();
|
|
113
287
|
return;
|
|
@@ -144,9 +318,30 @@ function FlexContainerControls({
|
|
|
144
318
|
const autoLayoutValue: AutoLayoutMatrixValue = {
|
|
145
319
|
direction: flexDirection,
|
|
146
320
|
wrap: styles.flexWrap === "wrap" ? "wrap" : "nowrap",
|
|
147
|
-
alignment: autoLayoutAlignmentFromStyles(
|
|
321
|
+
alignment: autoLayoutAlignmentFromStyles(
|
|
322
|
+
isGrid ? { ...styles, justifyContent: styles.justifyItems } : styles,
|
|
323
|
+
isGrid ? "horizontal" : flexDirection,
|
|
324
|
+
),
|
|
325
|
+
alignmentMixed: [
|
|
326
|
+
styles.justifyContent,
|
|
327
|
+
styles.alignItems,
|
|
328
|
+
styles.alignContent,
|
|
329
|
+
...(isGrid ? [styles.justifyItems] : []),
|
|
330
|
+
].some(isMixedValue),
|
|
148
331
|
gap: parseNumericValue(styles.gap || "0"),
|
|
332
|
+
// Multi-selections with differing gap/padding surface the MIXED_VALUE
|
|
333
|
+
// sentinel here; parseNumericValue would silently coerce it to 0 (a
|
|
334
|
+
// real-looking value that would clobber every element on edit), so flag
|
|
335
|
+
// each field so AutoLayoutMatrix renders a "Mixed" placeholder instead.
|
|
336
|
+
gapMixed: isMixedValue(styles.gap),
|
|
337
|
+
gapModeMixed: isMixedValue(styles.justifyContent),
|
|
149
338
|
padding,
|
|
339
|
+
paddingMixed: {
|
|
340
|
+
top: isMixedValue(styles.paddingTop),
|
|
341
|
+
right: isMixedValue(styles.paddingRight),
|
|
342
|
+
bottom: isMixedValue(styles.paddingBottom),
|
|
343
|
+
left: isMixedValue(styles.paddingLeft),
|
|
344
|
+
},
|
|
150
345
|
paddingLinked,
|
|
151
346
|
childSizing: {
|
|
152
347
|
horizontal: inferElementSizing(element, "horizontal"),
|
|
@@ -157,6 +352,7 @@ function FlexContainerControls({
|
|
|
157
352
|
vertical: readElementMinMax(element, "vertical"),
|
|
158
353
|
},
|
|
159
354
|
clipContent: styles.overflow === "hidden",
|
|
355
|
+
clipContentMixed: isMixedValue(styles.overflow),
|
|
160
356
|
resolvedSize: {
|
|
161
357
|
horizontal: cssElementSize(element, "horizontal"),
|
|
162
358
|
vertical: cssElementSize(element, "vertical"),
|
|
@@ -166,13 +362,28 @@ function FlexContainerControls({
|
|
|
166
362
|
vertical: isMixedValue(styles.height),
|
|
167
363
|
},
|
|
168
364
|
display: displayMode,
|
|
365
|
+
flowMixed,
|
|
169
366
|
spaceBetween: styles.justifyContent === "space-between",
|
|
367
|
+
grid: isGrid ? gridValueForElement(element) : undefined,
|
|
170
368
|
};
|
|
171
369
|
|
|
172
370
|
return (
|
|
173
371
|
<div className="space-y-2">
|
|
174
372
|
<AutoLayoutMatrix
|
|
175
373
|
value={autoLayoutValue}
|
|
374
|
+
onFlowChange={(flow) => {
|
|
375
|
+
const patch = autoLayoutStylesForFlow(flow, {
|
|
376
|
+
...styles,
|
|
377
|
+
...element.inlineStyles,
|
|
378
|
+
});
|
|
379
|
+
if (onStylesChange) {
|
|
380
|
+
onStylesChange(patch);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
Object.entries(patch).forEach(([property, value]) =>
|
|
384
|
+
onStyleChange(property, value),
|
|
385
|
+
);
|
|
386
|
+
}}
|
|
176
387
|
onDisplayChange={handleDisplayChange}
|
|
177
388
|
onDirectionChange={(direction) => {
|
|
178
389
|
ensureFlex();
|
|
@@ -185,7 +396,51 @@ function FlexContainerControls({
|
|
|
185
396
|
ensureFlex();
|
|
186
397
|
onStyleChange("flexWrap", wrap);
|
|
187
398
|
}}
|
|
399
|
+
onGridChange={(nextGrid, meta) => {
|
|
400
|
+
const previousGrid = autoLayoutValue.grid;
|
|
401
|
+
const columnTemplate = gridTemplateForTracks(
|
|
402
|
+
nextGrid.columns,
|
|
403
|
+
nextGrid.columnSizing,
|
|
404
|
+
nextGrid.columnSize,
|
|
405
|
+
nextGrid.columnSizing === "custom" &&
|
|
406
|
+
previousGrid?.columns === nextGrid.columns
|
|
407
|
+
? nextGrid.columnTemplate
|
|
408
|
+
: undefined,
|
|
409
|
+
);
|
|
410
|
+
const rowTemplate = gridTemplateForTracks(
|
|
411
|
+
nextGrid.rows,
|
|
412
|
+
nextGrid.rowSizing,
|
|
413
|
+
nextGrid.rowSize,
|
|
414
|
+
nextGrid.rowSizing === "custom" &&
|
|
415
|
+
previousGrid?.rows === nextGrid.rows
|
|
416
|
+
? nextGrid.rowTemplate
|
|
417
|
+
: undefined,
|
|
418
|
+
);
|
|
419
|
+
const patch = {
|
|
420
|
+
display: "grid",
|
|
421
|
+
gridTemplateColumns: columnTemplate,
|
|
422
|
+
gridTemplateRows: rowTemplate,
|
|
423
|
+
gridAutoFlow: "row",
|
|
424
|
+
columnGap: `${nextGrid.columnGap}px`,
|
|
425
|
+
rowGap: `${nextGrid.rowGap}px`,
|
|
426
|
+
};
|
|
427
|
+
if (onStylesChange) {
|
|
428
|
+
onStylesChange(patch, meta);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
Object.entries(patch).forEach(([property, value]) =>
|
|
432
|
+
onStyleChange(property, value, meta),
|
|
433
|
+
);
|
|
434
|
+
}}
|
|
188
435
|
onAlignmentChange={(alignment) => {
|
|
436
|
+
if (displayMode === "grid") {
|
|
437
|
+
onStyleChange(
|
|
438
|
+
"justifyItems",
|
|
439
|
+
horizontalToJustify(alignment.horizontal),
|
|
440
|
+
);
|
|
441
|
+
onStyleChange("alignItems", verticalToAlign(alignment.vertical));
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
189
444
|
if (autoLayoutValue.direction === "vertical") {
|
|
190
445
|
onStyleChange(
|
|
191
446
|
"alignItems",
|
|
@@ -227,31 +482,35 @@ function FlexContainerControls({
|
|
|
227
482
|
}}
|
|
228
483
|
onPaddingLinkedChange={(linked) => {
|
|
229
484
|
setPaddingLinked(linked);
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
485
|
+
// Linking is a display-mode choice, not a style edit. Figma keeps
|
|
486
|
+
// asymmetric padding intact when the sides are linked and only
|
|
487
|
+
// equalizes an axis after the user edits that linked field. The old
|
|
488
|
+
// eager average destroyed all four authored values immediately and
|
|
489
|
+
// produced four source commits/undo entries just from clicking the
|
|
490
|
+
// link icon. AutoLayoutMatrix intentionally displays left/top as
|
|
491
|
+
// each linked axis's representative value and applies both sides on
|
|
492
|
+
// the next real field edit, so no style write belongs here.
|
|
238
493
|
}}
|
|
239
494
|
onClipContentChange={(clipContent) =>
|
|
240
495
|
onStyleChange("overflow", clipContent ? "hidden" : "visible")
|
|
241
496
|
}
|
|
242
|
-
onDistribute={
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
497
|
+
onDistribute={
|
|
498
|
+
displayMode === "grid"
|
|
499
|
+
? undefined
|
|
500
|
+
: (axis) => {
|
|
501
|
+
if (axis === mainGapAxis) {
|
|
502
|
+
onStyleChange("justifyContent", "space-between");
|
|
503
|
+
} else if (autoLayoutValue.wrap === "wrap") {
|
|
504
|
+
onStyleChange("alignContent", "space-between");
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
249
508
|
onGapModeChange={(gapMode, axis) => {
|
|
250
509
|
if (axis !== mainGapAxis) return;
|
|
251
510
|
ensureFlex();
|
|
252
511
|
onStyleChange(
|
|
253
512
|
"justifyContent",
|
|
254
|
-
gapMode
|
|
513
|
+
justifyContentForGapMode(gapMode, lastPackedJustifyRef.current),
|
|
255
514
|
);
|
|
256
515
|
}}
|
|
257
516
|
availableChildSizing={availableSizingForElement(element)}
|
|
@@ -274,7 +533,12 @@ function FlexContainerControls({
|
|
|
274
533
|
onChildMinMaxChange={(axis, kind, val, meta) =>
|
|
275
534
|
commitElementMinMax(axis, kind, val, onStyleChange, meta)
|
|
276
535
|
}
|
|
277
|
-
|
|
536
|
+
// Empty frames/rectangles still need the complete Flow + Padding
|
|
537
|
+
// surface: users must be able to turn auto layout on before adding a
|
|
538
|
+
// first child, just as they can for an empty frame in Figma. The old
|
|
539
|
+
// child-count gate left an "Auto layout" section containing only
|
|
540
|
+
// Resizing, with no way to enable auto layout from the inspector.
|
|
541
|
+
showChildLayoutControls
|
|
278
542
|
/>
|
|
279
543
|
</div>
|
|
280
544
|
);
|
|
@@ -598,9 +862,16 @@ export function LayoutContextProperties({
|
|
|
598
862
|
must not silently flip while the user is mid-scrub — see the
|
|
599
863
|
FlexContainerControls comment) resets on selection change instead of
|
|
600
864
|
leaking to the next element — same pattern as CornerRadiusControl /
|
|
601
|
-
ExportSettingsPanel.
|
|
865
|
+
ExportSettingsPanel. Deliberately `elementStableKey`, NOT
|
|
866
|
+
`elementIdentityKey`: the latter folds in the rounded bounding rect,
|
|
867
|
+
which changes on every resize. Resizing a frame on canvas is a very
|
|
868
|
+
common action while its Auto layout section is open, and remounting
|
|
869
|
+
on every such tick would silently reset paddingLinked back to
|
|
870
|
+
allPaddingEqual mid-session — the exact class of bug the comment
|
|
871
|
+
below (STEVE TEST BATCH 4 #4) already fixed for the *value*-driven
|
|
872
|
+
case, reintroduced here via the *key*. */}
|
|
602
873
|
<FlexContainerControls
|
|
603
|
-
key={
|
|
874
|
+
key={elementStableKey(element)}
|
|
604
875
|
element={element}
|
|
605
876
|
onStyleChange={onStyleChange}
|
|
606
877
|
onStylesChange={onStylesChange}
|