@agent-native/core 0.80.2 → 0.80.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +66 -2
- package/corpus/core/docs/content/locales/ar-SA/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/real-time-collaboration.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +1 -1
- package/corpus/core/docs/content/real-time-collaboration.mdx +2 -2
- package/corpus/core/docs/content/template-design.mdx +1 -1
- package/corpus/core/package.json +3 -7
- package/corpus/core/src/action.ts +32 -0
- package/corpus/core/src/agent/durable-background.ts +32 -11
- package/corpus/core/src/agent/production-agent.ts +14 -1
- package/corpus/core/src/agent/run-loop-with-resume.ts +3 -1
- package/corpus/core/src/brand-kit/fig/index.ts +17 -37
- package/corpus/core/src/cli/index.ts +1 -1
- package/corpus/core/src/cli/mcp-config-writers.ts +187 -51
- package/corpus/core/src/cli/plan-local.ts +445 -108
- package/corpus/core/src/cli/skills.ts +32 -8
- package/corpus/core/src/client/AssistantChat.tsx +11 -1
- package/corpus/core/src/client/agent-chat.ts +12 -1
- package/corpus/core/src/client/composer/PromptComposer.tsx +100 -41
- package/corpus/core/src/client/org/OrgSwitcher.tsx +1 -1
- package/corpus/core/src/client/sharing/ShareButton.tsx +3 -27
- package/corpus/core/src/collab/presence.ts +1 -1
- package/corpus/core/src/mcp/connect-route.ts +34 -5
- package/corpus/core/src/server/action-discovery.ts +4 -0
- package/corpus/core/src/server/action-routes.ts +14 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +20 -0
- package/corpus/core/src/vite/client.ts +15 -1
- package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +2 -0
- package/corpus/templates/analytics/actions/update-dashboard.ts +8 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +117 -33
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +4 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +7 -0
- package/corpus/templates/analytics/changelog/2026-06-27-dashboards-can-now-nest-under-a-parent-in-the-sidebar-via-a-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-29-analytics-pages-now-sit-closer-under-the-header-with-tighter.md +6 -0
- package/corpus/templates/assets/actions/generate-image-batch.ts +3 -0
- package/corpus/templates/assets/actions/generate-image.ts +3 -0
- package/corpus/templates/assets/changelog/2026-06-29-longer-agent-generation-window.md +6 -0
- package/corpus/templates/assets/netlify.toml +3 -3
- package/corpus/templates/assets/server/plugins/agent-chat.ts +4 -1
- package/corpus/templates/clips/app/components/capture-install-options.tsx +7 -8
- package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +162 -0
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +1 -1
- package/corpus/templates/clips/app/i18n/ar-SA.ts +4 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +4 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +4 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +4 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +4 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +4 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +4 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +4 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +4 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +42 -18
- package/corpus/templates/content/AGENTS.md +12 -0
- package/corpus/templates/content/app/blocks/BuilderDocsBlocks.tsx +10 -0
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -0
- package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +185 -0
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +3 -0
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +19 -0
- package/corpus/templates/content/app/components/editor/extensions/ContentReferenceNode.tsx +82 -0
- package/corpus/templates/content/app/global.css +9 -0
- package/corpus/templates/content/app/i18n/zh-TW.ts +12 -0
- package/corpus/templates/content/app/i18n-data.ts +140 -0
- package/corpus/templates/content/changelog/2026-06-29-reusable-mdx-references-now-preview-linked-local-documents-i.md +6 -0
- package/corpus/templates/content/shared/builder-docs-blocks.ts +8 -0
- package/corpus/templates/content/shared/builder-mdx.ts +141 -4
- package/corpus/templates/content/shared/nfm.ts +62 -0
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +10 -11
- package/corpus/templates/design/AGENTS.md +5 -0
- package/corpus/templates/design/_gitignore +7 -0
- package/corpus/templates/design/actions/apply-visual-edit.ts +22 -12
- package/corpus/templates/design/actions/create-design-system.ts +15 -4
- package/corpus/templates/design/actions/create-file.ts +20 -1
- package/corpus/templates/design/actions/delete-design-system.ts +2 -2
- package/corpus/templates/design/actions/duplicate-design.ts +35 -9
- package/corpus/templates/design/actions/generate-design.ts +146 -69
- package/corpus/templates/design/actions/generate-screens.ts +51 -19
- package/corpus/templates/design/actions/get-design-snapshot.ts +5 -1
- package/corpus/templates/design/actions/get-design.ts +2 -0
- package/corpus/templates/design/actions/import-design-project.ts +28 -9
- package/corpus/templates/design/actions/import-document.ts +22 -8
- package/corpus/templates/design/actions/index-design-system-with-builder.ts +6 -153
- package/corpus/templates/design/actions/navigate.ts +105 -54
- package/corpus/templates/design/actions/set-default-design-system.ts +17 -3
- package/corpus/templates/design/actions/show-design-questions.ts +2 -0
- package/corpus/templates/design/actions/update-design.ts +2 -1
- package/corpus/templates/design/actions/view-screen.ts +12 -6
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +4 -4
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +159 -41
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +8 -4
- package/corpus/templates/design/app/components/design/DrawOverlay.tsx +37 -42
- package/corpus/templates/design/app/components/design/EditPanel.tsx +336 -183
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +153 -34
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +135 -33
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +6 -0
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +2 -1
- package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +4 -10
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +84 -43
- package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +4 -4
- package/corpus/templates/design/app/components/design/inspector/{FigmaColorPicker.tsx → DesignColorPicker.tsx} +89 -62
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +14 -26
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +40 -12
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +13 -4
- package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +13 -13
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +13 -9
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +13 -4
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design/inspector/{figma-icons.tsx → design-icons.tsx} +2 -2
- package/corpus/templates/design/app/components/design/inspector/index.ts +12 -12
- package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +5 -2
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -3
- package/corpus/templates/design/app/components/layout/Layout.tsx +5 -2
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +167 -91
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +16 -3
- package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +15 -0
- package/corpus/templates/design/app/global.css +4 -0
- package/corpus/templates/design/app/hooks/use-design-system.ts +4 -1
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +38 -3
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +9 -2
- package/corpus/templates/design/app/i18n/zh-TW.ts +22 -0
- package/corpus/templates/design/app/i18n-data.ts +527 -0
- package/corpus/templates/design/app/lib/design-systems.ts +6 -4
- package/corpus/templates/design/app/lib/design-templates.ts +15 -3
- package/corpus/templates/design/app/pages/DesignEditor.tsx +641 -158
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +42 -34
- package/corpus/templates/design/app/pages/VisualEdit.tsx +100 -0
- package/corpus/templates/design/app/root.tsx +42 -9
- package/corpus/templates/design/app/routes/visual-edit.tsx +7 -0
- package/corpus/templates/design/changelog/2026-06-28-live-cursors-now-keep-names-beside-a-cleaner-pointer-marker.md +1 -1
- package/corpus/templates/design/changelog/2026-06-28-mode-switching-now-lives-in-a-compact-bottom-right-icon-dock.md +1 -1
- package/corpus/templates/design/changelog/2026-06-28-visual-code-design-mode.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-generation-prompts-now-show-connect-ai-before-sending.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-mode-top-chrome-now-groups-collaborators-preview-shar.md +1 -1
- package/corpus/templates/design/changelog/2026-06-29-fixed-design-editor-exports-and-gradient-edits-so-multi-scre.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-longer-hosted-agent-turns.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-png-export-handles-modern-css-color-functions-more-reliably.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-png-export-now-ignores-duplicate-clicks-while-a-download-is-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-public-visual-edit-and-shared-design-links-now-invite-visito.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-visual-edit-actions-now-reject-missing-design-targets-before.md +6 -0
- package/corpus/templates/design/e2e/README.md +71 -0
- package/corpus/templates/design/e2e/global-setup.ts +157 -0
- package/corpus/templates/design/e2e/helpers.ts +148 -0
- package/corpus/templates/design/netlify.toml +3 -4
- package/corpus/templates/design/package.json +5 -1
- package/corpus/templates/design/playwright.config.ts +51 -0
- package/corpus/templates/design/server/handlers/index-design-system-with-builder.ts +121 -0
- package/corpus/templates/design/server/handlers/uploads.ts +89 -38
- package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +181 -0
- package/corpus/templates/design/server/lib/coding-handoff.ts +33 -4
- package/corpus/templates/design/server/lib/design-export.ts +35 -8
- package/corpus/templates/design/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/design/server/plugins/auth.ts +10 -1
- package/corpus/templates/design/server/routes/api/index-design-system-with-builder.post.ts +1 -0
- package/corpus/templates/design/shared/api.ts +2 -0
- package/corpus/templates/design/shared/apply-edits.ts +12 -8
- package/corpus/templates/design/shared/canvas-math.ts +19 -1
- package/corpus/templates/design/shared/code-layer.ts +87 -28
- package/corpus/templates/design/shared/generation-session.ts +1 -0
- package/corpus/templates/design/shared/resolve-tweaks.ts +4 -3
- package/corpus/templates/design/shared/shader-presets.ts +10 -0
- package/corpus/templates/design/shared/source-mode.ts +9 -0
- package/corpus/templates/design/vitest.config.ts +2 -1
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +1 -1
- package/corpus/templates/plan/.agents/skills/visual-plan/references/canvas.md +1 -1
- package/corpus/templates/plan/.agents/skills/visual-plan/references/local-files.md +14 -5
- package/corpus/templates/plan/.agents/skills/visual-recap/references/local-files.md +14 -5
- package/corpus/templates/plan/AGENTS.md +1 -1
- package/corpus/templates/plan/actions/create-plan-design.ts +1 -1
- package/corpus/templates/plan/actions/validate-local-plan-source.ts +110 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +1 -0
- package/corpus/templates/plan/docs/commenting-ux-plan.md +2 -2
- package/corpus/templates/plan/server/lib/plan-connector-catalog.ts +1 -0
- package/corpus/templates/plan/server/lib/public-action-paths.ts +1 -0
- package/corpus/templates/plan/server/plan-content.ts +1 -1
- package/corpus/templates/plan/server/ui-plan-html.ts +2 -2
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +6 -153
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +53 -38
- package/corpus/templates/slides/app/components/design-system/{fig-import-response.ts → builder-index-response.ts} +9 -6
- package/corpus/templates/slides/app/components/visual-editor/MultiSelectChip.tsx +1 -1
- package/corpus/templates/slides/changelog/2026-06-29-design-system-setup-now-indexes-uploaded-design-files-throug.md +6 -0
- package/corpus/templates/slides/changelog/2026-06-29-longer-hosted-agent-turns.md +6 -0
- package/corpus/templates/slides/netlify.toml +3 -6
- package/corpus/templates/slides/server/handlers/index-design-system-with-builder.ts +116 -0
- package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +179 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +4 -1
- package/corpus/templates/slides/server/routes/api/index-design-system-with-builder.post.ts +1 -0
- package/dist/action.d.ts +23 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +9 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/durable-background.d.ts +9 -7
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +27 -11
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/production-agent.d.ts +10 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +4 -1
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts +2 -1
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +2 -2
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/brand-kit/fig/index.d.ts +4 -4
- package/dist/brand-kit/fig/index.d.ts.map +1 -1
- package/dist/brand-kit/fig/index.js +14 -27
- package/dist/brand-kit/fig/index.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-config-writers.d.ts +15 -7
- package/dist/cli/mcp-config-writers.d.ts.map +1 -1
- package/dist/cli/mcp-config-writers.js +198 -45
- package/dist/cli/mcp-config-writers.js.map +1 -1
- package/dist/cli/plan-local.d.ts +30 -0
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +281 -56
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/skills.d.ts +2 -2
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +32 -8
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +11 -1
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +15 -2
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/composer/PromptComposer.d.ts.map +1 -1
- package/dist/client/composer/PromptComposer.js +35 -1
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/org/OrgSwitcher.js +1 -1
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +1 -1
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +2 -15
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/collab/presence.d.ts +1 -1
- package/dist/collab/presence.js +1 -1
- package/dist/collab/presence.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/mcp/connect-route.d.ts.map +1 -1
- package/dist/mcp/connect-route.js +34 -5
- package/dist/mcp/connect-route.js.map +1 -1
- package/dist/observability/routes.d.ts +2 -2
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +5 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +14 -0
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +6 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +12 -3
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +12 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/locales/ar-SA/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/ar-SA/template-design.mdx +1 -1
- package/docs/content/locales/de-DE/real-time-collaboration.mdx +3 -3
- package/docs/content/locales/de-DE/template-design.mdx +1 -1
- package/docs/content/locales/es-ES/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/es-ES/template-design.mdx +1 -1
- package/docs/content/locales/fr-FR/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/fr-FR/template-design.mdx +1 -1
- package/docs/content/locales/hi-IN/template-design.mdx +1 -1
- package/docs/content/locales/ja-JP/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/ja-JP/template-design.mdx +1 -1
- package/docs/content/locales/ko-KR/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/ko-KR/template-design.mdx +1 -1
- package/docs/content/locales/pt-BR/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/pt-BR/template-design.mdx +1 -1
- package/docs/content/locales/zh-CN/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/zh-CN/template-design.mdx +1 -1
- package/docs/content/locales/zh-TW/real-time-collaboration.mdx +2 -2
- package/docs/content/locales/zh-TW/template-design.mdx +1 -1
- package/docs/content/real-time-collaboration.mdx +2 -2
- package/docs/content/template-design.mdx +1 -1
- package/package.json +3 -7
- package/corpus/core/src/brand-kit/fig/decode.ts +0 -410
- package/corpus/core/src/brand-kit/fig/extract-design-system.ts +0 -947
- package/corpus/core/src/brand-kit/fig/fig-to-html.ts +0 -1906
- package/corpus/templates/design/actions/import-figma.ts +0 -55
- package/corpus/templates/design/changelog/2026-06-28-figma-style-code-design-mode.md +0 -6
- package/corpus/templates/design/server/handlers/import-figma-system.ts +0 -86
- package/corpus/templates/design/server/routes/api/import-figma-system.post.ts +0 -1
- package/corpus/templates/slides/server/handlers/import-figma-system.ts +0 -101
- package/corpus/templates/slides/server/routes/api/import-figma-system.post.ts +0 -1
- package/dist/brand-kit/fig/decode.d.ts +0 -33
- package/dist/brand-kit/fig/decode.d.ts.map +0 -1
- package/dist/brand-kit/fig/decode.js +0 -358
- package/dist/brand-kit/fig/decode.js.map +0 -1
- package/dist/brand-kit/fig/extract-design-system.d.ts +0 -44
- package/dist/brand-kit/fig/extract-design-system.d.ts.map +0 -1
- package/dist/brand-kit/fig/extract-design-system.js +0 -752
- package/dist/brand-kit/fig/extract-design-system.js.map +0 -1
- package/dist/brand-kit/fig/fig-to-html.d.ts +0 -246
- package/dist/brand-kit/fig/fig-to-html.d.ts.map +0 -1
- package/dist/brand-kit/fig/fig-to-html.js +0 -1506
- package/dist/brand-kit/fig/fig-to-html.js.map +0 -1
|
@@ -867,6 +867,10 @@ Todas as mudanças visíveis para usuários do Clips são documentadas aqui. Voc
|
|
|
867
867
|
replyingTo: "Respondendo a",
|
|
868
868
|
commentAt: "Comentário em",
|
|
869
869
|
writeReply: "Escreva uma resposta...",
|
|
870
|
+
commentButton: "Comentar",
|
|
871
|
+
composerPlaceholder: "Adicionar um comentário…",
|
|
872
|
+
mentionSomeone: "Mencionar alguém",
|
|
873
|
+
addEmoji: "Adicionar emoji",
|
|
870
874
|
},
|
|
871
875
|
shareMeeting: {
|
|
872
876
|
pageTitle: "Notas da reunião · Clips",
|
|
@@ -817,6 +817,10 @@ Clips 中所有面向用户的重要更改都会记录在这里。你可以随
|
|
|
817
817
|
replyingTo: "正在回复",
|
|
818
818
|
commentAt: "评论于",
|
|
819
819
|
writeReply: "写回复...",
|
|
820
|
+
commentButton: "评论",
|
|
821
|
+
composerPlaceholder: "添加评论…",
|
|
822
|
+
mentionSomeone: "提及某人",
|
|
823
|
+
addEmoji: "添加表情",
|
|
820
824
|
},
|
|
821
825
|
shareMeeting: {
|
|
822
826
|
pageTitle: "会议笔记 · Clips",
|
|
@@ -810,6 +810,10 @@ const messages = {
|
|
|
810
810
|
replyingTo: "正在回覆",
|
|
811
811
|
commentAt: "評論於",
|
|
812
812
|
writeReply: "寫回覆...",
|
|
813
|
+
commentButton: "留言",
|
|
814
|
+
composerPlaceholder: "新增留言…",
|
|
815
|
+
mentionSomeone: "提及某人",
|
|
816
|
+
addEmoji: "新增表情符號",
|
|
813
817
|
},
|
|
814
818
|
shareMeeting: {
|
|
815
819
|
pageTitle: "會議筆記 · Clips",
|
|
@@ -44,6 +44,10 @@ import { InsightsPanel } from "@/components/player/insights-panel";
|
|
|
44
44
|
import { ReactionsTray } from "@/components/player/reactions-tray";
|
|
45
45
|
import { SettingsPanel } from "@/components/player/settings-panel";
|
|
46
46
|
import { ShareRecordingPopover } from "@/components/player/share-dialog";
|
|
47
|
+
import {
|
|
48
|
+
TimestampedCommentButton,
|
|
49
|
+
TimestampedCommentBar,
|
|
50
|
+
} from "@/components/player/timestamped-comment-button";
|
|
47
51
|
import { TranscriptPanel } from "@/components/player/transcript-panel";
|
|
48
52
|
import {
|
|
49
53
|
VideoPlayer,
|
|
@@ -210,7 +214,25 @@ export default function RecordingPage() {
|
|
|
210
214
|
const [theaterMode, setTheaterMode] = useState(false);
|
|
211
215
|
const [editing, setEditing] = useState(false);
|
|
212
216
|
const [currentMs, setCurrentMs] = useState(0);
|
|
217
|
+
const [commentOpen, setCommentOpen] = useState(false);
|
|
218
|
+
const [commentAtMs, setCommentAtMs] = useState(0);
|
|
213
219
|
const isCompactLayout = useIsCompactRecordingLayout();
|
|
220
|
+
// Resolve the playback position for reactions/comments. Native <video> exposes
|
|
221
|
+
// a live `currentTime`; Loom embeds render in a cross-origin iframe with no
|
|
222
|
+
// live time bridge, so we fall back to the last position the player reported
|
|
223
|
+
// via onTimeUpdate (seek/initial start).
|
|
224
|
+
const resolvePlaybackMs = useCallback(() => {
|
|
225
|
+
const liveCt = playerRef.current?.video?.currentTime;
|
|
226
|
+
if (
|
|
227
|
+
typeof liveCt === "number" &&
|
|
228
|
+
Number.isFinite(liveCt) &&
|
|
229
|
+
liveCt >= 0 &&
|
|
230
|
+
liveCt < 1e7
|
|
231
|
+
) {
|
|
232
|
+
return Math.floor(liveCt * 1000);
|
|
233
|
+
}
|
|
234
|
+
return currentMs;
|
|
235
|
+
}, [currentMs]);
|
|
214
236
|
const transcriptKickedRef = useRef<string | null>(null);
|
|
215
237
|
// When the recording lands in the processing state but never flips to
|
|
216
238
|
// 'ready', stop spinning forever and surface an error banner so the user
|
|
@@ -1082,7 +1104,7 @@ export default function RecordingPage() {
|
|
|
1082
1104
|
<EditorLayout recordingId={recording.id} className="flex-1" />
|
|
1083
1105
|
) : (
|
|
1084
1106
|
<>
|
|
1085
|
-
<div className="flex-1 min-h-0">
|
|
1107
|
+
<div className="flex-1 min-h-0 relative">
|
|
1086
1108
|
<VideoPlayer
|
|
1087
1109
|
ref={playerRef}
|
|
1088
1110
|
recordingId={recording.id}
|
|
@@ -1107,6 +1129,18 @@ export default function RecordingPage() {
|
|
|
1107
1129
|
onTimeUpdate={(ms) => setCurrentMs(ms)}
|
|
1108
1130
|
className="h-full"
|
|
1109
1131
|
/>
|
|
1132
|
+
{commentOpen ? (
|
|
1133
|
+
<TimestampedCommentBar
|
|
1134
|
+
recordingId={recording.id}
|
|
1135
|
+
atMs={commentAtMs}
|
|
1136
|
+
onClose={() => setCommentOpen(false)}
|
|
1137
|
+
onAdded={() => {
|
|
1138
|
+
setPanel("comments");
|
|
1139
|
+
if (isCompactLayout) setSidePanelOpen(true);
|
|
1140
|
+
void playerDataQ.refetch();
|
|
1141
|
+
}}
|
|
1142
|
+
/>
|
|
1143
|
+
) : null}
|
|
1110
1144
|
</div>
|
|
1111
1145
|
|
|
1112
1146
|
{/* Title + reactions row */}
|
|
@@ -1129,15 +1163,12 @@ export default function RecordingPage() {
|
|
|
1129
1163
|
</span>
|
|
1130
1164
|
</NavLink>
|
|
1131
1165
|
) : null}
|
|
1132
|
-
<
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
className="text-base font-semibold"
|
|
1139
|
-
inputClassName="h-8 text-base font-semibold"
|
|
1140
|
-
skeletonClassName="h-5 w-72 max-w-full"
|
|
1166
|
+
<TimestampedCommentButton
|
|
1167
|
+
enableComments={recording.enableComments}
|
|
1168
|
+
onOpen={() => {
|
|
1169
|
+
setCommentAtMs(resolvePlaybackMs());
|
|
1170
|
+
setCommentOpen(true);
|
|
1171
|
+
}}
|
|
1141
1172
|
/>
|
|
1142
1173
|
{recording.description ? (
|
|
1143
1174
|
<p className="text-sm text-muted-foreground line-clamp-2">
|
|
@@ -1150,14 +1181,7 @@ export default function RecordingPage() {
|
|
|
1150
1181
|
disabled={!recording.enableReactions}
|
|
1151
1182
|
onReact={(emoji) => {
|
|
1152
1183
|
tracking.reportReaction(emoji);
|
|
1153
|
-
const
|
|
1154
|
-
const liveMs =
|
|
1155
|
-
typeof liveCt === "number" &&
|
|
1156
|
-
Number.isFinite(liveCt) &&
|
|
1157
|
-
liveCt >= 0 &&
|
|
1158
|
-
liveCt < 1e7
|
|
1159
|
-
? Math.floor(liveCt * 1000)
|
|
1160
|
-
: currentMs;
|
|
1184
|
+
const liveMs = resolvePlaybackMs();
|
|
1161
1185
|
fetch(
|
|
1162
1186
|
agentNativePath(
|
|
1163
1187
|
"/_agent-native/actions/react-to-recording",
|
|
@@ -195,6 +195,18 @@ Content has two file workflows:
|
|
|
195
195
|
`select` fields; selecting the component in the editor shows a corner edit
|
|
196
196
|
button that rewrites the MDX props. JSX expression props are preserved in
|
|
197
197
|
source but shown as an unsupported preview.
|
|
198
|
+
- **Reusable MDX references:** local-file MDX can embed another local document
|
|
199
|
+
with `<ContentReference sourcePath="./shared/example.mdx" />`. The editor
|
|
200
|
+
resolves `sourcePath` relative to the current file, previews the referenced
|
|
201
|
+
MDX read-only in place, and preserves the original tag in source. Use this for
|
|
202
|
+
reusable docs fragments instead of copy/pasting shared content.
|
|
203
|
+
- **Builder Symbols:** Builder MDX pulls preserve Symbol blocks as
|
|
204
|
+
`<BuilderSymbol ... />`. When Builder returns enriched symbol content, the
|
|
205
|
+
pull also writes a referenced `.builder.mdx` file under
|
|
206
|
+
`content/builder/symbols/` and sets the Symbol block's `source` attribute.
|
|
207
|
+
Edit reusable symbol content in that emitted source file; do not retarget
|
|
208
|
+
`entry`, `model`, or `source` in the parent MDX unless a dedicated Builder
|
|
209
|
+
retargeting workflow is added.
|
|
198
210
|
- **Picked folders and components:** browser-picked folders can be the
|
|
199
211
|
source of truth for `.md`/`.mdx` files, but the browser does not expose an
|
|
200
212
|
absolute path that Vite can compile. Component previews from a picked
|
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
} from "@tabler/icons-react";
|
|
27
27
|
import { useState } from "react";
|
|
28
28
|
|
|
29
|
+
import { ContentReferencePreview } from "@/components/editor/ContentReferencePreview";
|
|
30
|
+
|
|
29
31
|
function SidecarBadge({ rawRef }: { rawRef: string }) {
|
|
30
32
|
return (
|
|
31
33
|
<div className="mt-2 truncate text-[11px] text-muted-foreground">
|
|
@@ -180,7 +182,15 @@ export function BuilderSymbolRead({
|
|
|
180
182
|
</div>
|
|
181
183
|
<div className="mt-1 text-xs text-muted-foreground">
|
|
182
184
|
{data.model || "model unknown"} / {data.entry || "entry unknown"}
|
|
185
|
+
{data.dynamic ? " / dynamic" : ""}
|
|
183
186
|
</div>
|
|
187
|
+
{data.source ? (
|
|
188
|
+
<ContentReferencePreview
|
|
189
|
+
sourcePath={data.source}
|
|
190
|
+
title="Symbol source"
|
|
191
|
+
className="mb-0"
|
|
192
|
+
/>
|
|
193
|
+
) : null}
|
|
184
194
|
<SidecarBadge rawRef={data.rawRef} />
|
|
185
195
|
</section>
|
|
186
196
|
);
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { useT } from "@agent-native/core/client";
|
|
2
|
+
import { IconExternalLink, IconFileText } from "@tabler/icons-react";
|
|
3
|
+
import { lazy, Suspense, useMemo } from "react";
|
|
4
|
+
import { useNavigate } from "react-router";
|
|
5
|
+
|
|
6
|
+
import { Button } from "@/components/ui/button";
|
|
7
|
+
import { useDocument, useDocuments } from "@/hooks/use-documents";
|
|
8
|
+
import { cn } from "@/lib/utils";
|
|
9
|
+
|
|
10
|
+
const ReadonlyReferenceEditor = lazy(async () => {
|
|
11
|
+
const module = await import("./VisualEditor");
|
|
12
|
+
return { default: module.VisualEditor };
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const MAX_CONTENT_REFERENCE_PREVIEW_DEPTH = 1;
|
|
16
|
+
|
|
17
|
+
function trimSlashes(path: string) {
|
|
18
|
+
return path.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function dirname(path: string) {
|
|
22
|
+
const normalized = trimSlashes(path);
|
|
23
|
+
const index = normalized.lastIndexOf("/");
|
|
24
|
+
return index >= 0 ? normalized.slice(0, index) : "";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function normalizePathParts(path: string) {
|
|
28
|
+
const parts: string[] = [];
|
|
29
|
+
for (const part of path.split("/")) {
|
|
30
|
+
if (!part || part === ".") continue;
|
|
31
|
+
if (part === "..") {
|
|
32
|
+
if (parts.length === 0) return null;
|
|
33
|
+
parts.pop();
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
parts.push(part);
|
|
37
|
+
}
|
|
38
|
+
return parts.join("/");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function resolveContentReferencePath(
|
|
42
|
+
sourcePath: string | null | undefined,
|
|
43
|
+
currentPath?: string | null,
|
|
44
|
+
) {
|
|
45
|
+
if (typeof sourcePath !== "string" || !sourcePath.trim()) return null;
|
|
46
|
+
const normalized = sourcePath.replace(/\\/g, "/").trim();
|
|
47
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(normalized)) return null;
|
|
48
|
+
const base =
|
|
49
|
+
normalized.startsWith("./") || normalized.startsWith("../")
|
|
50
|
+
? dirname(currentPath ?? "")
|
|
51
|
+
: "";
|
|
52
|
+
return normalizePathParts(base ? `${base}/${normalized}` : normalized);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function ContentReferencePreview({
|
|
56
|
+
sourcePath,
|
|
57
|
+
currentPath,
|
|
58
|
+
title,
|
|
59
|
+
className,
|
|
60
|
+
referenceDepth = 0,
|
|
61
|
+
}: {
|
|
62
|
+
sourcePath?: string | null;
|
|
63
|
+
currentPath?: string | null;
|
|
64
|
+
title?: string | null;
|
|
65
|
+
className?: string;
|
|
66
|
+
referenceDepth?: number;
|
|
67
|
+
}) {
|
|
68
|
+
const t = useT();
|
|
69
|
+
const navigate = useNavigate();
|
|
70
|
+
const documentsQuery = useDocuments();
|
|
71
|
+
const resolvedPath = useMemo(
|
|
72
|
+
() => resolveContentReferencePath(sourcePath, currentPath),
|
|
73
|
+
[currentPath, sourcePath],
|
|
74
|
+
);
|
|
75
|
+
const document = useMemo(() => {
|
|
76
|
+
if (!resolvedPath) return null;
|
|
77
|
+
return (documentsQuery.data ?? []).find(
|
|
78
|
+
(candidate) =>
|
|
79
|
+
candidate.source?.mode === "local-files" &&
|
|
80
|
+
trimSlashes(candidate.source.path ?? "") === resolvedPath,
|
|
81
|
+
);
|
|
82
|
+
}, [documentsQuery.data, resolvedPath]);
|
|
83
|
+
const documentQuery = useDocument(document?.id ?? null);
|
|
84
|
+
const body = documentQuery.data?.content ?? "";
|
|
85
|
+
const displayTitle =
|
|
86
|
+
title?.trim() ||
|
|
87
|
+
documentQuery.data?.title ||
|
|
88
|
+
document?.title ||
|
|
89
|
+
t("editor.reference.defaultTitle");
|
|
90
|
+
const isSelfReference =
|
|
91
|
+
!!resolvedPath &&
|
|
92
|
+
!!currentPath &&
|
|
93
|
+
resolvedPath === trimSlashes(currentPath);
|
|
94
|
+
const isNestedTooDeep = referenceDepth >= MAX_CONTENT_REFERENCE_PREVIEW_DEPTH;
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<section
|
|
98
|
+
className={cn(
|
|
99
|
+
"content-reference-preview my-4 rounded-md border border-dashed bg-muted/20 text-sm",
|
|
100
|
+
className,
|
|
101
|
+
)}
|
|
102
|
+
data-content-reference={resolvedPath ?? sourcePath ?? ""}
|
|
103
|
+
>
|
|
104
|
+
<div className="flex min-h-10 items-center gap-2 border-b px-3 py-2">
|
|
105
|
+
<IconFileText className="size-4 shrink-0 text-muted-foreground" />
|
|
106
|
+
<div className="min-w-0 flex-1">
|
|
107
|
+
<div className="truncate font-medium text-foreground">
|
|
108
|
+
{displayTitle}
|
|
109
|
+
</div>
|
|
110
|
+
<div className="truncate text-xs text-muted-foreground">
|
|
111
|
+
{resolvedPath ?? sourcePath ?? t("editor.reference.pathMissing")}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
{document ? (
|
|
115
|
+
<Button
|
|
116
|
+
type="button"
|
|
117
|
+
size="sm"
|
|
118
|
+
variant="ghost"
|
|
119
|
+
className="h-8 gap-1.5 px-2 text-xs"
|
|
120
|
+
onClick={() =>
|
|
121
|
+
navigate(`/page/${document.id}`, { flushSync: true })
|
|
122
|
+
}
|
|
123
|
+
>
|
|
124
|
+
<IconExternalLink className="size-3.5" />
|
|
125
|
+
{t("editor.reference.open")}
|
|
126
|
+
</Button>
|
|
127
|
+
) : null}
|
|
128
|
+
</div>
|
|
129
|
+
<div className="max-h-[520px] overflow-auto px-3 py-3">
|
|
130
|
+
{!resolvedPath ? (
|
|
131
|
+
<div className="text-sm text-muted-foreground">
|
|
132
|
+
{t("editor.reference.missingPath")}
|
|
133
|
+
</div>
|
|
134
|
+
) : isSelfReference ? (
|
|
135
|
+
<div className="text-sm text-muted-foreground">
|
|
136
|
+
{t("editor.reference.selfReference")}
|
|
137
|
+
</div>
|
|
138
|
+
) : documentsQuery.isLoading ? (
|
|
139
|
+
<div className="text-sm text-muted-foreground">
|
|
140
|
+
{t("editor.reference.loading")}
|
|
141
|
+
</div>
|
|
142
|
+
) : !document ? (
|
|
143
|
+
<div className="text-sm text-muted-foreground">
|
|
144
|
+
{t("editor.reference.notFound")}
|
|
145
|
+
</div>
|
|
146
|
+
) : documentQuery.isLoading ? (
|
|
147
|
+
<div className="text-sm text-muted-foreground">
|
|
148
|
+
{t("editor.reference.loading")}
|
|
149
|
+
</div>
|
|
150
|
+
) : documentQuery.isError ? (
|
|
151
|
+
<div className="text-sm text-muted-foreground">
|
|
152
|
+
{t("editor.reference.loadError")}
|
|
153
|
+
</div>
|
|
154
|
+
) : isNestedTooDeep ? (
|
|
155
|
+
<div className="text-sm text-muted-foreground">
|
|
156
|
+
{t("editor.reference.nestedSkipped")}
|
|
157
|
+
</div>
|
|
158
|
+
) : body.trim() ? (
|
|
159
|
+
<Suspense
|
|
160
|
+
fallback={
|
|
161
|
+
<div className="text-sm text-muted-foreground">
|
|
162
|
+
{t("editor.reference.loading")}
|
|
163
|
+
</div>
|
|
164
|
+
}
|
|
165
|
+
>
|
|
166
|
+
<ReadonlyReferenceEditor
|
|
167
|
+
key={document.id}
|
|
168
|
+
documentId={document.id}
|
|
169
|
+
content={body}
|
|
170
|
+
onChange={() => {}}
|
|
171
|
+
editable={false}
|
|
172
|
+
localFileMode
|
|
173
|
+
localFilePath={resolvedPath}
|
|
174
|
+
referenceDepth={referenceDepth + 1}
|
|
175
|
+
/>
|
|
176
|
+
</Suspense>
|
|
177
|
+
) : (
|
|
178
|
+
<div className="text-sm text-muted-foreground">
|
|
179
|
+
{t("editor.reference.empty")}
|
|
180
|
+
</div>
|
|
181
|
+
)}
|
|
182
|
+
</div>
|
|
183
|
+
</section>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
@@ -1162,6 +1162,9 @@ function DocumentEditorBody({ documentId, document }: DocumentEditorBodyProps) {
|
|
|
1162
1162
|
user={currentUser}
|
|
1163
1163
|
editable={canEdit}
|
|
1164
1164
|
localFileMode={isLocalFileDocument}
|
|
1165
|
+
localFilePath={
|
|
1166
|
+
isLocalFileDocument ? document.source?.path : null
|
|
1167
|
+
}
|
|
1165
1168
|
onComment={
|
|
1166
1169
|
canEdit && !isLocalFileDocument
|
|
1167
1170
|
? handleComment
|
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
commentHighlightKey,
|
|
53
53
|
type CommentHighlightSpec,
|
|
54
54
|
} from "./extensions/CommentHighlight";
|
|
55
|
+
import { ContentReferenceNode } from "./extensions/ContentReferenceNode";
|
|
55
56
|
import { DragHandle } from "./extensions/DragHandle";
|
|
56
57
|
import { ImageNode } from "./extensions/ImageNode";
|
|
57
58
|
import {
|
|
@@ -745,6 +746,10 @@ interface VisualEditorProps {
|
|
|
745
746
|
editable?: boolean;
|
|
746
747
|
/** Local-file docs should not persist mount-time/schema normalization echoes. */
|
|
747
748
|
localFileMode?: boolean;
|
|
749
|
+
/** Workspace-relative local artifact path for resolving inline references. */
|
|
750
|
+
localFilePath?: string | null;
|
|
751
|
+
/** Current nested local-file reference preview depth. */
|
|
752
|
+
referenceDepth?: number;
|
|
748
753
|
/** Called when user selects text and clicks "Comment" in bubble toolbar. */
|
|
749
754
|
onComment?: (
|
|
750
755
|
quotedText: string,
|
|
@@ -891,6 +896,8 @@ interface VisualEditorExtensionOptions {
|
|
|
891
896
|
onJoinTitle?: (text: string) => void;
|
|
892
897
|
resolveNotionPageLink?: (notionPageId: string) => NotionPageLink | null;
|
|
893
898
|
onOpenNotionPageLink?: (documentId: string) => void;
|
|
899
|
+
localFilePath?: string | null;
|
|
900
|
+
referenceDepth?: number;
|
|
894
901
|
}
|
|
895
902
|
|
|
896
903
|
function hasAncestorType(
|
|
@@ -1214,6 +1221,8 @@ export function createVisualEditorExtensions({
|
|
|
1214
1221
|
onJoinTitle,
|
|
1215
1222
|
resolveNotionPageLink,
|
|
1216
1223
|
onOpenNotionPageLink,
|
|
1224
|
+
localFilePath,
|
|
1225
|
+
referenceDepth = 0,
|
|
1217
1226
|
}: VisualEditorExtensionOptions = {}): Extensions {
|
|
1218
1227
|
// Build on the SHARED editor core (StarterKit base + the Collaboration /
|
|
1219
1228
|
// CollaborationCaret wiring + collab undo/redo gating + ordering), then inject
|
|
@@ -1298,6 +1307,10 @@ export function createVisualEditorExtensions({
|
|
|
1298
1307
|
// `VisualEditor` below. Mounted after the Notion nodes and before the
|
|
1299
1308
|
// Markdown extension so the NFM <-> doc round-trip recognizes the node.
|
|
1300
1309
|
RegistryBlockNode,
|
|
1310
|
+
ContentReferenceNode.configure({
|
|
1311
|
+
currentPath: localFilePath ?? null,
|
|
1312
|
+
referenceDepth,
|
|
1313
|
+
}),
|
|
1301
1314
|
LocalMdxComponentNode,
|
|
1302
1315
|
CommentHighlight,
|
|
1303
1316
|
DragHandle,
|
|
@@ -1568,6 +1581,8 @@ export function VisualEditor({
|
|
|
1568
1581
|
user,
|
|
1569
1582
|
editable = true,
|
|
1570
1583
|
localFileMode = false,
|
|
1584
|
+
localFilePath,
|
|
1585
|
+
referenceDepth,
|
|
1571
1586
|
onComment,
|
|
1572
1587
|
commentThreads,
|
|
1573
1588
|
activeThreadId,
|
|
@@ -1636,6 +1651,8 @@ export function VisualEditor({
|
|
|
1636
1651
|
onJoinTitle,
|
|
1637
1652
|
resolveNotionPageLink,
|
|
1638
1653
|
onOpenNotionPageLink,
|
|
1654
|
+
localFilePath,
|
|
1655
|
+
referenceDepth,
|
|
1639
1656
|
}),
|
|
1640
1657
|
[
|
|
1641
1658
|
documentId,
|
|
@@ -1648,6 +1665,8 @@ export function VisualEditor({
|
|
|
1648
1665
|
onJoinTitle,
|
|
1649
1666
|
resolveNotionPageLink,
|
|
1650
1667
|
onOpenNotionPageLink,
|
|
1668
|
+
localFilePath,
|
|
1669
|
+
referenceDepth,
|
|
1651
1670
|
],
|
|
1652
1671
|
);
|
|
1653
1672
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Node as TiptapNode,
|
|
3
|
+
NodeViewWrapper,
|
|
4
|
+
ReactNodeViewRenderer,
|
|
5
|
+
mergeAttributes,
|
|
6
|
+
type NodeViewProps,
|
|
7
|
+
} from "@tiptap/react";
|
|
8
|
+
|
|
9
|
+
import { ContentReferencePreview } from "../ContentReferencePreview";
|
|
10
|
+
|
|
11
|
+
function ContentReferenceView({ node, extension }: NodeViewProps) {
|
|
12
|
+
const sourcePath =
|
|
13
|
+
typeof node.attrs.sourcePath === "string" ? node.attrs.sourcePath : null;
|
|
14
|
+
const title = typeof node.attrs.title === "string" ? node.attrs.title : null;
|
|
15
|
+
const currentPath =
|
|
16
|
+
typeof extension.options.currentPath === "string"
|
|
17
|
+
? extension.options.currentPath
|
|
18
|
+
: null;
|
|
19
|
+
const referenceDepth =
|
|
20
|
+
typeof extension.options.referenceDepth === "number"
|
|
21
|
+
? extension.options.referenceDepth
|
|
22
|
+
: 0;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<NodeViewWrapper
|
|
26
|
+
className="my-4"
|
|
27
|
+
contentEditable={false}
|
|
28
|
+
data-content-reference={sourcePath ?? ""}
|
|
29
|
+
>
|
|
30
|
+
<ContentReferencePreview
|
|
31
|
+
sourcePath={sourcePath}
|
|
32
|
+
currentPath={currentPath}
|
|
33
|
+
title={title}
|
|
34
|
+
referenceDepth={referenceDepth}
|
|
35
|
+
/>
|
|
36
|
+
</NodeViewWrapper>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const ContentReferenceNode = TiptapNode.create<{
|
|
41
|
+
currentPath?: string | null;
|
|
42
|
+
referenceDepth?: number;
|
|
43
|
+
}>({
|
|
44
|
+
name: "contentReference",
|
|
45
|
+
group: "block",
|
|
46
|
+
atom: true,
|
|
47
|
+
selectable: true,
|
|
48
|
+
draggable: true,
|
|
49
|
+
|
|
50
|
+
addOptions() {
|
|
51
|
+
return {
|
|
52
|
+
currentPath: null,
|
|
53
|
+
referenceDepth: 0,
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
addAttributes() {
|
|
58
|
+
return {
|
|
59
|
+
sourcePath: { default: "" },
|
|
60
|
+
title: { default: null },
|
|
61
|
+
__raw: { default: "" },
|
|
62
|
+
indent: { default: 0 },
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
parseHTML() {
|
|
67
|
+
return [{ tag: "div[data-content-reference]" }];
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
renderHTML({ HTMLAttributes }) {
|
|
71
|
+
return [
|
|
72
|
+
"div",
|
|
73
|
+
mergeAttributes(HTMLAttributes, {
|
|
74
|
+
"data-content-reference": HTMLAttributes.sourcePath,
|
|
75
|
+
}),
|
|
76
|
+
];
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
addNodeView() {
|
|
80
|
+
return ReactNodeViewRenderer(ContentReferenceView);
|
|
81
|
+
},
|
|
82
|
+
});
|
|
@@ -305,6 +305,15 @@
|
|
|
305
305
|
min-height: 6rem;
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
+
.content-reference-preview .visual-editor-wrapper,
|
|
309
|
+
.content-reference-preview .visual-editor-wrapper .notion-editor {
|
|
310
|
+
min-height: 0;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.content-reference-preview .notion-editor {
|
|
314
|
+
font-size: 0.875rem;
|
|
315
|
+
}
|
|
316
|
+
|
|
308
317
|
.notion-editor > *:first-child {
|
|
309
318
|
margin-top: 0;
|
|
310
319
|
}
|
|
@@ -142,6 +142,18 @@ const messages = {
|
|
|
142
142
|
"還原會替所有人取代目前內容,且無法復原。不過目前狀態會先儲存為一個版本。",
|
|
143
143
|
versionRestored: "版本已還原。",
|
|
144
144
|
versionSavedAutomatically: "編輯時會自動儲存版本。",
|
|
145
|
+
reference: {
|
|
146
|
+
defaultTitle: "引用",
|
|
147
|
+
empty: "引用的文件是空的。",
|
|
148
|
+
loadError: "無法載入引用的文件。",
|
|
149
|
+
loading: "正在載入引用...",
|
|
150
|
+
missingPath: "引用路徑缺失或不受支援。",
|
|
151
|
+
nestedSkipped: "已略過巢狀引用預覽。",
|
|
152
|
+
notFound: "找不到引用的文件。",
|
|
153
|
+
open: "開啟",
|
|
154
|
+
pathMissing: "引用路徑缺失",
|
|
155
|
+
selfReference: "此引用指向目前文件。",
|
|
156
|
+
},
|
|
145
157
|
media: {
|
|
146
158
|
addAltTextDescription: "新增替代文字來描述該圖片。",
|
|
147
159
|
addAudio: "新增音訊",
|