@agent-native/core 0.83.0 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +28 -0
- package/corpus/core/README.md +2 -2
- package/corpus/core/docs/content/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/template-chat.mdx +1 -1
- package/corpus/core/docs/content/template-chat.mdx +1 -1
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/engine/builtin.ts +1 -1
- package/corpus/core/src/agent/engine/output-tokens.ts +1 -1
- package/corpus/core/src/agent/harness/acp-adapter.ts +28 -4
- package/corpus/core/src/agent/harness/ai-sdk-adapter.ts +3 -0
- package/corpus/core/src/agent/harness/translate.ts +3 -0
- package/corpus/core/src/agent/harness/types.ts +1 -0
- package/corpus/core/src/agent/model-config.ts +34 -13
- package/corpus/core/src/agent/production-agent.ts +87 -10
- package/corpus/core/src/agent/thread-data-builder.ts +29 -4
- package/corpus/core/src/agent/tool-call-journal.ts +109 -48
- package/corpus/core/src/agent/types.ts +6 -1
- package/corpus/core/src/cli/design-connect.ts +106 -0
- package/corpus/core/src/cli/gateway-helpers.ts +17 -0
- package/corpus/core/src/cli/recap.ts +0 -2
- package/corpus/core/src/cli/skills.ts +54 -16
- package/corpus/core/src/cli/workspace-dev.ts +29 -5
- package/corpus/core/src/client/AssistantChat.tsx +89 -42
- package/corpus/core/src/client/DefaultSpinner.tsx +8 -1
- package/corpus/core/src/client/chat/message-components.tsx +49 -1
- package/corpus/core/src/client/chat/repo-helpers.ts +71 -0
- package/corpus/core/src/client/chat/run-recovery.tsx +15 -5
- package/corpus/core/src/client/components/ApiKeySettings.tsx +8 -8
- package/corpus/core/src/client/components/CodeRequiredDialog.tsx +26 -15
- package/corpus/core/src/client/components/MissingKeyCard.tsx +13 -6
- package/corpus/core/src/client/composer/TiptapComposer.tsx +4 -3
- package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +0 -1
- package/corpus/core/src/client/guided-questions.tsx +21 -27
- package/corpus/core/src/client/integrations/IntegrationCard.tsx +1 -1
- package/corpus/core/src/client/integrations/IntegrationsPanel.tsx +1 -1
- package/corpus/core/src/client/onboarding/OnboardingBanner.tsx +2 -2
- package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +23 -19
- package/corpus/core/src/client/resources/ResourceEditor.tsx +18 -10
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +5 -1
- package/corpus/core/src/client/settings/SettingsPanel.tsx +8 -3
- package/corpus/core/src/client/settings/useBuilderStatus.ts +8 -41
- package/corpus/core/src/client/useProductionAgent.ts +6 -2
- package/corpus/core/src/deploy/build.ts +1 -1
- package/corpus/core/src/observability/traces.ts +3 -3
- package/corpus/core/src/onboarding/default-steps.ts +1 -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/agent-chat-plugin.ts +177 -81
- package/corpus/core/src/server/core-routes-plugin.ts +7 -1
- package/corpus/core/src/server/open-route.ts +59 -40
- package/corpus/core/src/shared/reasoning-effort.ts +2 -0
- package/corpus/core/src/sharing/access.ts +22 -2
- package/corpus/core/src/sharing/registry.ts +18 -0
- package/corpus/core/src/styles/agent-native.css +104 -20
- package/corpus/core/src/styles/rich-markdown-editor.css +11 -10
- package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +10 -10
- package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +10 -10
- package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +6 -5
- package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +9 -9
- package/corpus/templates/analytics/app/global.css +4 -0
- package/corpus/templates/analytics/app/lib/chart-theme.ts +13 -0
- package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +22 -24
- package/corpus/templates/analytics/changelog/2026-06-30-dashboard-charts-now-use-theme-aware-tooltip-and-grid-colors.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-30-fixed-ask-composer-spacing-so-the-chat-field-has-a-comfortab.md +6 -0
- package/corpus/templates/calendar/AGENTS.md +4 -0
- package/corpus/templates/calendar/actions/connect-google-calendar.ts +80 -0
- package/corpus/templates/calendar/changelog/2026-06-30-calendar-now-gives-the-agent-a-safe-google-connection-link-i.md +6 -0
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +5 -5
- package/corpus/templates/content/app/global.css +6 -5
- package/corpus/templates/content/changelog/2026-06-30-editor-floating-toolbars-now-use-theme-aware-colors-in-light.md +6 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +6 -1
- package/corpus/templates/design/actions/add-localhost-screens.ts +63 -8
- package/corpus/templates/design/actions/apply-motion-edit.ts +12 -46
- package/corpus/templates/design/actions/list-design-native-assets.ts +2 -1
- package/corpus/templates/design/actions/migrate-board-objects-to-file.ts +49 -1
- package/corpus/templates/design/actions/navigate.ts +3 -12
- package/corpus/templates/design/actions/open-visual-edit.ts +341 -0
- package/corpus/templates/design/actions/view-screen.ts +1 -1
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +1 -1
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +345 -14
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +71 -91
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +25 -27
- package/corpus/templates/design/app/components/design/DeviceFrame.tsx +1 -1
- package/corpus/templates/design/app/components/design/DrawOverlay.tsx +2 -2
- package/corpus/templates/design/app/components/design/EditPanel.tsx +1111 -570
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +162 -32
- package/corpus/templates/design/app/components/design/MotionDock.tsx +268 -240
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1038 -150
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +1 -1
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +81 -102
- package/corpus/templates/design/app/components/design/StatesPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +11 -11
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +9 -7
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +1129 -155
- package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +130 -37
- package/corpus/templates/design/app/components/design/canvas-primitive-style.ts +24 -11
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +184 -162
- package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +137 -79
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +13 -13
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +8 -8
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +2 -2
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +4 -4
- package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +3 -3
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +13 -7
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +14 -11
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +4 -4
- package/corpus/templates/design/app/components/design/inspector/index.ts +2 -0
- package/corpus/templates/design/app/components/design/types.ts +19 -0
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +61 -78
- package/corpus/templates/design/app/components/layout/Header.tsx +0 -1
- package/corpus/templates/design/app/components/layout/Layout.tsx +3 -2
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +0 -2
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +5 -4
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
- package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +2 -2
- package/corpus/templates/design/app/global.css +56 -0
- package/corpus/templates/design/app/hooks/use-agent-generating.ts +4 -5
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +6 -7
- package/corpus/templates/design/app/hooks/use-question-flow.ts +3 -2
- package/corpus/templates/design/app/hooks/useAgentEditRequest.ts +6 -4
- package/corpus/templates/design/app/i18n/zh-TW.ts +5 -14
- package/corpus/templates/design/app/i18n-data.ts +63 -188
- package/corpus/templates/design/app/lib/agent-chat.ts +13 -0
- package/corpus/templates/design/app/pages/DesignEditor.tsx +1428 -384
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +9 -5
- package/corpus/templates/design/app/pages/DesignSystems.tsx +2 -2
- package/corpus/templates/design/app/pages/Index.tsx +49 -26
- package/corpus/templates/design/app/pages/NotFound.tsx +25 -8
- package/corpus/templates/design/app/pages/VisualEdit.tsx +17 -5
- package/corpus/templates/design/app/routes/examples.tsx +1 -7
- package/corpus/templates/design/app/routes/templates.tsx +7 -4
- package/corpus/templates/design/changelog/2026-06-30-board-shapes-and-auto-layout-controls-are-clearer.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-component-selections-now-use-purple-component-chrome-and-sho.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-constraints-now-stay-tucked-into-a-compact-inspector-preview.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-creating-a-component-now-opens-in-a-compact-inspector-popove.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-cards-no-longer-show-legacy-project-type-badges.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-chat-now-keeps-new-turns-in-the-visible-design-agent-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-editor-panels-now-keep-their-compact-text-sizing-cons.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-no-longer-shows-the-connected-local-code-warning-bann.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-now-opens-to-the-files-panel-unless-a-generation-is-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-opens-with-a-cleaner-empty-canvas-and-loading-preview.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-tools-use-simpler-less-decorative-icons.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-dragging-absolute-elements-no-longer-shows-coordinate-labels.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-fixed-all-screens-opening-too-zoomed-in-by-default.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-fixed-the-public-design-assets-sidebar-so-native-components-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-fixed-the-screen-overview-board-so-empty-board-space-no-long.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-full-view-screens-can-now-scroll-while-remaining-editable.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-inspector-element-headers-show-the-selected-html-tag-and-the.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-inspector-inputs-stay-compact-across-desktop-breakpoints.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-layers-can-be-multi-selected-from-the-canvas-and-edited-toge.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-local-visual-edit-links-can-edit-localhost-frames-without-si.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-localhost-visual-edit-frames-can-now-be-selected-and-edited.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-marquee-selection-now-works-inside-screens-multi-selected-la.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-motion-is-now-available-from-the-persistent-left-rail-and-th.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-motion-timeline-collapse-and-reopen-animations-feel-smoother.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-multi-select-outlines-now-stay-consistent-across-all-screens.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-new-board-shapes-now-start-with-neutral-gray-styling.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-new-designs-open-into-a-steadier-loading-state-before-the-ed.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-new-designs-show-a-loading-state-during-handoff-and-keep-edi.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-public-visual-edit-design-links-now-open-directly-instead-of.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-removed-the-confusing-states-section-from-the-design-editor-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-removed-the-templates-gallery-from-design-navigation.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-share-stays-visible-as-soon-as-editable-designs-load.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-signed-out-save-and-share-controls-use-simpler-labels-and-op.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-text-added-on-the-canvas-now-focuses-cleanly-with-the-right-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-editor-loading-skeleton-is-simpler-and-its-bottom.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-editor-loading-skeleton-now-follows-the-current-t.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-inspector-no-longer-shows-child-layout-controls-o.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-inspector-no-longer-shows-the-ask-ai-section-abov.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-review-panel-no-longer-shows-a-separate-inline-au.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-empty-designs-page-now-focuses-on-a-single-primary-new-d.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-layers-panel-header-stays-as-layers-while-multiple-items.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-missing-design-screen-now-uses-a-neutral-back-button.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-motion-timeline-now-closes-without-squeezing-the-canvas-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-new-design-connect-ai-setup-now-lines-up-with-the-compos.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-screen-overview-board-now-blends-into-the-canvas-and-new.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-top-level-canvas-drops-now-show-screen-guides.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-top-level-canvas-layers-now-keep-a-transparent-backdrop-and-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-top-level-canvas-layers-now-select-reliably-from-all-screens.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-visual-edit-can-open-and-refresh-localhost-screens-in-one-au.md +6 -0
- package/corpus/templates/design/e2e/helpers.ts +15 -4
- package/corpus/templates/design/server/db/index.ts +52 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/design/server/plugins/auth.ts +1 -0
- package/corpus/templates/design/server/plugins/core-routes.ts +4 -0
- package/corpus/templates/design/shared/board-file.ts +380 -5
- package/corpus/templates/design/shared/board-objects.ts +2 -2
- package/corpus/templates/design/shared/code-layer.ts +50 -6
- package/corpus/templates/design/shared/motion-compiler.ts +27 -0
- package/corpus/templates/macros/app/components/DailyProgress.tsx +41 -37
- package/corpus/templates/macros/app/components/ExerciseCard.tsx +2 -2
- package/corpus/templates/macros/app/components/MealCard.tsx +2 -2
- package/corpus/templates/macros/app/components/VoiceDictation.tsx +1 -1
- package/corpus/templates/macros/app/components/WeeklyCaloriesChart.tsx +1 -1
- package/corpus/templates/macros/app/components/WeightCard.tsx +2 -2
- package/corpus/templates/macros/app/components/WeightTracker.tsx +1 -1
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -1
- package/corpus/templates/macros/app/routes/_index.tsx +5 -5
- package/corpus/templates/macros/app/routes/analytics.tsx +1 -1
- package/corpus/templates/macros/changelog/2026-06-30-dashboard-loading-and-chart-surfaces-now-use-theme-aware-col.md +6 -0
- package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +14 -11
- package/corpus/templates/mail/app/global.css +3 -2
- package/corpus/templates/mail/changelog/2026-06-30-compose-floating-toolbars-now-use-theme-aware-colors-in-ligh.md +6 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -2
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +3 -3
- package/corpus/templates/slides/app/global.css +10 -0
- package/corpus/templates/slides/app/pages/Index.tsx +55 -51
- package/corpus/templates/slides/changelog/2026-06-30-deck-thumbnails-collapse-cleanly-to-one-column-when-the-chat.md +6 -0
- package/dist/agent/engine/anthropic-engine.d.ts +2 -2
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts +2 -2
- 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/engine/output-tokens.js +1 -1
- package/dist/agent/engine/output-tokens.js.map +1 -1
- package/dist/agent/harness/acp-adapter.d.ts +4 -1
- package/dist/agent/harness/acp-adapter.d.ts.map +1 -1
- package/dist/agent/harness/acp-adapter.js +19 -2
- package/dist/agent/harness/acp-adapter.js.map +1 -1
- package/dist/agent/harness/ai-sdk-adapter.d.ts.map +1 -1
- package/dist/agent/harness/ai-sdk-adapter.js +3 -0
- package/dist/agent/harness/ai-sdk-adapter.js.map +1 -1
- package/dist/agent/harness/translate.d.ts.map +1 -1
- package/dist/agent/harness/translate.js +3 -0
- package/dist/agent/harness/translate.js.map +1 -1
- package/dist/agent/harness/types.d.ts +1 -0
- package/dist/agent/harness/types.d.ts.map +1 -1
- package/dist/agent/harness/types.js.map +1 -1
- package/dist/agent/model-config.d.ts +21 -20
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +31 -13
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +85 -10
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +27 -6
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/agent/tool-call-journal.d.ts +11 -9
- package/dist/agent/tool-call-journal.d.ts.map +1 -1
- package/dist/agent/tool-call-journal.js +92 -40
- package/dist/agent/tool-call-journal.js.map +1 -1
- package/dist/agent/types.d.ts +5 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +84 -0
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/gateway-helpers.d.ts +4 -0
- package/dist/cli/gateway-helpers.d.ts.map +1 -1
- package/dist/cli/gateway-helpers.js +9 -0
- package/dist/cli/gateway-helpers.js.map +1 -1
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +0 -2
- package/dist/cli/recap.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +54 -16
- package/dist/cli/skills.js.map +1 -1
- package/dist/cli/workspace-dev.d.ts.map +1 -1
- package/dist/cli/workspace-dev.js +33 -6
- package/dist/cli/workspace-dev.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +72 -26
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/DefaultSpinner.d.ts.map +1 -1
- package/dist/client/DefaultSpinner.js +8 -1
- package/dist/client/DefaultSpinner.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +7 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +37 -1
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/repo-helpers.d.ts +1 -0
- package/dist/client/chat/repo-helpers.d.ts.map +1 -1
- package/dist/client/chat/repo-helpers.js +59 -0
- package/dist/client/chat/repo-helpers.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +4 -4
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/components/ApiKeySettings.js +8 -8
- package/dist/client/components/ApiKeySettings.js.map +1 -1
- package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
- package/dist/client/components/CodeRequiredDialog.js +24 -15
- package/dist/client/components/CodeRequiredDialog.js.map +1 -1
- package/dist/client/components/MissingKeyCard.d.ts.map +1 -1
- package/dist/client/components/MissingKeyCard.js +11 -6
- package/dist/client/components/MissingKeyCard.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +4 -3
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +6 -6
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/integrations/IntegrationCard.js +1 -1
- package/dist/client/integrations/IntegrationCard.js.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.js +1 -1
- package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
- package/dist/client/onboarding/OnboardingBanner.js +2 -2
- package/dist/client/onboarding/OnboardingBanner.js.map +1 -1
- package/dist/client/onboarding/OnboardingPanel.js +23 -19
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
- package/dist/client/resources/ResourceEditor.d.ts.map +1 -1
- package/dist/client/resources/ResourceEditor.js +13 -10
- package/dist/client/resources/ResourceEditor.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +2 -1
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +8 -3
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +6 -38
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/useProductionAgent.d.ts +2 -1
- package/dist/client/useProductionAgent.d.ts.map +1 -1
- package/dist/client/useProductionAgent.js.map +1 -1
- package/dist/deploy/build.js +1 -1
- package/dist/deploy/build.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js.map +1 -1
- package/dist/onboarding/default-steps.js +1 -1
- package/dist/onboarding/default-steps.js.map +1 -1
- 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-chat-plugin.d.ts +3 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +134 -72
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +3 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +4 -1
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/open-route.d.ts +9 -0
- package/dist/server/open-route.d.ts.map +1 -1
- package/dist/server/open-route.js +48 -38
- package/dist/server/open-route.js.map +1 -1
- package/dist/shared/reasoning-effort.js +3 -0
- package/dist/shared/reasoning-effort.js.map +1 -1
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +18 -2
- package/dist/sharing/access.js.map +1 -1
- package/dist/sharing/registry.d.ts +10 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/styles/agent-native.css +104 -20
- package/dist/styles/rich-markdown-editor.css +11 -10
- package/docs/content/cloneable-saas.mdx +2 -2
- package/docs/content/faq.mdx +1 -1
- package/docs/content/locales/ar-SA/cloneable-saas.mdx +2 -2
- package/docs/content/locales/ar-SA/faq.mdx +1 -1
- package/docs/content/locales/ar-SA/template-chat.mdx +1 -1
- package/docs/content/locales/de-DE/cloneable-saas.mdx +2 -2
- package/docs/content/locales/de-DE/faq.mdx +1 -1
- package/docs/content/locales/de-DE/template-chat.mdx +1 -1
- package/docs/content/locales/es-ES/cloneable-saas.mdx +2 -2
- package/docs/content/locales/es-ES/faq.mdx +1 -1
- package/docs/content/locales/es-ES/template-chat.mdx +1 -1
- package/docs/content/locales/fr-FR/cloneable-saas.mdx +2 -2
- package/docs/content/locales/fr-FR/faq.mdx +1 -1
- package/docs/content/locales/fr-FR/template-chat.mdx +1 -1
- package/docs/content/locales/hi-IN/cloneable-saas.mdx +2 -2
- package/docs/content/locales/hi-IN/faq.mdx +1 -1
- package/docs/content/locales/hi-IN/template-chat.mdx +1 -1
- package/docs/content/locales/ja-JP/cloneable-saas.mdx +2 -2
- package/docs/content/locales/ja-JP/faq.mdx +1 -1
- package/docs/content/locales/ja-JP/template-chat.mdx +1 -1
- package/docs/content/locales/ko-KR/cloneable-saas.mdx +2 -2
- package/docs/content/locales/ko-KR/faq.mdx +1 -1
- package/docs/content/locales/ko-KR/template-chat.mdx +1 -1
- package/docs/content/locales/pt-BR/cloneable-saas.mdx +2 -2
- package/docs/content/locales/pt-BR/faq.mdx +1 -1
- package/docs/content/locales/pt-BR/template-chat.mdx +1 -1
- package/docs/content/locales/zh-CN/cloneable-saas.mdx +2 -2
- package/docs/content/locales/zh-CN/faq.mdx +1 -1
- package/docs/content/locales/zh-CN/template-chat.mdx +1 -1
- package/docs/content/locales/zh-TW/cloneable-saas.mdx +2 -2
- package/docs/content/locales/zh-TW/faq.mdx +1 -1
- package/docs/content/locales/zh-TW/template-chat.mdx +1 -1
- package/docs/content/template-chat.mdx +1 -1
- package/package.json +1 -1
- package/corpus/templates/design/app/components/design/LocalSourceEditBanner.tsx +0 -157
- package/corpus/templates/design/app/lib/design-templates.ts +0 -1305
- package/corpus/templates/design/app/pages/Templates.tsx +0 -279
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* __EDITOR_CHROME_SCALE_X__ — number string, e.g. "1.5"
|
|
13
13
|
* __EDITOR_CHROME_SCALE_Y__ — number string, e.g. "1.5"
|
|
14
14
|
* __DESIGN_CANVAS_SCREEN_ID__ — string literal for the owning screen/file id
|
|
15
|
+
* __DESIGN_CANVAS_BOARD_SURFACE__ — boolean literal for top-level board iframe
|
|
15
16
|
*
|
|
16
17
|
* Rules:
|
|
17
18
|
* • No import/require of any module (DOM globals only).
|
|
@@ -26,11 +27,13 @@ declare var __TEXT_EDITING_ENABLED__: boolean;
|
|
|
26
27
|
declare var __EDITOR_CHROME_SCALE_X__: string;
|
|
27
28
|
declare var __EDITOR_CHROME_SCALE_Y__: string;
|
|
28
29
|
declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
30
|
+
declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
29
31
|
|
|
30
32
|
(function () {
|
|
31
33
|
var readOnly = __READ_ONLY__;
|
|
32
34
|
var textEditingEnabled = !readOnly && __TEXT_EDITING_ENABLED__;
|
|
33
35
|
var designCanvasScreenId = __DESIGN_CANVAS_SCREEN_ID__ || "";
|
|
36
|
+
var designCanvasBoardSurface = !!__DESIGN_CANVAS_BOARD_SURFACE__;
|
|
34
37
|
var scaleToolEnabled = false;
|
|
35
38
|
var editorChromeScaleX = Math.max(
|
|
36
39
|
0.05,
|
|
@@ -44,8 +47,15 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
44
47
|
// Ease the constant-size selection chrome to its new size when overview zoom
|
|
45
48
|
// settles (parent posts set-editor-chrome-scale), matching the canvas chrome.
|
|
46
49
|
// Only chrome-scale-driven props animate; the overlay's live position is excluded.
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
var chromeTransitionStyle: HTMLStyleElement | null = null;
|
|
51
|
+
|
|
52
|
+
function ensureEditorChromeStyle(): void {
|
|
53
|
+
if (chromeTransitionStyle && chromeTransitionStyle.isConnected) return;
|
|
54
|
+
chromeTransitionStyle = document.createElement("style");
|
|
55
|
+
chromeTransitionStyle.setAttribute(
|
|
56
|
+
"data-agent-native-editor-chrome-style",
|
|
57
|
+
"",
|
|
58
|
+
);
|
|
49
59
|
chromeTransitionStyle.textContent =
|
|
50
60
|
'[data-agent-native-edit-overlay="selection"]{transition:border-width 150ms ease-out}' +
|
|
51
61
|
"[data-agent-native-edge-handle],[data-agent-native-edit-handle],[data-agent-native-rotate-handle]{transition:width 150ms ease-out,height 150ms ease-out,border-width 150ms ease-out,top 150ms ease-out,bottom 150ms ease-out,left 150ms ease-out,right 150ms ease-out}" +
|
|
@@ -56,7 +66,20 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
56
66
|
(document.head || document.documentElement).appendChild(
|
|
57
67
|
chromeTransitionStyle,
|
|
58
68
|
);
|
|
59
|
-
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
ensureEditorChromeStyle();
|
|
72
|
+
|
|
73
|
+
function runtimeHeadHtmlWithoutEditorChrome(): string {
|
|
74
|
+
if (!document.head) return "";
|
|
75
|
+
var clone = document.head.cloneNode(true) as HTMLElement;
|
|
76
|
+
Array.prototype.slice
|
|
77
|
+
.call(clone.querySelectorAll("[data-agent-native-editor-chrome-style]"))
|
|
78
|
+
.forEach(function (node) {
|
|
79
|
+
if (node.parentNode) node.parentNode.removeChild(node);
|
|
80
|
+
});
|
|
81
|
+
return clone.innerHTML;
|
|
82
|
+
}
|
|
60
83
|
|
|
61
84
|
function chromeScaleX(): number {
|
|
62
85
|
return 1 / Math.max(0.05, editorChromeScaleX);
|
|
@@ -166,6 +189,20 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
166
189
|
return el === document.body || el === document.documentElement;
|
|
167
190
|
}
|
|
168
191
|
|
|
192
|
+
function isBoardRootMarqueeSurface(el: Element | null): boolean {
|
|
193
|
+
if (!designCanvasBoardSurface || !el) return false;
|
|
194
|
+
if (isDocumentRootElement(el)) return true;
|
|
195
|
+
if (el.parentElement !== document.body) return false;
|
|
196
|
+
var sourceId = (getSourceId(el) || "").toLowerCase();
|
|
197
|
+
var layerName = (
|
|
198
|
+
(el.getAttribute && el.getAttribute("data-agent-native-layer-name")) ||
|
|
199
|
+
""
|
|
200
|
+
).toLowerCase();
|
|
201
|
+
return (
|
|
202
|
+
sourceId === "body" || layerName === "body" || layerName === "<body>"
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
169
206
|
function closestStableSourceElement(el: Element | null): Element | null {
|
|
170
207
|
if (!el || !el.closest) return null;
|
|
171
208
|
var stable = el.closest(
|
|
@@ -249,9 +286,104 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
249
286
|
return selectorPath(el);
|
|
250
287
|
}
|
|
251
288
|
|
|
289
|
+
function explicitComponentNameForElement(el: Element | null): string {
|
|
290
|
+
var raw =
|
|
291
|
+
el && el.getAttribute && el.getAttribute("data-agent-native-component");
|
|
292
|
+
return raw && raw.trim ? raw.trim() : "";
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function elementLooksLikeComponent(el: Element | null): boolean {
|
|
296
|
+
if (!el || !el.getAttribute || !el.tagName) return false;
|
|
297
|
+
if (explicitComponentNameForElement(el)) return true;
|
|
298
|
+
var tag = el.tagName.toLowerCase();
|
|
299
|
+
if (
|
|
300
|
+
tag === "button" ||
|
|
301
|
+
tag === "input" ||
|
|
302
|
+
tag === "select" ||
|
|
303
|
+
tag === "textarea"
|
|
304
|
+
) {
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
var layerName = el.getAttribute("data-agent-native-layer-name") || "";
|
|
308
|
+
if (/component|card|button|control/i.test(layerName)) return true;
|
|
309
|
+
if (!el.classList) return false;
|
|
310
|
+
for (var i = 0; i < el.classList.length; i += 1) {
|
|
311
|
+
if (/component|card|button|control/i.test(el.classList.item(i) || "")) {
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function componentNameForElement(el: Element | null): string {
|
|
319
|
+
var explicit = explicitComponentNameForElement(el);
|
|
320
|
+
if (explicit) return explicit;
|
|
321
|
+
if (!elementLooksLikeComponent(el) || !el || !el.getAttribute) return "";
|
|
322
|
+
var layerName = el.getAttribute("data-agent-native-layer-name");
|
|
323
|
+
return layerName && layerName.trim ? layerName.trim() : "";
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function isAutoLayoutDisplay(display: string | undefined): boolean {
|
|
327
|
+
return (
|
|
328
|
+
display === "flex" ||
|
|
329
|
+
display === "inline-flex" ||
|
|
330
|
+
display === "grid" ||
|
|
331
|
+
display === "inline-grid"
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function rectInfoForElement(el: Element) {
|
|
336
|
+
var rect = el.getBoundingClientRect();
|
|
337
|
+
return {
|
|
338
|
+
x: rect.x + (window.scrollX || window.pageXOffset || 0),
|
|
339
|
+
y: rect.y + (window.scrollY || window.pageYOffset || 0),
|
|
340
|
+
width: rect.width,
|
|
341
|
+
height: rect.height,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function autoLayoutParentInfo(el: Element) {
|
|
346
|
+
var parent = el.parentElement;
|
|
347
|
+
if (
|
|
348
|
+
!parent ||
|
|
349
|
+
parent === document.body ||
|
|
350
|
+
parent === document.documentElement
|
|
351
|
+
) {
|
|
352
|
+
return undefined;
|
|
353
|
+
}
|
|
354
|
+
var parentStyles = window.getComputedStyle(parent);
|
|
355
|
+
if (!isAutoLayoutDisplay(parentStyles.display)) return undefined;
|
|
356
|
+
return {
|
|
357
|
+
display: parentStyles.display,
|
|
358
|
+
selector: getSelector(parent),
|
|
359
|
+
sourceId: getSourceId(parent) || getSelector(parent),
|
|
360
|
+
boundingRect: rectInfoForElement(parent),
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function chromeColorForElement(el: Element | null): string {
|
|
365
|
+
return elementLooksLikeComponent(el)
|
|
366
|
+
? "var(--design-editor-component-color)"
|
|
367
|
+
: "var(--design-editor-accent-color)";
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function chromeStrongColorForElement(el: Element | null): string {
|
|
371
|
+
return elementLooksLikeComponent(el)
|
|
372
|
+
? "var(--design-editor-component-strong-color)"
|
|
373
|
+
: "var(--design-editor-accent-strong-color)";
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function chromeContrastColorForElement(el: Element | null): string {
|
|
377
|
+
return elementLooksLikeComponent(el)
|
|
378
|
+
? "var(--design-editor-component-contrast-color)"
|
|
379
|
+
: "var(--design-editor-accent-contrast-color)";
|
|
380
|
+
}
|
|
381
|
+
|
|
252
382
|
function getElementInfo(el: Element): unknown {
|
|
253
383
|
var cs = window.getComputedStyle(el);
|
|
254
384
|
var rect = el.getBoundingClientRect();
|
|
385
|
+
var componentName = componentNameForElement(el);
|
|
386
|
+
var parentAutoLayout = autoLayoutParentInfo(el);
|
|
255
387
|
var parentStyles = el.parentElement
|
|
256
388
|
? window.getComputedStyle(el.parentElement)
|
|
257
389
|
: null;
|
|
@@ -297,13 +429,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
297
429
|
reason: "Class tokens are visible on the selected element.",
|
|
298
430
|
});
|
|
299
431
|
}
|
|
300
|
-
if (
|
|
301
|
-
sourceBacked &&
|
|
302
|
-
(parentDisplay === "flex" ||
|
|
303
|
-
parentDisplay === "inline-flex" ||
|
|
304
|
-
parentDisplay === "grid" ||
|
|
305
|
-
parentDisplay === "inline-grid")
|
|
306
|
-
) {
|
|
432
|
+
if (sourceBacked && isAutoLayoutDisplay(parentDisplay)) {
|
|
307
433
|
capabilities.push({
|
|
308
434
|
kind: "agent-structural-edit",
|
|
309
435
|
label: "agent-structural-edit",
|
|
@@ -370,6 +496,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
370
496
|
}
|
|
371
497
|
return {
|
|
372
498
|
tagName: el.tagName.toLowerCase(),
|
|
499
|
+
componentName: componentName || undefined,
|
|
373
500
|
id: el.id || undefined,
|
|
374
501
|
sourceId: sourceId,
|
|
375
502
|
selector: getSelector(el),
|
|
@@ -446,9 +573,12 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
446
573
|
el.innerHTML && el.innerHTML !== el.textContent
|
|
447
574
|
? el.innerHTML.slice(0, 4000)
|
|
448
575
|
: undefined,
|
|
576
|
+
childElementCount: el.children ? el.children.length : 0,
|
|
449
577
|
isFlexContainer: cs.display === "flex" || cs.display === "inline-flex",
|
|
578
|
+
isGridContainer: cs.display === "grid" || cs.display === "inline-grid",
|
|
450
579
|
isFlexChild: parentDisplay === "flex" || parentDisplay === "inline-flex",
|
|
451
580
|
parentDisplay: parentDisplay,
|
|
581
|
+
parentAutoLayout: parentAutoLayout,
|
|
452
582
|
parentLayout: parentLayout,
|
|
453
583
|
editCapabilities: capabilities,
|
|
454
584
|
confidence: capabilities.reduce(function (best, item) {
|
|
@@ -458,6 +588,72 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
458
588
|
};
|
|
459
589
|
}
|
|
460
590
|
|
|
591
|
+
function selectionIntentFromEvent(e): {
|
|
592
|
+
additive: boolean;
|
|
593
|
+
range: boolean;
|
|
594
|
+
source: "pointer";
|
|
595
|
+
shiftKey: boolean;
|
|
596
|
+
metaKey: boolean;
|
|
597
|
+
ctrlKey: boolean;
|
|
598
|
+
} {
|
|
599
|
+
var additive = Boolean(e && (e.metaKey || e.ctrlKey || e.shiftKey));
|
|
600
|
+
return {
|
|
601
|
+
additive: additive,
|
|
602
|
+
range: Boolean(e && e.shiftKey),
|
|
603
|
+
source: "pointer",
|
|
604
|
+
shiftKey: Boolean(e && e.shiftKey),
|
|
605
|
+
metaKey: Boolean(e && e.metaKey),
|
|
606
|
+
ctrlKey: Boolean(e && e.ctrlKey),
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function postElementSelect(el: Element, e?: MouseEvent): void {
|
|
611
|
+
var message: {
|
|
612
|
+
type: string;
|
|
613
|
+
payload: unknown;
|
|
614
|
+
intent?: ReturnType<typeof selectionIntentFromEvent>;
|
|
615
|
+
} = {
|
|
616
|
+
type: "element-select",
|
|
617
|
+
payload: getElementInfo(el),
|
|
618
|
+
};
|
|
619
|
+
if (e) message.intent = selectionIntentFromEvent(e);
|
|
620
|
+
(window.parent as Window).postMessage(message, "*");
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function collectSelectableElements(): Element[] {
|
|
624
|
+
var nodes = Array.prototype.slice.call(
|
|
625
|
+
document.querySelectorAll(
|
|
626
|
+
"[data-agent-native-node-id],[data-code-layer-id],[data-layer-id],[data-builder-id],[data-loc]",
|
|
627
|
+
),
|
|
628
|
+
) as Element[];
|
|
629
|
+
var seen = new Set<Element>();
|
|
630
|
+
var elements: Element[] = [];
|
|
631
|
+
nodes.forEach(function (node) {
|
|
632
|
+
var target = selectionTargetForHit(node);
|
|
633
|
+
if (
|
|
634
|
+
!target ||
|
|
635
|
+
isDocumentRootElement(target) ||
|
|
636
|
+
isBoardRootMarqueeSurface(target) ||
|
|
637
|
+
isOverlayElement(target) ||
|
|
638
|
+
isLayerInteractionBlocked(target) ||
|
|
639
|
+
seen.has(target)
|
|
640
|
+
) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
var rect = target.getBoundingClientRect();
|
|
644
|
+
if (rect.width <= 0 || rect.height <= 0) return;
|
|
645
|
+
seen.add(target);
|
|
646
|
+
elements.push(target);
|
|
647
|
+
});
|
|
648
|
+
return elements;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
function collectSelectableElementInfos(): unknown[] {
|
|
652
|
+
return collectSelectableElements().map(function (target) {
|
|
653
|
+
return getElementInfo(target);
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
461
657
|
var shieldOverlay = document.createElement("div");
|
|
462
658
|
shieldOverlay.setAttribute("data-agent-native-edit-overlay", "shield");
|
|
463
659
|
shieldOverlay.style.cssText =
|
|
@@ -470,6 +666,24 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
470
666
|
"position:fixed;pointer-events:none;z-index:99997;border:1.5px solid var(--design-editor-accent-color);background:transparent;display:none;box-sizing:border-box;";
|
|
471
667
|
document.body.appendChild(highlightOverlay);
|
|
472
668
|
|
|
669
|
+
var marqueeSelectionOverlay = document.createElement("div");
|
|
670
|
+
marqueeSelectionOverlay.setAttribute(
|
|
671
|
+
"data-agent-native-edit-overlay",
|
|
672
|
+
"marquee-selection",
|
|
673
|
+
);
|
|
674
|
+
marqueeSelectionOverlay.style.cssText =
|
|
675
|
+
"position:fixed;pointer-events:none;z-index:99995;border:1px solid var(--design-editor-accent-color);background:color-mix(in srgb,var(--design-editor-accent-color) 14%,transparent);display:none;box-sizing:border-box;";
|
|
676
|
+
document.body.appendChild(marqueeSelectionOverlay);
|
|
677
|
+
|
|
678
|
+
var parentAutoLayoutOverlay = document.createElement("div");
|
|
679
|
+
parentAutoLayoutOverlay.setAttribute(
|
|
680
|
+
"data-agent-native-edit-overlay",
|
|
681
|
+
"parent-auto-layout",
|
|
682
|
+
);
|
|
683
|
+
parentAutoLayoutOverlay.style.cssText =
|
|
684
|
+
"position:fixed;pointer-events:none;z-index:99996;border:1px dashed var(--design-editor-accent-color);background:transparent;display:none;box-sizing:border-box;border-radius:2px;opacity:0.68;";
|
|
685
|
+
document.body.appendChild(parentAutoLayoutOverlay);
|
|
686
|
+
|
|
473
687
|
var selectionOverlay = document.createElement("div");
|
|
474
688
|
selectionOverlay.setAttribute("data-agent-native-edit-overlay", "selection");
|
|
475
689
|
selectionOverlay.style.cssText =
|
|
@@ -601,10 +815,10 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
601
815
|
"white-space:nowrap",
|
|
602
816
|
"user-select:none",
|
|
603
817
|
"-webkit-user-select:none",
|
|
604
|
-
"background:var(--design-editor-
|
|
605
|
-
"color:var(--design-editor-
|
|
606
|
-
"box-shadow:0 1px 4px color-mix(in srgb,var(--design-editor-
|
|
607
|
-
"border:1px solid color-mix(in srgb,var(--design-editor-
|
|
818
|
+
"background:var(--design-editor-component-color)",
|
|
819
|
+
"color:var(--design-editor-component-contrast-color)",
|
|
820
|
+
"box-shadow:0 1px 4px color-mix(in srgb,var(--design-editor-component-color) 40%,transparent)",
|
|
821
|
+
"border:1px solid color-mix(in srgb,var(--design-editor-component-strong-color) 60%,transparent)",
|
|
608
822
|
"outline:2px solid transparent",
|
|
609
823
|
"transition:opacity 0.1s",
|
|
610
824
|
].join(";") + ";";
|
|
@@ -635,8 +849,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
635
849
|
clearComponentTag();
|
|
636
850
|
return;
|
|
637
851
|
}
|
|
638
|
-
var compName =
|
|
639
|
-
el.getAttribute && el.getAttribute("data-agent-native-component");
|
|
852
|
+
var compName = explicitComponentNameForElement(el);
|
|
640
853
|
if (!compName) {
|
|
641
854
|
clearComponentTag();
|
|
642
855
|
return;
|
|
@@ -658,9 +871,9 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
658
871
|
componentTagOverlay.style.display = "block";
|
|
659
872
|
componentTagOverlay.style.left = rect.left + "px";
|
|
660
873
|
componentTagOverlay.style.top = tagTop + "px";
|
|
661
|
-
//
|
|
874
|
+
// Purple outline on the selection overlay distinguishes component roots.
|
|
662
875
|
selectionOverlay.style.outline =
|
|
663
|
-
"2px solid
|
|
876
|
+
"2px solid " + chromeStrongColorForElement(el);
|
|
664
877
|
selectionOverlay.style.outlineOffset = "2px";
|
|
665
878
|
}
|
|
666
879
|
|
|
@@ -672,8 +885,77 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
672
885
|
selectionOverlay.style.outlineOffset = "";
|
|
673
886
|
}
|
|
674
887
|
|
|
888
|
+
function applyElementOverlayChrome(
|
|
889
|
+
overlay: HTMLElement,
|
|
890
|
+
el: Element | null,
|
|
891
|
+
): void {
|
|
892
|
+
var color = chromeColorForElement(el);
|
|
893
|
+
var contrast = chromeContrastColorForElement(el);
|
|
894
|
+
overlay.style.borderColor = color;
|
|
895
|
+
overlay
|
|
896
|
+
.querySelectorAll(
|
|
897
|
+
"[data-agent-native-edit-handle],[data-agent-native-edit-overlay='multi-selection-handle']",
|
|
898
|
+
)
|
|
899
|
+
.forEach(function (node) {
|
|
900
|
+
if (!(node instanceof HTMLElement)) return;
|
|
901
|
+
node.style.borderColor = color;
|
|
902
|
+
node.style.background = contrast;
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
function applySelectionChrome(el: Element | null): void {
|
|
907
|
+
applyElementOverlayChrome(selectionOverlay, el);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
function hideParentAutoLayoutOverlay(): void {
|
|
911
|
+
parentAutoLayoutOverlay.style.display = "none";
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function updateParentAutoLayoutOverlay(el: Element | null): void {
|
|
915
|
+
var parent = el && el.parentElement;
|
|
916
|
+
if (
|
|
917
|
+
!parent ||
|
|
918
|
+
parent === document.body ||
|
|
919
|
+
parent === document.documentElement
|
|
920
|
+
) {
|
|
921
|
+
hideParentAutoLayoutOverlay();
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
var parentStyles = window.getComputedStyle(parent);
|
|
925
|
+
if (!isAutoLayoutDisplay(parentStyles.display)) {
|
|
926
|
+
hideParentAutoLayoutOverlay();
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
positionOverlay(parentAutoLayoutOverlay, parent);
|
|
930
|
+
var color = chromeColorForElement(el);
|
|
931
|
+
parentAutoLayoutOverlay.style.borderColor =
|
|
932
|
+
"color-mix(in srgb," + color + " 68%,transparent)";
|
|
933
|
+
parentAutoLayoutOverlay.style.background =
|
|
934
|
+
"color-mix(in srgb," + color + " 5%,transparent)";
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
function hideSelectionOverlay(): void {
|
|
938
|
+
selectionOverlay.style.display = "none";
|
|
939
|
+
hideSpacingOverlay();
|
|
940
|
+
hideParentAutoLayoutOverlay();
|
|
941
|
+
clearComponentTag();
|
|
942
|
+
}
|
|
943
|
+
|
|
675
944
|
var selectedEl: Element | null = null;
|
|
676
945
|
var hoveredEl: Element | null = null;
|
|
946
|
+
var passiveSelectionEls: Element[] = [];
|
|
947
|
+
var passiveSelectionOverlays: HTMLElement[] = [];
|
|
948
|
+
var activeMarqueeSelection: {
|
|
949
|
+
startX: number;
|
|
950
|
+
startY: number;
|
|
951
|
+
additive: boolean;
|
|
952
|
+
moved: boolean;
|
|
953
|
+
pointerId?: number;
|
|
954
|
+
move: string;
|
|
955
|
+
up: string;
|
|
956
|
+
onMove: (ev: MouseEvent) => void;
|
|
957
|
+
onUp: (ev: MouseEvent) => void;
|
|
958
|
+
} | null = null;
|
|
677
959
|
var activeTextEditEl: HTMLElement | null = null;
|
|
678
960
|
var textEditPointerState: {
|
|
679
961
|
shield: string;
|
|
@@ -705,6 +987,8 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
705
987
|
var suppressNextShieldClickTimer: ReturnType<typeof setTimeout> | null = null;
|
|
706
988
|
var selectedSpacingHovered = false;
|
|
707
989
|
var hoveredSpacingHandleKey = "";
|
|
990
|
+
var spacingHoverClearTimer: ReturnType<typeof setTimeout> | null = null;
|
|
991
|
+
var lastSpacingPointerPoint: { x: number; y: number } | null = null;
|
|
708
992
|
var spacingHandleStateByKey: Record<string, { value: number }> = {};
|
|
709
993
|
var spacingHandleNodesByKey: Record<string, Element> = {};
|
|
710
994
|
var spacingOverlayRenderKey = "";
|
|
@@ -728,14 +1012,110 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
728
1012
|
function clearRuntimeSelection(): void {
|
|
729
1013
|
selectedEl = null;
|
|
730
1014
|
hoveredEl = null;
|
|
1015
|
+
setPassiveSelectionElements([]);
|
|
1016
|
+
clearSpacingHoverTimer();
|
|
731
1017
|
selectedSpacingHovered = false;
|
|
732
1018
|
hoveredSpacingHandleKey = "";
|
|
1019
|
+
lastSpacingPointerPoint = null;
|
|
733
1020
|
spacingDrag = null;
|
|
734
|
-
|
|
1021
|
+
hideSelectionOverlay();
|
|
735
1022
|
highlightOverlay.style.display = "none";
|
|
1023
|
+
marqueeSelectionOverlay.style.display = "none";
|
|
1024
|
+
clearActiveMarqueeSelection();
|
|
736
1025
|
hideSpacingOverlay();
|
|
737
1026
|
hideMeasurements();
|
|
738
|
-
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
function removePassiveSelectionOverlays(): void {
|
|
1030
|
+
passiveSelectionOverlays.forEach(function (overlay) {
|
|
1031
|
+
if (overlay.parentNode) overlay.parentNode.removeChild(overlay);
|
|
1032
|
+
});
|
|
1033
|
+
passiveSelectionOverlays = [];
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
function appendPassiveSelectionHandles(overlay: HTMLElement): void {
|
|
1037
|
+
["nw", "ne", "se", "sw"].forEach(function (pos) {
|
|
1038
|
+
var handle = document.createElement("span");
|
|
1039
|
+
handle.setAttribute(
|
|
1040
|
+
"data-agent-native-edit-overlay",
|
|
1041
|
+
"multi-selection-handle",
|
|
1042
|
+
);
|
|
1043
|
+
handle.setAttribute("data-corner", pos);
|
|
1044
|
+
handle.style.cssText =
|
|
1045
|
+
"position:absolute;z-index:1;width:7px;height:7px;border:1px solid var(--design-editor-accent-color);background:var(--design-editor-accent-contrast-color);box-sizing:border-box;border-radius:1px;pointer-events:none;";
|
|
1046
|
+
if (pos.indexOf("n") !== -1) handle.style.top = "-4px";
|
|
1047
|
+
if (pos.indexOf("s") !== -1) handle.style.bottom = "-4px";
|
|
1048
|
+
if (pos.indexOf("w") !== -1) handle.style.left = "-4px";
|
|
1049
|
+
if (pos.indexOf("e") !== -1) handle.style.right = "-4px";
|
|
1050
|
+
overlay.appendChild(handle);
|
|
1051
|
+
});
|
|
1052
|
+
scalePassiveSelectionOverlay(overlay);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
function makePassiveSelectionOverlay(): HTMLElement {
|
|
1056
|
+
var overlay = document.createElement("div");
|
|
1057
|
+
overlay.setAttribute("data-agent-native-edit-overlay", "multi-selection");
|
|
1058
|
+
overlay.style.cssText =
|
|
1059
|
+
"position:fixed;pointer-events:none;z-index:99996;border:1.5px solid var(--design-editor-accent-color);background:transparent;display:none;box-sizing:border-box;";
|
|
1060
|
+
appendPassiveSelectionHandles(overlay);
|
|
1061
|
+
document.body.appendChild(overlay);
|
|
1062
|
+
return overlay;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
function scalePassiveSelectionOverlay(overlay: HTMLElement): void {
|
|
1066
|
+
var sx = chromeScaleX();
|
|
1067
|
+
var sy = chromeScaleY();
|
|
1068
|
+
var line = chromeLineScale();
|
|
1069
|
+
overlay.style.borderWidth = 1.5 * line + "px";
|
|
1070
|
+
overlay
|
|
1071
|
+
.querySelectorAll(
|
|
1072
|
+
"[data-agent-native-edit-overlay='multi-selection-handle']",
|
|
1073
|
+
)
|
|
1074
|
+
.forEach(function (handle) {
|
|
1075
|
+
var pos = handle.getAttribute("data-corner") || "";
|
|
1076
|
+
handle.style.width = 7 * sx + "px";
|
|
1077
|
+
handle.style.height = 7 * sy + "px";
|
|
1078
|
+
handle.style.borderWidth = Math.max(1, 1 * line) + "px";
|
|
1079
|
+
if (pos.indexOf("n") !== -1) handle.style.top = -4 * sy + "px";
|
|
1080
|
+
if (pos.indexOf("s") !== -1) handle.style.bottom = -4 * sy + "px";
|
|
1081
|
+
if (pos.indexOf("w") !== -1) handle.style.left = -4 * sx + "px";
|
|
1082
|
+
if (pos.indexOf("e") !== -1) handle.style.right = -4 * sx + "px";
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
function setPassiveSelectionElements(elements: Element[]): void {
|
|
1087
|
+
passiveSelectionEls = elements.filter(function (el, index, all) {
|
|
1088
|
+
return (
|
|
1089
|
+
el &&
|
|
1090
|
+
el !== selectedEl &&
|
|
1091
|
+
document.documentElement.contains(el) &&
|
|
1092
|
+
all.indexOf(el) === index
|
|
1093
|
+
);
|
|
1094
|
+
});
|
|
1095
|
+
removePassiveSelectionOverlays();
|
|
1096
|
+
passiveSelectionEls.forEach(function (el) {
|
|
1097
|
+
var overlay = makePassiveSelectionOverlay();
|
|
1098
|
+
passiveSelectionOverlays.push(overlay);
|
|
1099
|
+
positionOverlay(overlay, el);
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
function preservePreviousSelectedElementForShiftClick(
|
|
1104
|
+
previous: Element | null,
|
|
1105
|
+
next: Element | null,
|
|
1106
|
+
e?: MouseEvent,
|
|
1107
|
+
): void {
|
|
1108
|
+
if (
|
|
1109
|
+
!e?.shiftKey ||
|
|
1110
|
+
!previous ||
|
|
1111
|
+
!next ||
|
|
1112
|
+
previous === next ||
|
|
1113
|
+
!document.documentElement.contains(previous) ||
|
|
1114
|
+
isLayerInteractionBlocked(previous)
|
|
1115
|
+
) {
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
setPassiveSelectionElements([previous].concat(passiveSelectionEls));
|
|
739
1119
|
}
|
|
740
1120
|
|
|
741
1121
|
function matchesSelectorList(
|
|
@@ -813,13 +1193,20 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
813
1193
|
html: string,
|
|
814
1194
|
preferredSelector: string,
|
|
815
1195
|
selectorCandidates: string[],
|
|
1196
|
+
forceFullDocument?: boolean,
|
|
816
1197
|
): void {
|
|
817
1198
|
if (typeof html !== "string") return;
|
|
818
|
-
if (activeTextEditEl) {
|
|
1199
|
+
if (activeTextEditEl && !forceFullDocument) {
|
|
819
1200
|
applyHiddenSelectors();
|
|
820
1201
|
refreshOverlays();
|
|
821
1202
|
return;
|
|
822
1203
|
}
|
|
1204
|
+
if (activeTextEditEl) {
|
|
1205
|
+
postTextEditingState(activeTextEditEl, false);
|
|
1206
|
+
activeTextEditEl = null;
|
|
1207
|
+
setTextEditingPointerPassthrough(false);
|
|
1208
|
+
setSelectionOverlayResizeChromeVisible(true);
|
|
1209
|
+
}
|
|
823
1210
|
var parser = new DOMParser();
|
|
824
1211
|
var nextDoc = parser.parseFromString(html, "text/html");
|
|
825
1212
|
if (!nextDoc || !nextDoc.body) return;
|
|
@@ -846,10 +1233,9 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
846
1233
|
}
|
|
847
1234
|
|
|
848
1235
|
var nextHeadHtml = nextDoc.head ? nextDoc.head.innerHTML : "";
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
) {
|
|
1236
|
+
ensureEditorChromeStyle();
|
|
1237
|
+
var currentHeadHtml = runtimeHeadHtmlWithoutEditorChrome();
|
|
1238
|
+
if (nextHeadHtml === currentHeadHtml && activeCandidates.length > 0) {
|
|
853
1239
|
var currentMatch = null;
|
|
854
1240
|
var nextMatch = null;
|
|
855
1241
|
var matchedSelector = "";
|
|
@@ -915,12 +1301,9 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
915
1301
|
hoveredEl = null;
|
|
916
1302
|
if (selectedEl && !isLayerInteractionBlocked(selectedEl)) {
|
|
917
1303
|
positionOverlay(selectionOverlay, selectedEl);
|
|
918
|
-
(
|
|
919
|
-
{ type: "element-select", payload: getElementInfo(selectedEl) },
|
|
920
|
-
"*",
|
|
921
|
-
);
|
|
1304
|
+
postElementSelect(selectedEl);
|
|
922
1305
|
} else {
|
|
923
|
-
|
|
1306
|
+
hideSelectionOverlay();
|
|
924
1307
|
}
|
|
925
1308
|
highlightOverlay.style.display = "none";
|
|
926
1309
|
hideMeasurements();
|
|
@@ -928,8 +1311,9 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
928
1311
|
return;
|
|
929
1312
|
}
|
|
930
1313
|
}
|
|
931
|
-
if (
|
|
1314
|
+
if (currentHeadHtml !== nextHeadHtml) {
|
|
932
1315
|
document.head.innerHTML = nextHeadHtml;
|
|
1316
|
+
ensureEditorChromeStyle();
|
|
933
1317
|
}
|
|
934
1318
|
Array.prototype.slice.call(document.body.attributes).forEach(function (
|
|
935
1319
|
attribute: Attr,
|
|
@@ -968,12 +1352,9 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
968
1352
|
}
|
|
969
1353
|
if (selectedEl) {
|
|
970
1354
|
positionOverlay(selectionOverlay, selectedEl);
|
|
971
|
-
(
|
|
972
|
-
{ type: "element-select", payload: getElementInfo(selectedEl) },
|
|
973
|
-
"*",
|
|
974
|
-
);
|
|
1355
|
+
postElementSelect(selectedEl);
|
|
975
1356
|
} else {
|
|
976
|
-
|
|
1357
|
+
hideSelectionOverlay();
|
|
977
1358
|
}
|
|
978
1359
|
highlightOverlay.style.display = "none";
|
|
979
1360
|
hideMeasurements();
|
|
@@ -989,6 +1370,13 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
989
1370
|
if (!spacingDrag) spacingBadge.style.display = "none";
|
|
990
1371
|
}
|
|
991
1372
|
|
|
1373
|
+
function clearSpacingHoverTimer(): void {
|
|
1374
|
+
if (spacingHoverClearTimer !== null) {
|
|
1375
|
+
clearTimeout(spacingHoverClearTimer);
|
|
1376
|
+
spacingHoverClearTimer = null;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
|
|
992
1380
|
function visibleLayoutChildren(el: Element | null): Element[] {
|
|
993
1381
|
if (!el || !el.children) return [];
|
|
994
1382
|
return Array.prototype.slice.call(el.children).filter(function (child) {
|
|
@@ -1400,7 +1788,10 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1400
1788
|
);
|
|
1401
1789
|
var lineNode = document.createElement("span");
|
|
1402
1790
|
lineNode.setAttribute("data-agent-native-spacing-line", handle.kind);
|
|
1791
|
+
lineNode.style.position = "absolute";
|
|
1403
1792
|
lineNode.style.display = "block";
|
|
1793
|
+
lineNode.style.pointerEvents = "none";
|
|
1794
|
+
lineNode.style.borderRadius = "999px";
|
|
1404
1795
|
lineNode.style.left = handle.line.x + "px";
|
|
1405
1796
|
lineNode.style.top = handle.line.y + "px";
|
|
1406
1797
|
lineNode.style.width = Math.max(1, handle.line.width) + "px";
|
|
@@ -1412,7 +1803,13 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1412
1803
|
regionNode.setAttribute("data-agent-native-spacing-region", handle.kind);
|
|
1413
1804
|
regionNode.setAttribute("data-orientation", handle.orientation);
|
|
1414
1805
|
regionNode.setAttribute("data-spacing-key", handle.key);
|
|
1806
|
+
regionNode.style.position = "absolute";
|
|
1415
1807
|
regionNode.style.display = "block";
|
|
1808
|
+
regionNode.style.boxSizing = "border-box";
|
|
1809
|
+
regionNode.style.pointerEvents = "auto";
|
|
1810
|
+
regionNode.style.backgroundSize = "6px 6px";
|
|
1811
|
+
regionNode.style.cursor =
|
|
1812
|
+
handle.orientation === "vertical" ? "ew-resize" : "ns-resize";
|
|
1416
1813
|
regionNode.style.left = handle.region.x + "px";
|
|
1417
1814
|
regionNode.style.top = handle.region.y + "px";
|
|
1418
1815
|
regionNode.style.width = handle.region.width + "px";
|
|
@@ -1424,6 +1821,14 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1424
1821
|
? "1px solid " + spacingColor(handle.kind)
|
|
1425
1822
|
: "0";
|
|
1426
1823
|
regionNode.style.outlineOffset = "-1px";
|
|
1824
|
+
regionNode.addEventListener(
|
|
1825
|
+
"pointerdown",
|
|
1826
|
+
function (event) {
|
|
1827
|
+
activateSpacingHandle(handle.key);
|
|
1828
|
+
startSpacingDrag(handle.key, event);
|
|
1829
|
+
},
|
|
1830
|
+
true,
|
|
1831
|
+
);
|
|
1427
1832
|
regionNode.addEventListener(
|
|
1428
1833
|
"mousedown",
|
|
1429
1834
|
function (event) {
|
|
@@ -1435,6 +1840,31 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1435
1840
|
spacingOverlay.appendChild(regionNode);
|
|
1436
1841
|
}
|
|
1437
1842
|
|
|
1843
|
+
function updateSpacingHandleHighlights(
|
|
1844
|
+
handles: ({
|
|
1845
|
+
key: string;
|
|
1846
|
+
groupKey: string;
|
|
1847
|
+
kind: string;
|
|
1848
|
+
orientation: string;
|
|
1849
|
+
} | null)[],
|
|
1850
|
+
activeGroupKey: string,
|
|
1851
|
+
): void {
|
|
1852
|
+
handles.forEach(function (handle) {
|
|
1853
|
+
if (!handle) return;
|
|
1854
|
+
var regionNode = spacingHandleNodesByKey[handle.key];
|
|
1855
|
+
if (!regionNode) return;
|
|
1856
|
+
var highlighted = Boolean(
|
|
1857
|
+
activeGroupKey && handle.groupKey === activeGroupKey,
|
|
1858
|
+
);
|
|
1859
|
+
(regionNode as HTMLElement).style.background = highlighted
|
|
1860
|
+
? spacingFill(handle.kind, handle.orientation)
|
|
1861
|
+
: "transparent";
|
|
1862
|
+
(regionNode as HTMLElement).style.outline = highlighted
|
|
1863
|
+
? "1px solid " + spacingColor(handle.kind)
|
|
1864
|
+
: "0";
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1438
1868
|
function updateSpacingOverlay(el: Element | null): void {
|
|
1439
1869
|
if (el && el !== selectedEl) {
|
|
1440
1870
|
hideSpacingOverlay();
|
|
@@ -1444,45 +1874,34 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1444
1874
|
hideSpacingOverlay();
|
|
1445
1875
|
return;
|
|
1446
1876
|
}
|
|
1447
|
-
if (!selectedSpacingHovered && !hoveredSpacingHandleKey && !spacingDrag) {
|
|
1448
|
-
hideSpacingOverlay();
|
|
1449
|
-
return;
|
|
1450
|
-
}
|
|
1451
1877
|
var handles = buildSpacingHandles(selectedEl);
|
|
1452
1878
|
if (handles.length === 0) {
|
|
1453
1879
|
hideSpacingOverlay();
|
|
1454
1880
|
return;
|
|
1455
1881
|
}
|
|
1456
|
-
var activeHandle =
|
|
1457
|
-
(spacingDrag && spacingDrag.handle) ||
|
|
1458
|
-
handles.find(function (handle) {
|
|
1459
|
-
return handle.key === hoveredSpacingHandleKey;
|
|
1460
|
-
}) ||
|
|
1461
|
-
null;
|
|
1882
|
+
var activeHandle = spacingDrag ? spacingDrag.handle : null;
|
|
1462
1883
|
var activeGroupKey = activeHandle ? activeHandle.groupKey : "";
|
|
1463
|
-
var nextRenderKey =
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
].join(",");
|
|
1480
|
-
})
|
|
1481
|
-
.join("|");
|
|
1884
|
+
var nextRenderKey = handles
|
|
1885
|
+
.map(function (handle) {
|
|
1886
|
+
return [
|
|
1887
|
+
handle.key,
|
|
1888
|
+
handle.value,
|
|
1889
|
+
handle.region.x,
|
|
1890
|
+
handle.region.y,
|
|
1891
|
+
handle.region.width,
|
|
1892
|
+
handle.region.height,
|
|
1893
|
+
handle.line.x,
|
|
1894
|
+
handle.line.y,
|
|
1895
|
+
handle.line.width,
|
|
1896
|
+
handle.line.height,
|
|
1897
|
+
].join(",");
|
|
1898
|
+
})
|
|
1899
|
+
.join("|");
|
|
1482
1900
|
if (
|
|
1483
1901
|
spacingOverlay.style.display === "block" &&
|
|
1484
1902
|
spacingOverlayRenderKey === nextRenderKey
|
|
1485
1903
|
) {
|
|
1904
|
+
updateSpacingHandleHighlights(handles, activeGroupKey);
|
|
1486
1905
|
if (activeHandle) {
|
|
1487
1906
|
showSpacingBadgeForHandle(
|
|
1488
1907
|
activeHandle,
|
|
@@ -1511,25 +1930,40 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1511
1930
|
}
|
|
1512
1931
|
}
|
|
1513
1932
|
|
|
1514
|
-
function
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
? e.target.closest("[data-agent-native-spacing-region]")
|
|
1933
|
+
function spacingKeyFromTarget(target: Element | null): string {
|
|
1934
|
+
var region =
|
|
1935
|
+
target && target.closest
|
|
1936
|
+
? target.closest("[data-agent-native-spacing-region]")
|
|
1519
1937
|
: null;
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1938
|
+
return region && region.getAttribute
|
|
1939
|
+
? region.getAttribute("data-spacing-key") || ""
|
|
1940
|
+
: "";
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
function activateSpacingHandle(spacingKey: string): void {
|
|
1524
1944
|
if (!spacingKey) return;
|
|
1525
|
-
|
|
1945
|
+
clearSpacingHoverTimer();
|
|
1526
1946
|
selectedSpacingHovered = true;
|
|
1527
|
-
if (
|
|
1947
|
+
if (
|
|
1948
|
+
hoveredSpacingHandleKey !== spacingKey ||
|
|
1949
|
+
spacingOverlay.style.display !== "block"
|
|
1950
|
+
) {
|
|
1528
1951
|
hoveredSpacingHandleKey = spacingKey;
|
|
1529
1952
|
updateSpacingOverlay(selectedEl);
|
|
1530
1953
|
}
|
|
1531
1954
|
}
|
|
1532
1955
|
|
|
1956
|
+
function handleSpacingOverlayPointerMove(e: PointerEvent): void {
|
|
1957
|
+
if (spacingDrag) return;
|
|
1958
|
+
lastSpacingPointerPoint = { x: e.clientX, y: e.clientY };
|
|
1959
|
+
var spacingKey = spacingKeyFromTarget(
|
|
1960
|
+
e.target && e.target.nodeType === 1 ? e.target : null,
|
|
1961
|
+
);
|
|
1962
|
+
if (!spacingKey) return;
|
|
1963
|
+
stopNativeInteraction(e);
|
|
1964
|
+
activateSpacingHandle(spacingKey);
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1533
1967
|
function spacingRegionFromPoint(
|
|
1534
1968
|
clientX: number,
|
|
1535
1969
|
clientY: number,
|
|
@@ -1557,8 +1991,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1557
1991
|
var spacingKey = region.getAttribute
|
|
1558
1992
|
? region.getAttribute("data-spacing-key")
|
|
1559
1993
|
: "";
|
|
1560
|
-
if (spacingKey)
|
|
1561
|
-
selectedSpacingHovered = true;
|
|
1994
|
+
if (spacingKey) activateSpacingHandle(spacingKey);
|
|
1562
1995
|
return true;
|
|
1563
1996
|
}
|
|
1564
1997
|
var hit = elementFromEditorPoint(clientX, clientY);
|
|
@@ -1572,6 +2005,25 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1572
2005
|
return false;
|
|
1573
2006
|
}
|
|
1574
2007
|
|
|
2008
|
+
function scheduleSpacingHoverClear(e: PointerEvent): void {
|
|
2009
|
+
if (spacingDrag) return;
|
|
2010
|
+
if (Number.isFinite(e.clientX) && Number.isFinite(e.clientY)) {
|
|
2011
|
+
lastSpacingPointerPoint = { x: e.clientX, y: e.clientY };
|
|
2012
|
+
}
|
|
2013
|
+
clearSpacingHoverTimer();
|
|
2014
|
+
spacingHoverClearTimer = setTimeout(function () {
|
|
2015
|
+
spacingHoverClearTimer = null;
|
|
2016
|
+
var point = lastSpacingPointerPoint;
|
|
2017
|
+
if (point && selectedSpacingSurfaceContainsPoint(point.x, point.y)) {
|
|
2018
|
+
updateSpacingOverlay(selectedEl);
|
|
2019
|
+
return;
|
|
2020
|
+
}
|
|
2021
|
+
selectedSpacingHovered = false;
|
|
2022
|
+
hoveredSpacingHandleKey = "";
|
|
2023
|
+
updateSpacingOverlay(selectedEl);
|
|
2024
|
+
}, 80);
|
|
2025
|
+
}
|
|
2026
|
+
|
|
1575
2027
|
function shouldKeepSpacingOverlayForLeave(e: PointerEvent): boolean {
|
|
1576
2028
|
if (spacingDrag) return true;
|
|
1577
2029
|
if (e.relatedTarget && isOverlayElement(e.relatedTarget)) return true;
|
|
@@ -1587,7 +2039,9 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1587
2039
|
var sy = chromeScaleY();
|
|
1588
2040
|
var line = chromeLineScale();
|
|
1589
2041
|
highlightOverlay.style.borderWidth = 1.5 * line + "px";
|
|
2042
|
+
parentAutoLayoutOverlay.style.borderWidth = Math.max(1, 1 * line) + "px";
|
|
1590
2043
|
selectionOverlay.style.borderWidth = 1.5 * line + "px";
|
|
2044
|
+
passiveSelectionOverlays.forEach(scalePassiveSelectionOverlay);
|
|
1591
2045
|
if (selectedEl) updateSpacingOverlay(selectedEl);
|
|
1592
2046
|
|
|
1593
2047
|
selectionOverlay
|
|
@@ -1633,7 +2087,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1633
2087
|
function positionOverlay(overlay: HTMLElement, el: Element): void {
|
|
1634
2088
|
if (!el || !document.documentElement.contains(el)) {
|
|
1635
2089
|
overlay.style.display = "none";
|
|
1636
|
-
if (overlay === selectionOverlay)
|
|
2090
|
+
if (overlay === selectionOverlay) hideSelectionOverlay();
|
|
1637
2091
|
return;
|
|
1638
2092
|
}
|
|
1639
2093
|
// For the selection overlay, prefer the CSS box + rotation transform so
|
|
@@ -1664,8 +2118,10 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1664
2118
|
overlay.style.height = elH + "px";
|
|
1665
2119
|
overlay.style.transform = "rotate(" + elRot + "deg)";
|
|
1666
2120
|
overlay.style.transformOrigin = "0 0";
|
|
2121
|
+
applySelectionChrome(el);
|
|
1667
2122
|
updateSpacingOverlay(el);
|
|
1668
2123
|
updateComponentTag(el);
|
|
2124
|
+
updateParentAutoLayoutOverlay(el);
|
|
1669
2125
|
return;
|
|
1670
2126
|
}
|
|
1671
2127
|
}
|
|
@@ -1677,8 +2133,12 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1677
2133
|
overlay.style.height = rect.height + "px";
|
|
1678
2134
|
overlay.style.transform = "";
|
|
1679
2135
|
if (overlay === selectionOverlay) {
|
|
2136
|
+
applySelectionChrome(el);
|
|
1680
2137
|
updateSpacingOverlay(el);
|
|
1681
2138
|
updateComponentTag(el);
|
|
2139
|
+
updateParentAutoLayoutOverlay(el);
|
|
2140
|
+
} else {
|
|
2141
|
+
applyElementOverlayChrome(overlay, el);
|
|
1682
2142
|
}
|
|
1683
2143
|
}
|
|
1684
2144
|
|
|
@@ -1688,7 +2148,15 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1688
2148
|
} else {
|
|
1689
2149
|
highlightOverlay.style.display = "none";
|
|
1690
2150
|
}
|
|
1691
|
-
if (selectedEl)
|
|
2151
|
+
if (selectedEl) {
|
|
2152
|
+
positionOverlay(selectionOverlay, selectedEl);
|
|
2153
|
+
} else {
|
|
2154
|
+
hideParentAutoLayoutOverlay();
|
|
2155
|
+
}
|
|
2156
|
+
passiveSelectionEls.forEach(function (el, index) {
|
|
2157
|
+
var overlay = passiveSelectionOverlays[index];
|
|
2158
|
+
if (overlay) positionOverlay(overlay, el);
|
|
2159
|
+
});
|
|
1692
2160
|
}
|
|
1693
2161
|
|
|
1694
2162
|
function hideMeasurements(): void {
|
|
@@ -1867,6 +2335,118 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1867
2335
|
if (e.stopImmediatePropagation) e.stopImmediatePropagation();
|
|
1868
2336
|
}
|
|
1869
2337
|
|
|
2338
|
+
function normalizedWheelDelta(e: WheelEvent): { x: number; y: number } {
|
|
2339
|
+
var multiplier =
|
|
2340
|
+
e.deltaMode === WheelEvent.DOM_DELTA_LINE
|
|
2341
|
+
? 16
|
|
2342
|
+
: e.deltaMode === WheelEvent.DOM_DELTA_PAGE
|
|
2343
|
+
? Math.max(
|
|
2344
|
+
1,
|
|
2345
|
+
window.innerHeight || document.documentElement.clientHeight,
|
|
2346
|
+
)
|
|
2347
|
+
: 1;
|
|
2348
|
+
return {
|
|
2349
|
+
x: e.deltaX * multiplier,
|
|
2350
|
+
y: e.deltaY * multiplier,
|
|
2351
|
+
};
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
function scrollableOverflow(value: string | undefined): boolean {
|
|
2355
|
+
return value === "auto" || value === "scroll" || value === "overlay";
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
function canScrollElement(
|
|
2359
|
+
el: Element | null,
|
|
2360
|
+
axis: "x" | "y",
|
|
2361
|
+
delta: number,
|
|
2362
|
+
): boolean {
|
|
2363
|
+
if (!el || !(el instanceof HTMLElement)) return false;
|
|
2364
|
+
var style = window.getComputedStyle(el);
|
|
2365
|
+
var overflow = axis === "y" ? style.overflowY : style.overflowX;
|
|
2366
|
+
if (!scrollableOverflow(overflow)) return false;
|
|
2367
|
+
var max =
|
|
2368
|
+
axis === "y"
|
|
2369
|
+
? el.scrollHeight - el.clientHeight
|
|
2370
|
+
: el.scrollWidth - el.clientWidth;
|
|
2371
|
+
if (max <= 1) return false;
|
|
2372
|
+
var current = axis === "y" ? el.scrollTop : el.scrollLeft;
|
|
2373
|
+
if (delta < 0) return current > 0;
|
|
2374
|
+
if (delta > 0) return current < max - 1;
|
|
2375
|
+
return false;
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
function findScrollableElementForWheel(
|
|
2379
|
+
start: Element | null,
|
|
2380
|
+
deltaX: number,
|
|
2381
|
+
deltaY: number,
|
|
2382
|
+
): HTMLElement | Element | null {
|
|
2383
|
+
var node: Element | null = start;
|
|
2384
|
+
while (node && node.nodeType === 1) {
|
|
2385
|
+
if (
|
|
2386
|
+
canScrollElement(node, "y", deltaY) ||
|
|
2387
|
+
canScrollElement(node, "x", deltaX)
|
|
2388
|
+
) {
|
|
2389
|
+
return node;
|
|
2390
|
+
}
|
|
2391
|
+
node = node.parentElement;
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
var scrollingElement =
|
|
2395
|
+
document.scrollingElement || document.documentElement;
|
|
2396
|
+
var maxY = scrollingElement.scrollHeight - scrollingElement.clientHeight;
|
|
2397
|
+
var maxX = scrollingElement.scrollWidth - scrollingElement.clientWidth;
|
|
2398
|
+
var canScrollUp = false;
|
|
2399
|
+
var canScrollDown = false;
|
|
2400
|
+
var canScrollLeft = false;
|
|
2401
|
+
var canScrollRight = false;
|
|
2402
|
+
if (deltaY < 0) {
|
|
2403
|
+
canScrollUp = scrollingElement.scrollTop > 0;
|
|
2404
|
+
}
|
|
2405
|
+
if (deltaY > 0) {
|
|
2406
|
+
canScrollDown = scrollingElement.scrollTop < maxY - 1;
|
|
2407
|
+
}
|
|
2408
|
+
if (deltaX < 0) {
|
|
2409
|
+
canScrollLeft = scrollingElement.scrollLeft > 0;
|
|
2410
|
+
}
|
|
2411
|
+
if (deltaX > 0) {
|
|
2412
|
+
canScrollRight = scrollingElement.scrollLeft < maxX - 1;
|
|
2413
|
+
}
|
|
2414
|
+
if (canScrollUp || canScrollDown || canScrollLeft || canScrollRight) {
|
|
2415
|
+
return scrollingElement;
|
|
2416
|
+
}
|
|
2417
|
+
return null;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
function scrollElementByWheelDelta(
|
|
2421
|
+
el: HTMLElement | Element,
|
|
2422
|
+
deltaX: number,
|
|
2423
|
+
deltaY: number,
|
|
2424
|
+
): boolean {
|
|
2425
|
+
var anyEl = el as HTMLElement;
|
|
2426
|
+
var beforeLeft = anyEl.scrollLeft || 0;
|
|
2427
|
+
var beforeTop = anyEl.scrollTop || 0;
|
|
2428
|
+
if (typeof anyEl.scrollBy === "function") {
|
|
2429
|
+
anyEl.scrollBy({ left: deltaX, top: deltaY, behavior: "auto" });
|
|
2430
|
+
} else {
|
|
2431
|
+
anyEl.scrollLeft = beforeLeft + deltaX;
|
|
2432
|
+
anyEl.scrollTop = beforeTop + deltaY;
|
|
2433
|
+
}
|
|
2434
|
+
return anyEl.scrollLeft !== beforeLeft || anyEl.scrollTop !== beforeTop;
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
function scrollUnderlyingElementAtWheel(e: WheelEvent): void {
|
|
2438
|
+
if (e.ctrlKey || e.metaKey) return;
|
|
2439
|
+
if (Math.abs(e.deltaX) < 0.01 && Math.abs(e.deltaY) < 0.01) return;
|
|
2440
|
+
var delta = normalizedWheelDelta(e);
|
|
2441
|
+
var target = elementFromEditorPoint(e.clientX, e.clientY);
|
|
2442
|
+
var scrollTarget = findScrollableElementForWheel(target, delta.x, delta.y);
|
|
2443
|
+
if (!scrollTarget) return;
|
|
2444
|
+
var didScroll = scrollElementByWheelDelta(scrollTarget, delta.x, delta.y);
|
|
2445
|
+
if (!didScroll) return;
|
|
2446
|
+
stopNativeInteraction(e);
|
|
2447
|
+
window.requestAnimationFrame(refreshOverlays);
|
|
2448
|
+
}
|
|
2449
|
+
|
|
1870
2450
|
function isEditorTypingTarget(target) {
|
|
1871
2451
|
if (!target || !target.closest) return false;
|
|
1872
2452
|
return !!target.closest(
|
|
@@ -1960,6 +2540,41 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
1960
2540
|
return !!(el && el.textContent && el.textContent.trim().length > 0);
|
|
1961
2541
|
}
|
|
1962
2542
|
|
|
2543
|
+
function hasTextCharacters(el: Element | null): boolean {
|
|
2544
|
+
return !!(el && el.textContent && el.textContent.length > 0);
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
function setSelectionOverlayResizeChromeVisible(visible: boolean): void {
|
|
2548
|
+
selectionOverlay
|
|
2549
|
+
.querySelectorAll(
|
|
2550
|
+
"[data-agent-native-edge-handle],[data-agent-native-edit-handle],[data-agent-native-rotate-handle]",
|
|
2551
|
+
)
|
|
2552
|
+
.forEach(function (node) {
|
|
2553
|
+
if (!(node instanceof HTMLElement)) return;
|
|
2554
|
+
node.style.display = visible ? "" : "none";
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
function updateTextEditingChrome(
|
|
2559
|
+
target: HTMLElement,
|
|
2560
|
+
originalMinWidth: string,
|
|
2561
|
+
originalMinHeight: string,
|
|
2562
|
+
): void {
|
|
2563
|
+
target.style.outline = "";
|
|
2564
|
+
target.style.outlineOffset = "";
|
|
2565
|
+
if (hasTextCharacters(target)) {
|
|
2566
|
+
target.style.minWidth = originalMinWidth;
|
|
2567
|
+
target.style.minHeight = originalMinHeight;
|
|
2568
|
+
positionOverlay(selectionOverlay, target);
|
|
2569
|
+
setSelectionOverlayResizeChromeVisible(false);
|
|
2570
|
+
return;
|
|
2571
|
+
}
|
|
2572
|
+
target.style.minWidth = originalMinWidth || "1px";
|
|
2573
|
+
target.style.minHeight = originalMinHeight || "1em";
|
|
2574
|
+
hideSelectionOverlay();
|
|
2575
|
+
setSelectionOverlayResizeChromeVisible(false);
|
|
2576
|
+
}
|
|
2577
|
+
|
|
1963
2578
|
function isInlineEditableDescendant(el: Element | null): boolean {
|
|
1964
2579
|
if (!el || !el.tagName) return false;
|
|
1965
2580
|
// Allowlist covers inline markup AND common block-level text containers
|
|
@@ -2078,19 +2693,20 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2078
2693
|
}
|
|
2079
2694
|
selectedSpacingHovered = false;
|
|
2080
2695
|
hoveredSpacingHandleKey = "";
|
|
2696
|
+
var previousSelectedEl = selectedEl;
|
|
2081
2697
|
selectedEl = selectionTargetForHit(target);
|
|
2082
2698
|
if (!selectedEl || isLayerInteractionBlocked(selectedEl)) {
|
|
2083
2699
|
selectedEl = null;
|
|
2084
|
-
|
|
2085
|
-
clearComponentTag();
|
|
2700
|
+
hideSelectionOverlay();
|
|
2086
2701
|
return;
|
|
2087
2702
|
}
|
|
2088
|
-
var info = getElementInfo(selectedEl);
|
|
2089
2703
|
positionOverlay(selectionOverlay, selectedEl);
|
|
2090
|
-
(
|
|
2091
|
-
|
|
2092
|
-
|
|
2704
|
+
preservePreviousSelectedElementForShiftClick(
|
|
2705
|
+
previousSelectedEl,
|
|
2706
|
+
selectedEl,
|
|
2707
|
+
e,
|
|
2093
2708
|
);
|
|
2709
|
+
postElementSelect(selectedEl, e);
|
|
2094
2710
|
}
|
|
2095
2711
|
|
|
2096
2712
|
function suppressNextShieldClickBriefly() {
|
|
@@ -2104,6 +2720,182 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2104
2720
|
}, 250);
|
|
2105
2721
|
}
|
|
2106
2722
|
|
|
2723
|
+
function clearActiveMarqueeSelection(): void {
|
|
2724
|
+
if (!activeMarqueeSelection) return;
|
|
2725
|
+
document.removeEventListener(
|
|
2726
|
+
activeMarqueeSelection.move,
|
|
2727
|
+
activeMarqueeSelection.onMove,
|
|
2728
|
+
true,
|
|
2729
|
+
);
|
|
2730
|
+
document.removeEventListener(
|
|
2731
|
+
activeMarqueeSelection.up,
|
|
2732
|
+
activeMarqueeSelection.onUp,
|
|
2733
|
+
true,
|
|
2734
|
+
);
|
|
2735
|
+
if (
|
|
2736
|
+
activeMarqueeSelection.pointerId !== undefined &&
|
|
2737
|
+
shieldOverlay.releasePointerCapture
|
|
2738
|
+
) {
|
|
2739
|
+
try {
|
|
2740
|
+
shieldOverlay.releasePointerCapture(activeMarqueeSelection.pointerId);
|
|
2741
|
+
} catch (_err) {}
|
|
2742
|
+
}
|
|
2743
|
+
activeMarqueeSelection = null;
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2746
|
+
function marqueeRectFromPoints(
|
|
2747
|
+
startX: number,
|
|
2748
|
+
startY: number,
|
|
2749
|
+
endX: number,
|
|
2750
|
+
endY: number,
|
|
2751
|
+
): {
|
|
2752
|
+
left: number;
|
|
2753
|
+
top: number;
|
|
2754
|
+
right: number;
|
|
2755
|
+
bottom: number;
|
|
2756
|
+
width: number;
|
|
2757
|
+
height: number;
|
|
2758
|
+
} {
|
|
2759
|
+
var left = Math.min(startX, endX);
|
|
2760
|
+
var top = Math.min(startY, endY);
|
|
2761
|
+
var right = Math.max(startX, endX);
|
|
2762
|
+
var bottom = Math.max(startY, endY);
|
|
2763
|
+
return {
|
|
2764
|
+
left: left,
|
|
2765
|
+
top: top,
|
|
2766
|
+
right: right,
|
|
2767
|
+
bottom: bottom,
|
|
2768
|
+
width: Math.max(1, right - left),
|
|
2769
|
+
height: Math.max(1, bottom - top),
|
|
2770
|
+
};
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
function rectsIntersect(
|
|
2774
|
+
a: { left: number; top: number; right: number; bottom: number },
|
|
2775
|
+
b: { left: number; top: number; right: number; bottom: number },
|
|
2776
|
+
): boolean {
|
|
2777
|
+
return (
|
|
2778
|
+
a.left <= b.right &&
|
|
2779
|
+
a.right >= b.left &&
|
|
2780
|
+
a.top <= b.bottom &&
|
|
2781
|
+
a.bottom >= b.top
|
|
2782
|
+
);
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
function postElementMarqueeSelect(
|
|
2786
|
+
elements: Element[],
|
|
2787
|
+
additive: boolean,
|
|
2788
|
+
e,
|
|
2789
|
+
): void {
|
|
2790
|
+
(window.parent as Window).postMessage(
|
|
2791
|
+
{
|
|
2792
|
+
type: "agent-native:layer-marquee-selection",
|
|
2793
|
+
phase: "change",
|
|
2794
|
+
payload: elements.map(function (el) {
|
|
2795
|
+
return getElementInfo(el);
|
|
2796
|
+
}),
|
|
2797
|
+
intent: {
|
|
2798
|
+
additive: additive,
|
|
2799
|
+
range: Boolean(e && e.shiftKey),
|
|
2800
|
+
source: "marquee",
|
|
2801
|
+
shiftKey: Boolean(e && e.shiftKey),
|
|
2802
|
+
metaKey: Boolean(e && e.metaKey),
|
|
2803
|
+
ctrlKey: Boolean(e && e.ctrlKey),
|
|
2804
|
+
},
|
|
2805
|
+
},
|
|
2806
|
+
"*",
|
|
2807
|
+
);
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
function updateMarqueeSelection(e): void {
|
|
2811
|
+
if (!activeMarqueeSelection) return;
|
|
2812
|
+
var rect = marqueeRectFromPoints(
|
|
2813
|
+
activeMarqueeSelection.startX,
|
|
2814
|
+
activeMarqueeSelection.startY,
|
|
2815
|
+
e.clientX,
|
|
2816
|
+
e.clientY,
|
|
2817
|
+
);
|
|
2818
|
+
marqueeSelectionOverlay.style.display = "block";
|
|
2819
|
+
marqueeSelectionOverlay.style.left = rect.left + "px";
|
|
2820
|
+
marqueeSelectionOverlay.style.top = rect.top + "px";
|
|
2821
|
+
marqueeSelectionOverlay.style.width = rect.width + "px";
|
|
2822
|
+
marqueeSelectionOverlay.style.height = rect.height + "px";
|
|
2823
|
+
|
|
2824
|
+
var hitElements = collectSelectableElements().filter(function (el) {
|
|
2825
|
+
var bounds = el.getBoundingClientRect();
|
|
2826
|
+
if (bounds.width <= 0 || bounds.height <= 0) return false;
|
|
2827
|
+
return rectsIntersect(rect, {
|
|
2828
|
+
left: bounds.left,
|
|
2829
|
+
top: bounds.top,
|
|
2830
|
+
right: bounds.right,
|
|
2831
|
+
bottom: bounds.bottom,
|
|
2832
|
+
});
|
|
2833
|
+
});
|
|
2834
|
+
var primary = hitElements[hitElements.length - 1] || null;
|
|
2835
|
+
if (primary) {
|
|
2836
|
+
selectedEl = primary;
|
|
2837
|
+
positionOverlay(selectionOverlay, primary);
|
|
2838
|
+
} else if (!activeMarqueeSelection.additive) {
|
|
2839
|
+
selectedEl = null;
|
|
2840
|
+
hideSelectionOverlay();
|
|
2841
|
+
}
|
|
2842
|
+
setPassiveSelectionElements(hitElements);
|
|
2843
|
+
postElementMarqueeSelect(hitElements, activeMarqueeSelection.additive, e);
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
function beginMarqueeSelection(e): void {
|
|
2847
|
+
if (e.button !== 0 || activeTextEditEl) return;
|
|
2848
|
+
clearActiveMarqueeSelection();
|
|
2849
|
+
var events = dragEventNames(e);
|
|
2850
|
+
var additive = Boolean(e && (e.metaKey || e.ctrlKey || e.shiftKey));
|
|
2851
|
+
function onMove(ev) {
|
|
2852
|
+
if (!activeMarqueeSelection) return;
|
|
2853
|
+
if (
|
|
2854
|
+
!activeMarqueeSelection.moved &&
|
|
2855
|
+
Math.hypot(
|
|
2856
|
+
ev.clientX - activeMarqueeSelection.startX,
|
|
2857
|
+
ev.clientY - activeMarqueeSelection.startY,
|
|
2858
|
+
) <= 3
|
|
2859
|
+
) {
|
|
2860
|
+
return;
|
|
2861
|
+
}
|
|
2862
|
+
if (!activeMarqueeSelection.moved) {
|
|
2863
|
+
activeMarqueeSelection.moved = true;
|
|
2864
|
+
suppressNextShieldClickBriefly();
|
|
2865
|
+
}
|
|
2866
|
+
stopNativeInteraction(ev);
|
|
2867
|
+
updateMarqueeSelection(ev);
|
|
2868
|
+
}
|
|
2869
|
+
function onUp(ev) {
|
|
2870
|
+
var didMove = Boolean(activeMarqueeSelection?.moved);
|
|
2871
|
+
if (didMove) {
|
|
2872
|
+
stopNativeInteraction(ev);
|
|
2873
|
+
updateMarqueeSelection(ev);
|
|
2874
|
+
suppressNextShieldClickBriefly();
|
|
2875
|
+
}
|
|
2876
|
+
marqueeSelectionOverlay.style.display = "none";
|
|
2877
|
+
clearActiveMarqueeSelection();
|
|
2878
|
+
}
|
|
2879
|
+
activeMarqueeSelection = {
|
|
2880
|
+
startX: e.clientX,
|
|
2881
|
+
startY: e.clientY,
|
|
2882
|
+
additive: additive,
|
|
2883
|
+
moved: false,
|
|
2884
|
+
pointerId: e.pointerId,
|
|
2885
|
+
move: events.move,
|
|
2886
|
+
up: events.up,
|
|
2887
|
+
onMove: onMove,
|
|
2888
|
+
onUp: onUp,
|
|
2889
|
+
};
|
|
2890
|
+
if (e.pointerId !== undefined && shieldOverlay.setPointerCapture) {
|
|
2891
|
+
try {
|
|
2892
|
+
shieldOverlay.setPointerCapture(e.pointerId);
|
|
2893
|
+
} catch (_err) {}
|
|
2894
|
+
}
|
|
2895
|
+
document.addEventListener(events.move, onMove, true);
|
|
2896
|
+
document.addEventListener(events.up, onUp, true);
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2107
2899
|
function openContextMenuAtEvent(e) {
|
|
2108
2900
|
stopNativeInteraction(e);
|
|
2109
2901
|
blurActiveTextEditor();
|
|
@@ -2117,14 +2909,10 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2117
2909
|
if (selectedEl && !isLayerInteractionBlocked(selectedEl)) {
|
|
2118
2910
|
info = getElementInfo(selectedEl);
|
|
2119
2911
|
positionOverlay(selectionOverlay, selectedEl);
|
|
2120
|
-
(
|
|
2121
|
-
{ type: "element-select", payload: info },
|
|
2122
|
-
"*",
|
|
2123
|
-
);
|
|
2912
|
+
postElementSelect(selectedEl, e);
|
|
2124
2913
|
} else {
|
|
2125
2914
|
selectedEl = null;
|
|
2126
|
-
|
|
2127
|
-
clearComponentTag();
|
|
2915
|
+
hideSelectionOverlay();
|
|
2128
2916
|
}
|
|
2129
2917
|
}
|
|
2130
2918
|
(window.parent as Window).postMessage(
|
|
@@ -2184,7 +2972,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2184
2972
|
!document.documentElement.contains(selectedEl)
|
|
2185
2973
|
) {
|
|
2186
2974
|
selectedEl = null;
|
|
2187
|
-
|
|
2975
|
+
hideSelectionOverlay();
|
|
2188
2976
|
}
|
|
2189
2977
|
hoveredEl = null;
|
|
2190
2978
|
highlightOverlay.style.display = "none";
|
|
@@ -2302,8 +3090,13 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2302
3090
|
}
|
|
2303
3091
|
|
|
2304
3092
|
function startSpacingDrag(key, e) {
|
|
3093
|
+
if (spacingDrag) {
|
|
3094
|
+
stopNativeInteraction(e);
|
|
3095
|
+
return;
|
|
3096
|
+
}
|
|
2305
3097
|
var handle = spacingHandleStateByKey[key];
|
|
2306
3098
|
if (!selectedEl || !handle || isLayerInteractionBlocked(selectedEl)) return;
|
|
3099
|
+
clearSpacingHoverTimer();
|
|
2307
3100
|
e.preventDefault();
|
|
2308
3101
|
e.stopPropagation();
|
|
2309
3102
|
if (e.stopImmediatePropagation) e.stopImmediatePropagation();
|
|
@@ -2312,6 +3105,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2312
3105
|
var originValue = handle.value;
|
|
2313
3106
|
var startX = e.clientX;
|
|
2314
3107
|
var startY = e.clientY;
|
|
3108
|
+
lastSpacingPointerPoint = { x: startX, y: startY };
|
|
2315
3109
|
hoveredSpacingHandleKey = key;
|
|
2316
3110
|
selectedSpacingHovered = true;
|
|
2317
3111
|
spacingDrag = {
|
|
@@ -2336,6 +3130,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2336
3130
|
currentValue: nextValue,
|
|
2337
3131
|
mirrorOpposite: !!ev.altKey,
|
|
2338
3132
|
};
|
|
3133
|
+
lastSpacingPointerPoint = { x: ev.clientX, y: ev.clientY };
|
|
2339
3134
|
applySpacingDragValue(dragEl, handle, nextValue, !!ev.altKey);
|
|
2340
3135
|
positionOverlay(selectionOverlay, dragEl);
|
|
2341
3136
|
showSpacingBadgeForHandle(handle, nextValue);
|
|
@@ -2536,6 +3331,17 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2536
3331
|
return true;
|
|
2537
3332
|
}
|
|
2538
3333
|
|
|
3334
|
+
function isAutoLayoutElement(el: Element | null): boolean {
|
|
3335
|
+
if (!el) return false;
|
|
3336
|
+
var cs = window.getComputedStyle(el);
|
|
3337
|
+
return (
|
|
3338
|
+
cs.display === "flex" ||
|
|
3339
|
+
cs.display === "inline-flex" ||
|
|
3340
|
+
cs.display === "grid" ||
|
|
3341
|
+
cs.display === "inline-grid"
|
|
3342
|
+
);
|
|
3343
|
+
}
|
|
3344
|
+
|
|
2539
3345
|
function isOutsideIframeViewport(clientX: number, clientY: number): boolean {
|
|
2540
3346
|
return (
|
|
2541
3347
|
clientX < 0 ||
|
|
@@ -2557,17 +3363,35 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2557
3363
|
);
|
|
2558
3364
|
return;
|
|
2559
3365
|
}
|
|
3366
|
+
var rect = el ? el.getBoundingClientRect() : null;
|
|
3367
|
+
var pointerOffset =
|
|
3368
|
+
rect && ev?.clientX !== undefined && ev.clientY !== undefined
|
|
3369
|
+
? {
|
|
3370
|
+
x: ev.clientX - rect.left,
|
|
3371
|
+
y: ev.clientY - rect.top,
|
|
3372
|
+
}
|
|
3373
|
+
: undefined;
|
|
2560
3374
|
(window.parent as Window).postMessage(
|
|
2561
3375
|
{
|
|
2562
3376
|
type: "agent-native:cross-screen-drag",
|
|
2563
3377
|
phase,
|
|
2564
3378
|
screenId: designCanvasScreenId,
|
|
3379
|
+
boardSurface: designCanvasBoardSurface,
|
|
2565
3380
|
selector: getSelector(el ?? null),
|
|
2566
3381
|
sourceId: getSourceId(el ?? null),
|
|
2567
3382
|
iframeX: ev?.clientX ?? 0,
|
|
2568
3383
|
iframeY: ev?.clientY ?? 0,
|
|
2569
3384
|
viewportW: window.innerWidth,
|
|
2570
3385
|
viewportH: window.innerHeight,
|
|
3386
|
+
elementRect: rect
|
|
3387
|
+
? {
|
|
3388
|
+
left: rect.left,
|
|
3389
|
+
top: rect.top,
|
|
3390
|
+
width: rect.width,
|
|
3391
|
+
height: rect.height,
|
|
3392
|
+
}
|
|
3393
|
+
: undefined,
|
|
3394
|
+
pointerOffset,
|
|
2571
3395
|
},
|
|
2572
3396
|
"*",
|
|
2573
3397
|
);
|
|
@@ -2751,6 +3575,66 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2751
3575
|
return { anchor: anchor, placement: placement, axis: axis };
|
|
2752
3576
|
}
|
|
2753
3577
|
|
|
3578
|
+
function elementFromEditorPointIgnoring(
|
|
3579
|
+
clientX: number,
|
|
3580
|
+
clientY: number,
|
|
3581
|
+
ignore: Element | null,
|
|
3582
|
+
): Element | null {
|
|
3583
|
+
var previousPointerEvents: string | null = null;
|
|
3584
|
+
if (ignore && ignore instanceof HTMLElement) {
|
|
3585
|
+
previousPointerEvents = ignore.style.pointerEvents;
|
|
3586
|
+
ignore.style.pointerEvents = "none";
|
|
3587
|
+
}
|
|
3588
|
+
var hit = elementFromEditorPoint(clientX, clientY);
|
|
3589
|
+
if (ignore && ignore instanceof HTMLElement) {
|
|
3590
|
+
ignore.style.pointerEvents = previousPointerEvents ?? "";
|
|
3591
|
+
}
|
|
3592
|
+
return hit;
|
|
3593
|
+
}
|
|
3594
|
+
|
|
3595
|
+
function autoLayoutInsertionTargetForPoint(el, clientX, clientY) {
|
|
3596
|
+
var hit = elementFromEditorPointIgnoring(clientX, clientY, el);
|
|
3597
|
+
if (!hit || hit === document.documentElement || hit === document.body) {
|
|
3598
|
+
return null;
|
|
3599
|
+
}
|
|
3600
|
+
var cursor = hit;
|
|
3601
|
+
while (cursor && cursor !== document.body) {
|
|
3602
|
+
if (
|
|
3603
|
+
cursor === el ||
|
|
3604
|
+
(el && el.contains && el.contains(cursor)) ||
|
|
3605
|
+
isOverlayElement(cursor) ||
|
|
3606
|
+
isLayerInteractionBlocked(cursor)
|
|
3607
|
+
) {
|
|
3608
|
+
cursor = cursor.parentElement;
|
|
3609
|
+
continue;
|
|
3610
|
+
}
|
|
3611
|
+
var parent = cursor.parentElement;
|
|
3612
|
+
if (parent && isAutoLayoutElement(parent)) {
|
|
3613
|
+
var parentAxis = parentFlowAxis(parent);
|
|
3614
|
+
var childRect = cursor.getBoundingClientRect();
|
|
3615
|
+
var childCenter =
|
|
3616
|
+
parentAxis === "x"
|
|
3617
|
+
? childRect.left + childRect.width / 2
|
|
3618
|
+
: childRect.top + childRect.height / 2;
|
|
3619
|
+
var childPointer = parentAxis === "x" ? clientX : clientY;
|
|
3620
|
+
return {
|
|
3621
|
+
anchor: cursor,
|
|
3622
|
+
placement: childPointer < childCenter ? "before" : "after",
|
|
3623
|
+
axis: parentAxis,
|
|
3624
|
+
};
|
|
3625
|
+
}
|
|
3626
|
+
if (isAutoLayoutElement(cursor) && isContainerDropTarget(cursor)) {
|
|
3627
|
+
return {
|
|
3628
|
+
anchor: cursor,
|
|
3629
|
+
placement: "inside",
|
|
3630
|
+
axis: parentFlowAxis(cursor),
|
|
3631
|
+
};
|
|
3632
|
+
}
|
|
3633
|
+
cursor = parent;
|
|
3634
|
+
}
|
|
3635
|
+
return null;
|
|
3636
|
+
}
|
|
3637
|
+
|
|
2754
3638
|
function showInsertionGuideFor(target) {
|
|
2755
3639
|
if (!target || !target.anchor) {
|
|
2756
3640
|
hideInsertionGuide();
|
|
@@ -2870,10 +3754,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2870
3754
|
selectedEl = clone;
|
|
2871
3755
|
duplicatedForDrag = true;
|
|
2872
3756
|
positionOverlay(selectionOverlay, selectedEl);
|
|
2873
|
-
(
|
|
2874
|
-
{ type: "element-select", payload: getElementInfo(selectedEl) },
|
|
2875
|
-
"*",
|
|
2876
|
-
);
|
|
3757
|
+
postElementSelect(selectedEl, e);
|
|
2877
3758
|
}
|
|
2878
3759
|
if (isFlowReorderCandidate(selectedEl)) {
|
|
2879
3760
|
// Snapshot the element being reordered so a concurrent select-element or
|
|
@@ -2945,10 +3826,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
2945
3826
|
reorderEl.parentElement.removeChild(reorderEl);
|
|
2946
3827
|
selectedEl = originalSelectedEl;
|
|
2947
3828
|
positionOverlay(selectionOverlay, selectedEl);
|
|
2948
|
-
(
|
|
2949
|
-
{ type: "element-select", payload: getElementInfo(selectedEl) },
|
|
2950
|
-
"*",
|
|
2951
|
-
);
|
|
3829
|
+
postElementSelect(selectedEl);
|
|
2952
3830
|
}
|
|
2953
3831
|
}
|
|
2954
3832
|
function onReorderKeyDown(ev) {
|
|
@@ -3004,10 +3882,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3004
3882
|
reorderEl.parentElement.removeChild(reorderEl);
|
|
3005
3883
|
selectedEl = originalSelectedEl;
|
|
3006
3884
|
positionOverlay(selectionOverlay, selectedEl);
|
|
3007
|
-
(
|
|
3008
|
-
{ type: "element-select", payload: getElementInfo(selectedEl) },
|
|
3009
|
-
"*",
|
|
3010
|
-
);
|
|
3885
|
+
postElementSelect(selectedEl);
|
|
3011
3886
|
}
|
|
3012
3887
|
return;
|
|
3013
3888
|
}
|
|
@@ -3043,6 +3918,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3043
3918
|
var originalInlinePosition = (selectedEl as HTMLElement).style.position;
|
|
3044
3919
|
var originalInlineLeft = (selectedEl as HTMLElement).style.left;
|
|
3045
3920
|
var originalInlineTop = (selectedEl as HTMLElement).style.top;
|
|
3921
|
+
var originalInlineOpacity = (selectedEl as HTMLElement).style.opacity;
|
|
3046
3922
|
var originLeft = readPx((selectedEl as HTMLElement).style.left || cs.left);
|
|
3047
3923
|
var originTop = readPx(selectedEl.style.top || cs.top);
|
|
3048
3924
|
var startX = e.clientX;
|
|
@@ -3053,6 +3929,11 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3053
3929
|
var dragEl = selectedEl;
|
|
3054
3930
|
var moved = false;
|
|
3055
3931
|
var DRAG_THRESHOLD = 3;
|
|
3932
|
+
var currentAutoLayoutTarget: {
|
|
3933
|
+
anchor: Element;
|
|
3934
|
+
placement: string;
|
|
3935
|
+
axis?: string;
|
|
3936
|
+
} | null = null;
|
|
3056
3937
|
if (!duplicatedForDrag) {
|
|
3057
3938
|
postCrossScreenDrag("start", dragEl, e);
|
|
3058
3939
|
}
|
|
@@ -3074,20 +3955,29 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3074
3955
|
!duplicatedForDrag &&
|
|
3075
3956
|
isOutsideIframeViewport(ev.clientX, ev.clientY)
|
|
3076
3957
|
) {
|
|
3077
|
-
|
|
3958
|
+
currentAutoLayoutTarget = null;
|
|
3959
|
+
hideInsertionGuide();
|
|
3960
|
+
(dragEl as HTMLElement).style.opacity = originalInlineOpacity;
|
|
3078
3961
|
} else {
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3962
|
+
currentAutoLayoutTarget = !duplicatedForDrag
|
|
3963
|
+
? autoLayoutInsertionTargetForPoint(dragEl, ev.clientX, ev.clientY)
|
|
3964
|
+
: null;
|
|
3965
|
+
if (currentAutoLayoutTarget) {
|
|
3966
|
+
showInsertionGuideFor(currentAutoLayoutTarget);
|
|
3967
|
+
(dragEl as HTMLElement).style.opacity = "0.4";
|
|
3968
|
+
} else {
|
|
3969
|
+
hideInsertionGuide();
|
|
3970
|
+
(dragEl as HTMLElement).style.opacity = originalInlineOpacity;
|
|
3971
|
+
}
|
|
3084
3972
|
}
|
|
3973
|
+
hideTransformBadge();
|
|
3085
3974
|
refreshOverlays();
|
|
3086
3975
|
}
|
|
3087
3976
|
function restoreSourceDragPosition(): void {
|
|
3088
3977
|
(dragEl as HTMLElement).style.position = originalInlinePosition;
|
|
3089
3978
|
(dragEl as HTMLElement).style.left = originalInlineLeft;
|
|
3090
3979
|
(dragEl as HTMLElement).style.top = originalInlineTop;
|
|
3980
|
+
(dragEl as HTMLElement).style.opacity = originalInlineOpacity;
|
|
3091
3981
|
selectedEl = originalSelectedEl;
|
|
3092
3982
|
positionOverlay(selectionOverlay, selectedEl);
|
|
3093
3983
|
}
|
|
@@ -3095,13 +3985,19 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3095
3985
|
document.removeEventListener(events.move, onMove, true);
|
|
3096
3986
|
document.removeEventListener(events.up, onUp, true);
|
|
3097
3987
|
hideTransformBadge();
|
|
3988
|
+
hideInsertionGuide();
|
|
3098
3989
|
if (!dragEl) return;
|
|
3990
|
+
var outsideOnDrop = ev
|
|
3991
|
+
? isOutsideIframeViewport(ev.clientX, ev.clientY)
|
|
3992
|
+
: false;
|
|
3099
3993
|
if (
|
|
3100
3994
|
ev &&
|
|
3101
3995
|
!duplicatedForDrag &&
|
|
3102
|
-
|
|
3996
|
+
(outsideOnDrop || designCanvasBoardSurface)
|
|
3103
3997
|
) {
|
|
3104
3998
|
postCrossScreenDrag("end", dragEl, ev);
|
|
3999
|
+
}
|
|
4000
|
+
if (ev && !duplicatedForDrag && outsideOnDrop) {
|
|
3105
4001
|
restoreSourceDragPosition();
|
|
3106
4002
|
return;
|
|
3107
4003
|
}
|
|
@@ -3110,15 +4006,22 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3110
4006
|
if (dragEl.parentElement) dragEl.parentElement.removeChild(dragEl);
|
|
3111
4007
|
selectedEl = originalSelectedEl;
|
|
3112
4008
|
positionOverlay(selectionOverlay, selectedEl);
|
|
3113
|
-
(
|
|
3114
|
-
{ type: "element-select", payload: getElementInfo(selectedEl) },
|
|
3115
|
-
"*",
|
|
3116
|
-
);
|
|
4009
|
+
postElementSelect(selectedEl);
|
|
3117
4010
|
return;
|
|
3118
4011
|
}
|
|
3119
4012
|
if (duplicatedForDrag) {
|
|
3120
4013
|
postVisualDuplicateChange(originalSelectedEl, dragEl);
|
|
4014
|
+
} else if (currentAutoLayoutTarget) {
|
|
4015
|
+
(dragEl as HTMLElement).style.opacity = originalInlineOpacity;
|
|
4016
|
+
var prevParent = dragEl.parentElement;
|
|
4017
|
+
var prevNextSibling = dragEl.nextSibling;
|
|
4018
|
+
applyRuntimeReorder(dragEl, currentAutoLayoutTarget);
|
|
4019
|
+
postVisualStructureChange(dragEl, currentAutoLayoutTarget, {
|
|
4020
|
+
prevParent: prevParent,
|
|
4021
|
+
prevNextSibling: prevNextSibling,
|
|
4022
|
+
});
|
|
3121
4023
|
} else {
|
|
4024
|
+
(dragEl as HTMLElement).style.opacity = originalInlineOpacity;
|
|
3122
4025
|
(window.parent as Window).postMessage(
|
|
3123
4026
|
{
|
|
3124
4027
|
type: "visual-style-change",
|
|
@@ -3363,15 +4266,23 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3363
4266
|
if (e.button !== 0 || activeTextEditEl) return;
|
|
3364
4267
|
var events = dragEventNames(e);
|
|
3365
4268
|
var hit = elementFromEditorPoint(e.clientX, e.clientY);
|
|
3366
|
-
|
|
4269
|
+
var hitTarget = selectionTargetForHit(hit);
|
|
4270
|
+
if (
|
|
4271
|
+
!hit ||
|
|
4272
|
+
hit === document.body ||
|
|
4273
|
+
hit === document.documentElement ||
|
|
4274
|
+
isBoardRootMarqueeSurface(hitTarget)
|
|
4275
|
+
) {
|
|
4276
|
+
beginMarqueeSelection(e);
|
|
3367
4277
|
return;
|
|
4278
|
+
}
|
|
3368
4279
|
var dragTarget =
|
|
3369
4280
|
selectedEl &&
|
|
3370
4281
|
document.documentElement.contains(selectedEl) &&
|
|
3371
4282
|
selectedEl.contains(hit)
|
|
3372
4283
|
? selectedEl
|
|
3373
|
-
:
|
|
3374
|
-
var clickTarget =
|
|
4284
|
+
: hitTarget;
|
|
4285
|
+
var clickTarget = hitTarget;
|
|
3375
4286
|
if (
|
|
3376
4287
|
!dragTarget ||
|
|
3377
4288
|
dragTarget === document.body ||
|
|
@@ -3395,19 +4306,22 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3395
4306
|
var startX = e.clientX;
|
|
3396
4307
|
var startY = e.clientY;
|
|
3397
4308
|
var didStartDrag = false;
|
|
3398
|
-
function selectTarget(target) {
|
|
4309
|
+
function selectTarget(target, ev?: MouseEvent) {
|
|
4310
|
+
var previousSelectedEl = selectedEl;
|
|
3399
4311
|
selectedEl = target;
|
|
3400
4312
|
positionOverlay(selectionOverlay, selectedEl);
|
|
3401
|
-
(
|
|
3402
|
-
|
|
3403
|
-
|
|
4313
|
+
preservePreviousSelectedElementForShiftClick(
|
|
4314
|
+
previousSelectedEl,
|
|
4315
|
+
selectedEl,
|
|
4316
|
+
ev,
|
|
3404
4317
|
);
|
|
4318
|
+
postElementSelect(selectedEl, ev);
|
|
3405
4319
|
}
|
|
3406
4320
|
function onMove(ev) {
|
|
3407
4321
|
if (Math.hypot(ev.clientX - startX, ev.clientY - startY) <= 3) return;
|
|
3408
4322
|
clearPendingShieldDrag();
|
|
3409
4323
|
didStartDrag = true;
|
|
3410
|
-
selectTarget(dragTarget);
|
|
4324
|
+
selectTarget(dragTarget, ev);
|
|
3411
4325
|
suppressNextShieldClickBriefly();
|
|
3412
4326
|
startMove(ev);
|
|
3413
4327
|
}
|
|
@@ -3418,7 +4332,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3418
4332
|
postCrossScreenDrag("cancel");
|
|
3419
4333
|
}
|
|
3420
4334
|
if (ev) stopNativeInteraction(ev);
|
|
3421
|
-
selectTarget(clickTarget || dragTarget);
|
|
4335
|
+
selectTarget(clickTarget || dragTarget, ev);
|
|
3422
4336
|
suppressNextShieldClickBriefly();
|
|
3423
4337
|
}
|
|
3424
4338
|
clearPendingShieldDrag();
|
|
@@ -3469,6 +4383,10 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3469
4383
|
);
|
|
3470
4384
|
|
|
3471
4385
|
shieldOverlay.addEventListener("pointerdown", beginPotentialShieldDrag, true);
|
|
4386
|
+
shieldOverlay.addEventListener("wheel", scrollUnderlyingElementAtWheel, {
|
|
4387
|
+
passive: false,
|
|
4388
|
+
capture: true,
|
|
4389
|
+
});
|
|
3472
4390
|
|
|
3473
4391
|
["pointerdown", "pointerup", "mousedown", "mouseup", "auxclick"].forEach(
|
|
3474
4392
|
function (type) {
|
|
@@ -3588,19 +4506,18 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3588
4506
|
selectedEl = selectionTargetForHit(target) || target;
|
|
3589
4507
|
var originalText = target.textContent || "";
|
|
3590
4508
|
var originalHtml = target.innerHTML || "";
|
|
4509
|
+
var originalMinWidth = target.style.minWidth;
|
|
4510
|
+
var originalMinHeight = target.style.minHeight;
|
|
4511
|
+
var originalBorderColor = target.style.borderColor;
|
|
3591
4512
|
var committed = false;
|
|
3592
4513
|
activeTextEditEl = target;
|
|
3593
4514
|
target.setAttribute("contenteditable", "true");
|
|
3594
4515
|
target.setAttribute("data-agent-native-text-editing", "true");
|
|
3595
4516
|
target.style.cursor = "text";
|
|
3596
|
-
target.style.
|
|
3597
|
-
target.style.outlineOffset = "2px";
|
|
4517
|
+
target.style.borderColor = "transparent";
|
|
3598
4518
|
setTextEditingPointerPassthrough(true);
|
|
3599
|
-
|
|
3600
|
-
(
|
|
3601
|
-
{ type: "element-select", payload: getElementInfo(target) },
|
|
3602
|
-
"*",
|
|
3603
|
-
);
|
|
4519
|
+
updateTextEditingChrome(target, originalMinWidth, originalMinHeight);
|
|
4520
|
+
postElementSelect(target, e);
|
|
3604
4521
|
(window.parent as Window).postMessage(
|
|
3605
4522
|
{ type: "element-dblclick-text", payload: getElementInfo(target) },
|
|
3606
4523
|
"*",
|
|
@@ -3613,6 +4530,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3613
4530
|
target.removeEventListener("blur", onBlur, true);
|
|
3614
4531
|
target.removeEventListener("keydown", onKeyDown, true);
|
|
3615
4532
|
target.removeEventListener("paste", onPaste, true);
|
|
4533
|
+
target.removeEventListener("input", onInput, true);
|
|
3616
4534
|
target.removeEventListener("keyup", onSelectionChange, true);
|
|
3617
4535
|
target.removeEventListener("mouseup", onSelectionChange, true);
|
|
3618
4536
|
document.removeEventListener("selectionchange", onSelectionChange);
|
|
@@ -3621,7 +4539,11 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3621
4539
|
target.style.cursor = "";
|
|
3622
4540
|
target.style.outline = "";
|
|
3623
4541
|
target.style.outlineOffset = "";
|
|
4542
|
+
target.style.minWidth = originalMinWidth;
|
|
4543
|
+
target.style.minHeight = originalMinHeight;
|
|
4544
|
+
target.style.borderColor = originalBorderColor;
|
|
3624
4545
|
setTextEditingPointerPassthrough(false);
|
|
4546
|
+
setSelectionOverlayResizeChromeVisible(true);
|
|
3625
4547
|
if (activeTextEditEl === target) activeTextEditEl = null;
|
|
3626
4548
|
postTextEditingState(target, false);
|
|
3627
4549
|
if (!commit) {
|
|
@@ -3644,7 +4566,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3644
4566
|
function onKeyDown(ev) {
|
|
3645
4567
|
if (ev.key === "Escape") {
|
|
3646
4568
|
ev.preventDefault();
|
|
3647
|
-
finish(
|
|
4569
|
+
finish(true);
|
|
3648
4570
|
target.blur();
|
|
3649
4571
|
return;
|
|
3650
4572
|
}
|
|
@@ -3660,15 +4582,24 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3660
4582
|
insertPlainTextAtSelection(
|
|
3661
4583
|
(ev.clipboardData && ev.clipboardData.getData("text/plain")) || "",
|
|
3662
4584
|
);
|
|
4585
|
+
updateTextEditingChrome(target, originalMinWidth, originalMinHeight);
|
|
4586
|
+
postTextEditingState(target, true);
|
|
4587
|
+
}
|
|
4588
|
+
|
|
4589
|
+
function onInput() {
|
|
4590
|
+
updateTextEditingChrome(target, originalMinWidth, originalMinHeight);
|
|
4591
|
+
postTextEditingState(target, true);
|
|
3663
4592
|
}
|
|
3664
4593
|
|
|
3665
4594
|
function onSelectionChange() {
|
|
4595
|
+
updateTextEditingChrome(target, originalMinWidth, originalMinHeight);
|
|
3666
4596
|
postTextEditingState(target, true);
|
|
3667
4597
|
}
|
|
3668
4598
|
|
|
3669
4599
|
target.addEventListener("blur", onBlur, true);
|
|
3670
4600
|
target.addEventListener("keydown", onKeyDown, true);
|
|
3671
4601
|
target.addEventListener("paste", onPaste, true);
|
|
4602
|
+
target.addEventListener("input", onInput, true);
|
|
3672
4603
|
target.addEventListener("keyup", onSelectionChange, true);
|
|
3673
4604
|
target.addEventListener("mouseup", onSelectionChange, true);
|
|
3674
4605
|
document.addEventListener("selectionchange", onSelectionChange);
|
|
@@ -3699,9 +4630,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3699
4630
|
if (!hoveredEl) {
|
|
3700
4631
|
highlightOverlay.style.display = "none";
|
|
3701
4632
|
if (!spacingDrag) {
|
|
3702
|
-
|
|
3703
|
-
hoveredSpacingHandleKey = "";
|
|
3704
|
-
updateSpacingOverlay(selectedEl);
|
|
4633
|
+
scheduleSpacingHoverClear(e);
|
|
3705
4634
|
}
|
|
3706
4635
|
hideMeasurements();
|
|
3707
4636
|
return;
|
|
@@ -3709,14 +4638,19 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3709
4638
|
if (hoveredEl && hoveredEl.closest("[data-agent-native-text-editing]"))
|
|
3710
4639
|
return;
|
|
3711
4640
|
if (!spacingDrag) {
|
|
3712
|
-
|
|
4641
|
+
var hoveringSelectedSpacingSurface = Boolean(
|
|
3713
4642
|
selectedEl &&
|
|
3714
4643
|
hoveredEl &&
|
|
3715
4644
|
(hoveredEl === selectedEl ||
|
|
3716
4645
|
(selectedEl.contains && selectedEl.contains(hoveredEl))),
|
|
3717
4646
|
);
|
|
3718
|
-
if (
|
|
3719
|
-
|
|
4647
|
+
if (hoveringSelectedSpacingSurface) {
|
|
4648
|
+
clearSpacingHoverTimer();
|
|
4649
|
+
selectedSpacingHovered = true;
|
|
4650
|
+
updateSpacingOverlay(selectedEl);
|
|
4651
|
+
} else {
|
|
4652
|
+
scheduleSpacingHoverClear(e);
|
|
4653
|
+
}
|
|
3720
4654
|
}
|
|
3721
4655
|
if (hoveredEl === selectedEl) {
|
|
3722
4656
|
highlightOverlay.style.display = "none";
|
|
@@ -3752,9 +4686,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3752
4686
|
return;
|
|
3753
4687
|
}
|
|
3754
4688
|
if (!spacingDrag) {
|
|
3755
|
-
|
|
3756
|
-
hoveredSpacingHandleKey = "";
|
|
3757
|
-
updateSpacingOverlay(selectedEl);
|
|
4689
|
+
scheduleSpacingHoverClear(e);
|
|
3758
4690
|
}
|
|
3759
4691
|
},
|
|
3760
4692
|
true,
|
|
@@ -3770,9 +4702,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3770
4702
|
}
|
|
3771
4703
|
hoveredEl = null;
|
|
3772
4704
|
if (!spacingDrag) {
|
|
3773
|
-
|
|
3774
|
-
hoveredSpacingHandleKey = "";
|
|
3775
|
-
updateSpacingOverlay(selectedEl);
|
|
4705
|
+
scheduleSpacingHoverClear(e);
|
|
3776
4706
|
}
|
|
3777
4707
|
highlightOverlay.style.display = "none";
|
|
3778
4708
|
hideMeasurements();
|
|
@@ -3880,9 +4810,59 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3880
4810
|
return;
|
|
3881
4811
|
}
|
|
3882
4812
|
if (e.data.type === "clear-selection") {
|
|
4813
|
+
// During marquee drag, empty hit sets are replayed back from the host as a
|
|
4814
|
+
// clear-selection state. Keep the drag-owned rectangle alive until pointer-up.
|
|
4815
|
+
if (activeMarqueeSelection) return;
|
|
3883
4816
|
clearRuntimeSelection();
|
|
3884
4817
|
return;
|
|
3885
4818
|
}
|
|
4819
|
+
if (e.data.type === "agent-native:collect-selectable-rects") {
|
|
4820
|
+
(window.parent as Window).postMessage(
|
|
4821
|
+
{
|
|
4822
|
+
type: "agent-native:selectable-rects-result",
|
|
4823
|
+
correlationId:
|
|
4824
|
+
typeof e.data.correlationId === "string"
|
|
4825
|
+
? e.data.correlationId
|
|
4826
|
+
: "",
|
|
4827
|
+
payload: collectSelectableElementInfos(),
|
|
4828
|
+
},
|
|
4829
|
+
"*",
|
|
4830
|
+
);
|
|
4831
|
+
return;
|
|
4832
|
+
}
|
|
4833
|
+
if (e.data.type === "select-elements") {
|
|
4834
|
+
var passiveTargets: Element[] = [];
|
|
4835
|
+
var selectorGroups: unknown[] = Array.isArray(e.data.selectorGroups)
|
|
4836
|
+
? e.data.selectorGroups
|
|
4837
|
+
: [];
|
|
4838
|
+
selectorGroups.forEach(function (group) {
|
|
4839
|
+
var selectors: string[] = [];
|
|
4840
|
+
if (Array.isArray(group)) {
|
|
4841
|
+
group.forEach(function (selector) {
|
|
4842
|
+
if (
|
|
4843
|
+
typeof selector === "string" &&
|
|
4844
|
+
selector &&
|
|
4845
|
+
selectors.indexOf(selector) === -1
|
|
4846
|
+
) {
|
|
4847
|
+
selectors.push(selector);
|
|
4848
|
+
}
|
|
4849
|
+
});
|
|
4850
|
+
}
|
|
4851
|
+
for (var i = 0; i < selectors.length; i += 1) {
|
|
4852
|
+
try {
|
|
4853
|
+
var matches = document.querySelectorAll(selectors[i]);
|
|
4854
|
+
for (var j = 0; j < matches.length; j += 1) {
|
|
4855
|
+
if (!isLayerInteractionBlocked(matches[j])) {
|
|
4856
|
+
passiveTargets.push(matches[j]);
|
|
4857
|
+
return;
|
|
4858
|
+
}
|
|
4859
|
+
}
|
|
4860
|
+
} catch (_err) {}
|
|
4861
|
+
}
|
|
4862
|
+
});
|
|
4863
|
+
setPassiveSelectionElements(passiveTargets);
|
|
4864
|
+
return;
|
|
4865
|
+
}
|
|
3886
4866
|
if (e.data.type === "select-element") {
|
|
3887
4867
|
var candidates: string[] = [];
|
|
3888
4868
|
if (Array.isArray(e.data.selectorCandidates)) {
|
|
@@ -3982,8 +4962,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
3982
4962
|
: [];
|
|
3983
4963
|
if (selectedEl && isLayerInteractionBlocked(selectedEl)) {
|
|
3984
4964
|
selectedEl = null;
|
|
3985
|
-
|
|
3986
|
-
clearComponentTag();
|
|
4965
|
+
hideSelectionOverlay();
|
|
3987
4966
|
}
|
|
3988
4967
|
if (hoveredEl && isLayerInteractionBlocked(hoveredEl)) {
|
|
3989
4968
|
hoveredEl = null;
|
|
@@ -4001,10 +4980,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
4001
4980
|
applyRuntimeReorder(move.el, move.target);
|
|
4002
4981
|
selectedEl = move.el;
|
|
4003
4982
|
positionOverlay(selectionOverlay, selectedEl);
|
|
4004
|
-
(
|
|
4005
|
-
{ type: "element-select", payload: getElementInfo(selectedEl) },
|
|
4006
|
-
"*",
|
|
4007
|
-
);
|
|
4983
|
+
postElementSelect(selectedEl);
|
|
4008
4984
|
}
|
|
4009
4985
|
} else {
|
|
4010
4986
|
// Revert the optimistic reorder to its pre-drag position.
|
|
@@ -4021,10 +4997,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
4021
4997
|
);
|
|
4022
4998
|
selectedEl = move.el;
|
|
4023
4999
|
positionOverlay(selectionOverlay, selectedEl);
|
|
4024
|
-
(
|
|
4025
|
-
{ type: "element-select", payload: getElementInfo(selectedEl) },
|
|
4026
|
-
"*",
|
|
4027
|
-
);
|
|
5000
|
+
postElementSelect(selectedEl);
|
|
4028
5001
|
}
|
|
4029
5002
|
}
|
|
4030
5003
|
return;
|
|
@@ -4034,6 +5007,7 @@ declare var __DESIGN_CANVAS_SCREEN_ID__: string;
|
|
|
4034
5007
|
e.data.content,
|
|
4035
5008
|
e.data.forceFullDocument ? "" : e.data.selectedSelector,
|
|
4036
5009
|
e.data.forceFullDocument ? [] : e.data.selectorCandidates,
|
|
5010
|
+
Boolean(e.data.forceFullDocument),
|
|
4037
5011
|
);
|
|
4038
5012
|
return;
|
|
4039
5013
|
}
|