@agent-native/core 0.80.10 → 0.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +53 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +108 -15
- package/corpus/core/src/cli/design-connect.ts +419 -19
- package/corpus/core/src/client/AssistantChat.tsx +123 -26
- package/corpus/core/src/client/ConnectBuilderCard.tsx +1 -0
- package/corpus/core/src/client/chat/index.ts +1 -0
- package/corpus/core/src/client/chat/run-recovery.tsx +9 -7
- package/corpus/core/src/client/chat-view-transition.ts +33 -2
- package/corpus/core/src/client/composer/PromptComposer.tsx +21 -2
- package/corpus/core/src/client/index.ts +1 -0
- package/corpus/core/src/client/org/OrgSwitcher.tsx +26 -4
- package/corpus/core/src/client/sharing/ShareButton.tsx +3 -3
- package/corpus/core/src/client/sse-event-processor.ts +9 -0
- package/corpus/core/src/client/use-agent-chat-home-handoff.ts +31 -3
- package/corpus/core/src/db/client.ts +29 -2
- package/corpus/core/src/provider-api/index.ts +29 -0
- package/corpus/core/src/server/core-routes-plugin.ts +58 -20
- package/corpus/core/src/styles/agent-native.css +54 -0
- package/corpus/core/src/usage/store.ts +2 -2
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +118 -10
- package/corpus/templates/analytics/app/components/layout/layout-route-policy.ts +7 -0
- package/corpus/templates/analytics/app/global.css +8 -0
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +7 -1
- package/corpus/templates/analytics/app/lib/chat-handoff.ts +34 -0
- package/corpus/templates/analytics/app/pages/Ask.tsx +9 -18
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +2 -2
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +109 -21
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +4 -6
- package/corpus/templates/analytics/changelog/2026-06-30-ask-opens-a-fresh-chat-unless-you-were-just-chatting-and-das.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-30-dashboard-email-reports-are-more-reliable-and-use-cleaner.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-30-dashboard-toolbar-controls-use-a-quieter-share-button-and-ve.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-30-session-replay-rows-show-whole-minute-durations-in-the-playl.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-30-session-replays-now-render-captured-styling-and-keep-the-eve.md +6 -0
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +16 -3
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +31 -14
- package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +9 -2
- package/corpus/templates/assets/AGENTS.md +4 -0
- package/corpus/templates/assets/actions/_tool-activity.ts +46 -0
- package/corpus/templates/assets/actions/generate-image-batch.ts +26 -5
- package/corpus/templates/assets/actions/generate-image.ts +118 -67
- package/corpus/templates/assets/actions/list-draft-assets.ts +50 -0
- package/corpus/templates/assets/actions/open-asset-picker.ts +9 -0
- package/corpus/templates/assets/actions/rerun-generation-run.ts +52 -31
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +100 -0
- package/corpus/templates/assets/app/global.css +15 -0
- package/corpus/templates/assets/app/hooks/use-navigation-state.ts +4 -0
- package/corpus/templates/assets/app/i18n/zh-TW.ts +7 -0
- package/corpus/templates/assets/app/i18n-data.ts +61 -0
- package/corpus/templates/assets/app/routes/_index.tsx +4 -0
- package/corpus/templates/assets/app/routes/library.tsx +233 -52
- package/corpus/templates/assets/changelog/2026-06-29-image-generation-can-now-render-requested-text-and-respect-b.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-30-image-generation-no-longer-looks-stuck-while-the-provider-is-still-working.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-30-tagged-presets-now-control-the-image-aspect-ratio.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-30-the-assets-picker-now-supports-a-vertical-embedded-layout-fo.md +6 -0
- package/corpus/templates/assets/server/lib/generation.ts +135 -11
- package/corpus/templates/assets/shared/api.ts +4 -0
- package/corpus/templates/clips/actions/finalize-recording.ts +1 -12
- package/corpus/templates/clips/actions/list-ai-requests.ts +60 -0
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +24 -25
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +10 -5
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -8
- package/corpus/templates/clips/changelog/2026-06-30-extension-save-recovery-avoids-false-upload-failures.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-30-longer-chrome-extension-recordings-now-keep-saving-reliably-.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/chrome-extension/src/background.ts +19 -10
- package/corpus/templates/clips/chrome-extension/src/content-script.ts +38 -12
- package/corpus/templates/clips/chrome-extension/src/finalize-recovery.ts +224 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +119 -16
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +16 -0
- package/corpus/templates/clips/server/lib/recording-upload-state.ts +48 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +9 -1
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +63 -13
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/status.get.ts +74 -0
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +32 -0
- package/corpus/templates/design/AGENTS.md +27 -0
- package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1 -1
- package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +5 -5
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +76 -25
- package/corpus/templates/design/actions/apply-design-state.ts +17 -4
- package/corpus/templates/design/actions/apply-motion-edit.ts +76 -115
- package/corpus/templates/design/actions/apply-shader-fill.ts +148 -56
- package/corpus/templates/design/actions/capture-design-state.ts +27 -4
- package/corpus/templates/design/actions/connect-localhost.ts +59 -22
- package/corpus/templates/design/actions/delete-design.ts +20 -0
- package/corpus/templates/design/actions/export-zip.ts +23 -8
- package/corpus/templates/design/actions/generate-design.ts +53 -1
- package/corpus/templates/design/actions/get-component-details.ts +21 -26
- package/corpus/templates/design/actions/get-motion-timeline.ts +135 -10
- package/corpus/templates/design/actions/grant-localhost-write-consent.ts +116 -0
- package/corpus/templates/design/actions/import-design-tokens.ts +521 -0
- package/corpus/templates/design/actions/index-design-tokens.ts +18 -5
- package/corpus/templates/design/actions/insert-design-native-asset.ts +268 -0
- package/corpus/templates/design/actions/insert-figma-library-asset.ts +233 -0
- package/corpus/templates/design/actions/list-design-extensions.ts +32 -10
- package/corpus/templates/design/actions/list-design-native-assets.ts +105 -0
- package/corpus/templates/design/actions/list-design-states.ts +19 -1
- package/corpus/templates/design/actions/list-figma-library-assets.ts +292 -0
- package/corpus/templates/design/actions/migrate-board-objects-to-file.ts +238 -0
- package/corpus/templates/design/actions/navigate.ts +18 -3
- package/corpus/templates/design/actions/open-component-source.ts +7 -2
- package/corpus/templates/design/actions/preview-component-prop-edit.ts +32 -26
- package/corpus/templates/design/actions/preview-shader-fill.ts +9 -11
- package/corpus/templates/design/actions/provider-api-catalog.ts +2 -2
- package/corpus/templates/design/actions/provider-api-docs.ts +1 -1
- package/corpus/templates/design/actions/provider-api-request.ts +3 -3
- package/corpus/templates/design/actions/revoke-localhost-write-consent.ts +48 -0
- package/corpus/templates/design/actions/run-design-audit.ts +74 -10
- package/corpus/templates/design/actions/run-design-extension-action.ts +1 -1
- package/corpus/templates/design/actions/view-screen.ts +1 -1
- package/corpus/templates/design/actions/write-local-file.ts +213 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +244 -3197
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +30 -20
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +795 -289
- package/corpus/templates/design/app/components/design/EditPanel.tsx +635 -234
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +124 -32
- package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +161 -0
- package/corpus/templates/design/app/components/design/MotionDock.tsx +244 -266
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +491 -56
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +55 -67
- package/corpus/templates/design/app/components/design/StatesPanel.tsx +38 -63
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +264 -8
- package/corpus/templates/design/app/components/design/bridge/codegen.ts +125 -0
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +4037 -0
- package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +62 -0
- package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +272 -0
- package/corpus/templates/design/app/components/design/bridge/nav.bridge.ts +116 -0
- package/corpus/templates/design/app/components/design/bridge/sample.bridge.ts +24 -0
- package/corpus/templates/design/app/components/design/bridge/shader-fill-preview.bridge.ts +78 -0
- package/corpus/templates/design/app/components/design/bridge/tsconfig.json +17 -0
- package/corpus/templates/design/app/components/design/bridge/tweak.bridge.ts +28 -0
- package/corpus/templates/design/app/components/design/bridge/zoom.bridge.ts +43 -0
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +45 -16
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +88 -9
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +94 -9
- package/corpus/templates/design/app/components/layout/Layout.tsx +19 -3
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/design/app/global.css +7 -0
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +23 -0
- package/corpus/templates/design/app/i18n/zh-TW.ts +22 -0
- package/corpus/templates/design/app/i18n-data.ts +369 -0
- package/corpus/templates/design/app/lib/pending-generation.ts +1 -0
- package/corpus/templates/design/app/pages/DesignEditor.tsx +3024 -616
- package/corpus/templates/design/app/pages/Index.tsx +5 -1
- package/corpus/templates/design/changelog/2026-06-30-applying-the-one-click-fix-for-a-small-tap-target-accessibil.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-canvas-creation-screen-dragging-undo-redo-and-image-fill-edi.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-component-prop-edits-and-shader-fills-now-preserve-rapid-sam.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-can-browse-figma-library-components-and-insert-them-i.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-now-has-a-figma-style-left-rail-for-file-agent-assets.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-now-has-native-components-embedded-media-and-figma-im.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-preview-now-includes-a-publish-app-waitlist-option-fr.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-s-left-rail-now-matches-the-sidebar-chrome-and-uses-t.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-s-tools-create-menu-now-stays-compact-instead-of-rend.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-starter-prompts-now-begin-generating-immediately-and-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-token-edits-now-stay-visible-in-previews-and-token-li.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-tools-now-use-a-quieter-figma-style-list-layout.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-drawing-rectangles-on-the-all-screens-canvas-no-longer-flash.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-fixed-code-native-design-studio-edits-so-component-props-mot.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-fixed-visual-editing-hover-overlays-and-spacing-handles-so-s.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-motion-edits-now-save-automatically-without-a-separate-css-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-motion-timelines-now-reopen-as-editable-tracks-after-writing.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-new-design-prompts-with-uploaded-screenshots-work-reliably-o.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-screen-previews-in-all-screens-view-now-keep-rounded-outline.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-selection-outlines-now-sit-flush-on-rectangles-drawn-directl.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-share-options-use-a-tighter-design-editor-popover-with-compa.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-collapsed-motion-panel-now-stays-tucked-under-the-left-s.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-inspector-now-shows-states-and-review-in-a-tighte.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-sidebar-keeps-the-organization-picker-space-stable-while.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-tokens-can-now-be-imported-from-pasted-notes-code-files-fold.md +6 -0
- package/corpus/templates/design/e2e/global-setup.ts +94 -2
- package/corpus/templates/design/e2e/helpers.ts +168 -65
- package/corpus/templates/design/package.json +3 -1
- package/corpus/templates/design/server/db/schema.ts +23 -0
- package/corpus/templates/design/server/handlers/uploads.ts +22 -1
- package/corpus/templates/design/server/lib/provider-api.ts +7 -4
- package/corpus/templates/design/server/lib/verify-write-grant.ts +108 -0
- package/corpus/templates/design/server/plugins/db.ts +39 -0
- package/corpus/templates/design/server/register-secrets.ts +38 -0
- package/corpus/templates/design/shared/board-file.ts +228 -0
- package/corpus/templates/design/shared/board-objects.ts +288 -0
- package/corpus/templates/design/shared/code-layer.ts +52 -0
- package/corpus/templates/design/shared/component-model.ts +35 -0
- package/corpus/templates/design/shared/motion-compiler.ts +137 -15
- package/corpus/templates/design/shared/motion-timeline.ts +2 -2
- package/corpus/templates/design/shared/resolve-tweaks.ts +32 -9
- package/corpus/templates/design/tsconfig.json +2 -1
- package/corpus/templates/slides/AGENTS.md +9 -0
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +4 -0
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +4 -24
- package/corpus/templates/slides/app/lib/export-pdf-client.ts +29 -20
- package/corpus/templates/slides/app/lib/export-pptx-client.ts +365 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +12 -9
- package/corpus/templates/slides/app/vite-env.d.ts +18 -0
- package/corpus/templates/slides/changelog/2026-06-30-powerpoint-downloads-now-preserve-the-rendered-slide-layout-.md +6 -0
- package/corpus/templates/slides/changelog/2026-06-30-unavailable-decks-open-in-a-cleaner-full-height-centered-sta.md +6 -0
- package/corpus/templates/slides/package.json +1 -0
- package/corpus/templates/slides/vite.config.ts +1 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +94 -10
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/design-connect.d.ts +25 -0
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +357 -18
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +14 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +115 -22
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/ConnectBuilderCard.d.ts.map +1 -1
- package/dist/client/ConnectBuilderCard.js +1 -0
- package/dist/client/ConnectBuilderCard.js.map +1 -1
- package/dist/client/chat/index.d.ts +1 -1
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js +1 -1
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +5 -5
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/chat-view-transition.d.ts +6 -0
- package/dist/client/chat-view-transition.d.ts.map +1 -1
- package/dist/client/chat-view-transition.js +23 -2
- package/dist/client/chat-view-transition.js.map +1 -1
- package/dist/client/composer/PromptComposer.d.ts.map +1 -1
- package/dist/client/composer/PromptComposer.js +3 -2
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +11 -4
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/sharing/ShareButton.js +3 -3
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +10 -0
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.d.ts +8 -2
- package/dist/client/use-agent-chat-home-handoff.d.ts.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.js +20 -6
- package/dist/client/use-agent-chat-home-handoff.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 +2 -2
- package/dist/db/client.d.ts +1 -0
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +28 -2
- package/dist/db/client.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/index.d.ts +5 -4
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +28 -0
- package/dist/provider-api/index.js.map +1 -1
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/core-routes-plugin.d.ts +25 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +43 -18
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/styles/agent-native.css +54 -0
- package/dist/usage/store.js +2 -2
- package/dist/usage/store.js.map +1 -1
- package/package.json +1 -1
|
@@ -37,7 +37,6 @@ import { useState } from "react";
|
|
|
37
37
|
|
|
38
38
|
import { Badge } from "@/components/ui/badge";
|
|
39
39
|
import { Button } from "@/components/ui/button";
|
|
40
|
-
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
41
40
|
import { Separator } from "@/components/ui/separator";
|
|
42
41
|
import { cn } from "@/lib/utils";
|
|
43
42
|
|
|
@@ -63,6 +62,12 @@ export interface ReviewFixSource {
|
|
|
63
62
|
filename?: string;
|
|
64
63
|
}
|
|
65
64
|
|
|
65
|
+
export interface ReviewFixResult {
|
|
66
|
+
applied?: boolean;
|
|
67
|
+
fileId?: string;
|
|
68
|
+
patchedContent?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
/** Per-finding state for the optimistic Fix flow. */
|
|
67
72
|
type FixStatus = "idle" | "pending" | "fixed" | "error";
|
|
68
73
|
|
|
@@ -116,7 +121,7 @@ export interface ReviewPanelProps {
|
|
|
116
121
|
* Called after a fix is successfully applied — e.g. to refetch the audit so
|
|
117
122
|
* the resolved finding drops out of the list. The applied finding is passed.
|
|
118
123
|
*/
|
|
119
|
-
onFixApplied?: (finding: A11yFinding) => void;
|
|
124
|
+
onFixApplied?: (finding: A11yFinding, result?: ReviewFixResult) => void;
|
|
120
125
|
className?: string;
|
|
121
126
|
}
|
|
122
127
|
|
|
@@ -186,7 +191,7 @@ function FindingRow({
|
|
|
186
191
|
finding: A11yFinding;
|
|
187
192
|
onClick?: (finding: A11yFinding) => void;
|
|
188
193
|
fixSource?: ReviewFixSource;
|
|
189
|
-
onFixApplied?: (finding: A11yFinding) => void;
|
|
194
|
+
onFixApplied?: (finding: A11yFinding, result?: ReviewFixResult) => void;
|
|
190
195
|
}) {
|
|
191
196
|
const cfg = SEVERITY_CONFIG[finding.severity];
|
|
192
197
|
const Icon = cfg.icon;
|
|
@@ -213,6 +218,7 @@ function FindingRow({
|
|
|
213
218
|
designId: fixSource?.designId,
|
|
214
219
|
fileId: fixSource?.fileId,
|
|
215
220
|
filename: fixSource?.filename,
|
|
221
|
+
includeContent: true,
|
|
216
222
|
finding: {
|
|
217
223
|
id: finding.id,
|
|
218
224
|
severity: finding.severity,
|
|
@@ -224,10 +230,10 @@ function FindingRow({
|
|
|
224
230
|
wcag: finding.wcag,
|
|
225
231
|
fixAvailable: finding.fixAvailable,
|
|
226
232
|
},
|
|
227
|
-
})) as
|
|
233
|
+
})) as ReviewFixResult | undefined;
|
|
228
234
|
if (res?.applied) {
|
|
229
235
|
setFixStatus("fixed");
|
|
230
|
-
onFixApplied?.(finding);
|
|
236
|
+
onFixApplied?.(finding, res);
|
|
231
237
|
} else {
|
|
232
238
|
// The engine could not apply it (e.g. selector no longer resolves).
|
|
233
239
|
setFixStatus("error");
|
|
@@ -374,7 +380,7 @@ function A11ySection({
|
|
|
374
380
|
onRunAudit?: () => void;
|
|
375
381
|
onFindingClick?: (finding: A11yFinding) => void;
|
|
376
382
|
fixSource?: ReviewFixSource;
|
|
377
|
-
onFixApplied?: (finding: A11yFinding) => void;
|
|
383
|
+
onFixApplied?: (finding: A11yFinding, result?: ReviewFixResult) => void;
|
|
378
384
|
}) {
|
|
379
385
|
const errors = findings.filter((f) => f.severity === "error");
|
|
380
386
|
const warnings = findings.filter((f) => f.severity === "warning");
|
|
@@ -386,7 +392,7 @@ function A11ySection({
|
|
|
386
392
|
return (
|
|
387
393
|
<section aria-labelledby="review-a11y-heading">
|
|
388
394
|
{/* Section header */}
|
|
389
|
-
<div className="flex h-
|
|
395
|
+
<div className="flex h-7 items-center justify-between">
|
|
390
396
|
<div className="flex items-center gap-1.5">
|
|
391
397
|
<IconShieldCheck className="size-3.5 text-muted-foreground" />
|
|
392
398
|
<span
|
|
@@ -433,7 +439,7 @@ function A11ySection({
|
|
|
433
439
|
size="sm"
|
|
434
440
|
disabled={loading}
|
|
435
441
|
onClick={onRunAudit}
|
|
436
|
-
className="h-6 px-
|
|
442
|
+
className="h-6 gap-1 rounded-md px-1.5 text-[10px] text-muted-foreground hover:text-foreground"
|
|
437
443
|
>
|
|
438
444
|
{loading ? (
|
|
439
445
|
<IconRefresh className="size-3 animate-spin" />
|
|
@@ -445,12 +451,12 @@ function A11ySection({
|
|
|
445
451
|
)}
|
|
446
452
|
</div>
|
|
447
453
|
|
|
448
|
-
<Separator
|
|
454
|
+
<Separator />
|
|
449
455
|
|
|
450
|
-
<div className="
|
|
456
|
+
<div className="py-1">
|
|
451
457
|
{/* Error state */}
|
|
452
458
|
{auditError && (
|
|
453
|
-
<div className="flex items-center gap-2 rounded px-2
|
|
459
|
+
<div className="flex min-h-7 items-center gap-2 rounded-[5px] px-2">
|
|
454
460
|
<IconAlertCircle className="size-3.5 shrink-0 text-destructive" />
|
|
455
461
|
<span className="text-[11px] text-muted-foreground">
|
|
456
462
|
{auditError}
|
|
@@ -460,23 +466,15 @@ function A11ySection({
|
|
|
460
466
|
|
|
461
467
|
{/* Not yet run */}
|
|
462
468
|
{notRun && (
|
|
463
|
-
<div className="flex
|
|
464
|
-
<IconShieldCheck className="size-5
|
|
465
|
-
<
|
|
466
|
-
No audit has been run yet.
|
|
467
|
-
{onRunAudit && (
|
|
468
|
-
<>
|
|
469
|
-
{" "}
|
|
470
|
-
Click <strong>Run</strong> to scan this design.
|
|
471
|
-
</>
|
|
472
|
-
)}
|
|
473
|
-
</p>
|
|
469
|
+
<div className="flex h-7 items-center gap-2 rounded-[5px] px-2 text-muted-foreground/55">
|
|
470
|
+
<IconShieldCheck className="size-3.5 shrink-0" />
|
|
471
|
+
<span className="truncate text-[11px]">Audit not run</span>
|
|
474
472
|
</div>
|
|
475
473
|
)}
|
|
476
474
|
|
|
477
475
|
{/* Loading */}
|
|
478
476
|
{loading && !hasFindings && (
|
|
479
|
-
<div className="flex items-center gap-2 px-2
|
|
477
|
+
<div className="flex h-7 items-center gap-2 rounded-[5px] px-2">
|
|
480
478
|
<IconRefresh className="size-3.5 animate-spin text-muted-foreground/50" />
|
|
481
479
|
<span className="text-[11px] text-muted-foreground/60">
|
|
482
480
|
Scanning…
|
|
@@ -486,7 +484,7 @@ function A11ySection({
|
|
|
486
484
|
|
|
487
485
|
{/* All clear */}
|
|
488
486
|
{!loading && !auditError && !notRun && !hasFindings && (
|
|
489
|
-
<div className="flex items-center gap-2 px-2
|
|
487
|
+
<div className="flex h-7 items-center gap-2 rounded-[5px] px-2">
|
|
490
488
|
<IconCheck className="size-3.5 text-emerald-500" />
|
|
491
489
|
<span className="text-[11px] text-muted-foreground">
|
|
492
490
|
No issues found.
|
|
@@ -511,7 +509,7 @@ function A11ySection({
|
|
|
511
509
|
|
|
512
510
|
{/* Audit timestamp */}
|
|
513
511
|
{auditedAt && (
|
|
514
|
-
<p className="mt-1
|
|
512
|
+
<p className="mt-1 px-2 text-[10px] text-muted-foreground/40">
|
|
515
513
|
Last audited{" "}
|
|
516
514
|
{new Date(auditedAt).toLocaleString(undefined, {
|
|
517
515
|
dateStyle: "short",
|
|
@@ -544,7 +542,7 @@ function VersionLabel({
|
|
|
544
542
|
<select
|
|
545
543
|
value={value ?? ""}
|
|
546
544
|
onChange={(e) => onChange(e.target.value || null)}
|
|
547
|
-
className="h-6 max-w-[120px] flex-1 truncate rounded border border-border bg-
|
|
545
|
+
className="h-6 max-w-[120px] flex-1 truncate rounded-md border border-[var(--design-editor-control-border)] bg-[var(--design-editor-control-bg)] px-1.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-[var(--design-editor-accent-color)]"
|
|
548
546
|
aria-label={placeholder}
|
|
549
547
|
>
|
|
550
548
|
<option value="">{placeholder}</option>
|
|
@@ -560,7 +558,7 @@ function VersionLabel({
|
|
|
560
558
|
function DiffRow({ entry }: { entry: VisualDiffEntry }) {
|
|
561
559
|
const cfg = DIFF_KIND_CONFIG[entry.kind];
|
|
562
560
|
return (
|
|
563
|
-
<div className="flex items-center gap-2 rounded px-2
|
|
561
|
+
<div className="flex h-7 items-center gap-2 rounded-[5px] px-2 hover:bg-[var(--design-editor-layer-hover-color)]">
|
|
564
562
|
<Badge
|
|
565
563
|
variant="outline"
|
|
566
564
|
className={cn("h-4 shrink-0 px-1 text-[9px] font-medium", cfg.badge)}
|
|
@@ -597,7 +595,7 @@ function VisualDiffSection({
|
|
|
597
595
|
|
|
598
596
|
return (
|
|
599
597
|
<section aria-labelledby="review-diff-heading">
|
|
600
|
-
<div className="flex h-
|
|
598
|
+
<div className="flex h-7 items-center gap-1.5">
|
|
601
599
|
<IconArrowsLeftRight className="size-3.5 text-muted-foreground" />
|
|
602
600
|
<span
|
|
603
601
|
id="review-diff-heading"
|
|
@@ -615,9 +613,9 @@ function VisualDiffSection({
|
|
|
615
613
|
)}
|
|
616
614
|
</div>
|
|
617
615
|
|
|
618
|
-
<Separator
|
|
616
|
+
<Separator />
|
|
619
617
|
|
|
620
|
-
<div className="
|
|
618
|
+
<div className="space-y-1.5 py-1">
|
|
621
619
|
{/* Version selectors */}
|
|
622
620
|
{hasVersions && (
|
|
623
621
|
<div className="flex items-center gap-1.5">
|
|
@@ -642,7 +640,7 @@ function VisualDiffSection({
|
|
|
642
640
|
|
|
643
641
|
{/* States */}
|
|
644
642
|
{diffError && (
|
|
645
|
-
<div className="flex items-center gap-2">
|
|
643
|
+
<div className="flex h-7 items-center gap-2 rounded-[5px] px-2">
|
|
646
644
|
<IconAlertCircle className="size-3.5 shrink-0 text-destructive" />
|
|
647
645
|
<span className="text-[11px] text-muted-foreground">
|
|
648
646
|
{diffError}
|
|
@@ -651,7 +649,7 @@ function VisualDiffSection({
|
|
|
651
649
|
)}
|
|
652
650
|
|
|
653
651
|
{loading && (
|
|
654
|
-
<div className="flex items-center gap-2">
|
|
652
|
+
<div className="flex h-7 items-center gap-2 rounded-[5px] px-2">
|
|
655
653
|
<IconRefresh className="size-3.5 animate-spin text-muted-foreground/50" />
|
|
656
654
|
<span className="text-[11px] text-muted-foreground/60">
|
|
657
655
|
Comparing…
|
|
@@ -660,15 +658,13 @@ function VisualDiffSection({
|
|
|
660
658
|
)}
|
|
661
659
|
|
|
662
660
|
{!loading && !diffError && noVersionsSelected && !hasDiff && (
|
|
663
|
-
<
|
|
664
|
-
{hasVersions
|
|
665
|
-
|
|
666
|
-
: "No versions saved yet. Save a version to compare."}
|
|
667
|
-
</p>
|
|
661
|
+
<div className="flex h-7 items-center rounded-[5px] px-2 text-[11px] text-muted-foreground/55">
|
|
662
|
+
{hasVersions ? "Choose versions to diff" : "No versions yet"}
|
|
663
|
+
</div>
|
|
668
664
|
)}
|
|
669
665
|
|
|
670
666
|
{!loading && !diffError && !noVersionsSelected && !hasDiff && (
|
|
671
|
-
<div className="flex items-center gap-2">
|
|
667
|
+
<div className="flex h-7 items-center gap-2 rounded-[5px] px-2">
|
|
672
668
|
<IconCheck className="size-3.5 text-emerald-500" />
|
|
673
669
|
<span className="text-[11px] text-muted-foreground">
|
|
674
670
|
No structural changes detected.
|
|
@@ -723,37 +719,29 @@ export function ReviewPanel({
|
|
|
723
719
|
}: ReviewPanelProps) {
|
|
724
720
|
return (
|
|
725
721
|
<div
|
|
726
|
-
className={cn("flex flex-col
|
|
722
|
+
className={cn("flex flex-col gap-2 text-[11px]", className)}
|
|
727
723
|
data-testid="review-panel"
|
|
728
724
|
>
|
|
729
|
-
<
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
baseVersionId={baseVersionId}
|
|
750
|
-
compareVersionId={compareVersionId}
|
|
751
|
-
onVersionChange={onVersionChange}
|
|
752
|
-
loading={diffLoading}
|
|
753
|
-
diffError={diffError}
|
|
754
|
-
/>
|
|
755
|
-
</div>
|
|
756
|
-
</ScrollArea>
|
|
725
|
+
<A11ySection
|
|
726
|
+
findings={findings}
|
|
727
|
+
loading={auditLoading}
|
|
728
|
+
auditedAt={auditedAt}
|
|
729
|
+
auditError={auditError}
|
|
730
|
+
onRunAudit={onRunAudit}
|
|
731
|
+
onFindingClick={onFindingClick}
|
|
732
|
+
fixSource={fixSource}
|
|
733
|
+
onFixApplied={onFixApplied}
|
|
734
|
+
/>
|
|
735
|
+
|
|
736
|
+
<VisualDiffSection
|
|
737
|
+
diff={visualDiff}
|
|
738
|
+
versionOptions={versionOptions}
|
|
739
|
+
baseVersionId={baseVersionId}
|
|
740
|
+
compareVersionId={compareVersionId}
|
|
741
|
+
onVersionChange={onVersionChange}
|
|
742
|
+
loading={diffLoading}
|
|
743
|
+
diffError={diffError}
|
|
744
|
+
/>
|
|
757
745
|
</div>
|
|
758
746
|
);
|
|
759
747
|
}
|
|
@@ -58,6 +58,8 @@ interface DesignStateRow {
|
|
|
58
58
|
breakpoint: DesignStateBreakpoint;
|
|
59
59
|
sourceRef?: string | null;
|
|
60
60
|
route?: string | null;
|
|
61
|
+
fixtureData?: Record<string, unknown> | null;
|
|
62
|
+
captureData?: Record<string, unknown> | null;
|
|
61
63
|
previewRef?: string | null;
|
|
62
64
|
createdAt?: string | null;
|
|
63
65
|
updatedAt?: string | null;
|
|
@@ -76,7 +78,7 @@ export interface StatesPanelProps {
|
|
|
76
78
|
breakpoints: Array<{ id: string; label: string; widthPx: number }>;
|
|
77
79
|
/** Whether the design's source supports live captures. */
|
|
78
80
|
canCapture?: boolean;
|
|
79
|
-
onStateSelect: (stateId: string | null) => void;
|
|
81
|
+
onStateSelect: (stateId: string | null, row?: DesignStateRow) => void;
|
|
80
82
|
onBreakpointSelect: (breakpointId: string) => void;
|
|
81
83
|
onAddBreakpoint?: () => void;
|
|
82
84
|
onCapture?: () => void;
|
|
@@ -155,10 +157,10 @@ function StateRow({
|
|
|
155
157
|
if (e.key === "Enter" || e.key === " ") onSelect();
|
|
156
158
|
}}
|
|
157
159
|
className={cn(
|
|
158
|
-
"group flex cursor-pointer items-center gap-2 rounded-
|
|
160
|
+
"group flex h-7 cursor-pointer items-center gap-2 rounded-[5px] px-2 outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--design-editor-accent-color)]",
|
|
159
161
|
isActive
|
|
160
|
-
? "bg-
|
|
161
|
-
: "text-muted-foreground hover:bg-
|
|
162
|
+
? "bg-[var(--design-editor-active-row-color)] text-foreground"
|
|
163
|
+
: "text-muted-foreground hover:bg-[var(--design-editor-layer-hover-color)] hover:text-foreground",
|
|
162
164
|
)}
|
|
163
165
|
>
|
|
164
166
|
{/* Active indicator */}
|
|
@@ -170,7 +172,7 @@ function StateRow({
|
|
|
170
172
|
/>
|
|
171
173
|
|
|
172
174
|
{/* Name */}
|
|
173
|
-
<span className="min-w-0 flex-1 truncate text-[12px] font-
|
|
175
|
+
<span className="min-w-0 flex-1 truncate text-[12px] font-semibold">
|
|
174
176
|
{row.name}
|
|
175
177
|
</span>
|
|
176
178
|
|
|
@@ -239,14 +241,12 @@ export function StatesPanel({
|
|
|
239
241
|
|
|
240
242
|
const createState = useActionMutation("create-design-state");
|
|
241
243
|
const deleteState = useActionMutation("delete-design-state");
|
|
242
|
-
const setActiveBreakpoint = useActionMutation("set-active-breakpoint");
|
|
243
244
|
|
|
244
245
|
const states = data?.states ?? [];
|
|
245
246
|
|
|
246
247
|
// --- Breakpoint control ---
|
|
247
248
|
const handleBreakpointClick = (id: string) => {
|
|
248
249
|
onBreakpointSelect(id);
|
|
249
|
-
setActiveBreakpoint.mutate({ designId, breakpointId: id });
|
|
250
250
|
};
|
|
251
251
|
|
|
252
252
|
// --- Create state ---
|
|
@@ -267,11 +267,11 @@ export function StatesPanel({
|
|
|
267
267
|
};
|
|
268
268
|
|
|
269
269
|
return (
|
|
270
|
-
<div className="flex flex-col gap-
|
|
270
|
+
<div className="flex flex-col gap-2">
|
|
271
271
|
{/* ── Responsive breakpoints ── */}
|
|
272
272
|
<section aria-label="Breakpoints">
|
|
273
|
-
<div className="mb-1
|
|
274
|
-
<span className="text-[
|
|
273
|
+
<div className="mb-1 flex items-center justify-between">
|
|
274
|
+
<span className="text-[11px] font-medium text-muted-foreground">
|
|
275
275
|
Responsive
|
|
276
276
|
</span>
|
|
277
277
|
{onAddBreakpoint && (
|
|
@@ -281,11 +281,11 @@ export function StatesPanel({
|
|
|
281
281
|
type="button"
|
|
282
282
|
variant="ghost"
|
|
283
283
|
size="icon"
|
|
284
|
-
className="size-
|
|
284
|
+
className="size-6 cursor-pointer rounded-md text-muted-foreground hover:text-foreground"
|
|
285
285
|
onClick={onAddBreakpoint}
|
|
286
286
|
aria-label="Add breakpoint"
|
|
287
287
|
>
|
|
288
|
-
<IconPlus className="size-3" />
|
|
288
|
+
<IconPlus className="size-3.5" />
|
|
289
289
|
</Button>
|
|
290
290
|
</TooltipTrigger>
|
|
291
291
|
<TooltipContent>Add breakpoint</TooltipContent>
|
|
@@ -294,7 +294,7 @@ export function StatesPanel({
|
|
|
294
294
|
</div>
|
|
295
295
|
|
|
296
296
|
{/* Segmented control */}
|
|
297
|
-
<div className="flex h-7 overflow-hidden rounded-md
|
|
297
|
+
<div className="flex h-7 min-w-0 overflow-hidden rounded-md bg-[var(--design-editor-control-bg)] p-0.5">
|
|
298
298
|
{/* Auto = single-frame, all breakpoints */}
|
|
299
299
|
<BreakpointButton
|
|
300
300
|
id="auto"
|
|
@@ -341,29 +341,12 @@ export function StatesPanel({
|
|
|
341
341
|
</>
|
|
342
342
|
)}
|
|
343
343
|
</div>
|
|
344
|
-
|
|
345
|
-
{/* Active-frame hint */}
|
|
346
|
-
{activeBreakpointId !== "auto" && (
|
|
347
|
-
<p className="mt-1 text-[10px] text-muted-foreground/60">
|
|
348
|
-
Edits in this frame write{" "}
|
|
349
|
-
<span className="font-mono font-semibold">
|
|
350
|
-
{activeBreakpointId === "bp-mobile"
|
|
351
|
-
? "base:"
|
|
352
|
-
: activeBreakpointId === "bp-tablet"
|
|
353
|
-
? "md:"
|
|
354
|
-
: activeBreakpointId === "bp-desktop"
|
|
355
|
-
? "xl:"
|
|
356
|
-
: "breakpoint:"}
|
|
357
|
-
</span>{" "}
|
|
358
|
-
classes
|
|
359
|
-
</p>
|
|
360
|
-
)}
|
|
361
344
|
</section>
|
|
362
345
|
|
|
363
346
|
{/* ── Design states ── */}
|
|
364
347
|
<section aria-label="Design states">
|
|
365
|
-
<div className="mb-1
|
|
366
|
-
<span className="text-[
|
|
348
|
+
<div className="mb-1 flex items-center justify-between">
|
|
349
|
+
<span className="text-[11px] font-medium text-muted-foreground">
|
|
367
350
|
States
|
|
368
351
|
</span>
|
|
369
352
|
<div className="flex items-center gap-0.5">
|
|
@@ -374,11 +357,11 @@ export function StatesPanel({
|
|
|
374
357
|
type="button"
|
|
375
358
|
variant="ghost"
|
|
376
359
|
size="icon"
|
|
377
|
-
className="size-
|
|
360
|
+
className="size-6 cursor-pointer rounded-md text-muted-foreground hover:text-foreground"
|
|
378
361
|
onClick={onCapture}
|
|
379
362
|
aria-label="Capture from running app"
|
|
380
363
|
>
|
|
381
|
-
<IconCamera className="size-3" />
|
|
364
|
+
<IconCamera className="size-3.5" />
|
|
382
365
|
</Button>
|
|
383
366
|
</TooltipTrigger>
|
|
384
367
|
<TooltipContent>Capture from running app</TooltipContent>
|
|
@@ -390,13 +373,13 @@ export function StatesPanel({
|
|
|
390
373
|
type="button"
|
|
391
374
|
variant="ghost"
|
|
392
375
|
size="icon"
|
|
393
|
-
className="size-
|
|
376
|
+
className="size-6 cursor-pointer rounded-md text-muted-foreground hover:text-foreground"
|
|
394
377
|
onClick={() => refetch()}
|
|
395
378
|
aria-label="Refresh states"
|
|
396
379
|
disabled={isLoading}
|
|
397
380
|
>
|
|
398
381
|
<IconRefresh
|
|
399
|
-
className={cn("size-3", isLoading && "animate-spin")}
|
|
382
|
+
className={cn("size-3.5", isLoading && "animate-spin")}
|
|
400
383
|
/>
|
|
401
384
|
</Button>
|
|
402
385
|
</TooltipTrigger>
|
|
@@ -408,11 +391,11 @@ export function StatesPanel({
|
|
|
408
391
|
type="button"
|
|
409
392
|
variant="ghost"
|
|
410
393
|
size="icon"
|
|
411
|
-
className="size-
|
|
394
|
+
className="size-6 cursor-pointer rounded-md text-muted-foreground hover:text-foreground"
|
|
412
395
|
onClick={() => setIsAdding(true)}
|
|
413
396
|
aria-label="Add state"
|
|
414
397
|
>
|
|
415
|
-
<IconPlus className="size-3" />
|
|
398
|
+
<IconPlus className="size-3.5" />
|
|
416
399
|
</Button>
|
|
417
400
|
</TooltipTrigger>
|
|
418
401
|
<TooltipContent>Add state</TooltipContent>
|
|
@@ -429,10 +412,10 @@ export function StatesPanel({
|
|
|
429
412
|
if (e.key === "Enter" || e.key === " ") onStateSelect(null);
|
|
430
413
|
}}
|
|
431
414
|
className={cn(
|
|
432
|
-
"flex cursor-pointer items-center gap-2 rounded-
|
|
415
|
+
"flex h-7 cursor-pointer items-center gap-2 rounded-[5px] px-2 outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--design-editor-accent-color)]",
|
|
433
416
|
activeStateId === null
|
|
434
|
-
? "bg-
|
|
435
|
-
: "text-muted-foreground hover:bg-
|
|
417
|
+
? "bg-[var(--design-editor-active-row-color)] text-foreground"
|
|
418
|
+
: "text-muted-foreground hover:bg-[var(--design-editor-layer-hover-color)] hover:text-foreground",
|
|
436
419
|
)}
|
|
437
420
|
>
|
|
438
421
|
<div
|
|
@@ -441,7 +424,9 @@ export function StatesPanel({
|
|
|
441
424
|
activeStateId === null ? "bg-primary" : "bg-muted-foreground/30",
|
|
442
425
|
)}
|
|
443
426
|
/>
|
|
444
|
-
<span className="text-[12px] font-
|
|
427
|
+
<span className="min-w-0 flex-1 truncate text-[12px] font-semibold">
|
|
428
|
+
Default
|
|
429
|
+
</span>
|
|
445
430
|
<span className="ml-auto text-[10px] text-muted-foreground/40">
|
|
446
431
|
Live
|
|
447
432
|
</span>
|
|
@@ -455,7 +440,7 @@ export function StatesPanel({
|
|
|
455
440
|
key={row.id}
|
|
456
441
|
row={row}
|
|
457
442
|
isActive={activeStateId === row.id}
|
|
458
|
-
onSelect={() => onStateSelect(row.id)}
|
|
443
|
+
onSelect={() => onStateSelect(row.id, row)}
|
|
459
444
|
onDelete={() => handleDeleteState(row.id)}
|
|
460
445
|
/>
|
|
461
446
|
))}
|
|
@@ -476,10 +461,9 @@ export function StatesPanel({
|
|
|
476
461
|
|
|
477
462
|
{/* Empty state (no user-created states yet) */}
|
|
478
463
|
{!isLoading && states.length === 0 && !isAdding && (
|
|
479
|
-
<
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
</p>
|
|
464
|
+
<div className="mt-1 flex h-7 items-center rounded-[5px] px-2 text-[11px] text-muted-foreground/55">
|
|
465
|
+
No saved states
|
|
466
|
+
</div>
|
|
483
467
|
)}
|
|
484
468
|
|
|
485
469
|
{/* Inline add-state form */}
|
|
@@ -496,7 +480,7 @@ export function StatesPanel({
|
|
|
496
480
|
value={newStateName}
|
|
497
481
|
onChange={(e) => setNewStateName(e.target.value)}
|
|
498
482
|
placeholder="State name…"
|
|
499
|
-
className="h-
|
|
483
|
+
className="h-6 min-w-0 flex-1 rounded-md border border-[var(--design-editor-control-border)] bg-[var(--design-editor-control-bg)] px-1.5 text-[11px] text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-[var(--design-editor-accent-color)]"
|
|
500
484
|
onKeyDown={(e) => {
|
|
501
485
|
if (e.key === "Escape") {
|
|
502
486
|
setIsAdding(false);
|
|
@@ -507,7 +491,7 @@ export function StatesPanel({
|
|
|
507
491
|
<Button
|
|
508
492
|
type="submit"
|
|
509
493
|
size="sm"
|
|
510
|
-
className="h-
|
|
494
|
+
className="h-6 cursor-pointer px-2 text-[11px]"
|
|
511
495
|
disabled={!newStateName.trim() || createState.isPending}
|
|
512
496
|
>
|
|
513
497
|
Add
|
|
@@ -516,7 +500,7 @@ export function StatesPanel({
|
|
|
516
500
|
type="button"
|
|
517
501
|
variant="ghost"
|
|
518
502
|
size="sm"
|
|
519
|
-
className="h-
|
|
503
|
+
className="h-6 cursor-pointer px-2 text-[11px]"
|
|
520
504
|
onClick={() => {
|
|
521
505
|
setIsAdding(false);
|
|
522
506
|
setNewStateName("");
|
|
@@ -526,15 +510,6 @@ export function StatesPanel({
|
|
|
526
510
|
</Button>
|
|
527
511
|
</form>
|
|
528
512
|
)}
|
|
529
|
-
|
|
530
|
-
{/* Real-app capture CTA (inline, only when not already canCapture) */}
|
|
531
|
-
{!canCapture && (
|
|
532
|
-
<div className="mt-3 rounded-md border border-dashed border-border/60 bg-muted/30 px-3 py-2.5 text-center">
|
|
533
|
-
<p className="text-[11px] leading-snug text-muted-foreground/70">
|
|
534
|
-
Connect Builder to capture live app data and route states.
|
|
535
|
-
</p>
|
|
536
|
-
</div>
|
|
537
|
-
)}
|
|
538
513
|
</section>
|
|
539
514
|
</div>
|
|
540
515
|
);
|
|
@@ -563,17 +538,17 @@ function BreakpointButton({
|
|
|
563
538
|
onClick={onClick}
|
|
564
539
|
aria-pressed={isActive}
|
|
565
540
|
className={cn(
|
|
566
|
-
"flex flex-1 cursor-pointer items-center justify-center gap-1 px-1 text-[
|
|
541
|
+
"flex min-w-0 flex-1 cursor-pointer items-center justify-center gap-1 rounded-[4px] px-1 text-[10px] font-semibold transition-colors",
|
|
567
542
|
isActive
|
|
568
|
-
? "bg-
|
|
569
|
-
: "text-muted-foreground
|
|
543
|
+
? "bg-[var(--design-editor-panel-bg)] text-foreground shadow-[0_0_0_1px_var(--design-editor-control-border),0_1px_2px_rgba(0,0,0,0.18)]"
|
|
544
|
+
: "text-muted-foreground hover:bg-[var(--design-editor-panel-raised-bg)] hover:text-foreground",
|
|
570
545
|
)}
|
|
571
546
|
title={widthPx ? `${label} (${widthPx}px)` : label}
|
|
572
547
|
>
|
|
573
548
|
{widthPx != null && (
|
|
574
549
|
<BreakpointIcon widthPx={widthPx} className="shrink-0" />
|
|
575
550
|
)}
|
|
576
|
-
<span className="
|
|
551
|
+
<span className="min-w-0 truncate">{label}</span>
|
|
577
552
|
</button>
|
|
578
553
|
);
|
|
579
554
|
}
|