@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,874 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
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 { FieldComponentType } from "@aglyn/aglyn";
18
+ import { SX_SCHEME_DARK_KEY } from "@aglyn/aglyn-node-renderer";
19
+ import { describeCssColorProblem, expandSxAliases } from "@aglyn/shared-data-enums";
20
+ import { besignerDocsUrl } from "./docs-help.js";
21
+ import { numericTextValue } from "./numeric-text-value.js";
22
+ import { readSxValue, writeSxValue } from "./responsive-sx.js";
23
+ /**
24
+ * Fields that earn a per-field help tip (AGL-600, wired in AGL-1220).
25
+ *
26
+ * Deliberately NOT every described field. Every field's `description`
27
+ * already renders as helper text UNDER its control, so a tooltip whose
28
+ * excerpt IS that description is ~40 question marks that say nothing new
29
+ * — and `FormFieldGrid` pins the icon at `top: -6, right: 0`, i.e. ON
30
+ * the field's top border, where on a length field it lands right beside
31
+ * the unit menu's caret and on a full-width select it floats detached
32
+ * above the box. (Colour pickers do not forward `help` at all, so the
33
+ * full set also left three ragged gaps.) Checked in the panel at its
34
+ * real ~340px width before narrowing to this list.
35
+ *
36
+ * What a tip can say that the inline line cannot is the panel's one
37
+ * genuine footgun: a bare NUMBER in these five fields is not pixels.
38
+ * `borderRadius: 2` renders 8px (× `shape.borderRadius`), `gap: 2`
39
+ * renders 16px (× the spacing unit), and `lineHeight: 1.5` is a ratio —
40
+ * a silent 8× surprise no one-line example can warn about, and the exact
41
+ * reason these five stayed free text while every other length became a
42
+ * number box + unit picker (AGL-1219). All five are plain text boxes, so
43
+ * the icon has the field's top-right corner to itself.
44
+ */ const STYLE_FIELD_HELP = {
45
+ borderRadius: {
46
+ title: 'Corner Radius',
47
+ excerpt: 'Pick a rounding preset, or Custom… for an exact value. In Custom, a bare number is a theme multiple, not pixels — 2 renders 8px (2 × the theme corner radius). Add a unit (8px, 50%) for an exact radius.'
48
+ },
49
+ gap: {
50
+ title: 'Gap',
51
+ excerpt: 'A bare number is a theme multiple, not pixels — 2 renders 16px (2 × the theme spacing unit). Add a unit (16px, 1rem) for an exact gutter.'
52
+ },
53
+ rowGap: {
54
+ title: 'Row Gap',
55
+ excerpt: 'A bare number is a theme multiple, not pixels — 2 renders 16px (2 × the theme spacing unit). Add a unit (16px, 1rem) for an exact gutter.'
56
+ },
57
+ columnGap: {
58
+ title: 'Column Gap',
59
+ excerpt: 'A bare number is a theme multiple, not pixels — 2 renders 16px (2 × the theme spacing unit). Add a unit (16px, 1rem) for an exact gutter.'
60
+ },
61
+ lineHeight: {
62
+ title: 'Line Height',
63
+ excerpt: 'A bare number is a ratio of the font size, not pixels — 1.5 renders one-and-a-half times the text size, and stays right when the font size changes. Add a unit (28px) to pin the line box.'
64
+ }
65
+ };
66
+ /**
67
+ * Marks every field in a group clearable (AGL-2486).
68
+ *
69
+ * A style field's empty state is a real authoring choice — it is what
70
+ * "let the theme decide" looks like — and until this there was no click
71
+ * anywhere in the panel that produced it. Colour fields had no empty
72
+ * swatch, length fields re-adopted their unit the moment a number came
73
+ * back, and selects only offered a Default option where one had been
74
+ * hand-authored. Applied to the whole group rather than field by field
75
+ * so a field added later cannot arrive one-way.
76
+ */ function withFieldClear(group) {
77
+ return _extends({}, group, {
78
+ fields: group.fields.map((field)=>_extends({
79
+ clearable: true
80
+ }, field))
81
+ });
82
+ }
83
+ /**
84
+ * Makes every field hold its value the way the DOCUMENT holds it
85
+ * (AGL-2486, items 9 and 10 together).
86
+ *
87
+ * Item 10 made a purely numeric value store as a NUMBER, which is what
88
+ * gives `gap: 2` its meaning of 16px. But a form control hands back
89
+ * whatever its own input produces — text from a box, the option's own
90
+ * value from a preset menu — so the form's copy of a stored `2` was
91
+ * sometimes `'2'` and sometimes `2`. react-final-form's definition of
92
+ * DIRTY is exactly that inequality, and item 9's re-seed spares dirty
93
+ * fields so it cannot eat characters mid-word. A numeric field was
94
+ * therefore permanently dirty and permanently spared: the canvas rolled
95
+ * back on an undo and the panel did not. Two fixes, each right on its own,
96
+ * cancelling.
97
+ *
98
+ * `parse` runs on the way IN, before the value reaches form state, so the
99
+ * form and the document agree by construction and "dirty" means what it
100
+ * says — for every control, including ones added later. It is the same
101
+ * function the merge writes through, so there is exactly one answer in the
102
+ * panel to "what type is this value", rather than one per control.
103
+ *
104
+ * Applied to the whole group for the same reason `clearable` is: a field
105
+ * added later cannot arrive with the old behaviour.
106
+ */ function withStoredValueParse(group) {
107
+ return _extends({}, group, {
108
+ fields: group.fields.map((field)=>{
109
+ var _field_FieldProps;
110
+ return _extends({}, field, {
111
+ FieldProps: _extends({}, (_field_FieldProps = field['FieldProps']) != null ? _field_FieldProps : {}, {
112
+ parse: normalizeStyleValue
113
+ })
114
+ });
115
+ })
116
+ });
117
+ }
118
+ /** Attaches {@link STYLE_FIELD_HELP} to a group's fields, each with a
119
+ * Deep link into the responsive-styling docs. */ function withStyleFieldHelp(group) {
120
+ return _extends({}, group, {
121
+ fields: group.fields.map((field)=>{
122
+ const help = STYLE_FIELD_HELP[field.name];
123
+ return help && !field['help'] ? _extends({}, field, {
124
+ help: _extends({}, help, {
125
+ href: besignerDocsUrl('responsiveStyling', '#style-groups')
126
+ })
127
+ }) : field;
128
+ })
129
+ });
130
+ }
131
+ const textField = (name, label, description, extra)=>_extends({
132
+ component: FieldComponentType.TEXT_FIELD,
133
+ name,
134
+ label,
135
+ description
136
+ }, extra);
137
+ /**
138
+ * ROW RHYTHM (AGL-2486).
139
+ *
140
+ * Two groups built from the same primitives can read as different panels
141
+ * entirely — one airy, one dense — without either being wrong field by field.
142
+ * The difference is two things this file controls and nothing else does.
143
+ *
144
+ * **1. Orphaned half-width fields.** A field declared `half` next to a
145
+ * full-width neighbour sits alone in the left column with the entire right
146
+ * half of the row empty. A half-width field is a promise that something
147
+ * shares its row; when nothing does, the group gains a row of dead space for
148
+ * no information. So the rule is:
149
+ * **every run of consecutive half-width fields has EVEN length.** It is
150
+ * enforced by a spec over the built groups rather than by review, because
151
+ * the failure is invisible in the source — you have to look at the
152
+ * neighbours, and neighbours change.
153
+ *
154
+ * **2. Helper text that wraps to three and four lines.** `half` is
155
+ * `{ xs: 12, sm: 6 }` and `sm` is a VIEWPORT breakpoint, so on any desktop
156
+ * it is permanently active however narrow the docked panel is — about
157
+ * 170px per column. "Stacking order for positioned elements — a theme
158
+ * layer, or a raw number." took four lines there and made one field as tall
159
+ * as a pair. So a half-width field's description is capped at
160
+ * {@link HALF_WIDTH_DESCRIPTION_LIMIT} characters, which is two lines at
161
+ * that width, and the spec fails the build if one grows past it. The longer
162
+ * explanation goes where there is room for it: the tooltip and the docs.
163
+ *
164
+ * A full-width field is never an orphan and has a whole row to wrap in, so
165
+ * it carries no length cap — that is what it is FOR, and it is the right
166
+ * home for a control with three sub-controls (see {@link dimensionField})
167
+ * or a genuinely long caption (Background Fill's url() egress warning).
168
+ */ const half = {
169
+ FormFieldGridProps: {
170
+ size: {
171
+ xs: 12,
172
+ sm: 6
173
+ }
174
+ }
175
+ };
176
+ /**
177
+ * Longest description a HALF-width field may carry: two lines at the ~170px
178
+ * a half column gets in the docked panel. Measured against the panel's own
179
+ * 0.75rem caption type, not guessed.
180
+ */ export const HALF_WIDTH_DESCRIPTION_LIMIT = 52;
181
+ /**
182
+ * A border editor: thickness box + line-style picker (AGL-2486). Replaces
183
+ * the free-text shorthand box an author had to type `1px solid` into.
184
+ *
185
+ * The PERSISTED value is unchanged — still one CSS shorthand string — so
186
+ * every existing document renders exactly as before, and a value the pair
187
+ * cannot model (`1px solid #f00`, `thin dashed`) falls back to a raw text
188
+ * box inside the same control rather than being clobbered.
189
+ */ const borderField = (name, label, description, extra)=>_extends({
190
+ component: FieldComponentType.CSS_BORDER,
191
+ name,
192
+ label,
193
+ description
194
+ }, extra);
195
+ /**
196
+ * A named-preset picker with a Custom… escape hatch (AGL-2486) — corner
197
+ * radius, drop shadow and font family.
198
+ *
199
+ * `choices` come from the SITE theme where the property has one
200
+ * ({@link StyleThemeScales}), so the recommended answer is the first one in
201
+ * reach rather than advice in a helper line. An empty list still leaves a
202
+ * usable control: the Custom… entry and the raw box are always there.
203
+ */ const presetField = (name, label, description, choices, extra)=>_extends({
204
+ component: FieldComponentType.PRESET_CHOICE,
205
+ name,
206
+ label,
207
+ description,
208
+ choices
209
+ }, extra);
210
+ /**
211
+ * A length field: number box + unit picker (AGL-1219) instead of a
212
+ * free-text box the author has to type `px` into. The PERSISTED value is
213
+ * unchanged — still one CSS string in `sx` — so this is purely an input
214
+ * affordance and nothing downstream has to know about it. Anything the
215
+ * control cannot model (`calc(100% - 2rem)`, `min-content`, MUI's
216
+ * `maxWidth: 'sm'` breakpoint key) falls back to a text box holding the
217
+ * raw string, so no existing value is destroyed.
218
+ *
219
+ * Not every length is one of these. Fields whose NUMBER means a theme
220
+ * multiple — `borderRadius` (× `shape.borderRadius`), `gap`/`rowGap`/
221
+ * `columnGap` (× the spacing unit) — stay free text: a stored `gap: 2` is
222
+ * 16px, and a px picker would show "2" and turn the next nudge into 3px.
223
+ * `lineHeight` stays free text for the same reason (a unitless 1.5 is the
224
+ * normal value, and a unit picker would push `px` onto it).
225
+ */ const dimensionField = (name, label, description, extra)=>{
226
+ /**
227
+ * A field carrying a theme scale AS WELL AS a unit takes the whole row
228
+ * (AGL-2486).
229
+ *
230
+ * Such a row holds three controls: the number, the theme-scale picker and
231
+ * the unit picker. The two pickers claim ~140px of fixed width between them,
232
+ * and `half` gives the whole field about 156px inside a 375px docked panel,
233
+ * so the number box — the only one with no width of its own — is left with
234
+ * single digits, and Font Size renders as `2.:` with the value truncated to
235
+ * nothing.
236
+ *
237
+ * The half-width itself is the trap. `half` is `{ xs: 12, sm: 6 }`, and
238
+ * `sm` is a VIEWPORT breakpoint: on any desktop it is permanently active
239
+ * regardless of how narrow the panel is, so a rule that reads like
240
+ * "two-up only when there is room" has in fact always been "two-up". A
241
+ * three-control field never fitted; nothing measured it.
242
+ *
243
+ * This is keyed on the SHAPE, not on the field name, so the next field
244
+ * given `scaleOptions` gets the row it needs without anyone remembering.
245
+ */ const hasScale = Array.isArray(extra == null ? void 0 : extra.scaleOptions) ? extra.scaleOptions.length > 0 : false;
246
+ return _extends({
247
+ component: FieldComponentType.CSS_DIMENSION,
248
+ name,
249
+ label,
250
+ description
251
+ }, extra, hasScale ? {
252
+ FormFieldGridProps: {
253
+ size: {
254
+ xs: 12
255
+ }
256
+ }
257
+ } : {});
258
+ };
259
+ /**
260
+ * Sizing keys read their bare numbers through MUI's `sizingTransform`,
261
+ * where a number in (0, 1] is a FRACTION of the parent — `width: 0.5`
262
+ * renders 50%, not 0.5px (AGL-1219).
263
+ */ const muiSizing = {
264
+ numberAs: 'mui-sizing'
265
+ };
266
+ /**
267
+ * Rejects a colour-field value that CSS would drop (AGL-1331).
268
+ *
269
+ * Every field in this panel applies live, on a debounce, and
270
+ * `ElementStylesFormTemplate` only schedules that commit while the form is
271
+ * `valid` — so returning a message here means the value is shown as an
272
+ * error under the field and NEVER reaches `sx`. That is the whole point:
273
+ * before this, a gradient typed into Background Color was accepted, stored
274
+ * as `background-color: linear-gradient(…)`, dropped by the CSS parser, and
275
+ * the element just went transparent with nothing to explain it.
276
+ *
277
+ * Rejecting rather than silently re-routing the value to `backgroundImage`
278
+ * is deliberate. These fields commit per KEYSTROKE, so a router would fire
279
+ * on `linear-gradient(2` and every prefix after it, moving half-typed
280
+ * values into a different sx key while the field the author is typing in
281
+ * blanks itself — a second kind of vanishing. A validator is inert until
282
+ * the value is complete, and its message names the field that CAN hold a
283
+ * gradient.
284
+ */ const colorFieldValidator = (value)=>describeCssColorProblem(value);
285
+ /** A colour picker field, with the value guard every one of them needs. */ const colorField = (name, label, description, presetColors, extra)=>_extends({
286
+ component: FieldComponentType.COLOR_PICKER,
287
+ name,
288
+ label,
289
+ description,
290
+ presetColors,
291
+ validate: [
292
+ colorFieldValidator
293
+ ],
294
+ // Show the message as soon as the value is invalid, not on blur. Every
295
+ // control in this panel applies live and an author typically moves
296
+ // straight to the canvas, so a touched-gated error would keep the value
297
+ // silently uncommitted for exactly as long as the old bug kept it
298
+ // silently dropped. It also explains an ALREADY-broken stored value the
299
+ // moment the field is opened.
300
+ validateOnMount: true
301
+ }, extra);
302
+ /**
303
+ * A field offering a THEME SCALE while still accepting any raw value
304
+ * (AGL-2486, item 12). The stored value is a theme token path
305
+ * (`fontWeightBold`, `appBar`) that MUI's sx system resolves itself, or
306
+ * whatever the author typed — see `ThemeScaleField`.
307
+ */ const themeScaleField = (name, label, description, scaleOptions, extra)=>_extends({
308
+ component: FieldComponentType.THEME_SCALE,
309
+ name,
310
+ label,
311
+ description,
312
+ scaleOptions
313
+ }, extra);
314
+ const selectField = (name, label, description, values, extra)=>_extends({
315
+ component: FieldComponentType.SELECT,
316
+ name,
317
+ label,
318
+ description,
319
+ options: [
320
+ {
321
+ value: '',
322
+ label: 'Default'
323
+ },
324
+ ...values.map((value)=>({
325
+ value,
326
+ label: value
327
+ }))
328
+ ]
329
+ }, extra);
330
+ /**
331
+ * The `url()` egress warning, appended to the Background Fill description
332
+ * (AGL-1737) — the "warn" half of AGL-1725's warn-and-disclose decision,
333
+ * reaching the Styles panel at last. The control's Custom CSS mode holds a
334
+ * non-gradient value (`url(…)`) as a raw string, so an author can type an
335
+ * off-site image here; the wording mirrors the Custom HTML component's
336
+ * `css` attribute so the same egress reads the same way everywhere the
337
+ * author can create it. Hosts are deliberately NOT blocked — the site
338
+ * owner is the controller for their own visitors (see `author-css.ts`) —
339
+ * which is exactly why the author has to be told what the url() does.
340
+ */ const BACKGROUND_FILL_URL_EGRESS = ' Custom CSS here can also hold an image url() — one pointing off ' + 'your site makes every visitor’s browser contact that host, which ' + 'sees their IP address and which page they are on. Insecure http:// ' + 'URLs are not loaded.';
341
+ /**
342
+ * Builds the style accordion groups. `presetColors` feeds the color
343
+ * pickers with the site theme's palette, mirroring the base styles form.
344
+ */ export function buildStyleFieldGroups(presetColors, options) {
345
+ return styleFieldGroups(presetColors, options).map(withStyleFieldHelp).map(withFieldClear).map(withStoredValueParse);
346
+ }
347
+ function styleFieldGroups(presetColors, options) {
348
+ var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
349
+ var _options_themeScales, _options_themeScales1, _options_themeScales2, _options_themeScales3, _options_themeScales4, _options_themeScales5, _options_themeScales6;
350
+ return [
351
+ {
352
+ $id: 'layout',
353
+ label: 'Layout',
354
+ fields: [
355
+ _extends({
356
+ component: FieldComponentType.SELECT,
357
+ name: 'display',
358
+ label: 'Display Variant',
359
+ // Was "The display property specifies the display behavior (the
360
+ // type of rendering box) of an element." — a restatement of the
361
+ // CSS spec that tells an author nothing they can act on.
362
+ description: 'How this element flows on the page.'
363
+ }, half, {
364
+ options: [
365
+ {
366
+ value: '',
367
+ label: 'Default'
368
+ },
369
+ {
370
+ value: 'block',
371
+ label: 'Block'
372
+ },
373
+ {
374
+ value: 'inline',
375
+ label: 'Inline'
376
+ },
377
+ {
378
+ value: 'content',
379
+ label: 'Contents'
380
+ },
381
+ {
382
+ value: 'list-item',
383
+ label: 'List Item'
384
+ },
385
+ {
386
+ value: 'inline-block',
387
+ label: 'Inline Block'
388
+ },
389
+ {
390
+ value: 'flex',
391
+ label: 'Flex'
392
+ },
393
+ {
394
+ value: 'inline-flex',
395
+ label: 'Inline Flex'
396
+ },
397
+ {
398
+ value: 'grid',
399
+ label: 'Grid'
400
+ },
401
+ {
402
+ value: 'inline-grid',
403
+ label: 'Inline Grid'
404
+ },
405
+ {
406
+ value: 'table',
407
+ label: 'Table'
408
+ },
409
+ {
410
+ value: 'inline-table',
411
+ label: 'Inline Table'
412
+ },
413
+ {
414
+ value: 'table-caption',
415
+ label: 'Table Caption'
416
+ },
417
+ {
418
+ value: 'table-column',
419
+ label: 'Table Column'
420
+ },
421
+ {
422
+ value: 'table-column-group',
423
+ label: 'Table Column Group'
424
+ },
425
+ {
426
+ value: 'table-cell',
427
+ label: 'Table Cell'
428
+ },
429
+ {
430
+ value: 'table-row',
431
+ label: 'Table Row'
432
+ },
433
+ {
434
+ value: 'table-row-group',
435
+ label: 'Table Row Group'
436
+ },
437
+ {
438
+ value: 'table-header-group',
439
+ label: 'Table Header Group'
440
+ },
441
+ {
442
+ value: 'table-footer-group',
443
+ label: 'Table Footer Group'
444
+ },
445
+ {
446
+ value: 'none',
447
+ label: 'None'
448
+ },
449
+ {
450
+ value: 'initial',
451
+ label: 'Initial'
452
+ },
453
+ {
454
+ value: 'unset',
455
+ label: 'Unset'
456
+ }
457
+ ]
458
+ }),
459
+ _extends({
460
+ component: FieldComponentType.SELECT,
461
+ name: 'float',
462
+ label: 'Float',
463
+ description: 'Let text wrap around this element.'
464
+ }, half, {
465
+ options: [
466
+ {
467
+ value: '',
468
+ label: 'Default'
469
+ },
470
+ {
471
+ value: 'inherit',
472
+ label: 'Inherit',
473
+ description: 'The element inherits the float value of its parent'
474
+ },
475
+ {
476
+ value: 'none',
477
+ label: 'None',
478
+ description: 'The element does not float (will be displayed just where it occurs in the text)'
479
+ },
480
+ {
481
+ value: 'left',
482
+ label: 'Left',
483
+ description: 'The element floats to the left of its container'
484
+ },
485
+ {
486
+ value: 'right',
487
+ label: 'Right',
488
+ description: 'The element floats to the right of its container'
489
+ }
490
+ ]
491
+ })
492
+ ]
493
+ },
494
+ {
495
+ $id: 'colors',
496
+ label: 'Colors',
497
+ fields: [
498
+ colorField('color', 'Text Color', 'The color of the text inside.', presetColors, half),
499
+ colorField('backgroundColor', 'Background Color', 'A solid color behind the content.', presetColors, half),
500
+ // Gradient backgrounds (AGL-1331). A separate field rather than a
501
+ // mode of Background Color, because they are different CSS
502
+ // properties: this one writes `backgroundImage`, which paints OVER
503
+ // the solid colour, so an author can keep a solid fallback under a
504
+ // gradient. Solid here writes `none` — an explicit "paint no
505
+ // image", which is what lets ONE instance of a component whose
506
+ // default IS a gradient go back to a flat band (AGL-1338).
507
+ {
508
+ component: FieldComponentType.CSS_GRADIENT,
509
+ name: 'backgroundImage',
510
+ label: 'Background Fill',
511
+ description: ((options == null ? void 0 : options.isInstanceOverride) ? 'Inherited keeps the fill the component paints. Solid ' + 'replaces it with the Background Color above — that is how ' + 'one placement drops a gradient the component sets. A ' + 'gradient here paints this instance only.' : 'Solid paints no image and lets the Background Color above ' + 'show. A gradient paints over it — set the angle and the ' + 'color stops, and bind any stop to a theme color so it ' + 'follows the palette.') + BACKGROUND_FILL_URL_EGRESS,
512
+ // On an instance the unset state is not "nothing", it is "the
513
+ // component's fill" — and saying so is half the AGL-1338 fix:
514
+ // the control read as already-Solid, so choosing Solid changed
515
+ // nothing and looked like a broken field.
516
+ unsetLabel: (options == null ? void 0 : options.isInstanceOverride) ? 'Inherited' : 'Default',
517
+ presetColors
518
+ }
519
+ ]
520
+ },
521
+ {
522
+ $id: 'sizing',
523
+ label: 'Sizing',
524
+ fields: [
525
+ dimensionField('width', 'Width', 'How wide the element is.', _extends({}, muiSizing, half)),
526
+ dimensionField('height', 'Height', 'How tall the element is.', _extends({}, muiSizing, half)),
527
+ dimensionField('minWidth', 'Min Width', 'Never narrower than this.', _extends({}, muiSizing, half)),
528
+ dimensionField('maxWidth', 'Max Width', 'Never wider than this.', _extends({}, muiSizing, half)),
529
+ dimensionField('minHeight', 'Min Height', 'Never shorter than this.', _extends({}, muiSizing, half)),
530
+ dimensionField('maxHeight', 'Max Height', 'Never taller than this.', _extends({}, muiSizing, half))
531
+ ]
532
+ },
533
+ {
534
+ $id: 'typography',
535
+ label: 'Typography',
536
+ fields: [
537
+ // Text Style leads the group because it is the one pick that can be
538
+ // RIGHT on its own (AGL-2486). Every field under it sets a single
539
+ // property, so matching the theme by hand takes five correct picks in
540
+ // a row; `typography: 'h2'` applies the face, size, weight, line
541
+ // height, letter spacing and casing the host defined, and keeps
542
+ // following them when the host retunes its scale. The fields below it
543
+ // read as adjustments ON a text style rather than as the only way to
544
+ // describe one.
545
+ presetField('typography', 'Text Style', 'A complete text style from the theme — sets face, size, weight and spacing together. Adjust individual properties below.', (_ref = options == null ? void 0 : (_options_themeScales = options.themeScales) == null ? void 0 : _options_themeScales.typographyVariant) != null ? _ref : []),
546
+ // The face comes FIRST, and it is a picker with a custom escape
547
+ // hatch (AGL-2486). A free-text box can only advise "prefer theme
548
+ // typography", which is advice with no way to act on it. The site
549
+ // theme's own faces lead the list, each row renders its own name in
550
+ // its own face, and a hand-typed stack still opens the control in its
551
+ // custom state holding that value.
552
+ presetField('fontFamily', 'Font Family', 'The typeface. The theme’s own fonts are listed first.', (_ref1 = options == null ? void 0 : (_options_themeScales1 = options.themeScales) == null ? void 0 : _options_themeScales1.fontFamily) != null ? _ref1 : [], {
553
+ previewKind: 'font'
554
+ }),
555
+ // Number + unit AND the theme's type scale (AGL-2486). Picking
556
+ // `h4.fontSize` stores that token path, which MUI resolves against
557
+ // `theme.typography` at render — so the heading keeps moving with
558
+ // the type scale instead of being pinned to the pixels it had on
559
+ // the day it was styled. A raw length is still one keystroke away.
560
+ // Full width is forced by `dimensionField`: three controls in one
561
+ // row never fitted a half column.
562
+ dimensionField('fontSize', 'Font Size', 'How big the text is — or a size from the theme’s type scale.', {
563
+ scaleOptions: (_ref2 = options == null ? void 0 : (_options_themeScales2 = options.themeScales) == null ? void 0 : _options_themeScales2.fontSize) != null ? _ref2 : []
564
+ }),
565
+ // The theme's named weights first, then the CSS ladder, and any raw
566
+ // value typed straight in (AGL-2486). `fontWeightBold` follows a
567
+ // host that decides its bold is 600; `700` means exactly 700.
568
+ themeScaleField('fontWeight', 'Font Weight', 'How bold the text is.', (_ref3 = options == null ? void 0 : (_options_themeScales3 = options.themeScales) == null ? void 0 : _options_themeScales3.fontWeight) != null ? _ref3 : [], half),
569
+ textField('lineHeight', 'Line Height', 'Space between lines of text.', half),
570
+ dimensionField('letterSpacing', 'Letter Spacing', 'Space between letters.', half),
571
+ selectField('textTransform', 'Text Transform', 'Force capitals or lower case.', [
572
+ 'none',
573
+ 'uppercase',
574
+ 'lowercase',
575
+ 'capitalize'
576
+ ], half),
577
+ selectField('textDecoration', 'Text Decoration', 'A line under, over or through the text.', [
578
+ 'none',
579
+ 'underline',
580
+ 'overline',
581
+ 'line-through'
582
+ ], half),
583
+ // Italic for a whole ELEMENT (AGL-2486). The inline text editor
584
+ // styles a selection inside a run, which cannot italicize a caption,
585
+ // a label or a quote block as a whole — that needs `fontStyle` on the
586
+ // element, one of MUI's theme-backed typography keys.
587
+ selectField('fontStyle', 'Font Style', 'Italic or upright.', [
588
+ 'normal',
589
+ 'italic',
590
+ 'oblique'
591
+ ], half)
592
+ ]
593
+ },
594
+ {
595
+ $id: 'borders',
596
+ label: 'Borders & Shadows',
597
+ fields: [
598
+ // A border is three obvious choices — how thick, what kind of
599
+ // line, what colour — and until AGL-2486 the panel asked for all
600
+ // three as CSS shorthand grammar typed into a text box. Thickness
601
+ // and line style are now the control; the colour sits beside it,
602
+ // where it has to live for a THEME colour to resolve (MUI reads
603
+ // `borderColor` against the palette, and the shorthand's colour
604
+ // slot is plain CSS that would drop a token on the floor).
605
+ borderField('border', 'Border', 'A line around the whole element.', half),
606
+ colorField('borderColor', 'Border Color', 'What color that line is.', presetColors, half),
607
+ // Per-side borders (AGL-1199). A divider under a bar, a rule
608
+ // between columns and a left accent rail are all far more common
609
+ // than a box outlined on four sides, and the shorthand above
610
+ // cannot express any of them — `border` writes all four.
611
+ borderField('borderTop', 'Border Top', 'A line along the top edge only.', half),
612
+ borderField('borderRight', 'Border Right', 'A line along the right edge only.', half),
613
+ borderField('borderBottom', 'Border Bottom', 'A line along the bottom edge only.', half),
614
+ borderField('borderLeft', 'Border Left', 'A line along the left edge only.', half),
615
+ presetField('borderRadius', 'Corner Radius', 'How rounded the corners are.', (_ref4 = options == null ? void 0 : (_options_themeScales4 = options.themeScales) == null ? void 0 : _options_themeScales4.cornerRadius) != null ? _ref4 : [], half),
616
+ borderField('outline', 'Outline', 'A ring drawn outside the border.', half),
617
+ // The shadow control no longer sends the author somewhere else to
618
+ // type CSS: the presets say what they look like and Custom… is in
619
+ // this control. Full width because the preset names are sentences
620
+ // ("Lifted — floats a little"), which is the point of them.
621
+ presetField('boxShadow', 'Shadow', 'A soft shadow that lifts the element off the page.', (_ref5 = options == null ? void 0 : (_options_themeScales5 = options.themeScales) == null ? void 0 : _options_themeScales5.shadow) != null ? _ref5 : [], {
622
+ previewKind: 'shadow'
623
+ })
624
+ ]
625
+ },
626
+ {
627
+ $id: 'position',
628
+ label: 'Position & Overflow',
629
+ fields: [
630
+ // Full width because it is the master control the four offsets
631
+ // depend on, and because its caption has to say so.
632
+ selectField('position', 'Position', 'How the element is placed. The four offsets below only apply once this is something other than Static.', [
633
+ 'static',
634
+ 'relative',
635
+ 'absolute',
636
+ 'fixed',
637
+ 'sticky'
638
+ ]),
639
+ dimensionField('top', 'Top', 'Distance from the top edge.', half),
640
+ dimensionField('right', 'Right', 'Distance from the right edge.', half),
641
+ dimensionField('bottom', 'Bottom', 'Distance from the bottom edge.', half),
642
+ dimensionField('left', 'Left', 'Distance from the left edge.', half),
643
+ // Z-Index and Opacity are a PAIR, so neither sits alone in the left
644
+ // column with the whole right half of its row empty — see ROW RHYTHM
645
+ // above. The long explanation of what a stacking layer is belongs in
646
+ // the docs, where there is room for it, not in this helper text.
647
+ themeScaleField('zIndex', 'Z-Index', 'Which element sits in front.', (_ref6 = options == null ? void 0 : (_options_themeScales6 = options.themeScales) == null ? void 0 : _options_themeScales6.zIndex) != null ? _ref6 : [], half),
648
+ textField('opacity', 'Opacity', '0 is invisible, 1 is solid.', _extends({
649
+ type: 'number'
650
+ }, half)),
651
+ selectField('overflow', 'Overflow', 'Content that does not fit.', [
652
+ 'visible',
653
+ 'hidden',
654
+ 'clip',
655
+ 'scroll',
656
+ 'auto'
657
+ ], half),
658
+ selectField('cursor', 'Cursor', 'Pointer shape on hover.', [
659
+ 'default',
660
+ 'pointer',
661
+ 'text',
662
+ 'move',
663
+ 'grab',
664
+ 'not-allowed'
665
+ ], half)
666
+ ]
667
+ }
668
+ ];
669
+ }
670
+ /**
671
+ * The typed fields of the single Flexbox & Grid section (AGL-2486).
672
+ *
673
+ * The panel used to answer "how do I lay this out?" in two places. A
674
+ * `Flexbox & Grids` accordion held the alignment toggles and the gaps; a
675
+ * separate `Grid & Flex Child` accordion, four sections further down, held
676
+ * the track lists, the item placement and the flex-child sizing. Both were
677
+ * about the same two CSS layout models, neither was complete, and their
678
+ * names did not divide the properties the way the names suggested:
679
+ * `alignSelf` and `justifySelf` are per-ITEM properties and lived in the
680
+ * container section, while `gridTemplateColumns` is a CONTAINER property
681
+ * and lived in the child one.
682
+ *
683
+ * So they are one section now, in reading order: how the container spaces
684
+ * its children (the gaps), what tracks it defines (the grid template), and
685
+ * where this element sits inside its own parent (placement and flex
686
+ * sizing). The alignment toggles render above these, from the panel — they
687
+ * are icon-button groups rather than schema fields and they read far better
688
+ * than the free-text equivalents would.
689
+ *
690
+ * Every property both sections carried is still here; the whole point is
691
+ * that nothing had to be dropped to stop saying it twice.
692
+ */ export function buildFlexGridGroup(options) {
693
+ var _ref, _ref1, _ref2;
694
+ var _options_themeScales, _options_themeScales1, _options_themeScales2;
695
+ const group = withFieldClear(withStyleFieldHelp({
696
+ $id: 'flex-grid',
697
+ label: 'Flexbox & Grid',
698
+ fields: [
699
+ // Container: the gutters between children, on the SPACING ladder
700
+ // (AGL-2486). A free-text box reads as a CSS length question and gets
701
+ // answered with one — but MUI runs all three gap keys through the
702
+ // same `createUnaryUnit(theme, 'spacing')` as margin and padding, so
703
+ // `2` follows the host's unit and `'16px'` does not. Same rungs the
704
+ // box styler offers, so the two controls agree.
705
+ presetField('gap', 'Gap', 'Space between the children, in both directions.', (_ref = options == null ? void 0 : (_options_themeScales = options.themeScales) == null ? void 0 : _options_themeScales.gap) != null ? _ref : []),
706
+ presetField('rowGap', 'Row Gap', 'Space between rows.', (_ref1 = options == null ? void 0 : (_options_themeScales1 = options.themeScales) == null ? void 0 : _options_themeScales1.gap) != null ? _ref1 : [], half),
707
+ presetField('columnGap', 'Column Gap', 'Space between columns.', (_ref2 = options == null ? void 0 : (_options_themeScales2 = options.themeScales) == null ? void 0 : _options_themeScales2.gap) != null ? _ref2 : [], half),
708
+ // Container: the grid it defines for them.
709
+ textField('gridTemplateColumns', 'Grid Columns', 'The columns this element lays its children out in — e.g. repeat(3, 1fr) for three equal ones.'),
710
+ textField('gridTemplateRows', 'Grid Rows', 'The rows this element lays its children out in — e.g. auto 1fr auto.'),
711
+ selectField('gridAutoFlow', 'Grid Auto Flow', 'The order children fill the grid in.', [
712
+ 'row',
713
+ 'column',
714
+ 'dense',
715
+ 'row dense',
716
+ 'column dense'
717
+ ]),
718
+ // Child: where THIS element sits in its own parent's layout.
719
+ textField('gridColumn', 'Grid Column', 'Which columns it spans.', half),
720
+ textField('gridRow', 'Grid Row', 'Which rows it spans.', half),
721
+ // Per-item flex sizing (AGL-587): grow/shrink/basis/order live
722
+ // together — they all describe this element as a flex/grid child.
723
+ textField('flexGrow', 'Flex Grow', 'Share of spare space it takes.', _extends({
724
+ type: 'number'
725
+ }, half)),
726
+ textField('flexShrink', 'Flex Shrink', 'How readily it gives space back.', _extends({
727
+ type: 'number'
728
+ }, half)),
729
+ dimensionField('flexBasis', 'Flex Basis', 'Its size before growing or shrinking.', half),
730
+ textField('order', 'Order', 'Where it sits among its siblings.', _extends({
731
+ type: 'number'
732
+ }, half))
733
+ ]
734
+ }));
735
+ return withStoredValueParse(group);
736
+ }
737
+ /** Field names owned by a group — the only keys its save may touch. */ export function styleGroupFieldNames(group) {
738
+ return group.fields.map((field)=>field.name);
739
+ }
740
+ /**
741
+ * The sx partial a group save is allowed to produce: exactly its own
742
+ * field names. Keys owned by other groups (or by the custom-CSS editor)
743
+ * never appear, so one group's auto-save can never clear another's
744
+ * values (AGL-540).
745
+ */ export function computeStylePartial(fieldNames, values) {
746
+ const partial = {};
747
+ for (const name of fieldNames){
748
+ partial[name] = values == null ? void 0 : values[name];
749
+ }
750
+ return partial;
751
+ }
752
+ /** Picks a group's own values out of the effective sx value map. */ export function pickStyleValues(fieldNames, values) {
753
+ const picked = {};
754
+ for (const name of fieldNames){
755
+ if (values && values[name] !== undefined) picked[name] = values[name];
756
+ }
757
+ return picked;
758
+ }
759
+ /**
760
+ * Style fields that carry a COLOR and therefore scope to the artboard's
761
+ * color scheme (AGL-588): while the canvas previews DARK, edits to these
762
+ * fields write into the sx dark slice so light keeps its own values.
763
+ * Everything else (spacing, sizing, layout…) is scheme-agnostic and
764
+ * always writes the base, no matter which scheme is previewed.
765
+ */ export const SCHEME_SCOPED_STYLE_FIELDS = [
766
+ 'color',
767
+ 'backgroundColor',
768
+ 'borderColor',
769
+ // A gradient IS colour (AGL-1331), so it scopes like the rest. Its
770
+ // token-bound stops already follow the palette per scheme on their own;
771
+ // this is what lets an author give dark its own gradient outright.
772
+ 'backgroundImage'
773
+ ];
774
+ const schemeScopedFields = new Set(SCHEME_SCOPED_STYLE_FIELDS);
775
+ /** Whether edits to this style field scope to the previewed color scheme. */ export function isSchemeScopedStyleField(name) {
776
+ return schemeScopedFields.has(name);
777
+ }
778
+ /**
779
+ * The sx scope one field's edit targets: color-bearing fields follow the
780
+ * previewed scheme; everything else stays scheme-agnostic (base writes).
781
+ */ function fieldSxScheme(name, scheme) {
782
+ return scheme === 'dark' && isSchemeScopedStyleField(name) ? 'dark' : null;
783
+ }
784
+ /**
785
+ * What a control's emitted value is STORED as (AGL-2486).
786
+ *
787
+ * The panel's free-text fields can only hand back a string, and for the
788
+ * fields whose bare number is a theme multiple that silently changes the
789
+ * value's MEANING. `borderRadius: 2` renders 8px because MUI multiplies a
790
+ * NUMBER by `shape.borderRadius`; the string `'2'` is passed through
791
+ * verbatim as `border-radius: 2` and dropped by the CSS parser. Same for
792
+ * `gap`/`rowGap`/`columnGap` against the spacing unit, and for
793
+ * `lineHeight`, where a unitless number is a ratio. Open the field on a
794
+ * node carrying the theme default, retype the same number, and the value
795
+ * is gone — with nothing anywhere to report it.
796
+ *
797
+ * The rule is the VALUE's shape ({@link numericTextValue}), not a list of
798
+ * field names, and it is enforced here rather than in each control: this is
799
+ * the merge every control in the panel writes through, so a field added
800
+ * later cannot arrive with the old behaviour. Anything carrying a
801
+ * non-numeric character (`8px`, `50%`, `1rem`, `span 2`) is what the author
802
+ * wrote and stays a string.
803
+ *
804
+ * Empty — including whitespace — clears. `0` does NOT: it is falsy and it
805
+ * is a legitimate radius, opacity and flex-grow, and `strictNullChecks` is
806
+ * off repo-wide, so the emptiness test is spelled out rather than left to
807
+ * a falsy check.
808
+ */ function normalizeStyleValue(value) {
809
+ if (typeof value !== 'string') return value;
810
+ if (value.trim() === '') return undefined;
811
+ return numericTextValue(value);
812
+ }
813
+ /**
814
+ * Merges a partial of style values into an sx object at the active
815
+ * breakpoint + scheme scope (AGL-333 / AGL-588). Unchanged values are
816
+ * skipped so effective (inherited) readings never get pinned into a
817
+ * breakpoint or scheme slice by round-tripping through a form. Empty
818
+ * strings clear, and purely numeric text is stored as a NUMBER — see
819
+ * {@link normalizeStyleValue}.
820
+ */ export function applyStylePartialToSx(sx, partial, breakpoint, scheme) {
821
+ // Alias keys the edit collides with are rewritten to the longhands this
822
+ // panel owns, FIRST and in place (AGL-2207). Without it, writing a field
823
+ // whose value is stored under an alias appends a second declaration and
824
+ // CLEARING that field deletes the longhand while the alias underneath
825
+ // keeps painting — the value comes straight back and no click in the
826
+ // product removes it. Scoped to the keys being edited, and to the same
827
+ // scheme slice, so an unrelated edit never rewrites a key the author did
828
+ // not touch.
829
+ let next = _extends({}, expandSxAliases(sx != null ? sx : {}, {
830
+ only: Object.keys(partial),
831
+ deep: true
832
+ }));
833
+ for (const [key, value] of Object.entries(partial)){
834
+ const normalized = normalizeStyleValue(value);
835
+ const fieldScheme = fieldSxScheme(key, scheme);
836
+ if (readSxValue(next, key, breakpoint, fieldScheme) === normalized) continue;
837
+ next = writeSxValue(next, key, normalized, breakpoint, fieldScheme);
838
+ }
839
+ return next;
840
+ }
841
+ /**
842
+ * Effective scalar style values at the active breakpoint + scheme scope
843
+ * — feeds the styles panel's forms and controls. Color-bearing fields
844
+ * resolve through the dark slice while the artboard previews dark
845
+ * (falling back to base where no override exists — exactly what
846
+ * renders); everything else reads the base. Responsive objects resolve
847
+ * to their active slice; nested objects are skipped.
848
+ */ export function computeEffectiveStyleValues(sx, breakpoint, scheme) {
849
+ // MUI's system-prop aliases resolve to the longhands this panel's fields
850
+ // are named for (AGL-2207) — a preset's `py: 4` or `bgcolor` renders, and
851
+ // without this reaches no control at all: the Padding box and the
852
+ // Background Color field simply read empty on a node that demonstrably
853
+ // has the value. The expansion keeps key ORDER, which is what makes it a
854
+ // renaming of what already renders rather than a restyle.
855
+ const source = expandSxAliases(sx != null ? sx : {}, {
856
+ deep: true
857
+ });
858
+ const keys = new Set(Object.keys(source));
859
+ keys.delete(SX_SCHEME_DARK_KEY);
860
+ if (scheme === 'dark') {
861
+ var _source_SX_SCHEME_DARK_KEY;
862
+ for (const key of Object.keys((_source_SX_SCHEME_DARK_KEY = source[SX_SCHEME_DARK_KEY]) != null ? _source_SX_SCHEME_DARK_KEY : {})){
863
+ keys.add(key);
864
+ }
865
+ }
866
+ const out = {};
867
+ for (const key of keys){
868
+ const value = readSxValue(source, key, breakpoint, fieldSxScheme(key, scheme));
869
+ if (value !== undefined && typeof value !== 'object') out[key] = value;
870
+ }
871
+ return out;
872
+ }
873
+
874
+ //# sourceMappingURL=style-field-groups.js.map