@aglyn/besigner-ui 1.0.0-beta.143

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 (486) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +73 -0
  4. package/src/besigner.d.ts +88 -0
  5. package/src/besigner.js +89 -0
  6. package/src/besigner.js.map +1 -0
  7. package/src/index.d.ts +17 -0
  8. package/src/index.js +18 -0
  9. package/src/index.js.map +1 -0
  10. package/src/lib/box-styler/box-styler.d.ts +57 -0
  11. package/src/lib/box-styler/box-styler.js +240 -0
  12. package/src/lib/box-styler/box-styler.js.map +1 -0
  13. package/src/lib/box-styler/components/box-diagram.d.ts +89 -0
  14. package/src/lib/box-styler/components/box-diagram.js +661 -0
  15. package/src/lib/box-styler/components/box-diagram.js.map +1 -0
  16. package/src/lib/box-styler/components/legend.d.ts +56 -0
  17. package/src/lib/box-styler/components/legend.js +130 -0
  18. package/src/lib/box-styler/components/legend.js.map +1 -0
  19. package/src/lib/box-styler/components/spacing-editor.d.ts +55 -0
  20. package/src/lib/box-styler/components/spacing-editor.js +347 -0
  21. package/src/lib/box-styler/components/spacing-editor.js.map +1 -0
  22. package/src/lib/box-styler/constants.d.ts +17 -0
  23. package/src/lib/box-styler/constants.js +30 -0
  24. package/src/lib/box-styler/constants.js.map +1 -0
  25. package/src/lib/box-styler/index.d.ts +2 -0
  26. package/src/lib/box-styler/index.js +4 -0
  27. package/src/lib/box-styler/index.js.map +1 -0
  28. package/src/lib/box-styler/region-fills.d.ts +107 -0
  29. package/src/lib/box-styler/region-fills.js +139 -0
  30. package/src/lib/box-styler/region-fills.js.map +1 -0
  31. package/src/lib/box-styler/spacing-value.d.ts +104 -0
  32. package/src/lib/box-styler/spacing-value.js +223 -0
  33. package/src/lib/box-styler/spacing-value.js.map +1 -0
  34. package/src/lib/box-styler/types.d.ts +29 -0
  35. package/src/lib/box-styler/types.js +18 -0
  36. package/src/lib/box-styler/types.js.map +1 -0
  37. package/src/lib/components/accordion-list.component.d.ts +50 -0
  38. package/src/lib/components/accordion-list.component.js +228 -0
  39. package/src/lib/components/accordion-list.component.js.map +1 -0
  40. package/src/lib/components/add-controls.component.d.ts +22 -0
  41. package/src/lib/components/add-controls.component.js +50 -0
  42. package/src/lib/components/add-controls.component.js.map +1 -0
  43. package/src/lib/components/app-bar-breadcrumbs.component.d.ts +29 -0
  44. package/src/lib/components/app-bar-breadcrumbs.component.js +279 -0
  45. package/src/lib/components/app-bar-breadcrumbs.component.js.map +1 -0
  46. package/src/lib/components/app-bar-primary.component.d.ts +21 -0
  47. package/src/lib/components/app-bar-primary.component.js +108 -0
  48. package/src/lib/components/app-bar-primary.component.js.map +1 -0
  49. package/src/lib/components/app-bar-secondary.component.d.ts +21 -0
  50. package/src/lib/components/app-bar-secondary.component.js +94 -0
  51. package/src/lib/components/app-bar-secondary.component.js.map +1 -0
  52. package/src/lib/components/aside-panel.component.d.ts +23 -0
  53. package/src/lib/components/aside-panel.component.js +505 -0
  54. package/src/lib/components/aside-panel.component.js.map +1 -0
  55. package/src/lib/components/besigner-conflict-alert.component.d.ts +36 -0
  56. package/src/lib/components/besigner-conflict-alert.component.js +51 -0
  57. package/src/lib/components/besigner-conflict-alert.component.js.map +1 -0
  58. package/src/lib/components/besigner-dnd-context.component.d.ts +32 -0
  59. package/src/lib/components/besigner-dnd-context.component.js +75 -0
  60. package/src/lib/components/besigner-dnd-context.component.js.map +1 -0
  61. package/src/lib/components/besigner-draft-alert.component.d.ts +70 -0
  62. package/src/lib/components/besigner-draft-alert.component.js +155 -0
  63. package/src/lib/components/besigner-draft-alert.component.js.map +1 -0
  64. package/src/lib/components/besigner-root-provider.component.d.ts +33 -0
  65. package/src/lib/components/besigner-root-provider.component.js +68 -0
  66. package/src/lib/components/besigner-root-provider.component.js.map +1 -0
  67. package/src/lib/components/binding-preview-controls.component.d.ts +28 -0
  68. package/src/lib/components/binding-preview-controls.component.js +63 -0
  69. package/src/lib/components/binding-preview-controls.component.js.map +1 -0
  70. package/src/lib/components/closeable-drawer.component.d.ts +32 -0
  71. package/src/lib/components/closeable-drawer.component.js +134 -0
  72. package/src/lib/components/closeable-drawer.component.js.map +1 -0
  73. package/src/lib/components/component-accordion-list.d.ts +28 -0
  74. package/src/lib/components/component-accordion-list.js +205 -0
  75. package/src/lib/components/component-accordion-list.js.map +1 -0
  76. package/src/lib/components/component-icon.component.d.ts +32 -0
  77. package/src/lib/components/component-icon.component.js +51 -0
  78. package/src/lib/components/component-icon.component.js.map +1 -0
  79. package/src/lib/components/component-picker.d.ts +27 -0
  80. package/src/lib/components/component-picker.js +368 -0
  81. package/src/lib/components/component-picker.js.map +1 -0
  82. package/src/lib/components/components-grid-list.component.d.ts +31 -0
  83. package/src/lib/components/components-grid-list.component.js +162 -0
  84. package/src/lib/components/components-grid-list.component.js.map +1 -0
  85. package/src/lib/components/custom-css-form.component.d.ts +115 -0
  86. package/src/lib/components/custom-css-form.component.js +699 -0
  87. package/src/lib/components/custom-css-form.component.js.map +1 -0
  88. package/src/lib/components/device-preview-controls.component.d.ts +22 -0
  89. package/src/lib/components/device-preview-controls.component.js +150 -0
  90. package/src/lib/components/device-preview-controls.component.js.map +1 -0
  91. package/src/lib/components/dnd/canvas-drop-indicator.d.ts +20 -0
  92. package/src/lib/components/dnd/canvas-drop-indicator.js +61 -0
  93. package/src/lib/components/dnd/canvas-drop-indicator.js.map +1 -0
  94. package/src/lib/components/dnd/draggable-droppable.d.ts +31 -0
  95. package/src/lib/components/dnd/draggable-droppable.js +383 -0
  96. package/src/lib/components/dnd/draggable-droppable.js.map +1 -0
  97. package/src/lib/components/dnd/draggable.d.ts +42 -0
  98. package/src/lib/components/dnd/draggable.js +66 -0
  99. package/src/lib/components/dnd/draggable.js.map +1 -0
  100. package/src/lib/components/dnd/drop-indicator.d.ts +31 -0
  101. package/src/lib/components/dnd/drop-indicator.js +139 -0
  102. package/src/lib/components/dnd/drop-indicator.js.map +1 -0
  103. package/src/lib/components/dnd/droppable.d.ts +43 -0
  104. package/src/lib/components/dnd/droppable.js +63 -0
  105. package/src/lib/components/dnd/droppable.js.map +1 -0
  106. package/src/lib/components/element-card.component.d.ts +23 -0
  107. package/src/lib/components/element-card.component.js +49 -0
  108. package/src/lib/components/element-card.component.js.map +1 -0
  109. package/src/lib/components/element-classes-field.component.d.ts +41 -0
  110. package/src/lib/components/element-classes-field.component.js +140 -0
  111. package/src/lib/components/element-classes-field.component.js.map +1 -0
  112. package/src/lib/components/element-detail-overlay.component.d.ts +55 -0
  113. package/src/lib/components/element-detail-overlay.component.js +157 -0
  114. package/src/lib/components/element-detail-overlay.component.js.map +1 -0
  115. package/src/lib/components/element-detail.component.d.ts +56 -0
  116. package/src/lib/components/element-detail.component.js +171 -0
  117. package/src/lib/components/element-detail.component.js.map +1 -0
  118. package/src/lib/components/element-info-details.component.d.ts +18 -0
  119. package/src/lib/components/element-info-details.component.js +169 -0
  120. package/src/lib/components/element-info-details.component.js.map +1 -0
  121. package/src/lib/components/element-interactions-form.component.d.ts +21 -0
  122. package/src/lib/components/element-interactions-form.component.js +199 -0
  123. package/src/lib/components/element-interactions-form.component.js.map +1 -0
  124. package/src/lib/components/element-preview.component.d.ts +75 -0
  125. package/src/lib/components/element-preview.component.js +346 -0
  126. package/src/lib/components/element-preview.component.js.map +1 -0
  127. package/src/lib/components/element-props-form.component.d.ts +565 -0
  128. package/src/lib/components/element-props-form.component.js +2392 -0
  129. package/src/lib/components/element-props-form.component.js.map +1 -0
  130. package/src/lib/components/element-styles-form-template.component.d.ts +27 -0
  131. package/src/lib/components/element-styles-form-template.component.js +89 -0
  132. package/src/lib/components/element-styles-form-template.component.js.map +1 -0
  133. package/src/lib/components/element-styles-form.component.d.ts +52 -0
  134. package/src/lib/components/element-styles-form.component.js +1350 -0
  135. package/src/lib/components/element-styles-form.component.js.map +1 -0
  136. package/src/lib/components/empty-document-slot.d.ts +39 -0
  137. package/src/lib/components/empty-document-slot.js +121 -0
  138. package/src/lib/components/empty-document-slot.js.map +1 -0
  139. package/src/lib/components/empty-results.d.ts +22 -0
  140. package/src/lib/components/empty-results.js +131 -0
  141. package/src/lib/components/empty-results.js.map +1 -0
  142. package/src/lib/components/history-controls.component.d.ts +21 -0
  143. package/src/lib/components/history-controls.component.js +67 -0
  144. package/src/lib/components/history-controls.component.js.map +1 -0
  145. package/src/lib/components/inline-markdown-editor.component.d.ts +17 -0
  146. package/src/lib/components/inline-markdown-editor.component.js +220 -0
  147. package/src/lib/components/inline-markdown-editor.component.js.map +1 -0
  148. package/src/lib/components/inline-text-editor.component.d.ts +48 -0
  149. package/src/lib/components/inline-text-editor.component.js +905 -0
  150. package/src/lib/components/inline-text-editor.component.js.map +1 -0
  151. package/src/lib/components/insert-token-menu.component.d.ts +86 -0
  152. package/src/lib/components/insert-token-menu.component.js +232 -0
  153. package/src/lib/components/insert-token-menu.component.js.map +1 -0
  154. package/src/lib/components/instance-attr-overrides.component.d.ts +50 -0
  155. package/src/lib/components/instance-attr-overrides.component.js +298 -0
  156. package/src/lib/components/instance-attr-overrides.component.js.map +1 -0
  157. package/src/lib/components/interact-controls.component.d.ts +22 -0
  158. package/src/lib/components/interact-controls.component.js +74 -0
  159. package/src/lib/components/interact-controls.component.js.map +1 -0
  160. package/src/lib/components/markdown-attribute-field.component.d.ts +40 -0
  161. package/src/lib/components/markdown-attribute-field.component.js +103 -0
  162. package/src/lib/components/markdown-attribute-field.component.js.map +1 -0
  163. package/src/lib/components/node-card.d.ts +24 -0
  164. package/src/lib/components/node-card.js +86 -0
  165. package/src/lib/components/node-card.js.map +1 -0
  166. package/src/lib/components/node-context-menu.d.ts +25 -0
  167. package/src/lib/components/node-context-menu.js +558 -0
  168. package/src/lib/components/node-context-menu.js.map +1 -0
  169. package/src/lib/components/node-leaf.d.ts +39 -0
  170. package/src/lib/components/node-leaf.js +628 -0
  171. package/src/lib/components/node-leaf.js.map +1 -0
  172. package/src/lib/components/node-outline.d.ts +24 -0
  173. package/src/lib/components/node-outline.js +156 -0
  174. package/src/lib/components/node-outline.js.map +1 -0
  175. package/src/lib/components/node-overlay.d.ts +23 -0
  176. package/src/lib/components/node-overlay.js +299 -0
  177. package/src/lib/components/node-overlay.js.map +1 -0
  178. package/src/lib/components/node-quick-actions.d.ts +24 -0
  179. package/src/lib/components/node-quick-actions.js +284 -0
  180. package/src/lib/components/node-quick-actions.js.map +1 -0
  181. package/src/lib/components/node-tree-view.d.ts +106 -0
  182. package/src/lib/components/node-tree-view.js +820 -0
  183. package/src/lib/components/node-tree-view.js.map +1 -0
  184. package/src/lib/components/panel-controls.component.d.ts +22 -0
  185. package/src/lib/components/panel-controls.component.js +76 -0
  186. package/src/lib/components/panel-controls.component.js.map +1 -0
  187. package/src/lib/components/picker-search-field.d.ts +38 -0
  188. package/src/lib/components/picker-search-field.js +79 -0
  189. package/src/lib/components/picker-search-field.js.map +1 -0
  190. package/src/lib/components/plugin-settings-field.component.d.ts +38 -0
  191. package/src/lib/components/plugin-settings-field.component.js +264 -0
  192. package/src/lib/components/plugin-settings-field.component.js.map +1 -0
  193. package/src/lib/components/properties-dialog.component.d.ts +22 -0
  194. package/src/lib/components/properties-dialog.component.js +40 -0
  195. package/src/lib/components/properties-dialog.component.js.map +1 -0
  196. package/src/lib/components/property-binding-field.component.d.ts +142 -0
  197. package/src/lib/components/property-binding-field.component.js +325 -0
  198. package/src/lib/components/property-binding-field.component.js.map +1 -0
  199. package/src/lib/components/property-values-form.component.d.ts +43 -0
  200. package/src/lib/components/property-values-form.component.js +223 -0
  201. package/src/lib/components/property-values-form.component.js.map +1 -0
  202. package/src/lib/components/scheme-preview-controls.component.d.ts +26 -0
  203. package/src/lib/components/scheme-preview-controls.component.js +56 -0
  204. package/src/lib/components/scheme-preview-controls.component.js.map +1 -0
  205. package/src/lib/components/screen-link-field.component.d.ts +118 -0
  206. package/src/lib/components/screen-link-field.component.js +282 -0
  207. package/src/lib/components/screen-link-field.component.js.map +1 -0
  208. package/src/lib/components/site-theme-color-tokens-provider.component.d.ts +33 -0
  209. package/src/lib/components/site-theme-color-tokens-provider.component.js +53 -0
  210. package/src/lib/components/site-theme-color-tokens-provider.component.js.map +1 -0
  211. package/src/lib/components/subtree-json-dialog.component.d.ts +46 -0
  212. package/src/lib/components/subtree-json-dialog.component.js +125 -0
  213. package/src/lib/components/subtree-json-dialog.component.js.map +1 -0
  214. package/src/lib/components/token-pill.component.d.ts +51 -0
  215. package/src/lib/components/token-pill.component.js +164 -0
  216. package/src/lib/components/token-pill.component.js.map +1 -0
  217. package/src/lib/components/token-text-field.component.d.ts +146 -0
  218. package/src/lib/components/token-text-field.component.js +603 -0
  219. package/src/lib/components/token-text-field.component.js.map +1 -0
  220. package/src/lib/components/tree/tree-list.d.ts +6 -0
  221. package/src/lib/components/tree/tree-list.js +108 -0
  222. package/src/lib/components/tree/tree-list.js.map +1 -0
  223. package/src/lib/components/viewport-canvas.component.d.ts +23 -0
  224. package/src/lib/components/viewport-canvas.component.js +128 -0
  225. package/src/lib/components/viewport-canvas.component.js.map +1 -0
  226. package/src/lib/components/viewport-frame.component.d.ts +47 -0
  227. package/src/lib/components/viewport-frame.component.js +332 -0
  228. package/src/lib/components/viewport-frame.component.js.map +1 -0
  229. package/src/lib/components/viewport-root.component.d.ts +22 -0
  230. package/src/lib/components/viewport-root.component.js +112 -0
  231. package/src/lib/components/viewport-root.component.js.map +1 -0
  232. package/src/lib/components/viewport-zoom-controls.d.ts +29 -0
  233. package/src/lib/components/viewport-zoom-controls.js +147 -0
  234. package/src/lib/components/viewport-zoom-controls.js.map +1 -0
  235. package/src/lib/components/workspace-editor.component.d.ts +23 -0
  236. package/src/lib/components/workspace-editor.component.js +191 -0
  237. package/src/lib/components/workspace-editor.component.js.map +1 -0
  238. package/src/lib/components/workspace-panel.component.d.ts +28 -0
  239. package/src/lib/components/workspace-panel.component.js +147 -0
  240. package/src/lib/components/workspace-panel.component.js.map +1 -0
  241. package/src/lib/constants/sample-data.d.ts +18 -0
  242. package/src/lib/constants/sample-data.js +106 -0
  243. package/src/lib/constants/sample-data.js.map +1 -0
  244. package/src/lib/constants/shared.d.ts +17 -0
  245. package/src/lib/constants/shared.js +18 -0
  246. package/src/lib/constants/shared.js.map +1 -0
  247. package/src/lib/contexts/besigner-app-context.d.ts +30 -0
  248. package/src/lib/contexts/besigner-app-context.js +41 -0
  249. package/src/lib/contexts/besigner-app-context.js.map +1 -0
  250. package/src/lib/contexts/binding-picker-context.d.ts +78 -0
  251. package/src/lib/contexts/binding-picker-context.js +21 -0
  252. package/src/lib/contexts/binding-picker-context.js.map +1 -0
  253. package/src/lib/contexts/canvas-host-tokens-context.d.ts +49 -0
  254. package/src/lib/contexts/canvas-host-tokens-context.js +63 -0
  255. package/src/lib/contexts/canvas-host-tokens-context.js.map +1 -0
  256. package/src/lib/contexts/canvas-reveal-context.d.ts +32 -0
  257. package/src/lib/contexts/canvas-reveal-context.js +34 -0
  258. package/src/lib/contexts/canvas-reveal-context.js.map +1 -0
  259. package/src/lib/contexts/component-promotion-context.d.ts +89 -0
  260. package/src/lib/contexts/component-promotion-context.js +21 -0
  261. package/src/lib/contexts/component-promotion-context.js.map +1 -0
  262. package/src/lib/contexts/components-drawer-context.provider.d.ts +32 -0
  263. package/src/lib/contexts/components-drawer-context.provider.js +80 -0
  264. package/src/lib/contexts/components-drawer-context.provider.js.map +1 -0
  265. package/src/lib/contexts/element-drawer-context.d.ts +1005 -0
  266. package/src/lib/contexts/element-drawer-context.js +45 -0
  267. package/src/lib/contexts/element-drawer-context.js.map +1 -0
  268. package/src/lib/contexts/inspected-selection.d.ts +32 -0
  269. package/src/lib/contexts/inspected-selection.js +38 -0
  270. package/src/lib/contexts/inspected-selection.js.map +1 -0
  271. package/src/lib/contexts/inspector-extras-context.d.ts +56 -0
  272. package/src/lib/contexts/inspector-extras-context.js +35 -0
  273. package/src/lib/contexts/inspector-extras-context.js.map +1 -0
  274. package/src/lib/contexts/interactions-context.d.ts +99 -0
  275. package/src/lib/contexts/interactions-context.js +22 -0
  276. package/src/lib/contexts/interactions-context.js.map +1 -0
  277. package/src/lib/contexts/layout-chrome-context.d.ts +37 -0
  278. package/src/lib/contexts/layout-chrome-context.js +75 -0
  279. package/src/lib/contexts/layout-chrome-context.js.map +1 -0
  280. package/src/lib/contexts/media-asset-facts-context.d.ts +74 -0
  281. package/src/lib/contexts/media-asset-facts-context.js +27 -0
  282. package/src/lib/contexts/media-asset-facts-context.js.map +1 -0
  283. package/src/lib/contexts/media-picker-context.d.ts +88 -0
  284. package/src/lib/contexts/media-picker-context.js +21 -0
  285. package/src/lib/contexts/media-picker-context.js.map +1 -0
  286. package/src/lib/contexts/rendered-canvas-elements.d.ts +42 -0
  287. package/src/lib/contexts/rendered-canvas-elements.js +79 -0
  288. package/src/lib/contexts/rendered-canvas-elements.js.map +1 -0
  289. package/src/lib/contexts/repeat-record-context.d.ts +38 -0
  290. package/src/lib/contexts/repeat-record-context.js +21 -0
  291. package/src/lib/contexts/repeat-record-context.js.map +1 -0
  292. package/src/lib/contexts/repeat-rows-context.d.ts +53 -0
  293. package/src/lib/contexts/repeat-rows-context.js +38 -0
  294. package/src/lib/contexts/repeat-rows-context.js.map +1 -0
  295. package/src/lib/contexts/toolbar-extras-context.d.ts +31 -0
  296. package/src/lib/contexts/toolbar-extras-context.js +33 -0
  297. package/src/lib/contexts/toolbar-extras-context.js.map +1 -0
  298. package/src/lib/drafts/besigner-draft-store.d.ts +110 -0
  299. package/src/lib/drafts/besigner-draft-store.js +125 -0
  300. package/src/lib/drafts/besigner-draft-store.js.map +1 -0
  301. package/src/lib/drafts/besigner-server-draft.d.ts +130 -0
  302. package/src/lib/drafts/besigner-server-draft.js +211 -0
  303. package/src/lib/drafts/besigner-server-draft.js.map +1 -0
  304. package/src/lib/form-fields/components/shared/inline-form-control.d.ts +32 -0
  305. package/src/lib/form-fields/components/shared/inline-form-control.js +85 -0
  306. package/src/lib/form-fields/components/shared/inline-form-control.js.map +1 -0
  307. package/src/lib/form-fields/components/shared/toggle-button-form-control.d.ts +33 -0
  308. package/src/lib/form-fields/components/shared/toggle-button-form-control.js +83 -0
  309. package/src/lib/form-fields/components/shared/toggle-button-form-control.js.map +1 -0
  310. package/src/lib/form-fields/form-fields.d.ts +20 -0
  311. package/src/lib/form-fields/form-fields.js +21 -0
  312. package/src/lib/form-fields/form-fields.js.map +1 -0
  313. package/src/lib/form-fields/index.d.ts +1 -0
  314. package/src/lib/form-fields/index.js +3 -0
  315. package/src/lib/form-fields/index.js.map +1 -0
  316. package/src/lib/hooks/use-add-element-drawer-callback.d.ts +28 -0
  317. package/src/lib/hooks/use-add-element-drawer-callback.js +112 -0
  318. package/src/lib/hooks/use-add-element-drawer-callback.js.map +1 -0
  319. package/src/lib/hooks/use-aglyn-besigner-flag.d.ts +23 -0
  320. package/src/lib/hooks/use-aglyn-besigner-flag.js +47 -0
  321. package/src/lib/hooks/use-aglyn-besigner-flag.js.map +1 -0
  322. package/src/lib/hooks/use-aglyn-besigner-panel-value.d.ts +23 -0
  323. package/src/lib/hooks/use-aglyn-besigner-panel-value.js +54 -0
  324. package/src/lib/hooks/use-aglyn-besigner-panel-value.js.map +1 -0
  325. package/src/lib/hooks/use-aglyn-besigner-panel.d.ts +23 -0
  326. package/src/lib/hooks/use-aglyn-besigner-panel.js +47 -0
  327. package/src/lib/hooks/use-aglyn-besigner-panel.js.map +1 -0
  328. package/src/lib/hooks/use-anchored-rect.d.ts +68 -0
  329. package/src/lib/hooks/use-anchored-rect.js +131 -0
  330. package/src/lib/hooks/use-anchored-rect.js.map +1 -0
  331. package/src/lib/hooks/use-besigner-app-context.d.ts +18 -0
  332. package/src/lib/hooks/use-besigner-app-context.js +19 -0
  333. package/src/lib/hooks/use-besigner-app-context.js.map +1 -0
  334. package/src/lib/hooks/use-besigner-document.d.ts +309 -0
  335. package/src/lib/hooks/use-besigner-document.js +500 -0
  336. package/src/lib/hooks/use-besigner-document.js.map +1 -0
  337. package/src/lib/hooks/use-besigner-draft.d.ts +209 -0
  338. package/src/lib/hooks/use-besigner-draft.js +429 -0
  339. package/src/lib/hooks/use-besigner-draft.js.map +1 -0
  340. package/src/lib/hooks/use-clipboard-callbacks.d.ts +29 -0
  341. package/src/lib/hooks/use-clipboard-callbacks.js +82 -0
  342. package/src/lib/hooks/use-clipboard-callbacks.js.map +1 -0
  343. package/src/lib/hooks/use-clipboard-shortcuts.d.ts +52 -0
  344. package/src/lib/hooks/use-clipboard-shortcuts.js +102 -0
  345. package/src/lib/hooks/use-clipboard-shortcuts.js.map +1 -0
  346. package/src/lib/hooks/use-component-propagation-notice.d.ts +96 -0
  347. package/src/lib/hooks/use-component-propagation-notice.js +177 -0
  348. package/src/lib/hooks/use-component-propagation-notice.js.map +1 -0
  349. package/src/lib/hooks/use-debounced-commit.d.ts +43 -0
  350. package/src/lib/hooks/use-debounced-commit.js +88 -0
  351. package/src/lib/hooks/use-debounced-commit.js.map +1 -0
  352. package/src/lib/hooks/use-delete-element-callback.d.ts +24 -0
  353. package/src/lib/hooks/use-delete-element-callback.js +82 -0
  354. package/src/lib/hooks/use-delete-element-callback.js.map +1 -0
  355. package/src/lib/hooks/use-detail-hover-intent.d.ts +76 -0
  356. package/src/lib/hooks/use-detail-hover-intent.js +123 -0
  357. package/src/lib/hooks/use-detail-hover-intent.js.map +1 -0
  358. package/src/lib/hooks/use-document-repair-callbacks.d.ts +50 -0
  359. package/src/lib/hooks/use-document-repair-callbacks.js +237 -0
  360. package/src/lib/hooks/use-document-repair-callbacks.js.map +1 -0
  361. package/src/lib/hooks/use-insert-token-options.d.ts +52 -0
  362. package/src/lib/hooks/use-insert-token-options.js +230 -0
  363. package/src/lib/hooks/use-insert-token-options.js.map +1 -0
  364. package/src/lib/hooks/use-leaf-drag.d.ts +24 -0
  365. package/src/lib/hooks/use-leaf-drag.js +28 -0
  366. package/src/lib/hooks/use-leaf-drag.js.map +1 -0
  367. package/src/lib/hooks/use-leaf-drop.d.ts +31 -0
  368. package/src/lib/hooks/use-leaf-drop.js +43 -0
  369. package/src/lib/hooks/use-leaf-drop.js.map +1 -0
  370. package/src/lib/hooks/use-markdown-media-picker.d.ts +63 -0
  371. package/src/lib/hooks/use-markdown-media-picker.js +110 -0
  372. package/src/lib/hooks/use-markdown-media-picker.js.map +1 -0
  373. package/src/lib/hooks/use-media-asset-facts-overlay.d.ts +43 -0
  374. package/src/lib/hooks/use-media-asset-facts-overlay.js +133 -0
  375. package/src/lib/hooks/use-media-asset-facts-overlay.js.map +1 -0
  376. package/src/lib/hooks/use-move-node-callbacks.d.ts +22 -0
  377. package/src/lib/hooks/use-move-node-callbacks.js +57 -0
  378. package/src/lib/hooks/use-move-node-callbacks.js.map +1 -0
  379. package/src/lib/hooks/use-node-with-host-tokens.d.ts +42 -0
  380. package/src/lib/hooks/use-node-with-host-tokens.js +59 -0
  381. package/src/lib/hooks/use-node-with-host-tokens.js.map +1 -0
  382. package/src/lib/hooks/use-picker-filter.d.ts +61 -0
  383. package/src/lib/hooks/use-picker-filter.js +122 -0
  384. package/src/lib/hooks/use-picker-filter.js.map +1 -0
  385. package/src/lib/hooks/use-repeat-preview.d.ts +64 -0
  386. package/src/lib/hooks/use-repeat-preview.js +214 -0
  387. package/src/lib/hooks/use-repeat-preview.js.map +1 -0
  388. package/src/lib/hooks/use-repeat-sources.d.ts +17 -0
  389. package/src/lib/hooks/use-repeat-sources.js +41 -0
  390. package/src/lib/hooks/use-repeat-sources.js.map +1 -0
  391. package/src/lib/hooks/use-visible-component-categories.d.ts +37 -0
  392. package/src/lib/hooks/use-visible-component-categories.js +79 -0
  393. package/src/lib/hooks/use-visible-component-categories.js.map +1 -0
  394. package/src/lib/utils/active-host-theme.d.ts +28 -0
  395. package/src/lib/utils/active-host-theme.js +77 -0
  396. package/src/lib/utils/active-host-theme.js.map +1 -0
  397. package/src/lib/utils/attr-target.d.ts +170 -0
  398. package/src/lib/utils/attr-target.js +229 -0
  399. package/src/lib/utils/attr-target.js.map +1 -0
  400. package/src/lib/utils/attribute-field-value.d.ts +21 -0
  401. package/src/lib/utils/attribute-field-value.js +28 -0
  402. package/src/lib/utils/attribute-field-value.js.map +1 -0
  403. package/src/lib/utils/canvas-context-menu.d.ts +28 -0
  404. package/src/lib/utils/canvas-context-menu.js +56 -0
  405. package/src/lib/utils/canvas-context-menu.js.map +1 -0
  406. package/src/lib/utils/canvas-reveal.d.ts +115 -0
  407. package/src/lib/utils/canvas-reveal.js +165 -0
  408. package/src/lib/utils/canvas-reveal.js.map +1 -0
  409. package/src/lib/utils/describe-element.d.ts +72 -0
  410. package/src/lib/utils/describe-element.js +159 -0
  411. package/src/lib/utils/describe-element.js.map +1 -0
  412. package/src/lib/utils/device-preview-styles.d.ts +89 -0
  413. package/src/lib/utils/device-preview-styles.js +228 -0
  414. package/src/lib/utils/device-preview-styles.js.map +1 -0
  415. package/src/lib/utils/docs-help.d.ts +22 -0
  416. package/src/lib/utils/docs-help.generated.d.ts +47 -0
  417. package/src/lib/utils/docs-help.generated.js +229 -0
  418. package/src/lib/utils/docs-help.generated.js.map +1 -0
  419. package/src/lib/utils/docs-help.js +37 -0
  420. package/src/lib/utils/docs-help.js.map +1 -0
  421. package/src/lib/utils/held-answers-store.d.ts +59 -0
  422. package/src/lib/utils/held-answers-store.js +94 -0
  423. package/src/lib/utils/held-answers-store.js.map +1 -0
  424. package/src/lib/utils/in-place-edit-surface.d.ts +118 -0
  425. package/src/lib/utils/in-place-edit-surface.js +164 -0
  426. package/src/lib/utils/in-place-edit-surface.js.map +1 -0
  427. package/src/lib/utils/inline-markdown-edit.store.d.ts +71 -0
  428. package/src/lib/utils/inline-markdown-edit.store.js +90 -0
  429. package/src/lib/utils/inline-markdown-edit.store.js.map +1 -0
  430. package/src/lib/utils/inline-text-edit.store.d.ts +85 -0
  431. package/src/lib/utils/inline-text-edit.store.js +78 -0
  432. package/src/lib/utils/inline-text-edit.store.js.map +1 -0
  433. package/src/lib/utils/instance-leaf-hit.d.ts +39 -0
  434. package/src/lib/utils/instance-leaf-hit.js +56 -0
  435. package/src/lib/utils/instance-leaf-hit.js.map +1 -0
  436. package/src/lib/utils/muted-classes.d.ts +76 -0
  437. package/src/lib/utils/muted-classes.js +108 -0
  438. package/src/lib/utils/muted-classes.js.map +1 -0
  439. package/src/lib/utils/muted-styles.d.ts +125 -0
  440. package/src/lib/utils/muted-styles.js +193 -0
  441. package/src/lib/utils/muted-styles.js.map +1 -0
  442. package/src/lib/utils/numeric-text-value.d.ts +42 -0
  443. package/src/lib/utils/numeric-text-value.js +47 -0
  444. package/src/lib/utils/numeric-text-value.js.map +1 -0
  445. package/src/lib/utils/preset-interactions.d.ts +37 -0
  446. package/src/lib/utils/preset-interactions.js +87 -0
  447. package/src/lib/utils/preset-interactions.js.map +1 -0
  448. package/src/lib/utils/publish-failure-message.d.ts +35 -0
  449. package/src/lib/utils/publish-failure-message.js +51 -0
  450. package/src/lib/utils/publish-failure-message.js.map +1 -0
  451. package/src/lib/utils/rank-picker-results.d.ts +45 -0
  452. package/src/lib/utils/rank-picker-results.js +136 -0
  453. package/src/lib/utils/rank-picker-results.js.map +1 -0
  454. package/src/lib/utils/responsive-sx.d.ts +65 -0
  455. package/src/lib/utils/responsive-sx.js +129 -0
  456. package/src/lib/utils/responsive-sx.js.map +1 -0
  457. package/src/lib/utils/rich-text-commands.d.ts +28 -0
  458. package/src/lib/utils/rich-text-commands.js +43 -0
  459. package/src/lib/utils/rich-text-commands.js.map +1 -0
  460. package/src/lib/utils/sanitize-rich-text.d.ts +52 -0
  461. package/src/lib/utils/sanitize-rich-text.js +173 -0
  462. package/src/lib/utils/sanitize-rich-text.js.map +1 -0
  463. package/src/lib/utils/state-sx.d.ts +255 -0
  464. package/src/lib/utils/state-sx.js +338 -0
  465. package/src/lib/utils/state-sx.js.map +1 -0
  466. package/src/lib/utils/style-field-groups.d.ts +136 -0
  467. package/src/lib/utils/style-field-groups.js +874 -0
  468. package/src/lib/utils/style-field-groups.js.map +1 -0
  469. package/src/lib/utils/style-field-search.d.ts +84 -0
  470. package/src/lib/utils/style-field-search.js +505 -0
  471. package/src/lib/utils/style-field-search.js.map +1 -0
  472. package/src/lib/utils/style-target.d.ts +69 -0
  473. package/src/lib/utils/style-target.js +203 -0
  474. package/src/lib/utils/style-target.js.map +1 -0
  475. package/src/lib/utils/theme-scale-options.d.ts +169 -0
  476. package/src/lib/utils/theme-scale-options.js +702 -0
  477. package/src/lib/utils/theme-scale-options.js.map +1 -0
  478. package/src/lib/utils/token-editable-dom.d.ts +82 -0
  479. package/src/lib/utils/token-editable-dom.js +280 -0
  480. package/src/lib/utils/token-editable-dom.js.map +1 -0
  481. package/src/lib/utils/token-segments.d.ts +111 -0
  482. package/src/lib/utils/token-segments.js +246 -0
  483. package/src/lib/utils/token-segments.js.map +1 -0
  484. package/src/lib/utils/visibility-styles.d.ts +38 -0
  485. package/src/lib/utils/visibility-styles.js +54 -0
  486. package/src/lib/utils/visibility-styles.js.map +1 -0
@@ -0,0 +1,347 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @license
4
+ * Copyright 2026 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import { buildCssMeasurement, CssUnit, isGlobalUnit, parseCssMeasurement } from "@aglyn/shared-data-enums";
18
+ import { HelpTip } from "@aglyn/shared-ui-jsx";
19
+ import { Box, Input, ListSubheader, MenuItem, Select, Stack, Typography } from "@mui/material";
20
+ import { useCallback, useMemo, useState } from "react";
21
+ import { besignerDocsUrl } from "../../utils/docs-help.js";
22
+ import { findSpacingStep, isSpacingSet, isThemeSpacingStep, spacingDisplayText, UNIT_GLOSS, UNIT_GROUPS, unitDocsAnchor } from "../spacing-value.js";
23
+ /**
24
+ * The editor behind one side of the box (AGL-2486, item 5).
25
+ *
26
+ * The control it replaces was a number box with a unit menu and nothing
27
+ * else, so the only answer an author could give was a flattened CSS
28
+ * length. Two consequences followed: the theme's spacing ladder was
29
+ * unreachable from the one panel that most needs it, and a step an author
30
+ * already had — every `Box`, `Paper` and section preset ships numeric
31
+ * padding — read back as blank, because `parseCssMeasurement` rejects a
32
+ * number outright.
33
+ *
34
+ * So the primary control is now the ladder, named in words rather than in
35
+ * CSS, and a custom amount is the deliberate second choice rather than the
36
+ * only one. Which mode is showing is DERIVED from the stored value (a
37
+ * string is a custom amount, a number is a step) with a latch that only
38
+ * ever opens custom mode — a remembered mode goes stale the moment the
39
+ * selection moves to another element.
40
+ */ /** The sentinel the select uses for "no value at all". */ const UNSET = '__unset__';
41
+ /** The sentinel that reveals the number + unit pair. */ const CUSTOM = '__custom__';
42
+ /**
43
+ * `auto`, which is its own select value AND the string that gets stored —
44
+ * unlike the two sentinels above, which stand for something else.
45
+ */ const AUTO = 'auto';
46
+ /** Whether the stored value is the `auto` keyword. */ const isAutoValue = (value)=>typeof value === 'string' && value.trim().toLowerCase() === AUTO;
47
+ export const SpacingEditor = (props)=>{
48
+ var _ref;
49
+ const { value, steps, label, allowAuto, onChange } = props;
50
+ const ladder = steps != null ? steps : [];
51
+ /**
52
+ * `auto`, when this side offers it, is a LIST answer rather than a
53
+ * custom amount — otherwise picking it from the list would immediately
54
+ * read back as "Custom amount…", since it is a string like any other.
55
+ */ const isAuto = Boolean(allowAuto) && isAutoValue(value);
56
+ // A string value IS custom; the latch only adds the case where the
57
+ // author asked for custom mode while the stored value is still a step.
58
+ const [customLatch, setCustomLatch] = useState(false);
59
+ const isCustom = customLatch || isSpacingSet(value) && !isThemeSpacingStep(value) && !isAuto;
60
+ const parsed = useMemo(()=>parseCssMeasurement(typeof value === 'string' ? value : undefined), [
61
+ value
62
+ ]);
63
+ /**
64
+ * A step the ladder has no rung for still has to be SELECTABLE.
65
+ *
66
+ * `p: 10` is an ordinary thing to find on a hero, and 10 is not on the
67
+ * ladder. Without an option carrying that value the select rendered
68
+ * blank — the control claimed the side was unset while the diagram
69
+ * beside it read `80px`, and the next pick would have quietly replaced
70
+ * a value the author never saw. So the stored step is offered as its
71
+ * own entry when the ladder does not already contain it.
72
+ */ const offLadderStep = isThemeSpacingStep(value) && !findSpacingStep(value, ladder) ? {
73
+ value: value,
74
+ hint: spacingDisplayText(value, ladder)
75
+ } : null;
76
+ const selectValue = isCustom ? CUSTOM : isAuto ? AUTO : isThemeSpacingStep(value) ? `${value}` : UNSET;
77
+ const handleSelect = useCallback((next)=>{
78
+ if (next === CUSTOM) {
79
+ setCustomLatch(true);
80
+ return;
81
+ }
82
+ setCustomLatch(false);
83
+ if (next === UNSET) {
84
+ onChange == null ? void 0 : onChange(undefined);
85
+ return;
86
+ }
87
+ // `auto` is a KEYWORD, not an amount, and it has to be emitted as
88
+ // the string CSS expects. It also has to return HERE: `Number('auto')`
89
+ // is NaN, so the step branch below would emit `undefined` and
90
+ // silently clear the side the author had just set.
91
+ if (next === AUTO) {
92
+ onChange == null ? void 0 : onChange(AUTO);
93
+ return;
94
+ }
95
+ // The STEP, as a number — MUI multiplies it by `theme.spacing` at
96
+ // render, which is the entire reason this control exists. `0` is a
97
+ // real rung ("None") and must survive: `Number('0')` is 0 and
98
+ // `Number.isFinite(0)` is true, so it does.
99
+ const step = Number(next);
100
+ onChange == null ? void 0 : onChange(Number.isFinite(step) ? step : undefined);
101
+ }, [
102
+ onChange
103
+ ]);
104
+ const emitCustom = useCallback((quantity, unit)=>{
105
+ if (!unit) {
106
+ // No unit is not a length. Clearing is the honest reading — the
107
+ // old control silently emitted `undefined` here too, but by
108
+ // accident rather than on purpose.
109
+ onChange == null ? void 0 : onChange(undefined);
110
+ return;
111
+ }
112
+ if (isGlobalUnit(unit)) {
113
+ onChange == null ? void 0 : onChange(`${unit}`);
114
+ return;
115
+ }
116
+ const text = `${quantity}`.trim();
117
+ if (text === '') {
118
+ onChange == null ? void 0 : onChange(undefined);
119
+ return;
120
+ }
121
+ const numeric = Number(text);
122
+ if (!Number.isFinite(numeric)) {
123
+ onChange == null ? void 0 : onChange(undefined);
124
+ return;
125
+ }
126
+ // `buildCssMeasurement` keeps `0` (its guard is `_isNum`, not
127
+ // truthiness), so `0px` is emitted rather than swallowed.
128
+ onChange == null ? void 0 : onChange(buildCssMeasurement({
129
+ value: numeric,
130
+ unit
131
+ }));
132
+ }, [
133
+ onChange
134
+ ]);
135
+ const currentUnit = (_ref = parsed == null ? void 0 : parsed.unit) != null ? _ref : '';
136
+ const currentQuantity = (parsed == null ? void 0 : parsed.value) === undefined || (parsed == null ? void 0 : parsed.value) === null ? '' : `${parsed.value}`;
137
+ return /*#__PURE__*/ _jsxs(Stack, {
138
+ spacing: 1,
139
+ sx: {
140
+ mt: 1
141
+ },
142
+ children: [
143
+ /*#__PURE__*/ _jsxs(Select, {
144
+ size: "small",
145
+ value: selectValue,
146
+ onChange: (event)=>handleSelect(`${event.target.value}`),
147
+ inputProps: {
148
+ 'aria-label': `${label} value`
149
+ },
150
+ sx: {
151
+ fontSize: '0.78rem'
152
+ },
153
+ children: [
154
+ /*#__PURE__*/ _jsx(MenuItem, {
155
+ value: UNSET,
156
+ children: /*#__PURE__*/ _jsx("em", {
157
+ children: 'Not set'
158
+ })
159
+ }),
160
+ ladder.length ? /*#__PURE__*/ _jsx(ListSubheader, {
161
+ sx: {
162
+ lineHeight: 2
163
+ },
164
+ children: 'Theme spacing'
165
+ }) : null,
166
+ offLadderStep ? /*#__PURE__*/ _jsxs(MenuItem, {
167
+ value: `${offLadderStep.value}`,
168
+ children: [
169
+ /*#__PURE__*/ _jsx(Box, {
170
+ component: "span",
171
+ sx: {
172
+ flex: 1
173
+ },
174
+ children: `${offLadderStep.value}× the spacing unit`
175
+ }),
176
+ /*#__PURE__*/ _jsx(Typography, {
177
+ component: "span",
178
+ variant: "caption",
179
+ sx: {
180
+ color: 'text.secondary',
181
+ ml: 1
182
+ },
183
+ children: offLadderStep.hint
184
+ })
185
+ ]
186
+ }) : null,
187
+ ladder.map((step)=>/*#__PURE__*/ _jsxs(MenuItem, {
188
+ value: `${step.value}`,
189
+ children: [
190
+ /*#__PURE__*/ _jsx(Box, {
191
+ component: "span",
192
+ sx: {
193
+ flex: 1
194
+ },
195
+ children: step.label
196
+ }),
197
+ /*#__PURE__*/ _jsx(Typography, {
198
+ component: "span",
199
+ variant: "caption",
200
+ sx: {
201
+ color: 'text.secondary',
202
+ ml: 1
203
+ },
204
+ children: step.hint
205
+ })
206
+ ]
207
+ }, step.value)),
208
+ allowAuto ? /*#__PURE__*/ _jsx(ListSubheader, {
209
+ sx: {
210
+ lineHeight: 2
211
+ },
212
+ children: 'Automatic'
213
+ }) : null,
214
+ allowAuto ? /*#__PURE__*/ _jsxs(MenuItem, {
215
+ value: AUTO,
216
+ children: [
217
+ /*#__PURE__*/ _jsx(Box, {
218
+ component: "span",
219
+ sx: {
220
+ flex: 1
221
+ },
222
+ children: 'Auto'
223
+ }),
224
+ /*#__PURE__*/ _jsx(Typography, {
225
+ component: "span",
226
+ variant: "caption",
227
+ sx: {
228
+ color: 'text.secondary',
229
+ ml: 1
230
+ },
231
+ children: UNIT_GLOSS[CssUnit.AUTO]
232
+ })
233
+ ]
234
+ }) : null,
235
+ /*#__PURE__*/ _jsx(ListSubheader, {
236
+ sx: {
237
+ lineHeight: 2
238
+ },
239
+ children: 'Exact amount'
240
+ }),
241
+ /*#__PURE__*/ _jsx(MenuItem, {
242
+ value: CUSTOM,
243
+ children: 'Custom amount…'
244
+ })
245
+ ]
246
+ }),
247
+ isCustom ? /*#__PURE__*/ _jsxs(Stack, {
248
+ direction: "row",
249
+ spacing: 1,
250
+ sx: {
251
+ alignItems: 'center'
252
+ },
253
+ children: [
254
+ /*#__PURE__*/ _jsx(Input, {
255
+ value: currentQuantity,
256
+ type: "number",
257
+ placeholder: "0",
258
+ disabled: Boolean(currentUnit) && isGlobalUnit(currentUnit),
259
+ inputProps: {
260
+ 'aria-label': `${label} amount`
261
+ },
262
+ onChange: (event)=>emitCustom(event.target.value, currentUnit || CssUnit.PIXELS),
263
+ sx: {
264
+ width: 72,
265
+ fontSize: '0.78rem'
266
+ }
267
+ }),
268
+ /*#__PURE__*/ _jsx(Select, {
269
+ size: "small",
270
+ displayEmpty: true,
271
+ value: currentUnit,
272
+ onChange: (event)=>emitCustom(currentQuantity, event.target.value),
273
+ inputProps: {
274
+ 'aria-label': `${label} unit`
275
+ },
276
+ renderValue: (unit)=>unit ? `${unit}` : 'unit',
277
+ sx: {
278
+ fontSize: '0.78rem',
279
+ minWidth: 88
280
+ },
281
+ children: UNIT_GROUPS.flatMap((group)=>[
282
+ /*#__PURE__*/ _jsx(ListSubheader, {
283
+ sx: {
284
+ lineHeight: 2
285
+ },
286
+ children: group.label
287
+ }, group.label),
288
+ ...group.units.map((unit)=>{
289
+ var _UNIT_GLOSS_unit;
290
+ return /*#__PURE__*/ _jsxs(MenuItem, {
291
+ value: unit,
292
+ children: [
293
+ /*#__PURE__*/ _jsxs(Box, {
294
+ component: "span",
295
+ sx: {
296
+ flex: 1,
297
+ minWidth: 0
298
+ },
299
+ children: [
300
+ /*#__PURE__*/ _jsx(Typography, {
301
+ component: "span",
302
+ variant: "body2",
303
+ children: unit
304
+ }),
305
+ /*#__PURE__*/ _jsx(Typography, {
306
+ component: "span",
307
+ variant: "caption",
308
+ sx: {
309
+ color: 'text.secondary',
310
+ ml: 1
311
+ },
312
+ children: UNIT_GLOSS[unit]
313
+ })
314
+ ]
315
+ }),
316
+ /*#__PURE__*/ _jsx(HelpTip, {
317
+ title: `The ${unit} unit`,
318
+ excerpt: (_UNIT_GLOSS_unit = UNIT_GLOSS[unit]) != null ? _UNIT_GLOSS_unit : 'A CSS unit.',
319
+ href: besignerDocsUrl('responsiveStyling', unitDocsAnchor(unit)),
320
+ ariaLabel: `What is ${unit}?`,
321
+ onClick: (event)=>event.stopPropagation(),
322
+ sx: {
323
+ ml: 1,
324
+ fontSize: '0.9em'
325
+ }
326
+ })
327
+ ]
328
+ }, unit);
329
+ })
330
+ ])
331
+ }),
332
+ /*#__PURE__*/ _jsx(HelpTip, {
333
+ title: "Steps or exact amounts",
334
+ excerpt: "A theme spacing step keeps following your theme; an exact amount is pinned forever. Units decide what the number is measured against.",
335
+ href: besignerDocsUrl('responsiveStyling', '#spacing-units'),
336
+ sx: {
337
+ fontSize: '0.9em'
338
+ }
339
+ })
340
+ ]
341
+ }) : null
342
+ ]
343
+ });
344
+ };
345
+ export default SpacingEditor;
346
+
347
+ //# sourceMappingURL=spacing-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../libs/besigner/feature/designer/src/lib/box-styler/components/spacing-editor.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n buildCssMeasurement,\n CssUnit,\n isGlobalUnit,\n parseCssMeasurement,\n} from '@aglyn/shared-data-enums'\nimport { HelpTip } from '@aglyn/shared-ui-jsx'\nimport {\n Box,\n Input,\n ListSubheader,\n MenuItem,\n Select,\n Stack,\n Typography,\n} from '@mui/material'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport { besignerDocsUrl } from '../../utils/docs-help'\nimport type { SpacingScaleOption } from '../../utils/theme-scale-options'\nimport {\n type BoxSpacingValue,\n findSpacingStep,\n isSpacingSet,\n isThemeSpacingStep,\n spacingDisplayText,\n UNIT_GLOSS,\n UNIT_GROUPS,\n unitDocsAnchor,\n} from '../spacing-value'\n\n/**\n * The editor behind one side of the box (AGL-2486, item 5).\n *\n * The control it replaces was a number box with a unit menu and nothing\n * else, so the only answer an author could give was a flattened CSS\n * length. Two consequences followed: the theme's spacing ladder was\n * unreachable from the one panel that most needs it, and a step an author\n * already had — every `Box`, `Paper` and section preset ships numeric\n * padding — read back as blank, because `parseCssMeasurement` rejects a\n * number outright.\n *\n * So the primary control is now the ladder, named in words rather than in\n * CSS, and a custom amount is the deliberate second choice rather than the\n * only one. Which mode is showing is DERIVED from the stored value (a\n * string is a custom amount, a number is a step) with a latch that only\n * ever opens custom mode — a remembered mode goes stale the moment the\n * selection moves to another element.\n */\n\n/** The sentinel the select uses for \"no value at all\". */\nconst UNSET = '__unset__'\n/** The sentinel that reveals the number + unit pair. */\nconst CUSTOM = '__custom__'\n/**\n * `auto`, which is its own select value AND the string that gets stored —\n * unlike the two sentinels above, which stand for something else.\n */\nconst AUTO = 'auto'\n\n/** Whether the stored value is the `auto` keyword. */\nconst isAutoValue = (value: BoxSpacingValue) =>\n typeof value === 'string' && value.trim().toLowerCase() === AUTO\n\nexport interface SpacingEditorProps {\n /** The side's stored value: a theme step, a CSS string, or nothing. */\n value: BoxSpacingValue\n /** The theme's spacing ladder; empty leaves custom amounts only. */\n steps?: readonly SpacingScaleOption[]\n /** Accessible name for the pair, e.g. `Space inside — top`. */\n label: string\n /**\n * Whether `auto` belongs in the list for this side (decided:\n * \"let's add the auto to this option list as well instead of only in\n * the custom amount\").\n *\n * It is a per-SIDE question, not a preference. `margin: auto` is the\n * standard way to centre an element and the diagram already displays it\n * on the left and right margins; `padding: auto` is not valid CSS, and\n * the browser drops the declaration — so offering it on a padding side\n * would be a menu entry that does nothing and reports nothing, which is\n * worse than not offering it. The caller answers per side rather than\n * this component guessing from `label`, which is display copy.\n *\n * `auto` reachable through Custom amount → the `auto` unit is what this\n * replaces as the ONLY route; that route still exists and still works,\n * and a padding side that somehow holds `auto` still shows it there\n * rather than pretending the side is unset.\n */\n allowAuto?: boolean\n /**\n * Emits the value to STORE.\n *\n * `undefined` means remove the property. A number is a theme step. A\n * string is a finished CSS length — never a bare number as a string,\n * which MUI would pass through and the browser would drop.\n */\n onChange?: (value: BoxSpacingValue) => void\n}\n\nexport const SpacingEditor = (props: SpacingEditorProps) => {\n const { value, steps, label, allowAuto, onChange } = props\n const ladder = steps ?? []\n\n /**\n * `auto`, when this side offers it, is a LIST answer rather than a\n * custom amount — otherwise picking it from the list would immediately\n * read back as \"Custom amount…\", since it is a string like any other.\n */\n const isAuto = Boolean(allowAuto) && isAutoValue(value)\n\n // A string value IS custom; the latch only adds the case where the\n // author asked for custom mode while the stored value is still a step.\n const [customLatch, setCustomLatch] = useState(false)\n const isCustom =\n customLatch ||\n (isSpacingSet(value) && !isThemeSpacingStep(value) && !isAuto)\n\n const parsed = useMemo(\n () => parseCssMeasurement(typeof value === 'string' ? value : undefined),\n [value],\n )\n\n /**\n * A step the ladder has no rung for still has to be SELECTABLE.\n *\n * `p: 10` is an ordinary thing to find on a hero, and 10 is not on the\n * ladder. Without an option carrying that value the select rendered\n * blank — the control claimed the side was unset while the diagram\n * beside it read `80px`, and the next pick would have quietly replaced\n * a value the author never saw. So the stored step is offered as its\n * own entry when the ladder does not already contain it.\n */\n const offLadderStep =\n isThemeSpacingStep(value) && !findSpacingStep(value, ladder)\n ? { value: value as number, hint: spacingDisplayText(value, ladder) }\n : null\n\n const selectValue = isCustom\n ? CUSTOM\n : isAuto\n ? AUTO\n : isThemeSpacingStep(value)\n ? `${value}`\n : UNSET\n\n const handleSelect = useCallback(\n (next: string) => {\n if (next === CUSTOM) {\n setCustomLatch(true)\n return\n }\n setCustomLatch(false)\n if (next === UNSET) {\n onChange?.(undefined)\n return\n }\n // `auto` is a KEYWORD, not an amount, and it has to be emitted as\n // the string CSS expects. It also has to return HERE: `Number('auto')`\n // is NaN, so the step branch below would emit `undefined` and\n // silently clear the side the author had just set.\n if (next === AUTO) {\n onChange?.(AUTO)\n return\n }\n // The STEP, as a number — MUI multiplies it by `theme.spacing` at\n // render, which is the entire reason this control exists. `0` is a\n // real rung (\"None\") and must survive: `Number('0')` is 0 and\n // `Number.isFinite(0)` is true, so it does.\n const step = Number(next)\n onChange?.(Number.isFinite(step) ? step : undefined)\n },\n [onChange],\n )\n\n const emitCustom = useCallback(\n (quantity: string, unit: CssUnit | '') => {\n if (!unit) {\n // No unit is not a length. Clearing is the honest reading — the\n // old control silently emitted `undefined` here too, but by\n // accident rather than on purpose.\n onChange?.(undefined)\n return\n }\n if (isGlobalUnit(unit)) {\n onChange?.(`${unit}`)\n return\n }\n const text = `${quantity}`.trim()\n if (text === '') {\n onChange?.(undefined)\n return\n }\n const numeric = Number(text)\n if (!Number.isFinite(numeric)) {\n onChange?.(undefined)\n return\n }\n // `buildCssMeasurement` keeps `0` (its guard is `_isNum`, not\n // truthiness), so `0px` is emitted rather than swallowed.\n onChange?.(buildCssMeasurement({ value: numeric, unit }))\n },\n [onChange],\n )\n\n const currentUnit = (parsed?.unit ?? '') as CssUnit | ''\n const currentQuantity =\n parsed?.value === undefined || parsed?.value === null\n ? ''\n : `${parsed.value}`\n\n return (\n <Stack spacing={1} sx={{ mt: 1 }}>\n <Select\n size=\"small\"\n value={selectValue}\n onChange={(event) => handleSelect(`${event.target.value}`)}\n inputProps={{ 'aria-label': `${label} value` }}\n sx={{ fontSize: '0.78rem' }}\n >\n <MenuItem value={UNSET}>\n <em>{'Not set'}</em>\n </MenuItem>\n {ladder.length ? (\n <ListSubheader sx={{ lineHeight: 2 }}>\n {'Theme spacing'}\n </ListSubheader>\n ) : null}\n {offLadderStep ? (\n <MenuItem value={`${offLadderStep.value}`}>\n <Box component=\"span\" sx={{ flex: 1 }}>\n {`${offLadderStep.value}× the spacing unit`}\n </Box>\n <Typography\n component=\"span\"\n variant=\"caption\"\n sx={{ color: 'text.secondary', ml: 1 }}\n >\n {offLadderStep.hint}\n </Typography>\n </MenuItem>\n ) : null}\n {ladder.map((step) => (\n <MenuItem key={step.value} value={`${step.value}`}>\n <Box component=\"span\" sx={{ flex: 1 }}>\n {step.label}\n </Box>\n <Typography\n component=\"span\"\n variant=\"caption\"\n sx={{ color: 'text.secondary', ml: 1 }}\n >\n {step.hint}\n </Typography>\n </MenuItem>\n ))}\n {/* Its own group, because `auto` is not a size — listing it among\n the rungs would put \"let the browser decide\" in a ladder of\n amounts. `Not set` (no property at all), `None` (0px) and\n `Auto` are three different answers and the list has to keep\n them apart. The gloss is the shared one the unit menu shows\n for the same keyword, so the two cannot drift. */}\n {allowAuto ? (\n <ListSubheader sx={{ lineHeight: 2 }}>{'Automatic'}</ListSubheader>\n ) : null}\n {allowAuto ? (\n <MenuItem value={AUTO}>\n <Box component=\"span\" sx={{ flex: 1 }}>\n {'Auto'}\n </Box>\n <Typography\n component=\"span\"\n variant=\"caption\"\n sx={{ color: 'text.secondary', ml: 1 }}\n >\n {UNIT_GLOSS[CssUnit.AUTO]}\n </Typography>\n </MenuItem>\n ) : null}\n <ListSubheader sx={{ lineHeight: 2 }}>{'Exact amount'}</ListSubheader>\n <MenuItem value={CUSTOM}>{'Custom amount…'}</MenuItem>\n </Select>\n\n {isCustom ? (\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <Input\n value={currentQuantity}\n type=\"number\"\n placeholder=\"0\"\n disabled={\n Boolean(currentUnit) && isGlobalUnit(currentUnit as CssUnit)\n }\n inputProps={{ 'aria-label': `${label} amount` }}\n onChange={(event) =>\n emitCustom(event.target.value, currentUnit || CssUnit.PIXELS)\n }\n sx={{ width: 72, fontSize: '0.78rem' }}\n />\n <Select\n size=\"small\"\n displayEmpty\n value={currentUnit}\n onChange={(event) =>\n emitCustom(currentQuantity, event.target.value as CssUnit | '')\n }\n inputProps={{ 'aria-label': `${label} unit` }}\n renderValue={(unit) => (unit ? `${unit}` : 'unit')}\n sx={{ fontSize: '0.78rem', minWidth: 88 }}\n >\n {UNIT_GROUPS.flatMap((group) => [\n <ListSubheader key={group.label} sx={{ lineHeight: 2 }}>\n {group.label}\n </ListSubheader>,\n ...group.units.map((unit) => (\n <MenuItem key={unit} value={unit}>\n <Box component=\"span\" sx={{ flex: 1, minWidth: 0 }}>\n <Typography component=\"span\" variant=\"body2\">\n {unit}\n </Typography>\n <Typography\n component=\"span\"\n variant=\"caption\"\n sx={{ color: 'text.secondary', ml: 1 }}\n >\n {UNIT_GLOSS[unit]}\n </Typography>\n </Box>\n {/* Every unit carries its own docs section (AGL-2486):\n this menu is the one place an author meets the\n question \"what is `ch`?\", so it is where the answer\n has to be. `onClick` stops the tip from also\n selecting the row it sits in. */}\n <HelpTip\n title={`The ${unit} unit`}\n excerpt={UNIT_GLOSS[unit] ?? 'A CSS unit.'}\n href={besignerDocsUrl(\n 'responsiveStyling',\n unitDocsAnchor(unit),\n )}\n ariaLabel={`What is ${unit}?`}\n onClick={(event) => event.stopPropagation()}\n sx={{ ml: 1, fontSize: '0.9em' }}\n />\n </MenuItem>\n )),\n ])}\n </Select>\n <HelpTip\n title=\"Steps or exact amounts\"\n excerpt=\"A theme spacing step keeps following your theme; an exact amount is pinned forever. Units decide what the number is measured against.\"\n href={besignerDocsUrl('responsiveStyling', '#spacing-units')}\n sx={{ fontSize: '0.9em' }}\n />\n </Stack>\n ) : null}\n </Stack>\n )\n}\n\nexport default SpacingEditor\n"],"names":["buildCssMeasurement","CssUnit","isGlobalUnit","parseCssMeasurement","HelpTip","Box","Input","ListSubheader","MenuItem","Select","Stack","Typography","useCallback","useMemo","useState","besignerDocsUrl","findSpacingStep","isSpacingSet","isThemeSpacingStep","spacingDisplayText","UNIT_GLOSS","UNIT_GROUPS","unitDocsAnchor","UNSET","CUSTOM","AUTO","isAutoValue","value","trim","toLowerCase","SpacingEditor","props","steps","label","allowAuto","onChange","ladder","isAuto","Boolean","customLatch","setCustomLatch","isCustom","parsed","undefined","offLadderStep","hint","selectValue","handleSelect","next","step","Number","isFinite","emitCustom","quantity","unit","text","numeric","currentUnit","currentQuantity","spacing","sx","mt","size","event","target","inputProps","fontSize","em","length","lineHeight","component","flex","variant","color","ml","map","direction","alignItems","type","placeholder","disabled","PIXELS","width","displayEmpty","renderValue","minWidth","flatMap","group","units","title","excerpt","href","ariaLabel","onClick","stopPropagation"],"mappings":"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"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export declare const classKeys: import("@aglyn/shared-ui-theme").ClassKeyMap<"border" | "margin" | "padding" | "label" | "row" | "contents" | "box" | "legendItem" | "legendSwatch" | "legendLabel", "BoxStyler">;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { generateComponentClassKeys } from "@aglyn/shared-ui-theme";
17
+ export const classKeys = generateComponentClassKeys('BoxStyler', [
18
+ 'box',
19
+ 'row',
20
+ 'label',
21
+ 'margin',
22
+ 'border',
23
+ 'padding',
24
+ 'contents',
25
+ 'legendItem',
26
+ 'legendSwatch',
27
+ 'legendLabel'
28
+ ]);
29
+
30
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/box-styler/constants.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generateComponentClassKeys } from '@aglyn/shared-ui-theme'\n\nexport const classKeys = generateComponentClassKeys('BoxStyler', [\n 'box',\n 'row',\n 'label',\n 'margin',\n 'border',\n 'padding',\n 'contents',\n 'legendItem',\n 'legendSwatch',\n 'legendLabel',\n])\n"],"names":["generateComponentClassKeys","classKeys"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,0BAA0B,QAAQ,yBAAwB;AAEnE,OAAO,MAAMC,YAAYD,2BAA2B,aAAa;IAC/D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,EAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './box-styler';
2
+ export * from './spacing-value';
@@ -0,0 +1,4 @@
1
+ export * from "./box-styler.js";
2
+ export * from "./spacing-value.js";
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/box-styler/index.ts"],"sourcesContent":["export * from './box-styler'\nexport * from './spacing-value'\n"],"names":[],"mappings":"AAAA,cAAc,kBAAc;AAC5B,cAAc,qBAAiB"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * The four region materials of the box diagram, defined ONCE (AGL-2486).
19
+ *
20
+ * Two reasons this is not inline in the component.
21
+ *
22
+ * **The legend has to be readable.** Four abstract swatches beside a textured
23
+ * diagram is a puzzle. A swatch painted with the *same* declaration as the
24
+ * region it names needs no decoding — so the diagram and the legend both read
25
+ * their fills from here, and the two cannot drift.
26
+ *
27
+ * **Dark mode has to come from the theme.** Every value below is a palette
28
+ * TOKEN or a channel form of one, never a literal, so the console's
29
+ * `colorSchemeSelector: 'class'` CSS variables re-resolve them when the
30
+ * scheme flips. That is also what keeps this file at zero entries in the
31
+ * hardcoded-colour ratchet, whose baseline may not rise.
32
+ *
33
+ * The texture is deliberate and so is its weight. Stripes and hatching are
34
+ * what tell one region from another; a saturated hue does the same job but
35
+ * shouts over its neighbours, and flat greys leave the regions
36
+ * indistinguishable. So the pattern is carried by `text.primary` at a low
37
+ * alpha rather than by a hue, which reads as material instead of decoration
38
+ * and survives both schemes: `text.primary` is near-black on light and
39
+ * near-white on dark, so the tint always contrasts gently with its ground.
40
+ */
41
+ /** The subset of a theme these fills read (a CSS-vars theme's `vars`). */
42
+ export interface RegionFillTheme {
43
+ palette: {
44
+ text: {
45
+ primary: string;
46
+ primaryChannel: string;
47
+ };
48
+ info: {
49
+ mainChannel: string;
50
+ };
51
+ primary: {
52
+ mainChannel: string;
53
+ };
54
+ secondary: {
55
+ mainChannel: string;
56
+ };
57
+ background: {
58
+ paper: string;
59
+ default: string;
60
+ };
61
+ };
62
+ }
63
+ export interface RegionFill {
64
+ /** `background` shorthand — a texture layer over a ground. */
65
+ background: string;
66
+ /**
67
+ * The ground BEHIND the wedges of this band.
68
+ *
69
+ * The band is drawn as four mitred wedges with a 2px gap between them,
70
+ * and that gap is what makes the diagonal seams at the corners visible —
71
+ * which is the whole reason the shape reads as a frame around something
72
+ * rather than as a plain rectangle. The wedges carry `background`; this
73
+ * shows through between them. The original used `common.black` here,
74
+ * which is what made the seams read as harsh slashes; a low-alpha ink
75
+ * tint gives the same geometry as fine lines instead.
76
+ *
77
+ * **Opaque, like every other value here.** A translucent seam is what
78
+ * put the border band's texture underneath the padding controls: the
79
+ * padding box's ground let the ring's material show straight through
80
+ * it. A region paints its own material and nothing else's, so every
81
+ * ground ends in a `background.*` token and each tint is layered ON it
82
+ * rather than left to composite against whatever happens to be behind.
83
+ */
84
+ seam: string;
85
+ /** The edge drawn around the region. */
86
+ borderColor: string;
87
+ borderStyle: 'dashed' | 'solid';
88
+ }
89
+ export interface RegionFills {
90
+ margin: RegionFill;
91
+ border: RegionFill;
92
+ padding: RegionFill;
93
+ contents: RegionFill;
94
+ /**
95
+ * The side whose editor is open.
96
+ *
97
+ * It lives here rather than in the component because "what colour is a
98
+ * region, in which state" should have one answer in one file — and
99
+ * because this is the value that was wrong: a fully saturated
100
+ * `primary.main` inside a figure built deliberately from low-alpha
101
+ * tints, so the selected wedge was the brightest thing on screen.
102
+ */
103
+ selected: RegionFill & {
104
+ color: string;
105
+ };
106
+ }
107
+ export declare function regionFills(tv: RegionFillTheme): RegionFills;