@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,53 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * @license
4
+ * Copyright 2026 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import { useAglynSiteTheme } from "@aglyn/aglyn-node-renderer";
18
+ import { buildColorTokenOptions, ColorPickerTokensContext } from "@aglyn/shared-ui-jsx-forms";
19
+ import { useHostThemeDocument } from "@aglyn/shared-ui-theme";
20
+ import { useMemo } from "react";
21
+ /**
22
+ * Feeds the two-stage color picker (AGL-588) with the SITE theme's
23
+ * palette token references, resolved through BOTH schemes of the host's
24
+ * persisted theme document so every swatch previews its light and dark
25
+ * colors. Mounted around the designer's aside panels, it reaches every
26
+ * COLOR_PICKER field — styles panel, attribute forms, and email block
27
+ * attributes — through the shared field component, with no per-form
28
+ * wiring.
29
+ */ export const SiteThemeColorTokensProvider = (props)=>{
30
+ const { children } = props;
31
+ const hostThemeDoc = useHostThemeDocument();
32
+ const lightTheme = useAglynSiteTheme({
33
+ theme: hostThemeDoc,
34
+ scheme: 'light'
35
+ });
36
+ const darkTheme = useAglynSiteTheme({
37
+ theme: hostThemeDoc,
38
+ scheme: 'dark'
39
+ });
40
+ const options = useMemo(()=>buildColorTokenOptions(lightTheme.palette, darkTheme.palette), [
41
+ lightTheme,
42
+ darkTheme
43
+ ]);
44
+ return /*#__PURE__*/ _jsx(ColorPickerTokensContext.Provider, {
45
+ value: options,
46
+ children: children
47
+ });
48
+ };
49
+ SiteThemeColorTokensProvider.displayName = 'SiteThemeColorTokensProvider';
50
+ SiteThemeColorTokensProvider.aglyn = true;
51
+ export default SiteThemeColorTokensProvider;
52
+
53
+ //# sourceMappingURL=site-theme-color-tokens-provider.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/site-theme-color-tokens-provider.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 { useAglynSiteTheme } from '@aglyn/aglyn-node-renderer'\nimport {\n buildColorTokenOptions,\n ColorPickerTokensContext,\n} from '@aglyn/shared-ui-jsx-forms'\nimport { useHostThemeDocument } from '@aglyn/shared-ui-theme'\nimport { useMemo } from 'react'\n\n/**\n * Feeds the two-stage color picker (AGL-588) with the SITE theme's\n * palette token references, resolved through BOTH schemes of the host's\n * persisted theme document so every swatch previews its light and dark\n * colors. Mounted around the designer's aside panels, it reaches every\n * COLOR_PICKER field — styles panel, attribute forms, and email block\n * attributes — through the shared field component, with no per-form\n * wiring.\n */\nexport const SiteThemeColorTokensProvider = (props: {\n children?: JSX.Children\n}) => {\n const { children } = props\n const hostThemeDoc = useHostThemeDocument()\n const lightTheme = useAglynSiteTheme({ theme: hostThemeDoc, scheme: 'light' })\n const darkTheme = useAglynSiteTheme({ theme: hostThemeDoc, scheme: 'dark' })\n const options = useMemo(\n () =>\n buildColorTokenOptions(\n lightTheme.palette as unknown as Record<string, unknown>,\n darkTheme.palette as unknown as Record<string, unknown>,\n ),\n [lightTheme, darkTheme],\n )\n return (\n <ColorPickerTokensContext.Provider value={options}>\n {children}\n </ColorPickerTokensContext.Provider>\n )\n}\nSiteThemeColorTokensProvider.displayName = 'SiteThemeColorTokensProvider'\nSiteThemeColorTokensProvider.aglyn = true\n\nexport default SiteThemeColorTokensProvider\n"],"names":["useAglynSiteTheme","buildColorTokenOptions","ColorPickerTokensContext","useHostThemeDocument","useMemo","SiteThemeColorTokensProvider","props","children","hostThemeDoc","lightTheme","theme","scheme","darkTheme","options","palette","Provider","value","displayName","aglyn"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,iBAAiB,QAAQ,6BAA4B;AAC9D,SACEC,sBAAsB,EACtBC,wBAAwB,QACnB,6BAA4B;AACnC,SAASC,oBAAoB,QAAQ,yBAAwB;AAC7D,SAASC,OAAO,QAAQ,QAAO;AAE/B;;;;;;;;CAQC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAG3C,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAME,eAAeL;IACrB,MAAMM,aAAaT,kBAAkB;QAAEU,OAAOF;QAAcG,QAAQ;IAAQ;IAC5E,MAAMC,YAAYZ,kBAAkB;QAAEU,OAAOF;QAAcG,QAAQ;IAAO;IAC1E,MAAME,UAAUT,QACd,IACEH,uBACEQ,WAAWK,OAAO,EAClBF,UAAUE,OAAO,GAErB;QAACL;QAAYG;KAAU;IAEzB,qBACE,KAACV,yBAAyBa,QAAQ;QAACC,OAAOH;kBACvCN;;AAGP,EAAC;AACDF,6BAA6BY,WAAW,GAAG;AAC3CZ,6BAA6Ba,KAAK,GAAG;AAErC,eAAeb,6BAA4B"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type * as Aglyn from '@aglyn/aglyn';
18
+ export interface SubtreeJsonDialogProps {
19
+ node?: Aglyn.NodeSchema<any> | null;
20
+ open: boolean;
21
+ onClose: () => void;
22
+ }
23
+ type NestedNode = {
24
+ $id?: string;
25
+ componentId?: string;
26
+ nodes?: NestedNode[];
27
+ [key: string]: unknown;
28
+ };
29
+ /**
30
+ * Validates a nested subtree before it replaces canvas content
31
+ * (AGL-338): every node needs a resolvable componentId and ids must be
32
+ * unique within the subtree (missing ids get minted).
33
+ */
34
+ export declare function validateSubtree(root: NestedNode): string | null;
35
+ /**
36
+ * Edit the JSON of a single element and its children (AGL-338), instead
37
+ * of the whole screen document — through the SAME editor as the Edit
38
+ * menu's raw JSON dialog (AGL-457). Save validates, keeps the node's
39
+ * identity (so the parent's child list stays intact), and replaces the
40
+ * subtree in one undoable step.
41
+ */
42
+ export declare function SubtreeJsonDialog(props: SubtreeJsonDialogProps): import("react").JSX.Element;
43
+ export declare namespace SubtreeJsonDialog {
44
+ var displayName: string;
45
+ }
46
+ export default SubtreeJsonDialog;
@@ -0,0 +1,125 @@
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 } from "react/jsx-runtime";
18
+ import { canvas, components } from "@aglyn/aglyn";
19
+ import { JsonEditor } from "@aglyn/shared-ui-json-editor";
20
+ import { toJS } from "mobx";
21
+ import { useCallback, useMemo } from "react";
22
+ /**
23
+ * Validates a nested subtree before it replaces canvas content
24
+ * (AGL-338): every node needs a resolvable componentId and ids must be
25
+ * unique within the subtree (missing ids get minted).
26
+ */ export function validateSubtree(root) {
27
+ const seen = new Set();
28
+ const walk = (item, path)=>{
29
+ if (typeof item !== 'object' || item === null || Array.isArray(item)) {
30
+ return `${path}: each node must be a JSON object`;
31
+ }
32
+ if (!item.componentId || typeof item.componentId !== 'string') {
33
+ return `${path}: missing componentId`;
34
+ }
35
+ if (!components.getFactory(item.componentId)) {
36
+ return `${path}: unknown component "${item.componentId}"`;
37
+ }
38
+ if (item.$id) {
39
+ if (seen.has(item.$id)) return `${path}: duplicate node id "${item.$id}"`;
40
+ seen.add(item.$id);
41
+ }
42
+ const children = Array.isArray(item.nodes) ? item.nodes : [];
43
+ for(let i = 0; i < children.length; i += 1){
44
+ const problem = walk(children[i], `${path}.nodes[${i}]`);
45
+ if (problem) return problem;
46
+ }
47
+ return null;
48
+ };
49
+ return walk(root, '$');
50
+ }
51
+ const mintMissingIds = (item)=>{
52
+ if (!item.$id) item.$id = canvas.createNodeId();
53
+ for (const child of Array.isArray(item.nodes) ? item.nodes : []){
54
+ mintMissingIds(child);
55
+ }
56
+ };
57
+ /** Node ids of the subtree rooted at `nodeId` in a flat NodesMap. */ const collectSubtreeIds = (map, nodeId, out = [])=>{
58
+ var _ref;
59
+ var _map_nodeId;
60
+ out.push(nodeId);
61
+ const children = (_ref = (_map_nodeId = map[nodeId]) == null ? void 0 : _map_nodeId.nodes) != null ? _ref : [];
62
+ for (const childId of children){
63
+ if (typeof childId === 'string' && map[childId]) {
64
+ collectSubtreeIds(map, childId, out);
65
+ }
66
+ }
67
+ return out;
68
+ };
69
+ /** The parsed draft with the root's identity pinned back on (AGL-338). */ const withRootIdentity = (value, node)=>{
70
+ const parsed = structuredClone(value);
71
+ // The root keeps its identity — the parent's child list references it.
72
+ parsed.$id = node.$id;
73
+ parsed['parentId'] = node.parentId;
74
+ return parsed;
75
+ };
76
+ /**
77
+ * Edit the JSON of a single element and its children (AGL-338), instead
78
+ * of the whole screen document — through the SAME editor as the Edit
79
+ * menu's raw JSON dialog (AGL-457). Save validates, keeps the node's
80
+ * identity (so the parent's child list stays intact), and replaces the
81
+ * subtree in one undoable step.
82
+ */ export function SubtreeJsonDialog(props) {
83
+ const { node, open, onClose } = props;
84
+ const nested = useMemo(()=>open && node ? canvas.makeNested(node) : undefined, [
85
+ open,
86
+ node
87
+ ]);
88
+ const handleValidate = useCallback((value)=>{
89
+ if (!node) return 'No element selected';
90
+ return validateSubtree(withRootIdentity(value, node));
91
+ }, [
92
+ node
93
+ ]);
94
+ const handleSave = useCallback((_event, value)=>{
95
+ if (!node) return;
96
+ const parsed = withRootIdentity(value, node);
97
+ mintMissingIds(parsed);
98
+ // Full-map rebuild: drop the old subtree's descendants, splice in the
99
+ // new flat nodes, and apply as one undoable replacement.
100
+ const map = _extends({}, toJS(canvas.toJSON().nodes));
101
+ for (const staleId of collectSubtreeIds(map, node.$id)){
102
+ delete map[staleId];
103
+ }
104
+ const flat = canvas.constructor.denormalizeNodes([
105
+ parsed
106
+ ], node.parentId, {});
107
+ Object.assign(map, flat);
108
+ canvas.applyNodes(map);
109
+ }, [
110
+ node
111
+ ]);
112
+ return /*#__PURE__*/ _jsx(JsonEditor, {
113
+ open: open,
114
+ title: "Edit element JSON",
115
+ description: 'This element and its children only — the rest of the screen is ' + 'untouched. Save replaces the subtree (undo restores it).',
116
+ defaultValue: nested,
117
+ validate: handleValidate,
118
+ onSave: handleSave,
119
+ onClose: onClose
120
+ });
121
+ }
122
+ SubtreeJsonDialog.displayName = 'SubtreeJsonDialog';
123
+ export default SubtreeJsonDialog;
124
+
125
+ //# sourceMappingURL=subtree-json-dialog.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/subtree-json-dialog.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 { canvas, components } from '@aglyn/aglyn'\nimport { JsonEditor } from '@aglyn/shared-ui-json-editor'\nimport { toJS } from 'mobx'\nimport { useCallback, useMemo } from 'react'\n\nexport interface SubtreeJsonDialogProps {\n node?: Aglyn.NodeSchema<any> | null\n open: boolean\n onClose: () => void\n}\n\ntype NestedNode = {\n $id?: string\n componentId?: string\n nodes?: NestedNode[]\n [key: string]: unknown\n}\n\n/**\n * Validates a nested subtree before it replaces canvas content\n * (AGL-338): every node needs a resolvable componentId and ids must be\n * unique within the subtree (missing ids get minted).\n */\nexport function validateSubtree(root: NestedNode): string | null {\n const seen = new Set<string>()\n const walk = (item: NestedNode, path: string): string | null => {\n if (typeof item !== 'object' || item === null || Array.isArray(item)) {\n return `${path}: each node must be a JSON object`\n }\n if (!item.componentId || typeof item.componentId !== 'string') {\n return `${path}: missing componentId`\n }\n if (!components.getFactory(item.componentId as any)) {\n return `${path}: unknown component \"${item.componentId}\"`\n }\n if (item.$id) {\n if (seen.has(item.$id)) return `${path}: duplicate node id \"${item.$id}\"`\n seen.add(item.$id)\n }\n const children = Array.isArray(item.nodes) ? item.nodes : []\n for (let i = 0; i < children.length; i += 1) {\n const problem = walk(children[i] as NestedNode, `${path}.nodes[${i}]`)\n if (problem) return problem\n }\n return null\n }\n return walk(root, '$')\n}\n\nconst mintMissingIds = (item: NestedNode): void => {\n if (!item.$id) item.$id = canvas.createNodeId()\n for (const child of Array.isArray(item.nodes) ? item.nodes : []) {\n mintMissingIds(child as NestedNode)\n }\n}\n\n/** Node ids of the subtree rooted at `nodeId` in a flat NodesMap. */\nconst collectSubtreeIds = (\n map: Record<string, Aglyn.NodeSchema<any>>,\n nodeId: string,\n out: string[] = [],\n): string[] => {\n out.push(nodeId)\n const children = (map[nodeId]?.nodes ?? []) as string[]\n for (const childId of children) {\n if (typeof childId === 'string' && map[childId]) {\n collectSubtreeIds(map, childId, out)\n }\n }\n return out\n}\n\n/** The parsed draft with the root's identity pinned back on (AGL-338). */\nconst withRootIdentity = (\n value: unknown,\n node: Aglyn.NodeSchema<any>,\n): NestedNode => {\n const parsed = structuredClone(value) as NestedNode\n // The root keeps its identity — the parent's child list references it.\n parsed.$id = node.$id\n parsed['parentId'] = node.parentId\n return parsed\n}\n\n/**\n * Edit the JSON of a single element and its children (AGL-338), instead\n * of the whole screen document — through the SAME editor as the Edit\n * menu's raw JSON dialog (AGL-457). Save validates, keeps the node's\n * identity (so the parent's child list stays intact), and replaces the\n * subtree in one undoable step.\n */\nexport function SubtreeJsonDialog(props: SubtreeJsonDialogProps) {\n const { node, open, onClose } = props\n\n const nested = useMemo(\n () => (open && node ? canvas.makeNested(node as any) : undefined),\n [open, node],\n )\n\n const handleValidate = useCallback(\n (value: unknown) => {\n if (!node) return 'No element selected'\n return validateSubtree(withRootIdentity(value, node))\n },\n [node],\n )\n\n const handleSave = useCallback(\n (_event: unknown, value: unknown) => {\n if (!node) return\n const parsed = withRootIdentity(value, node)\n mintMissingIds(parsed)\n\n // Full-map rebuild: drop the old subtree's descendants, splice in the\n // new flat nodes, and apply as one undoable replacement.\n const map = {\n ...(toJS(canvas.toJSON().nodes) as Record<\n string,\n Aglyn.NodeSchema<any>\n >),\n }\n for (const staleId of collectSubtreeIds(map, node.$id)) {\n delete map[staleId]\n }\n const flat = (canvas.constructor as any).denormalizeNodes(\n [parsed],\n node.parentId!,\n {},\n )\n Object.assign(map, flat)\n canvas.applyNodes(map as any)\n },\n [node],\n )\n\n return (\n <JsonEditor\n open={open}\n title=\"Edit element JSON\"\n description={\n 'This element and its children only — the rest of the screen is ' +\n 'untouched. Save replaces the subtree (undo restores it).'\n }\n defaultValue={nested as any}\n validate={handleValidate}\n onSave={handleSave}\n onClose={onClose}\n />\n )\n}\nSubtreeJsonDialog.displayName = 'SubtreeJsonDialog'\n\nexport default SubtreeJsonDialog\n"],"names":["canvas","components","JsonEditor","toJS","useCallback","useMemo","validateSubtree","root","seen","Set","walk","item","path","Array","isArray","componentId","getFactory","$id","has","add","children","nodes","i","length","problem","mintMissingIds","createNodeId","child","collectSubtreeIds","map","nodeId","out","push","childId","withRootIdentity","value","node","parsed","structuredClone","parentId","SubtreeJsonDialog","props","open","onClose","nested","makeNested","undefined","handleValidate","handleSave","_event","toJSON","staleId","flat","denormalizeNodes","Object","assign","applyNodes","title","description","defaultValue","validate","onSave","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;;AAGD,SAASA,MAAM,EAAEC,UAAU,QAAQ,eAAc;AACjD,SAASC,UAAU,QAAQ,+BAA8B;AACzD,SAASC,IAAI,QAAQ,OAAM;AAC3B,SAASC,WAAW,EAAEC,OAAO,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,MAAMC,OAAO,AAACpD,OAAO,WAAW,CAASqD,gBAAgB,CACvD;YAAChB;SAAO,EACRD,KAAKG,QAAQ,EACb,CAAC;QAEHe,OAAOC,MAAM,CAAC1B,KAAKuB;QACnBpD,OAAOwD,UAAU,CAAC3B;IACpB,GACA;QAACO;KAAK;IAGR,qBACE,KAAClC;QACCwC,MAAMA;QACNe,OAAM;QACNC,aACE,oEACA;QAEFC,cAAcf;QACdgB,UAAUb;QACVc,QAAQb;QACRL,SAASA;;AAGf;AACAH,kBAAkBsB,WAAW,GAAG;AAEhC,eAAetB,kBAAiB"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { Theme } from '@mui/material/styles';
18
+ import type { SystemStyleObject } from '@mui/system';
19
+ import type { ResolvedTokenLabel } from '../utils/token-segments';
20
+ export declare const tokenPillContainerSx: SystemStyleObject<Theme>;
21
+ export interface TokenPillProps {
22
+ /** Raw stored token, e.g. `{{var:AbC123}}`. */
23
+ token: string;
24
+ resolved: ResolvedTokenLabel;
25
+ }
26
+ /**
27
+ * One atomic pill inside a React-rendered editable surface. Clicks are
28
+ * handled by the surface via delegation on the `data-token` attribute
29
+ * (matching the inline editor's direct-DOM pills), so the pill itself
30
+ * stays a dumb, re-render-safe span.
31
+ */
32
+ export declare function TokenPill(props: TokenPillProps): import("react").JSX.Element;
33
+ export declare namespace TokenPill {
34
+ var displayName: string;
35
+ }
36
+ export interface TokenPillPopoverProps {
37
+ anchorEl: HTMLElement | null;
38
+ /** Raw token of the clicked pill (shown so editors can see the id form). */
39
+ token: string;
40
+ onClose: () => void;
41
+ /** Opens the insert picker to swap this token in place. */
42
+ onReplace: () => void;
43
+ /** Deletes this token from the value. */
44
+ onRemove: () => void;
45
+ }
46
+ /** The click affordance on a pill: replace it (via the picker) or remove it. */
47
+ export declare function TokenPillPopover(props: TokenPillPopoverProps): import("react").JSX.Element;
48
+ export declare namespace TokenPillPopover {
49
+ var displayName: string;
50
+ }
51
+ export default TokenPill;
@@ -0,0 +1,164 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * @license
5
+ * Copyright 2026 Aglyn LLC
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */ import { Button, Popover, Stack, Typography } from "@mui/material";
19
+ import { TOKEN_PILL_ATTR, TOKEN_PILL_GROUP_ATTR } from "../utils/token-editable-dom.js";
20
+ /**
21
+ * Token pills (AGL-586): the colored badges that render `{{...}}` bindings
22
+ * as their CURRENT display names inside editable text surfaces. The
23
+ * serialized value keeps the raw id-based token; the pill is presentation
24
+ * only. Pills are atomic (`contenteditable="false"`) and clickable — the
25
+ * host surface opens {@link TokenPillPopover} to replace or remove one.
26
+ *
27
+ * Styling lives on the CONTAINER (keyed off the data attributes) so React
28
+ * pills and the inline editor's direct-DOM pills look identical.
29
+ */ /** Pill colors by token family — stable theme-palette assignments. */ const PILL_GROUP_STYLES = {
30
+ // Slate, not the accent (AGL-1194): a pill is editor chrome rendered
31
+ // inside the user's own text, so it must not read as content styling.
32
+ // The other families keep their semantic hues — they encode WHAT the
33
+ // token is, which is information, not decoration.
34
+ variable: {
35
+ bgcolor: 'tertiary.main',
36
+ color: 'tertiary.contrastText'
37
+ },
38
+ function: {
39
+ bgcolor: 'tertiary.main',
40
+ color: 'tertiary.contrastText'
41
+ },
42
+ entry: {
43
+ bgcolor: 'info.main',
44
+ color: 'info.contrastText'
45
+ },
46
+ collection: {
47
+ bgcolor: 'success.main',
48
+ color: 'success.contrastText'
49
+ },
50
+ dataset: {
51
+ bgcolor: 'grey.700',
52
+ color: 'common.white'
53
+ },
54
+ // A value each page supplies, like a variable is one the site supplies.
55
+ property: {
56
+ bgcolor: 'tertiary.main',
57
+ color: 'tertiary.contrastText'
58
+ },
59
+ // A value the site supplies from its own settings (AGL-2881).
60
+ host: {
61
+ bgcolor: 'tertiary.main',
62
+ color: 'tertiary.contrastText'
63
+ },
64
+ // Unresolvable referent (deleted variable, unknown grammar): warning.
65
+ unknown: {
66
+ bgcolor: 'warning.main',
67
+ color: 'warning.contrastText'
68
+ }
69
+ };
70
+ /**
71
+ * Container styles for any surface that hosts pills. Spread into the
72
+ * editable element's `sx` — pills themselves carry only data attributes.
73
+ * Built as a plain record and cast once: MUI's sx union chokes (TS2590)
74
+ * on computed spreads inside the literal.
75
+ */ const containerStyles = {
76
+ [`& [${TOKEN_PILL_ATTR}]`]: _extends({
77
+ display: 'inline-block',
78
+ borderRadius: 1,
79
+ px: 0.75,
80
+ mx: '1px',
81
+ fontSize: '0.8em',
82
+ lineHeight: 1.7,
83
+ fontWeight: 600,
84
+ whiteSpace: 'nowrap',
85
+ verticalAlign: 'baseline',
86
+ cursor: 'pointer',
87
+ userSelect: 'none'
88
+ }, PILL_GROUP_STYLES['unknown'])
89
+ };
90
+ for (const [group, style] of Object.entries(PILL_GROUP_STYLES)){
91
+ containerStyles[`& [${TOKEN_PILL_ATTR}][${TOKEN_PILL_GROUP_ATTR}="${group}"]`] = style;
92
+ }
93
+ export const tokenPillContainerSx = containerStyles;
94
+ /**
95
+ * One atomic pill inside a React-rendered editable surface. Clicks are
96
+ * handled by the surface via delegation on the `data-token` attribute
97
+ * (matching the inline editor's direct-DOM pills), so the pill itself
98
+ * stays a dumb, re-render-safe span.
99
+ */ export function TokenPill(props) {
100
+ const { token, resolved } = props;
101
+ const attributes = {
102
+ [TOKEN_PILL_ATTR]: token,
103
+ [TOKEN_PILL_GROUP_ATTR]: resolved.known ? resolved.group : 'unknown'
104
+ };
105
+ return /*#__PURE__*/ _jsx("span", _extends({}, attributes, {
106
+ contentEditable: false,
107
+ role: "button",
108
+ // The raw token stays inspectable (names shown, ids stored).
109
+ title: token,
110
+ children: resolved.label
111
+ }));
112
+ }
113
+ TokenPill.displayName = 'TokenPill';
114
+ /** The click affordance on a pill: replace it (via the picker) or remove it. */ export function TokenPillPopover(props) {
115
+ const { anchorEl, token, onClose, onReplace, onRemove } = props;
116
+ return /*#__PURE__*/ _jsx(Popover, {
117
+ open: Boolean(anchorEl),
118
+ anchorEl: anchorEl,
119
+ onClose: onClose,
120
+ anchorOrigin: {
121
+ vertical: 'bottom',
122
+ horizontal: 'left'
123
+ },
124
+ // The editable surface keeps its DOM selection while the popover is up.
125
+ disableRestoreFocus: true,
126
+ children: /*#__PURE__*/ _jsxs(Stack, {
127
+ direction: "row",
128
+ spacing: 1,
129
+ sx: {
130
+ px: 1.5,
131
+ py: 1,
132
+ alignItems: 'center',
133
+ maxWidth: 420
134
+ },
135
+ children: [
136
+ /*#__PURE__*/ _jsx(Typography, {
137
+ variant: "caption",
138
+ color: "text.secondary",
139
+ noWrap: true,
140
+ sx: {
141
+ maxWidth: 200,
142
+ fontFamily: 'monospace'
143
+ },
144
+ children: token
145
+ }),
146
+ /*#__PURE__*/ _jsx(Button, {
147
+ size: "small",
148
+ onClick: onReplace,
149
+ children: 'Replace'
150
+ }),
151
+ /*#__PURE__*/ _jsx(Button, {
152
+ size: "small",
153
+ color: "error",
154
+ onClick: onRemove,
155
+ children: 'Remove'
156
+ })
157
+ ]
158
+ })
159
+ });
160
+ }
161
+ TokenPillPopover.displayName = 'TokenPillPopover';
162
+ export default TokenPill;
163
+
164
+ //# sourceMappingURL=token-pill.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/token-pill.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 { Button, Popover, Stack, Typography } from '@mui/material'\nimport type { Theme } from '@mui/material/styles'\nimport type { SystemStyleObject } from '@mui/system'\n\nimport {\n TOKEN_PILL_ATTR,\n TOKEN_PILL_GROUP_ATTR,\n} from '../utils/token-editable-dom'\nimport type { ResolvedTokenLabel } from '../utils/token-segments'\n\n/**\n * Token pills (AGL-586): the colored badges that render `{{...}}` bindings\n * as their CURRENT display names inside editable text surfaces. The\n * serialized value keeps the raw id-based token; the pill is presentation\n * only. Pills are atomic (`contenteditable=\"false\"`) and clickable — the\n * host surface opens {@link TokenPillPopover} to replace or remove one.\n *\n * Styling lives on the CONTAINER (keyed off the data attributes) so React\n * pills and the inline editor's direct-DOM pills look identical.\n */\n\n/** Pill colors by token family — stable theme-palette assignments. */\nconst PILL_GROUP_STYLES: Record<string, { bgcolor: string; color: string }> = {\n // Slate, not the accent (AGL-1194): a pill is editor chrome rendered\n // inside the user's own text, so it must not read as content styling.\n // The other families keep their semantic hues — they encode WHAT the\n // token is, which is information, not decoration.\n variable: { bgcolor: 'tertiary.main', color: 'tertiary.contrastText' },\n function: { bgcolor: 'tertiary.main', color: 'tertiary.contrastText' },\n entry: { bgcolor: 'info.main', color: 'info.contrastText' },\n collection: { bgcolor: 'success.main', color: 'success.contrastText' },\n dataset: { bgcolor: 'grey.700', color: 'common.white' },\n // A value each page supplies, like a variable is one the site supplies.\n property: { bgcolor: 'tertiary.main', color: 'tertiary.contrastText' },\n // A value the site supplies from its own settings (AGL-2881).\n host: { bgcolor: 'tertiary.main', color: 'tertiary.contrastText' },\n // Unresolvable referent (deleted variable, unknown grammar): warning.\n unknown: { bgcolor: 'warning.main', color: 'warning.contrastText' },\n}\n\n/**\n * Container styles for any surface that hosts pills. Spread into the\n * editable element's `sx` — pills themselves carry only data attributes.\n * Built as a plain record and cast once: MUI's sx union chokes (TS2590)\n * on computed spreads inside the literal.\n */\nconst containerStyles: Record<string, unknown> = {\n [`& [${TOKEN_PILL_ATTR}]`]: {\n display: 'inline-block',\n borderRadius: 1,\n px: 0.75,\n mx: '1px',\n fontSize: '0.8em',\n lineHeight: 1.7,\n fontWeight: 600,\n whiteSpace: 'nowrap',\n verticalAlign: 'baseline',\n cursor: 'pointer',\n userSelect: 'none',\n ...PILL_GROUP_STYLES['unknown'],\n },\n}\nfor (const [group, style] of Object.entries(PILL_GROUP_STYLES)) {\n containerStyles[\n `& [${TOKEN_PILL_ATTR}][${TOKEN_PILL_GROUP_ATTR}=\"${group}\"]`\n ] = style\n}\nexport const tokenPillContainerSx =\n containerStyles as SystemStyleObject<Theme>\n\nexport interface TokenPillProps {\n /** Raw stored token, e.g. `{{var:AbC123}}`. */\n token: string\n resolved: ResolvedTokenLabel\n}\n\n/**\n * One atomic pill inside a React-rendered editable surface. Clicks are\n * handled by the surface via delegation on the `data-token` attribute\n * (matching the inline editor's direct-DOM pills), so the pill itself\n * stays a dumb, re-render-safe span.\n */\nexport function TokenPill(props: TokenPillProps) {\n const { token, resolved } = props\n const attributes = {\n [TOKEN_PILL_ATTR]: token,\n [TOKEN_PILL_GROUP_ATTR]: resolved.known ? resolved.group : 'unknown',\n }\n return (\n <span\n {...attributes}\n contentEditable={false}\n role=\"button\"\n // The raw token stays inspectable (names shown, ids stored).\n title={token}\n >\n {resolved.label}\n </span>\n )\n}\nTokenPill.displayName = 'TokenPill'\n\nexport interface TokenPillPopoverProps {\n anchorEl: HTMLElement | null\n /** Raw token of the clicked pill (shown so editors can see the id form). */\n token: string\n onClose: () => void\n /** Opens the insert picker to swap this token in place. */\n onReplace: () => void\n /** Deletes this token from the value. */\n onRemove: () => void\n}\n\n/** The click affordance on a pill: replace it (via the picker) or remove it. */\nexport function TokenPillPopover(props: TokenPillPopoverProps) {\n const { anchorEl, token, onClose, onReplace, onRemove } = props\n return (\n <Popover\n open={Boolean(anchorEl)}\n anchorEl={anchorEl}\n onClose={onClose}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n // The editable surface keeps its DOM selection while the popover is up.\n disableRestoreFocus\n >\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{ px: 1.5, py: 1, alignItems: 'center', maxWidth: 420 }}\n >\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n noWrap\n sx={{ maxWidth: 200, fontFamily: 'monospace' }}\n >\n {token}\n </Typography>\n <Button size=\"small\" onClick={onReplace}>\n {'Replace'}\n </Button>\n <Button size=\"small\" color=\"error\" onClick={onRemove}>\n {'Remove'}\n </Button>\n </Stack>\n </Popover>\n )\n}\nTokenPillPopover.displayName = 'TokenPillPopover'\n\nexport default TokenPill\n"],"names":["Button","Popover","Stack","Typography","TOKEN_PILL_ATTR","TOKEN_PILL_GROUP_ATTR","PILL_GROUP_STYLES","variable","bgcolor","color","function","entry","collection","dataset","property","host","unknown","containerStyles","display","borderRadius","px","mx","fontSize","lineHeight","fontWeight","whiteSpace","verticalAlign","cursor","userSelect","group","style","Object","entries","tokenPillContainerSx","TokenPill","props","token","resolved","attributes","known","span","contentEditable","role","title","label","displayName","TokenPillPopover","anchorEl","onClose","onReplace","onRemove","open","Boolean","anchorOrigin","vertical","horizontal","disableRestoreFocus","direction","spac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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 FormFieldGridProps } from '@aglyn/shared-ui-jsx-forms';
18
+ import { type FocusEvent, type MutableRefObject } from 'react';
19
+ import type { BindingOption } from '../contexts/binding-picker-context';
20
+ import { type TokenLabelContext } from '../utils/token-segments';
21
+ /**
22
+ * TokenTextField (AGL-586): the attributes-panel editor for token-capable
23
+ * free-text attributes. A contentEditable surface styled as a MUI
24
+ * TextField renders the value as plain text plus atomic {@link TokenPill}
25
+ * badges — users see resolved NAMES while the serialized value (what
26
+ * react-final-form holds and the node stores) keeps the raw id-based
27
+ * `{{...}}` grammar. Typing edits text natively; pills are clickable to
28
+ * replace or remove; the {x} adornment inserts at the caret (AGL-583).
29
+ *
30
+ * Model/DOM contract (mirrors the AGL-582 markdown editor): the segment
31
+ * model is source of truth ONLY at version bumps. Between bumps the
32
+ * browser owns the DOM — every `input` event silently syncs the model and
33
+ * emits through `input.onChange`, so the AGL-567 debounced commit treats
34
+ * pill edits exactly like keystrokes. Structural edits (insert/replace/
35
+ * remove pill, paste, Enter-newline) re-render from the model and restore
36
+ * the selection from unit offsets (text char = 1 unit, pill = 1 unit).
37
+ *
38
+ * Raw `{{...}}` typed by hand materializes into a pill on BLUR, not per
39
+ * keystroke: materializing mid-typing would re-render under the caret and
40
+ * fight the IME/undo stack, while on blur there is no caret to disturb.
41
+ *
42
+ * Undo: native browser undo survives for plain typing runs (no re-render
43
+ * happens between keystrokes), but any pill materialization/insert/remove
44
+ * re-renders the surface and truncates the native undo stack — the same
45
+ * trade the markdown editor makes, without its custom history (the canvas
46
+ * model keeps its own undo at commit granularity, AGL-567).
47
+ */
48
+ /** Mapper key for the attributes form (editor-internal, never persisted). */
49
+ export declare const TOKEN_TEXT_FIELD_COMPONENT = "aglyn-token-text-field";
50
+ /** Imperative surface ops the field chrome (menus) drives. */
51
+ export interface TokenEditableHandle {
52
+ /** Current selection in unit offsets, or null when unfocused/outside. */
53
+ captureSelection(): {
54
+ start: number;
55
+ end: number;
56
+ } | null;
57
+ /** Splices a token at the captured units (null capture appends). */
58
+ insertToken(token: string, capture: {
59
+ start: number;
60
+ end: number;
61
+ } | null): void;
62
+ /** Swaps the nth token segment for a new token, in place. */
63
+ replaceTokenAt(tokenIndex: number, token: string): void;
64
+ /** Deletes the nth token segment from the value. */
65
+ removeTokenAt(tokenIndex: number): void;
66
+ }
67
+ interface TokenEditableInputProps {
68
+ /** Serialized field value (raw token grammar). */
69
+ /** Typed loosely on purpose: a schema `initialValue` can be a number. */
70
+ tokenValue: string | number | null;
71
+ onTokenValueChange: (next: string) => void;
72
+ multiline?: boolean;
73
+ labelContextRef: MutableRefObject<TokenLabelContext>;
74
+ handleRef: MutableRefObject<TokenEditableHandle | null>;
75
+ onPillClick: (anchor: HTMLElement, tokenIndex: number, token: string) => void;
76
+ className?: string;
77
+ disabled?: boolean;
78
+ placeholder?: string;
79
+ onFocus?: (event: FocusEvent<HTMLDivElement>) => void;
80
+ onBlur?: (event: FocusEvent<HTMLDivElement>) => void;
81
+ 'aria-invalid'?: boolean;
82
+ 'aria-describedby'?: string;
83
+ }
84
+ /**
85
+ * The contentEditable input rendered INSIDE MUI's InputBase (via
86
+ * `inputComponent`), so the border, label notch, focus ring and disabled
87
+ * styling all come from the real TextField machinery.
88
+ */
89
+ /**
90
+ * Exported for the AGL-2486 regression test only — a numeric model value must
91
+ * not spin this into "Maximum update depth exceeded". `TokenTextField` needs a
92
+ * `<Form>` context (`useFieldApi`), so the loop cannot be reached through it
93
+ * without standing up react-form-renderer around a bug that lives entirely in
94
+ * this inner component.
95
+ */
96
+ export declare const TokenEditableInput: import("react").NamedExoticComponent<TokenEditableInputProps & import("react").RefAttributes<unknown>>;
97
+ export interface TokenTextFieldProps {
98
+ [key: string]: unknown;
99
+ placeholder?: string;
100
+ multiline?: boolean;
101
+ tokenOptions?: BindingOption[];
102
+ tokenLabelContext?: TokenLabelContext;
103
+ FormFieldGridProps?: FormFieldGridProps;
104
+ /**
105
+ * Opens the host app's media browser for THIS field (AGL-2236). Supplied
106
+ * by the attributes panel for media-bearing attributes only, so a field
107
+ * that cannot hold an asset never grows a control that would write one.
108
+ */
109
+ onBrowseMedia?: () => void;
110
+ }
111
+ /**
112
+ * The "Browse media" end adornment (AGL-2236).
113
+ *
114
+ * The control every `src` field's helper text has named since AGL-1215 —
115
+ * "Pick from your media library with 'Browse media'" — and which, until now,
116
+ * lived at the BOTTOM of the Attributes panel, below the Save Element
117
+ * button, separated from the field it fills by every other attribute the
118
+ * element declares. On the Image element that is six fields and a submit
119
+ * button of scroll, and with a single media attribute the button read only
120
+ * "Browse media", naming no field. Authors reported it as missing, which for
121
+ * a no-code product it effectively was: the documented way to change an
122
+ * image was to hand-type a `media:org:…/…` reference.
123
+ *
124
+ * Mousedown is prevented so the field keeps focus while the dialog opens —
125
+ * the same reason {@link InsertTokenAdornment} does it. Losing focus here
126
+ * would flush the AGL-567 debounce and commit a half-typed value on the way
127
+ * to picking a different one.
128
+ */
129
+ export declare function BrowseMediaAdornment(props: {
130
+ onBrowse: () => void;
131
+ }): import("react").JSX.Element;
132
+ export declare namespace BrowseMediaAdornment {
133
+ var displayName: string;
134
+ }
135
+ /**
136
+ * The data-driven-forms field (registered as
137
+ * {@link TOKEN_TEXT_FIELD_COMPONENT} in the attributes mapper). The
138
+ * serialized string flows through react-final-form exactly like the plain
139
+ * TextField it replaces — the AGL-567 debounced autosave sees ordinary
140
+ * value changes and commits through the existing path.
141
+ */
142
+ export declare const TokenTextField: {
143
+ (props: TokenTextFieldProps): import("react").JSX.Element;
144
+ displayName: string;
145
+ };
146
+ export default TokenTextField;