@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,193 @@
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 { expandSxAliases } from "@aglyn/shared-data-enums";
18
+ import { readSxValue, writeSxValue } from "./responsive-sx.js";
19
+ import { SX_STATE_SELECTORS } from "./state-sx.js";
20
+ const SCOPE_BASE = 'base';
21
+ /**
22
+ * The flag entry for a target. Encoded rather than stored as an object
23
+ * because the flag is a plain value compared by identity: a string list is
24
+ * cheap to test membership in and cheap to rewrite immutably.
25
+ */ export function mutedStyleKey(target) {
26
+ var _target_state, _target_breakpoint;
27
+ return [
28
+ target.nodeId,
29
+ (_target_state = target.state) != null ? _target_state : SCOPE_BASE,
30
+ (_target_breakpoint = target.breakpoint) != null ? _target_breakpoint : SCOPE_BASE,
31
+ target.property
32
+ ].join('|');
33
+ }
34
+ /** The target a flag entry stands for, or null when it is not one of ours. */ export function parseMutedStyleKey(key) {
35
+ const parts = key.split('|');
36
+ if (parts.length !== 4) return null;
37
+ const [nodeId, state, breakpoint, property] = parts;
38
+ if (!nodeId || !property) return null;
39
+ return {
40
+ nodeId,
41
+ property,
42
+ state: state === SCOPE_BASE ? null : state,
43
+ breakpoint: breakpoint === SCOPE_BASE ? null : breakpoint
44
+ };
45
+ }
46
+ /** Whether this declaration is muted in this scope. */ export function isStyleMuted(mutedStyles, target) {
47
+ const key = mutedStyleKey(target);
48
+ return !!(mutedStyles == null ? void 0 : mutedStyles.some((entry)=>entry === key));
49
+ }
50
+ /**
51
+ * The mute list with one declaration flipped. Returns a new array so the
52
+ * flag's subscribers see a changed value, and never mutates the input.
53
+ */ export function toggleMutedStyle(mutedStyles, target) {
54
+ const key = mutedStyleKey(target);
55
+ const current = mutedStyles != null ? mutedStyles : [];
56
+ return current.some((entry)=>entry === key) ? current.filter((entry)=>entry !== key) : [
57
+ ...current,
58
+ key
59
+ ];
60
+ }
61
+ /** Every mute recorded against one element. */ export function mutedStylesForNode(mutedStyles, nodeId) {
62
+ if (!nodeId || !(mutedStyles == null ? void 0 : mutedStyles.length)) return [];
63
+ const targets = [];
64
+ for (const entry of mutedStyles){
65
+ const target = parseMutedStyleKey(entry);
66
+ if (target && target.nodeId === nodeId) targets.push(target);
67
+ }
68
+ return targets;
69
+ }
70
+ const isPlainObject = (value)=>typeof value === 'object' && value !== null && !Array.isArray(value);
71
+ /**
72
+ * The record with one declaration removed.
73
+ *
74
+ * Aliases are expanded for the muted key first, for the reason
75
+ * `applyStylePartialToSx` expands them: a preset writes `bgcolor` and the
76
+ * panel calls the field `backgroundColor`, so muting the field has to reach
77
+ * the declaration that is actually painting.
78
+ *
79
+ * Which breakpoint slice goes follows what the author is looking at. A
80
+ * property carrying an own slice at the active breakpoint loses THAT slice,
81
+ * so the mobile-first cascade fills in from below — the devtools behaviour of
82
+ * unchecking a declaration inside one media block. A property with no own
83
+ * slice there is applying at that width through the cascade, and the whole
84
+ * declaration goes; the alternative is a control that reads as available and
85
+ * does nothing when clicked.
86
+ */ function muteDeclaration(record, property, breakpoint) {
87
+ const expanded = expandSxAliases(record, {
88
+ only: [
89
+ property
90
+ ],
91
+ deep: true
92
+ });
93
+ if (readSxValue(expanded, property, breakpoint != null ? breakpoint : null) === undefined) {
94
+ return record;
95
+ }
96
+ const value = expanded[property];
97
+ const ownSlice = isPlainObject(value) && Object.prototype.hasOwnProperty.call(value, breakpoint != null ? breakpoint : 'xs');
98
+ if (ownSlice) {
99
+ return writeSxValue(expanded, property, undefined, breakpoint != null ? breakpoint : null);
100
+ }
101
+ const next = _extends({}, expanded);
102
+ delete next[property];
103
+ return next;
104
+ }
105
+ /** One target applied to one plain sx record. */ function muteOne(sx, target) {
106
+ if (!target.state) {
107
+ return muteDeclaration(sx, target.property, target.breakpoint);
108
+ }
109
+ const selector = SX_STATE_SELECTORS[target.state];
110
+ const slice = sx[selector];
111
+ if (!isPlainObject(slice)) return sx;
112
+ const nextSlice = muteDeclaration(slice, target.property, target.breakpoint);
113
+ if (nextSlice === slice) return sx;
114
+ const next = _extends({}, sx);
115
+ if (Object.keys(nextSlice).length) next[selector] = nextSlice;
116
+ else delete next[selector];
117
+ return next;
118
+ }
119
+ /**
120
+ * CANVAS ONLY: the element's sx with its muted declarations removed.
121
+ *
122
+ * Runs on the fully merged sx at the one point in `Leaf` where it reaches the
123
+ * element, and BEFORE the interaction-state hoist: a muted base declaration
124
+ * has to be gone before a hover slice is folded over it, and a muted hover
125
+ * declaration has to leave its slice so the base shows through.
126
+ *
127
+ * Handles the array form of sx for the same reason `hoistStateSx` does — a
128
+ * component may compose its own sx with the author's. Returns the input BY
129
+ * IDENTITY when nothing is muted, which is every element in every session
130
+ * where nobody has opened the comparison.
131
+ */ export function applyMutedStyles(sx, nodeId, mutedStyles) {
132
+ const targets = mutedStylesForNode(mutedStyles, nodeId);
133
+ if (!targets.length) return sx;
134
+ return muteTargets(sx, targets);
135
+ }
136
+ function muteTargets(sx, targets) {
137
+ if (Array.isArray(sx)) {
138
+ let changed = false;
139
+ const next = sx.map((entry)=>{
140
+ const value = muteTargets(entry, targets);
141
+ if (value !== entry) changed = true;
142
+ return value;
143
+ });
144
+ return changed ? next : sx;
145
+ }
146
+ if (!isPlainObject(sx)) return sx;
147
+ let out = sx;
148
+ for (const target of targets)out = muteOne(out, target);
149
+ return out === sx ? sx : out;
150
+ }
151
+ /** The mute control for one field, or nothing when there is none to offer. */ export function buildStyleMute(name, label, scope) {
152
+ var _scope_state, _scope_breakpoint;
153
+ if (!scope.nodeId || !name) return undefined;
154
+ const target = {
155
+ nodeId: scope.nodeId,
156
+ property: name,
157
+ state: (_scope_state = scope.state) != null ? _scope_state : null,
158
+ breakpoint: (_scope_breakpoint = scope.breakpoint) != null ? _scope_breakpoint : null
159
+ };
160
+ const muted = isStyleMuted(scope.mutedStyles, target);
161
+ // A row with nothing declared in this scope has nothing to switch off. A
162
+ // muted row keeps its control however it reads, or there would be no way
163
+ // back to the value it is still holding.
164
+ if (!muted && scope.scopeValues[name] === undefined) return undefined;
165
+ const named = typeof label === 'string' && label ? label : 'this style';
166
+ return {
167
+ label: muted ? `Apply ${named} again` : `Stop applying ${named} while designing`,
168
+ muted,
169
+ onToggle: ()=>scope.onToggle(target)
170
+ };
171
+ }
172
+ /**
173
+ * A group's field declarations carrying their per-row mute control.
174
+ *
175
+ * Supplied through `FormFieldGridProps`, which every editor in the shared
176
+ * mapper spreads onto its wrapper, so the affordance arrives on every field
177
+ * without each editor knowing anything about it. Fields with nothing to mute
178
+ * come back BY IDENTITY, so a panel where nothing is set re-renders exactly
179
+ * as it did before.
180
+ */ export function withStyleMuteControls(fields, scope) {
181
+ return fields.map((field)=>{
182
+ var _ref, _field_FormFieldGridProps;
183
+ const mute = buildStyleMute((_ref = field == null ? void 0 : field.name) != null ? _ref : '', field == null ? void 0 : field.label, scope);
184
+ if (!mute) return field;
185
+ return _extends({}, field, {
186
+ FormFieldGridProps: _extends({}, (_field_FormFieldGridProps = field.FormFieldGridProps) != null ? _field_FormFieldGridProps : {}, {
187
+ mute
188
+ })
189
+ });
190
+ });
191
+ }
192
+
193
+ //# sourceMappingURL=muted-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/muted-styles.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { expandSxAliases } from '@aglyn/shared-data-enums'\nimport type { FieldMuteAction } from '@aglyn/shared-ui-jsx-forms'\n\nimport { readSxValue, type SxBreakpoint, writeSxValue } from './responsive-sx'\nimport { SX_STATE_SELECTORS, type SxState } from './state-sx'\n\n/**\n * Muting one style declaration while designing (AGL-2486).\n *\n * ## What this is\n *\n * Every field in the Styles panel could set a value and take one off, and\n * nothing in between. Seeing a layout without its `maxWidth` meant deleting\n * the value and typing it back afterwards — which loses the very thing being\n * compared against. This is the browser-devtools checkbox: the declaration\n * stops applying, its value stays where it is, and one click puts it back.\n *\n * ## Canvas only, and the value is never moved\n *\n * A mute is held in the `mutedStyles` canvas flag, alongside `heldState`. The\n * document is not touched at all — the declaration stays in `node.sx` exactly\n * where the author left it, and the canvas renders a COPY with it removed,\n * through the same `LeafSxTransformContext` seam the artboard device pin and\n * the interaction-state hold already use.\n *\n * That is what makes the two requirements of a comparison tool hold at once.\n * The value is not parked somewhere and restored later, so turning a mute back\n * off cannot fail or lose anything; and nothing disabled can reach a published\n * page, because there is nothing in the document to reach it — no reserved sx\n * key for a renderer to recognise, no substitution pass on the tenant's render\n * path, and nothing for a publish to serialize. The cost is that a mute is a\n * session's worth of comparison rather than a saved state: reload, and every\n * declaration is applying again.\n *\n * ## Scope\n *\n * A mute belongs to the scope the panel was in when it was made — the\n * interaction state and the breakpoint the chips name. Muting `color` in the\n * hover slice leaves the default one applying, and a mute made while styling\n * SM is not in force at \"all screen sizes\".\n */\n\n/** One muted declaration, in the scope it was muted in. */\nexport interface MutedStyleTarget {\n nodeId: string\n /** sx property key, in the panel's spelling (`backgroundColor`, not `bgcolor`). */\n property: string\n /** Interaction-state slice, or null for the element's default styles. */\n state?: SxState | null\n /** Breakpoint scope, or null for \"all screen sizes\". */\n breakpoint?: SxBreakpoint | null\n}\n\nconst SCOPE_BASE = 'base'\n\n/**\n * The flag entry for a target. Encoded rather than stored as an object\n * because the flag is a plain value compared by identity: a string list is\n * cheap to test membership in and cheap to rewrite immutably.\n */\nexport function mutedStyleKey(target: MutedStyleTarget): string {\n return [\n target.nodeId,\n target.state ?? SCOPE_BASE,\n target.breakpoint ?? SCOPE_BASE,\n target.property,\n ].join('|')\n}\n\n/** The target a flag entry stands for, or null when it is not one of ours. */\nexport function parseMutedStyleKey(key: string): MutedStyleTarget | null {\n const parts = key.split('|')\n if (parts.length !== 4) return null\n const [nodeId, state, breakpoint, property] = parts\n if (!nodeId || !property) return null\n return {\n nodeId,\n property,\n state: state === SCOPE_BASE ? null : (state as SxState),\n breakpoint: breakpoint === SCOPE_BASE ? null : (breakpoint as SxBreakpoint),\n }\n}\n\n/** Whether this declaration is muted in this scope. */\nexport function isStyleMuted(\n mutedStyles: readonly string[] | undefined,\n target: MutedStyleTarget,\n): boolean {\n const key = mutedStyleKey(target)\n return !!mutedStyles?.some((entry) => entry === key)\n}\n\n/**\n * The mute list with one declaration flipped. Returns a new array so the\n * flag's subscribers see a changed value, and never mutates the input.\n */\nexport function toggleMutedStyle(\n mutedStyles: readonly string[] | undefined,\n target: MutedStyleTarget,\n): string[] {\n const key = mutedStyleKey(target)\n const current = mutedStyles ?? []\n return current.some((entry) => entry === key)\n ? current.filter((entry) => entry !== key)\n : [...current, key]\n}\n\n/** Every mute recorded against one element. */\nexport function mutedStylesForNode(\n mutedStyles: readonly string[] | undefined,\n nodeId: string | undefined,\n): MutedStyleTarget[] {\n if (!nodeId || !mutedStyles?.length) return []\n const targets: MutedStyleTarget[] = []\n for (const entry of mutedStyles) {\n const target = parseMutedStyleKey(entry)\n if (target && target.nodeId === nodeId) targets.push(target)\n }\n return targets\n}\n\nconst isPlainObject = (value: unknown): value is Record<string, any> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\n/**\n * The record with one declaration removed.\n *\n * Aliases are expanded for the muted key first, for the reason\n * `applyStylePartialToSx` expands them: a preset writes `bgcolor` and the\n * panel calls the field `backgroundColor`, so muting the field has to reach\n * the declaration that is actually painting.\n *\n * Which breakpoint slice goes follows what the author is looking at. A\n * property carrying an own slice at the active breakpoint loses THAT slice,\n * so the mobile-first cascade fills in from below — the devtools behaviour of\n * unchecking a declaration inside one media block. A property with no own\n * slice there is applying at that width through the cascade, and the whole\n * declaration goes; the alternative is a control that reads as available and\n * does nothing when clicked.\n */\nfunction muteDeclaration(\n record: Record<string, any>,\n property: string,\n breakpoint: SxBreakpoint | null | undefined,\n): Record<string, any> {\n const expanded = expandSxAliases(record, { only: [property], deep: true })\n if (readSxValue(expanded, property, breakpoint ?? null) === undefined) {\n return record\n }\n const value = expanded[property]\n const ownSlice =\n isPlainObject(value) &&\n Object.prototype.hasOwnProperty.call(value, breakpoint ?? 'xs')\n if (ownSlice) {\n return writeSxValue(expanded, property, undefined, breakpoint ?? null)\n }\n const next = { ...expanded }\n delete next[property]\n return next\n}\n\n/** One target applied to one plain sx record. */\nfunction muteOne(\n sx: Record<string, any>,\n target: MutedStyleTarget,\n): Record<string, any> {\n if (!target.state) {\n return muteDeclaration(sx, target.property, target.breakpoint)\n }\n const selector = SX_STATE_SELECTORS[target.state]\n const slice = sx[selector]\n if (!isPlainObject(slice)) return sx\n const nextSlice = muteDeclaration(slice, target.property, target.breakpoint)\n if (nextSlice === slice) return sx\n const next = { ...sx }\n if (Object.keys(nextSlice).length) next[selector] = nextSlice\n else delete next[selector]\n return next\n}\n\n/**\n * CANVAS ONLY: the element's sx with its muted declarations removed.\n *\n * Runs on the fully merged sx at the one point in `Leaf` where it reaches the\n * element, and BEFORE the interaction-state hoist: a muted base declaration\n * has to be gone before a hover slice is folded over it, and a muted hover\n * declaration has to leave its slice so the base shows through.\n *\n * Handles the array form of sx for the same reason `hoistStateSx` does — a\n * component may compose its own sx with the author's. Returns the input BY\n * IDENTITY when nothing is muted, which is every element in every session\n * where nobody has opened the comparison.\n */\nexport function applyMutedStyles<T>(\n sx: T,\n nodeId: string | undefined,\n mutedStyles: readonly string[] | undefined,\n): T {\n const targets = mutedStylesForNode(mutedStyles, nodeId)\n if (!targets.length) return sx\n return muteTargets(sx, targets)\n}\n\nfunction muteTargets<T>(sx: T, targets: MutedStyleTarget[]): T {\n if (Array.isArray(sx)) {\n let changed = false\n const next = sx.map((entry) => {\n const value = muteTargets(entry, targets)\n if (value !== entry) changed = true\n return value\n })\n return (changed ? next : sx) as unknown as T\n }\n if (!isPlainObject(sx)) return sx\n let out = sx as Record<string, any>\n for (const target of targets) out = muteOne(out, target)\n return (out === sx ? sx : out) as unknown as T\n}\n\n/** What the panel needs to know to offer a row's mute control. */\nexport interface StyleMuteScope {\n nodeId?: string\n state?: SxState | null\n breakpoint?: SxBreakpoint | null\n /**\n * What the ACTIVE SCOPE declares, keyed by field name — not what the panel\n * displays. The two differ in a state scope, where a field the author has\n * not overridden for hover still shows the base value it inherits: there is\n * no hover declaration to switch off, so that row gets no control.\n */\n scopeValues: Record<string, unknown>\n mutedStyles?: readonly string[]\n onToggle: (target: MutedStyleTarget) => void\n}\n\n/** The mute control for one field, or nothing when there is none to offer. */\nexport function buildStyleMute(\n name: string,\n label: unknown,\n scope: StyleMuteScope,\n): FieldMuteAction | undefined {\n if (!scope.nodeId || !name) return undefined\n const target: MutedStyleTarget = {\n nodeId: scope.nodeId,\n property: name,\n state: scope.state ?? null,\n breakpoint: scope.breakpoint ?? null,\n }\n const muted = isStyleMuted(scope.mutedStyles, target)\n // A row with nothing declared in this scope has nothing to switch off. A\n // muted row keeps its control however it reads, or there would be no way\n // back to the value it is still holding.\n if (!muted && scope.scopeValues[name] === undefined) return undefined\n const named = typeof label === 'string' && label ? label : 'this style'\n return {\n label: muted\n ? `Apply ${named} again`\n : `Stop applying ${named} while designing`,\n muted,\n onToggle: () => scope.onToggle(target),\n }\n}\n\n/**\n * A group's field declarations carrying their per-row mute control.\n *\n * Supplied through `FormFieldGridProps`, which every editor in the shared\n * mapper spreads onto its wrapper, so the affordance arrives on every field\n * without each editor knowing anything about it. Fields with nothing to mute\n * come back BY IDENTITY, so a panel where nothing is set re-renders exactly\n * as it did before.\n */\nexport function withStyleMuteControls<\n T extends { name?: string; label?: unknown },\n>(fields: readonly T[], scope: StyleMuteScope): T[] {\n return fields.map((field) => {\n const mute = buildStyleMute(field?.name ?? '', field?.label, scope)\n if (!mute) return field\n return {\n ...field,\n FormFieldGridProps: {\n ...((field as { FormFieldGridProps?: object }).FormFieldGridProps ??\n {}),\n mute,\n },\n }\n })\n}\n"],"names":["expandSxAliases","readSxValue","writeSxValue","SX_STATE_SELECTORS","SCOPE_BASE","mutedStyleKey","target","nodeId","state","breakpoint","property","join","parseMutedStyleKey","key","parts","split","length","isStyleMuted","mutedStyles","some","entry","toggleMutedStyle","current","filter","mutedStylesForNode","targets","push","isPlainObject","value","Array","isArray","muteDeclaration","record","expanded","only","deep","undefined","ownSlice","Object","prototype","hasOwnProperty","call","next","muteOne","sx","selector","slice","nextSlice","keys","applyMutedStyles","muteTargets","changed","map","out","buildStyleMute","name","label","scope","muted","scop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D,eAAe;QACtBhD,UAAU,GAAEgD,oBAAAA,MAAMhD,UAAU,YAAhBgD,oBAAoB;IAClC;IACA,MAAMC,QAAQzC,aAAawC,MAAMvC,WAAW,EAAEZ;IAC9C,yEAAyE;IACzE,yEAAyE;IACzE,yCAAyC;IACzC,IAAI,CAACoD,SAASD,MAAME,WAAW,CAACJ,KAAK,KAAKnB,WAAW,OAAOA;IAC5D,MAAMwB,QAAQ,OAAOJ,UAAU,YAAYA,QAAQA,QAAQ;IAC3D,OAAO;QACLA,OAAOE,QACH,CAAC,MAAM,EAAEE,MAAM,MAAM,CAAC,GACtB,CAAC,cAAc,EAAEA,MAAM,gBAAgB,CAAC;QAC5CF;QACAG,UAAU,IAAMJ,MAAMI,QAAQ,CAACvD;IACjC;AACF;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASwD,sBAEdC,MAAoB,EAAEN,KAAqB;IAC3C,OAAOM,OAAOX,GAAG,CAAC,CAACY;kBAMT;QALR,MAAMC,OAAOX,uBAAeU,yBAAAA,MAAOT,IAAI,mBAAI,IAAIS,yBAAAA,MAAOR,KAAK,EAAEC;QAC7D,IAAI,CAACQ,MAAM,OAAOD;QAClB,OAAO,aACFA;YACHE,oBAAoB,cACd,4BAAA,AAACF,MAA0CE,kBAAkB,YAA7D,4BACF,CAAC;gBACHD;;;IAGN;AACF"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Text that is ENTIRELY a number — the only shape a text control stores as
19
+ * a number.
20
+ *
21
+ * Deliberately narrower than `Number()` would accept: no exponent form, no
22
+ * `Infinity`, no hex. Those parse to a number and are not values any of the
23
+ * designer's controls offer, so converting them would only make the stored
24
+ * value harder to read back than the text the author actually typed.
25
+ */
26
+ export declare const NUMERIC_TEXT_VALUE: RegExp;
27
+ /**
28
+ * The NUMBER a control's text stands for, or the value unchanged.
29
+ *
30
+ * Every free-text control in the designer can only hand back a string, and
31
+ * for the values whose type carries meaning that changes what the value
32
+ * DOES: MUI multiplies a number by a theme unit and passes a string through
33
+ * verbatim, so `fontSize: 24` renders 24px while `fontSize: '24'` is not
34
+ * CSS at all and the declaration is dropped. Both panels that write those
35
+ * values normalize through here so the rule reads the same in each.
36
+ *
37
+ * Whitespace around an otherwise numeric value is incidental to typing and
38
+ * is dropped with it; text carrying any non-numeric character (`8px`,
39
+ * `50%`, `span 2`, a `{{var:id}}` binding) is what the author wrote and
40
+ * comes back untouched, whitespace and all.
41
+ */
42
+ export declare function numericTextValue(value: unknown): unknown;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Text that is ENTIRELY a number — the only shape a text control stores as
18
+ * a number.
19
+ *
20
+ * Deliberately narrower than `Number()` would accept: no exponent form, no
21
+ * `Infinity`, no hex. Those parse to a number and are not values any of the
22
+ * designer's controls offer, so converting them would only make the stored
23
+ * value harder to read back than the text the author actually typed.
24
+ */ export const NUMERIC_TEXT_VALUE = /^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/;
25
+ /**
26
+ * The NUMBER a control's text stands for, or the value unchanged.
27
+ *
28
+ * Every free-text control in the designer can only hand back a string, and
29
+ * for the values whose type carries meaning that changes what the value
30
+ * DOES: MUI multiplies a number by a theme unit and passes a string through
31
+ * verbatim, so `fontSize: 24` renders 24px while `fontSize: '24'` is not
32
+ * CSS at all and the declaration is dropped. Both panels that write those
33
+ * values normalize through here so the rule reads the same in each.
34
+ *
35
+ * Whitespace around an otherwise numeric value is incidental to typing and
36
+ * is dropped with it; text carrying any non-numeric character (`8px`,
37
+ * `50%`, `span 2`, a `{{var:id}}` binding) is what the author wrote and
38
+ * comes back untouched, whitespace and all.
39
+ */ export function numericTextValue(value) {
40
+ if (typeof value !== 'string') return value;
41
+ const text = value.trim();
42
+ if (!NUMERIC_TEXT_VALUE.test(text)) return value;
43
+ const numeric = Number(text);
44
+ return Number.isFinite(numeric) ? numeric : value;
45
+ }
46
+
47
+ //# sourceMappingURL=numeric-text-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/numeric-text-value.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Text that is ENTIRELY a number — the only shape a text control stores as\n * a number.\n *\n * Deliberately narrower than `Number()` would accept: no exponent form, no\n * `Infinity`, no hex. Those parse to a number and are not values any of the\n * designer's controls offer, so converting them would only make the stored\n * value harder to read back than the text the author actually typed.\n */\nexport const NUMERIC_TEXT_VALUE = /^[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/\n\n/**\n * The NUMBER a control's text stands for, or the value unchanged.\n *\n * Every free-text control in the designer can only hand back a string, and\n * for the values whose type carries meaning that changes what the value\n * DOES: MUI multiplies a number by a theme unit and passes a string through\n * verbatim, so `fontSize: 24` renders 24px while `fontSize: '24'` is not\n * CSS at all and the declaration is dropped. Both panels that write those\n * values normalize through here so the rule reads the same in each.\n *\n * Whitespace around an otherwise numeric value is incidental to typing and\n * is dropped with it; text carrying any non-numeric character (`8px`,\n * `50%`, `span 2`, a `{{var:id}}` binding) is what the author wrote and\n * comes back untouched, whitespace and all.\n */\nexport function numericTextValue(value: unknown): unknown {\n if (typeof value !== 'string') return value\n const text = value.trim()\n if (!NUMERIC_TEXT_VALUE.test(text)) return value\n const numeric = Number(text)\n return Number.isFinite(numeric) ? numeric : value\n}\n"],"names":["NUMERIC_TEXT_VALUE","numericTextValue","value","text","trim","test","numeric","Number","isFinite"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;CAQC,GACD,OAAO,MAAMA,qBAAqB,iCAAgC;AAElE;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,iBAAiBC,KAAc;IAC7C,IAAI,OAAOA,UAAU,UAAU,OAAOA;IACtC,MAAMC,OAAOD,MAAME,IAAI;IACvB,IAAI,CAACJ,mBAAmBK,IAAI,CAACF,OAAO,OAAOD;IAC3C,MAAMI,UAAUC,OAAOJ;IACvB,OAAOI,OAAOC,QAAQ,CAACF,WAAWA,UAAUJ;AAC9C"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { NodeSchema, NodeSchemaNested, PresetSchema } from '@aglyn/aglyn';
18
+ import { type PresetInteractionDraft } from '../contexts/interactions-context';
19
+ /**
20
+ * Resolves a preset's `presetRef` markers to the node ids minted at
21
+ * insert time (AGL-589). `createDuplicateNode` clones the preset's
22
+ * `data` tree preserving field values and child order, so the authored
23
+ * tree and the inserted subtree walk in lockstep — pairing them
24
+ * positionally maps each marker to its live id without the preset ever
25
+ * knowing ids exist.
26
+ */
27
+ export declare function collectPresetRefIds(data: NodeSchemaNested<any> | undefined, live: NodeSchema<any> | undefined | null): Record<string, string>;
28
+ /**
29
+ * Materializes a preset's interaction templates into ready-to-persist
30
+ * drafts: refs become `[data-aglyn="leaf:<id>"]` selectors. Templates
31
+ * (or steps) whose refs don't resolve are dropped rather than written
32
+ * broken — an unresolved ref means the preset author renamed a marker
33
+ * without updating the template, and a selector-less action would fail
34
+ * validation anyway.
35
+ */
36
+ export declare function buildPresetInteractionDrafts(preset: PresetSchema<any>, live: NodeSchema<any> | undefined | null): PresetInteractionDraft[];
37
+ export default buildPresetInteractionDrafts;
@@ -0,0 +1,87 @@
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
+ */ import { _ as _extends } from "@swc/helpers/_/_extends";
17
+ import { nodeElementSelector } from "../contexts/interactions-context.js";
18
+ /**
19
+ * Resolves a preset's `presetRef` markers to the node ids minted at
20
+ * insert time (AGL-589). `createDuplicateNode` clones the preset's
21
+ * `data` tree preserving field values and child order, so the authored
22
+ * tree and the inserted subtree walk in lockstep — pairing them
23
+ * positionally maps each marker to its live id without the preset ever
24
+ * knowing ids exist.
25
+ */ export function collectPresetRefIds(data, live) {
26
+ const refs = {};
27
+ const walk = (dataNode, liveNode)=>{
28
+ var _dataNode_nodes, _liveNode_children;
29
+ if (!dataNode || !liveNode) return;
30
+ if (dataNode.presetRef && liveNode.$id != null) {
31
+ refs[dataNode.presetRef] = String(liveNode.$id);
32
+ }
33
+ const dataChildren = (_dataNode_nodes = dataNode.nodes) != null ? _dataNode_nodes : [];
34
+ const liveChildren = (_liveNode_children = liveNode.children) != null ? _liveNode_children : [];
35
+ for(let index = 0; index < dataChildren.length; index += 1){
36
+ walk(dataChildren[index], liveChildren[index]);
37
+ }
38
+ };
39
+ walk(data, live != null ? live : undefined);
40
+ return refs;
41
+ }
42
+ /**
43
+ * Materializes a preset's interaction templates into ready-to-persist
44
+ * drafts: refs become `[data-aglyn="leaf:<id>"]` selectors. Templates
45
+ * (or steps) whose refs don't resolve are dropped rather than written
46
+ * broken — an unresolved ref means the preset author renamed a marker
47
+ * without updating the template, and a selector-less action would fail
48
+ * validation anyway.
49
+ */ export function buildPresetInteractionDrafts(preset, live) {
50
+ var _ref;
51
+ const interactions = (_ref = preset == null ? void 0 : preset.interactionTemplates) != null ? _ref : [];
52
+ if (!interactions.length || !live) return [];
53
+ const refs = collectPresetRefIds(preset.data, live);
54
+ const drafts = [];
55
+ for (const interaction of interactions){
56
+ var _interaction_steps;
57
+ const triggerId = refs[interaction.triggerRef];
58
+ if (!triggerId) continue;
59
+ const steps = [];
60
+ for (const step of (_interaction_steps = interaction.steps) != null ? _interaction_steps : []){
61
+ var _step_dismissOn;
62
+ const targetId = refs[step.targetRef];
63
+ if (!targetId) continue;
64
+ steps.push(_extends({
65
+ type: step.type,
66
+ selector: nodeElementSelector(targetId)
67
+ }, typeof step.delayMs === 'number' ? {
68
+ delayMs: step.delayMs
69
+ } : {}, ((_step_dismissOn = step.dismissOn) == null ? void 0 : _step_dismissOn.length) ? {
70
+ dismissOn: [
71
+ ...step.dismissOn
72
+ ]
73
+ } : {}));
74
+ }
75
+ if (!steps.length) continue;
76
+ drafts.push({
77
+ name: interaction.name,
78
+ event: interaction.event,
79
+ selector: nodeElementSelector(triggerId),
80
+ steps
81
+ });
82
+ }
83
+ return drafts;
84
+ }
85
+ export default buildPresetInteractionDrafts;
86
+
87
+ //# sourceMappingURL=preset-interactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/preset-interactions.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { NodeSchema, NodeSchemaNested, PresetSchema } from '@aglyn/aglyn'\nimport {\n nodeElementSelector,\n type PresetInteractionDraft,\n type PresetInteractionDraftStep,\n} from '../contexts/interactions-context'\n\n/**\n * Resolves a preset's `presetRef` markers to the node ids minted at\n * insert time (AGL-589). `createDuplicateNode` clones the preset's\n * `data` tree preserving field values and child order, so the authored\n * tree and the inserted subtree walk in lockstep — pairing them\n * positionally maps each marker to its live id without the preset ever\n * knowing ids exist.\n */\nexport function collectPresetRefIds(\n data: NodeSchemaNested<any> | undefined,\n live: NodeSchema<any> | undefined | null,\n): Record<string, string> {\n const refs: Record<string, string> = {}\n const walk = (\n dataNode: NodeSchemaNested<any> | undefined,\n liveNode: NodeSchema<any> | undefined,\n ): void => {\n if (!dataNode || !liveNode) return\n if (dataNode.presetRef && liveNode.$id != null) {\n refs[dataNode.presetRef] = String(liveNode.$id)\n }\n const dataChildren = dataNode.nodes ?? []\n const liveChildren = liveNode.children ?? []\n for (let index = 0; index < dataChildren.length; index += 1) {\n walk(dataChildren[index], liveChildren[index])\n }\n }\n walk(data, live ?? undefined)\n return refs\n}\n\n/**\n * Materializes a preset's interaction templates into ready-to-persist\n * drafts: refs become `[data-aglyn=\"leaf:<id>\"]` selectors. Templates\n * (or steps) whose refs don't resolve are dropped rather than written\n * broken — an unresolved ref means the preset author renamed a marker\n * without updating the template, and a selector-less action would fail\n * validation anyway.\n */\nexport function buildPresetInteractionDrafts(\n preset: PresetSchema<any>,\n live: NodeSchema<any> | undefined | null,\n): PresetInteractionDraft[] {\n const interactions = preset?.interactionTemplates ?? []\n if (!interactions.length || !live) return []\n const refs = collectPresetRefIds(preset.data, live)\n const drafts: PresetInteractionDraft[] = []\n for (const interaction of interactions) {\n const triggerId = refs[interaction.triggerRef]\n if (!triggerId) continue\n const steps: PresetInteractionDraftStep[] = []\n for (const step of interaction.steps ?? []) {\n const targetId = refs[step.targetRef]\n if (!targetId) continue\n steps.push({\n type: step.type,\n selector: nodeElementSelector(targetId),\n ...(typeof step.delayMs === 'number' ? { delayMs: step.delayMs } : {}),\n ...(step.dismissOn?.length ? { dismissOn: [...step.dismissOn] } : {}),\n })\n }\n if (!steps.length) continue\n drafts.push({\n name: interaction.name,\n event: interaction.event,\n selector: nodeElementSelector(triggerId),\n steps,\n })\n }\n return drafts\n}\n\nexport default buildPresetInteractionDrafts\n"],"names":["nodeElementSelector","collectPresetRefIds","data","live","refs","walk","dataNode","liveNode","presetRef","$id","String","dataChildren","nodes","liveChildren","children","index","length","undefined","buildPresetInteractionDrafts","preset","interactions","interactionTemplates","drafts","interaction","triggerId","triggerRef","steps","step","targetId","targetRef","push","type","selector","delayMs","dismissOn","name","event"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAGD,SACEA,mBAAmB,QAGd,sCAAkC;AAEzC;;;;;;;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,MAAMJ,KAAKI,IAAI;gBACfC,UAAUhC,oBAAoB4B;eAC1B,OAAOD,KAAKM,OAAO,KAAK,WAAW;gBAAEA,SAASN,KAAKM,OAAO;YAAC,IAAI,CAAC,GAChEN,EAAAA,kBAAAA,KAAKO,SAAS,qBAAdP,gBAAgBX,MAAM,IAAG;gBAAEkB,WAAW;uBAAIP,KAAKO,SAAS;iBAAC;YAAC,IAAI,CAAC;QAEvE;QACA,IAAI,CAACR,MAAMV,MAAM,EAAE;QACnBM,OAAOQ,IAAI,CAAC;YACVK,MAAMZ,YAAYY,IAAI;YACtBC,OAAOb,YAAYa,KAAK;YACxBJ,UAAUhC,oBAAoBwB;YAC9BE;QACF;IACF;IACA,OAAOJ;AACT;AAEA,eAAeJ,6BAA4B"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * What to tell an author whose publish threw (AGL-1334).
19
+ *
20
+ * A failed publish used to surface the raw thrown message — for the bug this
21
+ * fixes, a Firestore "called with invalid data, unsupported field value:
22
+ * undefined, found in field nodes.(id).props.startIconPath" — in a toast that
23
+ * auto-dismissed. That is the most dangerous possible
24
+ * failure surface for this action: publishing is the ONLY step that moves work
25
+ * onto live pages, the editor still reads `UP TO DATE` (the save really did
26
+ * succeed), and an author who misses the toast walks away believing the
27
+ * component shipped while every instance keeps rendering the old markup. It is
28
+ * how AGL-1318's fix sat stranded for hours.
29
+ *
30
+ * So every message here leads with the fact that matters — the live pages did
31
+ * NOT change — and names a next step. The underlying text is kept, last, for
32
+ * a bug report; it is evidence, not an explanation.
33
+ */
34
+ export declare function publishFailureMessage(error: unknown): string;
35
+ export default publishFailureMessage;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * What to tell an author whose publish threw (AGL-1334).
18
+ *
19
+ * A failed publish used to surface the raw thrown message — for the bug this
20
+ * fixes, a Firestore "called with invalid data, unsupported field value:
21
+ * undefined, found in field nodes.(id).props.startIconPath" — in a toast that
22
+ * auto-dismissed. That is the most dangerous possible
23
+ * failure surface for this action: publishing is the ONLY step that moves work
24
+ * onto live pages, the editor still reads `UP TO DATE` (the save really did
25
+ * succeed), and an author who misses the toast walks away believing the
26
+ * component shipped while every instance keeps rendering the old markup. It is
27
+ * how AGL-1318's fix sat stranded for hours.
28
+ *
29
+ * So every message here leads with the fact that matters — the live pages did
30
+ * NOT change — and names a next step. The underlying text is kept, last, for
31
+ * a bug report; it is evidence, not an explanation.
32
+ */ export function publishFailureMessage(error) {
33
+ const detail = error instanceof Error ? error.message : typeof error === 'string' ? error : '';
34
+ const lead = 'Not published — live pages still show the previous version.';
35
+ if (/permission|insufficient|unauthenticated/i.test(detail)) {
36
+ return `${lead} You do not have permission to publish this component. Ask an owner or admin of this site to publish it.`;
37
+ }
38
+ if (/invalid data|unsupported field value/i.test(detail)) {
39
+ return `${lead} This component has an element the site cannot store. Reload the editor and publish again — if it happens twice, report it with this: ${detail}`;
40
+ }
41
+ if (/offline|unavailable|network|deadline/i.test(detail)) {
42
+ return `${lead} The site could not be reached. Check your connection and publish again.`;
43
+ }
44
+ if (!detail) {
45
+ return `${lead} Publishing failed for an unknown reason — reload the editor and try again.`;
46
+ }
47
+ return `${lead} Publishing failed: ${detail}`;
48
+ }
49
+ export default publishFailureMessage;
50
+
51
+ //# sourceMappingURL=publish-failure-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/publish-failure-message.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * What to tell an author whose publish threw (AGL-1334).\n *\n * A failed publish used to surface the raw thrown message — for the bug this\n * fixes, a Firestore \"called with invalid data, unsupported field value:\n * undefined, found in field nodes.(id).props.startIconPath\" — in a toast that\n * auto-dismissed. That is the most dangerous possible\n * failure surface for this action: publishing is the ONLY step that moves work\n * onto live pages, the editor still reads `UP TO DATE` (the save really did\n * succeed), and an author who misses the toast walks away believing the\n * component shipped while every instance keeps rendering the old markup. It is\n * how AGL-1318's fix sat stranded for hours.\n *\n * So every message here leads with the fact that matters — the live pages did\n * NOT change — and names a next step. The underlying text is kept, last, for\n * a bug report; it is evidence, not an explanation.\n */\nexport function publishFailureMessage(error: unknown): string {\n const detail =\n error instanceof Error\n ? error.message\n : typeof error === 'string'\n ? error\n : ''\n const lead = 'Not published — live pages still show the previous version.'\n\n if (/permission|insufficient|unauthenticated/i.test(detail)) {\n return `${lead} You do not have permission to publish this component. Ask an owner or admin of this site to publish it.`\n }\n if (/invalid data|unsupported field value/i.test(detail)) {\n return `${lead} This component has an element the site cannot store. Reload the editor and publish again — if it happens twice, report it with this: ${detail}`\n }\n if (/offline|unavailable|network|deadline/i.test(detail)) {\n return `${lead} The site could not be reached. Check your connection and publish again.`\n }\n if (!detail) {\n return `${lead} Publishing failed for an unknown reason — reload the editor and try again.`\n }\n return `${lead} Publishing failed: ${detail}`\n}\n\nexport default publishFailureMessage\n"],"names":["publishFailureMessage","error","detail","Error","message","lead","test"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASA,sBAAsBC,KAAc;IAClD,MAAMC,SACJD,iBAAiBE,QACbF,MAAMG,OAAO,GACb,OAAOH,UAAU,WACfA,QACA;IACR,MAAMI,OAAO;IAEb,IAAI,2CAA2CC,IAAI,CAACJ,SAAS;QAC3D,OAAO,GAAGG,KAAK,wGAAwG,CAAC;IAC1H;IACA,IAAI,wCAAwCC,IAAI,CAACJ,SAAS;QACxD,OAAO,GAAGG,KAAK,sIAAsI,EAAEH,QAAQ;IACjK;IACA,IAAI,wCAAwCI,IAAI,CAACJ,SAAS;QACxD,OAAO,GAAGG,KAAK,wEAAwE,CAAC;IAC1F;IACA,IAAI,CAACH,QAAQ;QACX,OAAO,GAAGG,KAAK,2EAA2E,CAAC;IAC7F;IACA,OAAO,GAAGA,KAAK,oBAAoB,EAAEH,QAAQ;AAC/C;AAEA,eAAeF,sBAAqB"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Match quality, best first. Lower sorts earlier.
19
+ *
20
+ * `FUZZY_ONLY` is the floor: the caller's fuzzy pass matched it but no field
21
+ * literally contains the term (a typo, a transposition). Those keep their
22
+ * incoming order and sit behind every literal hit.
23
+ */
24
+ export declare const PICKER_RANK: {
25
+ readonly EXACT_NAME: 0;
26
+ readonly NAME_PREFIX: 1;
27
+ readonly NAME_WORD_PREFIX: 2;
28
+ readonly NAME_SUBSTRING: 3;
29
+ readonly OTHER_FIELD: 4;
30
+ readonly FUZZY_ONLY: 5;
31
+ };
32
+ export type PickerRank = (typeof PICKER_RANK)[keyof typeof PICKER_RANK];
33
+ /**
34
+ * How well `item` matches `query`.
35
+ *
36
+ * A multi-word query is scored by its WEAKEST term: "icon button" must not
37
+ * be reported as an exact name match on the strength of `icon` alone.
38
+ */
39
+ export declare function rankPickerItem(item: unknown, query: string): PickerRank;
40
+ /**
41
+ * `items` reordered best-match first. Nothing is dropped — the caller has
42
+ * already decided what matches.
43
+ */
44
+ export declare function rankPickerItems<T>(items: T[], query: string): T[];
45
+ export default rankPickerItems;