@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.
Files changed (111) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +7 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/cli/design-connect.ts +28 -2
  5. package/corpus/core/src/cli/skills.ts +45 -24
  6. package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +717 -0
  7. package/corpus/templates/design/actions/add-breakpoint.ts +143 -0
  8. package/corpus/templates/design/actions/add-localhost-screens.ts +5 -0
  9. package/corpus/templates/design/actions/apply-a11y-fix.ts +317 -0
  10. package/corpus/templates/design/actions/apply-component-prop-edit.ts +433 -0
  11. package/corpus/templates/design/actions/apply-design-state.ts +200 -0
  12. package/corpus/templates/design/actions/apply-design-token-edit.ts +202 -0
  13. package/corpus/templates/design/actions/apply-motion-edit.ts +450 -0
  14. package/corpus/templates/design/actions/apply-shader-fill.ts +404 -0
  15. package/corpus/templates/design/actions/apply-visual-edit.ts +191 -5
  16. package/corpus/templates/design/actions/capture-design-state.ts +224 -0
  17. package/corpus/templates/design/actions/connect-builder-app.ts +162 -0
  18. package/corpus/templates/design/actions/create-component.ts +447 -0
  19. package/corpus/templates/design/actions/create-design-branch.ts +263 -0
  20. package/corpus/templates/design/actions/create-design-state.ts +162 -0
  21. package/corpus/templates/design/actions/delete-design-state.ts +55 -0
  22. package/corpus/templates/design/actions/deploy-design-preview.ts +275 -0
  23. package/corpus/templates/design/actions/get-component-details.ts +242 -0
  24. package/corpus/templates/design/actions/get-design-branch-diff.ts +362 -0
  25. package/corpus/templates/design/actions/get-design-review.ts +314 -0
  26. package/corpus/templates/design/actions/get-design-surface-index.ts +582 -0
  27. package/corpus/templates/design/actions/get-motion-timeline.ts +99 -0
  28. package/corpus/templates/design/actions/index-components.ts +258 -0
  29. package/corpus/templates/design/actions/index-design-tokens.ts +273 -0
  30. package/corpus/templates/design/actions/list-design-extensions.ts +309 -0
  31. package/corpus/templates/design/actions/list-design-source-capabilities.ts +153 -0
  32. package/corpus/templates/design/actions/list-design-states.ts +72 -0
  33. package/corpus/templates/design/actions/migrate-inline-design-to-app.ts +298 -0
  34. package/corpus/templates/design/actions/open-component-source.ts +237 -0
  35. package/corpus/templates/design/actions/preview-component-prop-edit.ts +254 -0
  36. package/corpus/templates/design/actions/preview-design-token-edit.ts +113 -0
  37. package/corpus/templates/design/actions/preview-shader-fill.ts +189 -0
  38. package/corpus/templates/design/actions/remove-breakpoint.ts +103 -0
  39. package/corpus/templates/design/actions/remove-motion-timeline.ts +196 -0
  40. package/corpus/templates/design/actions/run-design-audit.ts +421 -0
  41. package/corpus/templates/design/actions/run-design-extension-action.ts +284 -0
  42. package/corpus/templates/design/actions/set-active-breakpoint.ts +39 -0
  43. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1414 -71
  44. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +632 -43
  45. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +1 -1
  46. package/corpus/templates/design/app/components/design/EditPanel.tsx +1391 -52
  47. package/corpus/templates/design/app/components/design/LayersPanel.tsx +4 -3
  48. package/corpus/templates/design/app/components/design/LocalSourceEditBanner.tsx +157 -0
  49. package/corpus/templates/design/app/components/design/MotionDock.tsx +1062 -0
  50. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1052 -98
  51. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +759 -0
  52. package/corpus/templates/design/app/components/design/StatesPanel.tsx +579 -0
  53. package/corpus/templates/design/app/components/design/TokensPanel.tsx +573 -0
  54. package/corpus/templates/design/app/components/design/canvas-primitive-style.ts +241 -0
  55. package/corpus/templates/design/app/components/design/index.ts +16 -0
  56. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +15 -6
  57. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +66 -3
  58. package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +145 -0
  59. package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +42 -12
  60. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
  61. package/corpus/templates/design/app/hooks/useAgentEditRequest.ts +131 -0
  62. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +3 -1
  63. package/corpus/templates/design/app/i18n/zh-TW.ts +31 -0
  64. package/corpus/templates/design/app/i18n-data.ts +269 -0
  65. package/corpus/templates/design/app/pages/DesignEditor.tsx +2478 -386
  66. package/corpus/templates/design/changelog/2026-06-29-added-a-review-panel-in-the-design-editor-s-inspector-with-a.md +6 -0
  67. package/corpus/templates/design/changelog/2026-06-29-copying-and-pasting-layers-no-longer-shows-success-notificat.md +6 -0
  68. package/corpus/templates/design/changelog/2026-06-29-device-presets-in-all-screens-view-resize-the-selected-previ.md +6 -0
  69. package/corpus/templates/design/changelog/2026-06-29-layer-and-canvas-drags-keep-the-layer-list-stable-while-chan.md +6 -0
  70. package/corpus/templates/design/changelog/2026-06-29-layer-moves-can-be-undone-and-redone-without-flashing-the-ca.md +6 -0
  71. package/corpus/templates/design/changelog/2026-06-29-screen-previews-use-a-single-blue-hover-border-in-all-screen.md +6 -0
  72. package/corpus/templates/design/changelog/2026-06-29-selected-containers-show-draggable-padding-and-gap-guides-on.md +6 -0
  73. package/corpus/templates/design/changelog/2026-06-29-the-design-editor-adds-a-studio-layer-with-tokens-respon.md +6 -0
  74. package/corpus/templates/design/changelog/2026-06-30-accessibility-findings-now-offer-a-one-click-fix.md +6 -0
  75. package/corpus/templates/design/changelog/2026-06-30-component-instances-now-have-editable-props-in-the-inspe.md +6 -0
  76. package/corpus/templates/design/changelog/2026-06-30-inspect-code-now-shows-the-elements-opening-tag-at-a-gla.md +6 -0
  77. package/corpus/templates/design/changelog/2026-06-30-shader-fill-presets-can-now-be-applied-to-an-element.md +6 -0
  78. package/corpus/templates/design/changelog/2026-06-30-the-motion-timeline-can-now-add-a-track-to-any-element-a.md +6 -0
  79. package/corpus/templates/design/changelog/2026-06-30-visual-editor-selection-layer-paint-and-drawing-controls-are-more-reliable.md +6 -0
  80. package/corpus/templates/design/e2e/helpers.ts +10 -4
  81. package/corpus/templates/design/server/db/schema.ts +123 -0
  82. package/corpus/templates/design/server/plugins/db.ts +90 -0
  83. package/corpus/templates/design/shared/builder-app.ts +297 -0
  84. package/corpus/templates/design/shared/capability-resolver.ts +123 -0
  85. package/corpus/templates/design/shared/capture-sanitize.ts +70 -0
  86. package/corpus/templates/design/shared/code-layer.ts +1016 -71
  87. package/corpus/templates/design/shared/component-model.ts +239 -0
  88. package/corpus/templates/design/shared/design-review.ts +275 -0
  89. package/corpus/templates/design/shared/design-source-capabilities.ts +286 -0
  90. package/corpus/templates/design/shared/design-state.ts +112 -0
  91. package/corpus/templates/design/shared/design-surface-index.ts +258 -0
  92. package/corpus/templates/design/shared/motion-compiler.ts +278 -0
  93. package/corpus/templates/design/shared/motion-timeline.ts +193 -0
  94. package/corpus/templates/design/shared/responsive-classes.ts +452 -0
  95. package/corpus/templates/design/shared/shader-fill.ts +323 -0
  96. package/corpus/templates/design/shared/source-mode.ts +245 -0
  97. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +6 -2
  98. package/corpus/templates/plan/changelog/2026-06-29-plan-canvases-open-without-an-initial-pan-and-zoom-flicker.md +6 -0
  99. package/dist/cli/design-connect.d.ts.map +1 -1
  100. package/dist/cli/design-connect.js +28 -2
  101. package/dist/cli/design-connect.js.map +1 -1
  102. package/dist/cli/skills.d.ts.map +1 -1
  103. package/dist/cli/skills.js +37 -21
  104. package/dist/cli/skills.js.map +1 -1
  105. package/dist/collab/routes.d.ts +1 -1
  106. package/dist/file-upload/actions/upload-image.d.ts +2 -2
  107. package/dist/notifications/routes.d.ts +2 -2
  108. package/dist/observability/routes.d.ts +7 -7
  109. package/dist/resources/handlers.d.ts +2 -2
  110. package/dist/server/transcribe-voice.d.ts +1 -1
  111. 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 draggable = selectable && Boolean(onMoveLayer);
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 || !selectable) return;
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 || !selectable) {
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
+ }