@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,115 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Canvas visibility for elements that start hidden on the published site
19
+ * (AGL-592).
20
+ *
21
+ * An element carrying {@link Aglyn.ELEMENT_HIDDEN_CLASS} — a mega-menu panel,
22
+ * a drawer, anything an interaction reveals at runtime — is `display: none`
23
+ * on the live page from the first paint. The canvas hides it too, so what an
24
+ * author sees matches what a visitor sees, and then reveals it on demand so
25
+ * it can be designed.
26
+ *
27
+ * The decision is made HERE, in JS, and stamped on the element itself rather
28
+ * than expressed as a relationship between elements in a selector. A rule
29
+ * that hides `.aglyn-hidden` unless a marker sits on its DOM PARENT depends
30
+ * on the rendered tree matching the node tree one-for-one, which it does not:
31
+ * any component whose render wraps its children puts a wrapper between the
32
+ * marked element and the hidden one, and the reveal silently stops matching.
33
+ * A flag on the hidden element cannot come apart that way.
34
+ */
35
+ /** Node shape these helpers read; the canvas node class satisfies it. */
36
+ type RevealNode = {
37
+ $id?: string;
38
+ className?: string;
39
+ hidden?: boolean;
40
+ props?: Record<string, unknown>;
41
+ parent?: RevealNode;
42
+ } | null;
43
+ /**
44
+ * Whether a node starts hidden on the published site — the state the eye
45
+ * affordance in the hierarchy reports and the canvas reveal overrides.
46
+ */
47
+ export declare function isNodeHiddenOnSite(node: RevealNode): boolean;
48
+ /**
49
+ * Whether the canvas shows a hidden node right now.
50
+ *
51
+ * Two ways in, and both are canvas-only:
52
+ *
53
+ * - the author turned it on from the hierarchy, so its id sits in
54
+ * `revealedNodeIds`;
55
+ * - the selection is inside the node's PARENT — the wrapper, the trigger
56
+ * beside it, the node itself or anything within it — which reveals a panel
57
+ * for as long as it is being worked on without asking for a click.
58
+ *
59
+ * The selection path stops at the parent rather than walking further up
60
+ * because every node is inside the root: a check against an ancestor would
61
+ * show every hidden element on the page the moment anything was selected. A
62
+ * node whose parent IS the root falls back to its own subtree for the same
63
+ * reason.
64
+ */
65
+ export declare function isNodeRevealedOnCanvas(node: RevealNode, revealedNodeIds?: readonly string[]): boolean;
66
+ /**
67
+ * The reveal list with one node flipped. Returns a new array so the flag's
68
+ * subscribers see a changed value, and never mutates the one passed in.
69
+ */
70
+ export declare function toggleRevealedNodeId(revealedNodeIds: readonly string[] | undefined, nodeId: string): string[];
71
+ /**
72
+ * The class list a node would carry with the hidden class added or removed.
73
+ *
74
+ * Returns the props object to assign, or `null` when nothing would change —
75
+ * so a caller never writes an identical value and never puts a second copy of
76
+ * the class on an element that already has one.
77
+ *
78
+ * Reads and writes `props.className` only. `node.className` is also consulted
79
+ * when ASKING whether an element is hidden, because a component may
80
+ * contribute one of its own, but that is the component's business and not a
81
+ * value an author's toggle may edit.
82
+ */
83
+ export declare function nodePropsWithHiddenOnSite(node: RevealNode, hidden: boolean): Record<string, unknown> | null;
84
+ /**
85
+ * Whether an ANCESTOR already hides this node, so the published site never
86
+ * renders it whatever its own class list says.
87
+ *
88
+ * The hierarchy dims a hidden layer and everything under it — a container
89
+ * that does not ship takes its contents with it, and a full-strength child
90
+ * row inside a dimmed parent reads as "this one still ships", which is the
91
+ * opposite of true. Only the OUTERMOST hidden ancestor draws the dim: CSS
92
+ * opacity multiplies through nesting, so letting each hidden level apply its
93
+ * own would fade a panel inside a hidden drawer to near-invisible.
94
+ */
95
+ export declare function isAncestorHiddenOnSite(node: RevealNode): boolean;
96
+ /**
97
+ * Whether the AUTHOR has hidden this element.
98
+ *
99
+ * The plain switch behind the eye on the hierarchy row: `display: none` on
100
+ * the canvas and on the published site, with nothing that reveals it.
101
+ * Deliberately not {@link isNodeHiddenOnSite}, which asks a different
102
+ * question — "does this start hidden for an interaction to show" — about a
103
+ * class that is part of a runtime contract.
104
+ */
105
+ export declare function isNodeHiddenByAuthor(node: RevealNode): boolean;
106
+ /**
107
+ * Whether an ANCESTOR is hidden, by either switch, so the published site
108
+ * never renders this node whatever its own state says.
109
+ *
110
+ * Replaces the class-only walk: an element inside a container the author hid
111
+ * is exactly as absent as one inside a container that starts hidden, and the
112
+ * hierarchy dims both the same way.
113
+ */
114
+ export declare function isAncestorHidden(node: RevealNode): boolean;
115
+ export {};
@@ -0,0 +1,165 @@
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 { ELEMENT_HIDDEN_CLASS, NODE_ROOT_ID } from "@aglyn/aglyn";
18
+ import * as Besigner from "@aglyn/besigner";
19
+ /**
20
+ * A node's ancestors, innermost first, visiting each at most once.
21
+ *
22
+ * The chain a canvas document offers is NOT acyclic. A stored document's root
23
+ * is its own parent — `CanvasManager.processNodesToDenormalized` builds it
24
+ * through `denormalizeNodes([{ $id: NODE_ROOT_ID, … }], NODE_ROOT_ID)`, and
25
+ * `denormalizeNodes` stamps its `parentId` argument onto every node it writes,
26
+ * the root included — and `AglynNode.parent` resolves that id straight back to
27
+ * the root. So `current = current.parent` has no null to arrive at: it settles
28
+ * on the root and stays there.
29
+ *
30
+ * That is a synchronous infinite loop on the renderer's main thread, not a
31
+ * slow walk. It costs the whole tab: Chrome stops answering input and script
32
+ * evaluation entirely and the page has to be closed.
33
+ *
34
+ * The visited set is keyed by node identity, so it terminates on ANY parent
35
+ * chain rather than only on the root's — a document whose nodes parent each
36
+ * other yields a wrong dim on one row instead of a locked browser.
37
+ */ function* ancestorsOf(node) {
38
+ const seen = new Set();
39
+ let current = node == null ? void 0 : node.parent;
40
+ while(current){
41
+ var _current_$id;
42
+ const key = (_current_$id = current.$id) != null ? _current_$id : current;
43
+ if (seen.has(key)) return;
44
+ seen.add(key);
45
+ yield current;
46
+ current = current.parent;
47
+ }
48
+ }
49
+ /** The class names a node contributes to its rendered element. */ function nodeClassNames(node) {
50
+ var _node_props;
51
+ return [
52
+ node == null ? void 0 : (_node_props = node.props) == null ? void 0 : _node_props['className'],
53
+ node == null ? void 0 : node.className
54
+ ].filter((value)=>typeof value === 'string').flatMap((value)=>value.split(/\s+/)).filter(Boolean);
55
+ }
56
+ /**
57
+ * Whether a node starts hidden on the published site — the state the eye
58
+ * affordance in the hierarchy reports and the canvas reveal overrides.
59
+ */ export function isNodeHiddenOnSite(node) {
60
+ return nodeClassNames(node).includes(ELEMENT_HIDDEN_CLASS);
61
+ }
62
+ /**
63
+ * Whether the canvas shows a hidden node right now.
64
+ *
65
+ * Two ways in, and both are canvas-only:
66
+ *
67
+ * - the author turned it on from the hierarchy, so its id sits in
68
+ * `revealedNodeIds`;
69
+ * - the selection is inside the node's PARENT — the wrapper, the trigger
70
+ * beside it, the node itself or anything within it — which reveals a panel
71
+ * for as long as it is being worked on without asking for a click.
72
+ *
73
+ * The selection path stops at the parent rather than walking further up
74
+ * because every node is inside the root: a check against an ancestor would
75
+ * show every hidden element on the page the moment anything was selected. A
76
+ * node whose parent IS the root falls back to its own subtree for the same
77
+ * reason.
78
+ */ export function isNodeRevealedOnCanvas(node, revealedNodeIds) {
79
+ if (!node) return false;
80
+ if (revealedNodeIds == null ? void 0 : revealedNodeIds.some((id)=>id === node.$id)) return true;
81
+ const parent = node.parent;
82
+ const scope = parent && parent.$id !== NODE_ROOT_ID ? parent : node;
83
+ return Besigner.focus.isNodeOrDescendantSelected(scope);
84
+ }
85
+ /**
86
+ * The reveal list with one node flipped. Returns a new array so the flag's
87
+ * subscribers see a changed value, and never mutates the one passed in.
88
+ */ export function toggleRevealedNodeId(revealedNodeIds, nodeId) {
89
+ const current = revealedNodeIds != null ? revealedNodeIds : [];
90
+ return current.some((id)=>id === nodeId) ? current.filter((id)=>id !== nodeId) : [
91
+ ...current,
92
+ nodeId
93
+ ];
94
+ }
95
+ /**
96
+ * The class list a node would carry with the hidden class added or removed.
97
+ *
98
+ * Returns the props object to assign, or `null` when nothing would change —
99
+ * so a caller never writes an identical value and never puts a second copy of
100
+ * the class on an element that already has one.
101
+ *
102
+ * Reads and writes `props.className` only. `node.className` is also consulted
103
+ * when ASKING whether an element is hidden, because a component may
104
+ * contribute one of its own, but that is the component's business and not a
105
+ * value an author's toggle may edit.
106
+ */ export function nodePropsWithHiddenOnSite(node, hidden) {
107
+ var _ref, _node_props;
108
+ var _node_props1;
109
+ if (!node) return null;
110
+ const current = String((_ref = (_node_props1 = node.props) == null ? void 0 : _node_props1['className']) != null ? _ref : '').split(/\s+/).filter(Boolean);
111
+ const has = current.includes(ELEMENT_HIDDEN_CLASS);
112
+ if (has === hidden) return null;
113
+ const next = hidden ? [
114
+ ...current,
115
+ ELEMENT_HIDDEN_CLASS
116
+ ] : current.filter((name)=>name !== ELEMENT_HIDDEN_CLASS);
117
+ const props = _extends({}, (_node_props = node.props) != null ? _node_props : {});
118
+ if (next.length) props['className'] = next.join(' ');
119
+ else delete props['className'];
120
+ return props;
121
+ }
122
+ /**
123
+ * Whether an ANCESTOR already hides this node, so the published site never
124
+ * renders it whatever its own class list says.
125
+ *
126
+ * The hierarchy dims a hidden layer and everything under it — a container
127
+ * that does not ship takes its contents with it, and a full-strength child
128
+ * row inside a dimmed parent reads as "this one still ships", which is the
129
+ * opposite of true. Only the OUTERMOST hidden ancestor draws the dim: CSS
130
+ * opacity multiplies through nesting, so letting each hidden level apply its
131
+ * own would fade a panel inside a hidden drawer to near-invisible.
132
+ */ export function isAncestorHiddenOnSite(node) {
133
+ for (const ancestor of ancestorsOf(node)){
134
+ if (isNodeHiddenOnSite(ancestor)) return true;
135
+ }
136
+ return false;
137
+ }
138
+ /**
139
+ * Whether the AUTHOR has hidden this element.
140
+ *
141
+ * The plain switch behind the eye on the hierarchy row: `display: none` on
142
+ * the canvas and on the published site, with nothing that reveals it.
143
+ * Deliberately not {@link isNodeHiddenOnSite}, which asks a different
144
+ * question — "does this start hidden for an interaction to show" — about a
145
+ * class that is part of a runtime contract.
146
+ */ export function isNodeHiddenByAuthor(node) {
147
+ return Boolean(node == null ? void 0 : node.hidden);
148
+ }
149
+ /**
150
+ * Whether an ANCESTOR is hidden, by either switch, so the published site
151
+ * never renders this node whatever its own state says.
152
+ *
153
+ * Replaces the class-only walk: an element inside a container the author hid
154
+ * is exactly as absent as one inside a container that starts hidden, and the
155
+ * hierarchy dims both the same way.
156
+ */ export function isAncestorHidden(node) {
157
+ for (const ancestor of ancestorsOf(node)){
158
+ if (isNodeHiddenByAuthor(ancestor) || isNodeHiddenOnSite(ancestor)) {
159
+ return true;
160
+ }
161
+ }
162
+ return false;
163
+ }
164
+
165
+ //# sourceMappingURL=canvas-reveal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/canvas-reveal.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as Aglyn from '@aglyn/aglyn'\nimport { ELEMENT_HIDDEN_CLASS, NODE_ROOT_ID } from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\n\n/**\n * Canvas visibility for elements that start hidden on the published site\n * (AGL-592).\n *\n * An element carrying {@link Aglyn.ELEMENT_HIDDEN_CLASS} — a mega-menu panel,\n * a drawer, anything an interaction reveals at runtime — is `display: none`\n * on the live page from the first paint. The canvas hides it too, so what an\n * author sees matches what a visitor sees, and then reveals it on demand so\n * it can be designed.\n *\n * The decision is made HERE, in JS, and stamped on the element itself rather\n * than expressed as a relationship between elements in a selector. A rule\n * that hides `.aglyn-hidden` unless a marker sits on its DOM PARENT depends\n * on the rendered tree matching the node tree one-for-one, which it does not:\n * any component whose render wraps its children puts a wrapper between the\n * marked element and the hidden one, and the reveal silently stops matching.\n * A flag on the hidden element cannot come apart that way.\n */\n\n/** Node shape these helpers read; the canvas node class satisfies it. */\ntype RevealNode = {\n $id?: string\n className?: string\n hidden?: boolean\n props?: Record<string, unknown>\n parent?: RevealNode\n} | null\n\n/**\n * A node's ancestors, innermost first, visiting each at most once.\n *\n * The chain a canvas document offers is NOT acyclic. A stored document's root\n * is its own parent — `CanvasManager.processNodesToDenormalized` builds it\n * through `denormalizeNodes([{ $id: NODE_ROOT_ID, … }], NODE_ROOT_ID)`, and\n * `denormalizeNodes` stamps its `parentId` argument onto every node it writes,\n * the root included — and `AglynNode.parent` resolves that id straight back to\n * the root. So `current = current.parent` has no null to arrive at: it settles\n * on the root and stays there.\n *\n * That is a synchronous infinite loop on the renderer's main thread, not a\n * slow walk. It costs the whole tab: Chrome stops answering input and script\n * evaluation entirely and the page has to be closed.\n *\n * The visited set is keyed by node identity, so it terminates on ANY parent\n * chain rather than only on the root's — a document whose nodes parent each\n * other yields a wrong dim on one row instead of a locked browser.\n */\nfunction* ancestorsOf(node: RevealNode): Generator<NonNullable<RevealNode>> {\n const seen = new Set<unknown>()\n let current = node?.parent\n while (current) {\n const key = current.$id ?? current\n if (seen.has(key)) return\n seen.add(key)\n yield current\n current = current.parent\n }\n}\n\n/** The class names a node contributes to its rendered element. */\nfunction nodeClassNames(node: RevealNode): string[] {\n return [node?.props?.['className'], node?.className]\n .filter((value): value is string => typeof value === 'string')\n .flatMap((value) => value.split(/\\s+/))\n .filter(Boolean)\n}\n\n/**\n * Whether a node starts hidden on the published site — the state the eye\n * affordance in the hierarchy reports and the canvas reveal overrides.\n */\nexport function isNodeHiddenOnSite(node: RevealNode): boolean {\n return nodeClassNames(node).includes(ELEMENT_HIDDEN_CLASS)\n}\n\n/**\n * Whether the canvas shows a hidden node right now.\n *\n * Two ways in, and both are canvas-only:\n *\n * - the author turned it on from the hierarchy, so its id sits in\n * `revealedNodeIds`;\n * - the selection is inside the node's PARENT — the wrapper, the trigger\n * beside it, the node itself or anything within it — which reveals a panel\n * for as long as it is being worked on without asking for a click.\n *\n * The selection path stops at the parent rather than walking further up\n * because every node is inside the root: a check against an ancestor would\n * show every hidden element on the page the moment anything was selected. A\n * node whose parent IS the root falls back to its own subtree for the same\n * reason.\n */\nexport function isNodeRevealedOnCanvas(\n node: RevealNode,\n revealedNodeIds?: readonly string[],\n): boolean {\n if (!node) return false\n if (revealedNodeIds?.some((id) => id === node.$id)) return true\n const parent = node.parent\n const scope = parent && parent.$id !== NODE_ROOT_ID ? parent : node\n return Besigner.focus.isNodeOrDescendantSelected(scope as never)\n}\n\n/**\n * The reveal list with one node flipped. Returns a new array so the flag's\n * subscribers see a changed value, and never mutates the one passed in.\n */\nexport function toggleRevealedNodeId(\n revealedNodeIds: readonly string[] | undefined,\n nodeId: string,\n): string[] {\n const current = revealedNodeIds ?? []\n return current.some((id) => id === nodeId)\n ? current.filter((id) => id !== nodeId)\n : [...current, nodeId]\n}\n\n/**\n * The class list a node would carry with the hidden class added or removed.\n *\n * Returns the props object to assign, or `null` when nothing would change —\n * so a caller never writes an identical value and never puts a second copy of\n * the class on an element that already has one.\n *\n * Reads and writes `props.className` only. `node.className` is also consulted\n * when ASKING whether an element is hidden, because a component may\n * contribute one of its own, but that is the component's business and not a\n * value an author's toggle may edit.\n */\nexport function nodePropsWithHiddenOnSite(\n node: RevealNode,\n hidden: boolean,\n): Record<string, unknown> | null {\n if (!node) return null\n const current = String(node.props?.['className'] ?? '')\n .split(/\\s+/)\n .filter(Boolean)\n const has = current.includes(ELEMENT_HIDDEN_CLASS)\n if (has === hidden) return null\n const next = hidden\n ? [...current, ELEMENT_HIDDEN_CLASS]\n : current.filter((name) => name !== ELEMENT_HIDDEN_CLASS)\n const props: Record<string, unknown> = { ...(node.props ?? {}) }\n if (next.length) props['className'] = next.join(' ')\n else delete props['className']\n return props\n}\n\n/**\n * Whether an ANCESTOR already hides this node, so the published site never\n * renders it whatever its own class list says.\n *\n * The hierarchy dims a hidden layer and everything under it — a container\n * that does not ship takes its contents with it, and a full-strength child\n * row inside a dimmed parent reads as \"this one still ships\", which is the\n * opposite of true. Only the OUTERMOST hidden ancestor draws the dim: CSS\n * opacity multiplies through nesting, so letting each hidden level apply its\n * own would fade a panel inside a hidden drawer to near-invisible.\n */\nexport function isAncestorHiddenOnSite(node: RevealNode): boolean {\n for (const ancestor of ancestorsOf(node)) {\n if (isNodeHiddenOnSite(ancestor)) return true\n }\n return false\n}\n\n\n/**\n * Whether the AUTHOR has hidden this element.\n *\n * The plain switch behind the eye on the hierarchy row: `display: none` on\n * the canvas and on the published site, with nothing that reveals it.\n * Deliberately not {@link isNodeHiddenOnSite}, which asks a different\n * question — \"does this start hidden for an interaction to show\" — about a\n * class that is part of a runtime contract.\n */\nexport function isNodeHiddenByAuthor(node: RevealNode): boolean {\n return Boolean(node?.hidden)\n}\n\n/**\n * Whether an ANCESTOR is hidden, by either switch, so the published site\n * never renders this node whatever its own state says.\n *\n * Replaces the class-only walk: an element inside a container the author hid\n * is exactly as absent as one inside a container that starts hidden, and the\n * hierarchy dims both the same way.\n */\nexport function isAncestorHidden(node: RevealNode): boolean {\n for (const ancestor of ancestorsOf(node)) {\n if (isNodeHiddenByAuthor(ancestor) || isNodeHiddenOnSite(ancestor)) {\n return true\n }\n }\n return false\n}\n"],"names":["ELEMENT_HIDDEN_CLASS","NODE_ROOT_ID","Besigner","ancestorsOf","node","seen","Set","current","parent","key","$id","has","add","nodeClassNames","props","className","filter","value","flatMap","split","Boolean","isNodeHiddenOnSite","includes","isNodeRevealedOnCanvas","revealedNodeIds","some","id","scope","focus","isNodeOrDescendantSelected","toggleRevealedNodeId","nodeId","nodePropsWithHiddenOnSite","hidden","String","next","name","length","join","isAncestorHiddenOnSite","ancestor","isNodeHiddenByAuthor","isAncestorHidden"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAGD,SAASA,oBAAoB,EAAEC,YAAY,QAAQ,eAAc;AACjE,YAAYC,cAAc,kBAAiB;AA8B3C;;;;;;;;;;;;;;;;;;CAkBC,GACD,UAAUC,YAAYC,IAAgB;IACpC,MAAMC,OAAO,IAAIC;IACjB,IAAIC,UAAUH,wBAAAA,KAAMI,MAAM;IAC1B,MAAOD,QAAS;YACFA;QAAZ,MAAME,OAAMF,eAAAA,QAAQG,GAAG,YAAXH,eAAeA;QAC3B,IAAIF,KAA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9B,eAAAA,KAAKU,KAAK,qBAAVV,YAAY,CAAC,YAAY,mBAAI,IACjDe,KAAK,CAAC,OACNH,MAAM,CAACI;IACV,MAAMT,MAAMJ,QAAQe,QAAQ,CAACtB;IAC7B,IAAIW,QAAQsB,QAAQ,OAAO;IAC3B,MAAME,OAAOF,SACT;WAAI1B;QAASP;KAAqB,GAClCO,QAAQS,MAAM,CAAC,CAACoB,OAASA,SAASpC;IACtC,MAAMc,QAAiC,cAAMV,cAAAA,KAAKU,KAAK,YAAVV,cAAc,CAAC;IAC5D,IAAI+B,KAAKE,MAAM,EAAEvB,KAAK,CAAC,YAAY,GAAGqB,KAAKG,IAAI,CAAC;SAC3C,OAAOxB,KAAK,CAAC,YAAY;IAC9B,OAAOA;AACT;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASyB,uBAAuBnC,IAAgB;IACrD,KAAK,MAAMoC,YAAYrC,YAAYC,MAAO;QACxC,IAAIiB,mBAAmBmB,WAAW,OAAO;IAC3C;IACA,OAAO;AACT;AAGA;;;;;;;;CAQC,GACD,OAAO,SAASC,qBAAqBrC,IAAgB;IACnD,OAAOgB,QAAQhB,wBAAAA,KAAM6B,MAAM;AAC7B;AAEA;;;;;;;CAOC,GACD,OAAO,SAASS,iBAAiBtC,IAAgB;IAC/C,KAAK,MAAMoC,YAAYrC,YAAYC,MAAO;QACxC,IAAIqC,qBAAqBD,aAAanB,mBAAmBmB,WAAW;YAClE,OAAO;QACT;IACF;IACA,OAAO;AACT"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * One derived statement about an element (AGL-2486).
19
+ *
20
+ * Every fact here is READ OFF the schema, never authored. That is the whole
21
+ * point: a component that changes its `restrictChildren` changes what the
22
+ * picker says about it in the same commit, whereas a sentence somebody typed
23
+ * about it in 2026 is wrong the moment the component moves and nothing
24
+ * fails. Prose is reserved for the things that genuinely cannot be derived.
25
+ */
26
+ export interface ElementFact {
27
+ /** Stable key — a surface may order or style by it. Not persisted. */
28
+ id: string;
29
+ /** Short user-facing sentence. */
30
+ label: string;
31
+ }
32
+ export interface ElementDetail {
33
+ /** The picker item's own id (a preset id for drawer entries). */
34
+ $id?: string;
35
+ /** The component the item ultimately places. */
36
+ componentId?: string;
37
+ name: string;
38
+ category?: string;
39
+ /**
40
+ * Authored one-liner, when the schema carries one. ~22 of the 57 mui
41
+ * component schemas do, and most presets do; the rest show facts only.
42
+ * Deliberately NOT padded with generated filler — a thin honest entry
43
+ * beats an invented paragraph.
44
+ */
45
+ description?: string;
46
+ /** Derived, never authored. */
47
+ facts: ElementFact[];
48
+ /** Attribute labels the Attributes panel will offer for this element. */
49
+ attributes: string[];
50
+ /** Set only for components a plugin contributed. */
51
+ pluginId?: string;
52
+ /**
53
+ * Parents this element must sit inside, when its schema limits them.
54
+ *
55
+ * Derived from the same `restrictParent` the facts read. A preview uses it
56
+ * to explain itself: an element that only renders in context often draws
57
+ * nothing on its own, and an unexplained blank frame reads as a broken
58
+ * preview rather than as an honest one.
59
+ */
60
+ requiredParents: string[];
61
+ }
62
+ /**
63
+ * Everything the element pickers show about one element, derived from the
64
+ * registry (AGL-2486).
65
+ *
66
+ * Both surfaces call this — the Choose-element dialog and the docked
67
+ * Elements panel — so the content is designed once and only the
68
+ * presentation differs. A schema that says nothing produces an entry with a
69
+ * name, a category and no prose, which is the honest answer.
70
+ */
71
+ export declare function describeElement(item: any): ElementDetail | null;
72
+ export default describeElement;
@@ -0,0 +1,159 @@
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 { components, FEATURE_FLAG, LinealDirectiveFlag, schemaAcceptsChildren } from "@aglyn/aglyn";
17
+ /** The mui bundle is the built-in set — not worth calling out as a plugin. */ const BUILT_IN_PLUGIN_IDS = new Set([
18
+ 'mui'
19
+ ]);
20
+ function label(componentId) {
21
+ var _components_getLabel;
22
+ if (!componentId) return undefined;
23
+ return (_components_getLabel = components.getLabel(componentId)) != null ? _components_getLabel : componentId;
24
+ }
25
+ /**
26
+ * The component ids named by a lineal directive of `directive` type, as
27
+ * labels. Mirrors the reading `confirmValidLinealRelationship` does at drop
28
+ * time, so what the detail view promises is what the canvas enforces.
29
+ */ function linealLabels(order, directive) {
30
+ if (!order) return [];
31
+ const [directiveType, definition] = order;
32
+ if (directiveType !== directive) return [];
33
+ const components = Array.isArray(definition) ? definition : definition == null ? void 0 : definition.components;
34
+ return (components != null ? components : []).map((id)=>label(id)).filter(Boolean);
35
+ }
36
+ function isEnabled(flag) {
37
+ return Boolean(flag) && Boolean(flag & FEATURE_FLAG.ENABLED);
38
+ }
39
+ function isDisabled(flag) {
40
+ return Boolean(flag) && Boolean(flag & FEATURE_FLAG.DISABLED);
41
+ }
42
+ /**
43
+ * The component schema a picker item ultimately places.
44
+ *
45
+ * Drawer entries are PRESETS — "FAQ" is three stacked Accordions — so the
46
+ * facts have to come from the component the preset builds on, while the
47
+ * name and description stay the preset's own. Matches how the drop path
48
+ * resolves a dragged preset before validating it.
49
+ */ function resolveComponentSchema(item) {
50
+ var _ref;
51
+ var _item_data;
52
+ const componentId = (_ref = item == null ? void 0 : (_item_data = item.data) == null ? void 0 : _item_data.componentId) != null ? _ref : item == null ? void 0 : item.$id;
53
+ if (!componentId) return {};
54
+ return {
55
+ componentId,
56
+ schema: components.getSchema(componentId)
57
+ };
58
+ }
59
+ /**
60
+ * Everything the element pickers show about one element, derived from the
61
+ * registry (AGL-2486).
62
+ *
63
+ * Both surfaces call this — the Choose-element dialog and the docked
64
+ * Elements panel — so the content is designed once and only the
65
+ * presentation differs. A schema that says nothing produces an entry with a
66
+ * name, a category and no prose, which is the honest answer.
67
+ */ export function describeElement(item) {
68
+ var _ref, _ref1, _ref2;
69
+ var _schema_flags, _schema_flags1, _schema_flags2;
70
+ if (!item) return null;
71
+ const { componentId, schema } = resolveComponentSchema(item);
72
+ const name = (item == null ? void 0 : item.label) || (item == null ? void 0 : item.displayName) || label(item == null ? void 0 : item.$id) || (item == null ? void 0 : item.$id) || 'Element';
73
+ const facts = [];
74
+ // 1. Can it hold anything? The single most useful thing to know before
75
+ // dropping one, and the question the child contract already answers.
76
+ const acceptsChildren = schemaAcceptsChildren(schema);
77
+ facts.push({
78
+ id: 'children',
79
+ label: acceptsChildren ? 'Holds other elements' : 'Does not hold other elements'
80
+ });
81
+ // 2. Lineal relationships, both directions.
82
+ const onlyChildren = linealLabels(schema == null ? void 0 : schema.restrictChildren, LinealDirectiveFlag.LIMIT_TO);
83
+ if (onlyChildren.length) {
84
+ facts.push({
85
+ id: 'only-accepts',
86
+ label: `Only accepts ${onlyChildren.join(', ')}`
87
+ });
88
+ }
89
+ const noChildren = linealLabels(schema == null ? void 0 : schema.restrictChildren, LinealDirectiveFlag.DISALLOW);
90
+ if (noChildren.length) {
91
+ facts.push({
92
+ id: 'never-accepts',
93
+ label: `Will not accept ${noChildren.join(', ')}`
94
+ });
95
+ }
96
+ const onlyParents = linealLabels(schema == null ? void 0 : schema.restrictParent, LinealDirectiveFlag.LIMIT_TO);
97
+ if (onlyParents.length) {
98
+ facts.push({
99
+ id: 'only-inside',
100
+ label: `Must be placed inside ${onlyParents.join(' or ')}`
101
+ });
102
+ }
103
+ const notInside = linealLabels(schema == null ? void 0 : schema.restrictParent, LinealDirectiveFlag.DISALLOW);
104
+ if (notInside.length) {
105
+ facts.push({
106
+ id: 'never-inside',
107
+ label: `Cannot be placed inside ${notInside.join(', ')}`
108
+ });
109
+ }
110
+ // 3. How its content is edited.
111
+ if (isEnabled(schema == null ? void 0 : (_schema_flags = schema.flags) == null ? void 0 : _schema_flags.textEditable)) {
112
+ var _schema_flags3;
113
+ facts.push({
114
+ id: 'text-editable',
115
+ label: isEnabled(schema == null ? void 0 : (_schema_flags3 = schema.flags) == null ? void 0 : _schema_flags3.richTextEditable) ? 'Its text is edited on the canvas, with basic formatting' : 'Its text is edited directly on the canvas'
116
+ });
117
+ }
118
+ // 4. Limitations the editor imposes, where a flag turns one OFF. These are
119
+ // the ones a user hits and cannot explain.
120
+ if (isDisabled(schema == null ? void 0 : (_schema_flags1 = schema.flags) == null ? void 0 : _schema_flags1.dragging)) {
121
+ facts.push({
122
+ id: 'no-drag',
123
+ label: 'Cannot be moved by dragging'
124
+ });
125
+ }
126
+ if (isDisabled(schema == null ? void 0 : (_schema_flags2 = schema.flags) == null ? void 0 : _schema_flags2.removing)) {
127
+ facts.push({
128
+ id: 'no-remove',
129
+ label: 'Cannot be deleted'
130
+ });
131
+ }
132
+ // 5. Provenance — a third-party element should say so, since removing the
133
+ // plugin removes the element.
134
+ const pluginId = (_ref = schema == null ? void 0 : schema.pluginId) != null ? _ref : item == null ? void 0 : item.pluginId;
135
+ if (pluginId && !BUILT_IN_PLUGIN_IDS.has(pluginId)) {
136
+ facts.push({
137
+ id: 'plugin',
138
+ label: `Provided by the ${pluginId} plugin`
139
+ });
140
+ }
141
+ const attributes = ((_ref1 = schema == null ? void 0 : schema.attributes) != null ? _ref1 : []).map((attr)=>(attr == null ? void 0 : attr.label) || (attr == null ? void 0 : attr.name)).filter(Boolean);
142
+ return {
143
+ $id: item == null ? void 0 : item.$id,
144
+ componentId,
145
+ name,
146
+ category: (_ref2 = item == null ? void 0 : item.category) != null ? _ref2 : schema == null ? void 0 : schema.category,
147
+ // The item's own prose wins — a preset describes itself better than the
148
+ // component it is built from ("Three stacked question panels" vs
149
+ // "Header that expands to reveal its details").
150
+ description: (item == null ? void 0 : item.description) || (schema == null ? void 0 : schema.description) || undefined,
151
+ facts,
152
+ attributes,
153
+ requiredParents: onlyParents,
154
+ pluginId: pluginId && !BUILT_IN_PLUGIN_IDS.has(pluginId) ? pluginId : undefined
155
+ };
156
+ }
157
+ export default describeElement;
158
+
159
+ //# sourceMappingURL=describe-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/describe-element.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as Aglyn from '@aglyn/aglyn'\nimport {\n components,\n FEATURE_FLAG,\n LinealDirectiveFlag,\n schemaAcceptsChildren,\n} from '@aglyn/aglyn'\n\n/**\n * One derived statement about an element (AGL-2486).\n *\n * Every fact here is READ OFF the schema, never authored. That is the whole\n * point: a component that changes its `restrictChildren` changes what the\n * picker says about it in the same commit, whereas a sentence somebody typed\n * about it in 2026 is wrong the moment the component moves and nothing\n * fails. Prose is reserved for the things that genuinely cannot be derived.\n */\nexport interface ElementFact {\n /** Stable key — a surface may order or style by it. Not persisted. */\n id: string\n /** Short user-facing sentence. */\n label: string\n}\n\nexport interface ElementDetail {\n /** The picker item's own id (a preset id for drawer entries). */\n $id?: string\n /** The component the item ultimately places. */\n componentId?: string\n name: string\n category?: string\n /**\n * Authored one-liner, when the schema carries one. ~22 of the 57 mui\n * component schemas do, and most presets do; the rest show facts only.\n * Deliberately NOT padded with generated filler — a thin honest entry\n * beats an invented paragraph.\n */\n description?: string\n /** Derived, never authored. */\n facts: ElementFact[]\n /** Attribute labels the Attributes panel will offer for this element. */\n attributes: string[]\n /** Set only for components a plugin contributed. */\n pluginId?: string\n /**\n * Parents this element must sit inside, when its schema limits them.\n *\n * Derived from the same `restrictParent` the facts read. A preview uses it\n * to explain itself: an element that only renders in context often draws\n * nothing on its own, and an unexplained blank frame reads as a broken\n * preview rather than as an honest one.\n */\n requiredParents: string[]\n}\n\n/** The mui bundle is the built-in set — not worth calling out as a plugin. */\nconst BUILT_IN_PLUGIN_IDS = new Set(['mui'])\n\nfunction label(componentId?: string): string | undefined {\n if (!componentId) return undefined\n return components.getLabel(componentId) ?? componentId\n}\n\n/**\n * The component ids named by a lineal directive of `directive` type, as\n * labels. Mirrors the reading `confirmValidLinealRelationship` does at drop\n * time, so what the detail view promises is what the canvas enforces.\n */\nfunction linealLabels(\n order: Aglyn.ComponentsLinealOrder | undefined,\n directive: Aglyn.LinealDirectiveFlag,\n): string[] {\n if (!order) return []\n const [directiveType, definition] = order\n if (directiveType !== directive) return []\n const components = Array.isArray(definition)\n ? definition\n : definition?.components\n return (components ?? []).map((id) => label(id)).filter(Boolean) as string[]\n}\n\nfunction isEnabled(flag?: Aglyn.FEATURE_FLAG): boolean {\n return Boolean(flag) && Boolean(flag & FEATURE_FLAG.ENABLED)\n}\n\nfunction isDisabled(flag?: Aglyn.FEATURE_FLAG): boolean {\n return Boolean(flag) && Boolean(flag & FEATURE_FLAG.DISABLED)\n}\n\n/**\n * The component schema a picker item ultimately places.\n *\n * Drawer entries are PRESETS — \"FAQ\" is three stacked Accordions — so the\n * facts have to come from the component the preset builds on, while the\n * name and description stay the preset's own. Matches how the drop path\n * resolves a dragged preset before validating it.\n */\nfunction resolveComponentSchema(item: any): {\n componentId?: string\n schema?: Aglyn.ComponentSchema\n} {\n const componentId = item?.data?.componentId ?? item?.$id\n if (!componentId) return {}\n return {\n componentId,\n schema: components.getSchema(componentId) as Aglyn.ComponentSchema,\n }\n}\n\n/**\n * Everything the element pickers show about one element, derived from the\n * registry (AGL-2486).\n *\n * Both surfaces call this — the Choose-element dialog and the docked\n * Elements panel — so the content is designed once and only the\n * presentation differs. A schema that says nothing produces an entry with a\n * name, a category and no prose, which is the honest answer.\n */\nexport function describeElement(item: any): ElementDetail | null {\n if (!item) return null\n\n const { componentId, schema } = resolveComponentSchema(item)\n const name =\n item?.label ||\n item?.displayName ||\n label(item?.$id) ||\n item?.$id ||\n 'Element'\n\n const facts: ElementFact[] = []\n\n // 1. Can it hold anything? The single most useful thing to know before\n // dropping one, and the question the child contract already answers.\n const acceptsChildren = schemaAcceptsChildren(schema)\n facts.push({\n id: 'children',\n label: acceptsChildren\n ? 'Holds other elements'\n : 'Does not hold other elements',\n })\n\n // 2. Lineal relationships, both directions.\n const onlyChildren = linealLabels(\n schema?.restrictChildren,\n LinealDirectiveFlag.LIMIT_TO,\n )\n if (onlyChildren.length) {\n facts.push({\n id: 'only-accepts',\n label: `Only accepts ${onlyChildren.join(', ')}`,\n })\n }\n const noChildren = linealLabels(\n schema?.restrictChildren,\n LinealDirectiveFlag.DISALLOW,\n )\n if (noChildren.length) {\n facts.push({\n id: 'never-accepts',\n label: `Will not accept ${noChildren.join(', ')}`,\n })\n }\n const onlyParents = linealLabels(\n schema?.restrictParent,\n LinealDirectiveFlag.LIMIT_TO,\n )\n if (onlyParents.length) {\n facts.push({\n id: 'only-inside',\n label: `Must be placed inside ${onlyParents.join(' or ')}`,\n })\n }\n const notInside = linealLabels(\n schema?.restrictParent,\n LinealDirectiveFlag.DISALLOW,\n )\n if (notInside.length) {\n facts.push({\n id: 'never-inside',\n label: `Cannot be placed inside ${notInside.join(', ')}`,\n })\n }\n\n // 3. How its content is edited.\n if (isEnabled(schema?.flags?.textEditable)) {\n facts.push({\n id: 'text-editable',\n label: isEnabled(schema?.flags?.richTextEditable)\n ? 'Its text is edited on the canvas, with basic formatting'\n : 'Its text is edited directly on the canvas',\n })\n }\n\n // 4. Limitations the editor imposes, where a flag turns one OFF. These are\n // the ones a user hits and cannot explain.\n if (isDisabled(schema?.flags?.dragging)) {\n facts.push({ id: 'no-drag', label: 'Cannot be moved by dragging' })\n }\n if (isDisabled(schema?.flags?.removing)) {\n facts.push({ id: 'no-remove', label: 'Cannot be deleted' })\n }\n\n // 5. Provenance — a third-party element should say so, since removing the\n // plugin removes the element.\n const pluginId = schema?.pluginId ?? item?.pluginId\n if (pluginId && !BUILT_IN_PLUGIN_IDS.has(pluginId)) {\n facts.push({ id: 'plugin', label: `Provided by the ${pluginId} plugin` })\n }\n\n const attributes = (schema?.attributes ?? [])\n .map((attr: any) => attr?.label || attr?.name)\n .filter(Boolean)\n\n return {\n $id: item?.$id,\n componentId,\n name,\n category: (item?.category ?? schema?.category) as string,\n // The item's own prose wins — a preset describes itself better than the\n // component it is built from (\"Three stacked question panels\" vs\n // \"Header that expands to reveal its details\").\n description: item?.description || schema?.description || undefined,\n facts,\n attributes,\n requiredParents: onlyParents,\n pluginId: pluginId && !BUILT_IN_PLUGIN_IDS.has(pluginId) ? pluginId : undefined,\n }\n}\n\nexport default describeElement\n"],"names":["components","FEATURE_FLAG","LinealDirectiveFlag","schemaAcceptsChildren","BUILT_IN_PLUGIN_IDS","Set","label","componentId","undefined","getLabel","linealLabels","order","directive","directiveType","definition","Array","isArray","map","id","filter","Boolean","isEnabled","flag","ENABLED","isDisabled","DISABLED","resolveComponentSchema","item","data","$id","schema","getSchema","describeElement","name","displayName","facts","acceptsChildren","push","onlyChildren","restrictChildren","LIMIT_TO","length","join","noChildren","DISALLOW","onlyParents","restrictParent","notInside","flags","textEditable","richTextEditable","dragging","removing","pluginId","has","attributes","attr","category","description","requiredParents"],"mappings":"AA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ACxE,iEAAiE;QACjE,gDAAgD;QAChDC,aAAa/B,CAAAA,wBAAAA,KAAM+B,WAAW,MAAI5B,0BAAAA,OAAQ4B,WAAW,KAAIlD;QACzD2B;QACAoB;QACAI,iBAAiBd;QACjBQ,UAAUA,YAAY,CAACjD,oBAAoBkD,GAAG,CAACD,YAAYA,WAAW7C;IACxE;AACF;AAEA,eAAewB,gBAAe"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { Theme } from '@aglyn/shared-ui-theme';
18
+ /**
19
+ * Artboard device preview styling (AGL-581).
20
+ *
21
+ * CSS media queries always evaluate against the BROWSER viewport, so a
22
+ * narrowed artboard never triggered visibility bands
23
+ * (`@media (max-width:599.95px)` in node sx), breakpoint-scoped sx
24
+ * values (`{ xs, sm, md }`), or MUI's own breakpoint-derived component
25
+ * styles. When a device is selected in the toolbar the canvas now pins
26
+ * both mechanisms to the device's width:
27
+ *
28
+ * - `resolveSxForDeviceWidth` statically evaluates width-only `@media`
29
+ * keys in node sx: matching slices inline where the key sat (keeping
30
+ * cascade order), off-device slices drop. Applied per-Leaf through
31
+ * `LeafSxTransformContext` — canvas only.
32
+ * - `createDevicePinnedTheme` rebuilds the canvas theme's breakpoint
33
+ * helpers so every `theme.breakpoints.up/down/...` query is forced
34
+ * always-true or never-true for the device width. Responsive sx
35
+ * objects, Stack/Grid responsive props, and component styleOverrides
36
+ * all resolve through these helpers at render time.
37
+ *
38
+ * Fluid Responsive (the default) provides neither, so the canvas keeps
39
+ * today's real-viewport behavior; the published tenant never sees any
40
+ * of this.
41
+ *
42
+ * The width each device simulates is `devicePreviewWidth`, which lives in
43
+ * `@aglyn/besigner` with the device flags so that anything auditing a page
44
+ * at the switcher's widths reads the same numbers the canvas pins to.
45
+ */
46
+ export { DEVICE_PREVIEW_XS_WIDTH, devicePreviewWidth } from '@aglyn/besigner';
47
+ /**
48
+ * Statically evaluates a width-only `@media` query at the given
49
+ * viewport width. Returns null when the query involves anything beyond
50
+ * px width conditions and the all/screen media types (color-scheme,
51
+ * hover, em units…) — such queries must stay live in the browser.
52
+ * Comma-separated clauses OR together, per the media-query spec.
53
+ */
54
+ export declare function evaluateWidthMediaQuery(query: string, width: number): boolean | null;
55
+ /**
56
+ * Returns a copy of an sx value with width-only `@media` slices
57
+ * resolved at the device width: matching slices inline exactly where
58
+ * the media key sat (later duplicate keys override earlier ones — the
59
+ * same order the CSS cascade gives equal-specificity rules), and
60
+ * off-device slices drop. Non-width media keys pass through untouched,
61
+ * as do arrays (per-entry) and theme callbacks (wrapped).
62
+ */
63
+ export declare function resolveSxForDeviceWidth<T>(sx: T, width: number): T;
64
+ type ThemeBreakpoints = Theme['breakpoints'];
65
+ /**
66
+ * Returns breakpoint helpers whose queries are forced for the given
67
+ * width: helpers whose real media query would match a `width`-wide
68
+ * viewport emit an always-true query (a sub-pixel min-width), the rest
69
+ * emit a never-true one (an unreachable min-width). Each helper/key
70
+ * pair gets a distinct slot number so forced queries never collide
71
+ * into one style-object key. `values`/`keys`/`unit` stay real —
72
+ * components (e.g. MuiContainer) read them as pixel numbers.
73
+ *
74
+ * `internal_mediaKeys` is rebuilt from the pinned `up()` outputs so
75
+ * MUI's style engine pre-seeds them in ascending-breakpoint order —
76
+ * responsive sx slices keep mobile-first cascade order no matter what
77
+ * order they were authored in.
78
+ */
79
+ export declare function pinBreakpointsToWidth(breakpoints: ThemeBreakpoints, width: number): ThemeBreakpoints;
80
+ /**
81
+ * A canvas-only clone of the site theme pinned to the device width:
82
+ * breakpoint helpers are forced (see {@link pinBreakpointsToWidth}) and
83
+ * the toolbar mixin — whose real viewport queries were baked in at
84
+ * createTheme time — is rebuilt against them. The dense xs-landscape
85
+ * (48px) toolbar rule is intentionally omitted: device previews
86
+ * simulate portrait-first widths, and that rule only exists for real
87
+ * rotated phones.
88
+ */
89
+ export declare function createDevicePinnedTheme(theme: Theme, width: number): Theme;