@elytracms/studio 0.0.1

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 (558) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/convex/assets.ts +107 -0
  4. package/convex/auth.config.ts +15 -0
  5. package/convex/auth.ts +50 -0
  6. package/convex/cliTokens.ts +63 -0
  7. package/convex/cms.ts +174 -0
  8. package/convex/content.ts +316 -0
  9. package/convex/delivery.ts +266 -0
  10. package/convex/functions.ts +35 -0
  11. package/convex/graphs.ts +51 -0
  12. package/convex/guard.ts +67 -0
  13. package/convex/http.ts +30 -0
  14. package/convex/members.ts +83 -0
  15. package/convex/publishing.ts +102 -0
  16. package/convex/references.ts +168 -0
  17. package/convex/schema.ts +173 -0
  18. package/convex/sync.ts +322 -0
  19. package/convex/tsconfig.json +12 -0
  20. package/convex/users.ts +23 -0
  21. package/convex/webhooks.ts +85 -0
  22. package/dist/components/assets/asset-library.d.ts +14 -0
  23. package/dist/components/assets/asset-library.js +191 -0
  24. package/dist/components/assets/asset-library.js.map +1 -0
  25. package/dist/components/assets/asset-metadata.d.ts +34 -0
  26. package/dist/components/assets/asset-metadata.js +40 -0
  27. package/dist/components/assets/asset-metadata.js.map +1 -0
  28. package/dist/components/assets/asset-search.d.ts +7 -0
  29. package/dist/components/assets/asset-search.js +12 -0
  30. package/dist/components/assets/asset-search.js.map +1 -0
  31. package/dist/components/assets/asset-selection.d.ts +17 -0
  32. package/dist/components/assets/asset-selection.js +33 -0
  33. package/dist/components/assets/asset-selection.js.map +1 -0
  34. package/dist/components/assets/assets-store.d.ts +51 -0
  35. package/dist/components/assets/assets-store.js +153 -0
  36. package/dist/components/assets/assets-store.js.map +1 -0
  37. package/dist/components/auth-context.d.ts +38 -0
  38. package/dist/components/auth-context.js +88 -0
  39. package/dist/components/auth-context.js.map +1 -0
  40. package/dist/components/backend-gate.d.ts +19 -0
  41. package/dist/components/backend-gate.js +63 -0
  42. package/dist/components/backend-gate.js.map +1 -0
  43. package/dist/components/breadcrumb-context.d.ts +39 -0
  44. package/dist/components/breadcrumb-context.js +38 -0
  45. package/dist/components/breadcrumb-context.js.map +1 -0
  46. package/dist/components/builder/blocks-model.d.ts +80 -0
  47. package/dist/components/builder/blocks-model.js +181 -0
  48. package/dist/components/builder/blocks-model.js.map +1 -0
  49. package/dist/components/builder/blocks-panel.d.ts +44 -0
  50. package/dist/components/builder/blocks-panel.js +147 -0
  51. package/dist/components/builder/blocks-panel.js.map +1 -0
  52. package/dist/components/builder/builder-store.d.ts +69 -0
  53. package/dist/components/builder/builder-store.js +294 -0
  54. package/dist/components/builder/builder-store.js.map +1 -0
  55. package/dist/components/builder/canvas-stylesheet.d.ts +4 -0
  56. package/dist/components/builder/canvas-stylesheet.js +24 -0
  57. package/dist/components/builder/canvas-stylesheet.js.map +1 -0
  58. package/dist/components/builder/canvas.d.ts +8 -0
  59. package/dist/components/builder/canvas.js +723 -0
  60. package/dist/components/builder/canvas.js.map +1 -0
  61. package/dist/components/builder/clipboard-actions.d.ts +93 -0
  62. package/dist/components/builder/clipboard-actions.js +246 -0
  63. package/dist/components/builder/clipboard-actions.js.map +1 -0
  64. package/dist/components/builder/composition-field-editor.d.ts +11 -0
  65. package/dist/components/builder/composition-field-editor.js +150 -0
  66. package/dist/components/builder/composition-field-editor.js.map +1 -0
  67. package/dist/components/builder/composition-scope.d.ts +16 -0
  68. package/dist/components/builder/composition-scope.js +7 -0
  69. package/dist/components/builder/composition-scope.js.map +1 -0
  70. package/dist/components/builder/drag-session.d.ts +41 -0
  71. package/dist/components/builder/drag-session.js +51 -0
  72. package/dist/components/builder/drag-session.js.map +1 -0
  73. package/dist/components/builder/fixture-thumbnail.d.ts +18 -0
  74. package/dist/components/builder/fixture-thumbnail.js +97 -0
  75. package/dist/components/builder/fixture-thumbnail.js.map +1 -0
  76. package/dist/components/builder/inline-edit.d.ts +142 -0
  77. package/dist/components/builder/inline-edit.js +136 -0
  78. package/dist/components/builder/inline-edit.js.map +1 -0
  79. package/dist/components/builder/insert-context.d.ts +14 -0
  80. package/dist/components/builder/insert-context.js +65 -0
  81. package/dist/components/builder/insert-context.js.map +1 -0
  82. package/dist/components/builder/insert-menu.d.ts +9 -0
  83. package/dist/components/builder/insert-menu.js +9 -0
  84. package/dist/components/builder/insert-menu.js.map +1 -0
  85. package/dist/components/builder/layout-inspector.d.ts +14 -0
  86. package/dist/components/builder/layout-inspector.js +84 -0
  87. package/dist/components/builder/layout-inspector.js.map +1 -0
  88. package/dist/components/builder/node-factory.d.ts +17 -0
  89. package/dist/components/builder/node-factory.js +90 -0
  90. package/dist/components/builder/node-factory.js.map +1 -0
  91. package/dist/components/builder/page-tree.d.ts +3 -0
  92. package/dist/components/builder/page-tree.js +207 -0
  93. package/dist/components/builder/page-tree.js.map +1 -0
  94. package/dist/components/builder/property-inspector.d.ts +1 -0
  95. package/dist/components/builder/property-inspector.js +233 -0
  96. package/dist/components/builder/property-inspector.js.map +1 -0
  97. package/dist/components/builder/rich-text-toolbar.d.ts +4 -0
  98. package/dist/components/builder/rich-text-toolbar.js +104 -0
  99. package/dist/components/builder/rich-text-toolbar.js.map +1 -0
  100. package/dist/components/builder/spacing-handles.d.ts +22 -0
  101. package/dist/components/builder/spacing-handles.js +213 -0
  102. package/dist/components/builder/spacing-handles.js.map +1 -0
  103. package/dist/components/cms/asset-picker.d.ts +12 -0
  104. package/dist/components/cms/asset-picker.js +60 -0
  105. package/dist/components/cms/asset-picker.js.map +1 -0
  106. package/dist/components/cms/bulk-actions.d.ts +60 -0
  107. package/dist/components/cms/bulk-actions.js +95 -0
  108. package/dist/components/cms/bulk-actions.js.map +1 -0
  109. package/dist/components/cms/bulk-bar.d.ts +23 -0
  110. package/dist/components/cms/bulk-bar.js +26 -0
  111. package/dist/components/cms/bulk-bar.js.map +1 -0
  112. package/dist/components/cms/cell-edit.d.ts +91 -0
  113. package/dist/components/cms/cell-edit.js +144 -0
  114. package/dist/components/cms/cell-edit.js.map +1 -0
  115. package/dist/components/cms/cell.d.ts +29 -0
  116. package/dist/components/cms/cell.js +127 -0
  117. package/dist/components/cms/cell.js.map +1 -0
  118. package/dist/components/cms/cms-index.d.ts +8 -0
  119. package/dist/components/cms/cms-index.js +23 -0
  120. package/dist/components/cms/cms-index.js.map +1 -0
  121. package/dist/components/cms/cms-store.d.ts +188 -0
  122. package/dist/components/cms/cms-store.js +702 -0
  123. package/dist/components/cms/cms-store.js.map +1 -0
  124. package/dist/components/cms/collection-table.d.ts +6 -0
  125. package/dist/components/cms/collection-table.js +250 -0
  126. package/dist/components/cms/collection-table.js.map +1 -0
  127. package/dist/components/cms/collections-sidebar.d.ts +9 -0
  128. package/dist/components/cms/collections-sidebar.js +25 -0
  129. package/dist/components/cms/collections-sidebar.js.map +1 -0
  130. package/dist/components/cms/detail-editor.d.ts +7 -0
  131. package/dist/components/cms/detail-editor.js +386 -0
  132. package/dist/components/cms/detail-editor.js.map +1 -0
  133. package/dist/components/cms/doc-state.d.ts +13 -0
  134. package/dist/components/cms/doc-state.js +18 -0
  135. package/dist/components/cms/doc-state.js.map +1 -0
  136. package/dist/components/cms/document-editor-context.d.ts +48 -0
  137. package/dist/components/cms/document-editor-context.js +23 -0
  138. package/dist/components/cms/document-editor-context.js.map +1 -0
  139. package/dist/components/cms/editable-cell.d.ts +22 -0
  140. package/dist/components/cms/editable-cell.js +176 -0
  141. package/dist/components/cms/editable-cell.js.map +1 -0
  142. package/dist/components/cms/field-control.d.ts +8 -0
  143. package/dist/components/cms/field-control.js +149 -0
  144. package/dist/components/cms/field-control.js.map +1 -0
  145. package/dist/components/cms/filter-builder.d.ts +12 -0
  146. package/dist/components/cms/filter-builder.js +84 -0
  147. package/dist/components/cms/filter-builder.js.map +1 -0
  148. package/dist/components/cms/import-export.d.ts +6 -0
  149. package/dist/components/cms/import-export.js +33 -0
  150. package/dist/components/cms/import-export.js.map +1 -0
  151. package/dist/components/cms/new-page-dialog.d.ts +22 -0
  152. package/dist/components/cms/new-page-dialog.js +42 -0
  153. package/dist/components/cms/new-page-dialog.js.map +1 -0
  154. package/dist/components/cms/reference-confirm.d.ts +25 -0
  155. package/dist/components/cms/reference-confirm.js +124 -0
  156. package/dist/components/cms/reference-confirm.js.map +1 -0
  157. package/dist/components/cms/relation-picker.d.ts +16 -0
  158. package/dist/components/cms/relation-picker.js +47 -0
  159. package/dist/components/cms/relation-picker.js.map +1 -0
  160. package/dist/components/cms/use-cell-edit.d.ts +33 -0
  161. package/dist/components/cms/use-cell-edit.js +125 -0
  162. package/dist/components/cms/use-cell-edit.js.map +1 -0
  163. package/dist/components/cms/versions-model.d.ts +15 -0
  164. package/dist/components/cms/versions-model.js +23 -0
  165. package/dist/components/cms/versions-model.js.map +1 -0
  166. package/dist/components/cms/versions-pane.d.ts +14 -0
  167. package/dist/components/cms/versions-pane.js +86 -0
  168. package/dist/components/cms/versions-pane.js.map +1 -0
  169. package/dist/components/cms/view-bar.d.ts +11 -0
  170. package/dist/components/cms/view-bar.js +80 -0
  171. package/dist/components/cms/view-bar.js.map +1 -0
  172. package/dist/components/collab/collab-context.d.ts +34 -0
  173. package/dist/components/collab/collab-context.js +52 -0
  174. package/dist/components/collab/collab-context.js.map +1 -0
  175. package/dist/components/collab/collab-seed.d.ts +27 -0
  176. package/dist/components/collab/collab-seed.js +42 -0
  177. package/dist/components/collab/collab-seed.js.map +1 -0
  178. package/dist/components/components/component-detail.d.ts +9 -0
  179. package/dist/components/components/component-detail.js +30 -0
  180. package/dist/components/components/component-detail.js.map +1 -0
  181. package/dist/components/components/component-status.d.ts +10 -0
  182. package/dist/components/components/component-status.js +30 -0
  183. package/dist/components/components/component-status.js.map +1 -0
  184. package/dist/components/components/components-index.d.ts +8 -0
  185. package/dist/components/components/components-index.js +42 -0
  186. package/dist/components/components/components-index.js.map +1 -0
  187. package/dist/components/components/field-inspector.d.ts +9 -0
  188. package/dist/components/components/field-inspector.js +38 -0
  189. package/dist/components/components/field-inspector.js.map +1 -0
  190. package/dist/components/components/fixture-runner.d.ts +10 -0
  191. package/dist/components/components/fixture-runner.js +24 -0
  192. package/dist/components/components/fixture-runner.js.map +1 -0
  193. package/dist/components/components/registry-browser.d.ts +4 -0
  194. package/dist/components/components/registry-browser.js +64 -0
  195. package/dist/components/components/registry-browser.js.map +1 -0
  196. package/dist/components/current-user-menu.d.ts +13 -0
  197. package/dist/components/current-user-menu.js +31 -0
  198. package/dist/components/current-user-menu.js.map +1 -0
  199. package/dist/components/dev-login-badge.d.ts +9 -0
  200. package/dist/components/dev-login-badge.js +18 -0
  201. package/dist/components/dev-login-badge.js.map +1 -0
  202. package/dist/components/extensions/extensions-view.d.ts +7 -0
  203. package/dist/components/extensions/extensions-view.js +126 -0
  204. package/dist/components/extensions/extensions-view.js.map +1 -0
  205. package/dist/components/guards.d.ts +27 -0
  206. package/dist/components/guards.js +46 -0
  207. package/dist/components/guards.js.map +1 -0
  208. package/dist/components/inspector/inspector-sidebar.d.ts +26 -0
  209. package/dist/components/inspector/inspector-sidebar.js +17 -0
  210. package/dist/components/inspector/inspector-sidebar.js.map +1 -0
  211. package/dist/components/operation-error.d.ts +17 -0
  212. package/dist/components/operation-error.js +54 -0
  213. package/dist/components/operation-error.js.map +1 -0
  214. package/dist/components/playground-badge.d.ts +10 -0
  215. package/dist/components/playground-badge.js +19 -0
  216. package/dist/components/playground-badge.js.map +1 -0
  217. package/dist/components/project-list.d.ts +15 -0
  218. package/dist/components/project-list.js +52 -0
  219. package/dist/components/project-list.js.map +1 -0
  220. package/dist/components/project-session.d.ts +46 -0
  221. package/dist/components/project-session.js +107 -0
  222. package/dist/components/project-session.js.map +1 -0
  223. package/dist/components/project-switcher.d.ts +11 -0
  224. package/dist/components/project-switcher.js +44 -0
  225. package/dist/components/project-switcher.js.map +1 -0
  226. package/dist/components/references/builder-deep-link.d.ts +12 -0
  227. package/dist/components/references/builder-deep-link.js +53 -0
  228. package/dist/components/references/builder-deep-link.js.map +1 -0
  229. package/dist/components/references/references-panel.d.ts +17 -0
  230. package/dist/components/references/references-panel.js +66 -0
  231. package/dist/components/references/references-panel.js.map +1 -0
  232. package/dist/components/routes/redirect-chain.d.ts +9 -0
  233. package/dist/components/routes/redirect-chain.js +16 -0
  234. package/dist/components/routes/redirect-chain.js.map +1 -0
  235. package/dist/components/routes/redirect-manager.d.ts +13 -0
  236. package/dist/components/routes/redirect-manager.js +24 -0
  237. package/dist/components/routes/redirect-manager.js.map +1 -0
  238. package/dist/components/routes/route-list.d.ts +35 -0
  239. package/dist/components/routes/route-list.js +69 -0
  240. package/dist/components/routes/route-list.js.map +1 -0
  241. package/dist/components/routes/routes-shell.d.ts +14 -0
  242. package/dist/components/routes/routes-shell.js +68 -0
  243. package/dist/components/routes/routes-shell.js.map +1 -0
  244. package/dist/components/section-nav.d.ts +17 -0
  245. package/dist/components/section-nav.js +33 -0
  246. package/dist/components/section-nav.js.map +1 -0
  247. package/dist/components/section-state.d.ts +24 -0
  248. package/dist/components/section-state.js +78 -0
  249. package/dist/components/section-state.js.map +1 -0
  250. package/dist/components/section-surface.d.ts +31 -0
  251. package/dist/components/section-surface.js +46 -0
  252. package/dist/components/section-surface.js.map +1 -0
  253. package/dist/components/sections.d.ts +38 -0
  254. package/dist/components/sections.js +72 -0
  255. package/dist/components/sections.js.map +1 -0
  256. package/dist/components/settings-form.d.ts +10 -0
  257. package/dist/components/settings-form.js +17 -0
  258. package/dist/components/settings-form.js.map +1 -0
  259. package/dist/components/studio-context.d.ts +22 -0
  260. package/dist/components/studio-context.js +48 -0
  261. package/dist/components/studio-context.js.map +1 -0
  262. package/dist/components/studio-project-screen.d.ts +19 -0
  263. package/dist/components/studio-project-screen.js +195 -0
  264. package/dist/components/studio-project-screen.js.map +1 -0
  265. package/dist/components/studio-shell.d.ts +18 -0
  266. package/dist/components/studio-shell.js +64 -0
  267. package/dist/components/studio-shell.js.map +1 -0
  268. package/dist/components/theme-context.d.ts +17 -0
  269. package/dist/components/theme-context.js +26 -0
  270. package/dist/components/theme-context.js.map +1 -0
  271. package/dist/components/workspace-gate.d.ts +12 -0
  272. package/dist/components/workspace-gate.js +27 -0
  273. package/dist/components/workspace-gate.js.map +1 -0
  274. package/dist/components/workspace-projects.d.ts +13 -0
  275. package/dist/components/workspace-projects.js +18 -0
  276. package/dist/components/workspace-projects.js.map +1 -0
  277. package/dist/lib/assets/delete-asset.d.ts +34 -0
  278. package/dist/lib/assets/delete-asset.js +34 -0
  279. package/dist/lib/assets/delete-asset.js.map +1 -0
  280. package/dist/lib/assets/image-dimensions.d.ts +18 -0
  281. package/dist/lib/assets/image-dimensions.js +26 -0
  282. package/dist/lib/assets/image-dimensions.js.map +1 -0
  283. package/dist/lib/assets/index.d.ts +9 -0
  284. package/dist/lib/assets/index.js +10 -0
  285. package/dist/lib/assets/index.js.map +1 -0
  286. package/dist/lib/assets/upload-state.d.ts +53 -0
  287. package/dist/lib/assets/upload-state.js +59 -0
  288. package/dist/lib/assets/upload-state.js.map +1 -0
  289. package/dist/lib/assets/upload.d.ts +56 -0
  290. package/dist/lib/assets/upload.js +125 -0
  291. package/dist/lib/assets/upload.js.map +1 -0
  292. package/dist/lib/auth/auth-adapter.d.ts +57 -0
  293. package/dist/lib/auth/auth-adapter.js +13 -0
  294. package/dist/lib/auth/auth-adapter.js.map +1 -0
  295. package/dist/lib/auth/convex-auth-adapter.d.ts +39 -0
  296. package/dist/lib/auth/convex-auth-adapter.js +171 -0
  297. package/dist/lib/auth/convex-auth-adapter.js.map +1 -0
  298. package/dist/lib/auth/dev-auto-login-adapter.d.ts +25 -0
  299. package/dist/lib/auth/dev-auto-login-adapter.js +40 -0
  300. package/dist/lib/auth/dev-auto-login-adapter.js.map +1 -0
  301. package/dist/lib/auth/index.d.ts +28 -0
  302. package/dist/lib/auth/index.js +61 -0
  303. package/dist/lib/auth/index.js.map +1 -0
  304. package/dist/lib/auth/local-auth-adapter.d.ts +57 -0
  305. package/dist/lib/auth/local-auth-adapter.js +78 -0
  306. package/dist/lib/auth/local-auth-adapter.js.map +1 -0
  307. package/dist/lib/auth/route-guard.d.ts +33 -0
  308. package/dist/lib/auth/route-guard.js +51 -0
  309. package/dist/lib/auth/route-guard.js.map +1 -0
  310. package/dist/lib/auth-errors.d.ts +42 -0
  311. package/dist/lib/auth-errors.js +74 -0
  312. package/dist/lib/auth-errors.js.map +1 -0
  313. package/dist/lib/bindings/section-bindings.d.ts +24 -0
  314. package/dist/lib/bindings/section-bindings.js +9 -0
  315. package/dist/lib/bindings/section-bindings.js.map +1 -0
  316. package/dist/lib/clipboard/index.d.ts +7 -0
  317. package/dist/lib/clipboard/index.js +8 -0
  318. package/dist/lib/clipboard/index.js.map +1 -0
  319. package/dist/lib/clipboard/os-clipboard.d.ts +46 -0
  320. package/dist/lib/clipboard/os-clipboard.js +105 -0
  321. package/dist/lib/clipboard/os-clipboard.js.map +1 -0
  322. package/dist/lib/clipboard/paste-issues.d.ts +34 -0
  323. package/dist/lib/clipboard/paste-issues.js +67 -0
  324. package/dist/lib/clipboard/paste-issues.js.map +1 -0
  325. package/dist/lib/clipboard/paste-target.d.ts +20 -0
  326. package/dist/lib/clipboard/paste-target.js +28 -0
  327. package/dist/lib/clipboard/paste-target.js.map +1 -0
  328. package/dist/lib/cms/published-documents.d.ts +30 -0
  329. package/dist/lib/cms/published-documents.js +75 -0
  330. package/dist/lib/cms/published-documents.js.map +1 -0
  331. package/dist/lib/cms-views/index.d.ts +9 -0
  332. package/dist/lib/cms-views/index.js +10 -0
  333. package/dist/lib/cms-views/index.js.map +1 -0
  334. package/dist/lib/cms-views/selection.d.ts +29 -0
  335. package/dist/lib/cms-views/selection.js +46 -0
  336. package/dist/lib/cms-views/selection.js.map +1 -0
  337. package/dist/lib/cms-views/view-model.d.ts +192 -0
  338. package/dist/lib/cms-views/view-model.js +353 -0
  339. package/dist/lib/cms-views/view-model.js.map +1 -0
  340. package/dist/lib/cms-views/views-store.d.ts +70 -0
  341. package/dist/lib/cms-views/views-store.js +129 -0
  342. package/dist/lib/cms-views/views-store.js.map +1 -0
  343. package/dist/lib/data/collection-content.d.ts +105 -0
  344. package/dist/lib/data/collection-content.js +196 -0
  345. package/dist/lib/data/collection-content.js.map +1 -0
  346. package/dist/lib/data/data-store.d.ts +97 -0
  347. package/dist/lib/data/data-store.js +205 -0
  348. package/dist/lib/data/data-store.js.map +1 -0
  349. package/dist/lib/data/index.d.ts +4 -0
  350. package/dist/lib/data/index.js +8 -0
  351. package/dist/lib/data/index.js.map +1 -0
  352. package/dist/lib/data/providers.d.ts +143 -0
  353. package/dist/lib/data/providers.js +255 -0
  354. package/dist/lib/data/providers.js.map +1 -0
  355. package/dist/lib/data/sample-capture.d.ts +30 -0
  356. package/dist/lib/data/sample-capture.js +70 -0
  357. package/dist/lib/data/sample-capture.js.map +1 -0
  358. package/dist/lib/data/sources-store.d.ts +42 -0
  359. package/dist/lib/data/sources-store.js +120 -0
  360. package/dist/lib/data/sources-store.js.map +1 -0
  361. package/dist/lib/dnd/drop-rules.d.ts +219 -0
  362. package/dist/lib/dnd/drop-rules.js +257 -0
  363. package/dist/lib/dnd/drop-rules.js.map +1 -0
  364. package/dist/lib/dnd/gap-drag.d.ts +66 -0
  365. package/dist/lib/dnd/gap-drag.js +95 -0
  366. package/dist/lib/dnd/gap-drag.js.map +1 -0
  367. package/dist/lib/locale/binding-fallback.d.ts +28 -0
  368. package/dist/lib/locale/binding-fallback.js +66 -0
  369. package/dist/lib/locale/binding-fallback.js.map +1 -0
  370. package/dist/lib/locale/fallback.d.ts +43 -0
  371. package/dist/lib/locale/fallback.js +52 -0
  372. package/dist/lib/locale/fallback.js.map +1 -0
  373. package/dist/lib/locale/index.d.ts +6 -0
  374. package/dist/lib/locale/index.js +7 -0
  375. package/dist/lib/locale/index.js.map +1 -0
  376. package/dist/lib/locale/locale-store.d.ts +40 -0
  377. package/dist/lib/locale/locale-store.js +61 -0
  378. package/dist/lib/locale/locale-store.js.map +1 -0
  379. package/dist/lib/locale/locale-switcher.d.ts +10 -0
  380. package/dist/lib/locale/locale-switcher.js +24 -0
  381. package/dist/lib/locale/locale-switcher.js.map +1 -0
  382. package/dist/lib/locale/route-variant.d.ts +14 -0
  383. package/dist/lib/locale/route-variant.js +11 -0
  384. package/dist/lib/locale/route-variant.js.map +1 -0
  385. package/dist/lib/locale/use-studio-locale.d.ts +10 -0
  386. package/dist/lib/locale/use-studio-locale.js +8 -0
  387. package/dist/lib/locale/use-studio-locale.js.map +1 -0
  388. package/dist/lib/operations/asset-repository.d.ts +15 -0
  389. package/dist/lib/operations/asset-repository.js +56 -0
  390. package/dist/lib/operations/asset-repository.js.map +1 -0
  391. package/dist/lib/operations/cms-persistence.d.ts +35 -0
  392. package/dist/lib/operations/cms-persistence.js +75 -0
  393. package/dist/lib/operations/cms-persistence.js.map +1 -0
  394. package/dist/lib/operations/graph-commands.d.ts +140 -0
  395. package/dist/lib/operations/graph-commands.js +86 -0
  396. package/dist/lib/operations/graph-commands.js.map +1 -0
  397. package/dist/lib/operations/graph-persistence.d.ts +27 -0
  398. package/dist/lib/operations/graph-persistence.js +35 -0
  399. package/dist/lib/operations/graph-persistence.js.map +1 -0
  400. package/dist/lib/operations/index.d.ts +13 -0
  401. package/dist/lib/operations/index.js +14 -0
  402. package/dist/lib/operations/index.js.map +1 -0
  403. package/dist/lib/operations/operations-package.d.ts +6 -0
  404. package/dist/lib/operations/operations-package.js +7 -0
  405. package/dist/lib/operations/operations-package.js.map +1 -0
  406. package/dist/lib/operations/persist-queue.d.ts +16 -0
  407. package/dist/lib/operations/persist-queue.js +18 -0
  408. package/dist/lib/operations/persist-queue.js.map +1 -0
  409. package/dist/lib/operations/session-hydration.d.ts +84 -0
  410. package/dist/lib/operations/session-hydration.js +112 -0
  411. package/dist/lib/operations/session-hydration.js.map +1 -0
  412. package/dist/lib/operations/studio-operations.d.ts +59 -0
  413. package/dist/lib/operations/studio-operations.js +92 -0
  414. package/dist/lib/operations/studio-operations.js.map +1 -0
  415. package/dist/lib/persistence/backend-mode.d.ts +69 -0
  416. package/dist/lib/persistence/backend-mode.js +120 -0
  417. package/dist/lib/persistence/backend-mode.js.map +1 -0
  418. package/dist/lib/persistence/convex-adapter.d.ts +34 -0
  419. package/dist/lib/persistence/convex-adapter.js +681 -0
  420. package/dist/lib/persistence/convex-adapter.js.map +1 -0
  421. package/dist/lib/persistence/convex-blob-storage.d.ts +57 -0
  422. package/dist/lib/persistence/convex-blob-storage.js +97 -0
  423. package/dist/lib/persistence/convex-blob-storage.js.map +1 -0
  424. package/dist/lib/persistence/convex-client.d.ts +19 -0
  425. package/dist/lib/persistence/convex-client.js +40 -0
  426. package/dist/lib/persistence/convex-client.js.map +1 -0
  427. package/dist/lib/persistence/index.d.ts +30 -0
  428. package/dist/lib/persistence/index.js +60 -0
  429. package/dist/lib/persistence/index.js.map +1 -0
  430. package/dist/lib/persona/labels.d.ts +23 -0
  431. package/dist/lib/persona/labels.js +122 -0
  432. package/dist/lib/persona/labels.js.map +1 -0
  433. package/dist/lib/rail.d.ts +11 -0
  434. package/dist/lib/rail.js +26 -0
  435. package/dist/lib/rail.js.map +1 -0
  436. package/dist/lib/references/impact.d.ts +64 -0
  437. package/dist/lib/references/impact.js +62 -0
  438. package/dist/lib/references/impact.js.map +1 -0
  439. package/dist/lib/references/index.d.ts +7 -0
  440. package/dist/lib/references/index.js +8 -0
  441. package/dist/lib/references/index.js.map +1 -0
  442. package/dist/lib/references/reference-model.d.ts +125 -0
  443. package/dist/lib/references/reference-model.js +242 -0
  444. package/dist/lib/references/reference-model.js.map +1 -0
  445. package/dist/lib/references/references-store.d.ts +65 -0
  446. package/dist/lib/references/references-store.js +221 -0
  447. package/dist/lib/references/references-store.js.map +1 -0
  448. package/dist/lib/registry/index.d.ts +65 -0
  449. package/dist/lib/registry/index.js +114 -0
  450. package/dist/lib/registry/index.js.map +1 -0
  451. package/dist/lib/registry/preview.d.ts +15 -0
  452. package/dist/lib/registry/preview.js +110 -0
  453. package/dist/lib/registry/preview.js.map +1 -0
  454. package/dist/lib/registry/project-components.d.ts +16 -0
  455. package/dist/lib/registry/project-components.js +152 -0
  456. package/dist/lib/registry/project-components.js.map +1 -0
  457. package/dist/lib/routing/index.d.ts +10 -0
  458. package/dist/lib/routing/index.js +11 -0
  459. package/dist/lib/routing/index.js.map +1 -0
  460. package/dist/lib/routing/routing-analysis.d.ts +26 -0
  461. package/dist/lib/routing/routing-analysis.js +37 -0
  462. package/dist/lib/routing/routing-analysis.js.map +1 -0
  463. package/dist/lib/routing/routing-store.d.ts +50 -0
  464. package/dist/lib/routing/routing-store.js +72 -0
  465. package/dist/lib/routing/routing-store.js.map +1 -0
  466. package/dist/lib/starters/kit-session.d.ts +5 -0
  467. package/dist/lib/starters/kit-session.js +17 -0
  468. package/dist/lib/starters/kit-session.js.map +1 -0
  469. package/dist/lib/theme.d.ts +21 -0
  470. package/dist/lib/theme.js +32 -0
  471. package/dist/lib/theme.js.map +1 -0
  472. package/dist/lib/utils.d.ts +11 -0
  473. package/dist/lib/utils.js +28 -0
  474. package/dist/lib/utils.js.map +1 -0
  475. package/dist/lib/webhooks/config.d.ts +15 -0
  476. package/dist/lib/webhooks/config.js +64 -0
  477. package/dist/lib/webhooks/config.js.map +1 -0
  478. package/dist/lib/webhooks/dispatcher.d.ts +67 -0
  479. package/dist/lib/webhooks/dispatcher.js +61 -0
  480. package/dist/lib/webhooks/dispatcher.js.map +1 -0
  481. package/dist/lib/webhooks/index.d.ts +11 -0
  482. package/dist/lib/webhooks/index.js +10 -0
  483. package/dist/lib/webhooks/index.js.map +1 -0
  484. package/dist/lib/webhooks/signing.d.ts +15 -0
  485. package/dist/lib/webhooks/signing.js +24 -0
  486. package/dist/lib/webhooks/signing.js.map +1 -0
  487. package/dist/lib/webhooks/tags.d.ts +25 -0
  488. package/dist/lib/webhooks/tags.js +173 -0
  489. package/dist/lib/webhooks/tags.js.map +1 -0
  490. package/dist/lib/working-graph.d.ts +82 -0
  491. package/dist/lib/working-graph.js +113 -0
  492. package/dist/lib/working-graph.js.map +1 -0
  493. package/dist/lib/workspace/index.d.ts +109 -0
  494. package/dist/lib/workspace/index.js +206 -0
  495. package/dist/lib/workspace/index.js.map +1 -0
  496. package/dist/lib/workspace/switcher-source.d.ts +39 -0
  497. package/dist/lib/workspace/switcher-source.js +23 -0
  498. package/dist/lib/workspace/switcher-source.js.map +1 -0
  499. package/dist/lib/workspace/workspace-source.d.ts +47 -0
  500. package/dist/lib/workspace/workspace-source.js +67 -0
  501. package/dist/lib/workspace/workspace-source.js.map +1 -0
  502. package/dist/router/index.d.ts +32 -0
  503. package/dist/router/index.js +32 -0
  504. package/dist/router/index.js.map +1 -0
  505. package/dist/router/match.d.ts +75 -0
  506. package/dist/router/match.js +87 -0
  507. package/dist/router/match.js.map +1 -0
  508. package/dist/router/search.d.ts +22 -0
  509. package/dist/router/search.js +16 -0
  510. package/dist/router/search.js.map +1 -0
  511. package/dist/ui/avatar.d.ts +17 -0
  512. package/dist/ui/avatar.js +38 -0
  513. package/dist/ui/avatar.js.map +1 -0
  514. package/dist/ui/badge.d.ts +9 -0
  515. package/dist/ui/badge.js +23 -0
  516. package/dist/ui/badge.js.map +1 -0
  517. package/dist/ui/button.d.ts +11 -0
  518. package/dist/ui/button.js +30 -0
  519. package/dist/ui/button.js.map +1 -0
  520. package/dist/ui/card.d.ts +11 -0
  521. package/dist/ui/card.js +23 -0
  522. package/dist/ui/card.js.map +1 -0
  523. package/dist/ui/dialog.d.ts +12 -0
  524. package/dist/ui/dialog.js +27 -0
  525. package/dist/ui/dialog.js.map +1 -0
  526. package/dist/ui/dropdown-menu.d.ts +15 -0
  527. package/dist/ui/dropdown-menu.js +24 -0
  528. package/dist/ui/dropdown-menu.js.map +1 -0
  529. package/dist/ui/field.d.ts +15 -0
  530. package/dist/ui/field.js +14 -0
  531. package/dist/ui/field.js.map +1 -0
  532. package/dist/ui/index.d.ts +14 -0
  533. package/dist/ui/index.js +15 -0
  534. package/dist/ui/index.js.map +1 -0
  535. package/dist/ui/input.d.ts +3 -0
  536. package/dist/ui/input.js +7 -0
  537. package/dist/ui/input.js.map +1 -0
  538. package/dist/ui/inspector.d.ts +18 -0
  539. package/dist/ui/inspector.js +14 -0
  540. package/dist/ui/inspector.js.map +1 -0
  541. package/dist/ui/layout.d.ts +45 -0
  542. package/dist/ui/layout.js +48 -0
  543. package/dist/ui/layout.js.map +1 -0
  544. package/dist/ui/panel.d.ts +12 -0
  545. package/dist/ui/panel.js +20 -0
  546. package/dist/ui/panel.js.map +1 -0
  547. package/dist/ui/separator.d.ts +6 -0
  548. package/dist/ui/separator.js +7 -0
  549. package/dist/ui/separator.js.map +1 -0
  550. package/dist/ui/toolbar.d.ts +9 -0
  551. package/dist/ui/toolbar.js +16 -0
  552. package/dist/ui/toolbar.js.map +1 -0
  553. package/dist/ui/typography.d.ts +50 -0
  554. package/dist/ui/typography.js +43 -0
  555. package/dist/ui/typography.js.map +1 -0
  556. package/package.json +149 -0
  557. package/src/styles/studio.css +101 -0
  558. package/src/styles/tokens.css +63 -0
@@ -0,0 +1,233 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { EyeOff } from 'lucide-react';
3
+ import { useEffect, useState } from 'react';
4
+ import { conditionOperatorSchema, staticProp } from '@elytracms/project-graph';
5
+ import { pathFromToken } from '@elytracms/data-binding';
6
+ import { manifestSlots } from '@elytracms/component-registry';
7
+ import { fieldValueValidator } from '@elytracms/cms-core';
8
+ import { getStudioRegistry } from '@elytracms/studio/lib/registry';
9
+ import { useData } from '@elytracms/studio/lib/data';
10
+ import { Badge, Button, Code, Field, Input, InspectorSection, PanelHeader, Row, Select, Spacer, Stack, Text, } from '@elytracms/studio/ui';
11
+ import { humanizeName } from '@elytracms/studio/lib/utils';
12
+ import { componentDisplayName, conditionOperatorLabel } from '@elytracms/studio/lib/persona/labels';
13
+ import { FieldControl } from '../cms/field-control';
14
+ import { useBuilder } from './builder-store';
15
+ import { LayoutSection, layoutManagedPropNames } from './layout-inspector';
16
+ export function PropertyInspector() {
17
+ const builder = useBuilder();
18
+ const studio = getStudioRegistry();
19
+ const node = builder.selectedNode;
20
+ if (!node) {
21
+ return (_jsx("div", { className: "grid h-full place-items-center p-6 text-center", children: _jsx(Text, { size: "sm", tone: "muted", children: "Select a node in the tree or canvas to edit its properties." }) }));
22
+ }
23
+ const manifest = studio.registry.getManifest(node.componentId);
24
+ return (_jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [_jsxs(PanelHeader, { children: [_jsx(Text, { size: "sm", weight: "semibold", children: "Inspector" }), _jsx(Spacer, {}), _jsx(Code, { tone: "muted", title: node.componentId, children: componentDisplayName(node.componentId, manifest) })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto", children: _jsx(SettingsTab, { node: node, manifest: manifest }) })] }));
25
+ }
26
+ /** The full property surface: node identity, static props, condition, slots. */
27
+ function SettingsTab({ node, manifest, }) {
28
+ // Container layout props render in the dedicated Layout section (EC-162),
29
+ // not as a second set of generic controls.
30
+ const layoutManaged = new Set(layoutManagedPropNames(node));
31
+ // EC-190: `blocks` props are slots (named child regions), edited via the page
32
+ // tree / composition surface, not as a scalar control — so they show in the
33
+ // Slots section, not Props.
34
+ const props = manifest
35
+ ? Object.entries(manifest.props).filter(([name, spec]) => !layoutManaged.has(name) && spec.type !== 'blocks')
36
+ : [];
37
+ const slots = manifest ? manifestSlots(manifest) : [];
38
+ return (_jsxs(_Fragment, { children: [_jsx(LayoutSection, { node: node }), !manifest ? (_jsxs("div", { className: "p-3", children: [_jsx(Badge, { variant: "error", children: "unknown component" }), _jsx(Text, { size: "xs", tone: "muted", className: "mt-2", children: "No manifest is registered for this component, so its props can't be edited." })] })) : (_jsx(InspectorSection, { title: "Props", children: props.length === 0 ? (_jsx(Text, { size: "xs", tone: "subtle", children: "No editable props." })) : (_jsx(Stack, { gap: "4", children: props.map(([name, spec]) => (
39
+ // Key by node id so per-node local control state never leaks
40
+ // across a selection change to a same-named prop.
41
+ _jsx(PropField, { node: node, name: name, spec: spec }, `${node.id}:${name}`))) })) })), _jsx(InspectorSection, { title: "Condition", children: _jsx(ConditionEditor, { node: node }) }), slots.length > 0 ? (_jsxs(InspectorSection, { title: "Slots", children: [_jsx(Stack, { gap: "1", children: slots.map((slot) => {
42
+ const count = node.slots?.[slot.name]?.length ?? 0;
43
+ const missing = slot.required && count === 0;
44
+ return (_jsxs(Row, { gap: "2", children: [_jsx(Text, { size: "xs", title: slot.name, children: humanizeName(slot.name) }), slot.required ? (_jsx(Badge, { variant: missing ? 'error' : 'outline', children: "required" })) : null, _jsx(Spacer, {}), _jsx(Text, { size: "xs", tone: "subtle", mono: true, children: count })] }, slot.name));
45
+ }) }), _jsx(Text, { size: "xs", tone: "subtle", className: "mt-2", children: "Add or reorder slot children from the page tree." })] })) : null] }));
46
+ }
47
+ function PropField({ node, name, spec }) {
48
+ const value = node.props?.[name];
49
+ return (_jsx(Field, { label: spec.form?.label ?? name, htmlFor: `prop-${node.id}-${name}`, children: _jsx(StaticControl, { node: node, name: name, spec: spec, value: value }) }));
50
+ }
51
+ function controlKind(spec) {
52
+ switch (spec.type) {
53
+ case 'boolean':
54
+ return 'boolean';
55
+ case 'number':
56
+ return 'number';
57
+ case 'select':
58
+ return 'select';
59
+ case 'richText':
60
+ return 'richtext';
61
+ // EC-195: an `asset`-typed prop (e.g. the Image `src`) picks from the asset
62
+ // library — never a raw asset id typed into a text box (the EC-192 persona).
63
+ case 'asset':
64
+ return 'asset';
65
+ // EC-253: an `object`/repeater prop reuses the CMS repeater control below.
66
+ case 'object':
67
+ return 'object';
68
+ // EC-262: a `relation`-typed prop (e.g. a ProductGrid's `category`) reuses the
69
+ // CMS relation picker — never a text box that stringifies the ref to "[object Object]".
70
+ case 'relation':
71
+ return 'relation';
72
+ case 'text': {
73
+ const c = spec.form?.control;
74
+ if (c === 'textarea')
75
+ return 'textarea';
76
+ if (c === 'color')
77
+ return 'color';
78
+ if (c === 'json')
79
+ return 'json';
80
+ return 'text';
81
+ }
82
+ default:
83
+ return 'text';
84
+ }
85
+ }
86
+ function StaticControl({ node, name, spec, value, }) {
87
+ const builder = useBuilder();
88
+ const current = value?.kind === 'static' ? value.value : spec.default;
89
+ const id = `prop-${node.id}-${name}`;
90
+ const coalesceKey = `${node.id}:${name}`;
91
+ function set(v) {
92
+ builder.dispatch({ type: 'setProp', id: node.id, name, value: staticProp(v), coalesceKey });
93
+ }
94
+ function clear() {
95
+ builder.dispatch({ type: 'removeProp', id: node.id, name });
96
+ }
97
+ // EC-190: validate with the prop's field-def value validator (was `spec.schema.safeParse`).
98
+ const valid = current === undefined || fieldValueValidator({ ...spec, name })(current);
99
+ // EC-190: derive the editor control from the field `type` + optional `form.control`.
100
+ const kind = controlKind(spec);
101
+ // Select options live on the `select` field-def (was `spec.control.options`).
102
+ const options = spec.type === 'select' ? spec.options : [];
103
+ let control;
104
+ if (kind === 'boolean') {
105
+ control = (_jsxs("label", { className: "flex h-8 items-center gap-2 text-sm", children: [_jsx("input", { id: id, type: "checkbox", checked: current === true, onChange: (e) => set(e.target.checked), className: "size-4 accent-primary" }), _jsx(Text, { size: "sm", tone: "muted", children: current === true ? 'true' : 'false' })] }));
106
+ }
107
+ else if (kind === 'select') {
108
+ control = (_jsx(Select, { id: id, value: String(current ?? ''), onChange: (e) => {
109
+ // EC-190: select option values are strings (field-def `options`).
110
+ const opt = options.find((o) => o.value === e.target.value);
111
+ set(opt ? opt.value : e.target.value);
112
+ }, children: options.map((opt) => (_jsx("option", { value: opt.value, children: opt.label ?? opt.value }, opt.value))) }));
113
+ }
114
+ else if (kind === 'number') {
115
+ control = _jsx(NumberControl, { id: id, current: current, onSet: set, onClear: clear });
116
+ }
117
+ else if (kind === 'json') {
118
+ control = _jsx(JsonControl, { id: id, current: current, onSet: set });
119
+ }
120
+ else if (kind === 'color') {
121
+ control = (_jsxs(Row, { gap: "2", children: [_jsx("input", { id: id, type: "color", value: typeof current === 'string' && /^#[0-9a-f]{6}$/i.test(current) ? current : '#000000', onChange: (e) => set(e.target.value), className: "h-8 w-10 shrink-0 rounded-md border border-input bg-background" }), _jsx(Input, { value: typeof current === 'string' ? current : '', onChange: (e) => set(e.target.value) })] }));
122
+ }
123
+ else if (kind === 'textarea' || kind === 'richtext') {
124
+ control = (_jsx("textarea", { id: id, rows: 2, value: typeof current === 'string' ? current : '', onChange: (e) => set(e.target.value), className: "flex w-full rounded-md border border-input bg-background px-2.5 py-1.5 text-sm text-foreground shadow-sm focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 outline-none" }));
125
+ }
126
+ else if (kind === 'asset' || kind === 'object' || kind === 'relation') {
127
+ // EC-195/EC-253/EC-262: reuse the CMS field control. `asset` = library picker +
128
+ // preview; `object` = the nested/repeater form; `relation` = the document picker
129
+ // (resolves the ref to its title, instead of stringifying it to "[object Object]").
130
+ // All edit a structured static prop value through the same shared control documents use.
131
+ control = (_jsx(FieldControl, { id: id, field: { ...spec, name }, value: current, onChange: (v) => (v === undefined || v === null ? clear() : set(v)), readOnly: false }));
132
+ }
133
+ else {
134
+ control = (_jsx(Input, { id: id, value: typeof current === 'string' ? current : String(current ?? ''), onChange: (e) => set(e.target.value) }));
135
+ }
136
+ return (_jsxs(Stack, { gap: "1", children: [control, !valid ? (_jsx(Text, { size: "xs", className: "text-destructive", children: "Value doesn't match the prop schema \u2014 the canvas falls back to the default." })) : null] }));
137
+ }
138
+ /** Number input with a local buffer: commits only finite values, never NaN; empty clears the prop. */
139
+ function NumberControl({ id, current, onSet, onClear, }) {
140
+ const [raw, setRaw] = useState(typeof current === 'number' ? String(current) : '');
141
+ useEffect(() => {
142
+ setRaw(typeof current === 'number' ? String(current) : '');
143
+ }, [current]);
144
+ return (_jsx(Input, { id: id, type: "number", value: raw, onChange: (e) => {
145
+ const v = e.target.value;
146
+ setRaw(v);
147
+ if (v.trim() === '') {
148
+ onClear();
149
+ return;
150
+ }
151
+ const n = Number(v);
152
+ if (Number.isFinite(n))
153
+ onSet(n);
154
+ } }));
155
+ }
156
+ /** JSON textarea with a local buffer: commits only when the text parses; flags parse errors. */
157
+ function JsonControl({ id, current, onSet, }) {
158
+ const [raw, setRaw] = useState(() => JSON.stringify(current ?? null));
159
+ const [error, setError] = useState(null);
160
+ useEffect(() => {
161
+ setRaw(JSON.stringify(current ?? null));
162
+ setError(null);
163
+ }, [current]);
164
+ return (_jsxs(Stack, { gap: "1", children: [_jsx("textarea", { id: id, rows: 3, value: raw, onChange: (e) => {
165
+ const v = e.target.value;
166
+ setRaw(v);
167
+ try {
168
+ onSet(JSON.parse(v));
169
+ setError(null);
170
+ }
171
+ catch {
172
+ setError('Invalid JSON');
173
+ }
174
+ }, className: "flex w-full rounded-md border border-input bg-background px-2.5 py-1.5 font-mono text-xs text-foreground shadow-sm focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 outline-none" }), error ? (_jsx(Text, { size: "xs", className: "text-destructive", children: error })) : null] }));
175
+ }
176
+ /** Plain-language label for a stored data path ("item 1 → title") — no raw syntax. */
177
+ function friendlyPathLabel(token) {
178
+ const path = pathFromToken(token);
179
+ if (path === undefined)
180
+ return 'this data';
181
+ if (path.length === 0)
182
+ return 'Everything';
183
+ return path
184
+ .map((seg) => (/^\d+$/.test(seg) ? `entry ${Number(seg) + 1}` : humanizeName(seg)))
185
+ .join(' → ');
186
+ }
187
+ /** Edit a node's render condition (EC-088): source field + operator + comparison value. */
188
+ function ConditionEditor({ node }) {
189
+ const builder = useBuilder();
190
+ const data = useData();
191
+ const condition = node.condition;
192
+ const firstSource = data.sources[0];
193
+ if (!condition) {
194
+ return (_jsxs(Stack, { gap: "2", children: [_jsx(Text, { size: "xs", tone: "subtle", children: "This node always renders. Add a condition to gate it on a data value." }), _jsxs(Button, { size: "sm", variant: "outline", className: "w-fit", disabled: !firstSource, onClick: () => firstSource &&
195
+ builder.dispatch({
196
+ type: 'setCondition',
197
+ id: node.id,
198
+ condition: {
199
+ source: { sourceId: firstSource.id, token: '/', mode: 'value' },
200
+ operator: 'truthy',
201
+ },
202
+ }), children: [_jsx(EyeOff, {}), " Add condition"] })] }));
203
+ }
204
+ const updateCondition = (patch) => builder.dispatch({ type: 'setCondition', id: node.id, condition: { ...condition, ...patch } });
205
+ const updateSource = (patch) => updateCondition({ source: { ...condition.source, ...patch } });
206
+ const tokens = data.tokensOf(condition.source.sourceId);
207
+ const source = data.getSource(condition.source.sourceId);
208
+ const needsValue = !['truthy', 'exists'].includes(condition.operator);
209
+ const result = data.resolveCondition(condition);
210
+ const pass = result.kind === 'condition' ? result.pass : false;
211
+ const issue = result.kind === 'issue' ? result.issue : null;
212
+ return (_jsxs(Stack, { gap: "2", children: [_jsx(Field, { label: "Source", htmlFor: `cond-src-${node.id}`, children: _jsxs(Select, { id: `cond-src-${node.id}`, value: condition.source.sourceId, onChange: (e) => updateSource({ sourceId: e.target.value, token: '/' }), children: [data.sources.map((s) => (_jsx("option", { value: s.id, children: s.label }, s.id))), !source ? (_jsx("option", { value: condition.source.sourceId, title: condition.source.sourceId, children: "Missing data source" })) : null] }) }), _jsxs(Row, { gap: "2", children: [_jsx(Field, { label: "Field", htmlFor: `cond-token-${node.id}`, className: "min-w-0 flex-1", children: _jsxs(Select, { id: `cond-token-${node.id}`, value: condition.source.token, onChange: (e) => updateSource({ token: e.target.value }), children: [tokens.map((t) => (_jsx("option", { value: t, children: friendlyPathLabel(t) }, t))), !tokens.includes(condition.source.token) ? (_jsx("option", { value: condition.source.token, children: friendlyPathLabel(condition.source.token) })) : null] }) }), _jsx(Field, { label: "Operator", htmlFor: `cond-op-${node.id}`, className: "w-28", children: _jsx(Select, { id: `cond-op-${node.id}`, value: condition.operator, onChange: (e) => updateCondition({ operator: e.target.value }), children: conditionOperatorSchema.options.map((op) => (_jsx("option", { value: op, title: op, children: conditionOperatorLabel(op) }, op))) }) })] }), needsValue ? (_jsx(Field, { label: "Compare to", htmlFor: `cond-val-${node.id}`, children: _jsx(Input, { id: `cond-val-${node.id}`, value: condition.value === undefined ? '' : String(condition.value), onChange: (e) => updateCondition({ value: coerceScalar(e.target.value) }), placeholder: "value", className: "font-mono text-xs" }) })) : null, _jsxs(Row, { gap: "2", children: [issue ? (_jsx(Badge, { variant: "error", children: "broken" })) : pass ? (_jsx(Badge, { variant: "success", children: "renders" })) : (_jsxs(Badge, { variant: "warning", children: [_jsx(EyeOff, { className: "size-3" }), " hidden"] })), _jsx(Text, { size: "xs", tone: "muted", className: "min-w-0 flex-1 truncate", children: issue
213
+ ? issue.message
214
+ : pass
215
+ ? 'Condition passes — node renders.'
216
+ : 'Condition fails — node is hidden on the canvas.' }), _jsx(Spacer, {}), _jsx(Button, { size: "sm", variant: "ghost", className: "text-destructive hover:text-destructive", onClick: () => builder.dispatch({ type: 'setCondition', id: node.id, condition: undefined }), children: "Remove" })] })] }));
217
+ }
218
+ /** Parse a comparison-value string into a number/boolean/null when it looks like one. */
219
+ function coerceScalar(raw) {
220
+ if (raw === '')
221
+ return '';
222
+ if (raw === 'true')
223
+ return true;
224
+ if (raw === 'false')
225
+ return false;
226
+ if (raw === 'null')
227
+ return null;
228
+ const n = Number(raw);
229
+ if (raw.trim() !== '' && Number.isFinite(n))
230
+ return n;
231
+ return raw;
232
+ }
233
+ //# sourceMappingURL=property-inspector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-inspector.js","sourceRoot":"","sources":["../../../src/components/builder/property-inspector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAS9E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA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I,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAA;IACrD,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare function RichTextToolbar({ doc, host }: {
2
+ doc: Document;
3
+ host: HTMLElement;
4
+ }): import("react").ReactPortal | null;
@@ -0,0 +1,104 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ const TOOLBAR_OFFSET_PX = 8;
5
+ function selectionState(doc, host) {
6
+ const selection = doc.getSelection();
7
+ if (!selection || selection.rangeCount === 0 || selection.isCollapsed)
8
+ return null;
9
+ if (!host.contains(selection.anchorNode) || !host.contains(selection.focusNode))
10
+ return null;
11
+ const rect = selection.getRangeAt(0).getBoundingClientRect();
12
+ if (rect.width === 0 && rect.height === 0)
13
+ return null;
14
+ const anchor = selection.anchorNode;
15
+ const anchorElement = anchor instanceof Element ? anchor : anchor?.parentElement;
16
+ const link = anchorElement?.closest('a') ?? null;
17
+ return {
18
+ left: rect.left + rect.width / 2,
19
+ top: rect.top,
20
+ bold: doc.queryCommandState('bold'),
21
+ italic: doc.queryCommandState('italic'),
22
+ linkHref: link?.getAttribute('href') ?? null,
23
+ };
24
+ }
25
+ export function RichTextToolbar({ doc, host }) {
26
+ const [state, setState] = useState(null);
27
+ const [linkOpen, setLinkOpen] = useState(false);
28
+ const [linkDraft, setLinkDraft] = useState('');
29
+ const savedRangeRef = useRef(null);
30
+ const refresh = useCallback(() => {
31
+ setState(selectionState(doc, host));
32
+ }, [doc, host]);
33
+ useEffect(() => {
34
+ refresh();
35
+ doc.addEventListener('selectionchange', refresh);
36
+ return () => doc.removeEventListener('selectionchange', refresh);
37
+ }, [doc, refresh]);
38
+ // Close a stale link editor when the selection leaves the host entirely.
39
+ useEffect(() => {
40
+ if (!state && !linkOpen)
41
+ setLinkDraft('');
42
+ }, [state, linkOpen]);
43
+ const exec = useCallback((command, value) => {
44
+ doc.execCommand(command, false, value);
45
+ refresh();
46
+ }, [doc, refresh]);
47
+ const openLinkEditor = useCallback(() => {
48
+ const selection = doc.getSelection();
49
+ if (selection && selection.rangeCount > 0) {
50
+ savedRangeRef.current = selection.getRangeAt(0).cloneRange();
51
+ }
52
+ setLinkDraft(state?.linkHref ?? '');
53
+ setLinkOpen(true);
54
+ }, [doc, state]);
55
+ const applyLink = useCallback((href) => {
56
+ const selection = doc.getSelection();
57
+ const saved = savedRangeRef.current;
58
+ if (saved && selection) {
59
+ selection.removeAllRanges();
60
+ selection.addRange(saved);
61
+ }
62
+ const trimmed = href.trim();
63
+ if (trimmed.length > 0)
64
+ exec('createLink', trimmed);
65
+ else
66
+ exec('unlink');
67
+ setLinkOpen(false);
68
+ savedRangeRef.current = null;
69
+ host.focus({ preventScroll: true });
70
+ }, [doc, exec, host]);
71
+ const closeLinkEditor = useCallback(() => {
72
+ setLinkOpen(false);
73
+ savedRangeRef.current = null;
74
+ host.focus({ preventScroll: true });
75
+ }, [host]);
76
+ if (!state && !linkOpen)
77
+ return null;
78
+ const left = state?.left ?? savedRangeRef.current?.getBoundingClientRect().left ?? 0;
79
+ const top = state?.top ?? savedRangeRef.current?.getBoundingClientRect().top ?? 0;
80
+ return createPortal(_jsx("div", { "data-ec-rt-toolbar": "", role: "toolbar", "aria-label": "Text formatting", className: "ec-rt-toolbar", style: {
81
+ position: 'fixed',
82
+ left: Math.max(8, left),
83
+ top: Math.max(8, top - TOOLBAR_OFFSET_PX),
84
+ transform: 'translate(-50%, -100%)',
85
+ zIndex: 50,
86
+ }, onMouseDown: (e) => {
87
+ // Keep the host's selection/focus — except for the link input.
88
+ if (!e.target.closest('input'))
89
+ e.preventDefault();
90
+ }, children: linkOpen ? (_jsxs("form", { className: "ec-rt-toolbar-row", onSubmit: (e) => {
91
+ e.preventDefault();
92
+ applyLink(linkDraft);
93
+ }, children: [_jsx("input", { autoFocus: true, type: "text", value: linkDraft, placeholder: "https://\u2026 (empty removes)", "aria-label": "Link URL", onChange: (e) => setLinkDraft(e.target.value), onKeyDown: (e) => {
94
+ if (e.key === 'Escape') {
95
+ e.preventDefault();
96
+ e.stopPropagation();
97
+ closeLinkEditor();
98
+ }
99
+ }, className: "ec-rt-toolbar-input" }), _jsx("button", { type: "submit", className: "ec-rt-toolbar-btn", "aria-label": "Apply link", children: "Set" })] })) : (_jsxs("div", { className: "ec-rt-toolbar-row", children: [_jsx(MarkButton, { label: "Bold", active: state?.bold ?? false, onClick: () => exec('bold'), children: "B" }), _jsx(MarkButton, { label: "Italic", active: state?.italic ?? false, onClick: () => exec('italic'), children: "I" }), _jsx(MarkButton, { label: "Link", active: state !== null && state.linkHref !== null, onClick: openLinkEditor, children: "Link" }), state !== null && state.linkHref !== null ? (_jsx(MarkButton, { label: "Remove link", active: false, onClick: () => exec('unlink'), children: "Unlink" })) : null] })) }), doc.body);
100
+ }
101
+ function MarkButton({ label, active, onClick, children, }) {
102
+ return (_jsx("button", { type: "button", "aria-label": label, "aria-pressed": active, title: label, onClick: onClick, className: "ec-rt-toolbar-btn", "data-active": active || undefined, children: children }));
103
+ }
104
+ //# sourceMappingURL=rich-text-toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rich-text-toolbar.js","sourceRoot":"","sources":["../../../src/components/builder/rich-text-toolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AA0BxC,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAE3B,SAAS,cAAc,CAAC,GAAa,EAAE,IAAiB;IACtD,MAAM,SAAS,GAAG,GAAG,CAAC,YAAY,EAAE,CAAA;IACpC,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,UAAU,KAAK,CAAC,IAAI,SAAS,CAAC,WAAW;QAAE,OAAO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AAA;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { ComponentNode } from '@elytracms/project-graph';
2
+ import type { GapStep } from '@elytracms/studio/lib/dnd/gap-drag';
3
+ /**
4
+ * Tokenized spacing handles (EC-163, vision §3.1 / AD-10): when a Stack/Grid
5
+ * container is selected on the canvas, draggable gap handles appear between
6
+ * its children, axis-aware via the shared `containerFlowAxis`. Dragging snaps
7
+ * through the EC-161 spacing-token scale (`lib/dnd/gap-drag` — pure math, no
8
+ * pixel value can escape it) with a live plain-language label (the layout
9
+ * inspector's vocabulary). The drag previews imperatively on the rendered
10
+ * element; releasing commits exactly ONE builder dispatch — `setProp` with the
11
+ * token, or `removeProp` for "no gap", the identical values the inspector's
12
+ * gap select writes — so one undo restores, and the graph stays the single
13
+ * source of truth. Esc mid-drag cancels: preview reverts, nothing dispatches.
14
+ */
15
+ /** Plain-language label for a gap step — the inspector's vocabulary. */
16
+ export declare function gapStepLabel(step: GapStep): string;
17
+ /** True when the node is a container with at least two children to space. */
18
+ export declare function hasSpacingHandles(node: ComponentNode | null): node is ComponentNode;
19
+ export declare function SpacingHandles({ doc, node }: {
20
+ doc: Document;
21
+ node: ComponentNode;
22
+ }): import("react").ReactPortal;
@@ -0,0 +1,213 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { DEFAULT_SLOT, isLayoutContainerNode, staticProp } from '@elytracms/project-graph';
5
+ import { containerFlowAxis } from '@elytracms/studio/lib/dnd/drop-rules';
6
+ import { containerGapStep, gapHandleSpots, gapStepCss, gapStepFromDrag, } from '@elytracms/studio/lib/dnd/gap-drag';
7
+ import { useBuilder } from './builder-store';
8
+ import { GAP_LABELS, GAP_NONE_LABEL } from './layout-inspector';
9
+ /**
10
+ * Tokenized spacing handles (EC-163, vision §3.1 / AD-10): when a Stack/Grid
11
+ * container is selected on the canvas, draggable gap handles appear between
12
+ * its children, axis-aware via the shared `containerFlowAxis`. Dragging snaps
13
+ * through the EC-161 spacing-token scale (`lib/dnd/gap-drag` — pure math, no
14
+ * pixel value can escape it) with a live plain-language label (the layout
15
+ * inspector's vocabulary). The drag previews imperatively on the rendered
16
+ * element; releasing commits exactly ONE builder dispatch — `setProp` with the
17
+ * token, or `removeProp` for "no gap", the identical values the inspector's
18
+ * gap select writes — so one undo restores, and the graph stays the single
19
+ * source of truth. Esc mid-drag cancels: preview reverts, nothing dispatches.
20
+ */
21
+ /** Plain-language label for a gap step — the inspector's vocabulary. */
22
+ export function gapStepLabel(step) {
23
+ return step === null ? GAP_NONE_LABEL : GAP_LABELS[step];
24
+ }
25
+ /** The container's rendered element (the Stack/Grid div carrying the gap style). */
26
+ function containerElementFor(doc, nodeId) {
27
+ const wrapper = doc.querySelector(`[data-ec-node-id="${nodeId}"]`);
28
+ return wrapper?.querySelector(':scope > [data-ec-primitive]') ?? null;
29
+ }
30
+ /**
31
+ * Measure the handle spots between the container's rendered children. The
32
+ * graph-level flow axis (`containerFlowAxis`) is tried first; when the
33
+ * rendered layout disagrees — a stacking Grid below the mobile breakpoint
34
+ * lays its "columns" out vertically — the cross axis is measured instead, so
35
+ * handles always sit in the gaps the editor actually sees.
36
+ */
37
+ function measureSpots(doc, nodeId, flowAxis) {
38
+ const container = containerElementFor(doc, nodeId);
39
+ const win = doc.defaultView;
40
+ if (!container || !win)
41
+ return { spots: [], axis: flowAxis };
42
+ const children = Array.from(container.querySelectorAll(':scope > [data-ec-node-id]'));
43
+ if (children.length < 2)
44
+ return { spots: [], axis: flowAxis };
45
+ const rects = children.map((el) => {
46
+ const r = el.getBoundingClientRect();
47
+ return { left: r.left + win.scrollX, top: r.top + win.scrollY, width: r.width, height: r.height };
48
+ });
49
+ const along = gapHandleSpots(rects, flowAxis);
50
+ if (along.length > 0)
51
+ return { spots: along, axis: flowAxis };
52
+ const cross = flowAxis === 'horizontal' ? 'vertical' : 'horizontal';
53
+ const across = gapHandleSpots(rects, cross);
54
+ return across.length > 0 ? { spots: across, axis: cross } : { spots: [], axis: flowAxis };
55
+ }
56
+ /** True when the node is a container with at least two children to space. */
57
+ export function hasSpacingHandles(node) {
58
+ return (node !== null &&
59
+ isLayoutContainerNode(node) &&
60
+ (node.slots?.[DEFAULT_SLOT]?.length ?? 0) >= 2);
61
+ }
62
+ const HANDLE_THICKNESS = 14;
63
+ const HANDLE_BAR = 4;
64
+ const HANDLE_MAX_LENGTH = 48;
65
+ export function SpacingHandles({ doc, node }) {
66
+ const builder = useBuilder();
67
+ const { dispatch } = builder;
68
+ const flowAxis = containerFlowAxis(node);
69
+ const [measured, setMeasured] = useState({ spots: [], axis: flowAxis });
70
+ const [drag, setDrag] = useState(null);
71
+ const dragRef = useRef(null);
72
+ // The container's pre-drag inline gap, restored on cancel/commit (the graph
73
+ // re-render owns the committed value; the preview is imperative-only).
74
+ const inlineGapRef = useRef('');
75
+ // Re-measure when the graph, selection, drag preview, or iframe size change.
76
+ useLayoutEffect(() => {
77
+ const measure = () => setMeasured(measureSpots(doc, node.id, flowAxis));
78
+ measure();
79
+ const win = doc.defaultView;
80
+ win?.addEventListener('resize', measure);
81
+ return () => win?.removeEventListener('resize', measure);
82
+ }, [doc, node, flowAxis, builder.present, builder.viewport, drag?.step]);
83
+ const { spots, axis } = measured;
84
+ const applyPreview = useCallback((step) => {
85
+ const container = containerElementFor(doc, node.id);
86
+ if (container)
87
+ container.style.gap = gapStepCss(step);
88
+ }, [doc, node.id]);
89
+ const finish = useCallback((mode) => {
90
+ const active = dragRef.current;
91
+ if (!active)
92
+ return;
93
+ dragRef.current = null;
94
+ setDrag(null);
95
+ // Drop the imperative preview; the rendered graph value takes over.
96
+ const container = containerElementFor(doc, node.id);
97
+ if (container)
98
+ container.style.gap = inlineGapRef.current;
99
+ if (mode === 'commit' && active.step !== active.startStep) {
100
+ // Exactly one dispatch — one operations command, one undo step — and
101
+ // the identical prop value the inspector's gap select produces.
102
+ if (active.step === null) {
103
+ dispatch({ type: 'removeProp', id: node.id, name: 'gap' });
104
+ }
105
+ else {
106
+ dispatch({ type: 'setProp', id: node.id, name: 'gap', value: staticProp(active.step) });
107
+ }
108
+ }
109
+ }, [doc, node.id, dispatch]);
110
+ // Esc cancels mid-drag — listen on both documents (focus may sit either side
111
+ // of the iframe boundary while the pointer is captured).
112
+ useEffect(() => {
113
+ if (!drag)
114
+ return;
115
+ const onKeyDown = (e) => {
116
+ if (e.key === 'Escape') {
117
+ e.preventDefault();
118
+ e.stopPropagation();
119
+ finish('cancel');
120
+ }
121
+ };
122
+ doc.addEventListener('keydown', onKeyDown, true);
123
+ document.addEventListener('keydown', onKeyDown, true);
124
+ return () => {
125
+ doc.removeEventListener('keydown', onKeyDown, true);
126
+ document.removeEventListener('keydown', onKeyDown, true);
127
+ };
128
+ }, [drag, doc, finish]);
129
+ // Cleanup on unmount/selection change mid-drag: revert, never dispatch.
130
+ useEffect(() => () => finish('cancel'), [finish]);
131
+ const onPointerDown = (spot) => (e) => {
132
+ if (e.button !== 0)
133
+ return;
134
+ e.preventDefault();
135
+ e.stopPropagation();
136
+ const startStep = containerGapStep(node);
137
+ const container = containerElementFor(doc, node.id);
138
+ inlineGapRef.current = container?.style.gap ?? '';
139
+ try {
140
+ e.currentTarget.setPointerCapture(e.pointerId);
141
+ }
142
+ catch {
143
+ // Synthetic pointer events (tests, automation) have no active pointer
144
+ // to capture; move/up still arrive via the handle's own listeners.
145
+ }
146
+ const next = {
147
+ index: spot.index,
148
+ startStep,
149
+ step: startStep,
150
+ startCoord: axis === 'horizontal' ? e.clientX : e.clientY,
151
+ labelX: spot.x,
152
+ labelY: spot.y,
153
+ };
154
+ dragRef.current = next;
155
+ setDrag(next);
156
+ };
157
+ const onPointerMove = (e) => {
158
+ const active = dragRef.current;
159
+ if (!active)
160
+ return;
161
+ const win = doc.defaultView;
162
+ const coord = axis === 'horizontal' ? e.clientX : e.clientY;
163
+ const step = gapStepFromDrag(active.startStep, coord - active.startCoord);
164
+ const next = {
165
+ ...active,
166
+ step,
167
+ labelX: e.clientX + (win?.scrollX ?? 0),
168
+ labelY: e.clientY + (win?.scrollY ?? 0),
169
+ };
170
+ dragRef.current = next;
171
+ setDrag(next);
172
+ applyPreview(step);
173
+ };
174
+ const horizontal = axis === 'horizontal';
175
+ return createPortal(_jsxs("div", { "data-ec-spacing-handles": "", children: [spots.map((spot) => {
176
+ const length = Math.min(spot.crossLength, HANDLE_MAX_LENGTH);
177
+ const active = drag?.index === spot.index;
178
+ return (_jsx("div", { "data-ec-gap-handle": spot.index, role: "separator", "aria-label": `Gap after child ${spot.index + 1}`, "aria-orientation": horizontal ? 'vertical' : 'horizontal', onPointerDown: onPointerDown(spot), onPointerMove: onPointerMove, onPointerUp: () => finish('commit'), onPointerCancel: () => finish('cancel'), style: {
179
+ position: 'absolute',
180
+ left: spot.x - (horizontal ? HANDLE_THICKNESS / 2 : length / 2),
181
+ top: spot.y - (horizontal ? length / 2 : HANDLE_THICKNESS / 2),
182
+ width: horizontal ? HANDLE_THICKNESS : length,
183
+ height: horizontal ? length : HANDLE_THICKNESS,
184
+ display: 'flex',
185
+ alignItems: 'center',
186
+ justifyContent: 'center',
187
+ cursor: horizontal ? 'col-resize' : 'row-resize',
188
+ zIndex: 40,
189
+ touchAction: 'none',
190
+ }, children: _jsx("div", { style: {
191
+ width: horizontal ? HANDLE_BAR : '100%',
192
+ height: horizontal ? '100%' : HANDLE_BAR,
193
+ borderRadius: 999,
194
+ backgroundColor: active ? '#5b8cff' : 'rgba(91, 140, 255, 0.65)',
195
+ boxShadow: '0 0 0 1px rgba(8, 12, 24, 0.55)',
196
+ } }) }, spot.index));
197
+ }), drag ? (_jsx("div", { "data-ec-gap-label": "", style: {
198
+ position: 'absolute',
199
+ left: drag.labelX + 12,
200
+ top: drag.labelY + 12,
201
+ zIndex: 50,
202
+ pointerEvents: 'none',
203
+ padding: '2px 8px',
204
+ borderRadius: 6,
205
+ fontSize: 11,
206
+ fontWeight: 600,
207
+ whiteSpace: 'nowrap',
208
+ color: '#fff',
209
+ backgroundColor: '#5b8cff',
210
+ boxShadow: '0 2px 8px rgba(8, 12, 24, 0.4)',
211
+ }, children: gapStepLabel(drag.step) })) : null] }), doc.body);
212
+ }
213
+ //# sourceMappingURL=spacing-handles.js.map