@agent-native/core 0.80.8 → 0.80.9
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 +12 -0
- package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +6 -0
- package/corpus/core/docs/content/locales/de-DE/template-design.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/template-design.mdx +10 -2
- package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +10 -2
- package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +9 -2
- package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +6 -0
- package/corpus/core/docs/content/template-design.mdx +9 -2
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/mcp.ts +10 -0
- package/corpus/core/src/cli/skills.ts +58 -12
- package/corpus/core/src/client/error-format.ts +25 -0
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +13 -11
- package/corpus/core/src/client/guided-questions.tsx +32 -4
- package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +33 -1
- package/corpus/core/src/client/resources/BuiltinCapabilityDetail.tsx +8 -0
- package/corpus/core/src/client/resources/use-builtin-capabilities.ts +4 -2
- package/corpus/core/src/client/session-replay.ts +34 -0
- package/corpus/core/src/client/sharing/ShareButton.tsx +106 -21
- package/corpus/core/src/coding-tools/index.ts +1 -1
- package/corpus/core/src/mcp/index.ts +2 -0
- package/corpus/core/src/mcp/screen-memory-stdio.ts +290 -0
- package/corpus/core/src/mcp-client/builtin-capabilities.ts +13 -1
- package/corpus/core/src/mcp-client/index.ts +9 -0
- package/corpus/core/src/mcp-client/screen-memory-local.ts +461 -0
- package/corpus/core/src/onboarding/types.ts +7 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +25 -0
- package/corpus/core/src/server/agents-bundle.ts +35 -7
- package/corpus/core/src/styles/agent-native.css +5 -0
- package/corpus/core/src/templates/default/app/global.css +35 -35
- package/corpus/templates/analytics/AGENTS.md +6 -0
- package/corpus/templates/analytics/actions/github-repo-files.ts +9 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +4 -4
- package/corpus/templates/analytics/app/global.css +144 -40
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +4 -4
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +9 -9
- package/corpus/templates/analytics/changelog/2026-06-29-agents-can-search-and-read-connected-github-repositories-whe.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-29-sessions-and-explorer-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
- package/corpus/templates/assets/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +1 -1
- package/corpus/templates/assets/app/global.css +99 -35
- package/corpus/templates/assets/app/routes/asset.$id.tsx +2 -2
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +4 -4
- package/corpus/templates/assets/app/routes/library.tsx +4 -4
- package/corpus/templates/assets/changelog/2026-06-29-asset-library-and-detail-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/brain/app/global.css +63 -35
- package/corpus/templates/brain/app/routes/search.tsx +1 -1
- package/corpus/templates/brain/app/routes/settings.tsx +1 -1
- package/corpus/templates/brain/app/routes/sources.tsx +2 -2
- package/corpus/templates/brain/changelog/2026-06-29-search-settings-and-source-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +4 -4
- package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +3 -2
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +4 -2
- package/corpus/templates/calendar/app/global.css +69 -35
- package/corpus/templates/calendar/changelog/2026-06-29-event-and-find-time-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/chat/app/global.css +35 -35
- package/corpus/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/clips/AGENTS.md +13 -0
- package/corpus/templates/clips/actions/get-screen-memory-status.ts +12 -0
- package/corpus/templates/clips/actions/query-screen-memory-context.ts +29 -0
- package/corpus/templates/clips/actions/view-screen.ts +2 -2
- package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
- package/corpus/templates/clips/app/global.css +47 -35
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +3 -3
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +45 -18
- package/corpus/templates/clips/changelog/2026-06-29-meeting-detail-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-29-screen-memory-keeps-a-local-rolling-screen-buffer-for-agent-context.md +5 -0
- package/corpus/templates/clips/changelog/2026-06-29-video-chat-is-easier-to-find-on-recording-pages-and-s3-setup.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/styles.css +39 -39
- package/corpus/templates/clips/desktop/src/app.tsx +290 -1
- package/corpus/templates/clips/desktop/src/shared/config.ts +83 -0
- package/corpus/templates/clips/desktop/src/styles.css +67 -52
- package/corpus/templates/clips/desktop/src-tauri/src/config.rs +50 -0
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +17 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +13 -13
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +990 -0
- package/corpus/templates/clips/server/plugins/onboarding.ts +2 -0
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +3 -3
- package/corpus/templates/content/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/content/app/global.css +29 -15
- package/corpus/templates/content/changelog/2026-06-29-database-gallery-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +25 -20
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +8 -0
- package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +8 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +13 -0
- package/corpus/templates/design/AGENTS.md +20 -12
- package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1054 -0
- package/corpus/templates/design/actions/apply-visual-edit.ts +24 -4
- package/corpus/templates/design/actions/export-coding-handoff.ts +12 -4
- package/corpus/templates/design/actions/generate-design.ts +6 -21
- package/corpus/templates/design/actions/generate-screens.ts +43 -2
- package/corpus/templates/design/actions/get-design.ts +1 -0
- package/corpus/templates/design/actions/present-design-variants.ts +355 -30
- package/corpus/templates/design/actions/view-screen.ts +75 -31
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +329 -69
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +1 -1
- package/corpus/templates/design/app/components/design/EditPanel.tsx +479 -77
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +380 -216
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1050 -196
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +83 -206
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +1 -1
- package/corpus/templates/design/app/components/design/index.ts +0 -1
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +225 -133
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +122 -11
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +24 -5
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +57 -1
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +37 -12
- package/corpus/templates/design/app/components/design/inspector/index.ts +1 -0
- package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +12 -5
- package/corpus/templates/design/app/components/design/types.ts +9 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +23 -5
- package/corpus/templates/design/app/global.css +77 -49
- package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +8 -1
- package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +45 -3
- package/corpus/templates/design/app/pages/DesignEditor.tsx +2602 -657
- package/corpus/templates/design/app/root.tsx +1 -1
- package/corpus/templates/design/changelog/2026-06-29-containers-no-longer-block-selecting-nested-elements-and-nor.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-agents-now-generate-and-refine-variants-from-stronger.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-inspector-controls-now-match-figmas-softer-dark-chrome.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-questions-now-appear-as-a-cleaner-canvas-intake-with-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-variant-directions-now-appear-as-board-screens-with-chat-buttons.md +5 -0
- package/corpus/templates/design/changelog/2026-06-29-element-selection-no-longer-snaps-back-to-the-previous-layer.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-frame-resize-measurements-now-stay-beside-the-cursor-while-d.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-inspector-number-fields-have-cleaner-tooltips-and-draggable-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-locking-layer-nesting-generated-question-intake-and-im.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-names-in-the-sidebar-can-scroll-horizontally-instead-o.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-nesting-in-the-sidebar-now-uses-tighter-spacing-so-nam.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layers-no-longer-repeat-document-wrapper-rows-when-a-screen-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-overview-previews-now-keep-element-hover-and-selection-tied-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-pressing-escape-now-cancels-a-stuck-screen-drag-in-the-overv.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-is-easier-to-find-and-named-screens-open-dir.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-only-highlights-screens-when-the-frame-or-ti.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-previews-now-resize-to-match-the-selected-de.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-now-uses-a-pointer-cursor-instead-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-outlines-now-stay-locked-to-the-se.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zoom-now-reports-real-screen-scale-separatel.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-feels-smoother-and-selection-outline.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-now-stays-on-the-overview-canvas-ins.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-selecting-a-nested-layer-from-all-screens-now-keeps-you-in-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-share-now-groups-link-sharing-exports-and-agent-handoff.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-design-editor-loading-skeleton-now-uses-a-softer-charcoa.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-device-preview-menu-now-sits-next-to-the-preview-button-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-inspector-stays-read-only-while-an-empty-design-is-still.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-missing-design-view-now-matches-the-rest-of-the-editor-c.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-pen-tool-icon-and-tool-option-menus-better-match-the-edi.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-typography-controls-now-keep-the-font-name-visible-and-move-.md +6 -0
- package/corpus/templates/design/e2e/README.md +3 -3
- package/corpus/templates/design/e2e/global-setup.ts +11 -22
- package/corpus/templates/design/e2e/helpers.ts +122 -11
- package/corpus/templates/design/playwright.config.ts +9 -3
- package/corpus/templates/design/server/lib/coding-handoff.ts +126 -2
- package/corpus/templates/design/server/plugins/core-routes.ts +1 -2
- package/corpus/templates/design/server/routes/api/design-handoff/[id].zip.get.ts +86 -0
- package/corpus/templates/design/shared/code-layer.ts +125 -22
- package/corpus/templates/design/shared/generation-session.ts +41 -0
- package/corpus/templates/dispatch/app/global.css +79 -35
- package/corpus/templates/dispatch/app/routes/integrations.tsx +8 -7
- package/corpus/templates/dispatch/changelog/2026-06-29-integration-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/forms/app/components/layout/Layout.tsx +6 -2
- package/corpus/templates/forms/app/global.css +64 -35
- package/corpus/templates/forms/app/pages/FormsListPage.tsx +2 -2
- package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +3 -3
- package/corpus/templates/forms/changelog/2026-06-29-form-list-and-insight-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +3 -1
- package/corpus/templates/macros/app/global.css +25 -9
- package/corpus/templates/macros/changelog/2026-06-29-macro-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -2
- package/corpus/templates/mail/app/global.css +42 -36
- package/corpus/templates/mail/app/pages/InboxPage.tsx +1 -1
- package/corpus/templates/mail/changelog/2026-06-29-the-contact-panel-now-adapts-to-the-available-mail-pane-width.md +6 -0
- package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +6 -7
- package/corpus/templates/plan/app/global.css +74 -42
- package/corpus/templates/plan/changelog/2026-06-29-plan-document-blocks-adapt-to-the-available-document-width.md +6 -0
- package/corpus/templates/plan/changelog/2026-06-29-plan-titles-and-summaries-can-be-edited-inline-without-focus.md +6 -0
- package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/slides/app/global.css +49 -33
- package/corpus/templates/slides/changelog/2026-06-29-slide-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/videos/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/videos/app/global.css +35 -35
- package/corpus/templates/videos/changelog/2026-06-29-video-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +10 -0
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +58 -12
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +17 -0
- package/dist/client/error-format.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +3 -4
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/guided-questions.d.ts +4 -0
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +16 -7
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/onboarding/OnboardingPanel.js +26 -1
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.d.ts.map +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.js +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.js.map +1 -1
- package/dist/client/resources/use-builtin-capabilities.d.ts +1 -1
- package/dist/client/resources/use-builtin-capabilities.d.ts.map +1 -1
- package/dist/client/resources/use-builtin-capabilities.js +2 -1
- package/dist/client/resources/use-builtin-capabilities.js.map +1 -1
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +31 -0
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +14 -0
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +36 -7
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/coding-tools/index.js +1 -1
- package/dist/coding-tools/index.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/index.d.ts +2 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +6 -0
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -0
- package/dist/mcp/screen-memory-stdio.js +213 -0
- package/dist/mcp/screen-memory-stdio.js.map +1 -0
- package/dist/mcp-client/builtin-capabilities.d.ts +1 -1
- package/dist/mcp-client/builtin-capabilities.d.ts.map +1 -1
- package/dist/mcp-client/builtin-capabilities.js +10 -0
- package/dist/mcp-client/builtin-capabilities.js.map +1 -1
- package/dist/mcp-client/index.d.ts +1 -0
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +1 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/screen-memory-local.d.ts +61 -0
- package/dist/mcp-client/screen-memory-local.d.ts.map +1 -0
- package/dist/mcp-client/screen-memory-local.js +336 -0
- package/dist/mcp-client/screen-memory-local.js.map +1 -0
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +8 -8
- package/dist/onboarding/types.d.ts +7 -0
- package/dist/onboarding/types.d.ts.map +1 -1
- package/dist/onboarding/types.js.map +1 -1
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +26 -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/agents-bundle.d.ts.map +1 -1
- package/dist/server/agents-bundle.js +22 -7
- package/dist/server/agents-bundle.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/styles/agent-native.css +5 -0
- package/dist/templates/default/app/global.css +35 -35
- package/docs/content/locales/ar-SA/template-design.mdx +6 -0
- package/docs/content/locales/de-DE/template-design.mdx +8 -0
- package/docs/content/locales/es-ES/template-design.mdx +10 -2
- package/docs/content/locales/fr-FR/template-design.mdx +10 -2
- package/docs/content/locales/hi-IN/template-design.mdx +7 -0
- package/docs/content/locales/ja-JP/template-design.mdx +7 -0
- package/docs/content/locales/ko-KR/template-design.mdx +7 -0
- package/docs/content/locales/pt-BR/template-design.mdx +9 -2
- package/docs/content/locales/zh-CN/template-design.mdx +6 -0
- package/docs/content/locales/zh-TW/template-design.mdx +6 -0
- package/docs/content/template-design.mdx +9 -2
- package/package.json +1 -1
- package/src/templates/default/app/global.css +35 -35
- package/corpus/templates/design/app/components/design/VariantGrid.tsx +0 -189
- package/corpus/templates/design/app/components/design/VariantHandoffCard.tsx +0 -115
- package/corpus/templates/design/app/hooks/use-variant-flow.ts +0 -342
|
@@ -9,18 +9,10 @@ import {
|
|
|
9
9
|
type GuidedQuestionOption,
|
|
10
10
|
} from "@agent-native/core/client";
|
|
11
11
|
import type { QuestionFlowQuestion } from "@shared/api";
|
|
12
|
-
import {
|
|
13
|
-
IconCheck,
|
|
14
|
-
IconChevronRight,
|
|
15
|
-
IconPalette,
|
|
16
|
-
IconSparkles,
|
|
17
|
-
IconUpload,
|
|
18
|
-
IconX,
|
|
19
|
-
} from "@tabler/icons-react";
|
|
12
|
+
import { IconCheck, IconPalette, IconUpload, IconX } from "@tabler/icons-react";
|
|
20
13
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
21
14
|
|
|
22
15
|
import { Button } from "@/components/ui/button";
|
|
23
|
-
import { Progress } from "@/components/ui/progress";
|
|
24
16
|
import { Slider } from "@/components/ui/slider";
|
|
25
17
|
import { Textarea } from "@/components/ui/textarea";
|
|
26
18
|
import { cn } from "@/lib/utils";
|
|
@@ -78,188 +70,77 @@ export function QuestionFlow({
|
|
|
78
70
|
: Math.round((answeredCount / guidedQuestions.length) * 100);
|
|
79
71
|
|
|
80
72
|
return (
|
|
81
|
-
<div className="flex h-full w-full
|
|
82
|
-
<
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
{description ?? t("questionFlow.defaultDescription")}
|
|
94
|
-
</p>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<div className="mt-5">
|
|
99
|
-
<div className="mb-2 flex items-center justify-between text-xs text-muted-foreground">
|
|
100
|
-
<span>
|
|
101
|
-
{t("questionFlow.answeredCount", {
|
|
102
|
-
answered: answeredCount,
|
|
103
|
-
total: guidedQuestions.length,
|
|
104
|
-
})}
|
|
105
|
-
</span>
|
|
106
|
-
{requiredQuestions.length > 0 && (
|
|
107
|
-
<span>
|
|
108
|
-
{t("questionFlow.requiredCount", {
|
|
109
|
-
answered: requiredAnswered,
|
|
110
|
-
total: requiredQuestions.length,
|
|
111
|
-
})}
|
|
112
|
-
</span>
|
|
113
|
-
)}
|
|
114
|
-
</div>
|
|
115
|
-
<Progress value={progress} className="h-1.5 bg-muted" />
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<ol className="mt-5 hidden min-h-0 flex-1 overflow-y-auto pe-1 lg:block">
|
|
119
|
-
{guidedQuestions.map((question, index) => {
|
|
120
|
-
const answered = hasGuidedAnswer(answers[question.id]);
|
|
121
|
-
return (
|
|
122
|
-
<li
|
|
123
|
-
key={question.id}
|
|
124
|
-
className={cn(
|
|
125
|
-
"mb-2 flex items-start gap-2 rounded-md border px-2.5 py-2 text-xs",
|
|
126
|
-
answered
|
|
127
|
-
? "border-primary/25 bg-primary/5 text-foreground"
|
|
128
|
-
: "border-transparent bg-background/45 text-muted-foreground",
|
|
129
|
-
)}
|
|
130
|
-
>
|
|
131
|
-
<span
|
|
132
|
-
className={cn(
|
|
133
|
-
"mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border text-[10px]",
|
|
134
|
-
answered
|
|
135
|
-
? "border-primary bg-primary text-primary-foreground"
|
|
136
|
-
: "border-border bg-muted text-muted-foreground",
|
|
137
|
-
)}
|
|
138
|
-
>
|
|
139
|
-
{answered ? <IconCheck className="size-3" /> : index + 1}
|
|
140
|
-
</span>
|
|
141
|
-
<span className="line-clamp-2">
|
|
142
|
-
{question.header ?? question.question}
|
|
143
|
-
</span>
|
|
144
|
-
</li>
|
|
145
|
-
);
|
|
146
|
-
})}
|
|
147
|
-
</ol>
|
|
148
|
-
|
|
149
|
-
<div className="mt-4 hidden rounded-md border border-border bg-background/60 p-3 text-xs leading-5 text-muted-foreground lg:block">
|
|
150
|
-
{t("questionFlow.multiSelectHelp")}
|
|
151
|
-
</div>
|
|
152
|
-
</aside>
|
|
153
|
-
|
|
154
|
-
<main className="flex min-h-0 flex-col">
|
|
155
|
-
<div className="min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6 sm:py-6">
|
|
156
|
-
<div className="grid gap-3 xl:grid-cols-2">
|
|
157
|
-
{guidedQuestions.map((question, index) => (
|
|
158
|
-
<QuestionCard
|
|
159
|
-
key={question.id}
|
|
160
|
-
index={index}
|
|
161
|
-
question={question}
|
|
162
|
-
value={answers[question.id]}
|
|
163
|
-
onChange={(value) => setAnswer(question.id, value)}
|
|
164
|
-
/>
|
|
165
|
-
))}
|
|
166
|
-
</div>
|
|
167
|
-
</div>
|
|
73
|
+
<div className="flex h-full w-full justify-center overflow-y-auto bg-transparent px-6 py-10 text-foreground sm:px-10 lg:px-14">
|
|
74
|
+
<main className="w-full max-w-4xl pb-10">
|
|
75
|
+
<div className="mb-9">
|
|
76
|
+
<h2 className="text-3xl font-semibold tracking-normal text-foreground sm:text-4xl">
|
|
77
|
+
{title ?? t("questionFlow.defaultTitle")}
|
|
78
|
+
</h2>
|
|
79
|
+
{description ? (
|
|
80
|
+
<p className="mt-3 max-w-2xl text-sm leading-6 text-muted-foreground">
|
|
81
|
+
{description}
|
|
82
|
+
</p>
|
|
83
|
+
) : null}
|
|
84
|
+
</div>
|
|
168
85
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
86
|
+
<div className="space-y-10">
|
|
87
|
+
{guidedQuestions.map((question) => (
|
|
88
|
+
<QuestionCard
|
|
89
|
+
key={question.id}
|
|
90
|
+
question={question}
|
|
91
|
+
value={answers[question.id]}
|
|
92
|
+
onChange={(value) => setAnswer(question.id, value)}
|
|
93
|
+
/>
|
|
94
|
+
))}
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div className="mt-10 flex flex-wrap items-center gap-3">
|
|
98
|
+
<Button
|
|
99
|
+
type="button"
|
|
100
|
+
size="sm"
|
|
101
|
+
onClick={() => onSubmit(normalizeGuidedAnswers(answers))}
|
|
102
|
+
disabled={!allRequiredAnswered}
|
|
103
|
+
className="cursor-pointer"
|
|
104
|
+
>
|
|
105
|
+
{submitLabel ?? t("questionFlow.continue")}
|
|
106
|
+
</Button>
|
|
107
|
+
<Button
|
|
108
|
+
type="button"
|
|
109
|
+
variant="ghost"
|
|
110
|
+
size="sm"
|
|
111
|
+
onClick={onSkip}
|
|
112
|
+
className="cursor-pointer"
|
|
113
|
+
>
|
|
114
|
+
{skipLabel ?? t("questionFlow.skip")}
|
|
115
|
+
</Button>
|
|
116
|
+
</div>
|
|
117
|
+
</main>
|
|
199
118
|
</div>
|
|
200
119
|
);
|
|
201
120
|
}
|
|
202
121
|
|
|
203
122
|
function QuestionCard({
|
|
204
|
-
index,
|
|
205
123
|
question,
|
|
206
124
|
value,
|
|
207
125
|
onChange,
|
|
208
126
|
}: {
|
|
209
|
-
index: number;
|
|
210
127
|
question: GuidedQuestion;
|
|
211
128
|
value: unknown;
|
|
212
129
|
onChange: (value: unknown) => void;
|
|
213
130
|
}) {
|
|
214
131
|
const t = useT();
|
|
215
|
-
const answered = hasGuidedAnswer(value);
|
|
216
|
-
const guidance = question.multiSelect
|
|
217
|
-
? t("questionFlow.chooseAny")
|
|
218
|
-
: t("questionFlow.chooseOne");
|
|
219
132
|
|
|
220
133
|
return (
|
|
221
|
-
<section
|
|
222
|
-
className=
|
|
223
|
-
"
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
answered
|
|
232
|
-
? "border-primary bg-primary text-primary-foreground"
|
|
233
|
-
: "border-border bg-muted text-muted-foreground",
|
|
234
|
-
)}
|
|
235
|
-
>
|
|
236
|
-
{answered ? <IconCheck className="size-4" /> : index + 1}
|
|
237
|
-
</div>
|
|
238
|
-
<div className="min-w-0 flex-1">
|
|
239
|
-
<div className="mb-1 flex flex-wrap items-center gap-1.5">
|
|
240
|
-
{question.header && (
|
|
241
|
-
<p className="text-[11px] font-medium uppercase text-muted-foreground">
|
|
242
|
-
{question.header}
|
|
243
|
-
</p>
|
|
244
|
-
)}
|
|
245
|
-
<span className="rounded-full border border-border bg-muted/40 px-2 py-0.5 text-[10px] font-medium text-muted-foreground">
|
|
246
|
-
{guidance}
|
|
247
|
-
</span>
|
|
248
|
-
{question.required && (
|
|
249
|
-
<span className="rounded-full border border-destructive/25 bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive">
|
|
250
|
-
{t("questionFlow.required")}
|
|
251
|
-
</span>
|
|
252
|
-
)}
|
|
253
|
-
</div>
|
|
254
|
-
<h3 className="text-sm font-semibold leading-5 text-foreground">
|
|
255
|
-
{question.question}
|
|
256
|
-
</h3>
|
|
257
|
-
{question.description && (
|
|
258
|
-
<p className="mt-1 text-xs leading-5 text-muted-foreground">
|
|
259
|
-
{question.description}
|
|
260
|
-
</p>
|
|
261
|
-
)}
|
|
262
|
-
</div>
|
|
134
|
+
<section className="min-w-0">
|
|
135
|
+
<div className="mb-3">
|
|
136
|
+
<h3 className="text-lg font-semibold leading-6 text-foreground">
|
|
137
|
+
{question.question}
|
|
138
|
+
</h3>
|
|
139
|
+
{question.description && (
|
|
140
|
+
<p className="mt-1 max-w-2xl text-sm leading-5 text-muted-foreground">
|
|
141
|
+
{question.description}
|
|
142
|
+
</p>
|
|
143
|
+
)}
|
|
263
144
|
</div>
|
|
264
145
|
|
|
265
146
|
{question.type === "text-options" && (
|
|
@@ -281,7 +162,7 @@ function QuestionCard({
|
|
|
281
162
|
placeholder={
|
|
282
163
|
question.placeholder ?? t("questionFlow.textPlaceholder")
|
|
283
164
|
}
|
|
284
|
-
className="min-h-[92px] resize-none bg-
|
|
165
|
+
className="min-h-[92px] resize-none bg-transparent text-sm shadow-none"
|
|
285
166
|
/>
|
|
286
167
|
)}
|
|
287
168
|
</section>
|
|
@@ -316,7 +197,7 @@ function TextOptions({
|
|
|
316
197
|
const compact = options.every(
|
|
317
198
|
(option) =>
|
|
318
199
|
// i18n-ignore scanner false positive
|
|
319
|
-
!option.
|
|
200
|
+
!option.preview && option.label.length <= 32, // i18n-ignore scanner false positive
|
|
320
201
|
);
|
|
321
202
|
|
|
322
203
|
const isSelected = (optionValue: string) =>
|
|
@@ -360,7 +241,7 @@ function TextOptions({
|
|
|
360
241
|
return (
|
|
361
242
|
<div className="space-y-3">
|
|
362
243
|
{multiSelect && (
|
|
363
|
-
<p className="
|
|
244
|
+
<p className="sr-only">
|
|
364
245
|
{selectedCount > 0
|
|
365
246
|
? t("questionFlow.selectedCount", { count: selectedCount })
|
|
366
247
|
: t("questionFlow.selectUseful")}
|
|
@@ -368,8 +249,8 @@ function TextOptions({
|
|
|
368
249
|
)}
|
|
369
250
|
<div
|
|
370
251
|
className={cn(
|
|
371
|
-
"
|
|
372
|
-
compact ? "
|
|
252
|
+
"flex flex-wrap gap-2",
|
|
253
|
+
compact ? "max-w-3xl" : "max-w-4xl",
|
|
373
254
|
)}
|
|
374
255
|
>
|
|
375
256
|
{options.map((option) => (
|
|
@@ -406,7 +287,7 @@ function TextOptions({
|
|
|
406
287
|
placeholder={
|
|
407
288
|
question.placeholder ?? t("questionFlow.customPlaceholder")
|
|
408
289
|
}
|
|
409
|
-
className="min-h-[72px] resize-none bg-
|
|
290
|
+
className="min-h-[72px] max-w-xl resize-none bg-transparent text-sm shadow-none"
|
|
410
291
|
/>
|
|
411
292
|
)}
|
|
412
293
|
</div>
|
|
@@ -433,20 +314,20 @@ function OptionButton({
|
|
|
433
314
|
onClick={onClick}
|
|
434
315
|
aria-pressed={selected}
|
|
435
316
|
className={cn(
|
|
436
|
-
"group flex min-w-0 cursor-pointer items-
|
|
437
|
-
compact ? "
|
|
317
|
+
"group inline-flex min-w-0 max-w-full cursor-pointer items-center gap-2 rounded-full border text-start transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
318
|
+
compact ? "px-3 py-2" : "px-4 py-2.5",
|
|
438
319
|
selected
|
|
439
|
-
? "border-
|
|
440
|
-
: "border-border bg-
|
|
320
|
+
? "border-foreground bg-foreground text-background"
|
|
321
|
+
: "border-border bg-background/35 text-foreground hover:border-muted-foreground hover:bg-background/70",
|
|
441
322
|
)}
|
|
442
323
|
>
|
|
443
324
|
<span
|
|
444
325
|
className={cn(
|
|
445
|
-
"
|
|
326
|
+
"flex size-4 shrink-0 items-center justify-center border",
|
|
446
327
|
multiSelect ? "rounded-sm" : "rounded-full",
|
|
447
328
|
selected
|
|
448
|
-
? "border-
|
|
449
|
-
: "border-
|
|
329
|
+
? "border-background bg-background text-foreground"
|
|
330
|
+
: "border-muted-foreground/40 bg-transparent",
|
|
450
331
|
)}
|
|
451
332
|
aria-hidden
|
|
452
333
|
>
|
|
@@ -454,17 +335,15 @@ function OptionButton({
|
|
|
454
335
|
</span>
|
|
455
336
|
<span className="min-w-0 flex-1">
|
|
456
337
|
<span className="flex min-w-0 flex-wrap items-center gap-1.5 text-sm font-medium leading-5">
|
|
457
|
-
<span className="truncate">{option.label}</span>
|
|
338
|
+
<span className="min-w-0 truncate">{option.label}</span>
|
|
458
339
|
{option.recommended && (
|
|
459
|
-
<span className="rounded-full bg-
|
|
340
|
+
<span className="rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground">
|
|
460
341
|
{t("questionFlow.recommended")}
|
|
461
342
|
</span>
|
|
462
343
|
)}
|
|
463
344
|
</span>
|
|
464
345
|
{option.description && (
|
|
465
|
-
<span className="
|
|
466
|
-
{option.description}
|
|
467
|
-
</span>
|
|
346
|
+
<span className="sr-only">{option.description}</span>
|
|
468
347
|
)}
|
|
469
348
|
{option.preview && (
|
|
470
349
|
<span className="mt-2 block max-h-36 overflow-auto whitespace-pre-wrap rounded-md border border-border/60 bg-background/70 px-2 py-1.5 font-mono text-[11px] leading-4 text-muted-foreground">
|
|
@@ -504,7 +383,7 @@ function ColorOptions({
|
|
|
504
383
|
};
|
|
505
384
|
|
|
506
385
|
return (
|
|
507
|
-
<div className="
|
|
386
|
+
<div className="flex max-w-4xl flex-wrap gap-2">
|
|
508
387
|
{options.map((option) => {
|
|
509
388
|
const selected = isSelected(option.value);
|
|
510
389
|
return (
|
|
@@ -514,26 +393,24 @@ function ColorOptions({
|
|
|
514
393
|
onClick={() => toggleOption(option.value)}
|
|
515
394
|
aria-pressed={selected}
|
|
516
395
|
className={cn(
|
|
517
|
-
"group flex min-w-0 cursor-pointer items-center gap-2 rounded-
|
|
396
|
+
"group inline-flex min-w-0 max-w-full cursor-pointer items-center gap-2 rounded-full border px-3 py-2 text-start transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
518
397
|
selected
|
|
519
|
-
? "border-
|
|
520
|
-
: "border-border bg-
|
|
398
|
+
? "border-foreground bg-foreground text-background"
|
|
399
|
+
: "border-border bg-background/35 text-foreground hover:border-muted-foreground hover:bg-background/70",
|
|
521
400
|
)}
|
|
522
401
|
>
|
|
523
402
|
<span
|
|
524
403
|
className={cn(
|
|
525
|
-
"size-
|
|
404
|
+
"size-6 shrink-0 rounded-full border border-border",
|
|
526
405
|
selected &&
|
|
527
|
-
"ring-2 ring-
|
|
406
|
+
"ring-2 ring-background/70 ring-offset-1 ring-offset-foreground",
|
|
528
407
|
)}
|
|
529
408
|
style={{ backgroundColor: option.color || option.value }}
|
|
530
409
|
/>
|
|
531
|
-
<span className="min-w-0 flex-1 truncate text-
|
|
410
|
+
<span className="min-w-0 flex-1 truncate text-sm font-medium">
|
|
532
411
|
{option.label}
|
|
533
412
|
</span>
|
|
534
|
-
{selected &&
|
|
535
|
-
<IconPalette className="size-3.5 shrink-0 text-primary" />
|
|
536
|
-
)}
|
|
413
|
+
{selected && <IconPalette className="size-3.5 shrink-0" />}
|
|
537
414
|
</button>
|
|
538
415
|
);
|
|
539
416
|
})}
|
|
@@ -561,10 +438,10 @@ function SliderQuestion({
|
|
|
561
438
|
// display-only midpoint fallback for the rendered slider position.
|
|
562
439
|
|
|
563
440
|
return (
|
|
564
|
-
<div className="
|
|
441
|
+
<div className="max-w-xl px-1 py-2">
|
|
565
442
|
<div className="mb-3 flex items-center justify-between text-xs text-muted-foreground">
|
|
566
443
|
<span>{min}</span>
|
|
567
|
-
<span className="
|
|
444
|
+
<span className="font-medium tabular-nums text-foreground">
|
|
568
445
|
{current}
|
|
569
446
|
</span>
|
|
570
447
|
<span>{max}</span>
|
|
@@ -609,10 +486,10 @@ function FileDropZone({
|
|
|
609
486
|
addFiles(Array.from(event.dataTransfer.files));
|
|
610
487
|
}}
|
|
611
488
|
className={cn(
|
|
612
|
-
"flex cursor-pointer flex-col items-center justify-center rounded-md border
|
|
489
|
+
"flex max-w-xl cursor-pointer flex-col items-center justify-center rounded-md border border-dashed p-5 transition-colors",
|
|
613
490
|
dragOver
|
|
614
491
|
? "border-primary bg-primary/5"
|
|
615
|
-
: "border-border bg-
|
|
492
|
+
: "border-border bg-transparent hover:border-muted-foreground/50",
|
|
616
493
|
)}
|
|
617
494
|
>
|
|
618
495
|
<IconUpload className="mb-2 size-5 text-muted-foreground" />
|
|
@@ -66,7 +66,7 @@ export function TweaksPanelContent({
|
|
|
66
66
|
type="button"
|
|
67
67
|
variant="outline"
|
|
68
68
|
size="sm"
|
|
69
|
-
className="h-6 cursor-pointer px-2.5 text-[11px]"
|
|
69
|
+
className="h-6 cursor-pointer border-[var(--design-editor-control-border)] bg-[var(--design-editor-control-bg)] px-2.5 text-[11px] text-foreground shadow-none hover:bg-[var(--design-editor-panel-raised-bg)] hover:text-foreground focus-visible:ring-1 focus-visible:ring-[var(--design-editor-accent-color)] focus-visible:ring-offset-0"
|
|
70
70
|
onClick={(e) => onRequestTweaks(e.currentTarget)}
|
|
71
71
|
>
|
|
72
72
|
<IconPlus className="size-3" />
|
|
@@ -4,7 +4,6 @@ export { DrawOverlay } from "./DrawOverlay";
|
|
|
4
4
|
export { EditPanel } from "./EditPanel";
|
|
5
5
|
export { QuestionFlow } from "./QuestionFlow";
|
|
6
6
|
export { TweaksPanel } from "./TweaksPanel";
|
|
7
|
-
export { VariantGrid } from "./VariantGrid";
|
|
8
7
|
export type {
|
|
9
8
|
DrawAnnotation,
|
|
10
9
|
ElementInfo,
|