@agent-native/core 0.80.4 → 0.80.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +21 -2
  3. package/corpus/core/docs/content/locales/ar-SA/real-time-collaboration.mdx +2 -2
  4. package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +1 -1
  5. package/corpus/core/docs/content/locales/de-DE/real-time-collaboration.mdx +3 -3
  6. package/corpus/core/docs/content/locales/de-DE/template-design.mdx +1 -1
  7. package/corpus/core/docs/content/locales/es-ES/real-time-collaboration.mdx +2 -2
  8. package/corpus/core/docs/content/locales/es-ES/template-design.mdx +1 -1
  9. package/corpus/core/docs/content/locales/fr-FR/real-time-collaboration.mdx +2 -2
  10. package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +1 -1
  11. package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +1 -1
  12. package/corpus/core/docs/content/locales/ja-JP/real-time-collaboration.mdx +2 -2
  13. package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +1 -1
  14. package/corpus/core/docs/content/locales/ko-KR/real-time-collaboration.mdx +2 -2
  15. package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +1 -1
  16. package/corpus/core/docs/content/locales/pt-BR/real-time-collaboration.mdx +2 -2
  17. package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +1 -1
  18. package/corpus/core/docs/content/locales/zh-CN/real-time-collaboration.mdx +2 -2
  19. package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +1 -1
  20. package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.mdx +2 -2
  21. package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +1 -1
  22. package/corpus/core/docs/content/real-time-collaboration.mdx +2 -2
  23. package/corpus/core/docs/content/template-design.mdx +1 -1
  24. package/corpus/core/package.json +3 -7
  25. package/corpus/core/src/action.ts +21 -0
  26. package/corpus/core/src/agent/durable-background.ts +32 -11
  27. package/corpus/core/src/agent/production-agent.ts +11 -1
  28. package/corpus/core/src/agent/run-loop-with-resume.ts +3 -1
  29. package/corpus/core/src/brand-kit/fig/index.ts +17 -37
  30. package/corpus/core/src/cli/index.ts +1 -1
  31. package/corpus/core/src/cli/mcp-config-writers.ts +187 -51
  32. package/corpus/core/src/cli/skills.ts +18 -3
  33. package/corpus/core/src/client/AssistantChat.tsx +11 -1
  34. package/corpus/core/src/client/agent-chat.ts +12 -1
  35. package/corpus/core/src/client/composer/PromptComposer.tsx +100 -41
  36. package/corpus/core/src/client/org/OrgSwitcher.tsx +1 -1
  37. package/corpus/core/src/client/sharing/ShareButton.tsx +3 -27
  38. package/corpus/core/src/collab/presence.ts +1 -1
  39. package/corpus/core/src/mcp/connect-route.ts +34 -5
  40. package/corpus/core/src/server/action-discovery.ts +4 -0
  41. package/corpus/core/src/server/agent-chat-plugin.ts +20 -0
  42. package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +2 -0
  43. package/corpus/templates/analytics/actions/update-dashboard.ts +8 -0
  44. package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -1
  45. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +117 -33
  46. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +4 -0
  47. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +7 -0
  48. package/corpus/templates/analytics/changelog/2026-06-27-dashboards-can-now-nest-under-a-parent-in-the-sidebar-via-a-.md +6 -0
  49. package/corpus/templates/analytics/changelog/2026-06-29-analytics-pages-now-sit-closer-under-the-header-with-tighter.md +6 -0
  50. package/corpus/templates/assets/actions/generate-image-batch.ts +3 -0
  51. package/corpus/templates/assets/actions/generate-image.ts +3 -0
  52. package/corpus/templates/assets/changelog/2026-06-29-longer-agent-generation-window.md +6 -0
  53. package/corpus/templates/assets/netlify.toml +3 -3
  54. package/corpus/templates/assets/server/plugins/agent-chat.ts +4 -1
  55. package/corpus/templates/clips/app/components/capture-install-options.tsx +7 -8
  56. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +1 -1
  57. package/corpus/templates/content/AGENTS.md +12 -0
  58. package/corpus/templates/content/app/blocks/BuilderDocsBlocks.tsx +10 -0
  59. package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -0
  60. package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +185 -0
  61. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +3 -0
  62. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +19 -0
  63. package/corpus/templates/content/app/components/editor/extensions/ContentReferenceNode.tsx +82 -0
  64. package/corpus/templates/content/app/global.css +9 -0
  65. package/corpus/templates/content/app/i18n/zh-TW.ts +12 -0
  66. package/corpus/templates/content/app/i18n-data.ts +140 -0
  67. package/corpus/templates/content/changelog/2026-06-29-reusable-mdx-references-now-preview-linked-local-documents-i.md +6 -0
  68. package/corpus/templates/content/shared/builder-docs-blocks.ts +8 -0
  69. package/corpus/templates/content/shared/builder-mdx.ts +141 -4
  70. package/corpus/templates/content/shared/nfm.ts +62 -0
  71. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +10 -11
  72. package/corpus/templates/design/AGENTS.md +5 -0
  73. package/corpus/templates/design/_gitignore +7 -0
  74. package/corpus/templates/design/actions/apply-visual-edit.ts +22 -12
  75. package/corpus/templates/design/actions/create-design-system.ts +15 -4
  76. package/corpus/templates/design/actions/create-file.ts +20 -1
  77. package/corpus/templates/design/actions/delete-design-system.ts +2 -2
  78. package/corpus/templates/design/actions/duplicate-design.ts +35 -9
  79. package/corpus/templates/design/actions/generate-design.ts +146 -69
  80. package/corpus/templates/design/actions/generate-screens.ts +51 -19
  81. package/corpus/templates/design/actions/get-design-snapshot.ts +5 -1
  82. package/corpus/templates/design/actions/get-design.ts +2 -0
  83. package/corpus/templates/design/actions/import-design-project.ts +28 -9
  84. package/corpus/templates/design/actions/import-document.ts +22 -8
  85. package/corpus/templates/design/actions/index-design-system-with-builder.ts +6 -153
  86. package/corpus/templates/design/actions/navigate.ts +105 -54
  87. package/corpus/templates/design/actions/set-default-design-system.ts +17 -3
  88. package/corpus/templates/design/actions/show-design-questions.ts +2 -0
  89. package/corpus/templates/design/actions/update-design.ts +2 -1
  90. package/corpus/templates/design/actions/view-screen.ts +12 -6
  91. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +4 -4
  92. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +159 -41
  93. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +8 -4
  94. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +37 -42
  95. package/corpus/templates/design/app/components/design/EditPanel.tsx +336 -183
  96. package/corpus/templates/design/app/components/design/LayersPanel.tsx +153 -34
  97. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +135 -33
  98. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +6 -0
  99. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +2 -1
  100. package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +4 -10
  101. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +84 -43
  102. package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +4 -4
  103. package/corpus/templates/design/app/components/design/inspector/{FigmaColorPicker.tsx → DesignColorPicker.tsx} +89 -62
  104. package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +14 -26
  105. package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +40 -12
  106. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +13 -4
  107. package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +13 -13
  108. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +13 -9
  109. package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +13 -4
  110. package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +6 -6
  111. package/corpus/templates/design/app/components/design/inspector/{figma-icons.tsx → design-icons.tsx} +2 -2
  112. package/corpus/templates/design/app/components/design/inspector/index.ts +12 -12
  113. package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +5 -2
  114. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -3
  115. package/corpus/templates/design/app/components/layout/Layout.tsx +5 -2
  116. package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -1
  117. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +167 -91
  118. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +16 -3
  119. package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +15 -0
  120. package/corpus/templates/design/app/global.css +4 -0
  121. package/corpus/templates/design/app/hooks/use-design-system.ts +4 -1
  122. package/corpus/templates/design/app/hooks/use-navigation-state.ts +38 -3
  123. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +9 -2
  124. package/corpus/templates/design/app/i18n/zh-TW.ts +22 -0
  125. package/corpus/templates/design/app/i18n-data.ts +527 -0
  126. package/corpus/templates/design/app/lib/design-systems.ts +6 -4
  127. package/corpus/templates/design/app/lib/design-templates.ts +15 -3
  128. package/corpus/templates/design/app/pages/DesignEditor.tsx +641 -158
  129. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +42 -34
  130. package/corpus/templates/design/app/pages/VisualEdit.tsx +100 -0
  131. package/corpus/templates/design/app/root.tsx +42 -9
  132. package/corpus/templates/design/app/routes/visual-edit.tsx +7 -0
  133. package/corpus/templates/design/changelog/2026-06-28-live-cursors-now-keep-names-beside-a-cleaner-pointer-marker.md +1 -1
  134. package/corpus/templates/design/changelog/2026-06-28-mode-switching-now-lives-in-a-compact-bottom-right-icon-dock.md +1 -1
  135. package/corpus/templates/design/changelog/2026-06-28-visual-code-design-mode.md +6 -0
  136. package/corpus/templates/design/changelog/2026-06-29-design-generation-prompts-now-show-connect-ai-before-sending.md +6 -0
  137. package/corpus/templates/design/changelog/2026-06-29-design-mode-top-chrome-now-groups-collaborators-preview-shar.md +1 -1
  138. package/corpus/templates/design/changelog/2026-06-29-fixed-design-editor-exports-and-gradient-edits-so-multi-scre.md +6 -0
  139. package/corpus/templates/design/changelog/2026-06-29-longer-hosted-agent-turns.md +6 -0
  140. package/corpus/templates/design/changelog/2026-06-29-png-export-handles-modern-css-color-functions-more-reliably.md +6 -0
  141. package/corpus/templates/design/changelog/2026-06-29-png-export-now-ignores-duplicate-clicks-while-a-download-is-.md +6 -0
  142. package/corpus/templates/design/changelog/2026-06-29-public-visual-edit-and-shared-design-links-now-invite-visito.md +6 -0
  143. package/corpus/templates/design/changelog/2026-06-29-visual-edit-actions-now-reject-missing-design-targets-before.md +6 -0
  144. package/corpus/templates/design/e2e/README.md +71 -0
  145. package/corpus/templates/design/e2e/global-setup.ts +157 -0
  146. package/corpus/templates/design/e2e/helpers.ts +148 -0
  147. package/corpus/templates/design/netlify.toml +3 -4
  148. package/corpus/templates/design/package.json +5 -1
  149. package/corpus/templates/design/playwright.config.ts +51 -0
  150. package/corpus/templates/design/server/handlers/index-design-system-with-builder.ts +121 -0
  151. package/corpus/templates/design/server/handlers/uploads.ts +89 -38
  152. package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +181 -0
  153. package/corpus/templates/design/server/lib/coding-handoff.ts +33 -4
  154. package/corpus/templates/design/server/lib/design-export.ts +35 -8
  155. package/corpus/templates/design/server/plugins/agent-chat.ts +4 -0
  156. package/corpus/templates/design/server/plugins/auth.ts +10 -1
  157. package/corpus/templates/design/server/routes/api/index-design-system-with-builder.post.ts +1 -0
  158. package/corpus/templates/design/shared/api.ts +2 -0
  159. package/corpus/templates/design/shared/apply-edits.ts +12 -8
  160. package/corpus/templates/design/shared/canvas-math.ts +19 -1
  161. package/corpus/templates/design/shared/code-layer.ts +87 -28
  162. package/corpus/templates/design/shared/generation-session.ts +1 -0
  163. package/corpus/templates/design/shared/resolve-tweaks.ts +4 -3
  164. package/corpus/templates/design/shared/shader-presets.ts +10 -0
  165. package/corpus/templates/design/shared/source-mode.ts +9 -0
  166. package/corpus/templates/design/vitest.config.ts +2 -1
  167. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +1 -1
  168. package/corpus/templates/plan/.agents/skills/visual-plan/references/canvas.md +1 -1
  169. package/corpus/templates/plan/AGENTS.md +1 -1
  170. package/corpus/templates/plan/actions/create-plan-design.ts +1 -1
  171. package/corpus/templates/plan/actions/validate-local-plan-source.ts +2 -10
  172. package/corpus/templates/plan/app/pages/PlansPage.tsx +1 -0
  173. package/corpus/templates/plan/docs/commenting-ux-plan.md +2 -2
  174. package/corpus/templates/plan/server/plan-content.ts +1 -1
  175. package/corpus/templates/plan/server/ui-plan-html.ts +2 -2
  176. package/corpus/templates/slides/actions/index-design-system-with-builder.ts +6 -153
  177. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +53 -38
  178. package/corpus/templates/slides/app/components/design-system/{fig-import-response.ts → builder-index-response.ts} +9 -6
  179. package/corpus/templates/slides/app/components/visual-editor/MultiSelectChip.tsx +1 -1
  180. package/corpus/templates/slides/changelog/2026-06-29-design-system-setup-now-indexes-uploaded-design-files-throug.md +6 -0
  181. package/corpus/templates/slides/changelog/2026-06-29-longer-hosted-agent-turns.md +6 -0
  182. package/corpus/templates/slides/netlify.toml +3 -6
  183. package/corpus/templates/slides/server/handlers/index-design-system-with-builder.ts +116 -0
  184. package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +179 -0
  185. package/corpus/templates/slides/server/plugins/agent-chat.ts +4 -1
  186. package/corpus/templates/slides/server/routes/api/index-design-system-with-builder.post.ts +1 -0
  187. package/dist/action.d.ts +15 -0
  188. package/dist/action.d.ts.map +1 -1
  189. package/dist/action.js +6 -0
  190. package/dist/action.js.map +1 -1
  191. package/dist/agent/durable-background.d.ts +9 -7
  192. package/dist/agent/durable-background.d.ts.map +1 -1
  193. package/dist/agent/durable-background.js +27 -11
  194. package/dist/agent/durable-background.js.map +1 -1
  195. package/dist/agent/production-agent.d.ts +7 -0
  196. package/dist/agent/production-agent.d.ts.map +1 -1
  197. package/dist/agent/production-agent.js +4 -1
  198. package/dist/agent/production-agent.js.map +1 -1
  199. package/dist/agent/run-loop-with-resume.d.ts +2 -1
  200. package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
  201. package/dist/agent/run-loop-with-resume.js +2 -2
  202. package/dist/agent/run-loop-with-resume.js.map +1 -1
  203. package/dist/brand-kit/fig/index.d.ts +4 -4
  204. package/dist/brand-kit/fig/index.d.ts.map +1 -1
  205. package/dist/brand-kit/fig/index.js +14 -27
  206. package/dist/brand-kit/fig/index.js.map +1 -1
  207. package/dist/cli/index.js +1 -1
  208. package/dist/cli/index.js.map +1 -1
  209. package/dist/cli/mcp-config-writers.d.ts +15 -7
  210. package/dist/cli/mcp-config-writers.d.ts.map +1 -1
  211. package/dist/cli/mcp-config-writers.js +198 -45
  212. package/dist/cli/mcp-config-writers.js.map +1 -1
  213. package/dist/cli/skills.d.ts +1 -1
  214. package/dist/cli/skills.d.ts.map +1 -1
  215. package/dist/cli/skills.js +18 -3
  216. package/dist/cli/skills.js.map +1 -1
  217. package/dist/client/AssistantChat.d.ts.map +1 -1
  218. package/dist/client/AssistantChat.js +11 -1
  219. package/dist/client/AssistantChat.js.map +1 -1
  220. package/dist/client/agent-chat.d.ts.map +1 -1
  221. package/dist/client/agent-chat.js +15 -2
  222. package/dist/client/agent-chat.js.map +1 -1
  223. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  224. package/dist/client/composer/PromptComposer.js +35 -1
  225. package/dist/client/composer/PromptComposer.js.map +1 -1
  226. package/dist/client/org/OrgSwitcher.js +1 -1
  227. package/dist/client/org/OrgSwitcher.js.map +1 -1
  228. package/dist/client/sharing/ShareButton.d.ts +1 -1
  229. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  230. package/dist/client/sharing/ShareButton.js +2 -15
  231. package/dist/client/sharing/ShareButton.js.map +1 -1
  232. package/dist/collab/presence.d.ts +1 -1
  233. package/dist/collab/presence.js +1 -1
  234. package/dist/collab/presence.js.map +1 -1
  235. package/dist/collab/routes.d.ts +1 -1
  236. package/dist/mcp/connect-route.d.ts.map +1 -1
  237. package/dist/mcp/connect-route.js +34 -5
  238. package/dist/mcp/connect-route.js.map +1 -1
  239. package/dist/notifications/routes.d.ts +3 -3
  240. package/dist/observability/routes.d.ts +3 -3
  241. package/dist/resources/handlers.d.ts +1 -1
  242. package/dist/server/action-discovery.d.ts.map +1 -1
  243. package/dist/server/action-discovery.js +5 -0
  244. package/dist/server/action-discovery.js.map +1 -1
  245. package/dist/server/agent-chat-plugin.d.ts +6 -0
  246. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  247. package/dist/server/agent-chat-plugin.js +12 -3
  248. package/dist/server/agent-chat-plugin.js.map +1 -1
  249. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  250. package/docs/content/locales/ar-SA/real-time-collaboration.mdx +2 -2
  251. package/docs/content/locales/ar-SA/template-design.mdx +1 -1
  252. package/docs/content/locales/de-DE/real-time-collaboration.mdx +3 -3
  253. package/docs/content/locales/de-DE/template-design.mdx +1 -1
  254. package/docs/content/locales/es-ES/real-time-collaboration.mdx +2 -2
  255. package/docs/content/locales/es-ES/template-design.mdx +1 -1
  256. package/docs/content/locales/fr-FR/real-time-collaboration.mdx +2 -2
  257. package/docs/content/locales/fr-FR/template-design.mdx +1 -1
  258. package/docs/content/locales/hi-IN/template-design.mdx +1 -1
  259. package/docs/content/locales/ja-JP/real-time-collaboration.mdx +2 -2
  260. package/docs/content/locales/ja-JP/template-design.mdx +1 -1
  261. package/docs/content/locales/ko-KR/real-time-collaboration.mdx +2 -2
  262. package/docs/content/locales/ko-KR/template-design.mdx +1 -1
  263. package/docs/content/locales/pt-BR/real-time-collaboration.mdx +2 -2
  264. package/docs/content/locales/pt-BR/template-design.mdx +1 -1
  265. package/docs/content/locales/zh-CN/real-time-collaboration.mdx +2 -2
  266. package/docs/content/locales/zh-CN/template-design.mdx +1 -1
  267. package/docs/content/locales/zh-TW/real-time-collaboration.mdx +2 -2
  268. package/docs/content/locales/zh-TW/template-design.mdx +1 -1
  269. package/docs/content/real-time-collaboration.mdx +2 -2
  270. package/docs/content/template-design.mdx +1 -1
  271. package/package.json +3 -7
  272. package/corpus/core/src/brand-kit/fig/decode.ts +0 -410
  273. package/corpus/core/src/brand-kit/fig/extract-design-system.ts +0 -947
  274. package/corpus/core/src/brand-kit/fig/fig-to-html.ts +0 -1906
  275. package/corpus/templates/design/actions/import-figma.ts +0 -55
  276. package/corpus/templates/design/changelog/2026-06-28-figma-style-code-design-mode.md +0 -6
  277. package/corpus/templates/design/server/handlers/import-figma-system.ts +0 -86
  278. package/corpus/templates/design/server/routes/api/import-figma-system.post.ts +0 -1
  279. package/corpus/templates/slides/server/handlers/import-figma-system.ts +0 -101
  280. package/corpus/templates/slides/server/routes/api/import-figma-system.post.ts +0 -1
  281. package/dist/brand-kit/fig/decode.d.ts +0 -33
  282. package/dist/brand-kit/fig/decode.d.ts.map +0 -1
  283. package/dist/brand-kit/fig/decode.js +0 -358
  284. package/dist/brand-kit/fig/decode.js.map +0 -1
  285. package/dist/brand-kit/fig/extract-design-system.d.ts +0 -44
  286. package/dist/brand-kit/fig/extract-design-system.d.ts.map +0 -1
  287. package/dist/brand-kit/fig/extract-design-system.js +0 -752
  288. package/dist/brand-kit/fig/extract-design-system.js.map +0 -1
  289. package/dist/brand-kit/fig/fig-to-html.d.ts +0 -246
  290. package/dist/brand-kit/fig/fig-to-html.d.ts.map +0 -1
  291. package/dist/brand-kit/fig/fig-to-html.js +0 -1506
  292. package/dist/brand-kit/fig/fig-to-html.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { IconPhotoPlus, IconX } from "@tabler/icons-react";
2
- import { useRef, useState } from "react";
2
+ import { useEffect, useRef, useState } from "react";
3
3
 
4
4
  import { Input } from "@/components/ui/input";
5
5
  import {
@@ -45,7 +45,7 @@ function imageFitMarker(fit: ImageFitMode): string {
45
45
 
46
46
  /**
47
47
  * Build the CSS `background` shorthand for an image fill.
48
- * Maps Figma's fit semantics onto background-size / background-repeat:
48
+ * Maps the design editor's fit semantics onto background-size / background-repeat:
49
49
  * - Fill → cover, no-repeat
50
50
  * - Fit → contain, no-repeat
51
51
  * - Crop → cover, no-repeat (cropped to the box; identical CSS to Fill but
@@ -79,6 +79,11 @@ export function parseImageFillCss(value: string): ImageFillValue | null {
79
79
  const url = match[2];
80
80
  const marker = value.match(FIT_MARKER_RE)?.[1] as ImageFitMode | undefined;
81
81
  if (marker) return { url, fit: marker };
82
+ // Heuristic fallback when no marker comment is present (e.g. CSS pasted from
83
+ // DevTools or Figma inspect). Note: "crop" and "fill" produce identical CSS
84
+ // (center / cover no-repeat), so external CSS without the marker comment will
85
+ // always parse as "fill". Crop mode is only recoverable via the proprietary
86
+ // agent-native-image-fit marker written by imageFillToCss.
82
87
  let fit: ImageFitMode = "fill";
83
88
  if (/contain/i.test(value)) fit = "fit";
84
89
  else if (/repeat(?!\s+no)/i.test(value) && !/no-repeat/i.test(value))
@@ -105,6 +110,10 @@ export function ImageFillControls({
105
110
  const fileInputRef = useRef<HTMLInputElement>(null);
106
111
  const [urlDraft, setUrlDraft] = useState(value.url);
107
112
 
113
+ useEffect(() => {
114
+ setUrlDraft(value.url);
115
+ }, [value.url]);
116
+
108
117
  const commitUrl = () => {
109
118
  onChange({ ...value, url: urlDraft.trim() });
110
119
  };
@@ -132,7 +141,7 @@ export function ImageFillControls({
132
141
  className="relative h-24 w-full overflow-hidden rounded-md border border-border/60"
133
142
  style={{
134
143
  backgroundImage: value.url
135
- ? `url("${value.url}")`
144
+ ? `url("${value.url.trim().replace(/["')]/g, encodeURIComponent)}")`
136
145
  : CHECKERBOARD_IMAGE,
137
146
  backgroundSize: value.url
138
147
  ? value.fit === "fit"
@@ -142,7 +151,7 @@ export function ImageFillControls({
142
151
  : "cover"
143
152
  : "8px 8px, 8px 8px, 8px 8px, 8px 8px",
144
153
  backgroundRepeat: value.fit === "tile" ? "repeat" : "no-repeat",
145
- backgroundPosition: "center",
154
+ backgroundPosition: value.fit === "tile" ? "top left" : "center",
146
155
  }}
147
156
  >
148
157
  {!value.url && (
@@ -8,30 +8,30 @@ Do NOT rely on line numbers — they drift. Use the search strings instead.
8
8
 
9
9
  ---
10
10
 
11
- ## (a) FigmaColorPicker.tsx — Add `"shader"` fill type
11
+ ## (a) DesignColorPicker.tsx — Add `"shader"` fill type
12
12
 
13
- **File:** `app/components/design/inspector/FigmaColorPicker.tsx`
13
+ **File:** `app/components/design/inspector/DesignColorPicker.tsx`
14
14
 
15
- ### 1. Extend `FigmaFillType`
15
+ ### 1. Extend `DesignFillType`
16
16
 
17
17
  Search for:
18
18
 
19
19
  ```ts
20
- export type FigmaFillType = "solid" | "gradient" | "image";
20
+ export type DesignFillType = "solid" | "gradient" | "image";
21
21
  ```
22
22
 
23
23
  Replace with:
24
24
 
25
25
  ```ts
26
- export type FigmaFillType = "solid" | "gradient" | "image" | "shader";
26
+ export type DesignFillType = "solid" | "gradient" | "image" | "shader";
27
27
  ```
28
28
 
29
- ### 2. Extend `FigmaPaintType`
29
+ ### 2. Extend `DesignPaintType`
30
30
 
31
31
  Search for:
32
32
 
33
33
  ```ts
34
- export type FigmaPaintType =
34
+ export type DesignPaintType =
35
35
  | "solid"
36
36
  | "linear"
37
37
  | "radial"
@@ -43,7 +43,7 @@ export type FigmaPaintType =
43
43
  Replace with:
44
44
 
45
45
  ```ts
46
- export type FigmaPaintType =
46
+ export type DesignPaintType =
47
47
  | "solid"
48
48
  | "linear"
49
49
  | "radial"
@@ -53,7 +53,7 @@ export type FigmaPaintType =
53
53
  | "shader";
54
54
  ```
55
55
 
56
- ### 3. Add `canUseShaders` prop to `FigmaColorPickerProps`
56
+ ### 3. Add `canUseShaders` prop to `DesignColorPickerProps`
57
57
 
58
58
  Search for:
59
59
 
@@ -407,10 +407,10 @@ shader token picker.
407
407
 
408
408
  ## Integration Checklist
409
409
 
410
- - [ ] `FigmaColorPicker.tsx` — `FigmaFillType` includes `"shader"`
411
- - [ ] `FigmaColorPicker.tsx` — `FigmaPaintType` includes `"shader"`
412
- - [ ] `FigmaColorPicker.tsx` — shader button renders in paint-type row
413
- - [ ] `FigmaColorPicker.tsx` — `ShaderControls` renders when `paintType === "shader"`
410
+ - [ ] `DesignColorPicker.tsx` — `DesignFillType` includes `"shader"`
411
+ - [ ] `DesignColorPicker.tsx` — `DesignPaintType` includes `"shader"`
412
+ - [ ] `DesignColorPicker.tsx` — shader button renders in paint-type row
413
+ - [ ] `DesignColorPicker.tsx` — `ShaderControls` renders when `paintType === "shader"`
414
414
  - [ ] `EditPanel.tsx` — `ShaderEffectRow` renders in `EffectsProperties`
415
415
  - [ ] `EditPanel.tsx` — "Add Shader" option in effects dropdown
416
416
  - [ ] `actions/apply-shader.ts` exists
@@ -78,7 +78,7 @@ export function ScrubInput({
78
78
  const dragRef = useRef({
79
79
  pointerId: -1,
80
80
  startX: 0,
81
- startValue: value,
81
+ prevX: 0,
82
82
  hasDragged: false,
83
83
  });
84
84
 
@@ -112,7 +112,7 @@ export function ScrubInput({
112
112
  event.preventDefault();
113
113
  const direction = event.key === "ArrowUp" ? 1 : -1;
114
114
  // getScrubStepFromEvent handles shiftKey (×10) and altKey (÷10).
115
- // Cmd (metaKey) mirrors Shift for ×10 — Figma convention on macOS.
115
+ // Cmd (metaKey) mirrors Shift for ×10 — editor convention on macOS.
116
116
  const baseStep = getScrubStepFromEvent(event, step);
117
117
  const cmdMultiplier = event.metaKey && !event.shiftKey ? 10 : 1;
118
118
  setNextValue(value + direction * baseStep * cmdMultiplier, {
@@ -143,7 +143,7 @@ export function ScrubInput({
143
143
  dragRef.current = {
144
144
  pointerId: event.pointerId,
145
145
  startX: event.clientX,
146
- startValue: value,
146
+ prevX: event.clientX,
147
147
  hasDragged: false,
148
148
  };
149
149
  event.currentTarget.setPointerCapture(event.pointerId);
@@ -152,12 +152,16 @@ export function ScrubInput({
152
152
 
153
153
  const handlePointerMove = (event: PointerEvent<HTMLLabelElement>) => {
154
154
  if (!dragging || dragRef.current.pointerId !== event.pointerId) return;
155
- const delta = event.clientX - dragRef.current.startX;
156
- if (delta === 0) return;
155
+ const incr = event.clientX - dragRef.current.prevX;
156
+ if (incr === 0) return;
157
+ dragRef.current.prevX = event.clientX;
157
158
  dragRef.current.hasDragged = true;
159
+ // Use incremental deltas from the last move so that clamped/rounded values
160
+ // committed by onChange are respected. A total-delta approach would create
161
+ // a dead zone equal to the amount dragged past the clamp boundary.
158
162
  const next =
159
- dragRef.current.startValue +
160
- delta *
163
+ value +
164
+ incr *
161
165
  getScrubStepFromEvent(
162
166
  { altKey: event.altKey, shiftKey: event.shiftKey },
163
167
  step,
@@ -171,7 +175,7 @@ export function ScrubInput({
171
175
  const wasDrag = dragRef.current.hasDragged;
172
176
  setDragging(false);
173
177
  // If the pointer was released without dragging (a plain click), focus the
174
- // input so the user can type immediately — mirrors Figma's label click
178
+ // input so the user can type immediately — mirrors the design editor's label click
175
179
  // behaviour (the event.preventDefault() in handlePointerDown blocks the
176
180
  // native label→input focus transfer).
177
181
  if (!wasDrag && !disabled) {
@@ -227,7 +231,7 @@ export function ScrubInput({
227
231
  onChange={(event) => setDraft(event.target.value)}
228
232
  onKeyDown={handleKeyDown}
229
233
  className={cn(
230
- // Compact Figma-style: h-6, 11px tabular text, ring-1 with no offset.
234
+ // Compact design-editor: h-6, 11px tabular text, ring-1 with no offset.
231
235
  "h-6 text-[11px] tabular-nums",
232
236
  "focus-visible:ring-1 focus-visible:ring-offset-0",
233
237
  inputClassName,
@@ -151,7 +151,7 @@ function ParamLabel({ children }: { children: React.ReactNode }) {
151
151
  }
152
152
 
153
153
  // ---------------------------------------------------------------------------
154
- // Color swatch button — Figma style: rounded rect swatch + hex label inline
154
+ // Color swatch button — design-editor style: rounded rect swatch + hex label inline
155
155
  // ---------------------------------------------------------------------------
156
156
 
157
157
  interface ColorSwatchProps {
@@ -161,6 +161,14 @@ interface ColorSwatchProps {
161
161
  }
162
162
 
163
163
  function ColorSwatch({ color, label, onChange }: ColorSwatchProps) {
164
+ // <input type="color"> only accepts 6-digit hex; strip any alpha suffix before
165
+ // passing as value, then reattach it when the user picks a new color so alpha
166
+ // is preserved rather than silently dropped.
167
+ const sixDigit =
168
+ color.length === 9 && color.startsWith("#") ? color.slice(0, 7) : color;
169
+ const alphaSuffix =
170
+ color.length === 9 && color.startsWith("#") ? color.slice(7) : "";
171
+
164
172
  return (
165
173
  <Tooltip>
166
174
  <TooltipTrigger asChild>
@@ -178,8 +186,8 @@ function ColorSwatch({ color, label, onChange }: ColorSwatchProps) {
178
186
  </span>
179
187
  <input
180
188
  type="color"
181
- value={color}
182
- onChange={(e) => onChange(e.target.value)}
189
+ value={sixDigit}
190
+ onChange={(e) => onChange(e.target.value + alphaSuffix)}
183
191
  className="sr-only"
184
192
  aria-label={label}
185
193
  />
@@ -387,11 +395,12 @@ export function ShaderControls({
387
395
  }
388
396
  }
389
397
 
398
+ setAnimated(false);
390
399
  onChange({
391
400
  preset: newPreset.name,
392
401
  params: defaults,
393
402
  colors: newPreset.defaultColors ?? undefined,
394
- speed: descriptor.speed,
403
+ speed: 0,
395
404
  frame: descriptor.frame,
396
405
  });
397
406
  }
@@ -287,13 +287,13 @@ export function ShaderFillsPanel({
287
287
  );
288
288
  }
289
289
 
290
- // ── Browse view: Figma-style title + search + Created by you + By Figma ───
290
+ // ── Browse view: design-editor title + search + Created by you + Library presets ───
291
291
  return (
292
292
  <div className="flex flex-col">
293
293
  {/* Header: "Shader fills" title + + button + × button */}
294
294
  <div className="flex h-6 items-center gap-1 px-3">
295
295
  <span className="flex-1 truncate text-[11px] font-semibold text-foreground">
296
- {"Shader fills" /* i18n-ignore Figma panel title */}
296
+ {"Shader fills" /* i18n-ignore design panel title */}
297
297
  </span>
298
298
  <Tooltip>
299
299
  <TooltipTrigger asChild>
@@ -351,7 +351,7 @@ export function ShaderFillsPanel({
351
351
  {!search && (
352
352
  <section className="mb-3">
353
353
  <p className="mb-1.5 text-[10px] font-semibold text-muted-foreground">
354
- {"Created by you" /* i18n-ignore Figma section */}
354
+ {"Created by you" /* i18n-ignore design section */}
355
355
  </p>
356
356
  {/* 2-col grid — "Create new" tile occupies the first cell */}
357
357
  <div className="grid grid-cols-2 gap-2">
@@ -372,18 +372,18 @@ export function ShaderFillsPanel({
372
372
  </span>
373
373
  <IconPlus className="size-4" />
374
374
  <span className="text-[10px]">
375
- {"Create new" /* i18n-ignore Figma create tile */}
375
+ {"Create new" /* i18n-ignore design create tile */}
376
376
  </span>
377
377
  </button>
378
378
  </div>
379
379
  </section>
380
380
  )}
381
381
 
382
- {/* ── By Figma — 2-col preset thumbnail grid ── */}
382
+ {/* ── Library presets — 2-col preset thumbnail grid ── */}
383
383
  <section>
384
384
  {!search && (
385
385
  <p className="mb-1.5 text-[10px] font-semibold text-muted-foreground">
386
- {"By Figma" /* i18n-ignore Figma section */}
386
+ {"Library presets" /* i18n-ignore design section */}
387
387
  </p>
388
388
  )}
389
389
  {filtered.length === 0 ? (
@@ -378,7 +378,7 @@ export function IconResizeToFit({ className }: IconProps) {
378
378
  }
379
379
 
380
380
  // Auto-layout toggle "on" — rounded rectangle with two small boxes arranged in a row inside
381
- // Matches Figma's blue auto-layout indicator glyph
381
+ // Matches the design editor's blue auto-layout indicator glyph
382
382
  export function IconAutoLayoutOn({ className }: IconProps) {
383
383
  return (
384
384
  <svg
@@ -583,7 +583,7 @@ export function IconAlignRight({ className }: IconProps) {
583
583
  }
584
584
 
585
585
  // ─────────────────────────────────────────────────
586
- // W/H sizing-menu glyphs (Figma resizing dropdown rows)
586
+ // W/H sizing-menu glyphs (design resizing dropdown rows)
587
587
  // ─────────────────────────────────────────────────
588
588
 
589
589
  // Sizing: Fixed — a bar bounded by two end-stops (⊢ / fixed dimension)
@@ -36,18 +36,18 @@ export {
36
36
  type ExportSettingsValue,
37
37
  } from "./ExportSettingsPanel";
38
38
  export {
39
- FigmaColorPicker,
40
- type FigmaColorMode,
41
- type FigmaColorPickerLabels,
42
- type FigmaColorPickerProps,
43
- type FigmaFillRow,
44
- type FigmaFillRowPatch,
45
- type FigmaFillType,
46
- type FigmaGradientStop,
47
- type FigmaGradientStopPatch,
48
- type FigmaGradientType,
49
- type FigmaPaintType,
50
- } from "./FigmaColorPicker";
39
+ DesignColorPicker,
40
+ type DesignColorMode,
41
+ type DesignColorPickerLabels,
42
+ type DesignColorPickerProps,
43
+ type DesignFillRow,
44
+ type DesignFillRowPatch,
45
+ type DesignFillType,
46
+ type DesignGradientStop,
47
+ type DesignGradientStopPatch,
48
+ type DesignGradientType,
49
+ type DesignPaintType,
50
+ } from "./DesignColorPicker";
51
51
  export {
52
52
  GradientEditor,
53
53
  defaultGradient,
@@ -69,9 +69,12 @@ export function getScrubStepFromEvent(
69
69
  event: Pick<KeyboardEvent | PointerEvent, "altKey" | "shiftKey">,
70
70
  step: number,
71
71
  ): number {
72
+ // Alt (fine-step) and Shift (coarse) are mutually exclusive — alt takes
73
+ // priority, matching Figma's modifier convention. Applying both independently
74
+ // would make Shift+Alt a no-op (×10 × 0.1 = ×1).
72
75
  let multiplier = 1;
73
- if (event.shiftKey) multiplier *= 10;
74
- if (event.altKey) multiplier *= 0.1;
76
+ if (event.altKey) multiplier = 0.1;
77
+ else if (event.shiftKey) multiplier = 10;
75
78
  return step * multiplier;
76
79
  }
77
80
 
@@ -307,7 +307,7 @@ export default function PromptPopover({
307
307
  panel.style.left = left + "px";
308
308
  panel.style.right = "auto";
309
309
  panel.style.transform = "none";
310
- });
310
+ }, [open, centered, anchorRef]);
311
311
 
312
312
  // Close on outside click / escape
313
313
  useEffect(() => {
@@ -410,7 +410,7 @@ export default function PromptPopover({
410
410
  if (name !== "chooseImage" && name !== "chooseAsset") return;
411
411
  const url = pickedAssetImageSource(payload);
412
412
  if (!url) {
413
- toast.error("Assets did not return an image URL.");
413
+ toast.error(t("promptDialog.assetsNoImageUrl"));
414
414
  return;
415
415
  }
416
416
 
@@ -433,7 +433,7 @@ export default function PromptPopover({
433
433
  setAssetsPickerOpen(false);
434
434
  toast.success(t("promptDialog.assetAdded"));
435
435
  },
436
- [],
436
+ [t],
437
437
  );
438
438
 
439
439
  const removePickedAsset = useCallback((path: string) => {
@@ -2,6 +2,7 @@ import {
2
2
  AgentSidebar,
3
3
  isEmbedAuthActive,
4
4
  getBrowserTabId,
5
+ useSession,
5
6
  useT,
6
7
  } from "@agent-native/core/client";
7
8
  import { IconMenu2 } from "@tabler/icons-react";
@@ -44,9 +45,11 @@ const BARE_PREFIXES = ["/present/"];
44
45
  const EDITOR_PREFIXES = ["/design/", "/extensions"];
45
46
 
46
47
  export function Layout({ children }: LayoutProps) {
47
- useNavigationState();
48
48
  const location = useLocation();
49
49
  const t = useT();
50
+ const { session } = useSession();
51
+ const hasSession = Boolean(session?.email);
52
+ useNavigationState(hasSession);
50
53
  const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
51
54
  const openMobileSidebar = useCallback(() => setMobileSidebarOpen(true), []);
52
55
 
@@ -78,7 +81,7 @@ export function Layout({ children }: LayoutProps) {
78
81
  const showMobileTopBar = !isDesignEditor;
79
82
  const embedded = isEmbedAuthActive();
80
83
 
81
- if (embedded) {
84
+ if (embedded || (isDesignEditor && !hasSession)) {
82
85
  return (
83
86
  <HeaderActionsProvider>
84
87
  <MobileSidebarContext.Provider value={null}>
@@ -62,7 +62,7 @@ export function Sidebar() {
62
62
  return (
63
63
  <aside
64
64
  className={cn(
65
- "flex h-full min-w-0 shrink-0 flex-col overflow-hidden border-e border-border bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out",
65
+ "flex h-full min-w-0 shrink-0 flex-col overflow-hidden bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out",
66
66
  collapsed ? "w-14" : "w-56",
67
67
  )}
68
68
  >