@agent-native/core 0.90.2 → 0.90.4
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/bin/agent-native.js +25 -3
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +21 -0
- package/corpus/core/bin/agent-native.js +25 -3
- package/corpus/core/docs/content/agent-native-toolkit.mdx +87 -80
- package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +89 -80
- package/corpus/core/docs/content/toolkit-agent-ux.mdx +43 -0
- package/corpus/core/docs/content/toolkit-app-adapters.mdx +9 -0
- package/corpus/core/docs/content/toolkit-collaboration-ui.mdx +12 -0
- package/corpus/core/docs/content/toolkit-collaboration.mdx +74 -0
- package/corpus/core/docs/content/toolkit-command-navigation.mdx +106 -0
- package/corpus/core/docs/content/toolkit-comments-review.mdx +98 -0
- package/corpus/core/docs/content/toolkit-history.mdx +95 -0
- package/corpus/core/docs/content/toolkit-observability.mdx +41 -0
- package/corpus/core/docs/content/toolkit-org-team.mdx +80 -0
- package/corpus/core/docs/content/toolkit-resources.mdx +57 -0
- package/corpus/core/docs/content/toolkit-settings.mdx +65 -0
- package/corpus/core/docs/content/toolkit-setup-connections.mdx +109 -0
- package/corpus/core/docs/content/toolkit-sharing-ui.mdx +18 -6
- package/corpus/core/docs/content/toolkit-sharing.mdx +81 -0
- package/corpus/core/docs/content/toolkit-shell-hooks.mdx +9 -0
- package/corpus/core/docs/content/toolkit-ui.mdx +9 -0
- package/corpus/core/package.json +35 -1
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +19 -1
- package/corpus/core/src/agent/engine/anthropic-engine.ts +25 -1
- package/corpus/core/src/agent/engine/index.ts +1 -0
- package/corpus/core/src/agent/engine/registry.ts +86 -18
- package/corpus/core/src/agent/production-agent.ts +37 -6
- package/corpus/core/src/cli/create.ts +35 -0
- package/corpus/core/src/cli/design-connect.ts +248 -0
- package/corpus/core/src/cli/index.ts +84 -7
- package/corpus/core/src/cli/workspacify.ts +34 -0
- package/corpus/core/src/client/command-navigation/index.ts +15 -0
- package/corpus/core/src/client/comments-review/index.ts +1 -0
- package/corpus/core/src/client/history/VersionHistoryPanel.tsx +175 -0
- package/corpus/core/src/client/history/index.ts +21 -0
- package/corpus/core/src/client/history/use-history.ts +114 -0
- package/corpus/core/src/client/index.ts +84 -9
- package/corpus/core/src/client/org/OrgSwitcher.tsx +6 -6
- package/corpus/core/src/client/org/RequireActiveOrg.tsx +2 -2
- package/corpus/core/src/client/org/TeamPage.tsx +3 -3
- package/corpus/core/src/client/org/hooks.ts +32 -0
- package/corpus/core/src/client/org/index.ts +30 -1
- package/corpus/core/src/client/org-team/index.ts +1 -0
- package/corpus/core/src/client/review/ReviewStatusBadge.tsx +39 -0
- package/corpus/core/src/client/review/ReviewThreadPanel.tsx +278 -0
- package/corpus/core/src/client/review/index.ts +30 -0
- package/corpus/core/src/client/review/use-review.ts +152 -0
- package/corpus/core/src/client/settings/index.ts +11 -1
- package/corpus/core/src/client/setup-connections/BuilderConnectCard.tsx +94 -0
- package/corpus/core/src/client/setup-connections/ProviderReadinessBadge.tsx +73 -0
- package/corpus/core/src/client/setup-connections/SetupConnectionsPage.tsx +94 -0
- package/corpus/core/src/client/setup-connections/index.ts +46 -0
- package/corpus/core/src/client/sharing/ShareButton.tsx +20 -14
- package/corpus/core/src/client/sharing/ShareDialog.tsx +3 -3
- package/corpus/core/src/command-navigation/actions.ts +100 -0
- package/corpus/core/src/command-navigation/index.ts +12 -0
- package/corpus/core/src/comments-review/index.ts +1 -0
- package/corpus/core/src/file-upload/builder.ts +24 -3
- package/corpus/core/src/file-upload/types.ts +3 -1
- package/corpus/core/src/history/actions/create-resource-version.ts +92 -0
- package/corpus/core/src/history/actions/get-resource-version.ts +60 -0
- package/corpus/core/src/history/actions/list-resource-history.ts +53 -0
- package/corpus/core/src/history/actions/list-resource-versions.ts +43 -0
- package/corpus/core/src/history/actions/restore-resource-version.ts +96 -0
- package/corpus/core/src/history/index.ts +26 -0
- package/corpus/core/src/history/registry.ts +111 -0
- package/corpus/core/src/history/store.ts +379 -0
- package/corpus/core/src/history/types.ts +69 -0
- package/corpus/core/src/index.ts +10 -0
- package/corpus/core/src/navigation/index.ts +170 -0
- package/corpus/core/src/org/index.ts +8 -0
- package/corpus/core/src/org/permissions.ts +30 -0
- package/corpus/core/src/org-team/index.ts +1 -0
- package/corpus/core/src/private-blob/registry.ts +1 -0
- package/corpus/core/src/review/actions/consume-review-feedback.ts +48 -0
- package/corpus/core/src/review/actions/create-review-comment.ts +107 -0
- package/corpus/core/src/review/actions/delete-review-comment.ts +67 -0
- package/corpus/core/src/review/actions/get-review-feedback.ts +54 -0
- package/corpus/core/src/review/actions/list-review-comments.ts +53 -0
- package/corpus/core/src/review/actions/reply-review-comment.ts +107 -0
- package/corpus/core/src/review/actions/resolve-review-thread.ts +67 -0
- package/corpus/core/src/review/actions/set-review-status.ts +58 -0
- package/corpus/core/src/review/index.ts +31 -0
- package/corpus/core/src/review/mentions.ts +44 -0
- package/corpus/core/src/review/registry.ts +111 -0
- package/corpus/core/src/review/store.ts +690 -0
- package/corpus/core/src/review/types.ts +97 -0
- package/corpus/core/src/server/action-discovery.ts +54 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +6 -0
- package/corpus/core/src/server/agent-engine-api-key-route.ts +5 -0
- package/corpus/core/src/server/credential-provider.ts +118 -0
- package/corpus/core/src/setup-connections/index.ts +89 -0
- package/corpus/core/src/setup-connections/onboarding.ts +47 -0
- package/corpus/core/src/transcription/builder-transcription.ts +9 -2
- package/corpus/core/src/vite/action-types-plugin.ts +52 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +2 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +2 -2
- package/corpus/templates/analytics/app/global.css +22 -10
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +6 -1
- package/corpus/templates/analytics/app/i18n-data.ts +81 -13
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +2 -2
- package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +2 -2
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +528 -108
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +466 -183
- package/corpus/templates/analytics/changelog/2026-07-07-session-replays-load-sooner-show-clearer-activity-timelines-.md +6 -0
- package/corpus/templates/assets/actions/_preset-skeleton-validation.ts +11 -11
- package/corpus/templates/assets/actions/generate-image.ts +64 -28
- package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +1 -1
- package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +91 -74
- package/corpus/templates/assets/server/lib/generation.ts +29 -4
- package/corpus/templates/assets/server/lib/image-processing.ts +131 -0
- package/corpus/templates/brain/app/routes/settings.tsx +2 -2
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +24 -2
- package/corpus/templates/calendar/AGENTS.md +3 -0
- package/corpus/templates/calendar/actions/create-event.ts +8 -34
- package/corpus/templates/calendar/actions/event-action-helpers.ts +52 -0
- package/corpus/templates/calendar/actions/manage-event-draft.ts +7 -34
- package/corpus/templates/calendar/actions/update-event.ts +10 -23
- package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +79 -6
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +23 -0
- package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +59 -2
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +40 -1
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +154 -41
- package/corpus/templates/calendar/app/hooks/use-events.ts +6 -0
- package/corpus/templates/calendar/app/hooks/use-people.ts +55 -0
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/calendar/app/i18n-data.ts +40 -0
- package/corpus/templates/calendar/changelog/2026-07-07-guest-suggestions-now-find-coworkers-from-your-google-worksp.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-07-you-can-mark-event-guests-as-optional-while-inviting-them-or.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-07-zoom-stays-selected-after-connecting-it-from-a-draft-event.md +6 -0
- package/corpus/templates/calendar/server/handlers/events.ts +1 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +4 -0
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/calendar/shared/api.ts +2 -0
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +29 -3
- package/corpus/templates/clips/actions/create-recording.ts +5 -1
- package/corpus/templates/clips/actions/finalize-recording.ts +140 -1
- package/corpus/templates/clips/actions/generate-workflow.ts +19 -8
- package/corpus/templates/clips/actions/get-clips-ai-prefs.ts +36 -0
- package/corpus/templates/clips/actions/import-loom-recording.ts +1 -0
- package/corpus/templates/clips/actions/lib/clips-ai-prefs.ts +28 -0
- package/corpus/templates/clips/actions/lib/ensure-seekable-video.ts +1 -0
- package/corpus/templates/clips/actions/regenerate-chapters.ts +21 -7
- package/corpus/templates/clips/actions/regenerate-summary.ts +26 -8
- package/corpus/templates/clips/actions/regenerate-title.ts +44 -7
- package/corpus/templates/clips/actions/request-transcript.ts +31 -0
- package/corpus/templates/clips/actions/set-thumbnail.ts +2 -0
- package/corpus/templates/clips/actions/update-clips-ai-prefs.ts +50 -0
- package/corpus/templates/clips/app/components/library/organization-switcher.tsx +2 -2
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +7 -2
- package/corpus/templates/clips/app/components/player/scrubber-position.ts +9 -0
- package/corpus/templates/clips/app/components/player/scrubber.tsx +5 -2
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +69 -41
- package/corpus/templates/clips/app/components/player/video-player.tsx +38 -1
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +3 -3
- package/corpus/templates/clips/app/components/sharing/slack-share-hint.tsx +9 -19
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +25 -10
- package/corpus/templates/clips/app/i18n/ar-SA.ts +28 -6
- package/corpus/templates/clips/app/i18n/de-DE.ts +28 -6
- package/corpus/templates/clips/app/i18n/en-US.ts +29 -6
- package/corpus/templates/clips/app/i18n/es-ES.ts +29 -6
- package/corpus/templates/clips/app/i18n/fr-FR.ts +30 -6
- package/corpus/templates/clips/app/i18n/hi-IN.ts +26 -6
- package/corpus/templates/clips/app/i18n/ja-JP.ts +27 -6
- package/corpus/templates/clips/app/i18n/ko-KR.ts +28 -6
- package/corpus/templates/clips/app/i18n/pt-BR.ts +28 -6
- package/corpus/templates/clips/app/i18n/zh-CN.ts +26 -6
- package/corpus/templates/clips/app/i18n/zh-TW.ts +25 -6
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +73 -0
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +79 -5
- package/corpus/templates/clips/app/routes/record.tsx +21 -12
- package/corpus/templates/clips/changelog/2026-07-02-recordings-now-wait-for-storage-media-to-serve-before-finishing.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-a-pending-app-update-no-longer-blocks-screen-recording-updat.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-ai-tools-can-include-the-full-video-not-just-the-transcript-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-chrome-extension-recordings-keep-audio-after-refreshing-tab.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-clip-playback-progress-now-starts-and-finishes-at-the-right-times.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-clips-desktop-now-surfaces-meetings-and-dictate-directly-in-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-meeting-notes-now-explain-exactly-how-to-start-granola-style.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-meeting-start-alerts-now-include-separate-start-notes-and-jo.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-recordings-start-more-predictably-and-newly-saved-clips-refr.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-sharing-public-clips-now-stays-focused-on-the-normal-link-wi.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/chrome-extension/src/background.ts +18 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +23 -8
- package/corpus/templates/clips/desktop/src/app.tsx +475 -108
- package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +19 -7
- package/corpus/templates/clips/desktop/src/lib/permissions.ts +2 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +27 -21
- package/corpus/templates/clips/desktop/src/lib/updater.ts +25 -2
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +23 -22
- package/corpus/templates/clips/desktop/src/styles.css +167 -2
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +8 -1
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +3 -7
- package/corpus/templates/clips/desktop/src-tauri/src/tray_meetings.rs +5 -4
- package/corpus/templates/clips/server/routes/_agent-native/clips/user-prefs.put.ts +16 -8
- package/corpus/templates/clips/server/routes/api/recordings/[recordingId]/thumbnail.post.ts +1 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +22 -5
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +8 -0
- package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +13 -6
- package/corpus/templates/clips/shared/clips-ai-prefs.ts +81 -0
- package/corpus/templates/clips/shared/finalize-recovery.ts +12 -0
- package/corpus/templates/content/actions/delete-document.ts +337 -52
- package/corpus/templates/content/changelog/2026-07-07-permanently-deleting-trashed-databases-now-finishes-reliably.md +6 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +16 -1
- package/corpus/templates/design/actions/add-localhost-screens.ts +1 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +345 -11
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +89 -14
- package/corpus/templates/design/app/components/design/bridge-security.ts +7 -1
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +1 -1
- package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +41 -0
- package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-uses-live-app-iframes-for-click-to-edit-pr.md +6 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +2 -2
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +15 -1
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +20 -1
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/index.d.ts +1 -1
- package/dist/agent/engine/index.d.ts.map +1 -1
- package/dist/agent/engine/index.js +1 -1
- package/dist/agent/engine/index.js.map +1 -1
- package/dist/agent/engine/registry.d.ts +14 -0
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +78 -16
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +27 -7
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +31 -0
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +186 -0
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/index.js +76 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/workspacify.d.ts.map +1 -1
- package/dist/cli/workspacify.js +30 -0
- package/dist/cli/workspacify.js.map +1 -1
- package/dist/client/command-navigation/index.d.ts +4 -0
- package/dist/client/command-navigation/index.d.ts.map +1 -0
- package/dist/client/command-navigation/index.js +4 -0
- package/dist/client/command-navigation/index.js.map +1 -0
- package/dist/client/comments-review/index.d.ts +2 -0
- package/dist/client/comments-review/index.d.ts.map +1 -0
- package/dist/client/comments-review/index.js +2 -0
- package/dist/client/comments-review/index.js.map +1 -0
- package/dist/client/history/VersionHistoryPanel.d.ts +18 -0
- package/dist/client/history/VersionHistoryPanel.d.ts.map +1 -0
- package/dist/client/history/VersionHistoryPanel.js +31 -0
- package/dist/client/history/VersionHistoryPanel.js.map +1 -0
- package/dist/client/history/index.d.ts +3 -0
- package/dist/client/history/index.d.ts.map +1 -0
- package/dist/client/history/index.js +3 -0
- package/dist/client/history/index.js.map +1 -0
- package/dist/client/history/use-history.d.ts +58 -0
- package/dist/client/history/use-history.d.ts.map +1 -0
- package/dist/client/history/use-history.js +24 -0
- package/dist/client/history/use-history.js.map +1 -0
- package/dist/client/index.d.ts +6 -4
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +6 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/org/OrgSwitcher.js +5 -5
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/org/RequireActiveOrg.js +2 -2
- package/dist/client/org/RequireActiveOrg.js.map +1 -1
- package/dist/client/org/TeamPage.js +3 -3
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/org/hooks.d.ts +12 -1
- package/dist/client/org/hooks.d.ts.map +1 -1
- package/dist/client/org/hooks.js +15 -0
- package/dist/client/org/hooks.js.map +1 -1
- package/dist/client/org/index.d.ts +4 -2
- package/dist/client/org/index.d.ts.map +1 -1
- package/dist/client/org/index.js +3 -1
- package/dist/client/org/index.js.map +1 -1
- package/dist/client/org-team/index.d.ts +2 -0
- package/dist/client/org-team/index.d.ts.map +1 -0
- package/dist/client/org-team/index.js +2 -0
- package/dist/client/org-team/index.js.map +1 -0
- package/dist/client/review/ReviewStatusBadge.d.ts +7 -0
- package/dist/client/review/ReviewStatusBadge.d.ts.map +1 -0
- package/dist/client/review/ReviewStatusBadge.js +19 -0
- package/dist/client/review/ReviewStatusBadge.js.map +1 -0
- package/dist/client/review/ReviewThreadPanel.d.ts +20 -0
- package/dist/client/review/ReviewThreadPanel.d.ts.map +1 -0
- package/dist/client/review/ReviewThreadPanel.js +84 -0
- package/dist/client/review/ReviewThreadPanel.js.map +1 -0
- package/dist/client/review/index.d.ts +4 -0
- package/dist/client/review/index.d.ts.map +1 -0
- package/dist/client/review/index.js +4 -0
- package/dist/client/review/index.js.map +1 -0
- package/dist/client/review/use-review.d.ts +91 -0
- package/dist/client/review/use-review.d.ts.map +1 -0
- package/dist/client/review/use-review.js +30 -0
- package/dist/client/review/use-review.js.map +1 -0
- package/dist/client/settings/index.d.ts +1 -1
- package/dist/client/settings/index.d.ts.map +1 -1
- package/dist/client/settings/index.js +1 -1
- package/dist/client/settings/index.js.map +1 -1
- package/dist/client/setup-connections/BuilderConnectCard.d.ts +9 -0
- package/dist/client/setup-connections/BuilderConnectCard.d.ts.map +1 -0
- package/dist/client/setup-connections/BuilderConnectCard.js +25 -0
- package/dist/client/setup-connections/BuilderConnectCard.js.map +1 -0
- package/dist/client/setup-connections/ProviderReadinessBadge.d.ts +8 -0
- package/dist/client/setup-connections/ProviderReadinessBadge.d.ts.map +1 -0
- package/dist/client/setup-connections/ProviderReadinessBadge.js +32 -0
- package/dist/client/setup-connections/ProviderReadinessBadge.js.map +1 -0
- package/dist/client/setup-connections/SetupConnectionsPage.d.ts +17 -0
- package/dist/client/setup-connections/SetupConnectionsPage.d.ts.map +1 -0
- package/dist/client/setup-connections/SetupConnectionsPage.js +10 -0
- package/dist/client/setup-connections/SetupConnectionsPage.js.map +1 -0
- package/dist/client/setup-connections/index.d.ts +7 -0
- package/dist/client/setup-connections/index.d.ts.map +1 -0
- package/dist/client/setup-connections/index.js +7 -0
- package/dist/client/setup-connections/index.js.map +1 -0
- package/dist/client/sharing/ShareButton.d.ts +4 -4
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +13 -7
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareDialog.js +3 -3
- package/dist/client/sharing/ShareDialog.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/command-navigation/actions.d.ts +25 -0
- package/dist/command-navigation/actions.d.ts.map +1 -0
- package/dist/command-navigation/actions.js +64 -0
- package/dist/command-navigation/actions.js.map +1 -0
- package/dist/command-navigation/index.d.ts +4 -0
- package/dist/command-navigation/index.d.ts.map +1 -0
- package/dist/command-navigation/index.js +4 -0
- package/dist/command-navigation/index.js.map +1 -0
- package/dist/comments-review/index.d.ts +2 -0
- package/dist/comments-review/index.d.ts.map +1 -0
- package/dist/comments-review/index.js +2 -0
- package/dist/comments-review/index.js.map +1 -0
- package/dist/file-upload/builder.d.ts.map +1 -1
- package/dist/file-upload/builder.js +18 -2
- package/dist/file-upload/builder.js.map +1 -1
- package/dist/file-upload/types.d.ts +3 -0
- package/dist/file-upload/types.d.ts.map +1 -1
- package/dist/file-upload/types.js.map +1 -1
- package/dist/history/actions/create-resource-version.d.ts +10 -0
- package/dist/history/actions/create-resource-version.d.ts.map +1 -0
- package/dist/history/actions/create-resource-version.js +68 -0
- package/dist/history/actions/create-resource-version.js.map +1 -0
- package/dist/history/actions/get-resource-version.d.ts +10 -0
- package/dist/history/actions/get-resource-version.d.ts.map +1 -0
- package/dist/history/actions/get-resource-version.js +38 -0
- package/dist/history/actions/get-resource-version.js.map +1 -0
- package/dist/history/actions/list-resource-history.d.ts +10 -0
- package/dist/history/actions/list-resource-history.d.ts.map +1 -0
- package/dist/history/actions/list-resource-history.js +45 -0
- package/dist/history/actions/list-resource-history.js.map +1 -0
- package/dist/history/actions/list-resource-versions.d.ts +10 -0
- package/dist/history/actions/list-resource-versions.d.ts.map +1 -0
- package/dist/history/actions/list-resource-versions.js +35 -0
- package/dist/history/actions/list-resource-versions.js.map +1 -0
- package/dist/history/actions/restore-resource-version.d.ts +11 -0
- package/dist/history/actions/restore-resource-version.d.ts.map +1 -0
- package/dist/history/actions/restore-resource-version.js +59 -0
- package/dist/history/actions/restore-resource-version.js.map +1 -0
- package/dist/history/index.d.ts +4 -0
- package/dist/history/index.d.ts.map +1 -0
- package/dist/history/index.js +3 -0
- package/dist/history/index.js.map +1 -0
- package/dist/history/registry.d.ts +10 -0
- package/dist/history/registry.d.ts.map +1 -0
- package/dist/history/registry.js +63 -0
- package/dist/history/registry.js.map +1 -0
- package/dist/history/store.d.ts +34 -0
- package/dist/history/store.d.ts.map +1 -0
- package/dist/history/store.js +290 -0
- package/dist/history/store.js.map +1 -0
- package/dist/history/types.d.ts +55 -0
- package/dist/history/types.d.ts.map +1 -0
- package/dist/history/types.js +2 -0
- package/dist/history/types.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/navigation/index.d.ts +53 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +105 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/observability/routes.d.ts +3 -3
- package/dist/org/index.d.ts +1 -0
- package/dist/org/index.d.ts.map +1 -1
- package/dist/org/index.js +1 -0
- package/dist/org/index.js.map +1 -1
- package/dist/org/permissions.d.ts +7 -0
- package/dist/org/permissions.d.ts.map +1 -0
- package/dist/org/permissions.js +21 -0
- package/dist/org/permissions.js.map +1 -0
- package/dist/org-team/index.d.ts +2 -0
- package/dist/org-team/index.d.ts.map +1 -0
- package/dist/org-team/index.js +2 -0
- package/dist/org-team/index.js.map +1 -0
- package/dist/private-blob/registry.d.ts.map +1 -1
- package/dist/private-blob/registry.js +1 -0
- package/dist/private-blob/registry.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/review/actions/consume-review-feedback.d.ts +10 -0
- package/dist/review/actions/consume-review-feedback.d.ts.map +1 -0
- package/dist/review/actions/consume-review-feedback.js +35 -0
- package/dist/review/actions/consume-review-feedback.js.map +1 -0
- package/dist/review/actions/create-review-comment.d.ts +18 -0
- package/dist/review/actions/create-review-comment.d.ts.map +1 -0
- package/dist/review/actions/create-review-comment.js +81 -0
- package/dist/review/actions/create-review-comment.js.map +1 -0
- package/dist/review/actions/delete-review-comment.d.ts +11 -0
- package/dist/review/actions/delete-review-comment.d.ts.map +1 -0
- package/dist/review/actions/delete-review-comment.js +53 -0
- package/dist/review/actions/delete-review-comment.js.map +1 -0
- package/dist/review/actions/get-review-feedback.d.ts +10 -0
- package/dist/review/actions/get-review-feedback.d.ts.map +1 -0
- package/dist/review/actions/get-review-feedback.js +45 -0
- package/dist/review/actions/get-review-feedback.js.map +1 -0
- package/dist/review/actions/list-review-comments.d.ts +13 -0
- package/dist/review/actions/list-review-comments.d.ts.map +1 -0
- package/dist/review/actions/list-review-comments.js +44 -0
- package/dist/review/actions/list-review-comments.js.map +1 -0
- package/dist/review/actions/reply-review-comment.d.ts +16 -0
- package/dist/review/actions/reply-review-comment.d.ts.map +1 -0
- package/dist/review/actions/reply-review-comment.js +84 -0
- package/dist/review/actions/reply-review-comment.js.map +1 -0
- package/dist/review/actions/resolve-review-thread.d.ts +12 -0
- package/dist/review/actions/resolve-review-thread.d.ts.map +1 -0
- package/dist/review/actions/resolve-review-thread.js +49 -0
- package/dist/review/actions/resolve-review-thread.js.map +1 -0
- package/dist/review/actions/set-review-status.d.ts +9 -0
- package/dist/review/actions/set-review-status.d.ts.map +1 -0
- package/dist/review/actions/set-review-status.js +43 -0
- package/dist/review/actions/set-review-status.js.map +1 -0
- package/dist/review/index.d.ts +5 -0
- package/dist/review/index.d.ts.map +1 -0
- package/dist/review/index.js +4 -0
- package/dist/review/index.js.map +1 -0
- package/dist/review/mentions.d.ts +4 -0
- package/dist/review/mentions.d.ts.map +1 -0
- package/dist/review/mentions.js +39 -0
- package/dist/review/mentions.js.map +1 -0
- package/dist/review/registry.d.ts +10 -0
- package/dist/review/registry.d.ts.map +1 -0
- package/dist/review/registry.js +63 -0
- package/dist/review/registry.js.map +1 -0
- package/dist/review/store.d.ts +63 -0
- package/dist/review/store.d.ts.map +1 -0
- package/dist/review/store.js +561 -0
- package/dist/review/store.js.map +1 -0
- package/dist/review/types.d.ts +77 -0
- package/dist/review/types.d.ts.map +1 -0
- package/dist/review/types.js +2 -0
- package/dist/review/types.js.map +1 -0
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +54 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +5 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts.map +1 -1
- package/dist/server/agent-engine-api-key-route.js +5 -0
- package/dist/server/agent-engine-api-key-route.js.map +1 -1
- package/dist/server/credential-provider.d.ts +28 -0
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +92 -0
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/setup-connections/index.d.ts +6 -0
- package/dist/setup-connections/index.d.ts.map +1 -0
- package/dist/setup-connections/index.js +6 -0
- package/dist/setup-connections/index.js.map +1 -0
- package/dist/setup-connections/onboarding.d.ts +14 -0
- package/dist/setup-connections/onboarding.d.ts.map +1 -0
- package/dist/setup-connections/onboarding.js +23 -0
- package/dist/setup-connections/onboarding.js.map +1 -0
- package/dist/transcription/builder-transcription.d.ts +1 -0
- package/dist/transcription/builder-transcription.d.ts.map +1 -1
- package/dist/transcription/builder-transcription.js +5 -2
- package/dist/transcription/builder-transcription.js.map +1 -1
- package/dist/vite/action-types-plugin.d.ts.map +1 -1
- package/dist/vite/action-types-plugin.js +52 -0
- package/dist/vite/action-types-plugin.js.map +1 -1
- package/docs/content/agent-native-toolkit.mdx +87 -80
- package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/de-DE/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/es-ES/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +89 -80
- package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +89 -80
- package/docs/content/toolkit-agent-ux.mdx +43 -0
- package/docs/content/toolkit-app-adapters.mdx +9 -0
- package/docs/content/toolkit-collaboration-ui.mdx +12 -0
- package/docs/content/toolkit-collaboration.mdx +74 -0
- package/docs/content/toolkit-command-navigation.mdx +106 -0
- package/docs/content/toolkit-comments-review.mdx +98 -0
- package/docs/content/toolkit-history.mdx +95 -0
- package/docs/content/toolkit-observability.mdx +41 -0
- package/docs/content/toolkit-org-team.mdx +80 -0
- package/docs/content/toolkit-resources.mdx +57 -0
- package/docs/content/toolkit-settings.mdx +65 -0
- package/docs/content/toolkit-setup-connections.mdx +109 -0
- package/docs/content/toolkit-sharing-ui.mdx +18 -6
- package/docs/content/toolkit-sharing.mdx +81 -0
- package/docs/content/toolkit-shell-hooks.mdx +9 -0
- package/docs/content/toolkit-ui.mdx +9 -0
- package/package.json +36 -2
|
@@ -351,6 +351,7 @@ interface DesignCanvasProps {
|
|
|
351
351
|
* For `"inline"` and `"localhost"` sources this prop is ignored.
|
|
352
352
|
*/
|
|
353
353
|
fusionUrl?: string;
|
|
354
|
+
bridgeToken?: string;
|
|
354
355
|
zoom: number;
|
|
355
356
|
onZoomChange?: (zoom: number) => void;
|
|
356
357
|
deviceFrame: DeviceFrameType;
|
|
@@ -371,6 +372,28 @@ interface DesignCanvasProps {
|
|
|
371
372
|
*/
|
|
372
373
|
runtimeReplacementContent?: string;
|
|
373
374
|
runtimeReplacementKey?: string;
|
|
375
|
+
styleRevertRequest?: {
|
|
376
|
+
requestId: number;
|
|
377
|
+
patches: Array<{
|
|
378
|
+
selector: string;
|
|
379
|
+
sourceId?: string | null;
|
|
380
|
+
styles: Record<string, string>;
|
|
381
|
+
}>;
|
|
382
|
+
} | null;
|
|
383
|
+
styleBaselineResetRequest?: number | null;
|
|
384
|
+
textRevertRequest?: {
|
|
385
|
+
requestId: number;
|
|
386
|
+
patches: Array<{
|
|
387
|
+
selector: string;
|
|
388
|
+
sourceId?: string | null;
|
|
389
|
+
value: string;
|
|
390
|
+
html?: string;
|
|
391
|
+
}>;
|
|
392
|
+
} | null;
|
|
393
|
+
structureAckRequest?: {
|
|
394
|
+
requestId: number;
|
|
395
|
+
acks: Array<{ requestId: string; applied: boolean }>;
|
|
396
|
+
} | null;
|
|
374
397
|
embeddedFrameBackground?: string;
|
|
375
398
|
transparentBackground?: boolean;
|
|
376
399
|
editorChromeScaleX?: number;
|
|
@@ -390,12 +413,17 @@ interface DesignCanvasProps {
|
|
|
390
413
|
selector: string,
|
|
391
414
|
styles: Record<string, string>,
|
|
392
415
|
info?: ElementInfo,
|
|
416
|
+
metadata?: { originalStyles?: Record<string, string> },
|
|
393
417
|
) => void;
|
|
394
418
|
onTextContentChange?: (
|
|
395
419
|
selector: string,
|
|
396
420
|
value: string,
|
|
397
421
|
info?: ElementInfo,
|
|
398
|
-
details?: {
|
|
422
|
+
details?: {
|
|
423
|
+
html?: string;
|
|
424
|
+
originalValue?: string;
|
|
425
|
+
originalHtml?: string;
|
|
426
|
+
},
|
|
399
427
|
) => void;
|
|
400
428
|
onTextEditingStateChange?: (state: {
|
|
401
429
|
active: boolean;
|
|
@@ -420,7 +448,7 @@ interface DesignCanvasProps {
|
|
|
420
448
|
sourceRect?: { x: number; y: number; width: number; height: number };
|
|
421
449
|
anchorRect?: { x: number; y: number; width: number; height: number };
|
|
422
450
|
},
|
|
423
|
-
) => boolean | void;
|
|
451
|
+
) => boolean | "pending" | void;
|
|
424
452
|
onVisualDuplicateChange?: (
|
|
425
453
|
selector: string,
|
|
426
454
|
cloneHtml: string,
|
|
@@ -837,6 +865,80 @@ function snapshotEndpointUrl(bridgeUrl: string, previewUrl: string): string {
|
|
|
837
865
|
return endpoint.toString();
|
|
838
866
|
}
|
|
839
867
|
|
|
868
|
+
function liveEditEndpointUrl(bridgeUrl: string, previewUrl: string): string {
|
|
869
|
+
const endpoint = new URL("/live-edit", bridgeUrl);
|
|
870
|
+
endpoint.searchParams.set("url", previewUrl);
|
|
871
|
+
return endpoint.toString();
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
function originFromUrl(value: string | undefined): string | null {
|
|
875
|
+
if (!value) return null;
|
|
876
|
+
try {
|
|
877
|
+
return new URL(value).origin;
|
|
878
|
+
} catch {
|
|
879
|
+
return null;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
function buildEditorChromeBridgeScript(args: {
|
|
884
|
+
readOnly: boolean;
|
|
885
|
+
editMode: boolean;
|
|
886
|
+
editorChromeScaleX: number;
|
|
887
|
+
editorChromeScaleY: number;
|
|
888
|
+
screenId: string;
|
|
889
|
+
boardSurface: boolean;
|
|
890
|
+
}) {
|
|
891
|
+
return (
|
|
892
|
+
createEditorBridgeThemeScript(readEditorBridgeThemeVars()) +
|
|
893
|
+
EDITOR_CHROME_BRIDGE_SCRIPT.replace(
|
|
894
|
+
"__READ_ONLY__",
|
|
895
|
+
args.readOnly ? "true" : "false",
|
|
896
|
+
)
|
|
897
|
+
.replace("__TEXT_EDITING_ENABLED__", args.editMode ? "true" : "false")
|
|
898
|
+
.replace("__EDITOR_CHROME_SCALE_X__", String(args.editorChromeScaleX))
|
|
899
|
+
.replace("__EDITOR_CHROME_SCALE_Y__", String(args.editorChromeScaleY))
|
|
900
|
+
.replace("__DESIGN_CANVAS_SCREEN_ID__", JSON.stringify(args.screenId))
|
|
901
|
+
.replace(
|
|
902
|
+
"__DESIGN_CANVAS_BOARD_SURFACE__",
|
|
903
|
+
args.boardSurface ? "true" : "false",
|
|
904
|
+
)
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
function contentHash(value: string): string {
|
|
909
|
+
let hash = 0;
|
|
910
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
911
|
+
hash = (hash * 31 + value.charCodeAt(index)) | 0;
|
|
912
|
+
}
|
|
913
|
+
return `${value.length}:${hash >>> 0}`;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
function isPlainRecord(value: unknown): value is Record<string, unknown> {
|
|
917
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
function isFiniteRect(value: unknown): value is ElementInfo["boundingRect"] {
|
|
921
|
+
if (!isPlainRecord(value)) return false;
|
|
922
|
+
return (
|
|
923
|
+
Number.isFinite(value.x) &&
|
|
924
|
+
Number.isFinite(value.y) &&
|
|
925
|
+
Number.isFinite(value.width) &&
|
|
926
|
+
Number.isFinite(value.height)
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
export function isElementInfoPayload(value: unknown): value is ElementInfo {
|
|
931
|
+
if (!isPlainRecord(value)) return false;
|
|
932
|
+
return (
|
|
933
|
+
typeof value.tagName === "string" &&
|
|
934
|
+
Array.isArray(value.classes) &&
|
|
935
|
+
isPlainRecord(value.computedStyles) &&
|
|
936
|
+
isFiniteRect(value.boundingRect) &&
|
|
937
|
+
typeof value.isFlexChild === "boolean" &&
|
|
938
|
+
typeof value.isFlexContainer === "boolean"
|
|
939
|
+
);
|
|
940
|
+
}
|
|
941
|
+
|
|
840
942
|
/**
|
|
841
943
|
* Exponential backoff delay (ms) for the localhost bridge snapshot auto-retry
|
|
842
944
|
* loop, keyed by the zero-based retry attempt number (0 = first retry after
|
|
@@ -945,6 +1047,7 @@ export function DesignCanvas({
|
|
|
945
1047
|
externalSnapshotHtml,
|
|
946
1048
|
onExternalContentSnapshot,
|
|
947
1049
|
fusionUrl,
|
|
1050
|
+
bridgeToken,
|
|
948
1051
|
zoom,
|
|
949
1052
|
onZoomChange,
|
|
950
1053
|
deviceFrame,
|
|
@@ -952,6 +1055,10 @@ export function DesignCanvas({
|
|
|
952
1055
|
boardSurface = false,
|
|
953
1056
|
runtimeReplacementContent,
|
|
954
1057
|
runtimeReplacementKey,
|
|
1058
|
+
styleRevertRequest,
|
|
1059
|
+
styleBaselineResetRequest,
|
|
1060
|
+
textRevertRequest,
|
|
1061
|
+
structureAckRequest,
|
|
955
1062
|
embeddedFrameBackground,
|
|
956
1063
|
transparentBackground = false,
|
|
957
1064
|
editorChromeScaleX = 1,
|
|
@@ -1082,6 +1189,8 @@ export function DesignCanvas({
|
|
|
1082
1189
|
status: "loading" | "error";
|
|
1083
1190
|
message?: string;
|
|
1084
1191
|
} | null>(null);
|
|
1192
|
+
const [registeredLiveEditBridgeKey, setRegisteredLiveEditBridgeKey] =
|
|
1193
|
+
useState<string | null>(null);
|
|
1085
1194
|
const [externalSnapshotRetryNonce, setExternalSnapshotRetryNonce] =
|
|
1086
1195
|
useState(0);
|
|
1087
1196
|
// Exponential backoff for the auto-retry loop below: 1.5s → 3s → 6s →
|
|
@@ -1116,20 +1225,74 @@ export function DesignCanvas({
|
|
|
1116
1225
|
(fetchedExternalSnapshot?.url === rawExternalPreviewUrl
|
|
1117
1226
|
? fetchedExternalSnapshot.html
|
|
1118
1227
|
: undefined);
|
|
1119
|
-
const
|
|
1228
|
+
const editorChromeBridgeForCurrentState = useMemo(
|
|
1229
|
+
() =>
|
|
1230
|
+
buildEditorChromeBridgeScript({
|
|
1231
|
+
readOnly,
|
|
1232
|
+
editMode,
|
|
1233
|
+
editorChromeScaleX: effectiveEditorChromeScaleX,
|
|
1234
|
+
editorChromeScaleY: effectiveEditorChromeScaleY,
|
|
1235
|
+
screenId: screenId ?? contentKey ?? "",
|
|
1236
|
+
boardSurface,
|
|
1237
|
+
}),
|
|
1238
|
+
[
|
|
1239
|
+
boardSurface,
|
|
1240
|
+
contentKey,
|
|
1241
|
+
editMode,
|
|
1242
|
+
effectiveEditorChromeScaleX,
|
|
1243
|
+
effectiveEditorChromeScaleY,
|
|
1244
|
+
readOnly,
|
|
1245
|
+
screenId,
|
|
1246
|
+
],
|
|
1247
|
+
);
|
|
1248
|
+
const embeddedWheelBridgeForCurrentState = useMemo(
|
|
1249
|
+
() =>
|
|
1250
|
+
EMBEDDED_WHEEL_BRIDGE_SCRIPT.replace(
|
|
1251
|
+
"__EMBEDDED_WHEEL_FORWARDING_ENABLED__",
|
|
1252
|
+
isEmbeddedFrame ? "true" : "false",
|
|
1253
|
+
),
|
|
1254
|
+
[isEmbeddedFrame],
|
|
1255
|
+
);
|
|
1256
|
+
const liveEditBridgeScript = useMemo(
|
|
1257
|
+
() =>
|
|
1258
|
+
MOTION_PREVIEW_BRIDGE_SCRIPT +
|
|
1259
|
+
SHADER_FILL_PREVIEW_BRIDGE_SCRIPT +
|
|
1260
|
+
TWEAK_BRIDGE_SCRIPT +
|
|
1261
|
+
ZOOM_BRIDGE_SCRIPT +
|
|
1262
|
+
LIGHTWEIGHT_HIT_TEST_BRIDGE_SCRIPT +
|
|
1263
|
+
embeddedWheelBridgeForCurrentState +
|
|
1264
|
+
editorChromeBridgeForCurrentState,
|
|
1265
|
+
[editorChromeBridgeForCurrentState, embeddedWheelBridgeForCurrentState],
|
|
1266
|
+
);
|
|
1267
|
+
const liveEditBridgeKey = useMemo(
|
|
1268
|
+
() => contentHash(liveEditBridgeScript),
|
|
1269
|
+
[liveEditBridgeScript],
|
|
1270
|
+
);
|
|
1271
|
+
const usesLiveEditExternalFrame =
|
|
1120
1272
|
sourceType === "localhost" &&
|
|
1121
1273
|
Boolean(bridgeUrl && rawExternalPreviewUrl) &&
|
|
1122
1274
|
!interactMode &&
|
|
1123
1275
|
!readOnly;
|
|
1276
|
+
const liveEditBridgeRegistered =
|
|
1277
|
+
usesLiveEditExternalFrame &&
|
|
1278
|
+
registeredLiveEditBridgeKey === liveEditBridgeKey;
|
|
1279
|
+
const requiresEditableExternalSnapshot = false;
|
|
1280
|
+
const liveEditExternalPreviewUrl =
|
|
1281
|
+
liveEditBridgeRegistered && bridgeUrl && rawExternalPreviewUrl
|
|
1282
|
+
? liveEditEndpointUrl(bridgeUrl, rawExternalPreviewUrl)
|
|
1283
|
+
: null;
|
|
1124
1284
|
const iframeRenderContent =
|
|
1125
1285
|
activeExternalSnapshotHtml ??
|
|
1126
1286
|
(requiresEditableExternalSnapshot ? "" : renderedContent);
|
|
1127
1287
|
const externalPreviewUrl =
|
|
1128
|
-
|
|
1288
|
+
liveEditExternalPreviewUrl ??
|
|
1289
|
+
(activeExternalSnapshotHtml || requiresEditableExternalSnapshot
|
|
1129
1290
|
? null
|
|
1130
|
-
: rawExternalPreviewUrl;
|
|
1291
|
+
: rawExternalPreviewUrl);
|
|
1131
1292
|
const waitingForEditableExternalSnapshot =
|
|
1132
1293
|
requiresEditableExternalSnapshot && !activeExternalSnapshotHtml;
|
|
1294
|
+
const waitingForLiveEditBridge =
|
|
1295
|
+
usesLiveEditExternalFrame && !liveEditBridgeRegistered;
|
|
1133
1296
|
zoomRef.current = zoom;
|
|
1134
1297
|
runtimeReplacementContentRef.current = runtimeReplacementContent;
|
|
1135
1298
|
runtimeReplacementKeyRef.current = runtimeReplacementKey;
|
|
@@ -1138,9 +1301,61 @@ export function DesignCanvas({
|
|
|
1138
1301
|
onExternalContentSnapshotRef.current = onExternalContentSnapshot;
|
|
1139
1302
|
}, [onExternalContentSnapshot]);
|
|
1140
1303
|
|
|
1304
|
+
useEffect(() => {
|
|
1305
|
+
if (!usesLiveEditExternalFrame || !bridgeUrl) {
|
|
1306
|
+
setRegisteredLiveEditBridgeKey(null);
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
let cancelled = false;
|
|
1310
|
+
setRegisteredLiveEditBridgeKey((current) =>
|
|
1311
|
+
current === liveEditBridgeKey ? current : null,
|
|
1312
|
+
);
|
|
1313
|
+
void (async () => {
|
|
1314
|
+
try {
|
|
1315
|
+
const endpoint = new URL("/live-edit-bridge", bridgeUrl).toString();
|
|
1316
|
+
const response = await fetch(endpoint, {
|
|
1317
|
+
method: "POST",
|
|
1318
|
+
headers: {
|
|
1319
|
+
"content-type": "application/json",
|
|
1320
|
+
...(bridgeToken ? { "x-bridge-token": bridgeToken } : {}),
|
|
1321
|
+
},
|
|
1322
|
+
body: JSON.stringify({ script: liveEditBridgeScript }),
|
|
1323
|
+
});
|
|
1324
|
+
if (!response.ok) {
|
|
1325
|
+
throw new Error(`Bridge registration failed (${response.status})`);
|
|
1326
|
+
}
|
|
1327
|
+
if (!cancelled) {
|
|
1328
|
+
setRegisteredLiveEditBridgeKey(liveEditBridgeKey);
|
|
1329
|
+
}
|
|
1330
|
+
} catch (error) {
|
|
1331
|
+
if (!cancelled) {
|
|
1332
|
+
console.warn(
|
|
1333
|
+
"[DesignCanvas] live edit bridge registration failed",
|
|
1334
|
+
error,
|
|
1335
|
+
);
|
|
1336
|
+
setRegisteredLiveEditBridgeKey(null);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
})();
|
|
1340
|
+
return () => {
|
|
1341
|
+
cancelled = true;
|
|
1342
|
+
};
|
|
1343
|
+
}, [
|
|
1344
|
+
bridgeUrl,
|
|
1345
|
+
bridgeToken,
|
|
1346
|
+
liveEditBridgeKey,
|
|
1347
|
+
liveEditBridgeScript,
|
|
1348
|
+
usesLiveEditExternalFrame,
|
|
1349
|
+
]);
|
|
1350
|
+
|
|
1141
1351
|
useEffect(() => {
|
|
1142
1352
|
const previewUrl = rawExternalPreviewUrl;
|
|
1143
|
-
if (
|
|
1353
|
+
if (
|
|
1354
|
+
!requiresEditableExternalSnapshot ||
|
|
1355
|
+
sourceType !== "localhost" ||
|
|
1356
|
+
!bridgeUrl ||
|
|
1357
|
+
!previewUrl
|
|
1358
|
+
) {
|
|
1144
1359
|
snapshotRetryAttemptRef.current = 0;
|
|
1145
1360
|
setFetchedExternalSnapshot((current) =>
|
|
1146
1361
|
current?.url === previewUrl ? current : null,
|
|
@@ -1468,6 +1683,12 @@ export function DesignCanvas({
|
|
|
1468
1683
|
origin: e.origin,
|
|
1469
1684
|
iframeWindow,
|
|
1470
1685
|
parentOrigin: window.location.origin,
|
|
1686
|
+
allowedOrigins:
|
|
1687
|
+
sourceType === "localhost" && bridgeUrl
|
|
1688
|
+
? [originFromUrl(bridgeUrl)].filter(
|
|
1689
|
+
(origin): origin is string => Boolean(origin),
|
|
1690
|
+
)
|
|
1691
|
+
: [],
|
|
1471
1692
|
});
|
|
1472
1693
|
if (!trusted) {
|
|
1473
1694
|
return;
|
|
@@ -1509,8 +1730,19 @@ export function DesignCanvas({
|
|
|
1509
1730
|
e.data.styles && typeof e.data.styles === "object"
|
|
1510
1731
|
? (e.data.styles as Record<string, string>)
|
|
1511
1732
|
: {};
|
|
1733
|
+
const originalStyles =
|
|
1734
|
+
e.data.originalStyles && typeof e.data.originalStyles === "object"
|
|
1735
|
+
? (e.data.originalStyles as Record<string, string>)
|
|
1736
|
+
: undefined;
|
|
1512
1737
|
if (selector && Object.keys(styles).length > 0) {
|
|
1513
|
-
onVisualStyleChange?.(
|
|
1738
|
+
onVisualStyleChange?.(
|
|
1739
|
+
selector,
|
|
1740
|
+
styles,
|
|
1741
|
+
isElementInfoPayload(e.data.payload) ? e.data.payload : undefined,
|
|
1742
|
+
{
|
|
1743
|
+
originalStyles,
|
|
1744
|
+
},
|
|
1745
|
+
);
|
|
1514
1746
|
}
|
|
1515
1747
|
return;
|
|
1516
1748
|
}
|
|
@@ -1528,8 +1760,20 @@ export function DesignCanvas({
|
|
|
1528
1760
|
const value = String(e.data.value ?? "");
|
|
1529
1761
|
const html =
|
|
1530
1762
|
typeof e.data.html === "string" ? String(e.data.html) : undefined;
|
|
1763
|
+
const originalValue =
|
|
1764
|
+
typeof e.data.originalValue === "string"
|
|
1765
|
+
? String(e.data.originalValue)
|
|
1766
|
+
: undefined;
|
|
1767
|
+
const originalHtml =
|
|
1768
|
+
typeof e.data.originalHtml === "string"
|
|
1769
|
+
? String(e.data.originalHtml)
|
|
1770
|
+
: undefined;
|
|
1531
1771
|
if (selector) {
|
|
1532
|
-
onTextContentChange?.(selector, value, e.data.payload, {
|
|
1772
|
+
onTextContentChange?.(selector, value, e.data.payload, {
|
|
1773
|
+
html,
|
|
1774
|
+
originalValue,
|
|
1775
|
+
originalHtml,
|
|
1776
|
+
});
|
|
1533
1777
|
}
|
|
1534
1778
|
return;
|
|
1535
1779
|
}
|
|
@@ -1599,7 +1843,7 @@ export function DesignCanvas({
|
|
|
1599
1843
|
anchorRect,
|
|
1600
1844
|
},
|
|
1601
1845
|
);
|
|
1602
|
-
if (requestId) {
|
|
1846
|
+
if (requestId && applied !== "pending") {
|
|
1603
1847
|
iframeRef.current?.contentWindow?.postMessage(
|
|
1604
1848
|
{
|
|
1605
1849
|
type: "visual-structure-ack",
|
|
@@ -1828,6 +2072,7 @@ export function DesignCanvas({
|
|
|
1828
2072
|
onComponentSourceJump,
|
|
1829
2073
|
isEmbeddedFrame,
|
|
1830
2074
|
sourceType,
|
|
2075
|
+
bridgeUrl,
|
|
1831
2076
|
fusionUrl,
|
|
1832
2077
|
flushPendingOneShotMessages,
|
|
1833
2078
|
]);
|
|
@@ -2159,6 +2404,89 @@ export function DesignCanvas({
|
|
|
2159
2404
|
[postOneShotBridgeMessage],
|
|
2160
2405
|
);
|
|
2161
2406
|
|
|
2407
|
+
const lastStyleRevertRequestIdRef = useRef<number | null>(null);
|
|
2408
|
+
useEffect(() => {
|
|
2409
|
+
if (!styleRevertRequest) return;
|
|
2410
|
+
if (lastStyleRevertRequestIdRef.current === styleRevertRequest.requestId) {
|
|
2411
|
+
return;
|
|
2412
|
+
}
|
|
2413
|
+
lastStyleRevertRequestIdRef.current = styleRevertRequest.requestId;
|
|
2414
|
+
for (const patch of styleRevertRequest.patches) {
|
|
2415
|
+
const selectorCandidates = [
|
|
2416
|
+
patch.selector,
|
|
2417
|
+
patch.sourceId
|
|
2418
|
+
? `[data-agent-native-node-id="${String(patch.sourceId).replace(/"/g, '\\"')}"]`
|
|
2419
|
+
: "",
|
|
2420
|
+
].filter(Boolean);
|
|
2421
|
+
for (const [property, value] of Object.entries(patch.styles)) {
|
|
2422
|
+
postOneShotBridgeMessage({
|
|
2423
|
+
type: "style-change",
|
|
2424
|
+
selector: patch.selector,
|
|
2425
|
+
property,
|
|
2426
|
+
value,
|
|
2427
|
+
selectorCandidates,
|
|
2428
|
+
nodeId: patch.sourceId ?? "",
|
|
2429
|
+
});
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
}, [postOneShotBridgeMessage, styleRevertRequest]);
|
|
2433
|
+
|
|
2434
|
+
const lastStyleBaselineResetRequestRef = useRef<number | null>(null);
|
|
2435
|
+
useEffect(() => {
|
|
2436
|
+
if (styleBaselineResetRequest == null) return;
|
|
2437
|
+
if (
|
|
2438
|
+
lastStyleBaselineResetRequestRef.current === styleBaselineResetRequest
|
|
2439
|
+
) {
|
|
2440
|
+
return;
|
|
2441
|
+
}
|
|
2442
|
+
lastStyleBaselineResetRequestRef.current = styleBaselineResetRequest;
|
|
2443
|
+
postOneShotBridgeMessage({
|
|
2444
|
+
type: "agent-native:reset-live-visual-edit-baselines",
|
|
2445
|
+
});
|
|
2446
|
+
}, [postOneShotBridgeMessage, styleBaselineResetRequest]);
|
|
2447
|
+
|
|
2448
|
+
const lastTextRevertRequestIdRef = useRef<number | null>(null);
|
|
2449
|
+
useEffect(() => {
|
|
2450
|
+
if (!textRevertRequest) return;
|
|
2451
|
+
if (lastTextRevertRequestIdRef.current === textRevertRequest.requestId) {
|
|
2452
|
+
return;
|
|
2453
|
+
}
|
|
2454
|
+
lastTextRevertRequestIdRef.current = textRevertRequest.requestId;
|
|
2455
|
+
for (const patch of textRevertRequest.patches) {
|
|
2456
|
+
const selectorCandidates = [
|
|
2457
|
+
patch.selector,
|
|
2458
|
+
patch.sourceId
|
|
2459
|
+
? `[data-agent-native-node-id="${String(patch.sourceId).replace(/"/g, '\\"')}"]`
|
|
2460
|
+
: "",
|
|
2461
|
+
].filter(Boolean);
|
|
2462
|
+
postOneShotBridgeMessage({
|
|
2463
|
+
type: "set-text-content",
|
|
2464
|
+
selector: patch.selector,
|
|
2465
|
+
selectorCandidates,
|
|
2466
|
+
value: patch.value,
|
|
2467
|
+
html: patch.html,
|
|
2468
|
+
});
|
|
2469
|
+
}
|
|
2470
|
+
}, [postOneShotBridgeMessage, textRevertRequest]);
|
|
2471
|
+
|
|
2472
|
+
const lastStructureAckRequestIdRef = useRef<number | null>(null);
|
|
2473
|
+
useEffect(() => {
|
|
2474
|
+
if (!structureAckRequest) return;
|
|
2475
|
+
if (
|
|
2476
|
+
lastStructureAckRequestIdRef.current === structureAckRequest.requestId
|
|
2477
|
+
) {
|
|
2478
|
+
return;
|
|
2479
|
+
}
|
|
2480
|
+
lastStructureAckRequestIdRef.current = structureAckRequest.requestId;
|
|
2481
|
+
for (const ack of structureAckRequest.acks) {
|
|
2482
|
+
postOneShotBridgeMessage({
|
|
2483
|
+
type: "visual-structure-ack",
|
|
2484
|
+
requestId: ack.requestId,
|
|
2485
|
+
applied: ack.applied,
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2488
|
+
}, [postOneShotBridgeMessage, structureAckRequest]);
|
|
2489
|
+
|
|
2162
2490
|
/**
|
|
2163
2491
|
* Send a motion-preview scrub tick to the iframe. `t` is the normalised
|
|
2164
2492
|
* playhead position in [0, 1]. Tracks must have been loaded first via the
|
|
@@ -2675,9 +3003,15 @@ export function DesignCanvas({
|
|
|
2675
3003
|
</div>
|
|
2676
3004
|
</div>
|
|
2677
3005
|
) : null}
|
|
2678
|
-
{waitingForEditableExternalSnapshot ? (
|
|
3006
|
+
{waitingForEditableExternalSnapshot || waitingForLiveEditBridge ? (
|
|
2679
3007
|
<div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-background/85 px-4 text-center text-sm text-muted-foreground">
|
|
2680
|
-
{
|
|
3008
|
+
{waitingForLiveEditBridge ? (
|
|
3009
|
+
<div className="max-w-[28rem] rounded-md border bg-card px-4 py-3 shadow-sm">
|
|
3010
|
+
{
|
|
3011
|
+
"Preparing live editor..." /* i18n-ignore transient localhost live-edit bridge loading state */
|
|
3012
|
+
}
|
|
3013
|
+
</div>
|
|
3014
|
+
) : externalSnapshotState?.status === "error" ? (
|
|
2681
3015
|
// A real offline dev server previously looked identical to the
|
|
2682
3016
|
// ordinary "still loading" state and retried forever on a fixed
|
|
2683
3017
|
// 1.5s timer — see getSnapshotRetryDelayMs for the backoff that
|
|
@@ -604,6 +604,32 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
604
604
|
return styles;
|
|
605
605
|
}
|
|
606
606
|
|
|
607
|
+
var liveVisualEditOriginalInlineStyles =
|
|
608
|
+
typeof WeakMap !== "undefined"
|
|
609
|
+
? new WeakMap<Element, Record<string, string>>()
|
|
610
|
+
: null;
|
|
611
|
+
|
|
612
|
+
function rememberLiveVisualEditOriginalStyles(el: Element | null): void {
|
|
613
|
+
if (!el || !liveVisualEditOriginalInlineStyles) return;
|
|
614
|
+
if (liveVisualEditOriginalInlineStyles.has(el)) return;
|
|
615
|
+
liveVisualEditOriginalInlineStyles.set(el, collectInlineStyles(el));
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
function originalInlineStylesForPatch(
|
|
619
|
+
el: Element | null,
|
|
620
|
+
styles: Record<string, string>,
|
|
621
|
+
): Record<string, string> {
|
|
622
|
+
if (!el || !liveVisualEditOriginalInlineStyles) return {};
|
|
623
|
+
rememberLiveVisualEditOriginalStyles(el);
|
|
624
|
+
var original = liveVisualEditOriginalInlineStyles.get(el) || {};
|
|
625
|
+
var patch: Record<string, string> = {};
|
|
626
|
+
Object.keys(styles).forEach(function (property) {
|
|
627
|
+
patch[property] =
|
|
628
|
+
typeof original[property] === "string" ? original[property] : "";
|
|
629
|
+
});
|
|
630
|
+
return patch;
|
|
631
|
+
}
|
|
632
|
+
|
|
607
633
|
function chromeColorForElement(el: Element | null): string {
|
|
608
634
|
return elementLooksLikeComponent(el)
|
|
609
635
|
? "var(--design-editor-component-color)"
|
|
@@ -946,6 +972,7 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
946
972
|
}
|
|
947
973
|
|
|
948
974
|
function postElementSelect(el: Element, e?: MouseEvent): void {
|
|
975
|
+
rememberLiveVisualEditOriginalStyles(el);
|
|
949
976
|
var message: {
|
|
950
977
|
type: string;
|
|
951
978
|
payload: unknown;
|
|
@@ -4455,6 +4482,7 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
4455
4482
|
type: "visual-style-change",
|
|
4456
4483
|
selector: getSelector(selectedEl),
|
|
4457
4484
|
styles: styles,
|
|
4485
|
+
originalStyles: originalInlineStylesForPatch(selectedEl, styles),
|
|
4458
4486
|
payload: getElementInfo(selectedEl),
|
|
4459
4487
|
},
|
|
4460
4488
|
"*",
|
|
@@ -4647,13 +4675,17 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
4647
4675
|
setActiveDragCancel(cancelSpacingDrag);
|
|
4648
4676
|
}
|
|
4649
4677
|
|
|
4650
|
-
function postTextContentChange(el, value, html) {
|
|
4678
|
+
function postTextContentChange(el, value, html, originalValue, originalHtml) {
|
|
4651
4679
|
(window.parent as Window).postMessage(
|
|
4652
4680
|
{
|
|
4653
4681
|
type: "text-content-change",
|
|
4654
4682
|
selector: getSelector(el),
|
|
4655
4683
|
value: value,
|
|
4656
4684
|
html: html,
|
|
4685
|
+
originalValue:
|
|
4686
|
+
typeof originalValue === "string" ? originalValue : undefined,
|
|
4687
|
+
originalHtml:
|
|
4688
|
+
typeof originalHtml === "string" ? originalHtml : undefined,
|
|
4657
4689
|
payload: getElementInfo(el),
|
|
4658
4690
|
},
|
|
4659
4691
|
"*",
|
|
@@ -5126,15 +5158,17 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
5126
5158
|
el.style.display = "flex";
|
|
5127
5159
|
el.style.flexDirection = inferred.direction;
|
|
5128
5160
|
el.style.gap = inferred.gap + "px";
|
|
5161
|
+
var styles = {
|
|
5162
|
+
display: "flex",
|
|
5163
|
+
"flex-direction": inferred.direction,
|
|
5164
|
+
gap: inferred.gap + "px",
|
|
5165
|
+
};
|
|
5129
5166
|
(window.parent as Window).postMessage(
|
|
5130
5167
|
{
|
|
5131
5168
|
type: "visual-style-change",
|
|
5132
5169
|
selector: getSelector(container),
|
|
5133
|
-
styles:
|
|
5134
|
-
|
|
5135
|
-
"flex-direction": inferred.direction,
|
|
5136
|
-
gap: inferred.gap + "px",
|
|
5137
|
-
},
|
|
5170
|
+
styles: styles,
|
|
5171
|
+
originalStyles: originalInlineStylesForPatch(container, styles),
|
|
5138
5172
|
payload: getElementInfo(container),
|
|
5139
5173
|
},
|
|
5140
5174
|
"*",
|
|
@@ -5223,11 +5257,13 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
5223
5257
|
if (!containerBackgroundIsLight(container)) return;
|
|
5224
5258
|
}
|
|
5225
5259
|
el.style.color = "inherit";
|
|
5260
|
+
var styles = { color: "inherit" };
|
|
5226
5261
|
(window.parent as Window).postMessage(
|
|
5227
5262
|
{
|
|
5228
5263
|
type: "visual-style-change",
|
|
5229
5264
|
selector: getSelector(member),
|
|
5230
|
-
styles:
|
|
5265
|
+
styles: styles,
|
|
5266
|
+
originalStyles: originalInlineStylesForPatch(member, styles),
|
|
5231
5267
|
payload: getElementInfo(member),
|
|
5232
5268
|
},
|
|
5233
5269
|
"*",
|
|
@@ -6590,15 +6626,17 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
6590
6626
|
// order — the host composes them against its synchronous same-tick
|
|
6591
6627
|
// content refs exactly like multi-property style commits.
|
|
6592
6628
|
memberStates.forEach(function (state) {
|
|
6629
|
+
var styles = {
|
|
6630
|
+
position: state.el.style.position,
|
|
6631
|
+
left: state.el.style.left,
|
|
6632
|
+
top: state.el.style.top,
|
|
6633
|
+
};
|
|
6593
6634
|
(window.parent as Window).postMessage(
|
|
6594
6635
|
{
|
|
6595
6636
|
type: "visual-style-change",
|
|
6596
6637
|
selector: getSelector(state.el),
|
|
6597
|
-
styles:
|
|
6598
|
-
|
|
6599
|
-
left: state.el.style.left,
|
|
6600
|
-
top: state.el.style.top,
|
|
6601
|
-
},
|
|
6638
|
+
styles: styles,
|
|
6639
|
+
originalStyles: originalInlineStylesForPatch(state.el, styles),
|
|
6602
6640
|
payload: getElementInfo(state.el),
|
|
6603
6641
|
},
|
|
6604
6642
|
"*",
|
|
@@ -6832,6 +6870,7 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
6832
6870
|
type: "visual-style-change",
|
|
6833
6871
|
selector: getSelector(resizeEl),
|
|
6834
6872
|
styles: styles,
|
|
6873
|
+
originalStyles: originalInlineStylesForPatch(resizeEl, styles),
|
|
6835
6874
|
payload: getElementInfo(resizeEl),
|
|
6836
6875
|
},
|
|
6837
6876
|
"*",
|
|
@@ -6902,11 +6941,13 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
6902
6941
|
cleanupRotateDrag();
|
|
6903
6942
|
hideTransformBadge();
|
|
6904
6943
|
if (!rotateEl) return;
|
|
6944
|
+
var styles = { transform: rotateEl.style.transform };
|
|
6905
6945
|
(window.parent as Window).postMessage(
|
|
6906
6946
|
{
|
|
6907
6947
|
type: "visual-style-change",
|
|
6908
6948
|
selector: getSelector(rotateEl),
|
|
6909
|
-
styles:
|
|
6949
|
+
styles: styles,
|
|
6950
|
+
originalStyles: originalInlineStylesForPatch(rotateEl, styles),
|
|
6910
6951
|
payload: getElementInfo(rotateEl),
|
|
6911
6952
|
},
|
|
6912
6953
|
"*",
|
|
@@ -7461,7 +7502,13 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
7461
7502
|
var nextHtml = target.innerHTML || "";
|
|
7462
7503
|
refreshOverlays();
|
|
7463
7504
|
if (next !== originalText || nextHtml !== originalHtml) {
|
|
7464
|
-
postTextContentChange(
|
|
7505
|
+
postTextContentChange(
|
|
7506
|
+
target,
|
|
7507
|
+
next,
|
|
7508
|
+
nextHtml,
|
|
7509
|
+
originalText,
|
|
7510
|
+
originalHtml,
|
|
7511
|
+
);
|
|
7465
7512
|
}
|
|
7466
7513
|
// T13: replay the latest runtime-content update that arrived (and was
|
|
7467
7514
|
// buffered) while this edit session was active, so the canvas isn't
|
|
@@ -7905,6 +7952,15 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
7905
7952
|
cancelActiveBridgeDrag();
|
|
7906
7953
|
return;
|
|
7907
7954
|
}
|
|
7955
|
+
if (e.data.type === "agent-native:reset-live-visual-edit-baselines") {
|
|
7956
|
+
if (liveVisualEditOriginalInlineStyles) {
|
|
7957
|
+
liveVisualEditOriginalInlineStyles = new WeakMap<
|
|
7958
|
+
Element,
|
|
7959
|
+
Record<string, string>
|
|
7960
|
+
>();
|
|
7961
|
+
}
|
|
7962
|
+
return;
|
|
7963
|
+
}
|
|
7908
7964
|
if (e.data.type === "clear-selection") {
|
|
7909
7965
|
// During marquee drag, empty hit sets are replayed back from the host as a
|
|
7910
7966
|
// clear-selection state. Keep the drag-owned rectangle alive until pointer-up.
|
|
@@ -8168,6 +8224,23 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
8168
8224
|
removeRuntimeTarget(e.data.selector, e.data.selectorCandidates);
|
|
8169
8225
|
return;
|
|
8170
8226
|
}
|
|
8227
|
+
if (e.data.type === "set-text-content") {
|
|
8228
|
+
var textTarget = findRuntimeTarget(
|
|
8229
|
+
String(e.data.selector || ""),
|
|
8230
|
+
Array.isArray(e.data.selectorCandidates)
|
|
8231
|
+
? e.data.selectorCandidates
|
|
8232
|
+
: [],
|
|
8233
|
+
) as HTMLElement | null;
|
|
8234
|
+
if (!textTarget) return;
|
|
8235
|
+
if (typeof e.data.html === "string") {
|
|
8236
|
+
textTarget.innerHTML = e.data.html;
|
|
8237
|
+
} else {
|
|
8238
|
+
textTarget.textContent =
|
|
8239
|
+
typeof e.data.value === "string" ? e.data.value : "";
|
|
8240
|
+
}
|
|
8241
|
+
refreshOverlays();
|
|
8242
|
+
return;
|
|
8243
|
+
}
|
|
8171
8244
|
if (e.data.type !== "style-change") return;
|
|
8172
8245
|
var sel = e.data.selector;
|
|
8173
8246
|
var prop = e.data.property;
|
|
@@ -8211,6 +8284,8 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
|
|
|
8211
8284
|
activeTextEditEl,
|
|
8212
8285
|
activeTextEditEl!.textContent || "",
|
|
8213
8286
|
activeTextEditEl!.innerHTML || "",
|
|
8287
|
+
undefined,
|
|
8288
|
+
undefined,
|
|
8214
8289
|
);
|
|
8215
8290
|
refreshOverlays();
|
|
8216
8291
|
return;
|