@agent-native/core 0.80.9 → 0.80.10
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 +7 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/design-connect.ts +28 -2
- package/corpus/core/src/cli/skills.ts +45 -24
- package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +717 -0
- package/corpus/templates/design/actions/add-breakpoint.ts +143 -0
- package/corpus/templates/design/actions/add-localhost-screens.ts +5 -0
- package/corpus/templates/design/actions/apply-a11y-fix.ts +317 -0
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +433 -0
- package/corpus/templates/design/actions/apply-design-state.ts +200 -0
- package/corpus/templates/design/actions/apply-design-token-edit.ts +202 -0
- package/corpus/templates/design/actions/apply-motion-edit.ts +450 -0
- package/corpus/templates/design/actions/apply-shader-fill.ts +404 -0
- package/corpus/templates/design/actions/apply-visual-edit.ts +191 -5
- package/corpus/templates/design/actions/capture-design-state.ts +224 -0
- package/corpus/templates/design/actions/connect-builder-app.ts +162 -0
- package/corpus/templates/design/actions/create-component.ts +447 -0
- package/corpus/templates/design/actions/create-design-branch.ts +263 -0
- package/corpus/templates/design/actions/create-design-state.ts +162 -0
- package/corpus/templates/design/actions/delete-design-state.ts +55 -0
- package/corpus/templates/design/actions/deploy-design-preview.ts +275 -0
- package/corpus/templates/design/actions/get-component-details.ts +242 -0
- package/corpus/templates/design/actions/get-design-branch-diff.ts +362 -0
- package/corpus/templates/design/actions/get-design-review.ts +314 -0
- package/corpus/templates/design/actions/get-design-surface-index.ts +582 -0
- package/corpus/templates/design/actions/get-motion-timeline.ts +99 -0
- package/corpus/templates/design/actions/index-components.ts +258 -0
- package/corpus/templates/design/actions/index-design-tokens.ts +273 -0
- package/corpus/templates/design/actions/list-design-extensions.ts +309 -0
- package/corpus/templates/design/actions/list-design-source-capabilities.ts +153 -0
- package/corpus/templates/design/actions/list-design-states.ts +72 -0
- package/corpus/templates/design/actions/migrate-inline-design-to-app.ts +298 -0
- package/corpus/templates/design/actions/open-component-source.ts +237 -0
- package/corpus/templates/design/actions/preview-component-prop-edit.ts +254 -0
- package/corpus/templates/design/actions/preview-design-token-edit.ts +113 -0
- package/corpus/templates/design/actions/preview-shader-fill.ts +189 -0
- package/corpus/templates/design/actions/remove-breakpoint.ts +103 -0
- package/corpus/templates/design/actions/remove-motion-timeline.ts +196 -0
- package/corpus/templates/design/actions/run-design-audit.ts +421 -0
- package/corpus/templates/design/actions/run-design-extension-action.ts +284 -0
- package/corpus/templates/design/actions/set-active-breakpoint.ts +39 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1414 -71
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +632 -43
- package/corpus/templates/design/app/components/design/DrawOverlay.tsx +1 -1
- package/corpus/templates/design/app/components/design/EditPanel.tsx +1391 -52
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +4 -3
- package/corpus/templates/design/app/components/design/LocalSourceEditBanner.tsx +157 -0
- package/corpus/templates/design/app/components/design/MotionDock.tsx +1062 -0
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1052 -98
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +759 -0
- package/corpus/templates/design/app/components/design/StatesPanel.tsx +579 -0
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +573 -0
- package/corpus/templates/design/app/components/design/canvas-primitive-style.ts +241 -0
- package/corpus/templates/design/app/components/design/index.ts +16 -0
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +15 -6
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +66 -3
- package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +145 -0
- package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +42 -12
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
- package/corpus/templates/design/app/hooks/useAgentEditRequest.ts +131 -0
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +3 -1
- package/corpus/templates/design/app/i18n/zh-TW.ts +31 -0
- package/corpus/templates/design/app/i18n-data.ts +269 -0
- package/corpus/templates/design/app/pages/DesignEditor.tsx +2478 -386
- package/corpus/templates/design/changelog/2026-06-29-added-a-review-panel-in-the-design-editor-s-inspector-with-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-copying-and-pasting-layers-no-longer-shows-success-notificat.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-device-presets-in-all-screens-view-resize-the-selected-previ.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-and-canvas-drags-keep-the-layer-list-stable-while-chan.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-moves-can-be-undone-and-redone-without-flashing-the-ca.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-previews-use-a-single-blue-hover-border-in-all-screen.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-selected-containers-show-draggable-padding-and-gap-guides-on.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-design-editor-adds-a-studio-layer-with-tokens-respon.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-accessibility-findings-now-offer-a-one-click-fix.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-component-instances-now-have-editable-props-in-the-inspe.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-inspect-code-now-shows-the-elements-opening-tag-at-a-gla.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-shader-fill-presets-can-now-be-applied-to-an-element.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-motion-timeline-can-now-add-a-track-to-any-element-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-visual-editor-selection-layer-paint-and-drawing-controls-are-more-reliable.md +6 -0
- package/corpus/templates/design/e2e/helpers.ts +10 -4
- package/corpus/templates/design/server/db/schema.ts +123 -0
- package/corpus/templates/design/server/plugins/db.ts +90 -0
- package/corpus/templates/design/shared/builder-app.ts +297 -0
- package/corpus/templates/design/shared/capability-resolver.ts +123 -0
- package/corpus/templates/design/shared/capture-sanitize.ts +70 -0
- package/corpus/templates/design/shared/code-layer.ts +1016 -71
- package/corpus/templates/design/shared/component-model.ts +239 -0
- package/corpus/templates/design/shared/design-review.ts +275 -0
- package/corpus/templates/design/shared/design-source-capabilities.ts +286 -0
- package/corpus/templates/design/shared/design-state.ts +112 -0
- package/corpus/templates/design/shared/design-surface-index.ts +258 -0
- package/corpus/templates/design/shared/motion-compiler.ts +278 -0
- package/corpus/templates/design/shared/motion-timeline.ts +193 -0
- package/corpus/templates/design/shared/responsive-classes.ts +452 -0
- package/corpus/templates/design/shared/shader-fill.ts +323 -0
- package/corpus/templates/design/shared/source-mode.ts +245 -0
- package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +6 -2
- package/corpus/templates/plan/changelog/2026-06-29-plan-canvases-open-without-an-initial-pan-and-zoom-flicker.md +6 -0
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +28 -2
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +37 -21
- package/dist/cli/skills.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/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +7 -7
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/package.json +1 -1
|
@@ -909,7 +909,8 @@ function LayerRow({
|
|
|
909
909
|
const selectable = node.selectable !== false;
|
|
910
910
|
const lockable = node.lockable !== false && Boolean(onToggleLocked);
|
|
911
911
|
const hideable = node.hideable !== false && Boolean(onToggleHidden);
|
|
912
|
-
const
|
|
912
|
+
const dragEligible = selectable && !node.locked && !node.hidden;
|
|
913
|
+
const draggable = dragEligible && Boolean(onMoveLayer);
|
|
913
914
|
const canDropInside = layerCanDropInside(node, hasChildren);
|
|
914
915
|
const activeDrop =
|
|
915
916
|
dropIndicator?.targetId === node.id ? dropIndicator.placement : null;
|
|
@@ -1061,7 +1062,7 @@ function LayerRow({
|
|
|
1061
1062
|
};
|
|
1062
1063
|
|
|
1063
1064
|
const handleDragOver = (event: DragEvent<HTMLDivElement>) => {
|
|
1064
|
-
if (!onMoveLayer || !
|
|
1065
|
+
if (!onMoveLayer || !dragEligible) return;
|
|
1065
1066
|
// dataTransfer.getData() always returns "" during dragover per spec.
|
|
1066
1067
|
// Read from the module-level activeDragState set in handleDragStart instead.
|
|
1067
1068
|
if (!activeDragState) return;
|
|
@@ -1084,7 +1085,7 @@ function LayerRow({
|
|
|
1084
1085
|
};
|
|
1085
1086
|
|
|
1086
1087
|
const handleDrop = (event: DragEvent<HTMLDivElement>) => {
|
|
1087
|
-
if (!onMoveLayer || !
|
|
1088
|
+
if (!onMoveLayer || !dragEligible) {
|
|
1088
1089
|
onDropIndicatorChange(null);
|
|
1089
1090
|
return;
|
|
1090
1091
|
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { useT } from "@agent-native/core/client";
|
|
2
|
+
import {
|
|
3
|
+
IconInfoCircle,
|
|
4
|
+
IconMessageBolt,
|
|
5
|
+
IconClipboard,
|
|
6
|
+
IconX,
|
|
7
|
+
} from "@tabler/icons-react";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
|
|
10
|
+
import { Alert, AlertDescription } from "@/components/ui/alert";
|
|
11
|
+
import { Button } from "@/components/ui/button";
|
|
12
|
+
import {
|
|
13
|
+
Dialog,
|
|
14
|
+
DialogContent,
|
|
15
|
+
DialogDescription,
|
|
16
|
+
DialogFooter,
|
|
17
|
+
DialogHeader,
|
|
18
|
+
DialogTitle,
|
|
19
|
+
} from "@/components/ui/dialog";
|
|
20
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
21
|
+
import { useAgentEditRequest } from "@/hooks/useAgentEditRequest";
|
|
22
|
+
|
|
23
|
+
export interface LocalSourceEditBannerProps {
|
|
24
|
+
/** The design id for agent context. */
|
|
25
|
+
designId: string;
|
|
26
|
+
/** The active file id for agent context, if known. */
|
|
27
|
+
fileId?: string;
|
|
28
|
+
/** Path to the localhost source file that should receive edits, if known. */
|
|
29
|
+
routeSourceFile?: string;
|
|
30
|
+
/** Called when the user dismisses the banner. */
|
|
31
|
+
onDismiss?: () => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Dismissible informational banner shown for screens connected to a local
|
|
36
|
+
* source (localhost / React dev server). Explains that edits are routed
|
|
37
|
+
* through the AI agent rather than applied directly, and provides quick
|
|
38
|
+
* "Ask AI to edit" and "Copy prompt" affordances.
|
|
39
|
+
*/
|
|
40
|
+
export function LocalSourceEditBanner({
|
|
41
|
+
designId,
|
|
42
|
+
fileId,
|
|
43
|
+
routeSourceFile,
|
|
44
|
+
onDismiss,
|
|
45
|
+
}: LocalSourceEditBannerProps) {
|
|
46
|
+
const t = useT();
|
|
47
|
+
const { sendEdit, copyPrompt } = useAgentEditRequest();
|
|
48
|
+
const [promptOpen, setPromptOpen] = useState(false);
|
|
49
|
+
const [request, setRequest] = useState("");
|
|
50
|
+
|
|
51
|
+
const baseArgs = { designId, fileId, routeSourceFile };
|
|
52
|
+
const submitArgs = { ...baseArgs, message: request };
|
|
53
|
+
const trimmed = request.trim();
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<Alert className="relative flex items-start gap-2 rounded-none border-x-0 border-t-0 py-2 px-3 text-xs">
|
|
58
|
+
<IconInfoCircle className="mt-0.5 size-3.5 shrink-0 text-muted-foreground" />
|
|
59
|
+
<AlertDescription className="flex flex-1 flex-col gap-1.5 text-xs leading-snug">
|
|
60
|
+
<span>{t("designEditor.localSourceEdit.bannerNotice")}</span>
|
|
61
|
+
<div className="flex flex-wrap gap-1.5">
|
|
62
|
+
<Button
|
|
63
|
+
size="sm"
|
|
64
|
+
variant="outline"
|
|
65
|
+
className="h-6 gap-1 px-2 text-[11px]"
|
|
66
|
+
onClick={() => setPromptOpen(true)}
|
|
67
|
+
>
|
|
68
|
+
<IconMessageBolt className="size-3 shrink-0" />
|
|
69
|
+
{t("designEditor.localSourceEdit.askAiToEdit")}
|
|
70
|
+
</Button>
|
|
71
|
+
<Button
|
|
72
|
+
size="sm"
|
|
73
|
+
variant="ghost"
|
|
74
|
+
className="h-6 gap-1 px-2 text-[11px] text-muted-foreground"
|
|
75
|
+
onClick={() => {
|
|
76
|
+
void copyPrompt({
|
|
77
|
+
...baseArgs,
|
|
78
|
+
message: routeSourceFile
|
|
79
|
+
? `Edit the connected source file "${routeSourceFile}" as requested.`
|
|
80
|
+
: "Edit the connected source code as requested.",
|
|
81
|
+
});
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
<IconClipboard className="size-3 shrink-0" />
|
|
85
|
+
{t("designEditor.localSourceEdit.copyPrompt")}
|
|
86
|
+
</Button>
|
|
87
|
+
</div>
|
|
88
|
+
</AlertDescription>
|
|
89
|
+
{onDismiss && (
|
|
90
|
+
<button
|
|
91
|
+
type="button"
|
|
92
|
+
aria-label={t("designEditor.dismiss")}
|
|
93
|
+
onClick={onDismiss}
|
|
94
|
+
className="absolute end-2 top-2 rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground transition-colors"
|
|
95
|
+
>
|
|
96
|
+
<IconX className="size-3.5" />
|
|
97
|
+
</button>
|
|
98
|
+
)}
|
|
99
|
+
</Alert>
|
|
100
|
+
|
|
101
|
+
<Dialog open={promptOpen} onOpenChange={setPromptOpen}>
|
|
102
|
+
<DialogContent className="max-w-md">
|
|
103
|
+
<DialogHeader>
|
|
104
|
+
<DialogTitle>
|
|
105
|
+
{t("designEditor.localSourceEdit.dialogTitle")}
|
|
106
|
+
</DialogTitle>
|
|
107
|
+
<DialogDescription>
|
|
108
|
+
{routeSourceFile
|
|
109
|
+
? t("designEditor.localSourceEdit.dialogDescriptionFile", {
|
|
110
|
+
file: routeSourceFile,
|
|
111
|
+
})
|
|
112
|
+
: t("designEditor.localSourceEdit.dialogDescription")}
|
|
113
|
+
</DialogDescription>
|
|
114
|
+
</DialogHeader>
|
|
115
|
+
<Textarea
|
|
116
|
+
autoFocus
|
|
117
|
+
value={request}
|
|
118
|
+
onChange={(e) => setRequest(e.target.value)}
|
|
119
|
+
placeholder={t("designEditor.localSourceEdit.requestPlaceholder")}
|
|
120
|
+
className="min-h-[96px] resize-none"
|
|
121
|
+
onKeyDown={(e) => {
|
|
122
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey) && trimmed) {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
void sendEdit(submitArgs);
|
|
125
|
+
setRequest("");
|
|
126
|
+
setPromptOpen(false);
|
|
127
|
+
}
|
|
128
|
+
}}
|
|
129
|
+
/>
|
|
130
|
+
<DialogFooter className="gap-2">
|
|
131
|
+
<Button
|
|
132
|
+
variant="ghost"
|
|
133
|
+
onClick={() => {
|
|
134
|
+
void copyPrompt(submitArgs);
|
|
135
|
+
}}
|
|
136
|
+
disabled={!trimmed}
|
|
137
|
+
>
|
|
138
|
+
<IconClipboard className="size-4" />
|
|
139
|
+
{t("designEditor.localSourceEdit.copyPrompt")}
|
|
140
|
+
</Button>
|
|
141
|
+
<Button
|
|
142
|
+
onClick={() => {
|
|
143
|
+
void sendEdit(submitArgs);
|
|
144
|
+
setRequest("");
|
|
145
|
+
setPromptOpen(false);
|
|
146
|
+
}}
|
|
147
|
+
disabled={!trimmed}
|
|
148
|
+
>
|
|
149
|
+
<IconMessageBolt className="size-4" />
|
|
150
|
+
{t("designEditor.localSourceEdit.askAiToEdit")}
|
|
151
|
+
</Button>
|
|
152
|
+
</DialogFooter>
|
|
153
|
+
</DialogContent>
|
|
154
|
+
</Dialog>
|
|
155
|
+
</>
|
|
156
|
+
);
|
|
157
|
+
}
|