@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,43 @@
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
+ * A node map with each placed library asset's current DAM facts laid over it
19
+ * (AGL-2838, AGL-2856): on the canvas, what `composeNodesWithChrome` does to
20
+ * the tree a published page ships, for images and films alike.
21
+ *
22
+ * Takes a flat map, children by id, which is the shape `applyMediaAssetFacts`
23
+ * walks. The SAME map comes back until an answer applies — no source, no
24
+ * library asset, or an asset whose read is pending or failed — so a caller
25
+ * that memoizes on the result pays nothing for a node that places no asset,
26
+ * and an asset nobody has answered for renders its stored props.
27
+ *
28
+ * Render copies only. Nothing here writes a node, so a draft never changes
29
+ * because an asset did.
30
+ */
31
+ export declare function useMediaAssetFactsOverlay<T extends Record<string, unknown>>(nodes: T | undefined): T | undefined;
32
+ /**
33
+ * One node's render copy with its asset's current DAM facts laid over it
34
+ * (AGL-2838, AGL-2856): {@link useMediaAssetFactsOverlay} for a single leaf.
35
+ *
36
+ * Returns `node` itself for anything that is not a Video or Image element, and
37
+ * for an asset nobody has answered for. Canvas nodes are MobX observables
38
+ * whose props change in place, so the copy is keyed by the JSON of those props
39
+ * rather than by the node's identity, the way every other render copy
40
+ * `NodeLeaf` builds is keyed.
41
+ */
42
+ export declare function useNodeWithMediaAssetFacts<N>(node: N): N;
43
+ export default useMediaAssetFactsOverlay;
@@ -0,0 +1,133 @@
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
+ // By path: the overlay rules stay out of every `@aglyn/aglyn` barrel.
18
+ import { applyMediaAssetFacts, IMAGE_COMPONENT_ID, mediaAssetFactsKey, mediaAssetRefs } from "@aglyn/aglyn/app-utils/media-asset-facts";
19
+ import { VIDEO_COMPONENT_ID } from "@aglyn/aglyn/app-utils/video-object";
20
+ import { useContext, useEffect, useMemo, useSyncExternalStore } from "react";
21
+ import { MediaAssetFactsContext } from "../contexts/media-asset-facts-context.js";
22
+ const NO_REFS = [];
23
+ const subscribeToNothing = ()=>()=>undefined;
24
+ const noVersion = ()=>0;
25
+ /**
26
+ * A node map with each placed library asset's current DAM facts laid over it
27
+ * (AGL-2838, AGL-2856): on the canvas, what `composeNodesWithChrome` does to
28
+ * the tree a published page ships, for images and films alike.
29
+ *
30
+ * Takes a flat map, children by id, which is the shape `applyMediaAssetFacts`
31
+ * walks. The SAME map comes back until an answer applies — no source, no
32
+ * library asset, or an asset whose read is pending or failed — so a caller
33
+ * that memoizes on the result pays nothing for a node that places no asset,
34
+ * and an asset nobody has answered for renders its stored props.
35
+ *
36
+ * Render copies only. Nothing here writes a node, so a draft never changes
37
+ * because an asset did.
38
+ */ export function useMediaAssetFactsOverlay(nodes) {
39
+ const source = useContext(MediaAssetFactsContext);
40
+ const refs = useMemo(()=>source && nodes ? mediaAssetRefs(nodes) : NO_REFS, [
41
+ source,
42
+ nodes
43
+ ]);
44
+ const refsKey = refs.map(mediaAssetFactsKey).join('\n');
45
+ useEffect(()=>{
46
+ if (!source || !refs.length) return undefined;
47
+ const releases = refs.map((ref)=>source.retain(ref));
48
+ return ()=>{
49
+ for (const release of releases)release();
50
+ };
51
+ // `refsKey` stands in for `refs`: a new map that places the same assets
52
+ // keeps the reads it already holds.
53
+ // eslint-disable-next-line react-hooks/exhaustive-deps
54
+ }, [
55
+ source,
56
+ refsKey
57
+ ]);
58
+ const version = useSyncExternalStore(source && refs.length ? source.subscribe : subscribeToNothing, source ? source.getVersion : noVersion, noVersion);
59
+ return useMemo(()=>{
60
+ if (!source || !nodes || !refs.length) return nodes;
61
+ const facts = new Map();
62
+ for (const ref of refs){
63
+ const key = mediaAssetFactsKey(ref);
64
+ const answer = source.get(key);
65
+ if (answer) facts.set(key, answer);
66
+ }
67
+ return facts.size ? applyMediaAssetFacts(nodes, facts) : nodes;
68
+ // `version` is what carries a new answer in; the body reads it through
69
+ // `source.get`.
70
+ // eslint-disable-next-line react-hooks/exhaustive-deps
71
+ }, [
72
+ source,
73
+ nodes,
74
+ refs,
75
+ version
76
+ ]);
77
+ }
78
+ /** The elements whose placement follows its file, as the composition lists them. */ const followsItsFile = (componentId)=>componentId === VIDEO_COMPONENT_ID || componentId === IMAGE_COMPONENT_ID;
79
+ /**
80
+ * One node's render copy with its asset's current DAM facts laid over it
81
+ * (AGL-2838, AGL-2856): {@link useMediaAssetFactsOverlay} for a single leaf.
82
+ *
83
+ * Returns `node` itself for anything that is not a Video or Image element, and
84
+ * for an asset nobody has answered for. Canvas nodes are MobX observables
85
+ * whose props change in place, so the copy is keyed by the JSON of those props
86
+ * rather than by the node's identity, the way every other render copy
87
+ * `NodeLeaf` builds is keyed.
88
+ */ export function useNodeWithMediaAssetFacts(node) {
89
+ var _ref, _ref1;
90
+ const rendered = node;
91
+ const placesAsset = followsItsFile(rendered == null ? void 0 : rendered.componentId);
92
+ const propsJson = placesAsset ? JSON.stringify([
93
+ (_ref = rendered == null ? void 0 : rendered.props) != null ? _ref : null,
94
+ (_ref1 = rendered == null ? void 0 : rendered.resolvedProps) != null ? _ref1 : null
95
+ ]) : '';
96
+ const single = useMemo(()=>{
97
+ if (!placesAsset || !rendered) return undefined;
98
+ return {
99
+ leaf: _extends({
100
+ componentId: rendered.componentId
101
+ }, rendered.props ? {
102
+ props: _extends({}, rendered.props)
103
+ } : {}, rendered.resolvedProps ? {
104
+ resolvedProps: _extends({}, rendered.resolvedProps)
105
+ } : {})
106
+ };
107
+ // Observable props: the JSON string keys the copy.
108
+ // eslint-disable-next-line react-hooks/exhaustive-deps
109
+ }, [
110
+ placesAsset,
111
+ rendered,
112
+ propsJson
113
+ ]);
114
+ const overlaid = useMediaAssetFactsOverlay(single);
115
+ return useMemo(()=>{
116
+ if (!rendered || !single || overlaid === single) return node;
117
+ const leaf = overlaid == null ? void 0 : overlaid['leaf'];
118
+ if (!leaf) return node;
119
+ return _extends({}, rendered, leaf.props ? {
120
+ props: leaf.props
121
+ } : {}, leaf.resolvedProps ? {
122
+ resolvedProps: leaf.resolvedProps
123
+ } : {});
124
+ }, [
125
+ node,
126
+ rendered,
127
+ single,
128
+ overlaid
129
+ ]);
130
+ }
131
+ export default useMediaAssetFactsOverlay;
132
+
133
+ //# sourceMappingURL=use-media-asset-facts-overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/hooks/use-media-asset-facts-overlay.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 { MediaRef } from '@aglyn/aglyn'\n// By path: the overlay rules stay out of every `@aglyn/aglyn` barrel.\nimport {\n applyMediaAssetFacts,\n IMAGE_COMPONENT_ID,\n type MediaAssetFacts,\n mediaAssetFactsKey,\n mediaAssetRefs,\n} from '@aglyn/aglyn/app-utils/media-asset-facts'\nimport { VIDEO_COMPONENT_ID } from '@aglyn/aglyn/app-utils/video-object'\nimport { useContext, useEffect, useMemo, useSyncExternalStore } from 'react'\nimport { MediaAssetFactsContext } from '../contexts/media-asset-facts-context'\n\nconst NO_REFS: readonly MediaRef[] = []\nconst subscribeToNothing = () => () => undefined\nconst noVersion = () => 0\n\n/**\n * A node map with each placed library asset's current DAM facts laid over it\n * (AGL-2838, AGL-2856): on the canvas, what `composeNodesWithChrome` does to\n * the tree a published page ships, for images and films alike.\n *\n * Takes a flat map, children by id, which is the shape `applyMediaAssetFacts`\n * walks. The SAME map comes back until an answer applies — no source, no\n * library asset, or an asset whose read is pending or failed — so a caller\n * that memoizes on the result pays nothing for a node that places no asset,\n * and an asset nobody has answered for renders its stored props.\n *\n * Render copies only. Nothing here writes a node, so a draft never changes\n * because an asset did.\n */\nexport function useMediaAssetFactsOverlay<T extends Record<string, unknown>>(\n nodes: T | undefined,\n): T | undefined {\n const source = useContext(MediaAssetFactsContext)\n const refs = useMemo(\n () => (source && nodes ? mediaAssetRefs(nodes) : NO_REFS),\n [source, nodes],\n )\n const refsKey = refs.map(mediaAssetFactsKey).join('\\n')\n useEffect(() => {\n if (!source || !refs.length) return undefined\n const releases = refs.map((ref) => source.retain(ref))\n return () => {\n for (const release of releases) release()\n }\n // `refsKey` stands in for `refs`: a new map that places the same assets\n // keeps the reads it already holds.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source, refsKey])\n const version = useSyncExternalStore(\n source && refs.length ? source.subscribe : subscribeToNothing,\n source ? source.getVersion : noVersion,\n noVersion,\n )\n return useMemo(() => {\n if (!source || !nodes || !refs.length) return nodes\n const facts = new Map<string, MediaAssetFacts>()\n for (const ref of refs) {\n const key = mediaAssetFactsKey(ref)\n const answer = source.get(key)\n if (answer) facts.set(key, answer)\n }\n return facts.size ? applyMediaAssetFacts(nodes, facts) : nodes\n // `version` is what carries a new answer in; the body reads it through\n // `source.get`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source, nodes, refs, version])\n}\n\n/** The part of a node `Leaf` renders from. */\ninterface RenderedNode {\n componentId?: string\n props?: Record<string, unknown>\n resolvedProps?: Record<string, unknown>\n}\n\n/** The elements whose placement follows its file, as the composition lists them. */\nconst followsItsFile = (componentId: string | undefined): boolean =>\n componentId === VIDEO_COMPONENT_ID || componentId === IMAGE_COMPONENT_ID\n\n/**\n * One node's render copy with its asset's current DAM facts laid over it\n * (AGL-2838, AGL-2856): {@link useMediaAssetFactsOverlay} for a single leaf.\n *\n * Returns `node` itself for anything that is not a Video or Image element, and\n * for an asset nobody has answered for. Canvas nodes are MobX observables\n * whose props change in place, so the copy is keyed by the JSON of those props\n * rather than by the node's identity, the way every other render copy\n * `NodeLeaf` builds is keyed.\n */\nexport function useNodeWithMediaAssetFacts<N>(node: N): N {\n const rendered = node as RenderedNode | null | undefined\n const placesAsset = followsItsFile(rendered?.componentId)\n const propsJson = placesAsset\n ? JSON.stringify([rendered?.props ?? null, rendered?.resolvedProps ?? null])\n : ''\n const single = useMemo(() => {\n if (!placesAsset || !rendered) return undefined\n return {\n leaf: {\n componentId: rendered.componentId,\n ...(rendered.props ? { props: { ...rendered.props } } : {}),\n ...(rendered.resolvedProps\n ? { resolvedProps: { ...rendered.resolvedProps } }\n : {}),\n },\n }\n // Observable props: the JSON string keys the copy.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [placesAsset, rendered, propsJson])\n const overlaid = useMediaAssetFactsOverlay(single)\n return useMemo(() => {\n if (!rendered || !single || overlaid === single) return node\n const leaf = overlaid?.['leaf'] as RenderedNode | undefined\n if (!leaf) return node\n return {\n ...rendered,\n ...(leaf.props ? { props: leaf.props } : {}),\n ...(leaf.resolvedProps ? { resolvedProps: leaf.resolvedProps } : {}),\n } as N\n }, [node, rendered, single, overlaid])\n}\n\nexport default useMediaAssetFactsOverlay\n"],"names":["applyMediaAssetFacts","IMAGE_COMPONENT_ID","mediaAssetFactsKey","mediaAssetRefs","VIDEO_COMPONENT_ID","useContext","useEffect","useMemo","useSyncExternalStore","MediaAssetFactsContext","NO_REFS","subscribeToNothing","undefined","noVersion","useMediaAssetFactsOverlay","nodes","source","refs","refsKey","map","join","length","releases","ref","retain","release","version","subscribe","getVersion","facts","Map","key","answer","get","set","size","followsItsFile","componentId","useNodeWithMediaAssetFacts","node","rendered","placesAsset","propsJson","JSON","stringify","props","resolvedProps","single","leaf","overlaid"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAGD,sEAAsE;AACtE,SACEA,oBAAoB,EACpBC,kBAAkB,EAElBC,kBAAkB,EAClBC,cAAc,QACT,2CAA0C;AACjD,SAASC,kBAAkB,QAAQ,sCAAqC;AACxE,SAASC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,oBAAoB,QAAQ,QAAO;AAC5E,SAASC,sBAAsB,QAAQ,2CAAuC;AAE9E,MAAMC,UAA+B,EAAE;AACvC,MAAMC,qBAAqB,IAAM,IAAMC;AACvC,MAAMC,YAAY,IAAM;AAExB;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,0BACdC,KAAoB;IAEpB,MAAMC,SAASX,WAAWI;IAC1B,MAAMQ,OAAOV,QACX,IAAOS,UAAUD,QAAQZ,eAAeY,SAASL,SACjD;QAACM;QAAQD;KAAM;IAEjB,MAAMG,UAAUD,KAAKE,GAAG,CAACjB,oBAAoBkB,IAAI,CAAC;IAClDd,UAAU;QACR,IAAI,CAACU,UAAU,CAACC,KAAKI,MAAM,EAAE,OAAOT;QACpC,MAAMU,WAAWL,KAAKE,GAAG,CAAC,CAACI,MAAQP,OAAOQ,MAAM,CAACD;QACjD,OAAO;YACL,KAAK,MAAME,WAAWH,SAAUG;QAClC;IACA,wEAAwE;IACxE,oCAAoC;IACpC,uDAAuD;IACzD,GAAG;QAACT;QAAQE;KAAQ;IACpB,MAAMQ,UAAUlB,qBACdQ,UAAUC,KAAKI,MAAM,GAAGL,OAAOW,SAAS,GAAGhB,oBAC3CK,SAASA,OAAOY,UAAU,GAAGf,WAC7BA;IAEF,OAAON,QAAQ;QACb,IAAI,CAACS,UAAU,CAACD,SAAS,CAACE,KAAKI,MAAM,EAAE,OAAON;QAC9C,MAAMc,QAAQ,IAAIC;QAClB,KAAK,MAAMP,OAAON,KAAM;YACtB,MAAMc,MAAM7B,mBAAmBqB;YAC/B,MAAMS,SAAShB,OAAOiB,GAAG,CAACF;YAC1B,IAAIC,QAAQH,MAAMK,GAAG,CAACH,KAAKC;QAC7B;QACA,OAAOH,MAAMM,IAAI,GAAGnC,qBAAqBe,OAAOc,SAASd;IACzD,uEAAuE;IACvE,gBAAgB;IAChB,uDAAuD;IACzD,GAAG;QAACC;QAAQD;QAAOE;QAAMS;KAAQ;AACnC;AASA,kFAAkF,GAClF,MAAMU,iBAAiB,CAACC,cACtBA,gBAAgBjC,sBAAsBiC,gBAAgBpC;AAExD;;;;;;;;;CASC,GACD,OAAO,SAASqC,2BAA8BC,IAAO;;IACnD,MAAMC,WAAWD;IACjB,MAAME,cAAcL,eAAeI,4BAAAA,SAAUH,WAAW;IACxD,MAAMK,YAAYD,cACdE,KAAKC,SAAS,CAAC;gBAACJ,4BAAAA,SAAUK,KAAK,mBAAI;iBAAML,4BAAAA,SAAUM,aAAa,oBAAI;KAAK,IACzE;IACJ,MAAMC,SAASxC,QAAQ;QACrB,IAAI,CAACkC,eAAe,CAACD,UAAU,OAAO5B;QACtC,OAAO;YACLoC,MAAM;gBACJX,aAAaG,SAASH,WAAW;eAC7BG,SAASK,KAAK,GAAG;gBAAEA,OAAO,aAAKL,SAASK,KAAK;YAAG,IAAI,CAAC,GACrDL,SAASM,aAAa,GACtB;gBAAEA,eAAe,aAAKN,SAASM,aAAa;YAAG,IAC/C,CAAC;QAET;IACA,mDAAmD;IACnD,uDAAuD;IACzD,GAAG;QAACL;QAAaD;QAAUE;KAAU;IACrC,MAAMO,WAAWnC,0BAA0BiC;IAC3C,OAAOxC,QAAQ;QACb,IAAI,CAACiC,YAAY,CAACO,UAAUE,aAAaF,QAAQ,OAAOR;QACxD,MAAMS,OAAOC,4BAAAA,QAAU,CAAC,OAAO;QAC/B,IAAI,CAACD,MAAM,OAAOT;QAClB,OAAO,aACFC,UACCQ,KAAKH,KAAK,GAAG;YAAEA,OAAOG,KAAKH,KAAK;QAAC,IAAI,CAAC,GACtCG,KAAKF,aAAa,GAAG;YAAEA,eAAeE,KAAKF,aAAa;QAAC,IAAI,CAAC;IAEtE,GAAG;QAACP;QAAMC;QAAUO;QAAQE;KAAS;AACvC;AAEA,eAAenC,0BAAyB"}
@@ -0,0 +1,22 @@
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 * as Aglyn from '@aglyn/aglyn';
18
+ /** Lift the node out of its container, landing it just after that container. */
19
+ export declare function useMoveNodeOutCallback(): (node?: Aglyn.NodeSchema<any>) => Aglyn.NodeSchema<any> | undefined;
20
+ /** Tuck the node into the sibling directly above it. */
21
+ export declare function useMoveNodeInCallback(): (node?: Aglyn.NodeSchema<any>) => Aglyn.NodeSchema<any> | undefined;
22
+ export default useMoveNodeOutCallback;
@@ -0,0 +1,57 @@
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 Besigner from "@aglyn/besigner";
17
+ import { useSnackbar } from "@aglyn/shared-ui-snackstack";
18
+ import { useCallback } from "react";
19
+ /**
20
+ * Move a node between containers by clicking (AGL-1405), reporting the way
21
+ * paste and Add element do. A refused move writes nothing and says why —
22
+ * the refusals are the point, since the situation this exists to repair was
23
+ * caused by a drop that was accepted and then discarded.
24
+ */ function useMoveCallback(move) {
25
+ var _useSnackbar;
26
+ // Null-safe: surfaces render without a snackbar provider in tests.
27
+ const { enqueueSnackbar } = (_useSnackbar = useSnackbar()) != null ? _useSnackbar : {};
28
+ return useCallback((node)=>{
29
+ const target = node != null ? node : Besigner.focus.getLastSelected();
30
+ if (!target) return undefined;
31
+ const result = move(target);
32
+ if (result.error) {
33
+ enqueueSnackbar == null ? void 0 : enqueueSnackbar(result.error, {
34
+ variant: 'warning',
35
+ persist: false
36
+ });
37
+ return undefined;
38
+ }
39
+ // Keep the moved node selected so the hierarchy scrolls to its new
40
+ // home and the next action acts on it — a move the author can't see
41
+ // land is the failure mode this whole issue is about.
42
+ if (result.node) Besigner.focus.setSelectedNode(result.node);
43
+ return result.node;
44
+ }, [
45
+ move,
46
+ enqueueSnackbar
47
+ ]);
48
+ }
49
+ /** Lift the node out of its container, landing it just after that container. */ export function useMoveNodeOutCallback() {
50
+ return useMoveCallback(Besigner.moveNodeOut);
51
+ }
52
+ /** Tuck the node into the sibling directly above it. */ export function useMoveNodeInCallback() {
53
+ return useMoveCallback(Besigner.moveNodeIn);
54
+ }
55
+ export default useMoveNodeOutCallback;
56
+
57
+ //# sourceMappingURL=use-move-node-callbacks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/hooks/use-move-node-callbacks.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 * as Aglyn from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport { useCallback } from 'react'\n\n/**\n * Move a node between containers by clicking (AGL-1405), reporting the way\n * paste and Add element do. A refused move writes nothing and says why —\n * the refusals are the point, since the situation this exists to repair was\n * caused by a drop that was accepted and then discarded.\n */\nfunction useMoveCallback(\n move: (node: Aglyn.NodeSchema<any>) => Besigner.MoveResult,\n): (node?: Aglyn.NodeSchema<any>) => Aglyn.NodeSchema<any> | undefined {\n // Null-safe: surfaces render without a snackbar provider in tests.\n const { enqueueSnackbar } = useSnackbar() ?? {}\n\n return useCallback(\n (node?: Aglyn.NodeSchema<any>) => {\n const target = node ?? Besigner.focus.getLastSelected()\n if (!target) return undefined\n\n const result = move(target)\n if (result.error) {\n enqueueSnackbar?.(result.error, { variant: 'warning', persist: false })\n return undefined\n }\n // Keep the moved node selected so the hierarchy scrolls to its new\n // home and the next action acts on it — a move the author can't see\n // land is the failure mode this whole issue is about.\n if (result.node) Besigner.focus.setSelectedNode(result.node)\n return result.node\n },\n [move, enqueueSnackbar],\n )\n}\n\n/** Lift the node out of its container, landing it just after that container. */\nexport function useMoveNodeOutCallback() {\n return useMoveCallback(Besigner.moveNodeOut)\n}\n\n/** Tuck the node into the sibling directly above it. */\nexport function useMoveNodeInCallback() {\n return useMoveCallback(Besigner.moveNodeIn)\n}\n\nexport default useMoveNodeOutCallback\n"],"names":["Besigner","useSnackbar","useCallback","useMoveCallback","move","enqueueSnackbar","node","target","focus","getLastSelected","undefined","result","error","variant","persist","setSelectedNode","useMoveNodeOutCallback","moveNodeOut","useMoveNodeInCallback","moveNodeIn"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,YAAYA,cAAc,kBAAiB;AAC3C,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAASC,WAAW,QAAQ,QAAO;AAEnC;;;;;CAKC,GACD,SAASC,gBACPC,IAA0D;QAG9BH;IAD5B,mEAAmE;IACnE,MAAM,EAAEI,eAAe,EAAE,IAAGJ,eAAAA,yBAAAA,eAAiB,CAAC;IAE9C,OAAOC,YACL,CAACI;QACC,MAAMC,SAASD,eAAAA,OAAQN,SAASQ,KAAK,CAACC,eAAe;QACrD,IAAI,CAACF,QAAQ,OAAOG;QAEpB,MAAMC,SAASP,KAAKG;QACpB,IAAII,OAAOC,KAAK,EAAE;YAChBP,mCAAAA,gBAAkBM,OAAOC,KAAK,EAAE;gBAAEC,SAAS;gBAAWC,SAAS;YAAM;YACrE,OAAOJ;QACT;QACA,mEAAmE;QACnE,oEAAoE;QACpE,sDAAsD;QACtD,IAAIC,OAAOL,IAAI,EAAEN,SAASQ,KAAK,CAACO,eAAe,CAACJ,OAAOL,IAAI;QAC3D,OAAOK,OAAOL,IAAI;IACpB,GACA;QAACF;QAAMC;KAAgB;AAE3B;AAEA,8EAA8E,GAC9E,OAAO,SAASW;IACd,OAAOb,gBAAgBH,SAASiB,WAAW;AAC7C;AAEA,sDAAsD,GACtD,OAAO,SAASC;IACd,OAAOf,gBAAgBH,SAASmB,UAAU;AAC5C;AAEA,eAAeH,uBAAsB"}
@@ -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
+ import { type HostTokenSource } from '@aglyn/aglyn';
18
+ /**
19
+ * One node's render copy with its `{{host.*}}` tokens filled in from `host`
20
+ * (AGL-2881).
21
+ *
22
+ * Through `resolveNodesHostTokens`, handed this node alone: the function the
23
+ * published page composes its whole tree with, so a token draws on the canvas
24
+ * as exactly what a visitor reads — a field the site has not set included,
25
+ * which both draw as nothing.
26
+ *
27
+ * Answers `node` itself when there is no site, and when no prop holds a token.
28
+ * A copy only: the node the canvas selects, edits and saves keeps its tokens.
29
+ */
30
+ export declare function resolveNodeHostTokens<N>(node: N, host: HostTokenSource | null | undefined): N;
31
+ /**
32
+ * {@link resolveNodeHostTokens} for a leaf, against the site the canvas decided
33
+ * on ({@link CanvasHostTokensContext}).
34
+ *
35
+ * The copy is keyed by the node and by `revision`. A canvas node is a MobX
36
+ * observable whose props change in place, so a leaf drawing one passes
37
+ * something that changes with those props; the nodes drawn from a component
38
+ * definition or the layout chrome are rebuilt whole when they change and need
39
+ * nothing more.
40
+ */
41
+ export declare function useNodeWithHostTokens<N>(node: N, revision?: unknown): N;
42
+ export default useNodeWithHostTokens;
@@ -0,0 +1,59 @@
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 { resolveNodesHostTokens } from "@aglyn/aglyn";
17
+ import { useContext, useMemo } from "react";
18
+ import CanvasHostTokensContext from "../contexts/canvas-host-tokens-context.js";
19
+ /**
20
+ * One node's render copy with its `{{host.*}}` tokens filled in from `host`
21
+ * (AGL-2881).
22
+ *
23
+ * Through `resolveNodesHostTokens`, handed this node alone: the function the
24
+ * published page composes its whole tree with, so a token draws on the canvas
25
+ * as exactly what a visitor reads — a field the site has not set included,
26
+ * which both draw as nothing.
27
+ *
28
+ * Answers `node` itself when there is no site, and when no prop holds a token.
29
+ * A copy only: the node the canvas selects, edits and saves keeps its tokens.
30
+ */ export function resolveNodeHostTokens(node, host) {
31
+ var _resolved_node;
32
+ if (!host || !node) return node;
33
+ const resolved = resolveNodesHostTokens({
34
+ node: node
35
+ }, host);
36
+ return (_resolved_node = resolved.node) != null ? _resolved_node : node;
37
+ }
38
+ /**
39
+ * {@link resolveNodeHostTokens} for a leaf, against the site the canvas decided
40
+ * on ({@link CanvasHostTokensContext}).
41
+ *
42
+ * The copy is keyed by the node and by `revision`. A canvas node is a MobX
43
+ * observable whose props change in place, so a leaf drawing one passes
44
+ * something that changes with those props; the nodes drawn from a component
45
+ * definition or the layout chrome are rebuilt whole when they change and need
46
+ * nothing more.
47
+ */ export function useNodeWithHostTokens(node, revision) {
48
+ const host = useContext(CanvasHostTokensContext);
49
+ return useMemo(()=>resolveNodeHostTokens(node, host), // `revision` carries the in-place prop changes identity cannot.
50
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51
+ [
52
+ node,
53
+ host,
54
+ revision
55
+ ]);
56
+ }
57
+ export default useNodeWithHostTokens;
58
+
59
+ //# sourceMappingURL=use-node-with-host-tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/hooks/use-node-with-host-tokens.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 HostTokenSource, resolveNodesHostTokens } from '@aglyn/aglyn'\nimport { useContext, useMemo } from 'react'\nimport CanvasHostTokensContext from '../contexts/canvas-host-tokens-context'\n\n/**\n * One node's render copy with its `{{host.*}}` tokens filled in from `host`\n * (AGL-2881).\n *\n * Through `resolveNodesHostTokens`, handed this node alone: the function the\n * published page composes its whole tree with, so a token draws on the canvas\n * as exactly what a visitor reads — a field the site has not set included,\n * which both draw as nothing.\n *\n * Answers `node` itself when there is no site, and when no prop holds a token.\n * A copy only: the node the canvas selects, edits and saves keeps its tokens.\n */\nexport function resolveNodeHostTokens<N>(\n node: N,\n host: HostTokenSource | null | undefined,\n): N {\n if (!host || !node) return node\n const resolved = resolveNodesHostTokens(\n { node: node as Record<string, unknown> },\n host,\n )\n return (resolved.node ?? node) as N\n}\n\n/**\n * {@link resolveNodeHostTokens} for a leaf, against the site the canvas decided\n * on ({@link CanvasHostTokensContext}).\n *\n * The copy is keyed by the node and by `revision`. A canvas node is a MobX\n * observable whose props change in place, so a leaf drawing one passes\n * something that changes with those props; the nodes drawn from a component\n * definition or the layout chrome are rebuilt whole when they change and need\n * nothing more.\n */\nexport function useNodeWithHostTokens<N>(node: N, revision?: unknown): N {\n const host = useContext(CanvasHostTokensContext)\n return useMemo(\n () => resolveNodeHostTokens(node, host),\n // `revision` carries the in-place prop changes identity cannot.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [node, host, revision],\n )\n}\n\nexport default useNodeWithHostTokens\n"],"names":["resolveNodesHostTokens","useContext","useMemo","CanvasHostTokensContext","resolveNodeHostTokens","node","host","resolved","useNodeWithHostTokens","revision"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAA+BA,sBAAsB,QAAQ,eAAc;AAC3E,SAASC,UAAU,EAAEC,OAAO,QAAQ,QAAO;AAC3C,OAAOC,6BAA6B,4CAAwC;AAE5E;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,sBACdC,IAAO,EACPC,IAAwC;QAOhCC;IALR,IAAI,CAACD,QAAQ,CAACD,MAAM,OAAOA;IAC3B,MAAME,WAAWP,uBACf;QAAEK,MAAMA;IAAgC,GACxCC;IAEF,QAAQC,iBAAAA,SAASF,IAAI,YAAbE,iBAAiBF;AAC3B;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASG,sBAAyBH,IAAO,EAAEI,QAAkB;IAClE,MAAMH,OAAOL,WAAWE;IACxB,OAAOD,QACL,IAAME,sBAAsBC,MAAMC,OAClC,gEAAgE;IAChE,uDAAuD;IACvD;QAACD;QAAMC;QAAMG;KAAS;AAE1B;AAEA,eAAeD,sBAAqB"}
@@ -0,0 +1,61 @@
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
+ /** The single group search results collapse into (AGL-2486). */
18
+ export declare const RESULTS_CATEGORY_ID = "aglyn:picker-results";
19
+ export declare const RESULTS_CATEGORY_LABEL = "Best matches";
20
+ /** A category group as both element pickers consume it. */
21
+ export interface PickerCategory<TItem = any> {
22
+ $id: string;
23
+ label?: string;
24
+ items?: TItem[];
25
+ }
26
+ export interface PickerFilterResult<TCategory> {
27
+ /** Current query text; empty when nothing is being searched. */
28
+ filter: string;
29
+ /** Categories unfiltered, or the single flat "Best matches" group. */
30
+ items: TCategory[];
31
+ /**
32
+ * `onChange` for the search field. Also serves the clear button: an
33
+ * IconButton has no `currentTarget.value`, so the query falls back to ''.
34
+ */
35
+ handleFilterChange: (e: {
36
+ currentTarget?: {
37
+ value?: string;
38
+ };
39
+ }) => void;
40
+ }
41
+ /**
42
+ * The element picker's search, shared by the Choose-element dialog and the
43
+ * Elements panel (AGL-2486).
44
+ *
45
+ * Both surfaces MUST agree about what a query matches and in what order.
46
+ * Two pickers that disagree about what `icon` means would be worse than one
47
+ * of them having no search at all, which is why this lives in one place
48
+ * rather than being written twice.
49
+ *
50
+ * Results are FLAT while a filter is active, deliberately. A name hit has to
51
+ * outrank a description hit, and that cannot hold inside category
52
+ * accordions: `Icon` lives in Media, so grouping would drag every Media
53
+ * entry — Avatar, "shows a picture, initials or an icon" — above `Icon
54
+ * button` in Input. Unfiltered, the curated categories come back untouched.
55
+ *
56
+ * @param allItems the visible categories, freshly derived each render
57
+ * @param onFiltered optional side effect run on every query change (the
58
+ * dialog drops its pending selection, which the new results no longer show)
59
+ */
60
+ export declare function usePickerFilter<TCategory extends PickerCategory>(allItems: TCategory[], onFiltered?: () => void): PickerFilterResult<TCategory>;
61
+ export default usePickerFilter;
@@ -0,0 +1,122 @@
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 { useCallback, useEffect, useState } from "react";
17
+ import { rankPickerItems } from "../utils/rank-picker-results.js";
18
+ /** The single group search results collapse into (AGL-2486). */ export const RESULTS_CATEGORY_ID = 'aglyn:picker-results';
19
+ export const RESULTS_CATEGORY_LABEL = 'Best matches';
20
+ /**
21
+ * The fields the fuzzy pass looks at. Fuse decides WHAT matches (it is the
22
+ * only thing here with any typo tolerance); `rankPickerItems` decides the
23
+ * ORDER.
24
+ */ const FUSE_KEYS = [
25
+ 'displayName',
26
+ 'label',
27
+ 'title',
28
+ 'description',
29
+ 'subtitle',
30
+ 'category',
31
+ // Authored synonyms. `rankPickerItems` has always ranked these; until
32
+ // AGL-2486 nothing could SET them and the fuzzy pass never looked at
33
+ // them, so the ranking was scoring a field that did not exist.
34
+ 'tags',
35
+ 'keywords',
36
+ 'pluginId',
37
+ 'kind',
38
+ '$id'
39
+ ];
40
+ /**
41
+ * The element picker's search, shared by the Choose-element dialog and the
42
+ * Elements panel (AGL-2486).
43
+ *
44
+ * Both surfaces MUST agree about what a query matches and in what order.
45
+ * Two pickers that disagree about what `icon` means would be worse than one
46
+ * of them having no search at all, which is why this lives in one place
47
+ * rather than being written twice.
48
+ *
49
+ * Results are FLAT while a filter is active, deliberately. A name hit has to
50
+ * outrank a description hit, and that cannot hold inside category
51
+ * accordions: `Icon` lives in Media, so grouping would drag every Media
52
+ * entry — Avatar, "shows a picture, initials or an icon" — above `Icon
53
+ * button` in Input. Unfiltered, the curated categories come back untouched.
54
+ *
55
+ * @param allItems the visible categories, freshly derived each render
56
+ * @param onFiltered optional side effect run on every query change (the
57
+ * dialog drops its pending selection, which the new results no longer show)
58
+ */ export function usePickerFilter(allItems, onFiltered) {
59
+ const [filter, setFilter] = useState('');
60
+ const [items, setItems] = useState(allItems);
61
+ // Presets can register after mount (per-host reusable components load
62
+ // from Firestore) — refresh the unfiltered list when the registry
63
+ // changes. `allItems` is a fresh array every render, so key on a stable
64
+ // signature to avoid a setState loop.
65
+ const registrySignature = allItems.map((category)=>{
66
+ var _ref;
67
+ var _category_items;
68
+ return `${category.$id}:${(_ref = (_category_items = category.items) == null ? void 0 : _category_items.length) != null ? _ref : 0}`;
69
+ }).join('|');
70
+ useEffect(()=>{
71
+ if (!filter) setItems(allItems);
72
+ // eslint-disable-next-line react-hooks/exhaustive-deps
73
+ }, [
74
+ registrySignature,
75
+ filter
76
+ ]);
77
+ const handleFilterChange = useCallback(async (e)=>{
78
+ var _e_currentTarget;
79
+ const filter = ((_e_currentTarget = e.currentTarget) == null ? void 0 : _e_currentTarget.value) || '';
80
+ setFilter(filter);
81
+ onFiltered == null ? void 0 : onFiltered();
82
+ let items = allItems;
83
+ if (filter) {
84
+ try {
85
+ // Dynamically load fuse.js
86
+ const Fuse = (await import("fuse.js")).default;
87
+ const fuse = new Fuse([], {
88
+ shouldSort: true,
89
+ keys: FUSE_KEYS
90
+ });
91
+ // Fuse's own `shouldSort` weights every key alike, which is what
92
+ // put `Icon` below everything whose description merely mentions
93
+ // an icon (AGL-2486). `rankPickerItems` re-orders name-first.
94
+ const matched = allItems.flatMap((category)=>{
95
+ fuse.setCollection(category.items);
96
+ return fuse.search(filter).map((result)=>result.item);
97
+ });
98
+ items = matched.length ? [
99
+ {
100
+ $id: RESULTS_CATEGORY_ID,
101
+ label: RESULTS_CATEGORY_LABEL,
102
+ items: rankPickerItems(matched, filter)
103
+ }
104
+ ] : [];
105
+ } catch (error) {
106
+ console.error('Failed to load fuse.js', error);
107
+ }
108
+ }
109
+ setItems(items);
110
+ }, [
111
+ allItems,
112
+ onFiltered
113
+ ]);
114
+ return {
115
+ filter,
116
+ items,
117
+ handleFilterChange
118
+ };
119
+ }
120
+ export default usePickerFilter;
121
+
122
+ //# sourceMappingURL=use-picker-filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/hooks/use-picker-filter.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 { useCallback, useEffect, useState } from 'react'\nimport { rankPickerItems } from '../utils/rank-picker-results'\n\n/** The single group search results collapse into (AGL-2486). */\nexport const RESULTS_CATEGORY_ID = 'aglyn:picker-results'\nexport const RESULTS_CATEGORY_LABEL = 'Best matches'\n\n/**\n * The fields the fuzzy pass looks at. Fuse decides WHAT matches (it is the\n * only thing here with any typo tolerance); `rankPickerItems` decides the\n * ORDER.\n */\nconst FUSE_KEYS = [\n 'displayName',\n 'label',\n 'title',\n 'description',\n 'subtitle',\n 'category',\n // Authored synonyms. `rankPickerItems` has always ranked these; until\n // AGL-2486 nothing could SET them and the fuzzy pass never looked at\n // them, so the ranking was scoring a field that did not exist.\n 'tags',\n 'keywords',\n 'pluginId',\n 'kind',\n '$id',\n]\n\n/** A category group as both element pickers consume it. */\nexport interface PickerCategory<TItem = any> {\n $id: string\n label?: string\n items?: TItem[]\n}\n\nexport interface PickerFilterResult<TCategory> {\n /** Current query text; empty when nothing is being searched. */\n filter: string\n /** Categories unfiltered, or the single flat \"Best matches\" group. */\n items: TCategory[]\n /**\n * `onChange` for the search field. Also serves the clear button: an\n * IconButton has no `currentTarget.value`, so the query falls back to ''.\n */\n handleFilterChange: (e: { currentTarget?: { value?: string } }) => void\n}\n\n/**\n * The element picker's search, shared by the Choose-element dialog and the\n * Elements panel (AGL-2486).\n *\n * Both surfaces MUST agree about what a query matches and in what order.\n * Two pickers that disagree about what `icon` means would be worse than one\n * of them having no search at all, which is why this lives in one place\n * rather than being written twice.\n *\n * Results are FLAT while a filter is active, deliberately. A name hit has to\n * outrank a description hit, and that cannot hold inside category\n * accordions: `Icon` lives in Media, so grouping would drag every Media\n * entry — Avatar, \"shows a picture, initials or an icon\" — above `Icon\n * button` in Input. Unfiltered, the curated categories come back untouched.\n *\n * @param allItems the visible categories, freshly derived each render\n * @param onFiltered optional side effect run on every query change (the\n * dialog drops its pending selection, which the new results no longer show)\n */\nexport function usePickerFilter<TCategory extends PickerCategory>(\n allItems: TCategory[],\n onFiltered?: () => void,\n): PickerFilterResult<TCategory> {\n const [filter, setFilter] = useState('')\n const [items, setItems] = useState(allItems)\n\n // Presets can register after mount (per-host reusable components load\n // from Firestore) — refresh the unfiltered list when the registry\n // changes. `allItems` is a fresh array every render, so key on a stable\n // signature to avoid a setState loop.\n const registrySignature = allItems\n .map((category) => `${category.$id}:${category.items?.length ?? 0}`)\n .join('|')\n useEffect(() => {\n if (!filter) setItems(allItems)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registrySignature, filter])\n\n const handleFilterChange = useCallback(\n async (e: { currentTarget?: { value?: string } }) => {\n const filter = e.currentTarget?.value || ''\n setFilter(filter)\n onFiltered?.()\n let items = allItems\n\n if (filter) {\n try {\n // Dynamically load fuse.js\n const Fuse = (await import('fuse.js')).default\n const fuse = new Fuse<TCategory['items'][number]>([], {\n shouldSort: true,\n keys: FUSE_KEYS,\n })\n\n // Fuse's own `shouldSort` weights every key alike, which is what\n // put `Icon` below everything whose description merely mentions\n // an icon (AGL-2486). `rankPickerItems` re-orders name-first.\n const matched = allItems.flatMap((category) => {\n fuse.setCollection(category.items)\n return fuse.search(filter).map((result) => result.item)\n })\n items = matched.length\n ? [\n {\n $id: RESULTS_CATEGORY_ID,\n label: RESULTS_CATEGORY_LABEL,\n items: rankPickerItems(matched, filter),\n } as unknown as TCategory,\n ]\n : []\n } catch (error) {\n console.error('Failed to load fuse.js', error)\n }\n }\n\n setItems(items)\n },\n [allItems, onFiltered],\n )\n\n return { filter, items, handleFilterChange }\n}\n\nexport default usePickerFilter\n"],"names":["useCallback","useEffect","useState","rankPickerItems","RESULTS_CATEGORY_ID","RESULTS_CATEGORY_LABEL","FUSE_KEYS","usePickerFilter","allItems","onFiltered","filter","setFilter","items","setItems","registrySignature","map","category","$id","length","join","handleFilterChange","e","currentTarget","value","Fuse","default","fuse","shouldSort","keys","matched","flatMap","setCollection","search","result","item","label","error","console"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AACxD,SAASC,eAAe,QAAQ,kCAA8B;AAE9D,8DAA8D,GAC9D,OAAO,MAAMC,sBAAsB,uBAAsB;AACzD,OAAO,MAAMC,yBAAyB,eAAc;AAEpD;;;;CAIC,GACD,MAAMC,YAAY;IAChB;IACA;IACA;IACA;IACA;IACA;IACA,sEAAsE;IACtE,qEAAqE;IACrE,+DAA+D;IAC/D;IACA;IACA;IACA;IACA;CACD;AAqBD;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,SAASC,gBACdC,QAAqB,EACrBC,UAAuB;IAEvB,MAAM,CAACC,QAAQC,UAAU,GAAGT,SAAS;IACrC,MAAM,CAACU,OAAOC,SAAS,GAAGX,SAASM;IAEnC,sEAAsE;IACtE,kEAAkE;IAClE,wEAAwE;IACxE,sCAAsC;IACtC,MAAMM,oBAAoBN,SACvBO,GAAG,CAAC,CAACC;;YAAgCA;eAAnB,GAAGA,SAASC,GAAG,CAAC,CAAC,WAAED,kBAAAA,SAASJ,KAAK,qBAAdI,gBAAgBE,MAAM,mBAAI,GAAG;OAClEC,IAAI,CAAC;IACRlB,UAAU;QACR,IAAI,CAACS,QAAQG,SAASL;IACtB,uDAAuD;IACzD,GAAG;QAACM;QAAmBJ;KAAO;IAE9B,MAAMU,qBAAqBpB,YACzB,OAAOqB;YACUA;QAAf,MAAMX,SAASW,EAAAA,mBAAAA,EAAEC,aAAa,qBAAfD,iBAAiBE,KAAK,KAAI;QACzCZ,UAAUD;QACVD,8BAAAA;QACA,IAAIG,QAAQJ;QAEZ,IAAIE,QAAQ;YACV,IAAI;gBACF,2BAA2B;gBAC3B,MAAMc,OAAO,AAAC,CAAA,MAAM,MAAM,CAAC,UAAS,EAAGC,OAAO;gBAC9C,MAAMC,OAAO,IAAIF,KAAiC,EAAE,EAAE;oBACpDG,YAAY;oBACZC,MAAMtB;gBACR;gBAEA,iEAAiE;gBACjE,gEAAgE;gBAChE,8DAA8D;gBAC9D,MAAMuB,UAAUrB,SAASsB,OAAO,CAAC,CAACd;oBAChCU,KAAKK,aAAa,CAACf,SAASJ,KAAK;oBACjC,OAAOc,KAAKM,MAAM,CAACtB,QAAQK,GAAG,CAAC,CAACkB,SAAWA,OAAOC,IAAI;gBACxD;gBACAtB,QAAQiB,QAAQX,MAAM,GAClB;oBACE;wBACED,KAAKb;wBACL+B,OAAO9B;wBACPO,OAAOT,gBAAgB0B,SAASnB;oBAClC;iBACD,GACD,EAAE;YACR,EAAE,OAAO0B,OAAO;gBACdC,QAAQD,KAAK,CAAC,0BAA0BA;YAC1C;QACF;QAEAvB,SAASD;IACX,GACA;QAACJ;QAAUC;KAAW;IAGxB,OAAO;QAAEC;QAAQE;QAAOQ;IAAmB;AAC7C;AAEA,eAAeb,gBAAe"}