@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,346 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { _ as _extends } from "@swc/helpers/_/_extends";
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { aglyn, CanvasManager, NODE_ROOT_ID, ScreenLinkContext, SiteContext } from "@aglyn/aglyn";
19
+ // Deep import, NOT the barrel (AGL-2486) — see `plugin-styles-ui.tsx`.
20
+ import { PluginStyles } from "@aglyn/aglyn/plugin-manager/plugin-styles-ui";
21
+ import { AglynNodeRenderer, useAglynSiteTheme } from "@aglyn/aglyn-node-renderer";
22
+ import { MuiShadowDom, useMuiShadowDomContext } from "@aglyn/shared-ui-jsx";
23
+ import { ThemeProvider } from "@aglyn/shared-ui-theme";
24
+ import { Box, GlobalStyles, Typography } from "@mui/material";
25
+ import { observer } from "mobx-react-lite";
26
+ import { useResolvedHostThemeDocument } from "../utils/active-host-theme.js";
27
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
28
+ /**
29
+ * The width the preview composes at, before it is scaled down to fit.
30
+ *
31
+ * Elements are authored for a page, not for a thumbnail: a Hero centres a
32
+ * headline across a viewport and a Footer lays out four columns. Composing at
33
+ * a phone width and calling it a preview would show neither. So it renders at
34
+ * a desktop width and the whole stage is scaled — the proportions the element
35
+ * was designed for survive, just smaller.
36
+ */ const STAGE_WIDTH = 1280;
37
+ /** Never blow a small element up past life size; only ever scale down. */ const MAX_SCALE = 1;
38
+ /** Below this a preview is a smudge; better to show a short empty band. */ const MIN_HEIGHT = 40;
39
+ /** Enough for the note to read as a sentence rather than a clipped line. */ const NOTE_HEIGHT = 76;
40
+ /**
41
+ * Renders the preset's own nodes into an isolated stage, so a picker shows
42
+ * what an element LOOKS like and not only what it is called (AGL-2486).
43
+ *
44
+ * Three things this must never do, each of which is a real hazard rather than
45
+ * a hypothetical one:
46
+ *
47
+ * 1. **Touch `Aglyn.canvas`.** That singleton holds the document being
48
+ * edited; the console's Preview route calls `setNodes` on it, and doing
49
+ * the same here would blow away the user's screen to draw a thumbnail.
50
+ * Every preview gets its own `CanvasManager`, backed by the real app so
51
+ * component schemas still resolve — the pattern `useLayoutChromeCanvas`
52
+ * already uses for locked layout chrome.
53
+ * 2. **Mutate anything from inside.** The stage is inert: pointer events are
54
+ * off, the subtree is marked `inert` so nothing in it is focusable or
55
+ * clickable, links are told not to navigate, and `SiteContext.preview`
56
+ * turns every write into a synthetic 423.
57
+ * 3. **Escape its box.** The stage is scaled to fit and clipped, so a Footer
58
+ * cannot push Confirm off the dialog or stretch the docked column.
59
+ *
60
+ * Elements that cannot render standalone — a Cart, a Product grid, anything
61
+ * reading site data — are NOT special-cased here. Deliberately: they already
62
+ * render their own dashed "Cart — lines render here" placeholder when there
63
+ * is no `hostId`, and this preview does not supply one. That placeholder is
64
+ * the honest answer to "what will I get", and it means the picker needs no
65
+ * second list of which elements are self-contained: each element already
66
+ * says so itself.
67
+ */ export const ElementPreview = observer((props)=>{
68
+ const { node, height = 160, requiredParents } = props;
69
+ // Context where it exists, register where the surface sits outside the
70
+ // page — see `active-host-theme.ts`. The preview must carry the SITE's
71
+ // brand wherever it is mounted.
72
+ const hostThemeDoc = useResolvedHostThemeDocument();
73
+ // A throwaway store per preset. Never the global canvas.
74
+ const canvas = useMemo(()=>{
75
+ const data = node == null ? void 0 : node.data;
76
+ if (!data) return undefined;
77
+ try {
78
+ const store = new CanvasManager(aglyn);
79
+ // Seed an empty root, then insert through the SAME path the drawer
80
+ // uses. Handing `preset.data` straight to `processNodesToDenormalized`
81
+ // looks equivalent and is not: it keys nodes by `$id` and maps each
82
+ // child to `i.$id`, and a preset's nodes carry `$id: null` until they
83
+ // are minted — so every child was filtered out and the preview drew an
84
+ // empty root. `addNodeFromPreset` runs `createDuplicateNode` first,
85
+ // which is what assigns them.
86
+ store.setNodes(store.processNodesToDenormalized([
87
+ {
88
+ $id: NODE_ROOT_ID,
89
+ componentId: 'div',
90
+ nodes: []
91
+ }
92
+ ]));
93
+ const rootNode = store.getNode(NODE_ROOT_ID);
94
+ store.addNodeFromPreset(node, rootNode);
95
+ return store;
96
+ } catch (error) {
97
+ // A preset the renderer cannot compose must cost the picker nothing.
98
+ console.error('Element preview failed to compose', error);
99
+ return undefined;
100
+ }
101
+ }, [
102
+ node
103
+ ]);
104
+ const root = canvas == null ? void 0 : canvas.getNode(NODE_ROOT_ID);
105
+ // Hoisted above the early return — every hook this component calls has to
106
+ // run on every render, including the one where there is nothing to draw.
107
+ const siteValue = useMemo(()=>({
108
+ preview: true
109
+ }), []);
110
+ const linkValue = useMemo(()=>({
111
+ suppressNavigation: true
112
+ }), []);
113
+ const boxRef = useRef(null);
114
+ const contentRef = useRef(null);
115
+ const hostRef = useRef(null);
116
+ // Whether the composed tree drew anything a person can see.
117
+ const [hasInk, setHasInk] = useState(true);
118
+ const [scale, setScale] = useState(0);
119
+ // The box shrinks to the SCALED CONTENT rather than standing at its cap.
120
+ // Most elements are wide and short — a Nav Bar is 1280x70 — so scaling to
121
+ // the column width leaves a ~12px strip, and a fixed-height box renders it
122
+ // as a sliver marooned at the top of a white rectangle. Measured, not
123
+ // assumed: the content decides, the cap only stops a Footer running away.
124
+ const [contentHeight, setContentHeight] = useState(0);
125
+ useLayoutEffect(()=>{
126
+ const box = boxRef.current;
127
+ if (!box) return;
128
+ const fit = ()=>{
129
+ var _contentRef_current;
130
+ const width = box.clientWidth;
131
+ if (width) setScale(Math.min(MAX_SCALE, width / STAGE_WIDTH));
132
+ const natural = (_contentRef_current = contentRef.current) == null ? void 0 : _contentRef_current.scrollHeight;
133
+ if (natural) setContentHeight(natural);
134
+ };
135
+ fit();
136
+ if (typeof ResizeObserver === 'undefined') return;
137
+ const observer = new ResizeObserver(fit);
138
+ observer.observe(box);
139
+ if (contentRef.current) observer.observe(contentRef.current);
140
+ return ()=>observer.disconnect();
141
+ }, [
142
+ root
143
+ ]);
144
+ // The shadow root is attached by the ShadowRoot component's OWN effect,
145
+ // which runs after this component's — and the portal that fills it renders
146
+ // a tick later still. Checking for ink once, on layout, therefore read an
147
+ // empty (or absent) root every time and concluded "inked" by default.
148
+ // Re-checked on a deferred pass and then on mutation.
149
+ useEffect(()=>{
150
+ const host = hostRef.current;
151
+ if (!host) return;
152
+ let cancelled = false;
153
+ const check = ()=>{
154
+ if (!cancelled) setHasInk(subtreeHasInk(host));
155
+ };
156
+ const timers = [
157
+ setTimeout(check, 0),
158
+ setTimeout(check, 120)
159
+ ];
160
+ let observer;
161
+ if (host.shadowRoot && typeof MutationObserver !== 'undefined') {
162
+ observer = new MutationObserver(check);
163
+ observer.observe(host.shadowRoot, {
164
+ childList: true,
165
+ subtree: true,
166
+ characterData: true
167
+ });
168
+ }
169
+ return ()=>{
170
+ cancelled = true;
171
+ timers.forEach(clearTimeout);
172
+ observer == null ? void 0 : observer.disconnect();
173
+ };
174
+ }, [
175
+ root
176
+ ]);
177
+ if (!root) return null;
178
+ // Below MIN_HEIGHT there is nothing to look at; above `height` a tall
179
+ // element is clipped rather than allowed to grow the surface.
180
+ const scaledHeight = !hasInk ? NOTE_HEIGHT : contentHeight ? Math.max(MIN_HEIGHT, Math.min(height, Math.ceil(contentHeight * scale))) : height;
181
+ return /*#__PURE__*/ _jsxs(Box, {
182
+ ref: boxRef,
183
+ "data-testid": "element-preview",
184
+ "aria-hidden": true,
185
+ sx: {
186
+ position: 'relative',
187
+ width: 1,
188
+ height: scaledHeight,
189
+ overflow: 'hidden',
190
+ borderRadius: 1,
191
+ border: 1,
192
+ borderColor: 'divider',
193
+ backgroundColor: 'background.paper',
194
+ // Belt to the `inert` brace below: nothing in a picker preview is
195
+ // clickable, draggable or selectable.
196
+ pointerEvents: 'none',
197
+ userSelect: 'none'
198
+ },
199
+ children: [
200
+ !hasInk ? /*#__PURE__*/ _jsx(Box, {
201
+ "data-testid": "element-preview-empty",
202
+ sx: {
203
+ position: 'absolute',
204
+ inset: 0,
205
+ display: 'flex',
206
+ alignItems: 'center',
207
+ justifyContent: 'center',
208
+ textAlign: 'center',
209
+ p: 1.5,
210
+ zIndex: 1,
211
+ backgroundColor: 'background.paper'
212
+ },
213
+ children: /*#__PURE__*/ _jsx(Typography, {
214
+ variant: "caption",
215
+ color: "textSecondary",
216
+ children: (requiredParents == null ? void 0 : requiredParents.length) ? `Renders inside ${requiredParents.join(' or ')} — nothing to show on its own.` : 'Nothing to show on its own.'
217
+ })
218
+ }) : null,
219
+ /*#__PURE__*/ _jsx(InertStage, {
220
+ children: /*#__PURE__*/ _jsx(Box, {
221
+ ref: contentRef,
222
+ sx: {
223
+ width: STAGE_WIDTH,
224
+ transform: `scale(${scale})`,
225
+ transformOrigin: 'top left'
226
+ },
227
+ children: /*#__PURE__*/ _jsxs(PreviewShadowDom, {
228
+ mode: "open",
229
+ "data-preview-root": true,
230
+ ref: hostRef,
231
+ style: {
232
+ display: 'block',
233
+ width: '100%'
234
+ },
235
+ children: [
236
+ /*#__PURE__*/ _jsx(PluginStyles, {
237
+ scope: "shadow"
238
+ }),
239
+ /*#__PURE__*/ _jsx(SiteContext.Provider, {
240
+ // No `hostId`: data-backed elements take their own placeholder
241
+ // branch rather than fetching a site's real content into a
242
+ // thumbnail. `preview` additionally 423s any write.
243
+ value: siteValue,
244
+ children: /*#__PURE__*/ _jsx(ScreenLinkContext.Provider, {
245
+ value: linkValue,
246
+ children: /*#__PURE__*/ _jsx(PreviewThemed, {
247
+ hostThemeDoc: hostThemeDoc,
248
+ children: /*#__PURE__*/ _jsx(AglynNodeRenderer, {
249
+ node: root
250
+ })
251
+ })
252
+ })
253
+ })
254
+ ]
255
+ })
256
+ })
257
+ })
258
+ ]
259
+ });
260
+ });
261
+ ElementPreview.displayName = 'ElementPreview';
262
+ /**
263
+ * Whether the rendered preview drew anything a person can actually see.
264
+ *
265
+ * Text, or a media element. A preset with no child nodes composes a real but
266
+ * EMPTY element — `Toolbar Content` is a 64px transparent flex row — which
267
+ * renders correctly and looks identical to the bug where nothing rendered at
268
+ * all. Since one of those has already shipped here, the frame says which it
269
+ * is rather than leaving a blank box to be read as broken.
270
+ *
271
+ * Deliberately conservative and slightly imprecise: a lone Divider draws a
272
+ * 1px rule and is reported as nothing to show. At preview scale that is very
273
+ * nearly true, and the alternative — probing computed backgrounds and
274
+ * borders — guesses far more than it settles.
275
+ */ export function subtreeHasInk(host) {
276
+ const root = host == null ? void 0 : host.shadowRoot;
277
+ if (!root) return true;
278
+ if (root.querySelector('img, svg, video, canvas, picture')) return true;
279
+ // Text, but NOT the emotion `<style>` blocks the shadow cache injects
280
+ // alongside the render. `root.textContent` includes their CSS, so the
281
+ // first version of this check found `@media (min-width:600px)` in an
282
+ // empty Toolbar and reported it as content — the note never appeared for
283
+ // the one element that most needed it.
284
+ const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);
285
+ let node = walker.nextNode();
286
+ while(node){
287
+ var _node_parentElement;
288
+ const tag = (_node_parentElement = node.parentElement) == null ? void 0 : _node_parentElement.tagName;
289
+ if (tag !== 'STYLE' && tag !== 'SCRIPT' && (node.nodeValue || '').trim()) {
290
+ return true;
291
+ }
292
+ node = walker.nextNode();
293
+ }
294
+ return false;
295
+ }
296
+ /**
297
+ * Marks the subtree `inert` through the DOM property rather than the JSX
298
+ * attribute, which React has spelled differently across versions. Nothing
299
+ * inside can take focus, be clicked, or be found by a page search.
300
+ */ function InertStage({ children }) {
301
+ const ref = useRef(null);
302
+ useEffect(()=>{
303
+ if (ref.current) ref.current.inert = true;
304
+ }, []);
305
+ return /*#__PURE__*/ _jsx("div", {
306
+ ref: ref,
307
+ children: children
308
+ });
309
+ }
310
+ // `MuiShadowDom` is a proxy whose members type loosely; the canvas viewport
311
+ // reaches the same shape through `styled()`.
312
+ const PreviewShadowDom = MuiShadowDom.div;
313
+ /**
314
+ * The site theme, scoped to the shadow root so MUI's own styles — and any
315
+ * portal the element opens — stay inside the preview.
316
+ */ function PreviewThemed({ hostThemeDoc, children }) {
317
+ const shadowDom = useMuiShadowDomContext();
318
+ const theme = useAglynSiteTheme({
319
+ container: shadowDom,
320
+ theme: hostThemeDoc,
321
+ scheme: 'light'
322
+ });
323
+ return /*#__PURE__*/ _jsxs(ThemeProvider, {
324
+ theme: theme,
325
+ children: [
326
+ /*#__PURE__*/ _jsx(GlobalStyles, {
327
+ styles: {
328
+ ':host': {
329
+ all: 'initial'
330
+ }
331
+ }
332
+ }),
333
+ /*#__PURE__*/ _jsx(Box, {
334
+ sx: _extends({}, theme.typography.body1, {
335
+ color: 'text.primary',
336
+ backgroundColor: 'background.default',
337
+ width: 1
338
+ }),
339
+ children: children
340
+ })
341
+ ]
342
+ });
343
+ }
344
+ export default ElementPreview;
345
+
346
+ //# sourceMappingURL=element-preview.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/element-preview.component.tsx"],"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 {\n aglyn,\n CanvasManager,\n NODE_ROOT_ID,\n ScreenLinkContext,\n SiteContext,\n} from '@aglyn/aglyn'\n// Deep import, NOT the barrel (AGL-2486) — see `plugin-styles-ui.tsx`.\nimport { PluginStyles } from '@aglyn/aglyn/plugin-manager/plugin-styles-ui'\nimport { AglynNodeRenderer, useAglynSiteTheme } from '@aglyn/aglyn-node-renderer'\nimport {\n MuiShadowDom,\n type MuiShadowRootProps,\n useMuiShadowDomContext,\n} from '@aglyn/shared-ui-jsx'\nimport { ThemeProvider } from '@aglyn/shared-ui-theme'\nimport { Box, GlobalStyles, Typography } from '@mui/material'\nimport { observer } from 'mobx-react-lite'\nimport { useResolvedHostThemeDocument } from '../utils/active-host-theme'\nimport {\n type HTMLAttributes,\n type ReactNode,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\n/**\n * The width the preview composes at, before it is scaled down to fit.\n *\n * Elements are authored for a page, not for a thumbnail: a Hero centres a\n * headline across a viewport and a Footer lays out four columns. Composing at\n * a phone width and calling it a preview would show neither. So it renders at\n * a desktop width and the whole stage is scaled — the proportions the element\n * was designed for survive, just smaller.\n */\nconst STAGE_WIDTH = 1280\n\n/** Never blow a small element up past life size; only ever scale down. */\nconst MAX_SCALE = 1\n\n/** Below this a preview is a smudge; better to show a short empty band. */\nconst MIN_HEIGHT = 40\n\n/** Enough for the note to read as a sentence rather than a clipped line. */\nconst NOTE_HEIGHT = 76\n\nexport interface ElementPreviewProps {\n /** The picker item — a preset in both drawers. */\n node: any\n /** Bounded height of the preview box in CSS pixels. */\n height?: number\n /**\n * Parents this element must sit inside, from the schema. An element that\n * only renders in context frequently draws nothing on its own, and the\n * note says which parent it is waiting for.\n */\n requiredParents?: string[]\n}\n\n/**\n * Renders the preset's own nodes into an isolated stage, so a picker shows\n * what an element LOOKS like and not only what it is called (AGL-2486).\n *\n * Three things this must never do, each of which is a real hazard rather than\n * a hypothetical one:\n *\n * 1. **Touch `Aglyn.canvas`.** That singleton holds the document being\n * edited; the console's Preview route calls `setNodes` on it, and doing\n * the same here would blow away the user's screen to draw a thumbnail.\n * Every preview gets its own `CanvasManager`, backed by the real app so\n * component schemas still resolve — the pattern `useLayoutChromeCanvas`\n * already uses for locked layout chrome.\n * 2. **Mutate anything from inside.** The stage is inert: pointer events are\n * off, the subtree is marked `inert` so nothing in it is focusable or\n * clickable, links are told not to navigate, and `SiteContext.preview`\n * turns every write into a synthetic 423.\n * 3. **Escape its box.** The stage is scaled to fit and clipped, so a Footer\n * cannot push Confirm off the dialog or stretch the docked column.\n *\n * Elements that cannot render standalone — a Cart, a Product grid, anything\n * reading site data — are NOT special-cased here. Deliberately: they already\n * render their own dashed \"Cart — lines render here\" placeholder when there\n * is no `hostId`, and this preview does not supply one. That placeholder is\n * the honest answer to \"what will I get\", and it means the picker needs no\n * second list of which elements are self-contained: each element already\n * says so itself.\n */\nexport const ElementPreview = observer((props: ElementPreviewProps) => {\n const { node, height = 160, requiredParents } = props\n // Context where it exists, register where the surface sits outside the\n // page — see `active-host-theme.ts`. The preview must carry the SITE's\n // brand wherever it is mounted.\n const hostThemeDoc = useResolvedHostThemeDocument()\n\n // A throwaway store per preset. Never the global canvas.\n const canvas = useMemo(() => {\n const data = node?.data\n if (!data) return undefined\n try {\n const store = new CanvasManager(aglyn)\n // Seed an empty root, then insert through the SAME path the drawer\n // uses. Handing `preset.data` straight to `processNodesToDenormalized`\n // looks equivalent and is not: it keys nodes by `$id` and maps each\n // child to `i.$id`, and a preset's nodes carry `$id: null` until they\n // are minted — so every child was filtered out and the preview drew an\n // empty root. `addNodeFromPreset` runs `createDuplicateNode` first,\n // which is what assigns them.\n store.setNodes(\n store.processNodesToDenormalized([\n { $id: NODE_ROOT_ID, componentId: 'div', nodes: [] } as any,\n ]),\n )\n const rootNode = store.getNode(NODE_ROOT_ID)\n store.addNodeFromPreset(node, rootNode)\n return store\n } catch (error) {\n // A preset the renderer cannot compose must cost the picker nothing.\n console.error('Element preview failed to compose', error)\n return undefined\n }\n }, [node])\n\n const root = canvas?.getNode(NODE_ROOT_ID)\n\n // Hoisted above the early return — every hook this component calls has to\n // run on every render, including the one where there is nothing to draw.\n const siteValue = useMemo(() => ({ preview: true }), [])\n const linkValue = useMemo(() => ({ suppressNavigation: true }), [])\n\n const boxRef = useRef<HTMLDivElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const hostRef = useRef<HTMLDivElement>(null)\n // Whether the composed tree drew anything a person can see.\n const [hasInk, setHasInk] = useState(true)\n const [scale, setScale] = useState(0)\n // The box shrinks to the SCALED CONTENT rather than standing at its cap.\n // Most elements are wide and short — a Nav Bar is 1280x70 — so scaling to\n // the column width leaves a ~12px strip, and a fixed-height box renders it\n // as a sliver marooned at the top of a white rectangle. Measured, not\n // assumed: the content decides, the cap only stops a Footer running away.\n const [contentHeight, setContentHeight] = useState(0)\n\n useLayoutEffect(() => {\n const box = boxRef.current\n if (!box) return\n const fit = () => {\n const width = box.clientWidth\n if (width) setScale(Math.min(MAX_SCALE, width / STAGE_WIDTH))\n const natural = contentRef.current?.scrollHeight\n if (natural) setContentHeight(natural)\n }\n fit()\n if (typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(fit)\n observer.observe(box)\n if (contentRef.current) observer.observe(contentRef.current)\n return () => observer.disconnect()\n }, [root])\n\n // The shadow root is attached by the ShadowRoot component's OWN effect,\n // which runs after this component's — and the portal that fills it renders\n // a tick later still. Checking for ink once, on layout, therefore read an\n // empty (or absent) root every time and concluded \"inked\" by default.\n // Re-checked on a deferred pass and then on mutation.\n useEffect(() => {\n const host = hostRef.current\n if (!host) return\n let cancelled = false\n const check = () => {\n if (!cancelled) setHasInk(subtreeHasInk(host))\n }\n const timers = [setTimeout(check, 0), setTimeout(check, 120)]\n let observer: MutationObserver | undefined\n if (host.shadowRoot && typeof MutationObserver !== 'undefined') {\n observer = new MutationObserver(check)\n observer.observe(host.shadowRoot, {\n childList: true,\n subtree: true,\n characterData: true,\n })\n }\n return () => {\n cancelled = true\n timers.forEach(clearTimeout)\n observer?.disconnect()\n }\n }, [root])\n\n if (!root) return null\n\n // Below MIN_HEIGHT there is nothing to look at; above `height` a tall\n // element is clipped rather than allowed to grow the surface.\n const scaledHeight = !hasInk\n ? NOTE_HEIGHT\n : contentHeight\n ? Math.max(MIN_HEIGHT, Math.min(height, Math.ceil(contentHeight * scale)))\n : height\n\n return (\n <Box\n ref={boxRef}\n data-testid=\"element-preview\"\n aria-hidden\n sx={{\n position: 'relative',\n width: 1,\n height: scaledHeight,\n overflow: 'hidden',\n borderRadius: 1,\n border: 1,\n borderColor: 'divider',\n backgroundColor: 'background.paper',\n // Belt to the `inert` brace below: nothing in a picker preview is\n // clickable, draggable or selectable.\n pointerEvents: 'none',\n userSelect: 'none',\n }}\n >\n {!hasInk ? (\n <Box\n data-testid=\"element-preview-empty\"\n sx={{\n position: 'absolute',\n inset: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n p: 1.5,\n zIndex: 1,\n backgroundColor: 'background.paper',\n }}\n >\n <Typography variant=\"caption\" color=\"textSecondary\">\n {requiredParents?.length\n ? `Renders inside ${requiredParents.join(' or ')} — nothing to show on its own.`\n : 'Nothing to show on its own.'}\n </Typography>\n </Box>\n ) : null}\n <InertStage>\n <Box\n ref={contentRef}\n sx={{\n width: STAGE_WIDTH,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }}\n >\n {/* The host needs its own box. `:host { all: initial }` inside the\n shadow root resets the host's display to `inline`, and an inline\n box with no intrinsic size collapses the whole preview to\n nothing — the canvas viewport never hits this because its host\n is a styled component carrying width and min-height. Outer\n styles beat `:host`, so setting it here is what wins. */}\n {/* Open, unlike the canvas viewport's closed root: the canvas\n closes it to keep the editor's own tooling from reaching in and\n treating site DOM as editable, and none of that applies to an\n inert thumbnail. Open is inspectable and testable. */}\n <PreviewShadowDom\n mode=\"open\"\n data-preview-root\n ref={hostRef}\n style={{ display: 'block', width: '100%' }}\n >\n {/* Plugin stylesheets (AGL-2486). The same shadow-root miss as the\n canvas viewport, and for the same reason — a thumbnail of a\n plugin element that ignores the plugin's own CSS is a thumbnail\n of something the site will never render. */}\n <PluginStyles scope=\"shadow\" />\n <SiteContext.Provider\n // No `hostId`: data-backed elements take their own placeholder\n // branch rather than fetching a site's real content into a\n // thumbnail. `preview` additionally 423s any write.\n value={siteValue}\n >\n <ScreenLinkContext.Provider\n value={linkValue}\n >\n <PreviewThemed hostThemeDoc={hostThemeDoc}>\n <AglynNodeRenderer node={root} />\n </PreviewThemed>\n </ScreenLinkContext.Provider>\n </SiteContext.Provider>\n </PreviewShadowDom>\n </Box>\n </InertStage>\n </Box>\n )\n})\nElementPreview.displayName = 'ElementPreview'\n\n/**\n * Whether the rendered preview drew anything a person can actually see.\n *\n * Text, or a media element. A preset with no child nodes composes a real but\n * EMPTY element — `Toolbar Content` is a 64px transparent flex row — which\n * renders correctly and looks identical to the bug where nothing rendered at\n * all. Since one of those has already shipped here, the frame says which it\n * is rather than leaving a blank box to be read as broken.\n *\n * Deliberately conservative and slightly imprecise: a lone Divider draws a\n * 1px rule and is reported as nothing to show. At preview scale that is very\n * nearly true, and the alternative — probing computed backgrounds and\n * borders — guesses far more than it settles.\n */\nexport function subtreeHasInk(host: HTMLElement | null): boolean {\n const root = host?.shadowRoot\n if (!root) return true\n if (root.querySelector('img, svg, video, canvas, picture')) return true\n // Text, but NOT the emotion `<style>` blocks the shadow cache injects\n // alongside the render. `root.textContent` includes their CSS, so the\n // first version of this check found `@media (min-width:600px)` in an\n // empty Toolbar and reported it as content — the note never appeared for\n // the one element that most needed it.\n const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT)\n let node = walker.nextNode()\n while (node) {\n const tag = node.parentElement?.tagName\n if (tag !== 'STYLE' && tag !== 'SCRIPT' && (node.nodeValue || '').trim()) {\n return true\n }\n node = walker.nextNode()\n }\n return false\n}\n\n/**\n * Marks the subtree `inert` through the DOM property rather than the JSX\n * attribute, which React has spelled differently across versions. Nothing\n * inside can take focus, be clicked, or be found by a page search.\n */\nfunction InertStage({ children }: { children: ReactNode }) {\n const ref = useRef<HTMLDivElement>(null)\n useEffect(() => {\n if (ref.current) (ref.current as any).inert = true\n }, [])\n return <div ref={ref}>{children}</div>\n}\n\n// `MuiShadowDom` is a proxy whose members type loosely; the canvas viewport\n// reaches the same shape through `styled()`.\nconst PreviewShadowDom = MuiShadowDom.div as unknown as React.FC<\n HTMLAttributes<HTMLDivElement> &\n MuiShadowRootProps & { ref?: React.Ref<HTMLDivElement> }\n>\n\n/**\n * The site theme, scoped to the shadow root so MUI's own styles — and any\n * portal the element opens — stay inside the preview.\n */\nfunction PreviewThemed({ hostThemeDoc, children }: any) {\n const shadowDom = useMuiShadowDomContext()\n const theme = useAglynSiteTheme({\n container: shadowDom,\n theme: hostThemeDoc,\n scheme: 'light',\n })\n return (\n <ThemeProvider theme={theme}>\n {/* `:host { all: initial }` cuts the console's inherited styles, which\n means the body-level baseline never arrives either — so the stage\n carries it, exactly as the canvas viewport does. */}\n <GlobalStyles styles={{ ':host': { all: 'initial' } }} />\n <Box\n sx={{\n ...(theme.typography as any).body1,\n color: 'text.primary',\n backgroundColor: 'background.default',\n width: 1,\n }}\n >\n {children}\n </Box>\n </ThemeProvider>\n )\n}\n\nexport default ElementPreview\n"],"names":["aglyn","CanvasManager","NODE_ROOT_ID","ScreenLinkContext","SiteContext","PluginStyles","AglynNodeRenderer","useAglynSiteTheme","MuiShadowDom","useMuiShadowDomContext","ThemeProvider","Box","GlobalStyles","Typography","observer","useResolvedHostThemeDocument","useEffect","useLayoutEffect","useMemo","useRef","useState","STAGE_WIDTH","MAX_SCALE","MIN_HEIGHT","NOTE_HEIGHT","ElementPreview","props","node","height","requiredParents","hostThemeDoc","canvas","data","undefined","store","setNodes","processNodesToDenormalized","$id","componentId","nodes","rootNode","getNode","addNodeFromPreset","error","console","root","siteValue","preview","linkValue","suppressNavigation","boxRef","contentRef","hostRef","hasInk","setHasInk","scale","setScale","contentHeight","setContentHeight","box","current","fit","width","clientWidth","Math","min","natural","scrollHeight","ResizeObserver","observe","disconnect","host","cancelled","check","subtreeHasInk","timers","setTimeout","shadowRoot","MutationObserver","childList","subtree","characterData","forEach","clearTimeout","scaledHeight","max","ceil","ref","data-testid","aria-hidden","sx","position","overflow","borderRadius","border","borderColor","backgroundColor","pointerEvents","userSelect","inset","display","alignItems","justifyContent","textAlign","p","zIndex","variant","color","length","join","InertStage","transform","transformOrigin","PreviewShadowDom","mode","data-preview-root","style","scope","Provider","value","PreviewThemed","displayName","querySelector","walker","ownerDocument","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","tag","parentElement","tagName","nodeValue","trim","children","inert","div","shadowDom","theme","container","scheme","styles","all","typography","body1"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;;AAGD,SACEA,KAAK,EACLC,aAAa,EACbC,YAAY,EACZC,iBAAiB,EACjBC,WAAW,QACN,eAAc;AACrB,uEAAuE;AACvE,SAASC,YAAY,QAAQ,+CAA8C;AAC3E,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,6BAA4B;AACjF,SACEC,YAAY,EAEZC,sBAAsB,QACjB,uBAAsB;AAC7B,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,GAAG,EAAEC,Y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