@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,39 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 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 LeafProps } from '@aglyn/aglyn-node-renderer';
18
+ /**
19
+ * The plain `Leaf`, drawing a node the way the published page composes it: its
20
+ * host variables filled in from the site being edited (AGL-2881), and a placed
21
+ * image or film with its DAM asset's current facts (AGL-2838, AGL-2856).
22
+ *
23
+ * For the nodes the canvas renders that are not canvas nodes — a component
24
+ * instance's definition, a placed form's design, the layout chrome — and so
25
+ * never reach `NodeLeaf`. A footer's `{{host.businessName}}` still has to read
26
+ * as the site's name, an asset inside one of them still has to show the shape
27
+ * the published page gives it, and a film its poster.
28
+ */
29
+ export declare const MediaFactsLeaf: import("react").ForwardRefExoticComponent<LeafProps & import("react").RefAttributes<any>>;
30
+ /**
31
+ * Nested-object form of a normalized node map, which is what `Branch` walks
32
+ * (`node.children`). Cycle-safe via `seen`: a definition that somehow
33
+ * referenced an ancestor would otherwise recurse until the stack gave out.
34
+ */
35
+ export declare function denormalizeTree(nodes: Record<string, any>, rootId: string, seen?: Set<string>): any;
36
+ export interface NodeLeafProps extends LeafProps {
37
+ }
38
+ export declare const NodeLeaf: import("react").FunctionComponent<NodeLeafProps & import("react").RefAttributes<any>>;
39
+ export default NodeLeaf;
@@ -0,0 +1,628 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ /**
5
+ * @license
6
+ * Copyright 2023 Aglyn LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */ import { buildComponentDefaultIconPaths, buildComponentDefaultTokens, buildComponentDefaultValues, composeReusableComponentNodes, displayBindingTokens, FORM_COMPONENT_ID, hasBindings, HostViewType, LAYOUT_SLOT_COMPONENT_ID, NODE_ROOT_ID, placedFormPlacement, resolveBindings, resolveComponentPropTokens, REUSABLE_INSTANCE_COMPONENT_ID } from "@aglyn/aglyn";
20
+ import { Branch, Leaf, RendererComponents, Stem, Trunk } from "@aglyn/aglyn-node-renderer";
21
+ import * as Besigner from "@aglyn/besigner";
22
+ import { alpha, Box } from "@mui/material";
23
+ import { observer } from "mobx-react-lite";
24
+ import { forwardRef, useCallback, useContext, useMemo, useRef } from "react";
25
+ import BindingPickerContext from "../contexts/binding-picker-context.js";
26
+ import CanvasRevealContext, { CanvasMutedClassesContext } from "../contexts/canvas-reveal-context.js";
27
+ import ComponentPromotionContext from "../contexts/component-promotion-context.js";
28
+ import { useRenderedCanvasElements } from "../contexts/rendered-canvas-elements.js";
29
+ import useAglynBesignerFlag from "../hooks/use-aglyn-besigner-flag.js";
30
+ import { useNodeWithMediaAssetFacts } from "../hooks/use-media-asset-facts-overlay.js";
31
+ import useNodeWithHostTokens from "../hooks/use-node-with-host-tokens.js";
32
+ import { useNodeWithRepeatRecord, useRepeatCopies, useRepeatPreview } from "../hooks/use-repeat-preview.js";
33
+ import { RepeatRecordContext } from "../contexts/repeat-record-context.js";
34
+ import { isNodeHiddenOnSite, isNodeRevealedOnCanvas } from "../utils/canvas-reveal.js";
35
+ import { stripMutedClasses } from "../utils/muted-classes.js";
36
+ import DraggableDroppable from "./dnd/draggable-droppable.js";
37
+ import EmptyDocumentSlot from "./empty-document-slot.js";
38
+ /**
39
+ * The plain `Leaf`, drawing a node the way the published page composes it: its
40
+ * host variables filled in from the site being edited (AGL-2881), and a placed
41
+ * image or film with its DAM asset's current facts (AGL-2838, AGL-2856).
42
+ *
43
+ * For the nodes the canvas renders that are not canvas nodes — a component
44
+ * instance's definition, a placed form's design, the layout chrome — and so
45
+ * never reach `NodeLeaf`. A footer's `{{host.businessName}}` still has to read
46
+ * as the site's name, an asset inside one of them still has to show the shape
47
+ * the published page gives it, and a film its poster.
48
+ */ export const MediaFactsLeaf = /*#__PURE__*/ forwardRef((props, ref)=>{
49
+ const { node } = props, rest = _object_without_properties_loose(props, [
50
+ "node"
51
+ ]);
52
+ const withHostTokens = useNodeWithHostTokens(node);
53
+ const withRecord = useNodeWithRepeatRecord(withHostTokens);
54
+ const shown = useNodeWithMediaAssetFacts(withRecord);
55
+ return /*#__PURE__*/ _jsx(Leaf, _extends({
56
+ ref: ref,
57
+ node: shown
58
+ }, rest));
59
+ });
60
+ MediaFactsLeaf.displayName = 'MediaFactsLeaf';
61
+ /**
62
+ * Renderer overrides for the inside of a component instance (AGL-1251).
63
+ *
64
+ * The plain `Leaf` (through `MediaFactsLeaf`), deliberately, where the canvas
65
+ * otherwise uses `NodeLeaf`: the definition's nodes are NOT in the canvas, so
66
+ * anything that made them draggable, selectable or droppable would be reaching
67
+ * for canvas state that has no entry for them. Rendering them inert is not a
68
+ * restriction bolted on afterwards — it is the only thing these nodes can be.
69
+ */ const INERT_RENDERER = {
70
+ TrunkComponent: Trunk,
71
+ StemComponent: Stem,
72
+ BranchComponent: Branch,
73
+ LeafComponent: MediaFactsLeaf
74
+ };
75
+ /**
76
+ * Nested-object form of a normalized node map, which is what `Branch` walks
77
+ * (`node.children`). Cycle-safe via `seen`: a definition that somehow
78
+ * referenced an ancestor would otherwise recurse until the stack gave out.
79
+ */ export function denormalizeTree(nodes, rootId, seen = new Set()) {
80
+ const node = nodes == null ? void 0 : nodes[rootId];
81
+ if (!node || seen.has(rootId)) return undefined;
82
+ seen.add(rootId);
83
+ const childIds = Array.isArray(node.nodes) ? node.nodes : [];
84
+ return _extends({}, node, {
85
+ children: childIds.map((childId)=>denormalizeTree(nodes, childId, seen)).filter(Boolean)
86
+ });
87
+ }
88
+ /**
89
+ * The slot marker is EDITOR CHROME, so it holds the brand accent literally
90
+ * rather than reading `secondary` from the theme: the canvas renders under
91
+ * the host's palette, so a token would repaint the editor's own furniture
92
+ * whenever a subscriber restyles their site — and it already rendered pink
93
+ * instead of the design's blue.
94
+ */ const SLOT_ACCENT = '#00B0FF';
95
+ /**
96
+ * Visible placement marker for the LayoutSlot while editing a layout. The
97
+ * slot is a passthrough at runtime, so without this it disappears once it
98
+ * has children and designers lose track of where screen content lands.
99
+ */ const SlotMarker = ({ caption })=>/*#__PURE__*/ _jsxs(Box, {
100
+ "aria-hidden": true,
101
+ "data-aglyn-slot-marker": "",
102
+ sx: {
103
+ m: 1,
104
+ p: 2,
105
+ minHeight: 64,
106
+ display: 'flex',
107
+ flexDirection: 'column',
108
+ alignItems: 'center',
109
+ justifyContent: 'center',
110
+ gap: 0.5,
111
+ borderWidth: 2,
112
+ borderStyle: 'dashed',
113
+ // Brand blue on a faint tint, not a grey dashed box: the slot is the
114
+ // one region the layout does not own, and it should not read as just
115
+ // another empty container.
116
+ borderColor: SLOT_ACCENT,
117
+ backgroundColor: alpha(SLOT_ACCENT, 0.06),
118
+ borderRadius: 1,
119
+ color: 'text.secondary',
120
+ fontSize: 13,
121
+ textAlign: 'center'
122
+ },
123
+ children: [
124
+ /*#__PURE__*/ _jsx(Box, {
125
+ component: "span",
126
+ sx: {
127
+ color: SLOT_ACCENT,
128
+ fontWeight: 700
129
+ },
130
+ children: '◇ layout-slot'
131
+ }),
132
+ /*#__PURE__*/ _jsx(Box, {
133
+ component: "span",
134
+ children: caption || 'Screen content renders here'
135
+ })
136
+ ]
137
+ });
138
+ /**
139
+ * The repeat badge (AGL-3111).
140
+ *
141
+ * Editor chrome, so it holds its accent literally for the reason
142
+ * {@link SLOT_ACCENT} does: the canvas renders under the SITE's palette, and a
143
+ * theme token here would repaint the editor's own furniture whenever a
144
+ * subscriber restyled their site.
145
+ *
146
+ * It cannot reach a published page: only `NodeLeaf` draws it, and a published
147
+ * page is composed from stored nodes and rendered through the plain `Leaf`.
148
+ * The stored node is untouched either way — this is a render copy, like every
149
+ * other thing the canvas lays over a node.
150
+ */ const REPEAT_ACCENT = '#7C4DFF';
151
+ /** The chip's own ink, for the same reason and read against that accent. */ const REPEAT_INK = '#FFFFFF';
152
+ const RepeatBadge = ({ label, count })=>/*#__PURE__*/ _jsx(Box, {
153
+ "aria-hidden": true,
154
+ "data-aglyn-repeat-badge": "",
155
+ sx: {
156
+ // Out of the element's own layout: a badge that took part in a flex row
157
+ // would move the design it is describing.
158
+ position: 'absolute',
159
+ top: 0,
160
+ right: 0,
161
+ zIndex: 2,
162
+ // Never swallows a click — the element under it stays selectable.
163
+ pointerEvents: 'none',
164
+ px: 0.75,
165
+ py: 0.25,
166
+ maxWidth: '100%',
167
+ overflow: 'hidden',
168
+ textOverflow: 'ellipsis',
169
+ whiteSpace: 'nowrap',
170
+ borderBottomLeftRadius: 3,
171
+ backgroundColor: REPEAT_ACCENT,
172
+ color: REPEAT_INK,
173
+ fontSize: 11,
174
+ fontWeight: 700,
175
+ lineHeight: 1.6,
176
+ letterSpacing: 0.2
177
+ },
178
+ children: `⟳ ${label} · ${count} ${count === 1 ? 'record' : 'records'}`
179
+ });
180
+ export const NodeLeaf = observer(/*#__PURE__*/ forwardRef((props, ref)=>{
181
+ var _ref, _ref1, _ref2, _ref3, _ref4;
182
+ var _node_nodes, _node_props;
183
+ const { node, children } = props, rest = _object_without_properties_loose(props, [
184
+ "node",
185
+ "children"
186
+ ]);
187
+ const [viewType] = useAglynBesignerFlag('viewType');
188
+ // The canvas element registry, finally given a WRITER (AGL-2486).
189
+ //
190
+ // `RenderedCanvasElementsProvider` has existed since the registry was
191
+ // introduced and `setElementRef`/`deleteElementRef` were called from
192
+ // NOWHERE in the repo — `elements.current` was `{}` for the life of every
193
+ // session. Everything that reads it therefore read an empty map and
194
+ // failed the only way an empty map can: silently.
195
+ //
196
+ // Two features were void because of it, and neither logged anything:
197
+ //
198
+ // `usePresence`'s cursor broadcast resolves the canvas root through
199
+ // this registry and bails with `if (!root) return`, so no editor has
200
+ // EVER written a cursor position. Confirmed against production RTDB on
201
+ // 2026-08-22: three live presence entries across three rooms, not one
202
+ // carrying `cursorX`/`cursorY`.
203
+ //
204
+ // `CollaboratorOverlays` resolves both the canvas root and each peer's
205
+ // selected node here, so `placements` was always empty and the overlay
206
+ // returned null. Confirmed live in the running console: a collaborator
207
+ // entry carrying both a cursor and a selection rendered its avatar and
208
+ // drew no cursor, no selection box and no name label.
209
+ //
210
+ // Registering here rather than in the renderer keeps it to the canvas:
211
+ // `NodeLeaf` is the besigner's leaf component, so component-definition
212
+ // previews (which render the plain `Leaf` through `INERT_RENDERER`) stay
213
+ // out of the registry — they are not in the canvas and must not be
214
+ // addressable as though they were.
215
+ //
216
+ // `NODE_ROOT_ID` and `CANVAS_ROOT_ELEMENT_ID` are the same string
217
+ // (`'_@_'`), so keying on `$id` registers the canvas root under the id
218
+ // the cursor code already looks for, with no special case.
219
+ const { elements, setElementRef, deleteElementRef } = useRenderedCanvasElements();
220
+ const $id = node == null ? void 0 : node.$id;
221
+ // What THIS leaf last put in the registry. A remount can hand the new
222
+ // element its ref before the old one is cleared, so an unconditional
223
+ // delete on `null` would evict the live registration and put the
224
+ // registry back to the state this whole change exists to fix.
225
+ const registered = useRef(null);
226
+ const registerElement = useCallback((element)=>{
227
+ var _elements_current_$id, _elements_current;
228
+ // Forward FIRST and unconditionally: dnd and the renderer already
229
+ // depend on this ref, and registration must never change what they
230
+ // observe.
231
+ if (typeof ref === 'function') ref(element);
232
+ else if (ref) ref.current = element;
233
+ if (!$id) return;
234
+ if (element instanceof Element) {
235
+ registered.current = element;
236
+ setElementRef($id, {
237
+ $id,
238
+ node: element,
239
+ dragHandle: undefined
240
+ });
241
+ return;
242
+ }
243
+ // Cleared (or never a DOM element — a class instance, say). Only
244
+ // withdraw the registration if it is still OURS.
245
+ const current = elements == null ? void 0 : (_elements_current = elements.current) == null ? void 0 : (_elements_current_$id = _elements_current[$id]) == null ? void 0 : _elements_current_$id.node;
246
+ if (!registered.current || current === registered.current) {
247
+ deleteElementRef($id);
248
+ }
249
+ registered.current = null;
250
+ }, [
251
+ ref,
252
+ $id,
253
+ elements,
254
+ setElementRef,
255
+ deleteElementRef
256
+ ]);
257
+ const showSlotMarker = (node == null ? void 0 : node.componentId) === LAYOUT_SLOT_COMPONENT_ID && viewType === HostViewType.LAYOUT;
258
+ // A document with no nodes has nothing to aim at. Wrapped in a shared
259
+ // layout it is worse than empty — the slot passes its children straight
260
+ // through, so the root collapses to a zero-height strip between locked
261
+ // chrome and the nav renders directly into the footer. Hung off the ROOT
262
+ // leaf, which is already inside `DraggableDroppable`, so giving it height
263
+ // is all a drop needs to resolve against the document root.
264
+ const showEmptyDocumentSlot = (node == null ? void 0 : node.$id) === NODE_ROOT_ID && !(node == null ? void 0 : (_node_nodes = node.nodes) == null ? void 0 : _node_nodes.length) && viewType !== HostViewType.LAYOUT;
265
+ // Nodes the author has opened up for designing (AGL-592). Through a
266
+ // context rather than the flag itself: the canvas subscribes once and
267
+ // every leaf reads the result.
268
+ const revealedNodeIds = useContext(CanvasRevealContext);
269
+ const mutedClasses = useContext(CanvasMutedClassesContext);
270
+ // WYSIWYG bindings (AGL-97): resolve variable/function tokens
271
+ // live on the rendered copy (selection/dnd keep the original node).
272
+ // Bound nodes are flagged either way so editors can spot them.
273
+ const [resolveFlag] = useAglynBesignerFlag('resolveBindings');
274
+ const { variables, functions, componentProps } = useContext(BindingPickerContext);
275
+ const boundProps = useMemo(()=>{
276
+ var _ref;
277
+ return Object.entries((_ref = node == null ? void 0 : node.props) != null ? _ref : {}).filter(([, value])=>typeof value === 'string' && hasBindings(value));
278
+ }, // MobX props are observable; the JSON string keys the memo cheaply.
279
+ // eslint-disable-next-line react-hooks/exhaustive-deps
280
+ [
281
+ node,
282
+ JSON.stringify((_ref = node == null ? void 0 : node.props) != null ? _ref : {})
283
+ ]);
284
+ /**
285
+ * A component editor draws with the definition's OWN defaults
286
+ * (AGL-2870), so `{{prop.headline}}` shows the headline and a film with a
287
+ * default source actually plays.
288
+ *
289
+ * Only props that HAVE a default are substituted. One without stays a
290
+ * visible token, which is the signal an author needs: the slot is real
291
+ * and nothing fills it yet. Substituting `''` there would draw an empty
292
+ * component and hide the very thing they still have to decide.
293
+ *
294
+ * On a screen this path does nothing — the props belong to the component
295
+ * route, and an instance is composed through `composeReusableComponentNodes`
296
+ * below, which is the single substitution path a published page uses.
297
+ */ const defaultPropTokens = useMemo(()=>buildComponentDefaultTokens(componentProps), [
298
+ componentProps
299
+ ]);
300
+ // The paths of the default icons, which a field bound to an icon property
301
+ // draws with — the editor has no reason to have loaded the icon catalog.
302
+ const defaultIconPaths = useMemo(()=>buildComponentDefaultIconPaths(componentProps), [
303
+ componentProps
304
+ ]);
305
+ // The values the defaults hand their bound fields (AGL-2893), so a list
306
+ // stays a list and a theme multiple a number on the editor's canvas too.
307
+ const defaultValues = useMemo(()=>buildComponentDefaultValues(componentProps), [
308
+ componentProps
309
+ ]);
310
+ const renderNode = useMemo(()=>{
311
+ var _ref, _resolveComponentPropTokens_String;
312
+ const hasDeclaredProps = Boolean(componentProps == null ? void 0 : componentProps.length);
313
+ if (!boundProps.length || !Object.keys(variables != null ? variables : {}).length && !Object.keys(functions != null ? functions : {}).length && !hasDeclaredProps) {
314
+ return node;
315
+ }
316
+ const resolved = _extends({}, (_ref = node == null ? void 0 : node.props) != null ? _ref : {});
317
+ for (const [key, value] of boundProps){
318
+ // Resolve toggle off → show friendly token text: id tokens map to
319
+ // the referent's CURRENT name (AGL-186), never raw doc ids.
320
+ resolved[key] = resolveFlag === false ? displayBindingTokens(value, variables != null ? variables : {}, functions != null ? functions : {}) : resolveBindings(value, variables != null ? variables : {}, functions != null ? functions : {});
321
+ }
322
+ const next = _extends({}, node, {
323
+ props: resolved
324
+ });
325
+ if (!hasDeclaredProps) return next;
326
+ // Through the same substitution a placed instance uses, keyed by this
327
+ // node alone — one code path deciding what a token becomes, never two
328
+ // that could disagree.
329
+ //
330
+ // The raw-token view substitutes no defaults: an author who turned
331
+ // resolution OFF asked to see the tokens, and a default is a resolved
332
+ // value like any other. A field bound to a Yes/no property still
333
+ // receives a yes or a no there, because a switch has no way to show a
334
+ // token and reads the token's text as a yes.
335
+ return (_resolveComponentPropTokens_String = resolveComponentPropTokens({
336
+ [String(node == null ? void 0 : node.$id)]: next
337
+ }, componentProps, resolveFlag === false ? undefined : defaultPropTokens, resolveFlag === false ? undefined : defaultIconPaths, resolveFlag === false ? undefined : defaultValues)[String(node == null ? void 0 : node.$id)]) != null ? _resolveComponentPropTokens_String : next;
338
+ }, [
339
+ node,
340
+ boundProps,
341
+ resolveFlag,
342
+ variables,
343
+ functions,
344
+ componentProps,
345
+ defaultPropTokens,
346
+ defaultIconPaths,
347
+ defaultValues
348
+ ]);
349
+ // Host variables (AGL-2881), filled in on the same render copy and after
350
+ // the bindings and the component's own defaults, which is the order the
351
+ // published page composes in: a default that names the host resolves
352
+ // too. The raw-token view reaches this leaf as no site at all
353
+ // (`CanvasHostTokensProvider`), so its tokens stay as written. Keyed by
354
+ // `boundProps`, which follows the observable props this copy reads.
355
+ const hostResolvedNode = useNodeWithHostTokens(renderNode, boundProps);
356
+ // Classes switched off for comparison (AGL-2486). Composed onto the SAME
357
+ // render copy the binding resolution builds, never onto the canvas node:
358
+ // selection, the hierarchy and every save keep reading the element's real
359
+ // class list, and the canvas paints without the switched-off names.
360
+ const renderNodeUnclassed = useMemo(()=>stripMutedClasses(hostResolvedNode, node == null ? void 0 : node.$id, mutedClasses), [
361
+ hostResolvedNode,
362
+ node,
363
+ mutedClasses
364
+ ]);
365
+ /**
366
+ * The record a repeat above this one is drawing (AGL-3111).
367
+ *
368
+ * Applied in the same place, and for the same reason, as the host tokens
369
+ * and the DAM facts above: the published page substitutes `{{item.*}}`
370
+ * when it composes, so the canvas substitutes it on the render copy while
371
+ * the node keeps the tokens every save writes.
372
+ */ const withRepeatRecord = useNodeWithRepeatRecord(renderNodeUnclassed);
373
+ // A placed asset's shape, and a film's length and poster, as its DAM
374
+ // document records them NOW (AGL-2838, AGL-2856). The published page lays
375
+ // the asset over the node when it is composed, so the canvas lays it over
376
+ // the same render copy: a replace shows here as it shows to a visitor,
377
+ // while selection, the panels and every save keep reading the node's
378
+ // stored props.
379
+ const shownNode = useNodeWithMediaAssetFacts(withRepeatRecord);
380
+ /**
381
+ * What this element repeats over, and the copies it draws (AGL-3111).
382
+ *
383
+ * The first record's copy is the element's own children — real canvas
384
+ * nodes an author selects, drags and edits — with that record laid over
385
+ * their render copies through {@link RepeatRecordContext}. Records 2..n
386
+ * are inert pictures of the same template, built by the page's own
387
+ * expansion. Editing the template therefore edits every copy, because
388
+ * there is only ever one.
389
+ */ const repeatPreview = useRepeatPreview(node);
390
+ const repeatCopies = useRepeatCopies(node, repeatPreview);
391
+ const firstRecord = useMemo(()=>{
392
+ var _repeatPreview_dataset;
393
+ return repeatPreview ? {
394
+ record: repeatPreview.records[0],
395
+ model: (_repeatPreview_dataset = repeatPreview.dataset) == null ? void 0 : _repeatPreview_dataset.model,
396
+ datasetsByKey: repeatPreview.datasetsByKey
397
+ } : undefined;
398
+ }, [
399
+ repeatPreview
400
+ ]);
401
+ // A component instance renders its definition (AGL-1251) instead of the
402
+ // named dashed box. Authors placed a hero and saw a grey rectangle, so
403
+ // the props they filled in were invisible until Preview.
404
+ //
405
+ // Rendered, never grafted: the definition's nodes stay out of the canvas
406
+ // entirely. That is what makes this safe — there is nothing to lock,
407
+ // nothing to strip before a save, and no way for a definition's node to
408
+ // be persisted into the document that placed it. Same shape as the
409
+ // binding resolution above, which renders a resolved copy while
410
+ // selection and dnd keep the original node.
411
+ const { definitions, formDesigns } = useContext(ComponentPromotionContext);
412
+ const instanceTree = useMemo(()=>{
413
+ var _ref, _node_props;
414
+ var _node_nodes;
415
+ if ((node == null ? void 0 : node.componentId) !== REUSABLE_INSTANCE_COMPONENT_ID) {
416
+ return undefined;
417
+ }
418
+ // Already expanded into this canvas — the layout-chrome store grafts
419
+ // before it loads (AGL-1218), so its instances arrive with children.
420
+ // Rendering here too would draw the nav twice.
421
+ if (node == null ? void 0 : (_node_nodes = node.nodes) == null ? void 0 : _node_nodes.length) return undefined;
422
+ const props = (_ref = node == null ? void 0 : node.props) != null ? _ref : {};
423
+ const definition = props.refId ? definitions == null ? void 0 : definitions[props.refId] : undefined;
424
+ if (!(definition == null ? void 0 : definition.nodes) || !(definition == null ? void 0 : definition.rootId)) return undefined;
425
+ // Plain snapshot: props are MobX observables and the graft reads nested
426
+ // `propValues` off them. The placement's classes stay out of it, as its
427
+ // `sx` does: this leaf already renders both on the element around the
428
+ // preview, and the graft joins a placement's classes onto the root it
429
+ // becomes. Handed them here, the preview's root would apply every class
430
+ // a second time, and keep `aglyn-hidden` collapsed inside a placement
431
+ // the canvas has revealed for designing.
432
+ const _JSON_parse = JSON.parse(JSON.stringify((_node_props = node.props) != null ? _node_props : {})), { className: _placementClasses } = _JSON_parse, snapshotProps = _object_without_properties_loose(_JSON_parse, [
433
+ "className"
434
+ ]);
435
+ // Reuse the real graft so the canvas resolves `{{prop.*}}` exactly as
436
+ // the published page will — one substitution path, not a second one
437
+ // that could disagree about which value wins.
438
+ const composed = composeReusableComponentNodes({
439
+ [node.$id]: _extends({
440
+ $id: node.$id,
441
+ componentId: REUSABLE_INSTANCE_COMPONENT_ID,
442
+ props: snapshotProps
443
+ }, node.styleOverrides && {
444
+ styleOverrides: JSON.parse(JSON.stringify(node.styleOverrides))
445
+ }, node.attrOverrides && {
446
+ attrOverrides: JSON.parse(JSON.stringify(node.attrOverrides))
447
+ }, {
448
+ nodes: []
449
+ })
450
+ }, // The host's WHOLE definitions map, not just this instance's own
451
+ // (AGL-1898). A definition may contain instances of OTHER
452
+ // definitions, and `composeReusableComponentNodes` expands those —
453
+ // but only the ones it is handed. Preview, tenant SSR and the
454
+ // layout-chrome graft all pass the full map, so a one-entry map
455
+ // here made the canvas the only surface that left a nested
456
+ // component as an unexpanded placeholder.
457
+ //
458
+ // It also silently voided propagation for the inner component:
459
+ // publishing a shared button re-rendered every canvas showing it
460
+ // directly and none of the ones showing it through the nav that
461
+ // contains it — which is the case a shared component is usually in.
462
+ //
463
+ // Safe to widen because the `nodes` argument above is this ONE
464
+ // instance: the extra definitions can only be reached from inside
465
+ // the subtree being grafted, never applied to some other node.
466
+ definitions);
467
+ // The graft puts the definition's root IN the instance's place rather
468
+ // than under it (AGL-2521), so the component to draw is at the
469
+ // instance's own id. Reading `nodes[0]` here would render the root's
470
+ // FIRST CHILD and drop the component's outer element with its siblings.
471
+ const grafted = composed[node.$id];
472
+ return grafted && grafted.componentId !== REUSABLE_INSTANCE_COMPONENT_ID ? denormalizeTree(composed, node.$id) : undefined;
473
+ // Observable props/overrides: the JSON strings key the memo, as above.
474
+ // eslint-disable-next-line react-hooks/exhaustive-deps
475
+ }, [
476
+ node,
477
+ JSON.stringify((_ref1 = node == null ? void 0 : node.props) != null ? _ref1 : {}),
478
+ JSON.stringify((_ref2 = node == null ? void 0 : node.styleOverrides) != null ? _ref2 : {}),
479
+ JSON.stringify((_ref3 = node == null ? void 0 : node.attrOverrides) != null ? _ref3 : {}),
480
+ definitions
481
+ ]);
482
+ /**
483
+ * A placed form draws its ENTITY'S published fields, not the page's copy
484
+ * of them (`docs/specs/reusable-forms.md`).
485
+ *
486
+ * The same render-copy treatment the instance above gets, and for the same
487
+ * reason: the entity's nodes stay out of the canvas, so there is nothing to
488
+ * lock, nothing to strip before a save, and no way for a form's fields to
489
+ * be persisted into the screen that placed it.
490
+ *
491
+ * It runs the REAL graft rather than reading `design.nodes` directly, so a
492
+ * component nested inside the form design expands here exactly as it will
493
+ * on the published page — one resolution path, not a second that could
494
+ * disagree.
495
+ *
496
+ * When it resolves, the node's own children are not rendered (below): the
497
+ * published page discards them, and a canvas that drew both would show the
498
+ * author a page that does not exist. Where the entity has no published
499
+ * design the memo is `undefined`, the children render, and the form the
500
+ * author drew is the form they see — which is every form built before the
501
+ * entity existed.
502
+ */ const placedFormTree = useMemo(()=>{
503
+ var _node_props;
504
+ var _node_props1, _composed_node_$id_nodes, _composed_node_$id;
505
+ if ((node == null ? void 0 : node.componentId) !== FORM_COMPONENT_ID) return undefined;
506
+ const formId = node == null ? void 0 : (_node_props1 = node.props) == null ? void 0 : _node_props1.formId;
507
+ if (typeof formId !== 'string' || !formId) return undefined;
508
+ const composed = composeReusableComponentNodes({
509
+ [node.$id]: {
510
+ $id: node.$id,
511
+ componentId: FORM_COMPONENT_ID,
512
+ // Plain snapshot: props are MobX observables, as above.
513
+ props: JSON.parse(JSON.stringify((_node_props = node.props) != null ? _node_props : {})),
514
+ nodes: []
515
+ }
516
+ }, // Component definitions ride along so an instance INSIDE the form
517
+ // design expands; the map is safe to pass whole for the reason the
518
+ // instance graft above states — the one node handed in is this form.
519
+ definitions, [
520
+ placedFormPlacement(formDesigns)
521
+ ]);
522
+ const graftedRootId = (_composed_node_$id = composed[node.$id]) == null ? void 0 : (_composed_node_$id_nodes = _composed_node_$id.nodes) == null ? void 0 : _composed_node_$id_nodes[0];
523
+ return graftedRootId ? denormalizeTree(composed, graftedRootId) : undefined;
524
+ // Observable props: the JSON string keys the memo, as above.
525
+ // eslint-disable-next-line react-hooks/exhaustive-deps
526
+ }, [
527
+ node,
528
+ JSON.stringify((_ref4 = node == null ? void 0 : node.props) != null ? _ref4 : {}),
529
+ definitions,
530
+ formDesigns
531
+ ]);
532
+ return /*#__PURE__*/ _jsx(DraggableDroppable, {
533
+ node: node,
534
+ type: Besigner.DragType.CANVAS,
535
+ accept: Object.values(Besigner.DragType),
536
+ disableDragging: !Besigner.dnd.canDragNode(node),
537
+ children: /*#__PURE__*/ _jsxs(Leaf, _extends({
538
+ ref: registerElement,
539
+ node: shownNode,
540
+ "data-aglyn-selected": Besigner.focus.isNodeSelected(node),
541
+ // Present while the selection lives in this node's subtree (the
542
+ // node itself or any descendant). Canvas-aware components (nav
543
+ // menus, drawers) read this neutral leaf attribute to expand
544
+ // only while they are being authored (AGL-571). Presence-based
545
+ // (''/undefined) so unaffected leaves carry no attribute.
546
+ "data-aglyn-selected-within": Besigner.focus.isNodeOrDescendantSelected(node) ? '' : undefined,
547
+ // Present on an element that carries the hidden class while the
548
+ // canvas is showing it anyway (AGL-592) — the flag the canvas
549
+ // stylesheet checks before collapsing it. Stamped on the hidden
550
+ // element itself, so no wrapper a component renders around its
551
+ // children can come between the two.
552
+ "data-aglyn-revealed": isNodeHiddenOnSite(node) && isNodeRevealedOnCanvas(node, revealedNodeIds) ? '' : undefined,
553
+ "data-aglyn-bound": boundProps.length ? '' : undefined
554
+ }, rest, {
555
+ children: [
556
+ placedFormTree ? null : firstRecord ? // The template IS the first copy: the real children, drawing the
557
+ // first record. Provided around them rather than applied to them,
558
+ // so every descendant leaf resolves its own tokens the way the
559
+ // page's substitution walks the whole cloned subtree.
560
+ /*#__PURE__*/ _jsx(RepeatRecordContext.Provider, {
561
+ value: firstRecord,
562
+ children: children
563
+ }) : children,
564
+ repeatCopies.length ? // Inert and click-through like the component and form previews
565
+ // below, and for the same reason: a copy is a picture of the
566
+ // template, not a document. Selecting one would offer an author
567
+ // an element no save can reach.
568
+ /*#__PURE__*/ _jsx(Box, {
569
+ sx: {
570
+ pointerEvents: 'none'
571
+ },
572
+ "data-aglyn-repeat-preview": "",
573
+ "aria-hidden": true,
574
+ children: /*#__PURE__*/ _jsx(RendererComponents.Provider, {
575
+ value: INERT_RENDERER,
576
+ children: repeatCopies.map((copy)=>/*#__PURE__*/ _jsx(Stem, {
577
+ node: copy
578
+ }, copy.$id))
579
+ })
580
+ }) : null,
581
+ repeatPreview ? /*#__PURE__*/ _jsx(RepeatBadge, {
582
+ label: repeatPreview.label,
583
+ count: repeatPreview.records.length
584
+ }) : null,
585
+ placedFormTree ? // Inert and click-through like the instance preview below: the
586
+ // fields belong to the form, and they are edited in the form's own
587
+ // besigner, so the only selectable thing here is the placement.
588
+ /*#__PURE__*/ _jsx(Box, {
589
+ sx: {
590
+ pointerEvents: 'none'
591
+ },
592
+ "data-aglyn-form-preview": "",
593
+ children: /*#__PURE__*/ _jsx(RendererComponents.Provider, {
594
+ value: INERT_RENDERER,
595
+ children: /*#__PURE__*/ _jsx(Stem, {
596
+ node: placedFormTree
597
+ })
598
+ })
599
+ }) : null,
600
+ instanceTree ? // `pointerEvents: none` so a click anywhere on the rendered
601
+ // component still lands on the instance beneath it — the
602
+ // instance is the only thing here that can be selected, and the
603
+ // only thing whose Attributes are editable.
604
+ /*#__PURE__*/ _jsx(Box, {
605
+ sx: {
606
+ pointerEvents: 'none'
607
+ },
608
+ "data-aglyn-component-preview": "",
609
+ children: /*#__PURE__*/ _jsx(RendererComponents.Provider, {
610
+ value: INERT_RENDERER,
611
+ children: /*#__PURE__*/ _jsx(Stem, {
612
+ node: instanceTree
613
+ })
614
+ })
615
+ }) : null,
616
+ showSlotMarker ? /*#__PURE__*/ _jsx(SlotMarker, {
617
+ caption: node == null ? void 0 : (_node_props = node.props) == null ? void 0 : _node_props['caption']
618
+ }) : null,
619
+ showEmptyDocumentSlot ? /*#__PURE__*/ _jsx(EmptyDocumentSlot, {}) : null
620
+ ]
621
+ }))
622
+ });
623
+ }));
624
+ NodeLeaf.displayName = 'BesignerLeafComponent';
625
+ NodeLeaf.aglyn = true;
626
+ export default NodeLeaf;
627
+
628
+ //# sourceMappingURL=node-leaf.js.map