@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,702 @@
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
+ */ /** `mobileStepper` → `Mobile stepper`. */ function humanizeKey(key) {
17
+ const spaced = key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/[-_]+/g, ' ').trim().toLowerCase();
18
+ return spaced.charAt(0).toUpperCase() + spaced.slice(1);
19
+ }
20
+ /** What a theme value reads as in the hint, or '' when it is not a scalar. */ function hintOf(value) {
21
+ if (typeof value === 'number') return Number.isFinite(value) ? `${value}` : '';
22
+ return typeof value === 'string' ? value : '';
23
+ }
24
+ /**
25
+ * The typography variants offered as font sizes, in the order a type scale
26
+ * is read rather than alphabetically. A variant the theme does not define —
27
+ * or defines without a `fontSize` — is dropped, so a slimmed-down host theme
28
+ * offers only what it really has.
29
+ */ const FONT_SIZE_VARIANTS = [
30
+ {
31
+ key: 'h1',
32
+ label: 'Heading 1'
33
+ },
34
+ {
35
+ key: 'h2',
36
+ label: 'Heading 2'
37
+ },
38
+ {
39
+ key: 'h3',
40
+ label: 'Heading 3'
41
+ },
42
+ {
43
+ key: 'h4',
44
+ label: 'Heading 4'
45
+ },
46
+ {
47
+ key: 'h5',
48
+ label: 'Heading 5'
49
+ },
50
+ {
51
+ key: 'h6',
52
+ label: 'Heading 6'
53
+ },
54
+ {
55
+ key: 'subtitle1',
56
+ label: 'Subtitle 1'
57
+ },
58
+ {
59
+ key: 'subtitle2',
60
+ label: 'Subtitle 2'
61
+ },
62
+ {
63
+ key: 'body1',
64
+ label: 'Body'
65
+ },
66
+ {
67
+ key: 'body2',
68
+ label: 'Body small'
69
+ },
70
+ {
71
+ key: 'button',
72
+ label: 'Button'
73
+ },
74
+ {
75
+ key: 'caption',
76
+ label: 'Caption'
77
+ },
78
+ {
79
+ key: 'overline',
80
+ label: 'Overline'
81
+ }
82
+ ];
83
+ /**
84
+ * Every variant the theme defines, not just the ones MUI ships (AGL-2486).
85
+ *
86
+ * The list above names MUI's own variants in reading order; a host that adds
87
+ * rungs of its own — Aglyn's theme carries `lede`, `bodyCompact` and `micro`
88
+ * for the 17/13/11px steps MUI has no name for — is unreachable from a fixed
89
+ * list, which leaves an author typing the pixels. Discovering the extras keeps
90
+ * the curated order for the familiar ones and appends whatever else the host
91
+ * defined, sorted small to large so the ramp still reads.
92
+ *
93
+ * A variant is anything under `theme.typography` that is an OBJECT carrying a
94
+ * `fontSize`; that skips `fontFamily`, the `fontWeight*` scalars and
95
+ * `pxToRem` without naming them.
96
+ */ function themeTypographyVariants(typography) {
97
+ if (!typography) return [];
98
+ const known = new Set(FONT_SIZE_VARIANTS.map((entry)=>entry.key));
99
+ const extra = [];
100
+ for (const key of Object.keys(typography)){
101
+ if (known.has(key)) continue;
102
+ const value = typography[key];
103
+ if (!value || typeof value !== 'object') continue;
104
+ const size = value.fontSize;
105
+ const parsed = Number.parseFloat(String(size != null ? size : ''));
106
+ if (!Number.isFinite(parsed)) continue;
107
+ extra.push({
108
+ key,
109
+ label: humanizeKey(key),
110
+ size: parsed
111
+ });
112
+ }
113
+ extra.sort((a, b)=>a.size - b.size);
114
+ return [
115
+ ...FONT_SIZE_VARIANTS,
116
+ ...extra.map(({ key, label })=>({
117
+ key,
118
+ label
119
+ }))
120
+ ];
121
+ }
122
+ /** Font sizes from `theme.typography`, e.g. `h4.fontSize` → `2.125rem`. */ export function buildFontSizeScaleOptions(theme) {
123
+ const typography = theme == null ? void 0 : theme.typography;
124
+ if (!typography) return [];
125
+ const options = [];
126
+ for (const { key, label } of themeTypographyVariants(typography)){
127
+ const variant = typography[key];
128
+ if (!variant || typeof variant !== 'object') continue;
129
+ const fontSize = variant['fontSize'];
130
+ const hint = hintOf(fontSize);
131
+ if (!hint) continue;
132
+ options.push({
133
+ value: `${key}.fontSize`,
134
+ label,
135
+ hint
136
+ });
137
+ }
138
+ return options;
139
+ }
140
+ /**
141
+ * The four weights MUI's typography names, then the plain CSS ladder.
142
+ *
143
+ * Both halves are offered because both are real answers: `fontWeightBold`
144
+ * follows a host that decides its bold is 600, while `700` is what an author
145
+ * who wants exactly 700 means. The token entries come first so the
146
+ * theme-following answer is the one in reach.
147
+ */ /**
148
+ * Weight tokens are DISCOVERED, not listed (AGL-2486).
149
+ *
150
+ * Hardcoding MUI's four defaults would hide every weight a host adds to its
151
+ * own ramp — Aglyn's theme carries SemiBold 600, ExtraBold 800 and Black 900 —
152
+ * leaving a raw number as the only way to reach the brand's own weight.
153
+ * Reading the keys off `theme.typography` means any host's ramp shows up with
154
+ * no edit here.
155
+ *
156
+ * Ordered by the weight each resolves to, so the menu reads light → heavy
157
+ * rather than in whatever order the theme object happened to be written.
158
+ */ const FONT_WEIGHT_KEY = /^fontWeight(.+)$/;
159
+ function themeFontWeightTokens(typography) {
160
+ if (!typography) return [];
161
+ const found = [];
162
+ for (const key of Object.keys(typography)){
163
+ const match = FONT_WEIGHT_KEY.exec(key);
164
+ if (!match) continue;
165
+ const raw = typography[key];
166
+ const weight = typeof raw === 'number' ? raw : Number.parseFloat(String(raw != null ? raw : ''));
167
+ if (!Number.isFinite(weight)) continue;
168
+ found.push({
169
+ key,
170
+ label: `${humanizeKey(match[1])} (theme)`,
171
+ weight
172
+ });
173
+ }
174
+ return found.sort((a, b)=>a.weight - b.weight);
175
+ }
176
+ const FONT_WEIGHT_LADDER = [
177
+ {
178
+ value: '100',
179
+ label: 'Thin'
180
+ },
181
+ {
182
+ value: '200',
183
+ label: 'Extra light'
184
+ },
185
+ {
186
+ value: '300',
187
+ label: 'Light'
188
+ },
189
+ {
190
+ value: '400',
191
+ label: 'Regular'
192
+ },
193
+ {
194
+ value: '500',
195
+ label: 'Medium'
196
+ },
197
+ {
198
+ value: '600',
199
+ label: 'Semi bold'
200
+ },
201
+ {
202
+ value: '700',
203
+ label: 'Bold'
204
+ },
205
+ {
206
+ value: '800',
207
+ label: 'Extra bold'
208
+ },
209
+ {
210
+ value: '900',
211
+ label: 'Black'
212
+ }
213
+ ];
214
+ export function buildFontWeightScaleOptions(theme) {
215
+ const typography = theme == null ? void 0 : theme.typography;
216
+ const options = [];
217
+ for (const { key, label } of themeFontWeightTokens(typography)){
218
+ const hint = hintOf(typography ? typography[key] : undefined);
219
+ if (!hint) continue;
220
+ options.push({
221
+ value: key,
222
+ label,
223
+ hint
224
+ });
225
+ }
226
+ for (const entry of FONT_WEIGHT_LADDER){
227
+ options.push({
228
+ value: entry.value,
229
+ label: entry.label,
230
+ hint: entry.value
231
+ });
232
+ }
233
+ return options;
234
+ }
235
+ /**
236
+ * Stacking layers from `theme.zIndex`, ordered by the layer they sit on
237
+ * rather than alphabetically — an author picking "above the app bar" is
238
+ * reading the stack, not the key names.
239
+ *
240
+ * This is the one of the three where a raw number is usually the WRONG
241
+ * answer: typing `1300` next to a modal the theme also puts at 1300 is a
242
+ * coin toss, and a host that re-tunes its layers leaves that number behind.
243
+ */ export function buildZIndexScaleOptions(theme) {
244
+ const zIndex = theme == null ? void 0 : theme.zIndex;
245
+ if (!zIndex) return [];
246
+ return Object.keys(zIndex).filter((key)=>typeof zIndex[key] === 'number').sort((a, b)=>zIndex[a] - zIndex[b]).map((key)=>({
247
+ value: key,
248
+ label: humanizeKey(key),
249
+ hint: `${zIndex[key]}`
250
+ }));
251
+ }
252
+ /**
253
+ * The ladder offered, in the order a scale is read.
254
+ *
255
+ * Named rather than numbered because this is the one control in the panel
256
+ * a non-developer is guaranteed to meet: "Medium" is a choice anyone can
257
+ * make, "2" is a question about what the unit is. The resolved value rides
258
+ * along in the hint so the answer is still there for whoever wants it.
259
+ *
260
+ * `0` is on the ladder as **None**, and it is a real value meaning "no
261
+ * space", not the absence of one — the styler keeps "not set" as a separate
262
+ * answer that removes the property entirely.
263
+ */ const SPACING_STEPS = [
264
+ {
265
+ step: 0,
266
+ label: 'None'
267
+ },
268
+ {
269
+ step: 0.5,
270
+ label: 'Hairline'
271
+ },
272
+ {
273
+ step: 1,
274
+ label: 'Extra small'
275
+ },
276
+ {
277
+ step: 2,
278
+ label: 'Small'
279
+ },
280
+ {
281
+ step: 3,
282
+ label: 'Medium'
283
+ },
284
+ {
285
+ step: 4,
286
+ label: 'Large'
287
+ },
288
+ {
289
+ step: 6,
290
+ label: 'Extra large'
291
+ },
292
+ {
293
+ step: 8,
294
+ label: 'Huge'
295
+ },
296
+ {
297
+ step: 12,
298
+ label: 'Giant'
299
+ }
300
+ ];
301
+ /** What one step resolves to, or `''` when the theme cannot answer. */ function resolveSpacing(spacing, step) {
302
+ if (typeof spacing === 'function') {
303
+ const resolved = spacing(step);
304
+ if (typeof resolved === 'number') {
305
+ return Number.isFinite(resolved) ? `${resolved}px` : '';
306
+ }
307
+ return typeof resolved === 'string' ? resolved : '';
308
+ }
309
+ // Raw theme options carry the bare unit; mirror MUI's own arithmetic.
310
+ if (typeof spacing === 'number' && Number.isFinite(spacing)) {
311
+ return `${spacing * step}px`;
312
+ }
313
+ return '';
314
+ }
315
+ /**
316
+ * The spacing ladder read off the SITE theme, so a host that set
317
+ * `spacing: 4` offers its own eight-step ladder rather than Aglyn's.
318
+ *
319
+ * A theme with no usable `spacing` yields an empty list, which leaves the
320
+ * styler on custom amounts only — never a ladder of numbers that resolve to
321
+ * nothing.
322
+ */ export function buildSpacingScaleOptions(theme) {
323
+ const spacing = theme == null ? void 0 : theme.spacing;
324
+ const options = [];
325
+ for (const { step, label } of SPACING_STEPS){
326
+ const hint = resolveSpacing(spacing, step);
327
+ // `'0px'` is truthy, so None survives this guard — the check is for a
328
+ // theme that cannot resolve the step at all, not for a zero value.
329
+ if (hint === '') continue;
330
+ options.push({
331
+ value: step,
332
+ label,
333
+ hint
334
+ });
335
+ }
336
+ return options;
337
+ }
338
+ export function buildStyleThemeScales(theme) {
339
+ return {
340
+ fontSize: buildFontSizeScaleOptions(theme),
341
+ fontWeight: buildFontWeightScaleOptions(theme),
342
+ zIndex: buildZIndexScaleOptions(theme),
343
+ spacing: buildSpacingScaleOptions(theme),
344
+ cornerRadius: buildCornerRadiusChoices(theme),
345
+ shadow: buildShadowChoices(theme),
346
+ fontFamily: buildFontFamilyChoices(theme),
347
+ typographyVariant: buildTypographyVariantChoices(theme),
348
+ gap: buildGapChoices(theme)
349
+ };
350
+ }
351
+ /* ── Corner radius ────────────────────────────────────────────────────── */ /**
352
+ * MUI's own unit for a bare `borderRadius` number, and its default.
353
+ *
354
+ * `borderRadius: 2` renders 8px because MUI multiplies the number by
355
+ * `shape.borderRadius` (4 unless a host changed it) — the same
356
+ * theme-following arithmetic `spacing` gets, and the reason the presets
357
+ * below store NUMBERS. A host that set `shape.borderRadius: 6` gets a
358
+ * ladder of its own without anyone editing this file.
359
+ */ const DEFAULT_SHAPE_RADIUS = 4;
360
+ function shapeRadiusUnit(theme) {
361
+ var _theme_shape;
362
+ const raw = theme == null ? void 0 : (_theme_shape = theme.shape) == null ? void 0 : _theme_shape.borderRadius;
363
+ if (typeof raw === 'number' && Number.isFinite(raw)) return raw;
364
+ // A theme may carry a CSS length (`'4px'`); read the leading number so
365
+ // the hints stay right rather than silently reverting to the default.
366
+ if (typeof raw === 'string') {
367
+ const parsed = Number.parseFloat(raw);
368
+ if (Number.isFinite(parsed)) return parsed;
369
+ }
370
+ return DEFAULT_SHAPE_RADIUS;
371
+ }
372
+ /**
373
+ * The rounding ladder, named the way an author describes a shape rather
374
+ * than the way CSS spells one (AGL-2486).
375
+ *
376
+ * A text box for corner radius invites three value systems at once — a pixel
377
+ * length, a percentage, or a theme multiple — and two of them are wrong,
378
+ * because the theme scale behind this property is SHAPE, not spacing. Every
379
+ * rung here is a theme multiple except the two that cannot be: a pill needs a
380
+ * radius larger than the box can ever be, and a circle is a percentage.
381
+ */ const RADIUS_STEPS = [
382
+ {
383
+ step: 0,
384
+ label: 'Square'
385
+ },
386
+ {
387
+ step: 1,
388
+ label: 'Slightly rounded'
389
+ },
390
+ {
391
+ step: 2,
392
+ label: 'Rounded'
393
+ },
394
+ {
395
+ step: 3,
396
+ label: 'More rounded'
397
+ },
398
+ {
399
+ step: 4,
400
+ label: 'Very rounded'
401
+ }
402
+ ];
403
+ /**
404
+ * A radius large enough that any box reads as a pill (CSS clamps a radius
405
+ * to half the shorter side), expressed in px rather than as a theme
406
+ * multiple because it is deliberately NOT following the theme — a pill is
407
+ * a shape, not a spacing decision.
408
+ */ const PILL_RADIUS = '9999px';
409
+ /** Corner-radius presets, with what each resolves to in THIS theme. */ export function buildCornerRadiusChoices(theme) {
410
+ const unit = shapeRadiusUnit(theme);
411
+ const options = RADIUS_STEPS.map(({ step, label })=>({
412
+ value: step,
413
+ label,
414
+ hint: `${step * unit}px`,
415
+ // The menu tile draws the real shape, so the choice is made by looking.
416
+ preview: `${step * unit}px`
417
+ }));
418
+ options.push({
419
+ value: PILL_RADIUS,
420
+ label: 'Pill',
421
+ preview: PILL_RADIUS
422
+ });
423
+ options.push({
424
+ value: '50%',
425
+ label: 'Circle',
426
+ hint: 'square elements only',
427
+ preview: '50%'
428
+ });
429
+ return options;
430
+ }
431
+ /* ── Shadow ───────────────────────────────────────────────────────────── */ /**
432
+ * Drop-shadow presets named by what they LOOK like (AGL-2486).
433
+ *
434
+ * The labels say what the shadow looks like, `No shadow` is offered as the
435
+ * real value it is (a component or the theme may be drawing one), and the
436
+ * escape hatch is a `Custom…` entry in this very control rather than a helper
437
+ * pointing at the custom-CSS section.
438
+ *
439
+ * ## The menu is SHORT but the values are theme ELEVATIONS
440
+ *
441
+ * Two constraints pull apart here. MUI's ladder is 25 near-identical Material
442
+ * elevations, which is a worse menu than a handful of shadows that visibly
443
+ * differ — nobody should scroll 25 rows. But a literal CSS shadow is a bespoke
444
+ * value that ignores `theme.shadows`, so a host that retunes its elevations
445
+ * leaves every stored shadow behind.
446
+ *
447
+ * Both hold at once by curating INDICES: six rungs off the host's own
448
+ * ladder, each stored as the number `boxShadow` already resolves through
449
+ * (`themeKey: 'shadows'`), and each previewing the CSS that number renders
450
+ * so the row still shows what it looks like. Same trick as Corner Radius —
451
+ * store the theme multiple, preview the resolved value.
452
+ *
453
+ * `none` stays a string because it is the real value it is: a component or
454
+ * the theme may be drawing a shadow this element wants gone.
455
+ */ const SHADOW_STEPS = [
456
+ {
457
+ elevation: 1,
458
+ label: 'Barely there — a hairline lift'
459
+ },
460
+ {
461
+ elevation: 3,
462
+ label: 'Soft — sits on the page'
463
+ },
464
+ {
465
+ elevation: 6,
466
+ label: 'Lifted — floats a little'
467
+ },
468
+ {
469
+ elevation: 12,
470
+ label: 'Raised — floats well above'
471
+ },
472
+ {
473
+ elevation: 24,
474
+ label: 'Highest — dialog level'
475
+ }
476
+ ];
477
+ /**
478
+ * Literal CSS shadows, reached only when a theme carries no usable `shadows`
479
+ * array, so the control never degrades to an empty menu on a host with an
480
+ * unusual theme.
481
+ */ const FALLBACK_SHADOWS = [
482
+ {
483
+ value: '0 1px 3px rgba(0,0,0,0.2)',
484
+ label: 'Soft — sits on the page'
485
+ },
486
+ {
487
+ value: '0 4px 12px rgba(0,0,0,0.15)',
488
+ label: 'Lifted — floats a little'
489
+ },
490
+ {
491
+ value: '0 12px 32px rgba(0,0,0,0.25)',
492
+ label: 'Raised — floats well above'
493
+ },
494
+ {
495
+ value: 'inset 0 2px 6px rgba(0,0,0,0.2)',
496
+ label: 'Inset — pressed into the page'
497
+ }
498
+ ];
499
+ export function buildShadowChoices(theme) {
500
+ const shadows = theme == null ? void 0 : theme.shadows;
501
+ const options = [
502
+ {
503
+ value: 'none',
504
+ label: 'No shadow'
505
+ }
506
+ ];
507
+ if (!Array.isArray(shadows) || shadows.length === 0) {
508
+ for (const entry of FALLBACK_SHADOWS){
509
+ options.push({
510
+ value: entry.value,
511
+ label: entry.label,
512
+ preview: entry.value
513
+ });
514
+ }
515
+ return options;
516
+ }
517
+ for (const { elevation, label } of SHADOW_STEPS){
518
+ const resolved = shadows[elevation];
519
+ // A host with a shorter ladder simply offers fewer rungs rather than
520
+ // storing an index that resolves to nothing.
521
+ if (typeof resolved !== 'string' || !resolved || resolved === 'none') continue;
522
+ options.push({
523
+ value: elevation,
524
+ label,
525
+ hint: `Elevation ${elevation}`,
526
+ preview: resolved
527
+ });
528
+ }
529
+ return options;
530
+ }
531
+ /* ── Font family ──────────────────────────────────────────────────────── */ /**
532
+ * The typography variants whose own `fontFamily` is worth offering. A theme
533
+ * that gives headings a display face and body a text face has TWO answers
534
+ * an author should be able to pick, and neither of them is a font name they
535
+ * have to know how to spell.
536
+ */ const FONT_FAMILY_VARIANTS = [
537
+ {
538
+ key: 'h1',
539
+ label: 'Theme heading font'
540
+ },
541
+ {
542
+ key: 'body1',
543
+ label: 'Theme body font'
544
+ },
545
+ {
546
+ key: 'button',
547
+ label: 'Theme button font'
548
+ }
549
+ ];
550
+ /**
551
+ * Web-safe stacks, offered AFTER the theme's own faces.
552
+ *
553
+ * Deliberately short and generic: these are the families that render
554
+ * without a webfont on every platform, so picking one can never cost a
555
+ * page-load or leave a visitor on a fallback the author never saw. Anything
556
+ * else — a Google font, a licensed face — is a Custom… value, which is the
557
+ * honest place for it because it also needs the font to be loaded.
558
+ */ const WEB_SAFE_FONTS = [
559
+ {
560
+ value: 'system-ui, sans-serif',
561
+ label: 'System sans-serif'
562
+ },
563
+ {
564
+ value: 'Georgia, serif',
565
+ label: 'Georgia (serif)'
566
+ },
567
+ {
568
+ value: '"Times New Roman", Times, serif',
569
+ label: 'Times (serif)'
570
+ },
571
+ {
572
+ value: 'Arial, Helvetica, sans-serif',
573
+ label: 'Arial (sans-serif)'
574
+ },
575
+ {
576
+ value: 'Verdana, Geneva, sans-serif',
577
+ label: 'Verdana (sans-serif)'
578
+ },
579
+ {
580
+ value: '"Trebuchet MS", Helvetica, sans-serif',
581
+ label: 'Trebuchet (sans-serif)'
582
+ },
583
+ {
584
+ value: '"Courier New", Courier, monospace',
585
+ label: 'Courier (monospace)'
586
+ }
587
+ ];
588
+ /** The first word of a stack, for a hint that fits a narrow menu row. */ function firstFamily(stack) {
589
+ var _stack_split_;
590
+ const first = (_stack_split_ = stack.split(',')[0]) != null ? _stack_split_ : '';
591
+ return first.trim().replace(/^["']|["']$/g, '');
592
+ }
593
+ /**
594
+ * Font-family choices: the SITE THEME's own faces first, then web-safe
595
+ *
596
+ * The old field was free text carrying the advice *"Prefer theme typography
597
+ * when possible"* — advice with no way to act on it. Leading with the
598
+ * theme's faces makes the recommended answer the first one in reach, and
599
+ * every row renders its own label in its own face so the choice can be made
600
+ * by looking.
601
+ *
602
+ * A theme face is stored as the resolved STACK rather than as a token path,
603
+ * because MUI declares `fontFamily` with `themeKey: 'typography'` and
604
+ * `typography.fontFamily` is the only path that resolves — `h1.fontFamily`
605
+ * does not. Duplicates are collapsed so a theme using one face everywhere
606
+ * offers it once.
607
+ */ export function buildFontFamilyChoices(theme) {
608
+ const typography = theme == null ? void 0 : theme.typography;
609
+ const options = [];
610
+ const seen = new Set();
611
+ const push = (value, label)=>{
612
+ const stack = value.trim();
613
+ if (stack === '' || seen.has(stack)) return;
614
+ seen.add(stack);
615
+ options.push({
616
+ value: stack,
617
+ label,
618
+ hint: firstFamily(stack)
619
+ });
620
+ };
621
+ if (typography) {
622
+ const base = typography['fontFamily'];
623
+ if (typeof base === 'string') push(base, 'Theme default font');
624
+ for (const { key, label } of FONT_FAMILY_VARIANTS){
625
+ const variant = typography[key];
626
+ if (!variant || typeof variant !== 'object') continue;
627
+ const family = variant['fontFamily'];
628
+ if (typeof family === 'string') push(family, label);
629
+ }
630
+ }
631
+ for (const font of WEB_SAFE_FONTS)push(font.value, font.label);
632
+ return options;
633
+ }
634
+ /* ── Typography variant ───────────────────────────────────────────────── */ /**
635
+ * Whole text styles from `theme.typography` (AGL-2486).
636
+ *
637
+ * Every other control in this group sets ONE property, so matching a heading
638
+ * to the theme takes five correct picks in a row — face, size, weight, line
639
+ * height, letter spacing — and getting any of them wrong leaves text that
640
+ * looks almost right. `typography: 'h2'` is a single sx key that applies all
641
+ * of them at once, and it is the key MUI itself reaches for.
642
+ *
643
+ * Without this control a page can carry eleven headings at MUI's default `h2`
644
+ * — Light 300 at 60px — while every panel in the besigner reports nothing
645
+ * wrong: no field says "this is a Heading 2", only fields that say "this is
646
+ * 60px" once somebody types it.
647
+ *
648
+ * The hint names what the variant resolves to in THIS theme rather than in
649
+ * the abstract, because "Heading 2" means nothing until you know the host
650
+ * made it 40px semibold.
651
+ */ export function buildTypographyVariantChoices(theme) {
652
+ const typography = theme == null ? void 0 : theme.typography;
653
+ if (!typography) return [];
654
+ const options = [];
655
+ for (const { key, label } of themeTypographyVariants(typography)){
656
+ const variant = typography[key];
657
+ if (!variant || typeof variant !== 'object') continue;
658
+ const { fontSize, fontWeight } = variant;
659
+ const parts = [
660
+ hintOf(fontSize),
661
+ hintOf(fontWeight) && `weight ${hintOf(fontWeight)}`
662
+ ].filter(Boolean).join(' · ');
663
+ options.push({
664
+ value: key,
665
+ label,
666
+ hint: parts || undefined
667
+ });
668
+ }
669
+ return options;
670
+ }
671
+ /* ── Gap ──────────────────────────────────────────────────────────────── */ /**
672
+ * Grid and flex gaps on the theme's spacing ladder (AGL-2486).
673
+ *
674
+ * A free-text box for `gap`, `rowGap` or `columnGap` reads as a CSS length
675
+ * question and gets answered with one — but MUI runs all three through
676
+ * `createUnaryUnit(theme, 'spacing', …)`, exactly like margin and padding. So
677
+ * `gap: 2` is a theme multiple that follows a host retuning its unit, and
678
+ * `gap: '16px'` is a bespoke value that does not.
679
+ *
680
+ * These are the same rungs and the same labels the box styler offers for
681
+ * margin and padding, so the two controls agree; gaps only sit apart because
682
+ * they live in the Grid and Flex groups.
683
+ *
684
+ * A `PresetChoiceOption` rather than a `ThemeScaleOption` because the value
685
+ * STORED is a number and that interface is string-only — the same reason
686
+ * Corner Radius is a preset.
687
+ */ export function buildGapChoices(theme) {
688
+ const spacing = theme == null ? void 0 : theme.spacing;
689
+ const options = [];
690
+ for (const { step, label } of SPACING_STEPS){
691
+ const hint = resolveSpacing(spacing, step);
692
+ if (hint === '') continue;
693
+ options.push({
694
+ value: step,
695
+ label,
696
+ hint
697
+ });
698
+ }
699
+ return options;
700
+ }
701
+
702
+ //# sourceMappingURL=theme-scale-options.js.map