@agent-native/core 0.86.0 → 0.87.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.
Files changed (1331) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +21 -0
  3. package/corpus/core/docs/content/components.mdx +13 -0
  4. package/corpus/core/docs/content/creating-templates.mdx +7 -0
  5. package/corpus/core/docs/content/locales/ar-SA/components.mdx +9 -0
  6. package/corpus/core/docs/content/locales/ar-SA/creating-templates.mdx +2 -0
  7. package/corpus/core/docs/content/locales/ar-SA/template-analytics.mdx +6 -0
  8. package/corpus/core/docs/content/locales/ar-SA/template-clips.mdx +7 -0
  9. package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +6 -0
  10. package/corpus/core/docs/content/locales/de-DE/components.mdx +9 -0
  11. package/corpus/core/docs/content/locales/de-DE/creating-templates.mdx +2 -0
  12. package/corpus/core/docs/content/locales/de-DE/template-analytics.mdx +6 -0
  13. package/corpus/core/docs/content/locales/de-DE/template-clips.mdx +7 -0
  14. package/corpus/core/docs/content/locales/de-DE/tracking.mdx +6 -0
  15. package/corpus/core/docs/content/locales/es-ES/components.mdx +9 -0
  16. package/corpus/core/docs/content/locales/es-ES/creating-templates.mdx +2 -0
  17. package/corpus/core/docs/content/locales/es-ES/template-analytics.mdx +6 -0
  18. package/corpus/core/docs/content/locales/es-ES/template-clips.mdx +7 -0
  19. package/corpus/core/docs/content/locales/es-ES/tracking.mdx +6 -0
  20. package/corpus/core/docs/content/locales/fr-FR/components.mdx +9 -0
  21. package/corpus/core/docs/content/locales/fr-FR/creating-templates.mdx +2 -0
  22. package/corpus/core/docs/content/locales/fr-FR/template-analytics.mdx +6 -0
  23. package/corpus/core/docs/content/locales/fr-FR/template-clips.mdx +7 -0
  24. package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +6 -0
  25. package/corpus/core/docs/content/locales/hi-IN/components.mdx +9 -0
  26. package/corpus/core/docs/content/locales/hi-IN/creating-templates.mdx +2 -0
  27. package/corpus/core/docs/content/locales/hi-IN/template-analytics.mdx +6 -0
  28. package/corpus/core/docs/content/locales/hi-IN/template-clips.mdx +7 -0
  29. package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +6 -0
  30. package/corpus/core/docs/content/locales/ja-JP/components.mdx +9 -0
  31. package/corpus/core/docs/content/locales/ja-JP/creating-templates.mdx +2 -0
  32. package/corpus/core/docs/content/locales/ja-JP/template-analytics.mdx +6 -0
  33. package/corpus/core/docs/content/locales/ja-JP/template-clips.mdx +7 -0
  34. package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +6 -0
  35. package/corpus/core/docs/content/locales/ko-KR/components.mdx +9 -0
  36. package/corpus/core/docs/content/locales/ko-KR/creating-templates.mdx +2 -0
  37. package/corpus/core/docs/content/locales/ko-KR/template-analytics.mdx +6 -0
  38. package/corpus/core/docs/content/locales/ko-KR/template-clips.mdx +7 -0
  39. package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +6 -0
  40. package/corpus/core/docs/content/locales/pt-BR/components.mdx +9 -0
  41. package/corpus/core/docs/content/locales/pt-BR/creating-templates.mdx +2 -0
  42. package/corpus/core/docs/content/locales/pt-BR/template-analytics.mdx +6 -0
  43. package/corpus/core/docs/content/locales/pt-BR/template-clips.mdx +7 -0
  44. package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +6 -0
  45. package/corpus/core/docs/content/locales/zh-CN/components.mdx +9 -0
  46. package/corpus/core/docs/content/locales/zh-CN/creating-templates.mdx +2 -0
  47. package/corpus/core/docs/content/locales/zh-CN/template-analytics.mdx +6 -0
  48. package/corpus/core/docs/content/locales/zh-CN/template-clips.mdx +7 -0
  49. package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +6 -0
  50. package/corpus/core/docs/content/locales/zh-TW/components.mdx +9 -0
  51. package/corpus/core/docs/content/locales/zh-TW/creating-templates.mdx +2 -0
  52. package/corpus/core/docs/content/locales/zh-TW/template-analytics.mdx +6 -0
  53. package/corpus/core/docs/content/locales/zh-TW/template-clips.mdx +7 -0
  54. package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +6 -0
  55. package/corpus/core/docs/content/template-analytics.mdx +6 -0
  56. package/corpus/core/docs/content/template-clips.mdx +7 -0
  57. package/corpus/core/docs/content/tracking.mdx +6 -0
  58. package/corpus/core/package.json +9 -1
  59. package/corpus/core/src/application-state/emitter.ts +37 -5
  60. package/corpus/core/src/cli/create.ts +55 -3
  61. package/corpus/core/src/cli/workspacify.ts +10 -4
  62. package/corpus/core/src/client/AgentPanel.tsx +10 -0
  63. package/corpus/core/src/client/AssistantChat.tsx +91 -27
  64. package/corpus/core/src/client/ErrorBoundary.tsx +67 -12
  65. package/corpus/core/src/client/ErrorReportActions.tsx +69 -0
  66. package/corpus/core/src/client/FeedbackButton.tsx +8 -4
  67. package/corpus/core/src/client/components/ui/dialog.tsx +1 -91
  68. package/corpus/core/src/client/components/ui/dropdown-menu.tsx +1 -191
  69. package/corpus/core/src/client/components/ui/hover-card.tsx +1 -29
  70. package/corpus/core/src/client/components/ui/popover.tsx +1 -31
  71. package/corpus/core/src/client/components/ui/sheet.tsx +1 -96
  72. package/corpus/core/src/client/components/ui/tooltip.tsx +1 -53
  73. package/corpus/core/src/client/db-admin/DbAdminPage.tsx +41 -13
  74. package/corpus/core/src/client/db-admin/SqlEditor.tsx +10 -3
  75. package/corpus/core/src/client/db-admin/TableEditor.tsx +12 -5
  76. package/corpus/core/src/client/db-admin/useAgentSync.ts +10 -3
  77. package/corpus/core/src/client/db-admin/useDbAdmin.ts +65 -16
  78. package/corpus/core/src/client/error-reporting.ts +100 -0
  79. package/corpus/core/src/client/index.ts +11 -0
  80. package/corpus/core/src/client/org/RequireActiveOrg.tsx +12 -0
  81. package/corpus/core/src/client/visual-style-controls.tsx +615 -2
  82. package/corpus/core/src/db-admin/index.ts +26 -0
  83. package/corpus/core/src/db-admin/operations.ts +87 -49
  84. package/corpus/core/src/localization/default-messages.ts +4 -0
  85. package/corpus/core/src/secrets/crypto.ts +47 -9
  86. package/corpus/core/src/server/agent-access.ts +72 -0
  87. package/corpus/core/src/server/builder-design-systems.ts +328 -9
  88. package/corpus/core/src/server/h3-helpers.ts +14 -2
  89. package/corpus/core/src/server/index.ts +34 -0
  90. package/corpus/core/src/server/request-context.ts +64 -7
  91. package/corpus/core/src/shared/agent-access.ts +112 -0
  92. package/corpus/core/src/shared/index.ts +14 -0
  93. package/corpus/core/src/templates/default/app/root.tsx +47 -0
  94. package/corpus/templates/analytics/AGENTS.md +10 -4
  95. package/corpus/templates/analytics/actions/delete-db-admin-connection.ts +19 -0
  96. package/corpus/templates/analytics/actions/list-db-admin-connections.ts +18 -0
  97. package/corpus/templates/analytics/actions/navigate.ts +17 -3
  98. package/corpus/templates/analytics/actions/save-db-admin-connection.ts +33 -0
  99. package/corpus/templates/analytics/actions/view-screen.ts +11 -3
  100. package/corpus/templates/analytics/app/components/InlineMetric.tsx +2 -2
  101. package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +7 -2
  102. package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +16 -11
  103. package/corpus/templates/analytics/app/components/dashboard/DateRangePicker.tsx +2 -1
  104. package/corpus/templates/analytics/app/components/dashboard/MetricCard.tsx +7 -2
  105. package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +6 -3
  106. package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +6 -1
  107. package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +7 -2
  108. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +15 -11
  109. package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +7 -1
  110. package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +7 -2
  111. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +16 -16
  112. package/corpus/templates/analytics/app/components/layout/HeaderActions.tsx +1 -2
  113. package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +5 -2
  114. package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +6 -6
  115. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +3 -4
  116. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +12 -9
  117. package/corpus/templates/analytics/app/components/ui/calendar.tsx +1 -1
  118. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +11 -2
  119. package/corpus/templates/analytics/app/i18n/zh-TW.ts +23 -2
  120. package/corpus/templates/analytics/app/i18n-data.ts +230 -20
  121. package/corpus/templates/analytics/app/pages/Agents.tsx +406 -12
  122. package/corpus/templates/analytics/app/pages/DataDictionary.tsx +21 -21
  123. package/corpus/templates/analytics/app/pages/DataSources.tsx +28 -28
  124. package/corpus/templates/analytics/app/pages/NotFound.tsx +1 -2
  125. package/corpus/templates/analytics/app/pages/Placeholder.tsx +1 -2
  126. package/corpus/templates/analytics/app/pages/Settings.tsx +16 -16
  127. package/corpus/templates/analytics/app/pages/adhoc/DashboardSkeleton.tsx +2 -3
  128. package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +13 -8
  129. package/corpus/templates/analytics/app/pages/adhoc/_shared/components/DateRangeInput.tsx +2 -1
  130. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ChartTypePicker.tsx +4 -2
  131. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/DateRangePicker.tsx +2 -1
  132. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventCombobox.tsx +7 -7
  133. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventPanel.tsx +1 -2
  134. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventRow.tsx +1 -2
  135. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ExplorerChart.tsx +8 -3
  136. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/FilterBuilder.tsx +4 -5
  137. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/GroupByPicker.tsx +1 -2
  138. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +7 -7
  139. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +7 -7
  140. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +1 -1
  141. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +16 -16
  142. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +21 -16
  143. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +32 -32
  144. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +14 -14
  145. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +13 -14
  146. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +21 -13
  147. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +28 -23
  148. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewSqlPopover.tsx +12 -12
  149. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +15 -15
  150. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +33 -29
  151. package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +7 -8
  152. package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +19 -19
  153. package/corpus/templates/analytics/app/pages/analyses/LegacyFusionAnalysis.tsx +15 -11
  154. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +42 -23
  155. package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +12 -7
  156. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +12 -12
  157. package/corpus/templates/analytics/app/pages/settings/AlertRulesSettingsCard.tsx +25 -25
  158. package/corpus/templates/analytics/app/root.tsx +2 -2
  159. package/corpus/templates/analytics/app/routes/catalog.tsx +8 -8
  160. package/corpus/templates/analytics/changelog/2026-07-03-connect-other-app-databases-from-analytics.md +6 -0
  161. package/corpus/templates/analytics/package.json +1 -0
  162. package/corpus/templates/analytics/server/db/schema.ts +27 -0
  163. package/corpus/templates/analytics/server/lib/db-admin-connections.ts +458 -0
  164. package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +59 -59
  165. package/corpus/templates/analytics/server/plugins/db.ts +35 -0
  166. package/corpus/templates/analytics/server/routes/[base]/_agent-native/analytics-db-admin/[...path].ts +1 -0
  167. package/corpus/templates/analytics/server/routes/_agent-native/analytics-db-admin/[...path].ts +160 -0
  168. package/corpus/templates/analytics/shared/session-replay-agent-access.ts +14 -3
  169. package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +2 -3
  170. package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +9 -9
  171. package/corpus/templates/assets/app/components/layout/Header.tsx +4 -2
  172. package/corpus/templates/assets/app/components/layout/Layout.tsx +1 -1
  173. package/corpus/templates/assets/app/components/layout/PageShell.tsx +5 -6
  174. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +12 -12
  175. package/corpus/templates/assets/app/components/library/CreateLibraryDialog.tsx +8 -8
  176. package/corpus/templates/assets/app/components/library/EditLibraryDialog.tsx +7 -7
  177. package/corpus/templates/assets/app/components/library/LibraryCard.tsx +8 -8
  178. package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +2 -3
  179. package/corpus/templates/assets/app/root.tsx +1 -1
  180. package/corpus/templates/assets/app/routes/asset.$id.tsx +19 -19
  181. package/corpus/templates/assets/app/routes/audit.tsx +14 -15
  182. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +54 -49
  183. package/corpus/templates/assets/app/routes/library.tsx +31 -31
  184. package/corpus/templates/assets/app/routes/settings.tsx +18 -18
  185. package/corpus/templates/assets/package.json +1 -0
  186. package/corpus/templates/brain/app/components/brain/CanonicalPreviewSheet.tsx +5 -6
  187. package/corpus/templates/brain/app/components/brain/Surface.tsx +8 -3
  188. package/corpus/templates/brain/app/components/layout/Layout.tsx +7 -7
  189. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +6 -6
  190. package/corpus/templates/brain/app/routes/knowledge.tsx +19 -19
  191. package/corpus/templates/brain/app/routes/ops.tsx +18 -18
  192. package/corpus/templates/brain/app/routes/review.tsx +27 -22
  193. package/corpus/templates/brain/app/routes/search.tsx +20 -20
  194. package/corpus/templates/brain/app/routes/settings.tsx +22 -22
  195. package/corpus/templates/brain/app/routes/sources.tsx +23 -23
  196. package/corpus/templates/brain/package.json +1 -0
  197. package/corpus/templates/calendar/app/components/ThemeToggle.tsx +5 -5
  198. package/corpus/templates/calendar/app/components/TimezoneCombobox.tsx +6 -6
  199. package/corpus/templates/calendar/app/components/booking/BookingConfirmation.tsx +1 -2
  200. package/corpus/templates/calendar/app/components/booking/BookingForm.tsx +8 -9
  201. package/corpus/templates/calendar/app/components/booking/DatePicker.tsx +2 -2
  202. package/corpus/templates/calendar/app/components/booking/TimeSlotPicker.tsx +2 -3
  203. package/corpus/templates/calendar/app/components/calendar/AddCalendarDialog.tsx +15 -10
  204. package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +6 -6
  205. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +27 -27
  206. package/corpus/templates/calendar/app/components/calendar/DeleteEventDialog.tsx +12 -9
  207. package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +13 -10
  208. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +7 -7
  209. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +21 -21
  210. package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +11 -11
  211. package/corpus/templates/calendar/app/components/calendar/EventOptionControls.tsx +9 -9
  212. package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +9 -9
  213. package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +6 -6
  214. package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -3
  215. package/corpus/templates/calendar/app/components/calendar/GoogleSyncButton.tsx +1 -1
  216. package/corpus/templates/calendar/app/components/calendar/GuestNotificationDialog.tsx +10 -8
  217. package/corpus/templates/calendar/app/components/calendar/IntegrationsSidebar.tsx +12 -12
  218. package/corpus/templates/calendar/app/components/calendar/KeyboardShortcutsHelp.tsx +2 -2
  219. package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +1 -1
  220. package/corpus/templates/calendar/app/components/calendar/PeopleSearchDialog.tsx +6 -6
  221. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +6 -6
  222. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +2 -2
  223. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +16 -16
  224. package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +11 -11
  225. package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +50 -45
  226. package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -2
  227. package/corpus/templates/calendar/app/pages/BookingsList.tsx +12 -12
  228. package/corpus/templates/calendar/app/pages/CalendarView.tsx +17 -17
  229. package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +13 -13
  230. package/corpus/templates/calendar/app/pages/Settings.tsx +12 -12
  231. package/corpus/templates/calendar/app/routes/event.tsx +2 -2
  232. package/corpus/templates/calendar/package.json +1 -0
  233. package/corpus/templates/chat/app/components/layout/Header.tsx +4 -2
  234. package/corpus/templates/chat/app/components/layout/Layout.tsx +7 -7
  235. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +12 -12
  236. package/corpus/templates/chat/app/routes/database.tsx +1 -2
  237. package/corpus/templates/chat/app/routes/observability.tsx +1 -1
  238. package/corpus/templates/chat/app/routes/settings.tsx +5 -5
  239. package/corpus/templates/chat/package.json +1 -0
  240. package/corpus/templates/clips/AGENTS.md +5 -0
  241. package/corpus/templates/clips/actions/create-recording-agent-link.ts +15 -20
  242. package/corpus/templates/clips/actions/delete-recording-permanent.ts +74 -34
  243. package/corpus/templates/clips/app/components/capture-install-options.tsx +6 -6
  244. package/corpus/templates/clips/app/components/editable-recording-title.tsx +2 -2
  245. package/corpus/templates/clips/app/components/editor/chapters-editor.tsx +7 -7
  246. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +165 -3
  247. package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +101 -57
  248. package/corpus/templates/clips/app/components/editor/split-button.tsx +4 -5
  249. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +9 -9
  250. package/corpus/templates/clips/app/components/editor/thumbnail-picker.tsx +16 -11
  251. package/corpus/templates/clips/app/components/editor/timeline.tsx +4 -6
  252. package/corpus/templates/clips/app/components/editor/transcript-editor.tsx +5 -5
  253. package/corpus/templates/clips/app/components/editor/trim-handles.tsx +4 -7
  254. package/corpus/templates/clips/app/components/editor/waveform.tsx +13 -4
  255. package/corpus/templates/clips/app/components/layout/Header.tsx +4 -2
  256. package/corpus/templates/clips/app/components/layout/Layout.tsx +2 -3
  257. package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +4 -4
  258. package/corpus/templates/clips/app/components/library/create-space-dialog.tsx +8 -8
  259. package/corpus/templates/clips/app/components/library/empty-state.tsx +1 -2
  260. package/corpus/templates/clips/app/components/library/folder-tree.tsx +14 -14
  261. package/corpus/templates/clips/app/components/library/library-grid.tsx +7 -7
  262. package/corpus/templates/clips/app/components/library/library-layout.tsx +16 -16
  263. package/corpus/templates/clips/app/components/library/organization-switcher.tsx +11 -11
  264. package/corpus/templates/clips/app/components/library/recording-card.tsx +16 -12
  265. package/corpus/templates/clips/app/components/library/search-bar.tsx +5 -5
  266. package/corpus/templates/clips/app/components/library/sort-menu.tsx +3 -4
  267. package/corpus/templates/clips/app/components/library/tag-input.tsx +4 -4
  268. package/corpus/templates/clips/app/components/meetings/attendee-stack.tsx +6 -2
  269. package/corpus/templates/clips/app/components/meetings/auto-record-prompt.tsx +1 -1
  270. package/corpus/templates/clips/app/components/meetings/bullet-link.tsx +4 -4
  271. package/corpus/templates/clips/app/components/meetings/canvas-editor.tsx +5 -5
  272. package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +3 -3
  273. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +9 -9
  274. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +11 -6
  275. package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +4 -4
  276. package/corpus/templates/clips/app/components/player/access-password-prompt.tsx +2 -3
  277. package/corpus/templates/clips/app/components/player/comments-panel.tsx +14 -14
  278. package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +6 -7
  279. package/corpus/templates/clips/app/components/player/insights-panel.tsx +1 -2
  280. package/corpus/templates/clips/app/components/player/player-controls.tsx +15 -15
  281. package/corpus/templates/clips/app/components/player/reactions-tray.tsx +3 -3
  282. package/corpus/templates/clips/app/components/player/settings-panel.tsx +12 -13
  283. package/corpus/templates/clips/app/components/player/share-dialog.tsx +20 -11
  284. package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +2 -3
  285. package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +2 -2
  286. package/corpus/templates/clips/app/components/player/transcript-panel.tsx +7 -7
  287. package/corpus/templates/clips/app/components/player/video-player.tsx +9 -9
  288. package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +1 -1
  289. package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
  290. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +21 -21
  291. package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +5 -6
  292. package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +6 -7
  293. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +10 -10
  294. package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +9 -5
  295. package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +19 -9
  296. package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +9 -10
  297. package/corpus/templates/clips/app/components/workspace/members-list.tsx +10 -11
  298. package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +1 -2
  299. package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +2 -3
  300. package/corpus/templates/clips/app/components/workspace/top-videos-table.tsx +2 -3
  301. package/corpus/templates/clips/app/hooks/use-desktop-promo.ts +1 -2
  302. package/corpus/templates/clips/app/root.tsx +10 -10
  303. package/corpus/templates/clips/app/routes/_app.dictate.tsx +13 -13
  304. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +35 -26
  305. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +20 -20
  306. package/corpus/templates/clips/app/routes/_app.notifications.tsx +3 -3
  307. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +31 -31
  308. package/corpus/templates/clips/app/routes/_app.settings.organization.tsx +13 -8
  309. package/corpus/templates/clips/app/routes/_app.spaces._index.tsx +1 -1
  310. package/corpus/templates/clips/app/routes/_app.trash.tsx +10 -10
  311. package/corpus/templates/clips/app/routes/bug-report.done.tsx +1 -1
  312. package/corpus/templates/clips/app/routes/bug-report.tsx +11 -11
  313. package/corpus/templates/clips/app/routes/download.tsx +2 -2
  314. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +1 -1
  315. package/corpus/templates/clips/app/routes/invite.$token.tsx +13 -8
  316. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +28 -23
  317. package/corpus/templates/clips/app/routes/record.tsx +3 -3
  318. package/corpus/templates/clips/app/routes/share.$shareId.tsx +41 -20
  319. package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +2 -2
  320. package/corpus/templates/clips/changelog/2026-07-05-desktop-full-screen-recordings-with-system-audio-now-finaliz.md +6 -0
  321. package/corpus/templates/clips/changelog/2026-07-05-desktop-recording-shortcut-start-stop.md +6 -0
  322. package/corpus/templates/clips/changelog/2026-07-05-desktop-recordings-no-longer-fail-when-saved-capture-constra.md +6 -0
  323. package/corpus/templates/clips/changelog/2026-07-05-permanently-deleted-clips-now-clean-up-s3-media-objects.md +6 -0
  324. package/corpus/templates/clips/changelog/2026-07-05-timeline-zoom-controls-are-now-visible-in-the-clip-editor-an.md +6 -0
  325. package/corpus/templates/clips/desktop/src/app.tsx +98 -1
  326. package/corpus/templates/clips/desktop/src/components/MediaDeviceRow.tsx +3 -2
  327. package/corpus/templates/clips/desktop/src/lib/media-capture-constraints.ts +121 -0
  328. package/corpus/templates/clips/desktop/src/lib/recorder.ts +55 -84
  329. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +77 -39
  330. package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +60 -8
  331. package/corpus/templates/clips/package.json +1 -0
  332. package/corpus/templates/clips/server/lib/public-agent-context.ts +17 -12
  333. package/corpus/templates/clips/server/lib/recording-media-cleanup.ts +110 -0
  334. package/corpus/templates/clips/server/lib/s3-upload-provider.ts +126 -0
  335. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +47 -11
  336. package/corpus/templates/clips/shared/agent-context.ts +23 -21
  337. package/corpus/templates/content/app/blocks/contentBlockRegistry.tsx +4 -4
  338. package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
  339. package/corpus/templates/content/app/components/ThemeToggle.tsx +6 -6
  340. package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +5 -5
  341. package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +5 -5
  342. package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +1 -1
  343. package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +36 -36
  344. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +3 -3
  345. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +29 -29
  346. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +23 -23
  347. package/corpus/templates/content/app/components/editor/EmojiPicker.tsx +4 -5
  348. package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +4 -5
  349. package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
  350. package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +2 -2
  351. package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +5 -5
  352. package/corpus/templates/content/app/components/editor/TableHoverControls.tsx +13 -13
  353. package/corpus/templates/content/app/components/editor/VersionHistoryPanel.tsx +10 -10
  354. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +41 -41
  355. package/corpus/templates/content/app/components/editor/database/shared.tsx +19 -19
  356. package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +8 -9
  357. package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +18 -19
  358. package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +20 -21
  359. package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +8 -8
  360. package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +18 -19
  361. package/corpus/templates/content/app/components/layout/Header.tsx +4 -2
  362. package/corpus/templates/content/app/components/layout/Layout.tsx +3 -3
  363. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +22 -22
  364. package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +22 -22
  365. package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +11 -11
  366. package/corpus/templates/content/app/root.tsx +13 -5
  367. package/corpus/templates/content/app/routes/_app._index.tsx +1 -1
  368. package/corpus/templates/content/app/routes/_app.local-files.tsx +11 -11
  369. package/corpus/templates/content/app/routes/_app.settings.tsx +3 -3
  370. package/corpus/templates/content/changelog/2026-07-03-error-screens-now-include-a-feedback-button-with-debug-info.md +6 -0
  371. package/corpus/templates/content/package.json +1 -0
  372. package/corpus/templates/design/AGENTS.md +13 -7
  373. package/corpus/templates/design/actions/get-design-system.ts +21 -0
  374. package/corpus/templates/design/actions/index-design-system-with-builder.ts +14 -37
  375. package/corpus/templates/design/app/components/ThemeToggle.tsx +6 -6
  376. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +11 -11
  377. package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +2 -2
  378. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +21 -16
  379. package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +3 -3
  380. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +7 -7
  381. package/corpus/templates/design/app/components/design/EditPanel.tsx +30 -30
  382. package/corpus/templates/design/app/components/design/FusionAppBanner.tsx +8 -9
  383. package/corpus/templates/design/app/components/design/LayersPanel.tsx +14 -14
  384. package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +5 -6
  385. package/corpus/templates/design/app/components/design/MotionDock.tsx +15 -15
  386. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +3 -3
  387. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +3 -3
  388. package/corpus/templates/design/app/components/design/StatesPanel.tsx +13 -13
  389. package/corpus/templates/design/app/components/design/TokensPanel.tsx +14 -14
  390. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +6 -6
  391. package/corpus/templates/design/app/components/design/code-workbench/ActivityBar.tsx +3 -3
  392. package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +3 -3
  393. package/corpus/templates/design/app/components/design/code-workbench/SideBar.tsx +70 -9
  394. package/corpus/templates/design/app/components/design/code-workbench/editor/EditorTabs.tsx +17 -8
  395. package/corpus/templates/design/app/components/design/code-workbench/editor/MonacoHost.tsx +2 -3
  396. package/corpus/templates/design/app/components/design/code-workbench/editor/StatusBar.tsx +1 -1
  397. package/corpus/templates/design/app/components/design/code-workbench/explorer/ExplorerView.tsx +8 -2
  398. package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +24 -20
  399. package/corpus/templates/design/app/components/design/code-workbench/search/SearchView.tsx +6 -6
  400. package/corpus/templates/design/app/components/design/code-workbench/store.tsx +48 -0
  401. package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +3 -3
  402. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +7 -7
  403. package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +3 -3
  404. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +18 -18
  405. package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +6 -6
  406. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +6 -6
  407. package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +7 -7
  408. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +7 -7
  409. package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +14 -14
  410. package/corpus/templates/design/app/components/design/inspector/ShaderEffectRow.tsx +9 -9
  411. package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +6 -6
  412. package/corpus/templates/design/app/components/design-system/DesignSystemCard.tsx +2 -3
  413. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +18 -15
  414. package/corpus/templates/design/app/components/layout/Header.tsx +4 -2
  415. package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
  416. package/corpus/templates/design/app/components/layout/Sidebar.tsx +5 -5
  417. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +7 -7
  418. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +7 -7
  419. package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +3 -3
  420. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +6 -0
  421. package/corpus/templates/design/app/i18n/zh-TW.ts +15 -14
  422. package/corpus/templates/design/app/i18n-data.ts +154 -142
  423. package/corpus/templates/design/app/pages/DesignEditor.tsx +51 -47
  424. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +40 -22
  425. package/corpus/templates/design/app/pages/DesignSystems.tsx +32 -32
  426. package/corpus/templates/design/app/pages/Index.tsx +28 -28
  427. package/corpus/templates/design/app/pages/NotFound.tsx +1 -2
  428. package/corpus/templates/design/app/pages/Present.tsx +1 -2
  429. package/corpus/templates/design/app/pages/VisualEdit.tsx +1 -2
  430. package/corpus/templates/design/app/root.tsx +1 -1
  431. package/corpus/templates/design/app/routes/settings.tsx +3 -3
  432. package/corpus/templates/design/changelog/2026-07-03-design-system-setup-now-indexes-figma-code-and-design-md-sou.md +6 -0
  433. package/corpus/templates/design/changelog/2026-07-03-the-code-editor-is-easier-to-use-with-top-sidebar-tabs-clear.md +6 -0
  434. package/corpus/templates/design/package.json +1 -0
  435. package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +16 -106
  436. package/corpus/templates/forms/app/components/CloudUpgrade.tsx +10 -10
  437. package/corpus/templates/forms/app/components/ThemeToggle.tsx +5 -5
  438. package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +10 -11
  439. package/corpus/templates/forms/app/components/builder/FieldRenderer.tsx +13 -10
  440. package/corpus/templates/forms/app/components/layout/Header.tsx +4 -2
  441. package/corpus/templates/forms/app/components/layout/Layout.tsx +1 -1
  442. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +15 -15
  443. package/corpus/templates/forms/app/components/ui/calendar.tsx +1 -1
  444. package/corpus/templates/forms/app/components/ui/command.tsx +1 -1
  445. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +24 -24
  446. package/corpus/templates/forms/app/pages/FormFillPage.tsx +2 -2
  447. package/corpus/templates/forms/app/pages/FormsListPage.tsx +25 -25
  448. package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +11 -11
  449. package/corpus/templates/forms/app/pages/ResponsesPage.tsx +4 -4
  450. package/corpus/templates/forms/app/routes/_app.settings.tsx +5 -5
  451. package/corpus/templates/forms/app/routes/form-preview.tsx +3 -3
  452. package/corpus/templates/forms/package.json +1 -0
  453. package/corpus/templates/macros/app/components/AddExerciseDialog.tsx +1 -1
  454. package/corpus/templates/macros/app/components/AddMealDialog.tsx +1 -1
  455. package/corpus/templates/macros/app/components/AddWeightDialog.tsx +1 -1
  456. package/corpus/templates/macros/app/components/DailyProgress.tsx +7 -7
  457. package/corpus/templates/macros/app/components/WeeklyCaloriesChart.tsx +1 -2
  458. package/corpus/templates/macros/app/components/WeightCard.tsx +10 -10
  459. package/corpus/templates/macros/app/components/WeightTracker.tsx +1 -1
  460. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +11 -7
  461. package/corpus/templates/macros/app/components/layout/Header.tsx +4 -2
  462. package/corpus/templates/macros/app/root.tsx +1 -1
  463. package/corpus/templates/macros/app/routes/_index.tsx +1 -1
  464. package/corpus/templates/macros/app/routes/analytics.tsx +9 -9
  465. package/corpus/templates/macros/app/routes/settings.tsx +2 -2
  466. package/corpus/templates/macros/package.json +1 -0
  467. package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +1 -1
  468. package/corpus/templates/mail/app/components/ThemeToggle.tsx +6 -6
  469. package/corpus/templates/mail/app/components/agent-engine-picker.tsx +10 -10
  470. package/corpus/templates/mail/app/components/email/CodeBlockLangPicker.tsx +3 -4
  471. package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +5 -5
  472. package/corpus/templates/mail/app/components/email/ComposeEditor.tsx +9 -9
  473. package/corpus/templates/mail/app/components/email/ComposeModal.tsx +18 -18
  474. package/corpus/templates/mail/app/components/email/EmailList.tsx +17 -17
  475. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +5 -5
  476. package/corpus/templates/mail/app/components/email/EmailThread.tsx +6 -6
  477. package/corpus/templates/mail/app/components/email/InlineReplyComposer.tsx +11 -11
  478. package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +13 -13
  479. package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +13 -13
  480. package/corpus/templates/mail/app/components/email/RecipientInput.tsx +13 -13
  481. package/corpus/templates/mail/app/components/email/SendLaterButton.tsx +4 -5
  482. package/corpus/templates/mail/app/components/email/SnoozeModal.tsx +1 -1
  483. package/corpus/templates/mail/app/components/email/SnoozePopover.tsx +6 -6
  484. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +12 -12
  485. package/corpus/templates/mail/app/components/layout/SearchBar.tsx +5 -5
  486. package/corpus/templates/mail/app/components/settings/GmailFiltersSection.tsx +23 -23
  487. package/corpus/templates/mail/app/components/ui/calendar.tsx +1 -1
  488. package/corpus/templates/mail/app/components/ui/command.tsx +1 -1
  489. package/corpus/templates/mail/app/pages/DraftQueuePage.tsx +14 -14
  490. package/corpus/templates/mail/app/pages/NotFound.tsx +1 -2
  491. package/corpus/templates/mail/app/pages/SettingsPage.tsx +25 -25
  492. package/corpus/templates/mail/app/root.tsx +61 -2
  493. package/corpus/templates/mail/app/routes/_index.tsx +1 -2
  494. package/corpus/templates/mail/app/routes/email.tsx +2 -2
  495. package/corpus/templates/mail/changelog/2026-07-03-error-screens-now-include-a-feedback-button-with-debug-info.md +6 -0
  496. package/corpus/templates/mail/package.json +1 -0
  497. package/corpus/templates/plan/app/components/layout/Header.tsx +4 -2
  498. package/corpus/templates/plan/app/components/layout/Layout.tsx +5 -6
  499. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +20 -20
  500. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +2 -3
  501. package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +2 -2
  502. package/corpus/templates/plan/app/components/plan/GuestModeBanner.tsx +1 -2
  503. package/corpus/templates/plan/app/components/plan/LocalCodebasePicker.tsx +8 -8
  504. package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +1 -1
  505. package/corpus/templates/plan/app/components/plan/PlanImageViewer.tsx +83 -82
  506. package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +3 -3
  507. package/corpus/templates/plan/app/components/plan/planBlocks.tsx +4 -4
  508. package/corpus/templates/plan/app/i18n/ar-SA.ts +3 -0
  509. package/corpus/templates/plan/app/i18n/de-DE.ts +4 -0
  510. package/corpus/templates/plan/app/i18n/en-US.ts +4 -0
  511. package/corpus/templates/plan/app/i18n/es-ES.ts +4 -0
  512. package/corpus/templates/plan/app/i18n/fr-FR.ts +4 -0
  513. package/corpus/templates/plan/app/i18n/hi-IN.ts +3 -0
  514. package/corpus/templates/plan/app/i18n/ja-JP.ts +4 -0
  515. package/corpus/templates/plan/app/i18n/ko-KR.ts +4 -0
  516. package/corpus/templates/plan/app/i18n/pt-BR.ts +4 -0
  517. package/corpus/templates/plan/app/i18n/zh-CN.ts +3 -0
  518. package/corpus/templates/plan/app/i18n/zh-TW.ts +3 -0
  519. package/corpus/templates/plan/app/pages/PlansPage.tsx +158 -80
  520. package/corpus/templates/plan/app/root.tsx +1 -1
  521. package/corpus/templates/plan/app/routes/_index.tsx +2 -1
  522. package/corpus/templates/plan/app/routes/local-plans.$slug.tsx +1 -1
  523. package/corpus/templates/plan/app/routes/plans.$id.tsx +2 -1
  524. package/corpus/templates/plan/app/routes/plans.tsx +2 -1
  525. package/corpus/templates/plan/app/routes/recaps.$id.tsx +2 -1
  526. package/corpus/templates/plan/app/routes/recaps.tsx +2 -1
  527. package/corpus/templates/plan/app/routes/settings.tsx +5 -5
  528. package/corpus/templates/plan/changelog/2026-07-03-error-screens-now-include-a-feedback-button-with-debug-info.md +6 -0
  529. package/corpus/templates/plan/changelog/2026-07-05-images-in-plan-documents-open-reliably-in-the-full-size-prev.md +6 -0
  530. package/corpus/templates/plan/package.json +1 -0
  531. package/corpus/templates/slides/AGENTS.md +7 -3
  532. package/corpus/templates/slides/actions/get-design-system.ts +21 -0
  533. package/corpus/templates/slides/actions/import-file.ts +15 -7
  534. package/corpus/templates/slides/actions/index-design-system-with-builder.ts +14 -37
  535. package/corpus/templates/slides/app/components/ThemeToggle.tsx +6 -6
  536. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +5 -5
  537. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +7 -7
  538. package/corpus/templates/slides/app/components/deck/ExcalidrawSlide.tsx +1 -2
  539. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +1 -1
  540. package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -3
  541. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +45 -22
  542. package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +7 -7
  543. package/corpus/templates/slides/app/components/editor/BlockBubbleMenu.tsx +5 -5
  544. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +8 -8
  545. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +15 -17
  546. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +9 -10
  547. package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +5 -6
  548. package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +12 -12
  549. package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +3 -4
  550. package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +4 -5
  551. package/corpus/templates/slides/app/components/editor/ImportButton.tsx +3 -4
  552. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +1 -2
  553. package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +10 -10
  554. package/corpus/templates/slides/app/components/editor/SlideBubbleMenu.tsx +10 -10
  555. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +169 -160
  556. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +20 -17
  557. package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +56 -6
  558. package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +1 -1
  559. package/corpus/templates/slides/app/components/layout/Header.tsx +4 -2
  560. package/corpus/templates/slides/app/components/layout/Layout.tsx +7 -2
  561. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +5 -5
  562. package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +6 -6
  563. package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +7 -7
  564. package/corpus/templates/slides/app/i18n/ar-SA.ts +8 -7
  565. package/corpus/templates/slides/app/i18n/de-DE.ts +7 -8
  566. package/corpus/templates/slides/app/i18n/en-US.ts +8 -7
  567. package/corpus/templates/slides/app/i18n/es-ES.ts +7 -8
  568. package/corpus/templates/slides/app/i18n/fr-FR.ts +7 -8
  569. package/corpus/templates/slides/app/i18n/hi-IN.ts +8 -7
  570. package/corpus/templates/slides/app/i18n/ja-JP.ts +7 -8
  571. package/corpus/templates/slides/app/i18n/ko-KR.ts +7 -7
  572. package/corpus/templates/slides/app/i18n/pt-BR.ts +7 -8
  573. package/corpus/templates/slides/app/i18n/zh-CN.ts +8 -7
  574. package/corpus/templates/slides/app/i18n/zh-TW.ts +8 -7
  575. package/corpus/templates/slides/app/lib/canvas-zoom.ts +16 -1
  576. package/corpus/templates/slides/app/pages/DeckEditor.tsx +6 -6
  577. package/corpus/templates/slides/app/pages/DesignSystems.tsx +5 -5
  578. package/corpus/templates/slides/app/pages/Index.tsx +18 -15
  579. package/corpus/templates/slides/app/root.tsx +3 -3
  580. package/corpus/templates/slides/app/routes/settings.tsx +5 -5
  581. package/corpus/templates/slides/changelog/2026-07-03-design-system-setup-now-indexes-figma-code-and-design-md-sou.md +6 -0
  582. package/corpus/templates/slides/changelog/2026-07-03-slide-editing-now-keeps-thumbnails-speaker-notes-styling-and.md +6 -0
  583. package/corpus/templates/slides/package.json +1 -0
  584. package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +16 -104
  585. package/dist/application-state/emitter.d.ts +9 -2
  586. package/dist/application-state/emitter.d.ts.map +1 -1
  587. package/dist/application-state/emitter.js +25 -3
  588. package/dist/application-state/emitter.js.map +1 -1
  589. package/dist/cli/create.d.ts +2 -1
  590. package/dist/cli/create.d.ts.map +1 -1
  591. package/dist/cli/create.js +52 -4
  592. package/dist/cli/create.js.map +1 -1
  593. package/dist/cli/workspacify.d.ts +2 -0
  594. package/dist/cli/workspacify.d.ts.map +1 -1
  595. package/dist/cli/workspacify.js +8 -4
  596. package/dist/cli/workspacify.js.map +1 -1
  597. package/dist/client/AgentPanel.d.ts.map +1 -1
  598. package/dist/client/AgentPanel.js +2 -1
  599. package/dist/client/AgentPanel.js.map +1 -1
  600. package/dist/client/AssistantChat.d.ts.map +1 -1
  601. package/dist/client/AssistantChat.js +77 -25
  602. package/dist/client/AssistantChat.js.map +1 -1
  603. package/dist/client/ErrorBoundary.d.ts.map +1 -1
  604. package/dist/client/ErrorBoundary.js +37 -2
  605. package/dist/client/ErrorBoundary.js.map +1 -1
  606. package/dist/client/ErrorReportActions.d.ts +13 -0
  607. package/dist/client/ErrorReportActions.d.ts.map +1 -0
  608. package/dist/client/ErrorReportActions.js +14 -0
  609. package/dist/client/ErrorReportActions.js.map +1 -0
  610. package/dist/client/FeedbackButton.d.ts +3 -1
  611. package/dist/client/FeedbackButton.d.ts.map +1 -1
  612. package/dist/client/FeedbackButton.js +6 -5
  613. package/dist/client/FeedbackButton.js.map +1 -1
  614. package/dist/client/components/ui/dialog.d.ts +1 -13
  615. package/dist/client/components/ui/dialog.d.ts.map +1 -1
  616. package/dist/client/components/ui/dialog.js +1 -20
  617. package/dist/client/components/ui/dialog.js.map +1 -1
  618. package/dist/client/components/ui/dropdown-menu.d.ts +1 -27
  619. package/dist/client/components/ui/dropdown-menu.d.ts.map +1 -1
  620. package/dist/client/components/ui/dropdown-menu.js +1 -33
  621. package/dist/client/components/ui/dropdown-menu.js.map +1 -1
  622. package/dist/client/components/ui/hover-card.d.ts +1 -6
  623. package/dist/client/components/ui/hover-card.d.ts.map +1 -1
  624. package/dist/client/components/ui/hover-card.js +1 -9
  625. package/dist/client/components/ui/hover-card.js.map +1 -1
  626. package/dist/client/components/ui/popover.d.ts +1 -7
  627. package/dist/client/components/ui/popover.d.ts.map +1 -1
  628. package/dist/client/components/ui/popover.js +1 -10
  629. package/dist/client/components/ui/popover.js.map +1 -1
  630. package/dist/client/components/ui/sheet.d.ts +1 -15
  631. package/dist/client/components/ui/sheet.d.ts.map +1 -1
  632. package/dist/client/components/ui/sheet.js +1 -22
  633. package/dist/client/components/ui/sheet.js.map +1 -1
  634. package/dist/client/components/ui/tooltip.d.ts +1 -8
  635. package/dist/client/components/ui/tooltip.d.ts.map +1 -1
  636. package/dist/client/components/ui/tooltip.js +1 -17
  637. package/dist/client/components/ui/tooltip.js.map +1 -1
  638. package/dist/client/db-admin/DbAdminPage.d.ts +9 -1
  639. package/dist/client/db-admin/DbAdminPage.d.ts.map +1 -1
  640. package/dist/client/db-admin/DbAdminPage.js +17 -13
  641. package/dist/client/db-admin/DbAdminPage.js.map +1 -1
  642. package/dist/client/db-admin/SqlEditor.d.ts +3 -1
  643. package/dist/client/db-admin/SqlEditor.d.ts.map +1 -1
  644. package/dist/client/db-admin/SqlEditor.js +3 -3
  645. package/dist/client/db-admin/SqlEditor.js.map +1 -1
  646. package/dist/client/db-admin/TableEditor.d.ts +3 -1
  647. package/dist/client/db-admin/TableEditor.d.ts.map +1 -1
  648. package/dist/client/db-admin/TableEditor.js +6 -6
  649. package/dist/client/db-admin/TableEditor.js.map +1 -1
  650. package/dist/client/db-admin/useAgentSync.d.ts +3 -2
  651. package/dist/client/db-admin/useAgentSync.d.ts.map +1 -1
  652. package/dist/client/db-admin/useAgentSync.js +8 -4
  653. package/dist/client/db-admin/useAgentSync.js.map +1 -1
  654. package/dist/client/db-admin/useDbAdmin.d.ts +11 -7
  655. package/dist/client/db-admin/useDbAdmin.d.ts.map +1 -1
  656. package/dist/client/db-admin/useDbAdmin.js +45 -20
  657. package/dist/client/db-admin/useDbAdmin.js.map +1 -1
  658. package/dist/client/error-reporting.d.ts +19 -0
  659. package/dist/client/error-reporting.d.ts.map +1 -0
  660. package/dist/client/error-reporting.js +71 -0
  661. package/dist/client/error-reporting.js.map +1 -0
  662. package/dist/client/index.d.ts +3 -1
  663. package/dist/client/index.d.ts.map +1 -1
  664. package/dist/client/index.js +3 -1
  665. package/dist/client/index.js.map +1 -1
  666. package/dist/client/org/RequireActiveOrg.d.ts.map +1 -1
  667. package/dist/client/org/RequireActiveOrg.js +2 -1
  668. package/dist/client/org/RequireActiveOrg.js.map +1 -1
  669. package/dist/client/visual-style-controls.d.ts +11 -0
  670. package/dist/client/visual-style-controls.d.ts.map +1 -1
  671. package/dist/client/visual-style-controls.js +350 -1
  672. package/dist/client/visual-style-controls.js.map +1 -1
  673. package/dist/collab/routes.d.ts +1 -1
  674. package/dist/collab/struct-routes.d.ts +1 -1
  675. package/dist/db-admin/index.d.ts +3 -0
  676. package/dist/db-admin/index.d.ts.map +1 -0
  677. package/dist/db-admin/index.js +2 -0
  678. package/dist/db-admin/index.js.map +1 -0
  679. package/dist/db-admin/operations.d.ts +26 -5
  680. package/dist/db-admin/operations.d.ts.map +1 -1
  681. package/dist/db-admin/operations.js +66 -55
  682. package/dist/db-admin/operations.js.map +1 -1
  683. package/dist/localization/default-messages.d.ts +3 -0
  684. package/dist/localization/default-messages.d.ts.map +1 -1
  685. package/dist/localization/default-messages.js +3 -0
  686. package/dist/localization/default-messages.js.map +1 -1
  687. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  688. package/dist/secrets/crypto.d.ts.map +1 -1
  689. package/dist/secrets/crypto.js +37 -4
  690. package/dist/secrets/crypto.js.map +1 -1
  691. package/dist/secrets/routes.d.ts +9 -9
  692. package/dist/server/agent-access.d.ts +16 -0
  693. package/dist/server/agent-access.d.ts.map +1 -0
  694. package/dist/server/agent-access.js +25 -0
  695. package/dist/server/agent-access.js.map +1 -0
  696. package/dist/server/builder-design-systems.d.ts +61 -0
  697. package/dist/server/builder-design-systems.d.ts.map +1 -1
  698. package/dist/server/builder-design-systems.js +219 -14
  699. package/dist/server/builder-design-systems.js.map +1 -1
  700. package/dist/server/h3-helpers.d.ts.map +1 -1
  701. package/dist/server/h3-helpers.js +12 -2
  702. package/dist/server/h3-helpers.js.map +1 -1
  703. package/dist/server/index.d.ts +2 -1
  704. package/dist/server/index.d.ts.map +1 -1
  705. package/dist/server/index.js +2 -1
  706. package/dist/server/index.js.map +1 -1
  707. package/dist/server/request-context.d.ts +17 -0
  708. package/dist/server/request-context.d.ts.map +1 -1
  709. package/dist/server/request-context.js +46 -6
  710. package/dist/server/request-context.js.map +1 -1
  711. package/dist/shared/agent-access.d.ts +29 -0
  712. package/dist/shared/agent-access.d.ts.map +1 -0
  713. package/dist/shared/agent-access.js +57 -0
  714. package/dist/shared/agent-access.js.map +1 -0
  715. package/dist/shared/index.d.ts +1 -0
  716. package/dist/shared/index.d.ts.map +1 -1
  717. package/dist/shared/index.js +1 -0
  718. package/dist/shared/index.js.map +1 -1
  719. package/dist/templates/default/app/root.tsx +47 -0
  720. package/docs/content/components.mdx +13 -0
  721. package/docs/content/creating-templates.mdx +7 -0
  722. package/docs/content/locales/ar-SA/components.mdx +9 -0
  723. package/docs/content/locales/ar-SA/creating-templates.mdx +2 -0
  724. package/docs/content/locales/ar-SA/template-analytics.mdx +6 -0
  725. package/docs/content/locales/ar-SA/template-clips.mdx +7 -0
  726. package/docs/content/locales/ar-SA/tracking.mdx +6 -0
  727. package/docs/content/locales/de-DE/components.mdx +9 -0
  728. package/docs/content/locales/de-DE/creating-templates.mdx +2 -0
  729. package/docs/content/locales/de-DE/template-analytics.mdx +6 -0
  730. package/docs/content/locales/de-DE/template-clips.mdx +7 -0
  731. package/docs/content/locales/de-DE/tracking.mdx +6 -0
  732. package/docs/content/locales/es-ES/components.mdx +9 -0
  733. package/docs/content/locales/es-ES/creating-templates.mdx +2 -0
  734. package/docs/content/locales/es-ES/template-analytics.mdx +6 -0
  735. package/docs/content/locales/es-ES/template-clips.mdx +7 -0
  736. package/docs/content/locales/es-ES/tracking.mdx +6 -0
  737. package/docs/content/locales/fr-FR/components.mdx +9 -0
  738. package/docs/content/locales/fr-FR/creating-templates.mdx +2 -0
  739. package/docs/content/locales/fr-FR/template-analytics.mdx +6 -0
  740. package/docs/content/locales/fr-FR/template-clips.mdx +7 -0
  741. package/docs/content/locales/fr-FR/tracking.mdx +6 -0
  742. package/docs/content/locales/hi-IN/components.mdx +9 -0
  743. package/docs/content/locales/hi-IN/creating-templates.mdx +2 -0
  744. package/docs/content/locales/hi-IN/template-analytics.mdx +6 -0
  745. package/docs/content/locales/hi-IN/template-clips.mdx +7 -0
  746. package/docs/content/locales/hi-IN/tracking.mdx +6 -0
  747. package/docs/content/locales/ja-JP/components.mdx +9 -0
  748. package/docs/content/locales/ja-JP/creating-templates.mdx +2 -0
  749. package/docs/content/locales/ja-JP/template-analytics.mdx +6 -0
  750. package/docs/content/locales/ja-JP/template-clips.mdx +7 -0
  751. package/docs/content/locales/ja-JP/tracking.mdx +6 -0
  752. package/docs/content/locales/ko-KR/components.mdx +9 -0
  753. package/docs/content/locales/ko-KR/creating-templates.mdx +2 -0
  754. package/docs/content/locales/ko-KR/template-analytics.mdx +6 -0
  755. package/docs/content/locales/ko-KR/template-clips.mdx +7 -0
  756. package/docs/content/locales/ko-KR/tracking.mdx +6 -0
  757. package/docs/content/locales/pt-BR/components.mdx +9 -0
  758. package/docs/content/locales/pt-BR/creating-templates.mdx +2 -0
  759. package/docs/content/locales/pt-BR/template-analytics.mdx +6 -0
  760. package/docs/content/locales/pt-BR/template-clips.mdx +7 -0
  761. package/docs/content/locales/pt-BR/tracking.mdx +6 -0
  762. package/docs/content/locales/zh-CN/components.mdx +9 -0
  763. package/docs/content/locales/zh-CN/creating-templates.mdx +2 -0
  764. package/docs/content/locales/zh-CN/template-analytics.mdx +6 -0
  765. package/docs/content/locales/zh-CN/template-clips.mdx +7 -0
  766. package/docs/content/locales/zh-CN/tracking.mdx +6 -0
  767. package/docs/content/locales/zh-TW/components.mdx +9 -0
  768. package/docs/content/locales/zh-TW/creating-templates.mdx +2 -0
  769. package/docs/content/locales/zh-TW/template-analytics.mdx +6 -0
  770. package/docs/content/locales/zh-TW/template-clips.mdx +7 -0
  771. package/docs/content/locales/zh-TW/tracking.mdx +6 -0
  772. package/docs/content/template-analytics.mdx +6 -0
  773. package/docs/content/template-clips.mdx +7 -0
  774. package/docs/content/tracking.mdx +6 -0
  775. package/package.json +10 -2
  776. package/src/templates/default/app/root.tsx +47 -0
  777. package/corpus/templates/analytics/app/components/ui/accordion.tsx +0 -56
  778. package/corpus/templates/analytics/app/components/ui/alert-dialog.tsx +0 -139
  779. package/corpus/templates/analytics/app/components/ui/alert.tsx +0 -59
  780. package/corpus/templates/analytics/app/components/ui/aspect-ratio.tsx +0 -5
  781. package/corpus/templates/analytics/app/components/ui/avatar.tsx +0 -48
  782. package/corpus/templates/analytics/app/components/ui/badge.tsx +0 -37
  783. package/corpus/templates/analytics/app/components/ui/breadcrumb.tsx +0 -115
  784. package/corpus/templates/analytics/app/components/ui/button.tsx +0 -57
  785. package/corpus/templates/analytics/app/components/ui/card.tsx +0 -86
  786. package/corpus/templates/analytics/app/components/ui/carousel.tsx +0 -260
  787. package/corpus/templates/analytics/app/components/ui/checkbox.tsx +0 -28
  788. package/corpus/templates/analytics/app/components/ui/collapsible.tsx +0 -9
  789. package/corpus/templates/analytics/app/components/ui/command.tsx +0 -154
  790. package/corpus/templates/analytics/app/components/ui/context-menu.tsx +0 -202
  791. package/corpus/templates/analytics/app/components/ui/date-picker.tsx +0 -68
  792. package/corpus/templates/analytics/app/components/ui/dialog.tsx +0 -130
  793. package/corpus/templates/analytics/app/components/ui/drawer.tsx +0 -116
  794. package/corpus/templates/analytics/app/components/ui/dropdown-menu.tsx +0 -212
  795. package/corpus/templates/analytics/app/components/ui/form.tsx +0 -177
  796. package/corpus/templates/analytics/app/components/ui/hover-card.tsx +0 -27
  797. package/corpus/templates/analytics/app/components/ui/input-otp.tsx +0 -69
  798. package/corpus/templates/analytics/app/components/ui/input.tsx +0 -22
  799. package/corpus/templates/analytics/app/components/ui/label.tsx +0 -24
  800. package/corpus/templates/analytics/app/components/ui/menubar.tsx +0 -234
  801. package/corpus/templates/analytics/app/components/ui/navigation-menu.tsx +0 -128
  802. package/corpus/templates/analytics/app/components/ui/pagination.tsx +0 -121
  803. package/corpus/templates/analytics/app/components/ui/popover.tsx +0 -44
  804. package/corpus/templates/analytics/app/components/ui/progress.tsx +0 -26
  805. package/corpus/templates/analytics/app/components/ui/radio-group.tsx +0 -42
  806. package/corpus/templates/analytics/app/components/ui/resizable.tsx +0 -43
  807. package/corpus/templates/analytics/app/components/ui/scroll-area.tsx +0 -46
  808. package/corpus/templates/analytics/app/components/ui/select.tsx +0 -158
  809. package/corpus/templates/analytics/app/components/ui/separator.tsx +0 -29
  810. package/corpus/templates/analytics/app/components/ui/sheet.tsx +0 -160
  811. package/corpus/templates/analytics/app/components/ui/sidebar.tsx +0 -782
  812. package/corpus/templates/analytics/app/components/ui/skeleton.tsx +0 -15
  813. package/corpus/templates/analytics/app/components/ui/slider.tsx +0 -26
  814. package/corpus/templates/analytics/app/components/ui/sonner.tsx +0 -58
  815. package/corpus/templates/analytics/app/components/ui/spinner.tsx +0 -17
  816. package/corpus/templates/analytics/app/components/ui/switch.tsx +0 -27
  817. package/corpus/templates/analytics/app/components/ui/table.tsx +0 -117
  818. package/corpus/templates/analytics/app/components/ui/tabs.tsx +0 -53
  819. package/corpus/templates/analytics/app/components/ui/textarea.tsx +0 -23
  820. package/corpus/templates/analytics/app/components/ui/toast.tsx +0 -127
  821. package/corpus/templates/analytics/app/components/ui/toaster.tsx +0 -33
  822. package/corpus/templates/analytics/app/components/ui/toggle-group.tsx +0 -59
  823. package/corpus/templates/analytics/app/components/ui/toggle.tsx +0 -43
  824. package/corpus/templates/analytics/app/components/ui/tooltip.tsx +0 -30
  825. package/corpus/templates/analytics/app/components/ui/use-toast.ts +0 -3
  826. package/corpus/templates/analytics/app/hooks/use-mobile.tsx +0 -21
  827. package/corpus/templates/analytics/app/hooks/use-toast.ts +0 -188
  828. package/corpus/templates/assets/app/components/layout/HeaderActions.tsx +0 -84
  829. package/corpus/templates/assets/app/components/ui/alert-dialog.tsx +0 -139
  830. package/corpus/templates/assets/app/components/ui/alert.tsx +0 -59
  831. package/corpus/templates/assets/app/components/ui/avatar.tsx +0 -48
  832. package/corpus/templates/assets/app/components/ui/badge.tsx +0 -37
  833. package/corpus/templates/assets/app/components/ui/breadcrumb.tsx +0 -115
  834. package/corpus/templates/assets/app/components/ui/button.tsx +0 -57
  835. package/corpus/templates/assets/app/components/ui/card.tsx +0 -86
  836. package/corpus/templates/assets/app/components/ui/checkbox.tsx +0 -28
  837. package/corpus/templates/assets/app/components/ui/dialog.tsx +0 -130
  838. package/corpus/templates/assets/app/components/ui/dropdown-menu.tsx +0 -212
  839. package/corpus/templates/assets/app/components/ui/hover-card.tsx +0 -27
  840. package/corpus/templates/assets/app/components/ui/input.tsx +0 -22
  841. package/corpus/templates/assets/app/components/ui/label.tsx +0 -24
  842. package/corpus/templates/assets/app/components/ui/pagination.tsx +0 -121
  843. package/corpus/templates/assets/app/components/ui/popover.tsx +0 -44
  844. package/corpus/templates/assets/app/components/ui/progress.tsx +0 -26
  845. package/corpus/templates/assets/app/components/ui/scroll-area.tsx +0 -46
  846. package/corpus/templates/assets/app/components/ui/select.tsx +0 -158
  847. package/corpus/templates/assets/app/components/ui/separator.tsx +0 -29
  848. package/corpus/templates/assets/app/components/ui/sheet.tsx +0 -160
  849. package/corpus/templates/assets/app/components/ui/skeleton.tsx +0 -15
  850. package/corpus/templates/assets/app/components/ui/slider.tsx +0 -26
  851. package/corpus/templates/assets/app/components/ui/sonner.tsx +0 -58
  852. package/corpus/templates/assets/app/components/ui/spinner.tsx +0 -17
  853. package/corpus/templates/assets/app/components/ui/table.tsx +0 -117
  854. package/corpus/templates/assets/app/components/ui/tabs.tsx +0 -53
  855. package/corpus/templates/assets/app/components/ui/tooltip.tsx +0 -30
  856. package/corpus/templates/brain/app/components/ui/badge.tsx +0 -37
  857. package/corpus/templates/brain/app/components/ui/button.tsx +0 -57
  858. package/corpus/templates/brain/app/components/ui/card.tsx +0 -86
  859. package/corpus/templates/brain/app/components/ui/input.tsx +0 -22
  860. package/corpus/templates/brain/app/components/ui/label.tsx +0 -24
  861. package/corpus/templates/brain/app/components/ui/progress.tsx +0 -26
  862. package/corpus/templates/brain/app/components/ui/select.tsx +0 -158
  863. package/corpus/templates/brain/app/components/ui/separator.tsx +0 -29
  864. package/corpus/templates/brain/app/components/ui/sheet.tsx +0 -160
  865. package/corpus/templates/brain/app/components/ui/skeleton.tsx +0 -15
  866. package/corpus/templates/brain/app/components/ui/sonner.tsx +0 -58
  867. package/corpus/templates/brain/app/components/ui/switch.tsx +0 -27
  868. package/corpus/templates/brain/app/components/ui/table.tsx +0 -117
  869. package/corpus/templates/brain/app/components/ui/textarea.tsx +0 -23
  870. package/corpus/templates/brain/app/components/ui/tooltip.tsx +0 -30
  871. package/corpus/templates/calendar/app/components/ui/accordion.tsx +0 -56
  872. package/corpus/templates/calendar/app/components/ui/alert-dialog.tsx +0 -139
  873. package/corpus/templates/calendar/app/components/ui/alert.tsx +0 -59
  874. package/corpus/templates/calendar/app/components/ui/aspect-ratio.tsx +0 -5
  875. package/corpus/templates/calendar/app/components/ui/avatar.tsx +0 -48
  876. package/corpus/templates/calendar/app/components/ui/badge.tsx +0 -37
  877. package/corpus/templates/calendar/app/components/ui/breadcrumb.tsx +0 -115
  878. package/corpus/templates/calendar/app/components/ui/button.tsx +0 -57
  879. package/corpus/templates/calendar/app/components/ui/calendar.tsx +0 -68
  880. package/corpus/templates/calendar/app/components/ui/card.tsx +0 -86
  881. package/corpus/templates/calendar/app/components/ui/carousel.tsx +0 -260
  882. package/corpus/templates/calendar/app/components/ui/chart.tsx +0 -375
  883. package/corpus/templates/calendar/app/components/ui/checkbox.tsx +0 -28
  884. package/corpus/templates/calendar/app/components/ui/collapsible.tsx +0 -9
  885. package/corpus/templates/calendar/app/components/ui/command.tsx +0 -154
  886. package/corpus/templates/calendar/app/components/ui/context-menu.tsx +0 -202
  887. package/corpus/templates/calendar/app/components/ui/dialog.tsx +0 -130
  888. package/corpus/templates/calendar/app/components/ui/drawer.tsx +0 -116
  889. package/corpus/templates/calendar/app/components/ui/dropdown-menu.tsx +0 -212
  890. package/corpus/templates/calendar/app/components/ui/form.tsx +0 -177
  891. package/corpus/templates/calendar/app/components/ui/hover-card.tsx +0 -27
  892. package/corpus/templates/calendar/app/components/ui/input-otp.tsx +0 -69
  893. package/corpus/templates/calendar/app/components/ui/input.tsx +0 -22
  894. package/corpus/templates/calendar/app/components/ui/label.tsx +0 -24
  895. package/corpus/templates/calendar/app/components/ui/menubar.tsx +0 -234
  896. package/corpus/templates/calendar/app/components/ui/navigation-menu.tsx +0 -128
  897. package/corpus/templates/calendar/app/components/ui/pagination.tsx +0 -121
  898. package/corpus/templates/calendar/app/components/ui/popover.tsx +0 -44
  899. package/corpus/templates/calendar/app/components/ui/progress.tsx +0 -26
  900. package/corpus/templates/calendar/app/components/ui/radio-group.tsx +0 -42
  901. package/corpus/templates/calendar/app/components/ui/resizable.tsx +0 -43
  902. package/corpus/templates/calendar/app/components/ui/scroll-area.tsx +0 -46
  903. package/corpus/templates/calendar/app/components/ui/select.tsx +0 -158
  904. package/corpus/templates/calendar/app/components/ui/separator.tsx +0 -29
  905. package/corpus/templates/calendar/app/components/ui/sheet.tsx +0 -160
  906. package/corpus/templates/calendar/app/components/ui/sidebar.tsx +0 -782
  907. package/corpus/templates/calendar/app/components/ui/skeleton.tsx +0 -15
  908. package/corpus/templates/calendar/app/components/ui/slider.tsx +0 -26
  909. package/corpus/templates/calendar/app/components/ui/spinner.tsx +0 -17
  910. package/corpus/templates/calendar/app/components/ui/switch.tsx +0 -27
  911. package/corpus/templates/calendar/app/components/ui/table.tsx +0 -117
  912. package/corpus/templates/calendar/app/components/ui/tabs.tsx +0 -53
  913. package/corpus/templates/calendar/app/components/ui/textarea.tsx +0 -23
  914. package/corpus/templates/calendar/app/components/ui/toast.tsx +0 -127
  915. package/corpus/templates/calendar/app/components/ui/toaster.tsx +0 -33
  916. package/corpus/templates/calendar/app/components/ui/toggle-group.tsx +0 -59
  917. package/corpus/templates/calendar/app/components/ui/toggle.tsx +0 -43
  918. package/corpus/templates/calendar/app/components/ui/tooltip.tsx +0 -30
  919. package/corpus/templates/calendar/app/components/ui/use-toast.ts +0 -3
  920. package/corpus/templates/calendar/app/hooks/use-mobile.tsx +0 -21
  921. package/corpus/templates/calendar/app/hooks/use-toast.ts +0 -188
  922. package/corpus/templates/chat/app/components/layout/HeaderActions.tsx +0 -84
  923. package/corpus/templates/chat/app/components/ui/accordion.tsx +0 -56
  924. package/corpus/templates/chat/app/components/ui/alert-dialog.tsx +0 -139
  925. package/corpus/templates/chat/app/components/ui/alert.tsx +0 -59
  926. package/corpus/templates/chat/app/components/ui/aspect-ratio.tsx +0 -5
  927. package/corpus/templates/chat/app/components/ui/avatar.tsx +0 -48
  928. package/corpus/templates/chat/app/components/ui/badge.tsx +0 -37
  929. package/corpus/templates/chat/app/components/ui/breadcrumb.tsx +0 -115
  930. package/corpus/templates/chat/app/components/ui/button.tsx +0 -57
  931. package/corpus/templates/chat/app/components/ui/calendar.tsx +0 -68
  932. package/corpus/templates/chat/app/components/ui/card.tsx +0 -86
  933. package/corpus/templates/chat/app/components/ui/carousel.tsx +0 -260
  934. package/corpus/templates/chat/app/components/ui/chart.tsx +0 -375
  935. package/corpus/templates/chat/app/components/ui/checkbox.tsx +0 -28
  936. package/corpus/templates/chat/app/components/ui/collapsible.tsx +0 -9
  937. package/corpus/templates/chat/app/components/ui/command.tsx +0 -154
  938. package/corpus/templates/chat/app/components/ui/context-menu.tsx +0 -202
  939. package/corpus/templates/chat/app/components/ui/dialog.tsx +0 -130
  940. package/corpus/templates/chat/app/components/ui/drawer.tsx +0 -116
  941. package/corpus/templates/chat/app/components/ui/dropdown-menu.tsx +0 -212
  942. package/corpus/templates/chat/app/components/ui/form.tsx +0 -177
  943. package/corpus/templates/chat/app/components/ui/hover-card.tsx +0 -27
  944. package/corpus/templates/chat/app/components/ui/input-otp.tsx +0 -69
  945. package/corpus/templates/chat/app/components/ui/input.tsx +0 -22
  946. package/corpus/templates/chat/app/components/ui/label.tsx +0 -24
  947. package/corpus/templates/chat/app/components/ui/menubar.tsx +0 -234
  948. package/corpus/templates/chat/app/components/ui/navigation-menu.tsx +0 -128
  949. package/corpus/templates/chat/app/components/ui/pagination.tsx +0 -121
  950. package/corpus/templates/chat/app/components/ui/popover.tsx +0 -44
  951. package/corpus/templates/chat/app/components/ui/progress.tsx +0 -26
  952. package/corpus/templates/chat/app/components/ui/radio-group.tsx +0 -42
  953. package/corpus/templates/chat/app/components/ui/resizable.tsx +0 -43
  954. package/corpus/templates/chat/app/components/ui/scroll-area.tsx +0 -46
  955. package/corpus/templates/chat/app/components/ui/select.tsx +0 -158
  956. package/corpus/templates/chat/app/components/ui/separator.tsx +0 -29
  957. package/corpus/templates/chat/app/components/ui/sheet.tsx +0 -160
  958. package/corpus/templates/chat/app/components/ui/sidebar.tsx +0 -782
  959. package/corpus/templates/chat/app/components/ui/skeleton.tsx +0 -15
  960. package/corpus/templates/chat/app/components/ui/slider.tsx +0 -26
  961. package/corpus/templates/chat/app/components/ui/sonner.tsx +0 -58
  962. package/corpus/templates/chat/app/components/ui/spinner.tsx +0 -17
  963. package/corpus/templates/chat/app/components/ui/switch.tsx +0 -27
  964. package/corpus/templates/chat/app/components/ui/table.tsx +0 -117
  965. package/corpus/templates/chat/app/components/ui/tabs.tsx +0 -53
  966. package/corpus/templates/chat/app/components/ui/textarea.tsx +0 -23
  967. package/corpus/templates/chat/app/components/ui/toast.tsx +0 -127
  968. package/corpus/templates/chat/app/components/ui/toaster.tsx +0 -33
  969. package/corpus/templates/chat/app/components/ui/toggle-group.tsx +0 -59
  970. package/corpus/templates/chat/app/components/ui/toggle.tsx +0 -43
  971. package/corpus/templates/chat/app/components/ui/tooltip.tsx +0 -30
  972. package/corpus/templates/chat/app/components/ui/use-toast.ts +0 -3
  973. package/corpus/templates/chat/app/hooks/use-mobile.tsx +0 -21
  974. package/corpus/templates/chat/app/hooks/use-toast.ts +0 -188
  975. package/corpus/templates/clips/app/components/layout/HeaderActions.tsx +0 -84
  976. package/corpus/templates/clips/app/components/ui/accordion.tsx +0 -56
  977. package/corpus/templates/clips/app/components/ui/alert-dialog.tsx +0 -139
  978. package/corpus/templates/clips/app/components/ui/alert.tsx +0 -59
  979. package/corpus/templates/clips/app/components/ui/aspect-ratio.tsx +0 -5
  980. package/corpus/templates/clips/app/components/ui/avatar.tsx +0 -48
  981. package/corpus/templates/clips/app/components/ui/badge.tsx +0 -37
  982. package/corpus/templates/clips/app/components/ui/breadcrumb.tsx +0 -115
  983. package/corpus/templates/clips/app/components/ui/button.tsx +0 -57
  984. package/corpus/templates/clips/app/components/ui/calendar.tsx +0 -68
  985. package/corpus/templates/clips/app/components/ui/card.tsx +0 -86
  986. package/corpus/templates/clips/app/components/ui/carousel.tsx +0 -260
  987. package/corpus/templates/clips/app/components/ui/chart.tsx +0 -375
  988. package/corpus/templates/clips/app/components/ui/checkbox.tsx +0 -28
  989. package/corpus/templates/clips/app/components/ui/collapsible.tsx +0 -9
  990. package/corpus/templates/clips/app/components/ui/command.tsx +0 -154
  991. package/corpus/templates/clips/app/components/ui/context-menu.tsx +0 -202
  992. package/corpus/templates/clips/app/components/ui/dialog.tsx +0 -130
  993. package/corpus/templates/clips/app/components/ui/drawer.tsx +0 -116
  994. package/corpus/templates/clips/app/components/ui/dropdown-menu.tsx +0 -212
  995. package/corpus/templates/clips/app/components/ui/form.tsx +0 -177
  996. package/corpus/templates/clips/app/components/ui/hover-card.tsx +0 -27
  997. package/corpus/templates/clips/app/components/ui/input-otp.tsx +0 -69
  998. package/corpus/templates/clips/app/components/ui/input.tsx +0 -22
  999. package/corpus/templates/clips/app/components/ui/label.tsx +0 -24
  1000. package/corpus/templates/clips/app/components/ui/menubar.tsx +0 -234
  1001. package/corpus/templates/clips/app/components/ui/navigation-menu.tsx +0 -128
  1002. package/corpus/templates/clips/app/components/ui/pagination.tsx +0 -121
  1003. package/corpus/templates/clips/app/components/ui/popover.tsx +0 -44
  1004. package/corpus/templates/clips/app/components/ui/progress.tsx +0 -26
  1005. package/corpus/templates/clips/app/components/ui/radio-group.tsx +0 -42
  1006. package/corpus/templates/clips/app/components/ui/resizable.tsx +0 -43
  1007. package/corpus/templates/clips/app/components/ui/scroll-area.tsx +0 -46
  1008. package/corpus/templates/clips/app/components/ui/select.tsx +0 -158
  1009. package/corpus/templates/clips/app/components/ui/separator.tsx +0 -29
  1010. package/corpus/templates/clips/app/components/ui/sheet.tsx +0 -160
  1011. package/corpus/templates/clips/app/components/ui/sidebar.tsx +0 -782
  1012. package/corpus/templates/clips/app/components/ui/skeleton.tsx +0 -15
  1013. package/corpus/templates/clips/app/components/ui/slider.tsx +0 -26
  1014. package/corpus/templates/clips/app/components/ui/sonner.tsx +0 -58
  1015. package/corpus/templates/clips/app/components/ui/spinner.tsx +0 -17
  1016. package/corpus/templates/clips/app/components/ui/switch.tsx +0 -27
  1017. package/corpus/templates/clips/app/components/ui/table.tsx +0 -117
  1018. package/corpus/templates/clips/app/components/ui/tabs.tsx +0 -53
  1019. package/corpus/templates/clips/app/components/ui/textarea.tsx +0 -23
  1020. package/corpus/templates/clips/app/components/ui/toast.tsx +0 -127
  1021. package/corpus/templates/clips/app/components/ui/toaster.tsx +0 -33
  1022. package/corpus/templates/clips/app/components/ui/toggle-group.tsx +0 -59
  1023. package/corpus/templates/clips/app/components/ui/toggle.tsx +0 -43
  1024. package/corpus/templates/clips/app/components/ui/tooltip.tsx +0 -30
  1025. package/corpus/templates/clips/app/components/ui/use-toast.ts +0 -3
  1026. package/corpus/templates/clips/app/hooks/use-mobile.tsx +0 -21
  1027. package/corpus/templates/clips/app/hooks/use-toast.ts +0 -188
  1028. package/corpus/templates/content/app/components/layout/HeaderActions.tsx +0 -84
  1029. package/corpus/templates/content/app/components/ui/alert-dialog.tsx +0 -139
  1030. package/corpus/templates/content/app/components/ui/button.tsx +0 -57
  1031. package/corpus/templates/content/app/components/ui/dialog.tsx +0 -130
  1032. package/corpus/templates/content/app/components/ui/dropdown-menu.tsx +0 -212
  1033. package/corpus/templates/content/app/components/ui/input.tsx +0 -22
  1034. package/corpus/templates/content/app/components/ui/label.tsx +0 -24
  1035. package/corpus/templates/content/app/components/ui/popover.tsx +0 -44
  1036. package/corpus/templates/content/app/components/ui/separator.tsx +0 -29
  1037. package/corpus/templates/content/app/components/ui/sheet.tsx +0 -160
  1038. package/corpus/templates/content/app/components/ui/skeleton.tsx +0 -15
  1039. package/corpus/templates/content/app/components/ui/sonner.tsx +0 -58
  1040. package/corpus/templates/content/app/components/ui/spinner.tsx +0 -17
  1041. package/corpus/templates/content/app/components/ui/table.tsx +0 -117
  1042. package/corpus/templates/content/app/components/ui/toast.tsx +0 -127
  1043. package/corpus/templates/content/app/components/ui/toaster.tsx +0 -33
  1044. package/corpus/templates/content/app/components/ui/toggle.tsx +0 -43
  1045. package/corpus/templates/content/app/components/ui/tooltip.tsx +0 -30
  1046. package/corpus/templates/content/app/components/ui/use-toast.ts +0 -3
  1047. package/corpus/templates/content/app/hooks/use-mobile.tsx +0 -21
  1048. package/corpus/templates/content/app/hooks/use-toast.ts +0 -188
  1049. package/corpus/templates/design/app/components/layout/HeaderActions.tsx +0 -84
  1050. package/corpus/templates/design/app/components/ui/accordion.tsx +0 -56
  1051. package/corpus/templates/design/app/components/ui/alert-dialog.tsx +0 -139
  1052. package/corpus/templates/design/app/components/ui/alert.tsx +0 -59
  1053. package/corpus/templates/design/app/components/ui/aspect-ratio.tsx +0 -5
  1054. package/corpus/templates/design/app/components/ui/avatar.tsx +0 -48
  1055. package/corpus/templates/design/app/components/ui/badge.tsx +0 -37
  1056. package/corpus/templates/design/app/components/ui/breadcrumb.tsx +0 -115
  1057. package/corpus/templates/design/app/components/ui/button.tsx +0 -57
  1058. package/corpus/templates/design/app/components/ui/calendar.tsx +0 -68
  1059. package/corpus/templates/design/app/components/ui/card.tsx +0 -86
  1060. package/corpus/templates/design/app/components/ui/carousel.tsx +0 -260
  1061. package/corpus/templates/design/app/components/ui/chart.tsx +0 -375
  1062. package/corpus/templates/design/app/components/ui/checkbox.tsx +0 -28
  1063. package/corpus/templates/design/app/components/ui/collapsible.tsx +0 -9
  1064. package/corpus/templates/design/app/components/ui/command.tsx +0 -154
  1065. package/corpus/templates/design/app/components/ui/context-menu.tsx +0 -202
  1066. package/corpus/templates/design/app/components/ui/dialog.tsx +0 -130
  1067. package/corpus/templates/design/app/components/ui/drawer.tsx +0 -116
  1068. package/corpus/templates/design/app/components/ui/dropdown-menu.tsx +0 -212
  1069. package/corpus/templates/design/app/components/ui/form.tsx +0 -177
  1070. package/corpus/templates/design/app/components/ui/hover-card.tsx +0 -27
  1071. package/corpus/templates/design/app/components/ui/input-otp.tsx +0 -69
  1072. package/corpus/templates/design/app/components/ui/input.tsx +0 -22
  1073. package/corpus/templates/design/app/components/ui/label.tsx +0 -24
  1074. package/corpus/templates/design/app/components/ui/menubar.tsx +0 -234
  1075. package/corpus/templates/design/app/components/ui/navigation-menu.tsx +0 -128
  1076. package/corpus/templates/design/app/components/ui/pagination.tsx +0 -121
  1077. package/corpus/templates/design/app/components/ui/popover.tsx +0 -44
  1078. package/corpus/templates/design/app/components/ui/progress.tsx +0 -26
  1079. package/corpus/templates/design/app/components/ui/radio-group.tsx +0 -42
  1080. package/corpus/templates/design/app/components/ui/resizable.tsx +0 -43
  1081. package/corpus/templates/design/app/components/ui/scroll-area.tsx +0 -46
  1082. package/corpus/templates/design/app/components/ui/select.tsx +0 -158
  1083. package/corpus/templates/design/app/components/ui/separator.tsx +0 -29
  1084. package/corpus/templates/design/app/components/ui/sheet.tsx +0 -160
  1085. package/corpus/templates/design/app/components/ui/sidebar.tsx +0 -782
  1086. package/corpus/templates/design/app/components/ui/skeleton.tsx +0 -15
  1087. package/corpus/templates/design/app/components/ui/slider.tsx +0 -26
  1088. package/corpus/templates/design/app/components/ui/sonner.tsx +0 -58
  1089. package/corpus/templates/design/app/components/ui/spinner.tsx +0 -17
  1090. package/corpus/templates/design/app/components/ui/switch.tsx +0 -27
  1091. package/corpus/templates/design/app/components/ui/table.tsx +0 -117
  1092. package/corpus/templates/design/app/components/ui/tabs.tsx +0 -53
  1093. package/corpus/templates/design/app/components/ui/textarea.tsx +0 -23
  1094. package/corpus/templates/design/app/components/ui/toast.tsx +0 -127
  1095. package/corpus/templates/design/app/components/ui/toaster.tsx +0 -33
  1096. package/corpus/templates/design/app/components/ui/toggle-group.tsx +0 -59
  1097. package/corpus/templates/design/app/components/ui/toggle.tsx +0 -43
  1098. package/corpus/templates/design/app/components/ui/tooltip.tsx +0 -30
  1099. package/corpus/templates/design/app/components/ui/use-toast.ts +0 -3
  1100. package/corpus/templates/design/app/hooks/use-mobile.tsx +0 -21
  1101. package/corpus/templates/design/app/hooks/use-toast.ts +0 -188
  1102. package/corpus/templates/forms/app/components/layout/HeaderActions.tsx +0 -84
  1103. package/corpus/templates/forms/app/components/ui/accordion.tsx +0 -56
  1104. package/corpus/templates/forms/app/components/ui/alert-dialog.tsx +0 -139
  1105. package/corpus/templates/forms/app/components/ui/alert.tsx +0 -59
  1106. package/corpus/templates/forms/app/components/ui/aspect-ratio.tsx +0 -5
  1107. package/corpus/templates/forms/app/components/ui/avatar.tsx +0 -48
  1108. package/corpus/templates/forms/app/components/ui/badge.tsx +0 -37
  1109. package/corpus/templates/forms/app/components/ui/breadcrumb.tsx +0 -115
  1110. package/corpus/templates/forms/app/components/ui/button.tsx +0 -57
  1111. package/corpus/templates/forms/app/components/ui/card.tsx +0 -86
  1112. package/corpus/templates/forms/app/components/ui/carousel.tsx +0 -260
  1113. package/corpus/templates/forms/app/components/ui/checkbox.tsx +0 -28
  1114. package/corpus/templates/forms/app/components/ui/collapsible.tsx +0 -9
  1115. package/corpus/templates/forms/app/components/ui/dialog.tsx +0 -130
  1116. package/corpus/templates/forms/app/components/ui/drawer.tsx +0 -116
  1117. package/corpus/templates/forms/app/components/ui/dropdown-menu.tsx +0 -212
  1118. package/corpus/templates/forms/app/components/ui/form.tsx +0 -177
  1119. package/corpus/templates/forms/app/components/ui/hover-card.tsx +0 -27
  1120. package/corpus/templates/forms/app/components/ui/input-otp.tsx +0 -69
  1121. package/corpus/templates/forms/app/components/ui/input.tsx +0 -22
  1122. package/corpus/templates/forms/app/components/ui/label.tsx +0 -24
  1123. package/corpus/templates/forms/app/components/ui/navigation-menu.tsx +0 -128
  1124. package/corpus/templates/forms/app/components/ui/pagination.tsx +0 -121
  1125. package/corpus/templates/forms/app/components/ui/popover.tsx +0 -44
  1126. package/corpus/templates/forms/app/components/ui/progress.tsx +0 -26
  1127. package/corpus/templates/forms/app/components/ui/radio-group.tsx +0 -42
  1128. package/corpus/templates/forms/app/components/ui/resizable.tsx +0 -43
  1129. package/corpus/templates/forms/app/components/ui/scroll-area.tsx +0 -46
  1130. package/corpus/templates/forms/app/components/ui/select.tsx +0 -158
  1131. package/corpus/templates/forms/app/components/ui/separator.tsx +0 -29
  1132. package/corpus/templates/forms/app/components/ui/sheet.tsx +0 -160
  1133. package/corpus/templates/forms/app/components/ui/sidebar.tsx +0 -782
  1134. package/corpus/templates/forms/app/components/ui/skeleton.tsx +0 -15
  1135. package/corpus/templates/forms/app/components/ui/slider.tsx +0 -26
  1136. package/corpus/templates/forms/app/components/ui/sonner.tsx +0 -58
  1137. package/corpus/templates/forms/app/components/ui/spinner.tsx +0 -17
  1138. package/corpus/templates/forms/app/components/ui/switch.tsx +0 -27
  1139. package/corpus/templates/forms/app/components/ui/table.tsx +0 -117
  1140. package/corpus/templates/forms/app/components/ui/tabs.tsx +0 -53
  1141. package/corpus/templates/forms/app/components/ui/textarea.tsx +0 -23
  1142. package/corpus/templates/forms/app/components/ui/toast.tsx +0 -127
  1143. package/corpus/templates/forms/app/components/ui/toaster.tsx +0 -33
  1144. package/corpus/templates/forms/app/components/ui/toggle-group.tsx +0 -59
  1145. package/corpus/templates/forms/app/components/ui/toggle.tsx +0 -43
  1146. package/corpus/templates/forms/app/components/ui/tooltip.tsx +0 -30
  1147. package/corpus/templates/forms/app/hooks/use-mobile.tsx +0 -21
  1148. package/corpus/templates/forms/app/hooks/use-toast.ts +0 -188
  1149. package/corpus/templates/macros/app/components/layout/HeaderActions.tsx +0 -84
  1150. package/corpus/templates/macros/app/components/ui/accordion.tsx +0 -56
  1151. package/corpus/templates/macros/app/components/ui/alert-dialog.tsx +0 -139
  1152. package/corpus/templates/macros/app/components/ui/alert.tsx +0 -59
  1153. package/corpus/templates/macros/app/components/ui/aspect-ratio.tsx +0 -5
  1154. package/corpus/templates/macros/app/components/ui/avatar.tsx +0 -48
  1155. package/corpus/templates/macros/app/components/ui/badge.tsx +0 -37
  1156. package/corpus/templates/macros/app/components/ui/breadcrumb.tsx +0 -115
  1157. package/corpus/templates/macros/app/components/ui/chart.tsx +0 -375
  1158. package/corpus/templates/macros/app/components/ui/checkbox.tsx +0 -28
  1159. package/corpus/templates/macros/app/components/ui/collapsible.tsx +0 -9
  1160. package/corpus/templates/macros/app/components/ui/command.tsx +0 -154
  1161. package/corpus/templates/macros/app/components/ui/context-menu.tsx +0 -202
  1162. package/corpus/templates/macros/app/components/ui/drawer.tsx +0 -116
  1163. package/corpus/templates/macros/app/components/ui/dropdown-menu.tsx +0 -212
  1164. package/corpus/templates/macros/app/components/ui/form.tsx +0 -177
  1165. package/corpus/templates/macros/app/components/ui/hover-card.tsx +0 -27
  1166. package/corpus/templates/macros/app/components/ui/label.tsx +0 -24
  1167. package/corpus/templates/macros/app/components/ui/logo.tsx +0 -36
  1168. package/corpus/templates/macros/app/components/ui/navigation-menu.tsx +0 -128
  1169. package/corpus/templates/macros/app/components/ui/pagination.tsx +0 -121
  1170. package/corpus/templates/macros/app/components/ui/popover.tsx +0 -44
  1171. package/corpus/templates/macros/app/components/ui/radio-group.tsx +0 -42
  1172. package/corpus/templates/macros/app/components/ui/scroll-area.tsx +0 -46
  1173. package/corpus/templates/macros/app/components/ui/select.tsx +0 -158
  1174. package/corpus/templates/macros/app/components/ui/separator.tsx +0 -29
  1175. package/corpus/templates/macros/app/components/ui/sheet.tsx +0 -160
  1176. package/corpus/templates/macros/app/components/ui/skeleton.tsx +0 -15
  1177. package/corpus/templates/macros/app/components/ui/slider.tsx +0 -26
  1178. package/corpus/templates/macros/app/components/ui/sonner.tsx +0 -58
  1179. package/corpus/templates/macros/app/components/ui/switch.tsx +0 -27
  1180. package/corpus/templates/macros/app/components/ui/table.tsx +0 -117
  1181. package/corpus/templates/macros/app/components/ui/toast.tsx +0 -127
  1182. package/corpus/templates/macros/app/components/ui/toggle-group.tsx +0 -59
  1183. package/corpus/templates/macros/app/components/ui/toggle.tsx +0 -43
  1184. package/corpus/templates/macros/app/components/ui/tooltip.tsx +0 -30
  1185. package/corpus/templates/mail/app/components/ui/accordion.tsx +0 -56
  1186. package/corpus/templates/mail/app/components/ui/alert-dialog.tsx +0 -139
  1187. package/corpus/templates/mail/app/components/ui/alert.tsx +0 -59
  1188. package/corpus/templates/mail/app/components/ui/aspect-ratio.tsx +0 -5
  1189. package/corpus/templates/mail/app/components/ui/avatar.tsx +0 -48
  1190. package/corpus/templates/mail/app/components/ui/badge.tsx +0 -37
  1191. package/corpus/templates/mail/app/components/ui/breadcrumb.tsx +0 -115
  1192. package/corpus/templates/mail/app/components/ui/button.tsx +0 -57
  1193. package/corpus/templates/mail/app/components/ui/card.tsx +0 -86
  1194. package/corpus/templates/mail/app/components/ui/carousel.tsx +0 -260
  1195. package/corpus/templates/mail/app/components/ui/checkbox.tsx +0 -28
  1196. package/corpus/templates/mail/app/components/ui/collapsible.tsx +0 -9
  1197. package/corpus/templates/mail/app/components/ui/dialog.tsx +0 -130
  1198. package/corpus/templates/mail/app/components/ui/drawer.tsx +0 -116
  1199. package/corpus/templates/mail/app/components/ui/dropdown-menu.tsx +0 -212
  1200. package/corpus/templates/mail/app/components/ui/form.tsx +0 -177
  1201. package/corpus/templates/mail/app/components/ui/hover-card.tsx +0 -27
  1202. package/corpus/templates/mail/app/components/ui/input-otp.tsx +0 -69
  1203. package/corpus/templates/mail/app/components/ui/label.tsx +0 -24
  1204. package/corpus/templates/mail/app/components/ui/navigation-menu.tsx +0 -128
  1205. package/corpus/templates/mail/app/components/ui/pagination.tsx +0 -121
  1206. package/corpus/templates/mail/app/components/ui/popover.tsx +0 -44
  1207. package/corpus/templates/mail/app/components/ui/progress.tsx +0 -26
  1208. package/corpus/templates/mail/app/components/ui/radio-group.tsx +0 -42
  1209. package/corpus/templates/mail/app/components/ui/resizable.tsx +0 -43
  1210. package/corpus/templates/mail/app/components/ui/scroll-area.tsx +0 -46
  1211. package/corpus/templates/mail/app/components/ui/select.tsx +0 -158
  1212. package/corpus/templates/mail/app/components/ui/separator.tsx +0 -29
  1213. package/corpus/templates/mail/app/components/ui/sheet.tsx +0 -160
  1214. package/corpus/templates/mail/app/components/ui/sidebar.tsx +0 -782
  1215. package/corpus/templates/mail/app/components/ui/skeleton.tsx +0 -15
  1216. package/corpus/templates/mail/app/components/ui/slider.tsx +0 -26
  1217. package/corpus/templates/mail/app/components/ui/spinner.tsx +0 -17
  1218. package/corpus/templates/mail/app/components/ui/switch.tsx +0 -27
  1219. package/corpus/templates/mail/app/components/ui/table.tsx +0 -117
  1220. package/corpus/templates/mail/app/components/ui/tabs.tsx +0 -53
  1221. package/corpus/templates/mail/app/components/ui/toast.tsx +0 -127
  1222. package/corpus/templates/mail/app/components/ui/toaster.tsx +0 -33
  1223. package/corpus/templates/mail/app/components/ui/toggle-group.tsx +0 -59
  1224. package/corpus/templates/mail/app/components/ui/toggle.tsx +0 -43
  1225. package/corpus/templates/mail/app/components/ui/tooltip.tsx +0 -30
  1226. package/corpus/templates/mail/app/hooks/use-toast.ts +0 -188
  1227. package/corpus/templates/plan/app/components/layout/HeaderActions.tsx +0 -84
  1228. package/corpus/templates/plan/app/components/ui/accordion.tsx +0 -56
  1229. package/corpus/templates/plan/app/components/ui/alert-dialog.tsx +0 -139
  1230. package/corpus/templates/plan/app/components/ui/alert.tsx +0 -59
  1231. package/corpus/templates/plan/app/components/ui/aspect-ratio.tsx +0 -5
  1232. package/corpus/templates/plan/app/components/ui/avatar.tsx +0 -48
  1233. package/corpus/templates/plan/app/components/ui/badge.tsx +0 -37
  1234. package/corpus/templates/plan/app/components/ui/breadcrumb.tsx +0 -115
  1235. package/corpus/templates/plan/app/components/ui/button.tsx +0 -57
  1236. package/corpus/templates/plan/app/components/ui/calendar.tsx +0 -68
  1237. package/corpus/templates/plan/app/components/ui/card.tsx +0 -86
  1238. package/corpus/templates/plan/app/components/ui/carousel.tsx +0 -260
  1239. package/corpus/templates/plan/app/components/ui/chart.tsx +0 -375
  1240. package/corpus/templates/plan/app/components/ui/checkbox.tsx +0 -28
  1241. package/corpus/templates/plan/app/components/ui/collapsible.tsx +0 -9
  1242. package/corpus/templates/plan/app/components/ui/command.tsx +0 -154
  1243. package/corpus/templates/plan/app/components/ui/context-menu.tsx +0 -202
  1244. package/corpus/templates/plan/app/components/ui/dialog.tsx +0 -130
  1245. package/corpus/templates/plan/app/components/ui/drawer.tsx +0 -116
  1246. package/corpus/templates/plan/app/components/ui/dropdown-menu.tsx +0 -212
  1247. package/corpus/templates/plan/app/components/ui/form.tsx +0 -177
  1248. package/corpus/templates/plan/app/components/ui/hover-card.tsx +0 -27
  1249. package/corpus/templates/plan/app/components/ui/input-otp.tsx +0 -69
  1250. package/corpus/templates/plan/app/components/ui/input.tsx +0 -22
  1251. package/corpus/templates/plan/app/components/ui/label.tsx +0 -24
  1252. package/corpus/templates/plan/app/components/ui/menubar.tsx +0 -234
  1253. package/corpus/templates/plan/app/components/ui/navigation-menu.tsx +0 -128
  1254. package/corpus/templates/plan/app/components/ui/pagination.tsx +0 -121
  1255. package/corpus/templates/plan/app/components/ui/popover.tsx +0 -44
  1256. package/corpus/templates/plan/app/components/ui/progress.tsx +0 -26
  1257. package/corpus/templates/plan/app/components/ui/radio-group.tsx +0 -42
  1258. package/corpus/templates/plan/app/components/ui/resizable.tsx +0 -43
  1259. package/corpus/templates/plan/app/components/ui/scroll-area.tsx +0 -46
  1260. package/corpus/templates/plan/app/components/ui/select.tsx +0 -158
  1261. package/corpus/templates/plan/app/components/ui/separator.tsx +0 -29
  1262. package/corpus/templates/plan/app/components/ui/sheet.tsx +0 -160
  1263. package/corpus/templates/plan/app/components/ui/sidebar.tsx +0 -782
  1264. package/corpus/templates/plan/app/components/ui/skeleton.tsx +0 -15
  1265. package/corpus/templates/plan/app/components/ui/slider.tsx +0 -26
  1266. package/corpus/templates/plan/app/components/ui/sonner.tsx +0 -58
  1267. package/corpus/templates/plan/app/components/ui/spinner.tsx +0 -17
  1268. package/corpus/templates/plan/app/components/ui/switch.tsx +0 -27
  1269. package/corpus/templates/plan/app/components/ui/table.tsx +0 -117
  1270. package/corpus/templates/plan/app/components/ui/textarea.tsx +0 -23
  1271. package/corpus/templates/plan/app/components/ui/toast.tsx +0 -127
  1272. package/corpus/templates/plan/app/components/ui/toaster.tsx +0 -33
  1273. package/corpus/templates/plan/app/components/ui/toggle-group.tsx +0 -59
  1274. package/corpus/templates/plan/app/components/ui/toggle.tsx +0 -43
  1275. package/corpus/templates/plan/app/components/ui/tooltip.tsx +0 -30
  1276. package/corpus/templates/plan/app/components/ui/use-toast.ts +0 -3
  1277. package/corpus/templates/plan/app/hooks/use-mobile.tsx +0 -21
  1278. package/corpus/templates/plan/app/hooks/use-toast.ts +0 -188
  1279. package/corpus/templates/slides/app/components/layout/HeaderActions.tsx +0 -84
  1280. package/corpus/templates/slides/app/components/ui/accordion.tsx +0 -56
  1281. package/corpus/templates/slides/app/components/ui/alert-dialog.tsx +0 -139
  1282. package/corpus/templates/slides/app/components/ui/alert.tsx +0 -59
  1283. package/corpus/templates/slides/app/components/ui/aspect-ratio.tsx +0 -5
  1284. package/corpus/templates/slides/app/components/ui/avatar.tsx +0 -48
  1285. package/corpus/templates/slides/app/components/ui/badge.tsx +0 -37
  1286. package/corpus/templates/slides/app/components/ui/breadcrumb.tsx +0 -115
  1287. package/corpus/templates/slides/app/components/ui/button.tsx +0 -57
  1288. package/corpus/templates/slides/app/components/ui/calendar.tsx +0 -68
  1289. package/corpus/templates/slides/app/components/ui/card.tsx +0 -86
  1290. package/corpus/templates/slides/app/components/ui/carousel.tsx +0 -260
  1291. package/corpus/templates/slides/app/components/ui/chart.tsx +0 -375
  1292. package/corpus/templates/slides/app/components/ui/checkbox.tsx +0 -28
  1293. package/corpus/templates/slides/app/components/ui/collapsible.tsx +0 -9
  1294. package/corpus/templates/slides/app/components/ui/command.tsx +0 -154
  1295. package/corpus/templates/slides/app/components/ui/context-menu.tsx +0 -202
  1296. package/corpus/templates/slides/app/components/ui/dialog.tsx +0 -130
  1297. package/corpus/templates/slides/app/components/ui/drawer.tsx +0 -116
  1298. package/corpus/templates/slides/app/components/ui/dropdown-menu.tsx +0 -212
  1299. package/corpus/templates/slides/app/components/ui/form.tsx +0 -177
  1300. package/corpus/templates/slides/app/components/ui/hover-card.tsx +0 -27
  1301. package/corpus/templates/slides/app/components/ui/input-otp.tsx +0 -69
  1302. package/corpus/templates/slides/app/components/ui/input.tsx +0 -22
  1303. package/corpus/templates/slides/app/components/ui/label.tsx +0 -24
  1304. package/corpus/templates/slides/app/components/ui/menubar.tsx +0 -234
  1305. package/corpus/templates/slides/app/components/ui/navigation-menu.tsx +0 -128
  1306. package/corpus/templates/slides/app/components/ui/pagination.tsx +0 -121
  1307. package/corpus/templates/slides/app/components/ui/popover.tsx +0 -44
  1308. package/corpus/templates/slides/app/components/ui/progress.tsx +0 -26
  1309. package/corpus/templates/slides/app/components/ui/radio-group.tsx +0 -42
  1310. package/corpus/templates/slides/app/components/ui/resizable.tsx +0 -43
  1311. package/corpus/templates/slides/app/components/ui/scroll-area.tsx +0 -46
  1312. package/corpus/templates/slides/app/components/ui/select.tsx +0 -158
  1313. package/corpus/templates/slides/app/components/ui/separator.tsx +0 -29
  1314. package/corpus/templates/slides/app/components/ui/sheet.tsx +0 -160
  1315. package/corpus/templates/slides/app/components/ui/sidebar.tsx +0 -782
  1316. package/corpus/templates/slides/app/components/ui/skeleton.tsx +0 -15
  1317. package/corpus/templates/slides/app/components/ui/slider.tsx +0 -26
  1318. package/corpus/templates/slides/app/components/ui/sonner.tsx +0 -58
  1319. package/corpus/templates/slides/app/components/ui/spinner.tsx +0 -17
  1320. package/corpus/templates/slides/app/components/ui/switch.tsx +0 -27
  1321. package/corpus/templates/slides/app/components/ui/table.tsx +0 -117
  1322. package/corpus/templates/slides/app/components/ui/tabs.tsx +0 -53
  1323. package/corpus/templates/slides/app/components/ui/textarea.tsx +0 -23
  1324. package/corpus/templates/slides/app/components/ui/toast.tsx +0 -127
  1325. package/corpus/templates/slides/app/components/ui/toaster.tsx +0 -33
  1326. package/corpus/templates/slides/app/components/ui/toggle-group.tsx +0 -59
  1327. package/corpus/templates/slides/app/components/ui/toggle.tsx +0 -43
  1328. package/corpus/templates/slides/app/components/ui/tooltip.tsx +0 -30
  1329. package/corpus/templates/slides/app/components/ui/use-toast.ts +0 -3
  1330. package/corpus/templates/slides/app/hooks/use-mobile.tsx +0 -21
  1331. package/corpus/templates/slides/app/hooks/use-toast.ts +0 -188
@@ -1,5 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconColorPicker } from "@tabler/icons-react";
2
3
  import { useEffect, useId, useRef, useState, } from "react";
4
+ import { Popover, PopoverContent, PopoverTrigger, } from "./components/ui/popover.js";
3
5
  import { cn } from "./utils.js";
4
6
  function clampNumber(value, min, max) {
5
7
  let next = value;
@@ -20,6 +22,164 @@ function parseDraftNumber(value, fallback) {
20
22
  const next = Number(match[0]);
21
23
  return Number.isFinite(next) ? next : fallback;
22
24
  }
25
+ const CHECKERBOARD_IMAGE = "linear-gradient(45deg, #d4d4d4 25%, transparent 25%), linear-gradient(-45deg, #d4d4d4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d4d4d4 75%), linear-gradient(-45deg, transparent 75%, #d4d4d4 75%)";
26
+ const FALLBACK_RGBA = { r: 0, g: 0, b: 0, a: 1 };
27
+ function normalizeRgba(color) {
28
+ return {
29
+ r: clamp(color.r, 0, 255),
30
+ g: clamp(color.g, 0, 255),
31
+ b: clamp(color.b, 0, 255),
32
+ a: clampFloat(color.a, 0, 1),
33
+ };
34
+ }
35
+ function normalizeHexColor(value) {
36
+ const trimmed = value.trim();
37
+ if (/^#[0-9a-f]{6}$/i.test(trimmed))
38
+ return trimmed.toUpperCase();
39
+ if (/^[0-9a-f]{6}$/i.test(trimmed))
40
+ return `#${trimmed}`.toUpperCase();
41
+ if (/^#[0-9a-f]{3}$/i.test(trimmed)) {
42
+ return `#${trimmed
43
+ .slice(1)
44
+ .split("")
45
+ .map((char) => char + char)
46
+ .join("")}`.toUpperCase();
47
+ }
48
+ if (/^[0-9a-f]{3}$/i.test(trimmed)) {
49
+ return `#${trimmed
50
+ .split("")
51
+ .map((char) => char + char)
52
+ .join("")}`.toUpperCase();
53
+ }
54
+ return null;
55
+ }
56
+ function parseCssColor(value) {
57
+ const trimmed = value.trim();
58
+ if (!trimmed)
59
+ return null;
60
+ const normalizedHex = normalizeHexColor(trimmed);
61
+ if (normalizedHex) {
62
+ return normalizeRgba({
63
+ r: Number.parseInt(normalizedHex.slice(1, 3), 16),
64
+ g: Number.parseInt(normalizedHex.slice(3, 5), 16),
65
+ b: Number.parseInt(normalizedHex.slice(5, 7), 16),
66
+ a: 1,
67
+ });
68
+ }
69
+ const rgb = trimmed.match(/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*([0-9.]+%?))?/i);
70
+ if (rgb) {
71
+ return normalizeRgba({
72
+ r: Number(rgb[1]),
73
+ g: Number(rgb[2]),
74
+ b: Number(rgb[3]),
75
+ a: parseAlpha(rgb[4]),
76
+ });
77
+ }
78
+ const lower = trimmed.toLowerCase();
79
+ if (lower === "transparent" || lower === "rgba(0, 0, 0, 0)") {
80
+ return { r: 0, g: 0, b: 0, a: 0 };
81
+ }
82
+ return null;
83
+ }
84
+ function channelToHex(value) {
85
+ return clamp(value, 0, 255).toString(16).padStart(2, "0");
86
+ }
87
+ function rgbaToHex(color) {
88
+ const normalized = normalizeRgba(color);
89
+ return `#${channelToHex(normalized.r)}${channelToHex(normalized.g)}${channelToHex(normalized.b)}`.toUpperCase();
90
+ }
91
+ function rgbaToCss(color) {
92
+ const normalized = normalizeRgba(color);
93
+ if (normalized.a >= 1)
94
+ return rgbaToHex(normalized);
95
+ return `rgba(${normalized.r}, ${normalized.g}, ${normalized.b}, ${trimNumber(normalized.a)})`;
96
+ }
97
+ function parseAlpha(value) {
98
+ if (!value)
99
+ return 1;
100
+ if (value.endsWith("%"))
101
+ return Number(value.slice(0, -1)) / 100;
102
+ return Number(value);
103
+ }
104
+ function trimNumber(value) {
105
+ return Number(value.toFixed(2)).toString();
106
+ }
107
+ function rgbaToHsv(color) {
108
+ const normalized = normalizeRgba(color);
109
+ const r = normalized.r / 255;
110
+ const g = normalized.g / 255;
111
+ const b = normalized.b / 255;
112
+ const max = Math.max(r, g, b);
113
+ const min = Math.min(r, g, b);
114
+ const delta = max - min;
115
+ let h = 0;
116
+ if (delta !== 0) {
117
+ if (max === r)
118
+ h = ((g - b) / delta) % 6;
119
+ else if (max === g)
120
+ h = (b - r) / delta + 2;
121
+ else
122
+ h = (r - g) / delta + 4;
123
+ h *= 60;
124
+ if (h < 0)
125
+ h += 360;
126
+ }
127
+ return {
128
+ h: Math.round(h),
129
+ s: max === 0 ? 0 : Math.round((delta / max) * 100),
130
+ v: Math.round(max * 100),
131
+ a: normalized.a,
132
+ };
133
+ }
134
+ function hsvToRgba(color) {
135
+ const h = ((color.h % 360) + 360) % 360;
136
+ const s = clampFloat(color.s, 0, 100) / 100;
137
+ const v = clampFloat(color.v, 0, 100) / 100;
138
+ const chroma = v * s;
139
+ const x = chroma * (1 - Math.abs(((h / 60) % 2) - 1));
140
+ const m = v - chroma;
141
+ let r = 0;
142
+ let g = 0;
143
+ let b = 0;
144
+ if (h < 60)
145
+ [r, g, b] = [chroma, x, 0];
146
+ else if (h < 120)
147
+ [r, g, b] = [x, chroma, 0];
148
+ else if (h < 180)
149
+ [r, g, b] = [0, chroma, x];
150
+ else if (h < 240)
151
+ [r, g, b] = [0, x, chroma];
152
+ else if (h < 300)
153
+ [r, g, b] = [x, 0, chroma];
154
+ else
155
+ [r, g, b] = [chroma, 0, x];
156
+ return normalizeRgba({
157
+ r: Math.round((r + m) * 255),
158
+ g: Math.round((g + m) * 255),
159
+ b: Math.round((b + m) * 255),
160
+ a: clampFloat(color.a, 0, 1),
161
+ });
162
+ }
163
+ function clamp(value, min, max) {
164
+ if (!Number.isFinite(value))
165
+ return min;
166
+ return Math.max(min, Math.min(max, Math.round(value)));
167
+ }
168
+ function clampFloat(value, min, max) {
169
+ if (!Number.isFinite(value))
170
+ return min;
171
+ return Math.max(min, Math.min(max, value));
172
+ }
173
+ function swatchBackground(value) {
174
+ if (value === "transparent" || value === "rgba(0, 0, 0, 0)") {
175
+ return {
176
+ background: CHECKERBOARD_IMAGE,
177
+ backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0",
178
+ backgroundSize: "8px 8px",
179
+ };
180
+ }
181
+ return { background: value };
182
+ }
23
183
  export function VisualInspectorPanel({ title, subtitle, children, className, headerAction, }) {
24
184
  return (_jsxs("aside", { className: cn("w-64 overflow-hidden rounded-xl border border-border bg-card/95 text-card-foreground shadow-2xl shadow-black/35 backdrop-blur", className), children: [_jsxs("div", { className: "flex min-h-10 items-start justify-between gap-2 border-b border-border/70 px-3 py-2.5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: title }), subtitle && (_jsx("div", { className: "mt-0.5 truncate text-[12px] text-foreground", children: subtitle }))] }), headerAction] }), _jsx("div", { className: "max-h-[min(680px,calc(100vh-7rem))] overflow-y-auto p-2", children: children })] }));
25
185
  }
@@ -45,6 +205,195 @@ export function VisualSwatchControl({ options, value, onChange, columns = 8, cla
45
205
  } }, `${option.value}-${option.label}`));
46
206
  }) }));
47
207
  }
208
+ export function VisualColorPicker({ label, value, onChange, documentColors = [], allowTransparent = false, hexLabel = "Hex", documentColorsLabel = "Document colors", transparentLabel = "Transparent", className, }) {
209
+ const [open, setOpen] = useState(false);
210
+ const color = parseCssColor(value) ?? FALLBACK_RGBA;
211
+ const colorHex = rgbaToHex(color);
212
+ const [draft, setDraft] = useState(colorHex.replace(/^#/, ""));
213
+ const [picking, setPicking] = useState(false);
214
+ const hasEyeDropper = typeof window !== "undefined" && "EyeDropper" in window;
215
+ useEffect(() => {
216
+ if (!open)
217
+ setDraft(colorHex.replace(/^#/, ""));
218
+ }, [colorHex, open]);
219
+ const commitDraft = (nextDraft = draft) => {
220
+ const normalized = normalizeHexColor(nextDraft);
221
+ if (!normalized) {
222
+ setDraft(colorHex.replace(/^#/, ""));
223
+ return;
224
+ }
225
+ setDraft(normalized.replace(/^#/, ""));
226
+ onChange(normalized);
227
+ };
228
+ const emitHsv = (nextHsv) => {
229
+ const nextColor = hsvToRgba({ ...nextHsv, a: color.a });
230
+ const nextValue = rgbaToCss(nextColor);
231
+ setDraft(rgbaToHex(nextColor).replace(/^#/, ""));
232
+ onChange(nextValue);
233
+ };
234
+ const pickScreenColor = async () => {
235
+ if (!hasEyeDropper || picking)
236
+ return;
237
+ try {
238
+ setPicking(true);
239
+ const EyeDropperCtor = window.EyeDropper;
240
+ if (!EyeDropperCtor)
241
+ return;
242
+ const result = await new EyeDropperCtor().open();
243
+ if (result?.sRGBHex) {
244
+ const next = normalizeHexColor(result.sRGBHex);
245
+ if (next) {
246
+ setDraft(next.replace(/^#/, ""));
247
+ onChange(next);
248
+ }
249
+ }
250
+ }
251
+ finally {
252
+ setPicking(false);
253
+ }
254
+ };
255
+ const uniqueDocumentColors = Array.from(new Set(documentColors
256
+ .map((color) => color === "transparent" ? color : normalizeHexColor(color))
257
+ .filter(Boolean))).slice(0, 16);
258
+ const displayValue = value === "transparent" || color.a === 0
259
+ ? transparentLabel
260
+ : colorHex.replace(/^#/, "");
261
+ const hsv = rgbaToHsv(color);
262
+ return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", "aria-label": label, className: cn("flex h-7 w-full cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background/70 px-2 text-[11px] shadow-none transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", className), children: [_jsx("span", { className: "size-4 shrink-0 rounded-[3px] border border-border/70", style: swatchBackground(value) }), _jsx("span", { className: "min-w-0 flex-1 truncate text-left font-medium tabular-nums text-foreground", children: displayValue }), _jsx("span", { "aria-hidden": "true", className: "size-0 border-x-[4px] border-t-[5px] border-x-transparent border-t-muted-foreground/70" })] }) }), _jsx(PopoverContent, { side: "left", align: "start", sideOffset: 8, className: "z-[10000] w-[252px] p-0 text-[11px] shadow-xl", onFocusOutside: (event) => event.preventDefault(), children: _jsxs("div", { className: "rounded-md bg-popover text-popover-foreground", children: [_jsx(VisualSaturationBrightnessField, { hsv: hsv, label: label, onChange: emitHsv }), _jsx("div", { className: "mt-2.5 px-3", children: _jsxs("div", { className: "grid grid-cols-[1.5rem_1fr] items-center gap-x-2", children: [_jsx("div", { className: "flex items-center justify-center", children: _jsx("button", { type: "button", "aria-label": label, disabled: !hasEyeDropper || picking, onClick: () => void pickScreenColor(), className: cn("flex size-6 cursor-pointer items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", (!hasEyeDropper || picking) &&
263
+ "pointer-events-none opacity-40", picking &&
264
+ "bg-primary/10 text-primary ring-1 ring-primary/50"), children: _jsx(IconColorPicker, { className: "size-4" }) }) }), _jsx(VisualColorTrack, { label: label, value: hsv.h, min: 0, max: 360, backgroundImage: "linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)", onChange: (nextHue) => emitHsv({ ...hsv, h: nextHue === 360 ? 0 : nextHue }) }), _jsx("span", { className: "mt-2 size-[18px] shrink-0 rounded-[3px] border border-border/60", style: swatchBackground(rgbaToCss(color)) }), _jsx(VisualColorTrack, { label: transparentLabel, value: Math.round(color.a * 100), min: 0, max: 100, backgroundImage: `${CHECKERBOARD_IMAGE}, linear-gradient(90deg, rgba(${color.r}, ${color.g}, ${color.b}, 0), rgba(${color.r}, ${color.g}, ${color.b}, 1))`, backgroundSize: "8px 8px, 8px 8px, 8px 8px, 8px 8px, 100% 100%", backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0, 0 0", onChange: (nextOpacity) => {
265
+ const nextColor = normalizeRgba({
266
+ ...color,
267
+ a: nextOpacity / 100,
268
+ });
269
+ const nextValue = rgbaToCss(nextColor);
270
+ setDraft(rgbaToHex(nextColor).replace(/^#/, ""));
271
+ onChange(nextValue);
272
+ } })] }) }), _jsxs("div", { className: "mt-2.5 grid grid-cols-[4.5rem_1fr] items-center gap-1 border-b border-border/70 px-3 pb-3", children: [_jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: hexLabel }), _jsx("input", { value: draft, spellCheck: false, onChange: (event) => setDraft(event.currentTarget.value), onFocus: (event) => event.currentTarget.select(), onBlur: () => commitDraft(), onKeyDown: (event) => {
273
+ if (event.key === "Enter") {
274
+ event.preventDefault();
275
+ commitDraft();
276
+ event.currentTarget.blur();
277
+ }
278
+ if (event.key === "Escape") {
279
+ event.preventDefault();
280
+ setDraft(colorHex.replace(/^#/, ""));
281
+ event.currentTarget.blur();
282
+ }
283
+ }, className: "h-6 min-w-0 rounded-md border border-input bg-background/70 px-2 text-right text-[11px] uppercase tabular-nums outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring" })] }), (allowTransparent || uniqueDocumentColors.length > 0) && (_jsxs("div", { className: "px-3 py-2.5", children: [_jsx("div", { className: "mb-2 flex h-5 items-center justify-between text-[11px] text-muted-foreground", children: _jsx("span", { children: documentColorsLabel }) }), _jsxs("div", { className: "grid grid-cols-8 gap-1", children: [allowTransparent && (_jsx("button", { type: "button", "aria-label": transparentLabel, "aria-pressed": value === "transparent", className: cn("size-5 cursor-pointer rounded-sm border transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", value === "transparent" || color.a === 0
284
+ ? "border-primary ring-1 ring-primary"
285
+ : "border-border/60"), style: swatchBackground("transparent"), onClick: () => {
286
+ setDraft(colorHex.replace(/^#/, ""));
287
+ onChange("transparent");
288
+ } })), uniqueDocumentColors.map((color) => (_jsx("button", { type: "button", title: color, "aria-label": color, "aria-pressed": colorHex === color, className: cn("size-5 cursor-pointer rounded-sm border transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", colorHex === color
289
+ ? "border-primary ring-1 ring-primary"
290
+ : "border-border/60"), style: swatchBackground(color), onClick: () => {
291
+ setDraft(color);
292
+ onChange(color);
293
+ } }, color)))] })] }))] }) })] }));
294
+ }
295
+ function VisualSaturationBrightnessField({ hsv, label, onChange, }) {
296
+ const fieldRef = useRef(null);
297
+ const draggingRef = useRef(false);
298
+ const hueColor = rgbaToCss(hsvToRgba({ h: hsv.h, s: 100, v: 100, a: 1 }));
299
+ const updateFromPointer = (event) => {
300
+ const rect = fieldRef.current?.getBoundingClientRect();
301
+ if (!rect)
302
+ return;
303
+ onChange({
304
+ ...hsv,
305
+ s: clamp(((event.clientX - rect.left) / rect.width) * 100, 0, 100),
306
+ v: clamp(100 - ((event.clientY - rect.top) / rect.height) * 100, 0, 100),
307
+ });
308
+ };
309
+ const stepWithKeyboard = (event) => {
310
+ const step = event.shiftKey ? 10 : 1;
311
+ if (event.key === "ArrowRight") {
312
+ event.preventDefault();
313
+ onChange({ ...hsv, s: clamp(hsv.s + step, 0, 100) });
314
+ }
315
+ if (event.key === "ArrowLeft") {
316
+ event.preventDefault();
317
+ onChange({ ...hsv, s: clamp(hsv.s - step, 0, 100) });
318
+ }
319
+ if (event.key === "ArrowUp") {
320
+ event.preventDefault();
321
+ onChange({ ...hsv, v: clamp(hsv.v + step, 0, 100) });
322
+ }
323
+ if (event.key === "ArrowDown") {
324
+ event.preventDefault();
325
+ onChange({ ...hsv, v: clamp(hsv.v - step, 0, 100) });
326
+ }
327
+ };
328
+ return (_jsx("div", { ref: fieldRef, tabIndex: 0, "aria-label": label, onPointerDown: (event) => {
329
+ draggingRef.current = true;
330
+ event.currentTarget.setPointerCapture(event.pointerId);
331
+ updateFromPointer(event);
332
+ }, onPointerMove: (event) => {
333
+ if (!draggingRef.current)
334
+ return;
335
+ updateFromPointer(event);
336
+ }, onPointerUp: (event) => {
337
+ draggingRef.current = false;
338
+ if (event.currentTarget.hasPointerCapture(event.pointerId)) {
339
+ event.currentTarget.releasePointerCapture(event.pointerId);
340
+ }
341
+ }, onPointerCancel: () => {
342
+ draggingRef.current = false;
343
+ }, onKeyDown: stepWithKeyboard, className: "relative h-40 w-full cursor-crosshair overflow-hidden rounded-t-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset active:cursor-grabbing", style: {
344
+ backgroundImage: `linear-gradient(to top, #000 0%, transparent 100%), linear-gradient(to right, #fff 0%, ${hueColor} 100%)`,
345
+ }, children: _jsx("span", { className: "pointer-events-none absolute size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_hsl(var(--foreground)/0.6)]", style: {
346
+ left: `${hsv.s}%`,
347
+ top: `${100 - hsv.v}%`,
348
+ } }) }));
349
+ }
350
+ function VisualColorTrack({ label, value, min, max, backgroundImage, backgroundSize, backgroundPosition, onChange, }) {
351
+ const trackRef = useRef(null);
352
+ const draggingRef = useRef(false);
353
+ const percent = ((value - min) / (max - min)) * 100;
354
+ const updateFromPointer = (event) => {
355
+ const rect = trackRef.current?.getBoundingClientRect();
356
+ if (!rect)
357
+ return;
358
+ const next = min + ((event.clientX - rect.left) / rect.width) * (max - min);
359
+ onChange(clamp(next, min, max));
360
+ };
361
+ const stepWithKeyboard = (event) => {
362
+ const step = event.shiftKey ? 10 : 1;
363
+ if (event.key === "ArrowRight" || event.key === "ArrowUp") {
364
+ event.preventDefault();
365
+ onChange(clamp(value + step, min, max));
366
+ }
367
+ if (event.key === "ArrowLeft" || event.key === "ArrowDown") {
368
+ event.preventDefault();
369
+ onChange(clamp(value - step, min, max));
370
+ }
371
+ if (event.key === "Home") {
372
+ event.preventDefault();
373
+ onChange(min);
374
+ }
375
+ if (event.key === "End") {
376
+ event.preventDefault();
377
+ onChange(max);
378
+ }
379
+ };
380
+ return (_jsx("div", { ref: trackRef, role: "slider", tabIndex: 0, "aria-label": label, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": Math.round(value), onKeyDown: stepWithKeyboard, onPointerDown: (event) => {
381
+ draggingRef.current = true;
382
+ event.currentTarget.setPointerCapture(event.pointerId);
383
+ updateFromPointer(event);
384
+ }, onPointerMove: (event) => {
385
+ if (!draggingRef.current)
386
+ return;
387
+ updateFromPointer(event);
388
+ }, onPointerUp: (event) => {
389
+ draggingRef.current = false;
390
+ if (event.currentTarget.hasPointerCapture(event.pointerId)) {
391
+ event.currentTarget.releasePointerCapture(event.pointerId);
392
+ }
393
+ }, onPointerCancel: () => {
394
+ draggingRef.current = false;
395
+ }, className: "relative h-3.5 cursor-pointer rounded-full border border-border/60 outline-none ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:cursor-grabbing", style: { backgroundImage, backgroundSize, backgroundPosition }, children: _jsx("span", { className: "pointer-events-none absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_hsl(var(--foreground)/0.6)]", style: { left: `${clamp(percent, 0, 100)}%` } }) }));
396
+ }
48
397
  export function VisualSegmentedControl({ options, value, onChange, className, }) {
49
398
  return (_jsx("div", { className: cn("flex min-h-7 overflow-hidden rounded-md border border-border bg-background/60", className), children: options.map((option) => (_jsx("button", { type: "button", onClick: () => onChange(option.value), className: cn("min-w-0 flex-1 cursor-pointer px-2 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground", value === option.value && "bg-accent text-foreground"), children: _jsx("span", { className: "truncate", children: option.label }) }, option.value))) }));
50
399
  }
@@ -144,7 +493,7 @@ export function VisualTweakControl({ tweak, value, onChange, className, }) {
144
493
  ? Number(value)
145
494
  : Number(tweak.defaultValue);
146
495
  return (_jsxs(VisualControlRow, { label: tweak.label, className: className, children: [(tweak.type === "color-swatch" ||
147
- tweak.type === "color-swatches") && (_jsx(VisualSwatchControl, { options: tweak.options ?? [], value: String(value), onChange: onChange })), tweak.type === "segment" && (_jsx(VisualSegmentedControl, { options: tweak.options ?? [], value: String(value), onChange: onChange })), tweak.type === "slider" && (_jsx(VisualSliderControl, { min: tweak.min ?? 0, max: tweak.max ?? 100, step: tweak.step ?? 1, unit: tweak.unit ??
496
+ tweak.type === "color-swatches") && (_jsx(VisualColorPicker, { label: tweak.label, value: String(value), documentColors: (tweak.options ?? []).map((option) => option.color ?? option.value), onChange: onChange })), tweak.type === "segment" && (_jsx(VisualSegmentedControl, { options: tweak.options ?? [], value: String(value), onChange: onChange })), tweak.type === "slider" && (_jsx(VisualSliderControl, { min: tweak.min ?? 0, max: tweak.max ?? 100, step: tweak.step ?? 1, unit: tweak.unit ??
148
497
  (tweak.cssVar?.toLowerCase().includes("radius") ? "px" : undefined), value: Number.isFinite(numericValue) ? numericValue : 0, onChange: onChange }))] }));
149
498
  }
150
499
  //# sourceMappingURL=visual-style-controls.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"visual-style-controls.js","sourceRoot":"","sources":["../../src/client/visual-style-controls.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAuBhC,SAAS,WAAW,CAAC,KAAa,EAAE,GAAY,EAAE,GAAY;IAC5D,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxD,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,KAAa,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CACH,EACA,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,CAC3B,KAAC,sBAAsB,IACrB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE,EAC5B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EACpB,QAAQ,EAAE,QAAQ,GAClB,CACH,EACA,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,CAC1B,KAAC,mBAAmB,IAClB,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,EACnB,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,GAAG,EACrB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EACrB,IAAI,EACF,KAAK,CAAC,IAAI;oBACV,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,EAErE,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EACvD,QAAQ,EAAE,QAAQ,GAClB,CACH,IACgB,CACpB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useEffect,\n useId,\n useRef,\n useState,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n} from \"react\";\n\nimport { cn } from \"./utils.js\";\n\nexport type VisualControlValue = string | number | boolean;\n\nexport interface VisualControlOption {\n label: string;\n value: string;\n color?: string;\n}\n\nexport interface VisualTweakDefinition {\n id: string;\n label: string;\n type: \"color-swatch\" | \"color-swatches\" | \"segment\" | \"slider\" | \"toggle\";\n options?: VisualControlOption[];\n min?: number;\n max?: number;\n step?: number;\n defaultValue: VisualControlValue;\n cssVar?: string;\n unit?: string;\n}\n\nfunction clampNumber(value: number, min?: number, max?: number) {\n let next = value;\n if (typeof min === \"number\") next = Math.max(min, next);\n if (typeof max === \"number\") next = Math.min(max, next);\n return next;\n}\n\nfunction formatNumber(value: number, unit?: string) {\n const rounded = Number.isInteger(value) ? value : Number(value.toFixed(2));\n return unit ? `${rounded}${unit}` : String(rounded);\n}\n\nfunction parseDraftNumber(value: string, fallback: number) {\n const match = value.trim().match(/-?\\d+(?:\\.\\d+)?/);\n if (!match) return fallback;\n const next = Number(match[0]);\n return Number.isFinite(next) ? next : fallback;\n}\n\nexport function VisualInspectorPanel({\n title,\n subtitle,\n children,\n className,\n headerAction,\n}: {\n title: ReactNode;\n subtitle?: ReactNode;\n children: ReactNode;\n className?: string;\n headerAction?: ReactNode;\n}) {\n return (\n <aside\n className={cn(\n \"w-64 overflow-hidden rounded-xl border border-border bg-card/95 text-card-foreground shadow-2xl shadow-black/35 backdrop-blur\",\n className,\n )}\n >\n <div className=\"flex min-h-10 items-start justify-between gap-2 border-b border-border/70 px-3 py-2.5\">\n <div className=\"min-w-0\">\n <div className=\"truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground\">\n {title}\n </div>\n {subtitle && (\n <div className=\"mt-0.5 truncate text-[12px] text-foreground\">\n {subtitle}\n </div>\n )}\n </div>\n {headerAction}\n </div>\n <div className=\"max-h-[min(680px,calc(100vh-7rem))] overflow-y-auto p-2\">\n {children}\n </div>\n </aside>\n );\n}\n\nexport function VisualInspectorSection({\n title,\n children,\n className,\n}: {\n title: ReactNode;\n children: ReactNode;\n className?: string;\n}) {\n return (\n <section className={cn(\"rounded-lg px-1.5 py-2\", className)}>\n <div className=\"mb-2 px-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/75\">\n {title}\n </div>\n <div className=\"space-y-2\">{children}</div>\n </section>\n );\n}\n\nexport function VisualControlRow({\n label,\n children,\n className,\n}: {\n label: ReactNode;\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div className={cn(\"grid gap-1\", className)}>\n <span className=\"text-[11px] text-muted-foreground\">{label}</span>\n {children}\n </div>\n );\n}\n\nexport function VisualSwatchControl({\n options,\n value,\n onChange,\n columns = 8,\n className,\n}: {\n options: VisualControlOption[];\n value: string;\n onChange: (value: string) => void;\n columns?: number;\n className?: string;\n}) {\n return (\n <div\n className={cn(\"grid gap-1.5\", className)}\n style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}\n >\n {options.map((option) => {\n const swatch = option.color ?? option.value;\n const isTransparent = swatch === \"transparent\";\n return (\n <button\n key={`${option.value}-${option.label}`}\n type=\"button\"\n title={option.label}\n aria-label={option.label}\n onClick={() => onChange(option.value)}\n className={cn(\n \"size-5 cursor-pointer rounded-md border border-border/70 transition-all hover:scale-105 hover:border-foreground/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n value === option.value &&\n \"border-foreground/70 ring-2 ring-foreground/40 ring-offset-1 ring-offset-card\",\n )}\n style={{\n background: isTransparent\n ? \"linear-gradient(45deg, hsl(var(--muted)) 25%, transparent 25%), linear-gradient(-45deg, hsl(var(--muted)) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, hsl(var(--muted)) 75%), linear-gradient(-45deg, transparent 75%, hsl(var(--muted)) 75%)\"\n : swatch,\n backgroundPosition: isTransparent\n ? \"0 0, 0 4px, 4px -4px, -4px 0\"\n : undefined,\n backgroundSize: isTransparent ? \"8px 8px\" : undefined,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nexport function VisualSegmentedControl({\n options,\n value,\n onChange,\n className,\n}: {\n options: VisualControlOption[];\n value: string;\n onChange: (value: string) => void;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n \"flex min-h-7 overflow-hidden rounded-md border border-border bg-background/60\",\n className,\n )}\n >\n {options.map((option) => (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => onChange(option.value)}\n className={cn(\n \"min-w-0 flex-1 cursor-pointer px-2 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground\",\n value === option.value && \"bg-accent text-foreground\",\n )}\n >\n <span className=\"truncate\">{option.label}</span>\n </button>\n ))}\n </div>\n );\n}\n\nexport function VisualToggleControl({\n checked,\n onChange,\n label,\n}: {\n checked: boolean;\n onChange: (checked: boolean) => void;\n label?: string;\n}) {\n return (\n <button\n type=\"button\"\n aria-pressed={checked}\n aria-label={label}\n onClick={() => onChange(!checked)}\n className={cn(\n \"relative h-5 w-9 cursor-pointer rounded-full border border-border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n checked ? \"bg-primary/35\" : \"bg-muted\",\n )}\n >\n <span\n className={cn(\n \"absolute top-1/2 size-3.5 -translate-y-1/2 rounded-full bg-foreground shadow transition-transform\",\n checked ? \"translate-x-[18px]\" : \"translate-x-[3px]\",\n )}\n />\n </button>\n );\n}\n\nexport function VisualSliderControl({\n value,\n onChange,\n min = 0,\n max = 100,\n step = 1,\n unit,\n}: {\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n unit?: string;\n}) {\n const safeValue = clampNumber(Number.isFinite(value) ? value : min, min, max);\n return (\n <div className=\"flex h-7 items-center gap-2\">\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={safeValue}\n onChange={(event) => onChange(Number(event.currentTarget.value))}\n className=\"min-w-0 flex-1 cursor-pointer accent-foreground\"\n />\n <span className=\"w-9 text-right text-[11px] tabular-nums text-muted-foreground\">\n {formatNumber(safeValue, unit)}\n </span>\n </div>\n );\n}\n\nexport function VisualScrubInput({\n label,\n value,\n onChange,\n min,\n max,\n step = 1,\n unit,\n disabled = false,\n}: {\n label: string;\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n unit?: string;\n disabled?: boolean;\n}) {\n const id = useId();\n const [draft, setDraft] = useState(() => formatNumber(value, unit));\n const [focused, setFocused] = useState(false);\n const dragRef = useRef<{\n pointerId: number;\n prevX: number;\n dragged: boolean;\n } | null>(null);\n\n useEffect(() => {\n if (!focused) setDraft(formatNumber(value, unit));\n }, [focused, unit, value]);\n\n const commit = (nextDraft = draft) => {\n const parsed = parseDraftNumber(nextDraft, value);\n const next = clampNumber(parsed, min, max);\n onChange(next);\n setDraft(formatNumber(next, unit));\n };\n\n const setNext = (next: number) => {\n const clamped = clampNumber(next, min, max);\n onChange(clamped);\n setDraft(formatNumber(clamped, unit));\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit();\n event.currentTarget.blur();\n return;\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n setDraft(formatNumber(value, unit));\n event.currentTarget.blur();\n return;\n }\n if (event.key === \"ArrowUp\" || event.key === \"ArrowDown\") {\n event.preventDefault();\n const mult =\n event.shiftKey || event.metaKey ? 10 : event.altKey ? 0.1 : 1;\n const direction = event.key === \"ArrowUp\" ? 1 : -1;\n const base = parseDraftNumber(draft, value);\n setNext(base + direction * step * mult);\n }\n };\n\n const onPointerDown = (event: PointerEvent<HTMLLabelElement>) => {\n if (disabled || event.button !== 0) return;\n event.preventDefault();\n dragRef.current = {\n pointerId: event.pointerId,\n prevX: event.clientX,\n dragged: false,\n };\n event.currentTarget.setPointerCapture(event.pointerId);\n };\n\n const onPointerMove = (event: PointerEvent<HTMLLabelElement>) => {\n const drag = dragRef.current;\n if (!drag || drag.pointerId !== event.pointerId) return;\n const delta = event.clientX - drag.prevX;\n if (delta === 0) return;\n drag.prevX = event.clientX;\n drag.dragged = true;\n const mult = event.shiftKey || event.metaKey ? 10 : event.altKey ? 0.1 : 1;\n setNext(value + delta * step * mult);\n };\n\n const onPointerUp = (event: PointerEvent<HTMLLabelElement>) => {\n const drag = dragRef.current;\n if (!drag || drag.pointerId !== event.pointerId) return;\n event.currentTarget.releasePointerCapture(event.pointerId);\n dragRef.current = null;\n if (!drag.dragged) {\n document.getElementById(id)?.focus();\n }\n };\n\n return (\n <div className=\"flex items-center gap-1.5\">\n <label\n htmlFor={id}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n className={cn(\n \"flex w-8 shrink-0 cursor-ew-resize select-none items-center justify-center rounded border border-transparent px-1 text-[10px] font-semibold text-muted-foreground hover:border-border hover:bg-accent/60\",\n disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {label}\n </label>\n <input\n id={id}\n value={draft}\n disabled={disabled}\n onFocus={() => setFocused(true)}\n onBlur={() => {\n setFocused(false);\n commit();\n }}\n onChange={(event) => setDraft(event.currentTarget.value)}\n onKeyDown={onKeyDown}\n className=\"h-7 min-w-0 flex-1 rounded-md border border-input bg-background/70 px-2 text-right text-[11px] tabular-nums text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring disabled:opacity-50\"\n />\n </div>\n );\n}\n\nexport function VisualTweakControl({\n tweak,\n value,\n onChange,\n className,\n}: {\n tweak: VisualTweakDefinition;\n value: VisualControlValue;\n onChange: (value: VisualControlValue) => void;\n className?: string;\n}) {\n if (tweak.type === \"toggle\") {\n return (\n <div\n className={cn(\"flex h-7 items-center justify-between gap-2\", className)}\n >\n <span className=\"truncate text-[11px] text-muted-foreground\">\n {tweak.label}\n </span>\n <VisualToggleControl\n checked={Boolean(value)}\n onChange={onChange}\n label={tweak.label}\n />\n </div>\n );\n }\n\n const numericValue =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\"\n ? Number(value)\n : Number(tweak.defaultValue);\n\n return (\n <VisualControlRow label={tweak.label} className={className}>\n {((tweak.type as string) === \"color-swatch\" ||\n (tweak.type as string) === \"color-swatches\") && (\n <VisualSwatchControl\n options={tweak.options ?? []}\n value={String(value)}\n onChange={onChange}\n />\n )}\n {tweak.type === \"segment\" && (\n <VisualSegmentedControl\n options={tweak.options ?? []}\n value={String(value)}\n onChange={onChange}\n />\n )}\n {tweak.type === \"slider\" && (\n <VisualSliderControl\n min={tweak.min ?? 0}\n max={tweak.max ?? 100}\n step={tweak.step ?? 1}\n unit={\n tweak.unit ??\n (tweak.cssVar?.toLowerCase().includes(\"radius\") ? \"px\" : undefined)\n }\n value={Number.isFinite(numericValue) ? numericValue : 0}\n onChange={onChange}\n />\n )}\n </VisualControlRow>\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,CAC3B,KAAC,sBAAsB,IACrB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE,EAC5B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EACpB,QAAQ,EAAE,QAAQ,GAClB,CACH,EACA,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,CAC1B,KAAC,mBAAmB,IAClB,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,EACnB,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,GAAG,EACrB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EACrB,IAAI,EACF,KAAK,CAAC,IAAI;oBACV,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,EAErE,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EACvD,QAAQ,EAAE,QAAQ,GAClB,CACH,IACgB,CACpB,CAAC;AACJ,CAAC","sourcesContent":["import { IconColorPicker } from \"@tabler/icons-react\";\nimport {\n useEffect,\n useId,\n useRef,\n useState,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n} from \"react\";\n\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"./components/ui/popover.js\";\nimport { cn } from \"./utils.js\";\n\nexport type VisualControlValue = string | number | boolean;\n\nexport interface VisualControlOption {\n label: string;\n value: string;\n color?: string;\n}\n\nexport interface VisualTweakDefinition {\n id: string;\n label: string;\n type: \"color-swatch\" | \"color-swatches\" | \"segment\" | \"slider\" | \"toggle\";\n options?: VisualControlOption[];\n min?: number;\n max?: number;\n step?: number;\n defaultValue: VisualControlValue;\n cssVar?: string;\n unit?: string;\n}\n\nfunction clampNumber(value: number, min?: number, max?: number) {\n let next = value;\n if (typeof min === \"number\") next = Math.max(min, next);\n if (typeof max === \"number\") next = Math.min(max, next);\n return next;\n}\n\nfunction formatNumber(value: number, unit?: string) {\n const rounded = Number.isInteger(value) ? value : Number(value.toFixed(2));\n return unit ? `${rounded}${unit}` : String(rounded);\n}\n\nfunction parseDraftNumber(value: string, fallback: number) {\n const match = value.trim().match(/-?\\d+(?:\\.\\d+)?/);\n if (!match) return fallback;\n const next = Number(match[0]);\n return Number.isFinite(next) ? next : fallback;\n}\n\ninterface RgbaColor {\n r: number;\n g: number;\n b: number;\n a: number;\n}\n\ninterface HsvaColor {\n h: number;\n s: number;\n v: number;\n a: number;\n}\n\nconst CHECKERBOARD_IMAGE =\n \"linear-gradient(45deg, #d4d4d4 25%, transparent 25%), linear-gradient(-45deg, #d4d4d4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d4d4d4 75%), linear-gradient(-45deg, transparent 75%, #d4d4d4 75%)\";\nconst FALLBACK_RGBA: RgbaColor = { r: 0, g: 0, b: 0, a: 1 };\n\nfunction normalizeRgba(color: RgbaColor): RgbaColor {\n return {\n r: clamp(color.r, 0, 255),\n g: clamp(color.g, 0, 255),\n b: clamp(color.b, 0, 255),\n a: clampFloat(color.a, 0, 1),\n };\n}\n\nfunction normalizeHexColor(value: string): string | null {\n const trimmed = value.trim();\n if (/^#[0-9a-f]{6}$/i.test(trimmed)) return trimmed.toUpperCase();\n if (/^[0-9a-f]{6}$/i.test(trimmed)) return `#${trimmed}`.toUpperCase();\n if (/^#[0-9a-f]{3}$/i.test(trimmed)) {\n return `#${trimmed\n .slice(1)\n .split(\"\")\n .map((char) => char + char)\n .join(\"\")}`.toUpperCase();\n }\n if (/^[0-9a-f]{3}$/i.test(trimmed)) {\n return `#${trimmed\n .split(\"\")\n .map((char) => char + char)\n .join(\"\")}`.toUpperCase();\n }\n return null;\n}\n\nfunction parseCssColor(value: string): RgbaColor | null {\n const trimmed = value.trim();\n if (!trimmed) return null;\n const normalizedHex = normalizeHexColor(trimmed);\n if (normalizedHex) {\n return normalizeRgba({\n r: Number.parseInt(normalizedHex.slice(1, 3), 16),\n g: Number.parseInt(normalizedHex.slice(3, 5), 16),\n b: Number.parseInt(normalizedHex.slice(5, 7), 16),\n a: 1,\n });\n }\n const rgb = trimmed.match(\n /^rgba?\\(\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)(?:\\s*,\\s*([0-9.]+%?))?/i,\n );\n if (rgb) {\n return normalizeRgba({\n r: Number(rgb[1]),\n g: Number(rgb[2]),\n b: Number(rgb[3]),\n a: parseAlpha(rgb[4]),\n });\n }\n const lower = trimmed.toLowerCase();\n if (lower === \"transparent\" || lower === \"rgba(0, 0, 0, 0)\") {\n return { r: 0, g: 0, b: 0, a: 0 };\n }\n return null;\n}\n\nfunction channelToHex(value: number): string {\n return clamp(value, 0, 255).toString(16).padStart(2, \"0\");\n}\n\nfunction rgbaToHex(color: RgbaColor): string {\n const normalized = normalizeRgba(color);\n return `#${channelToHex(normalized.r)}${channelToHex(normalized.g)}${channelToHex(normalized.b)}`.toUpperCase();\n}\n\nfunction rgbaToCss(color: RgbaColor): string {\n const normalized = normalizeRgba(color);\n if (normalized.a >= 1) return rgbaToHex(normalized);\n return `rgba(${normalized.r}, ${normalized.g}, ${normalized.b}, ${trimNumber(normalized.a)})`;\n}\n\nfunction parseAlpha(value: string | undefined): number {\n if (!value) return 1;\n if (value.endsWith(\"%\")) return Number(value.slice(0, -1)) / 100;\n return Number(value);\n}\n\nfunction trimNumber(value: number) {\n return Number(value.toFixed(2)).toString();\n}\n\nfunction rgbaToHsv(color: RgbaColor): HsvaColor {\n const normalized = normalizeRgba(color);\n const r = normalized.r / 255;\n const g = normalized.g / 255;\n const b = normalized.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const delta = max - min;\n\n let h = 0;\n if (delta !== 0) {\n if (max === r) h = ((g - b) / delta) % 6;\n else if (max === g) h = (b - r) / delta + 2;\n else h = (r - g) / delta + 4;\n h *= 60;\n if (h < 0) h += 360;\n }\n\n return {\n h: Math.round(h),\n s: max === 0 ? 0 : Math.round((delta / max) * 100),\n v: Math.round(max * 100),\n a: normalized.a,\n };\n}\n\nfunction hsvToRgba(color: HsvaColor): RgbaColor {\n const h = ((color.h % 360) + 360) % 360;\n const s = clampFloat(color.s, 0, 100) / 100;\n const v = clampFloat(color.v, 0, 100) / 100;\n const chroma = v * s;\n const x = chroma * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = v - chroma;\n\n let r = 0;\n let g = 0;\n let b = 0;\n if (h < 60) [r, g, b] = [chroma, x, 0];\n else if (h < 120) [r, g, b] = [x, chroma, 0];\n else if (h < 180) [r, g, b] = [0, chroma, x];\n else if (h < 240) [r, g, b] = [0, x, chroma];\n else if (h < 300) [r, g, b] = [x, 0, chroma];\n else [r, g, b] = [chroma, 0, x];\n\n return normalizeRgba({\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n a: clampFloat(color.a, 0, 1),\n });\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n if (!Number.isFinite(value)) return min;\n return Math.max(min, Math.min(max, Math.round(value)));\n}\n\nfunction clampFloat(value: number, min: number, max: number): number {\n if (!Number.isFinite(value)) return min;\n return Math.max(min, Math.min(max, value));\n}\n\nfunction swatchBackground(value: string) {\n if (value === \"transparent\" || value === \"rgba(0, 0, 0, 0)\") {\n return {\n background: CHECKERBOARD_IMAGE,\n backgroundPosition: \"0 0, 0 4px, 4px -4px, -4px 0\",\n backgroundSize: \"8px 8px\",\n };\n }\n return { background: value };\n}\n\nexport function VisualInspectorPanel({\n title,\n subtitle,\n children,\n className,\n headerAction,\n}: {\n title: ReactNode;\n subtitle?: ReactNode;\n children: ReactNode;\n className?: string;\n headerAction?: ReactNode;\n}) {\n return (\n <aside\n className={cn(\n \"w-64 overflow-hidden rounded-xl border border-border bg-card/95 text-card-foreground shadow-2xl shadow-black/35 backdrop-blur\",\n className,\n )}\n >\n <div className=\"flex min-h-10 items-start justify-between gap-2 border-b border-border/70 px-3 py-2.5\">\n <div className=\"min-w-0\">\n <div className=\"truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground\">\n {title}\n </div>\n {subtitle && (\n <div className=\"mt-0.5 truncate text-[12px] text-foreground\">\n {subtitle}\n </div>\n )}\n </div>\n {headerAction}\n </div>\n <div className=\"max-h-[min(680px,calc(100vh-7rem))] overflow-y-auto p-2\">\n {children}\n </div>\n </aside>\n );\n}\n\nexport function VisualInspectorSection({\n title,\n children,\n className,\n}: {\n title: ReactNode;\n children: ReactNode;\n className?: string;\n}) {\n return (\n <section className={cn(\"rounded-lg px-1.5 py-2\", className)}>\n <div className=\"mb-2 px-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/75\">\n {title}\n </div>\n <div className=\"space-y-2\">{children}</div>\n </section>\n );\n}\n\nexport function VisualControlRow({\n label,\n children,\n className,\n}: {\n label: ReactNode;\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div className={cn(\"grid gap-1\", className)}>\n <span className=\"text-[11px] text-muted-foreground\">{label}</span>\n {children}\n </div>\n );\n}\n\nexport function VisualSwatchControl({\n options,\n value,\n onChange,\n columns = 8,\n className,\n}: {\n options: VisualControlOption[];\n value: string;\n onChange: (value: string) => void;\n columns?: number;\n className?: string;\n}) {\n return (\n <div\n className={cn(\"grid gap-1.5\", className)}\n style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}\n >\n {options.map((option) => {\n const swatch = option.color ?? option.value;\n const isTransparent = swatch === \"transparent\";\n return (\n <button\n key={`${option.value}-${option.label}`}\n type=\"button\"\n title={option.label}\n aria-label={option.label}\n onClick={() => onChange(option.value)}\n className={cn(\n \"size-5 cursor-pointer rounded-md border border-border/70 transition-all hover:scale-105 hover:border-foreground/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n value === option.value &&\n \"border-foreground/70 ring-2 ring-foreground/40 ring-offset-1 ring-offset-card\",\n )}\n style={{\n background: isTransparent\n ? \"linear-gradient(45deg, hsl(var(--muted)) 25%, transparent 25%), linear-gradient(-45deg, hsl(var(--muted)) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, hsl(var(--muted)) 75%), linear-gradient(-45deg, transparent 75%, hsl(var(--muted)) 75%)\"\n : swatch,\n backgroundPosition: isTransparent\n ? \"0 0, 0 4px, 4px -4px, -4px 0\"\n : undefined,\n backgroundSize: isTransparent ? \"8px 8px\" : undefined,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nexport function VisualColorPicker({\n label,\n value,\n onChange,\n documentColors = [],\n allowTransparent = false,\n hexLabel = \"Hex\",\n documentColorsLabel = \"Document colors\",\n transparentLabel = \"Transparent\",\n className,\n}: {\n label: string;\n value: string;\n onChange: (value: string) => void;\n documentColors?: string[];\n allowTransparent?: boolean;\n hexLabel?: string;\n documentColorsLabel?: string;\n transparentLabel?: string;\n className?: string;\n}) {\n const [open, setOpen] = useState(false);\n const color = parseCssColor(value) ?? FALLBACK_RGBA;\n const colorHex = rgbaToHex(color);\n const [draft, setDraft] = useState(colorHex.replace(/^#/, \"\"));\n const [picking, setPicking] = useState(false);\n const hasEyeDropper = typeof window !== \"undefined\" && \"EyeDropper\" in window;\n\n useEffect(() => {\n if (!open) setDraft(colorHex.replace(/^#/, \"\"));\n }, [colorHex, open]);\n\n const commitDraft = (nextDraft = draft) => {\n const normalized = normalizeHexColor(nextDraft);\n if (!normalized) {\n setDraft(colorHex.replace(/^#/, \"\"));\n return;\n }\n setDraft(normalized.replace(/^#/, \"\"));\n onChange(normalized);\n };\n\n const emitHsv = (nextHsv: HsvaColor) => {\n const nextColor = hsvToRgba({ ...nextHsv, a: color.a });\n const nextValue = rgbaToCss(nextColor);\n setDraft(rgbaToHex(nextColor).replace(/^#/, \"\"));\n onChange(nextValue);\n };\n\n const pickScreenColor = async () => {\n if (!hasEyeDropper || picking) return;\n try {\n setPicking(true);\n const EyeDropperCtor = (\n window as unknown as {\n EyeDropper?: new () => { open: () => Promise<{ sRGBHex: string }> };\n }\n ).EyeDropper;\n if (!EyeDropperCtor) return;\n const result = await new EyeDropperCtor().open();\n if (result?.sRGBHex) {\n const next = normalizeHexColor(result.sRGBHex);\n if (next) {\n setDraft(next.replace(/^#/, \"\"));\n onChange(next);\n }\n }\n } finally {\n setPicking(false);\n }\n };\n\n const uniqueDocumentColors = Array.from(\n new Set(\n documentColors\n .map((color) =>\n color === \"transparent\" ? color : normalizeHexColor(color),\n )\n .filter(Boolean) as string[],\n ),\n ).slice(0, 16);\n const displayValue =\n value === \"transparent\" || color.a === 0\n ? transparentLabel\n : colorHex.replace(/^#/, \"\");\n const hsv = rgbaToHsv(color);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-label={label}\n className={cn(\n \"flex h-7 w-full cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background/70 px-2 text-[11px] shadow-none transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n >\n <span\n className=\"size-4 shrink-0 rounded-[3px] border border-border/70\"\n style={swatchBackground(value)}\n />\n <span className=\"min-w-0 flex-1 truncate text-left font-medium tabular-nums text-foreground\">\n {displayValue}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"size-0 border-x-[4px] border-t-[5px] border-x-transparent border-t-muted-foreground/70\"\n />\n </button>\n </PopoverTrigger>\n <PopoverContent\n side=\"left\"\n align=\"start\"\n sideOffset={8}\n className=\"z-[10000] w-[252px] p-0 text-[11px] shadow-xl\"\n onFocusOutside={(event) => event.preventDefault()}\n >\n <div className=\"rounded-md bg-popover text-popover-foreground\">\n <VisualSaturationBrightnessField\n hsv={hsv}\n label={label}\n onChange={emitHsv}\n />\n\n <div className=\"mt-2.5 px-3\">\n <div className=\"grid grid-cols-[1.5rem_1fr] items-center gap-x-2\">\n <div className=\"flex items-center justify-center\">\n <button\n type=\"button\"\n aria-label={label}\n disabled={!hasEyeDropper || picking}\n onClick={() => void pickScreenColor()}\n className={cn(\n \"flex size-6 cursor-pointer items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n (!hasEyeDropper || picking) &&\n \"pointer-events-none opacity-40\",\n picking &&\n \"bg-primary/10 text-primary ring-1 ring-primary/50\",\n )}\n >\n <IconColorPicker className=\"size-4\" />\n </button>\n </div>\n <VisualColorTrack\n label={label}\n value={hsv.h}\n min={0}\n max={360}\n backgroundImage=\"linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)\"\n onChange={(nextHue) =>\n emitHsv({ ...hsv, h: nextHue === 360 ? 0 : nextHue })\n }\n />\n <span\n className=\"mt-2 size-[18px] shrink-0 rounded-[3px] border border-border/60\"\n style={swatchBackground(rgbaToCss(color))}\n />\n <VisualColorTrack\n label={transparentLabel}\n value={Math.round(color.a * 100)}\n min={0}\n max={100}\n backgroundImage={`${CHECKERBOARD_IMAGE}, linear-gradient(90deg, rgba(${color.r}, ${color.g}, ${color.b}, 0), rgba(${color.r}, ${color.g}, ${color.b}, 1))`}\n backgroundSize=\"8px 8px, 8px 8px, 8px 8px, 8px 8px, 100% 100%\"\n backgroundPosition=\"0 0, 0 4px, 4px -4px, -4px 0, 0 0\"\n onChange={(nextOpacity) => {\n const nextColor = normalizeRgba({\n ...color,\n a: nextOpacity / 100,\n });\n const nextValue = rgbaToCss(nextColor);\n setDraft(rgbaToHex(nextColor).replace(/^#/, \"\"));\n onChange(nextValue);\n }}\n />\n </div>\n </div>\n\n <div className=\"mt-2.5 grid grid-cols-[4.5rem_1fr] items-center gap-1 border-b border-border/70 px-3 pb-3\">\n <span className=\"text-[11px] font-medium text-muted-foreground\">\n {hexLabel}\n </span>\n <input\n value={draft}\n spellCheck={false}\n onChange={(event) => setDraft(event.currentTarget.value)}\n onFocus={(event) => event.currentTarget.select()}\n onBlur={() => commitDraft()}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commitDraft();\n event.currentTarget.blur();\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n setDraft(colorHex.replace(/^#/, \"\"));\n event.currentTarget.blur();\n }\n }}\n className=\"h-6 min-w-0 rounded-md border border-input bg-background/70 px-2 text-right text-[11px] uppercase tabular-nums outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring\"\n />\n </div>\n {(allowTransparent || uniqueDocumentColors.length > 0) && (\n <div className=\"px-3 py-2.5\">\n <div className=\"mb-2 flex h-5 items-center justify-between text-[11px] text-muted-foreground\">\n <span>{documentColorsLabel}</span>\n </div>\n <div className=\"grid grid-cols-8 gap-1\">\n {allowTransparent && (\n <button\n type=\"button\"\n aria-label={transparentLabel}\n aria-pressed={value === \"transparent\"}\n className={cn(\n \"size-5 cursor-pointer rounded-sm border transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n value === \"transparent\" || color.a === 0\n ? \"border-primary ring-1 ring-primary\"\n : \"border-border/60\",\n )}\n style={swatchBackground(\"transparent\")}\n onClick={() => {\n setDraft(colorHex.replace(/^#/, \"\"));\n onChange(\"transparent\");\n }}\n />\n )}\n {uniqueDocumentColors.map((color) => (\n <button\n key={color}\n type=\"button\"\n title={color}\n aria-label={color}\n aria-pressed={colorHex === color}\n className={cn(\n \"size-5 cursor-pointer rounded-sm border transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n colorHex === color\n ? \"border-primary ring-1 ring-primary\"\n : \"border-border/60\",\n )}\n style={swatchBackground(color)}\n onClick={() => {\n setDraft(color);\n onChange(color);\n }}\n />\n ))}\n </div>\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction VisualSaturationBrightnessField({\n hsv,\n label,\n onChange,\n}: {\n hsv: HsvaColor;\n label: string;\n onChange: (value: HsvaColor) => void;\n}) {\n const fieldRef = useRef<HTMLDivElement>(null);\n const draggingRef = useRef(false);\n const hueColor = rgbaToCss(hsvToRgba({ h: hsv.h, s: 100, v: 100, a: 1 }));\n\n const updateFromPointer = (event: PointerEvent<HTMLDivElement>) => {\n const rect = fieldRef.current?.getBoundingClientRect();\n if (!rect) return;\n onChange({\n ...hsv,\n s: clamp(((event.clientX - rect.left) / rect.width) * 100, 0, 100),\n v: clamp(100 - ((event.clientY - rect.top) / rect.height) * 100, 0, 100),\n });\n };\n\n const stepWithKeyboard = (event: KeyboardEvent<HTMLDivElement>) => {\n const step = event.shiftKey ? 10 : 1;\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n onChange({ ...hsv, s: clamp(hsv.s + step, 0, 100) });\n }\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n onChange({ ...hsv, s: clamp(hsv.s - step, 0, 100) });\n }\n if (event.key === \"ArrowUp\") {\n event.preventDefault();\n onChange({ ...hsv, v: clamp(hsv.v + step, 0, 100) });\n }\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n onChange({ ...hsv, v: clamp(hsv.v - step, 0, 100) });\n }\n };\n\n return (\n <div\n ref={fieldRef}\n tabIndex={0}\n aria-label={label}\n onPointerDown={(event) => {\n draggingRef.current = true;\n event.currentTarget.setPointerCapture(event.pointerId);\n updateFromPointer(event);\n }}\n onPointerMove={(event) => {\n if (!draggingRef.current) return;\n updateFromPointer(event);\n }}\n onPointerUp={(event) => {\n draggingRef.current = false;\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }}\n onPointerCancel={() => {\n draggingRef.current = false;\n }}\n onKeyDown={stepWithKeyboard}\n className=\"relative h-40 w-full cursor-crosshair overflow-hidden rounded-t-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset active:cursor-grabbing\"\n style={{\n backgroundImage: `linear-gradient(to top, #000 0%, transparent 100%), linear-gradient(to right, #fff 0%, ${hueColor} 100%)`,\n }}\n >\n <span\n className=\"pointer-events-none absolute size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_hsl(var(--foreground)/0.6)]\"\n style={{\n left: `${hsv.s}%`,\n top: `${100 - hsv.v}%`,\n }}\n />\n </div>\n );\n}\n\nfunction VisualColorTrack({\n label,\n value,\n min,\n max,\n backgroundImage,\n backgroundSize,\n backgroundPosition,\n onChange,\n}: {\n label: string;\n value: number;\n min: number;\n max: number;\n backgroundImage: string;\n backgroundSize?: string;\n backgroundPosition?: string;\n onChange: (value: number) => void;\n}) {\n const trackRef = useRef<HTMLDivElement>(null);\n const draggingRef = useRef(false);\n const percent = ((value - min) / (max - min)) * 100;\n\n const updateFromPointer = (event: PointerEvent<HTMLDivElement>) => {\n const rect = trackRef.current?.getBoundingClientRect();\n if (!rect) return;\n const next = min + ((event.clientX - rect.left) / rect.width) * (max - min);\n onChange(clamp(next, min, max));\n };\n\n const stepWithKeyboard = (event: KeyboardEvent<HTMLDivElement>) => {\n const step = event.shiftKey ? 10 : 1;\n if (event.key === \"ArrowRight\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n onChange(clamp(value + step, min, max));\n }\n if (event.key === \"ArrowLeft\" || event.key === \"ArrowDown\") {\n event.preventDefault();\n onChange(clamp(value - step, min, max));\n }\n if (event.key === \"Home\") {\n event.preventDefault();\n onChange(min);\n }\n if (event.key === \"End\") {\n event.preventDefault();\n onChange(max);\n }\n };\n\n return (\n <div\n ref={trackRef}\n role=\"slider\"\n tabIndex={0}\n aria-label={label}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={Math.round(value)}\n onKeyDown={stepWithKeyboard}\n onPointerDown={(event) => {\n draggingRef.current = true;\n event.currentTarget.setPointerCapture(event.pointerId);\n updateFromPointer(event);\n }}\n onPointerMove={(event) => {\n if (!draggingRef.current) return;\n updateFromPointer(event);\n }}\n onPointerUp={(event) => {\n draggingRef.current = false;\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }}\n onPointerCancel={() => {\n draggingRef.current = false;\n }}\n className=\"relative h-3.5 cursor-pointer rounded-full border border-border/60 outline-none ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:cursor-grabbing\"\n style={{ backgroundImage, backgroundSize, backgroundPosition }}\n >\n <span\n className=\"pointer-events-none absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_hsl(var(--foreground)/0.6)]\"\n style={{ left: `${clamp(percent, 0, 100)}%` }}\n />\n </div>\n );\n}\n\nexport function VisualSegmentedControl({\n options,\n value,\n onChange,\n className,\n}: {\n options: VisualControlOption[];\n value: string;\n onChange: (value: string) => void;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n \"flex min-h-7 overflow-hidden rounded-md border border-border bg-background/60\",\n className,\n )}\n >\n {options.map((option) => (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => onChange(option.value)}\n className={cn(\n \"min-w-0 flex-1 cursor-pointer px-2 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground\",\n value === option.value && \"bg-accent text-foreground\",\n )}\n >\n <span className=\"truncate\">{option.label}</span>\n </button>\n ))}\n </div>\n );\n}\n\nexport function VisualToggleControl({\n checked,\n onChange,\n label,\n}: {\n checked: boolean;\n onChange: (checked: boolean) => void;\n label?: string;\n}) {\n return (\n <button\n type=\"button\"\n aria-pressed={checked}\n aria-label={label}\n onClick={() => onChange(!checked)}\n className={cn(\n \"relative h-5 w-9 cursor-pointer rounded-full border border-border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n checked ? \"bg-primary/35\" : \"bg-muted\",\n )}\n >\n <span\n className={cn(\n \"absolute top-1/2 size-3.5 -translate-y-1/2 rounded-full bg-foreground shadow transition-transform\",\n checked ? \"translate-x-[18px]\" : \"translate-x-[3px]\",\n )}\n />\n </button>\n );\n}\n\nexport function VisualSliderControl({\n value,\n onChange,\n min = 0,\n max = 100,\n step = 1,\n unit,\n}: {\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n unit?: string;\n}) {\n const safeValue = clampNumber(Number.isFinite(value) ? value : min, min, max);\n return (\n <div className=\"flex h-7 items-center gap-2\">\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={safeValue}\n onChange={(event) => onChange(Number(event.currentTarget.value))}\n className=\"min-w-0 flex-1 cursor-pointer accent-foreground\"\n />\n <span className=\"w-9 text-right text-[11px] tabular-nums text-muted-foreground\">\n {formatNumber(safeValue, unit)}\n </span>\n </div>\n );\n}\n\nexport function VisualScrubInput({\n label,\n value,\n onChange,\n min,\n max,\n step = 1,\n unit,\n disabled = false,\n}: {\n label: string;\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n unit?: string;\n disabled?: boolean;\n}) {\n const id = useId();\n const [draft, setDraft] = useState(() => formatNumber(value, unit));\n const [focused, setFocused] = useState(false);\n const dragRef = useRef<{\n pointerId: number;\n prevX: number;\n dragged: boolean;\n } | null>(null);\n\n useEffect(() => {\n if (!focused) setDraft(formatNumber(value, unit));\n }, [focused, unit, value]);\n\n const commit = (nextDraft = draft) => {\n const parsed = parseDraftNumber(nextDraft, value);\n const next = clampNumber(parsed, min, max);\n onChange(next);\n setDraft(formatNumber(next, unit));\n };\n\n const setNext = (next: number) => {\n const clamped = clampNumber(next, min, max);\n onChange(clamped);\n setDraft(formatNumber(clamped, unit));\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit();\n event.currentTarget.blur();\n return;\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n setDraft(formatNumber(value, unit));\n event.currentTarget.blur();\n return;\n }\n if (event.key === \"ArrowUp\" || event.key === \"ArrowDown\") {\n event.preventDefault();\n const mult =\n event.shiftKey || event.metaKey ? 10 : event.altKey ? 0.1 : 1;\n const direction = event.key === \"ArrowUp\" ? 1 : -1;\n const base = parseDraftNumber(draft, value);\n setNext(base + direction * step * mult);\n }\n };\n\n const onPointerDown = (event: PointerEvent<HTMLLabelElement>) => {\n if (disabled || event.button !== 0) return;\n event.preventDefault();\n dragRef.current = {\n pointerId: event.pointerId,\n prevX: event.clientX,\n dragged: false,\n };\n event.currentTarget.setPointerCapture(event.pointerId);\n };\n\n const onPointerMove = (event: PointerEvent<HTMLLabelElement>) => {\n const drag = dragRef.current;\n if (!drag || drag.pointerId !== event.pointerId) return;\n const delta = event.clientX - drag.prevX;\n if (delta === 0) return;\n drag.prevX = event.clientX;\n drag.dragged = true;\n const mult = event.shiftKey || event.metaKey ? 10 : event.altKey ? 0.1 : 1;\n setNext(value + delta * step * mult);\n };\n\n const onPointerUp = (event: PointerEvent<HTMLLabelElement>) => {\n const drag = dragRef.current;\n if (!drag || drag.pointerId !== event.pointerId) return;\n event.currentTarget.releasePointerCapture(event.pointerId);\n dragRef.current = null;\n if (!drag.dragged) {\n document.getElementById(id)?.focus();\n }\n };\n\n return (\n <div className=\"flex items-center gap-1.5\">\n <label\n htmlFor={id}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n className={cn(\n \"flex w-8 shrink-0 cursor-ew-resize select-none items-center justify-center rounded border border-transparent px-1 text-[10px] font-semibold text-muted-foreground hover:border-border hover:bg-accent/60\",\n disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {label}\n </label>\n <input\n id={id}\n value={draft}\n disabled={disabled}\n onFocus={() => setFocused(true)}\n onBlur={() => {\n setFocused(false);\n commit();\n }}\n onChange={(event) => setDraft(event.currentTarget.value)}\n onKeyDown={onKeyDown}\n className=\"h-7 min-w-0 flex-1 rounded-md border border-input bg-background/70 px-2 text-right text-[11px] tabular-nums text-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring disabled:opacity-50\"\n />\n </div>\n );\n}\n\nexport function VisualTweakControl({\n tweak,\n value,\n onChange,\n className,\n}: {\n tweak: VisualTweakDefinition;\n value: VisualControlValue;\n onChange: (value: VisualControlValue) => void;\n className?: string;\n}) {\n if (tweak.type === \"toggle\") {\n return (\n <div\n className={cn(\"flex h-7 items-center justify-between gap-2\", className)}\n >\n <span className=\"truncate text-[11px] text-muted-foreground\">\n {tweak.label}\n </span>\n <VisualToggleControl\n checked={Boolean(value)}\n onChange={onChange}\n label={tweak.label}\n />\n </div>\n );\n }\n\n const numericValue =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\"\n ? Number(value)\n : Number(tweak.defaultValue);\n\n return (\n <VisualControlRow label={tweak.label} className={className}>\n {((tweak.type as string) === \"color-swatch\" ||\n (tweak.type as string) === \"color-swatches\") && (\n <VisualColorPicker\n label={tweak.label}\n value={String(value)}\n documentColors={(tweak.options ?? []).map(\n (option) => option.color ?? option.value,\n )}\n onChange={onChange}\n />\n )}\n {tweak.type === \"segment\" && (\n <VisualSegmentedControl\n options={tweak.options ?? []}\n value={String(value)}\n onChange={onChange}\n />\n )}\n {tweak.type === \"slider\" && (\n <VisualSliderControl\n min={tweak.min ?? 0}\n max={tweak.max ?? 100}\n step={tweak.step ?? 1}\n unit={\n tweak.unit ??\n (tweak.cssVar?.toLowerCase().includes(\"radius\") ? \"px\" : undefined)\n }\n value={Number.isFinite(numericValue) ? numericValue : 0}\n onChange={onChange}\n />\n )}\n </VisualControlRow>\n );\n}\n"]}
@@ -41,9 +41,9 @@ export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import
41
41
  * Body: { text: string, fieldName?: string, requestSource?: string }
42
42
  */
43
43
  export declare const postCollabText: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
44
+ text?: undefined;
44
45
  ok?: undefined;
45
46
  error: string;
46
- text?: undefined;
47
47
  } | {
48
48
  error?: undefined;
49
49
  ok: boolean;
@@ -13,8 +13,8 @@
13
13
  * Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
14
14
  */
15
15
  export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
16
- error: string;
17
16
  ok?: undefined;
17
+ error: string;
18
18
  } | {
19
19
  error?: undefined;
20
20
  ok: boolean;
@@ -0,0 +1,3 @@
1
+ export { listTables, getTableSchema, getRows, applyMutations, runSql, DbAdminConfirmRequiredError, type DbAdminRuntime, } from "./operations.js";
2
+ export type { DbAdminColumn, DbAdminDialect, DbAdminFilter, DbAdminFilterOp, DbAdminForeignKey, DbAdminIndex, DbAdminMutation, DbAdminMutationResult, DbAdminQueryResult, DbAdminRowsRequest, DbAdminRowsResult, DbAdminSort, DbAdminTableSchema, DbAdminTableSummary, } from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db-admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,OAAO,EACP,cAAc,EACd,MAAM,EACN,2BAA2B,EAC3B,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { listTables, getTableSchema, getRows, applyMutations, runSql, DbAdminConfirmRequiredError, } from "./operations.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db-admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,OAAO,EACP,cAAc,EACd,MAAM,EACN,2BAA2B,GAE5B,MAAM,iBAAiB,CAAC","sourcesContent":["export {\n listTables,\n getTableSchema,\n getRows,\n applyMutations,\n runSql,\n DbAdminConfirmRequiredError,\n type DbAdminRuntime,\n} from \"./operations.js\";\n\nexport type {\n DbAdminColumn,\n DbAdminDialect,\n DbAdminFilter,\n DbAdminFilterOp,\n DbAdminForeignKey,\n DbAdminIndex,\n DbAdminMutation,\n DbAdminMutationResult,\n DbAdminQueryResult,\n DbAdminRowsRequest,\n DbAdminRowsResult,\n DbAdminSort,\n DbAdminTableSchema,\n DbAdminTableSummary,\n} from \"./types.js\";\n"]}