@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 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/inline-text-editor.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as Aglyn from '@aglyn/aglyn'\nimport {\n canvas,\n FEATURE_FLAG,\n REUSABLE_INSTANCE_PROP_VALUES_KEY,\n RICH_TEXT_COMMANDS,\n} from '@aglyn/aglyn'\nimport { mdiCodeBraces } from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\n// Subpath, not the library index — see the note there.\nimport { escapeHtml } from '@aglyn/shared-util-tools/escape-html'\nimport { Box, Button, IconButton, Paper } from '@mui/material'\nimport type { Theme } from '@mui/material/styles'\nimport type { SystemStyleObject } from '@mui/system'\nimport isEqual from 'lodash-es/isEqual.js'\nimport { toJS } from 'mobx'\nimport { observer } from 'mobx-react-lite'\nimport {\n type KeyboardEvent,\n type MouseEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react'\nimport { clampToViewport, useAnchoredRect } from '../hooks/use-anchored-rect'\nimport useInsertTokenOptions from '../hooks/use-insert-token-options'\nimport {\n beginInPlaceEdit,\n type InPlaceEditSurface,\n selectionOf,\n} from '../utils/in-place-edit-surface'\nimport { inlineTextEdit } from '../utils/inline-text-edit.store'\nimport { richTextCommandGroups } from '../utils/rich-text-commands'\nimport {\n richTextToPlain,\n sanitizeRichText,\n} from '../utils/sanitize-rich-text'\nimport {\n createTokenPillElement,\n materializeTokenPillsInElement,\n readTokenSegmentsFromDom,\n replacePillsWithTokenText,\n TOKEN_PILL_ATTR,\n} from '../utils/token-editable-dom'\nimport {\n parseTokenSegments,\n resolveTokenLabel,\n serializeTokenSegments,\n} from '../utils/token-segments'\nimport { InsertTokenMenu } from './insert-token-menu.component'\nimport {\n TokenPillPopover,\n tokenPillContainerSx,\n} from './token-pill.component'\n\n/**\n * The formatting tools, each tagged with the group that has to be allowed\n * for it to appear (AGL-2557).\n *\n * The toolbar used to render this list whole, which is why rich text could\n * only ever be offered by a component that could hold all of it — a\n * `<button>` cannot hold a list, so Accordion Summary and Button were left\n * with no formatting at all rather than with the half that is safe in them.\n */\nconst RICH_COMMANDS: Array<{\n command: string\n label: string\n title: string\n group: Aglyn.RICH_TEXT_COMMANDS\n}> = [\n {\n command: 'bold',\n label: 'B',\n title: 'Bold',\n group: RICH_TEXT_COMMANDS.EMPHASIS,\n },\n {\n command: 'italic',\n label: 'I',\n title: 'Italic',\n group: RICH_TEXT_COMMANDS.EMPHASIS,\n },\n {\n command: 'underline',\n label: 'U',\n title: 'Underline',\n group: RICH_TEXT_COMMANDS.EMPHASIS,\n },\n {\n command: 'insertUnorderedList',\n label: '•',\n title: 'Bulleted list',\n group: RICH_TEXT_COMMANDS.LIST,\n },\n {\n command: 'insertOrderedList',\n label: '1.',\n title: 'Numbered list',\n group: RICH_TEXT_COMMANDS.LIST,\n },\n]\n\n/** Stands in while no edit is open, so the anchor hook can run every render. */\nconst EMPTY_RECT = { left: 0, top: 0, width: 0, height: 0 }\n\n/**\n * The fallback editor, for an edit with no element to type into — opened\n * with no anchor, or on an anchor already detached from the document.\n *\n * Deliberately OPAQUE. It floats over content that cannot re-flow with it,\n * and a see-through surface in that position is what drew two texts over\n * each other; covering what it stands on is honest, blending with it is not.\n * Everything else edits the canvas leaf itself and needs no surface here.\n */\nconst BOXED_SURFACE_SX = {\n p: 0.5,\n bgcolor: 'background.paper',\n color: 'text.primary',\n border: '2px solid',\n borderColor: 'tertiary.main',\n borderRadius: 0.5,\n outline: 'none',\n boxShadow: 4,\n}\n\n/**\n * Plain text as the markup that renders it, newlines included.\n *\n * Named for what it does rather than `escapeHtml`, which it is not: the\n * `<br>` is a CONVERSION, and a reader who takes this for the escaper will\n * eventually reach for it somewhere a line break must stay literal. The\n * escaping half is the shared one.\n */\nfunction textToHtml(text: string): string {\n return escapeHtml(text).replace(/\\n/g, '<br>')\n}\n\n/**\n * Fixed-position overlay that edits a node's text in place, opened by\n * double-clicking a `textEditable` element in the canvas (see\n * DraggableDroppable). Plain components edit through a pill-capable\n * contentEditable line (Enter or blur commits, Shift+Enter breaks a line,\n * Escape cancels). Components flagged `richTextEditable` (AGL-54) get a\n * contentEditable surface with a basic formatting toolbar; the commit\n * sanitizes the markup through an allowlist and stores it in the `html`\n * prop with `children` kept as the plain-text fallback. Either mode\n * commits ONCE through `Aglyn.canvas.updateNodeProps` (a single undo entry).\n *\n * Binding pills (AGL-586): stored `{{...}}` tokens render as named,\n * colored, atomic pills in BOTH modes when the editor opens; the toolbar's\n * {x} button opens the same grouped insert picker as the attributes panel\n * (assembled from this node's ancestor context) and drops a pill at the\n * caret; clicking a pill offers Replace/Remove. Commits serialize pills\n * back to raw token syntax — names shown, ids stored.\n *\n * Instance prop overrides (AGL-1304): opened with a `propTarget`, the same\n * surface edits a component instance's `propValues[propName]` instead of a\n * node's `children` — the double-clicked leaf is a GRAFTED preview node,\n * not a canvas node, so the commit rides the instance. Always the plain\n * surface (prop values substitute as strings), the same single\n * `updateNodeProps` commit (one undo entry, and the same node-changed\n * signal co-editing's shadow diff already mirrors), and an emptied commit\n * REMOVES the override so the component's own copy returns — exactly what\n * clearing the Attributes field does.\n */\nexport const InlineTextEditorComponent = observer(\n function InlineTextEditorComponent() {\n const node = inlineTextEdit.node\n const rect = inlineTextEdit.rect\n const propTarget = inlineTextEdit.propTarget\n // Follows the element as the canvas scrolls or resizes (AGL-1644). Called\n // unconditionally, above the `!node || !rect` bail-out further down, so the\n // hook order is stable whether or not an edit is open.\n const anchor = inlineTextEdit.anchor\n const live = useAnchoredRect(anchor, rect ?? EMPTY_RECT)\n /**\n * Whether the canvas leaf ITSELF is the editing surface (AGL-2486).\n *\n * When it is, this component renders only the toolbar: there is no\n * second rectangle to keep in sync with the text, so the text cannot\n * move or restyle when editing begins and the layout re-flows because\n * the element really did grow. That is the\n * transparent-if-and-only-if-reserved invariant satisfied by\n * construction rather than by a check.\n *\n * When it is not — no element to type into — the opaque fallback\n * overlay is used instead.\n */\n const [inPlaceActive, setInPlaceActive] = useState(false)\n const overlayRef = useRef<HTMLElement>(null)\n const plainRef = useRef<HTMLDivElement>(null)\n const richRef = useRef<HTMLDivElement>(null)\n // Distinguish commit-blur (Enter already committed) from cancel paths.\n const committedRef = useRef(false)\n /**\n * Whether the surface has been BUILT from the node yet (AGL-2486).\n *\n * The editable is populated and focused on a `requestAnimationFrame`, so\n * between opening and that frame it is an empty box holding no caret.\n * Committing then reads emptiness as an author's deletion and writes\n * `children: ''` — the element's text is gone from the canvas, the\n * co-editing mirror publishes it, and every joiner gets the blank.\n * Measured exactly that way against screen `yFjgqiG2wm`: node\n * `XlqFJTz4ej` (\"Be first through the door\") went to `children: ''` from\n * a double-click and a click-away, with nothing typed. A background tab\n * makes it certain rather than rare — `requestAnimationFrame` does not\n * run in one at all, so the surface NEVER seeds and every click-away is\n * a wipe.\n *\n * Nothing can be lost by refusing: a surface that was never built holds\n * no caret and no typing.\n */\n const seededRef = useRef(false)\n /** The canvas leaf while it IS the editing surface — see beginInPlaceEdit. */\n const inPlaceRef = useRef<InPlaceEditSurface | undefined>(undefined)\n /**\n * Latest handlers for the listeners bound onto the leaf. They are bound\n * once per edit, so they must not close over a stale render.\n */\n const handlersRef = useRef({\n keyDown: (_e: KeyboardEvent<HTMLDivElement>) => undefined as void,\n richKeyDown: (_e: KeyboardEvent<HTMLDivElement>) => undefined as void,\n blur: () => undefined as void,\n click: (_e: MouseEvent<HTMLDivElement>) => undefined as void,\n mouseDown: (_e: MouseEvent<HTMLDivElement>) => undefined as void,\n })\n // The insert picker / pill popover take focus (portal + autofocus\n // search) — commit-on-blur must stand down while one is open, or the\n // editor would commit and close under the open menu (AGL-586).\n const menuOpenRef = useRef(false)\n const savedRangeRef = useRef<Range | null>(null)\n const [insertMenu, setInsertMenu] = useState<{\n anchorEl: HTMLElement\n replacePill: HTMLElement | null\n } | null>(null)\n const [pillMenu, setPillMenu] = useState<HTMLElement | null>(null)\n\n // Same context walk as the attributes panel (AGL-583) — the edited\n // node is known, so dataset-item / entry groups resolve identically.\n const { options: insertOptions, labelContext } =\n useInsertTokenOptions(node)\n const labelContextRef = useRef(labelContext)\n labelContextRef.current = labelContext\n\n // A prop edit is always the plain surface: prop values substitute into\n // the definition as strings (see buildPropTokens), so there is no\n // per-instance html channel for the rich toolbar to write.\n const rich =\n !propTarget &&\n ((node?.componentSchema?.flags?.richTextEditable ??\n FEATURE_FLAG.DISABLED) &\n FEATURE_FLAG.ENABLED) !==\n 0\n\n // What THIS component's schema allows (AGL-2557); a schema that names\n // nothing allows everything, which is what leaves Typography alone.\n const commandGroups = richTextCommandGroups(node?.componentSchema)\n /**\n * The surface may hold phrasing content only.\n *\n * Derived from the allowance rather than declared beside it: a component\n * that can take neither a list nor a link is one whose element admits no\n * block and no nested control, and that single fact is what the commit\n * sanitizer, the Enter key and the toolbar all need. Two ways to say it\n * would eventually say two different things.\n */\n const phrasingOnly =\n rich &&\n !commandGroups.has(RICH_TEXT_COMMANDS.LIST) &&\n !commandGroups.has(RICH_TEXT_COMMANDS.LINK)\n\n const activeEditable = useCallback(\n () =>\n inPlaceRef.current?.element ??\n (rich ? richRef.current : plainRef.current),\n [rich],\n )\n\n /**\n * Opens the edit: builds the content once, and puts it in the canvas\n * leaf itself wherever that is possible (AGL-2486).\n *\n * The builder is shared deliberately. In-place and the fallback overlay\n * must show the SAME thing — the same pills, the same markup, the same\n * plain-text seed — or the two paths would drift into two editors.\n */\n useEffect(() => {\n if (!node) return\n committedRef.current = false\n menuOpenRef.current = false\n savedRangeRef.current = null\n seededRef.current = false\n const props = { ...node.props, ...node.resolvedProps } as any\n const text = propTarget\n ? propTarget.initialText\n : typeof props?.children === 'string'\n ? (props.children as string)\n : ''\n const resolve = (token: string) =>\n resolveTokenLabel(token, labelContextRef.current)\n\n const build = (target: HTMLElement) => {\n if (rich) {\n const initial =\n typeof props?.html === 'string' && props.html\n ? (props.html as string)\n : textToHtml(text)\n target.innerHTML = initial\n // Raw {{tokens}} in the stored markup become pills (AGL-586).\n materializeTokenPillsInElement(target, resolve)\n return\n }\n // Plain mode: text nodes + pills, then the browser owns the DOM.\n target.textContent = ''\n for (const segment of parseTokenSegments(text)) {\n if (segment.type === 'token') {\n target.appendChild(\n createTokenPillElement(\n target.ownerDocument,\n segment.token ?? segment.value,\n resolve(segment.token ?? segment.value),\n ),\n )\n } else {\n target.appendChild(target.ownerDocument.createTextNode(segment.value))\n }\n }\n }\n\n // The element itself, whenever there is one to edit.\n const surface = beginInPlaceEdit(anchor, build)\n if (surface) {\n inPlaceRef.current = surface\n seededRef.current = true\n setInPlaceActive(true)\n surface.element.focus()\n const selection = surface.selection()\n if (selection) {\n const range = surface.element.ownerDocument.createRange()\n range.selectNodeContents(surface.element)\n // Caret at the end, never select-all: the author double-clicked a\n // word to edit it, and replacing the lot on the next keystroke is\n // how a heading gets destroyed by a typo.\n range.collapse(false)\n selection.removeAllRanges()\n selection.addRange(range)\n }\n return () => {\n surface.dispose()\n inPlaceRef.current = undefined\n setInPlaceActive(false)\n }\n }\n\n // No element to edit — the OPAQUE overlay. Built on a frame because\n // the surface it writes into has not rendered yet, which is the race\n // `seededRef` exists for.\n setInPlaceActive(false)\n const raf = requestAnimationFrame(() => {\n const editable = rich ? richRef.current : plainRef.current\n if (!editable) return\n build(editable)\n editable.focus()\n const selection = window.getSelection()\n if (selection) {\n const range = document.createRange()\n range.selectNodeContents(editable)\n if (rich) range.collapse(false)\n selection.removeAllRanges()\n selection.addRange(range)\n }\n seededRef.current = true\n })\n return () => cancelAnimationFrame(raf)\n }, [node, rich, propTarget, anchor])\n\n /**\n * Writes `next` only when it is a different document (AGL-2486).\n *\n * Closing this editor is not by itself an edit. Every branch below\n * rebuilds the WHOLE props object from the surface's DOM, so a commit\n * that changed nothing still produced a fresh object — an undo entry, a\n * node-changed signal, and a co-editing mirror publish, all for an edit\n * the author never made. The mirror is the expensive one: it is cleared\n * only by a successful save, so an unsaved no-op is replayed into every\n * joiner's canvas for `COEDIT_MIRROR_MAX_AGE_MS` (seven days) and each\n * of them opens a document that reads dirty with nothing to see.\n */\n const commitProps = useCallback(\n (node: Aglyn.NodeSchema<any>, next: Record<string, unknown>) => {\n if (isEqual(toJS(node.props), next)) return\n canvas.updateNodeProps(node, next as never)\n },\n [],\n )\n\n const commit = useCallback(() => {\n if (committedRef.current) return\n committedRef.current = true\n const current = inlineTextEdit.node\n // An unbuilt surface is not an emptied one (AGL-2486) — close, do not\n // write. See `seededRef`.\n /**\n * Collected first, WRITTEN LAST (AGL-2486).\n *\n * The markup this computes is correct; the hazard is that it can be\n * undone a moment later. Ending the edit restores the element's\n * original child nodes — deliberately, by reference, so React's fibers\n * keep pointing at live nodes — and that restore must not run in the\n * effect cleanup, i.e. AFTER `updateNodeProps` has already told React\n * to re-render the leaf. In that order React paints the new text and\n * the parked ORIGINAL nodes then go back over the top of it, so an\n * edit reads as never having taken.\n *\n * Worst for formatted text, which is how it was found: a node with\n * `html` renders through `dangerouslySetInnerHTML`, so React does not\n * track those children at all and never corrects them afterwards. The\n * canvas kept the pre-edit markup, the store held the new value, and\n * the break came back every time — until \"Remove formatting\" dropped\n * `html` and the plain `children` finally showed.\n *\n * So the element is given back BEFORE the store is written, and the\n * write is the last thing that happens. React then re-renders onto a\n * subtree that is exactly where it left it.\n */\n let nextWrite: Record<string, unknown> | undefined\n if (current && seededRef.current) {\n // UpdateNodeProps REPLACES the props object — spread the existing\n // props so variant/component/etc. survive the text edit.\n const surface = activeEditable()\n if (rich && surface) {\n // Pills serialize back to raw tokens BEFORE sanitizing (the\n // sanitizer strips attributes, and pill labels must never\n // reach storage) — on a clone, the live DOM stays intact.\n const clone = surface.cloneNode(true) as HTMLElement\n replacePillsWithTokenText(clone)\n // The toolbar offers no block command on a phrasing-only surface,\n // but a PASTE can still carry one in, and the renderer would strip\n // it — so the commit strips it first and what is stored is what\n // the page will draw.\n const sanitized = sanitizeRichText(clone.innerHTML, { phrasingOnly })\n const plain = richTextToPlain(sanitized)\n const hasMarkup = /<[a-z]/i.test(sanitized)\n const nextProps: Record<string, unknown> = {\n ...toJS(current.props),\n children: plain,\n }\n // ABSENT, not `''`, when there is no markup (AGL-2486). The\n // renderer gates on `typeof html === 'string' && Boolean(html)`,\n // so the two are the same document to everything that draws it —\n // but `isInitialSame` compares serialized node maps with\n // `isEqual`, and there the empty key is a difference. Writing it\n // onto a node that never had one is what put SAVE on the header\n // of a screen nobody had touched.\n if (hasMarkup) nextProps['html'] = sanitized\n else delete nextProps['html']\n nextWrite = nextProps\n } else if (surface) {\n let value = serializeTokenSegments(\n readTokenSegmentsFromDom(surface),\n )\n // An emptied contentEditable leaves a stray <br> behind.\n if (value === '\\n') value = ''\n const target = inlineTextEdit.propTarget\n if (target) {\n // Instance prop override (AGL-1304): the edit rides the\n // INSTANCE's nested propValues, never the grafted leaf (which\n // is not a canvas node). An emptied value REMOVES the key —\n // the graft treats '' as unset anyway, and a cleared override\n // must read as clean, exactly like the style-override layer.\n const values = {\n ...(current.props?.[\n REUSABLE_INSTANCE_PROP_VALUES_KEY\n ] as Record<string, unknown> | undefined),\n }\n if (value === '') delete values[target.propName]\n else values[target.propName] = value\n const nextProps = {\n ...current.props,\n [REUSABLE_INSTANCE_PROP_VALUES_KEY]: values,\n }\n // The LAST override cleared: drop the container too, so the\n // stored instance is byte-identical to one never overridden.\n if (!Object.keys(values).length) {\n delete nextProps[REUSABLE_INSTANCE_PROP_VALUES_KEY]\n }\n nextWrite = toJS(nextProps) as Record<string, unknown>\n } else {\n nextWrite = {\n ...toJS(current.props),\n children: value,\n }\n }\n }\n }\n // Give the element back to React BEFORE the write — see `nextWrite`.\n inPlaceRef.current?.dispose()\n inPlaceRef.current = undefined\n if (current && nextWrite) commitProps(current, nextWrite)\n inlineTextEdit.close()\n }, [rich, phrasingOnly, commitProps, activeEditable])\n\n const cancel = useCallback(() => {\n committedRef.current = true\n inlineTextEdit.close()\n }, [])\n\n const handleEditableBlur = useCallback(() => {\n if (menuOpenRef.current) return\n commit()\n }, [commit])\n\n // Latest `commit` for the document listener below, which must not\n // re-register on every render just to stay current.\n const commitRef = useRef(commit)\n commitRef.current = commit\n\n /**\n * Wires the editing handlers onto the LEAF while it is the surface.\n *\n * Imperatively, because the element belongs to the canvas renderer and\n * not to this component's JSX — the same reason `contentEditable` is set\n * as a DOM property. Registered once per edit and torn down with it.\n *\n * No `input` handler is needed any more, and that absence is the point:\n * the element being typed into IS the element being laid out, so the\n * card, the row and the siblings re-flow on their own. The stand-in that\n * used to reproduce that effect for an overlay is gone with the overlay.\n */\n useEffect(() => {\n const surface = inPlaceActive ? inPlaceRef.current : undefined\n const element = surface?.element\n if (!element) return\n const onKeyDown = (event: Event) =>\n (rich ? handlersRef.current.richKeyDown : handlersRef.current.keyDown)(\n event as unknown as KeyboardEvent<HTMLDivElement>,\n )\n const onBlur = () => handlersRef.current.blur()\n const onClick = (event: Event) =>\n handlersRef.current.click(\n event as unknown as MouseEvent<HTMLDivElement>,\n )\n const onMouseDown = (event: Event) =>\n handlersRef.current.mouseDown(\n event as unknown as MouseEvent<HTMLDivElement>,\n )\n element.addEventListener('keydown', onKeyDown)\n element.addEventListener('blur', onBlur)\n element.addEventListener('click', onClick)\n element.addEventListener('mousedown', onMouseDown)\n return () => {\n element.removeEventListener('keydown', onKeyDown)\n element.removeEventListener('blur', onBlur)\n element.removeEventListener('click', onClick)\n element.removeEventListener('mousedown', onMouseDown)\n }\n }, [inPlaceActive, rich])\n\n /**\n * Click-away commits, because on this canvas blur never arrives\n * (AGL-2486).\n *\n * `commit()` used to be reachable from a click only through `onBlur`,\n * and a click on another element cannot produce one: `DraggableDroppable`\n * registers `mousedown` AND `pointerdown` on every leaf and both begin\n * `e.preventDefault(); e.stopPropagation()`. Preventing a mousedown's\n * default suppresses the focus change it would have caused, so the\n * editable keeps focus and stays open — while the same handler runs\n * `Besigner.focus.handleNodeSelection(node, …)` and moves the selection\n * out from under it. Clicking out \"just selects other elements rather\n * than applying\", and the edit sits in a surface the author has already\n * mentally left. This repo has recorded that exact shape once before:\n * an attribute that commits on blur, discarded by selecting the next\n * node, with the canvas still looking right.\n *\n * A CAPTURE-phase listener on the document is what reaches the commit\n * first: capture runs from the document down, so it is ahead of the\n * leaf's own bubble-phase listener and ahead of the `preventDefault`\n * that would have swallowed the blur. It calls the SAME `commit()` the\n * Done button does — one commit path, one undo entry, and the same\n * no-op guard, rather than a second route into the document.\n *\n * The click is deliberately NOT consumed: committing and then letting\n * the canvas select what was clicked is what every other design tool\n * does, and it is what the author asked for by clicking there.\n *\n * `pointerdown`, not `mousedown`: it is the first of the pair, and\n * `preventDefault` on it suppresses the mouse events that follow, so a\n * `mousedown` listener would never run for a touch or pen edit.\n *\n * Targets inside the canvas retarget to its CLOSED shadow host, which is\n * not inside this overlay, so `contains` reads them as outside — which\n * they are. The portalled insert picker and pill popover ARE outside the\n * overlay in the DOM, and are covered by the same `menuOpenRef` stand-down\n * that already guards commit-on-blur (AGL-586).\n */\n useEffect(() => {\n if (!node) return\n const editing = inPlaceRef.current?.element\n const root = editing?.getRootNode() as ShadowRoot | Document | undefined\n const host =\n root && 'host' in root ? (root as ShadowRoot).host : undefined\n\n const isInsideTheEditor = (target: Node | null): boolean => {\n if (!target) return false\n // Read LIVE, never the value captured when this effect ran: a click\n // inside the text is the author placing a caret, and getting that\n // wrong tears the surface down and rebuilds it on every click, which\n // looks exactly like a caret that will not move.\n const live = inPlaceRef.current?.element\n if (live?.contains(target)) return true\n const overlay = overlayRef.current\n return Boolean(overlay?.contains(target))\n }\n\n const handlePointerDownAway = (event: Event) => {\n if (menuOpenRef.current) return\n const target = event.target as Node | null\n // Inside the CLOSED canvas root, an event seen from the document has\n // already been retargeted to the host, so it cannot say whether the\n // click landed on the text being edited or beside it. The listener on\n // the root itself sees the real target and has already decided; this\n // one must not overrule it with a guess.\n if (host && target === host) return\n if (isInsideTheEditor(target)) return\n commitRef.current()\n }\n\n document.addEventListener('pointerdown', handlePointerDownAway, true)\n // Second listener, INSIDE the shadow root, for the clicks the first one\n // is blind to — including a click on the very element being edited,\n // which must move the caret rather than end the edit.\n if (root && root !== document) {\n root.addEventListener('pointerdown', handlePointerDownAway, true)\n }\n return () => {\n document.removeEventListener('pointerdown', handlePointerDownAway, true)\n if (root && root !== document) {\n root.removeEventListener('pointerdown', handlePointerDownAway, true)\n }\n }\n }, [node, inPlaceActive])\n\n const insertPlainNewline = useCallback(() => {\n const editable = activeEditable()\n const selection = editable ? selectionOf(editable) : null\n if (!selection || selection.rangeCount === 0) return\n const range = selection.getRangeAt(0)\n range.deleteContents()\n const newline = document.createTextNode('\\n')\n range.insertNode(newline)\n range.setStartAfter(newline)\n range.collapse(true)\n selection.removeAllRanges()\n selection.addRange(range)\n }, [activeEditable])\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n event.preventDefault()\n cancel()\n } else if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault()\n commit()\n } else if (event.key === 'Enter') {\n // Browsers fork contentEditable into <div>s on Enter — insert\n // the newline ourselves so reads stay text + pills only.\n event.preventDefault()\n insertPlainNewline()\n }\n },\n [cancel, commit, insertPlainNewline],\n )\n\n const handleRichKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n event.preventDefault()\n cancel()\n } else if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n commit()\n } else if (event.key === 'Enter' && phrasingOnly && !event.shiftKey) {\n // A phrasing-only surface is a control's LABEL — a button, a link,\n // an accordion header. Enter there means \"done\", the same as it\n // does on the plain surface; a browser would otherwise fork the\n // contentEditable into `<div>`s, which is exactly the markup this\n // surface may not hold. Shift+Enter still breaks the line, and a\n // `<br>` is phrasing content.\n event.preventDefault()\n commit()\n }\n },\n [cancel, commit, phrasingOnly],\n )\n\n // Keep the selection inside the editable surface while clicking tools.\n const keepFocus = useCallback((event: MouseEvent) => {\n event.preventDefault()\n }, [])\n\n const exec = useCallback(\n (command: string) => () => {\n // ExecCommand is deprecated but universally supported and keeps this\n // dependency-free; the output is normalized by the sanitizer anyway.\n document.execCommand(command)\n activeEditable()?.focus()\n },\n [activeEditable],\n )\n\n const handleLink = useCallback(() => {\n const url = window.prompt('Link URL (https://…)')\n if (url) document.execCommand('createLink', false, url)\n activeEditable()?.focus()\n }, [activeEditable])\n\n /** Pill clicks (delegated): offer Replace/Remove (AGL-586). */\n const handleEditableClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n const pill = (event.target as HTMLElement).closest?.(\n `[${TOKEN_PILL_ATTR}]`,\n ) as HTMLElement | null\n if (!pill || !event.currentTarget.contains(pill)) return\n menuOpenRef.current = true\n setPillMenu(pill)\n },\n [],\n )\n\n // Pills are non-editable islands — a mousedown on one would move\n // focus out of the editable and trigger commit-on-blur.\n const handleEditableMouseDown = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n const pill = (event.target as HTMLElement).closest?.(\n `[${TOKEN_PILL_ATTR}]`,\n )\n if (pill) event.preventDefault()\n },\n [],\n )\n\n handlersRef.current = {\n keyDown: handleKeyDown,\n richKeyDown: handleRichKeyDown,\n blur: handleEditableBlur,\n click: handleEditableClick,\n mouseDown: handleEditableMouseDown,\n }\n\n /** The toolbar {x}: captures the live selection, opens the picker. */\n const handleInsertOpen = useCallback(\n (event: MouseEvent<HTMLElement>) => {\n const editable = activeEditable()\n const selection = editable ? selectionOf(editable) : null\n const range =\n selection && selection.rangeCount > 0\n ? selection.getRangeAt(0)\n : null\n savedRangeRef.current =\n range &&\n editable &&\n editable.contains(range.startContainer) &&\n editable.contains(range.endContainer)\n ? range.cloneRange()\n : null\n menuOpenRef.current = true\n setInsertMenu({ anchorEl: event.currentTarget, replacePill: null })\n },\n [activeEditable],\n )\n\n const closeMenus = useCallback(() => {\n setInsertMenu(null)\n setPillMenu(null)\n menuOpenRef.current = false\n activeEditable()?.focus()\n }, [activeEditable])\n\n const handleInsertPick = useCallback(\n (token: string) => {\n const editable = activeEditable()\n const replacePill = insertMenu?.replacePill ?? null\n setInsertMenu(null)\n menuOpenRef.current = false\n if (!editable) return\n const pill = createTokenPillElement(\n document,\n token,\n resolveTokenLabel(token, labelContextRef.current),\n )\n if (replacePill && editable.contains(replacePill)) {\n replacePill.replaceWith(pill)\n } else {\n const range = savedRangeRef.current\n if (\n range &&\n editable.contains(range.startContainer) &&\n editable.contains(range.endContainer)\n ) {\n range.deleteContents()\n range.insertNode(pill)\n } else {\n editable.appendChild(pill)\n }\n }\n savedRangeRef.current = null\n editable.focus()\n // Caret lands just after the pill, ready to keep typing.\n const selection = selectionOf(editable)\n if (selection) {\n const after = document.createRange()\n after.setStartAfter(pill)\n after.collapse(true)\n selection.removeAllRanges()\n selection.addRange(after)\n }\n },\n [activeEditable, insertMenu],\n )\n\n const handlePillReplace = useCallback(() => {\n const pill = pillMenu\n setPillMenu(null)\n if (!pill) {\n menuOpenRef.current = false\n return\n }\n // Keep menuOpenRef up — the insert picker opens next.\n setInsertMenu({ anchorEl: pill, replacePill: pill })\n }, [pillMenu])\n\n const handlePillRemove = useCallback(() => {\n pillMenu?.remove()\n closeMenus()\n }, [pillMenu, closeMenus])\n\n const insertButton = (\n <IconButton\n size=\"small\"\n title=\"Insert data\"\n aria-label=\"Insert data token\"\n onMouseDown={keepFocus}\n onClick={handleInsertOpen}\n sx={{ width: 28, height: 28, borderRadius: 0.5 }}\n >\n <MdiIcon path={mdiCodeBraces.path} fontSize=\"small\" />\n </IconButton>\n )\n\n if (!node || !rect) return null\n\n // Read at render, which `useAnchoredRect` makes safe: it re-renders on\n // every scroll and resize, so these are never a stale snapshot. The toolbar\n // sits 40px ABOVE the surface, so the top margin has to clear it or the\n // controls go off-screen while the editable stays on it.\n const viewportWidth =\n typeof window === 'undefined' ? Infinity : window.innerWidth\n const viewportHeight =\n typeof window === 'undefined' ? Infinity : window.innerHeight\n // The fallback overlay is ALWAYS the opaque box (AGL-2486). It exists\n // only for an edit with no element to type into, and an element that is\n // not there cannot re-flow — so a see-through surface over it would be\n // exactly what the invariant forbids. In-place editing needs no surface\n // here at all: the leaf is the surface, and this component renders only\n // the toolbar.\n //\n // Built as plain records and cast ONCE, the way `tokenPillContainerSx`\n // is: MUI's `sx` union cannot absorb a computed spread and reports every\n // neighbouring key as the error instead.\n const surfaceSx: Record<string, unknown> = BOXED_SURFACE_SX\n const richSurfaceSx = {\n width: '100%',\n minHeight: live.height,\n boxSizing: 'border-box',\n font: 'inherit',\n ...surfaceSx,\n '& a': { pointerEvents: 'none' },\n ...tokenPillContainerSx,\n } as SystemStyleObject<Theme>\n const plainSurfaceSx = {\n width: '100%',\n minHeight: live.height,\n boxSizing: 'border-box',\n font: 'inherit',\n ...surfaceSx,\n // After the anchor's type, never from it: `pre-wrap` is what makes a\n // Shift+Enter newline visible while typing.\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-word',\n ...tokenPillContainerSx,\n } as SystemStyleObject<Theme>\n const minWidth = Math.max(live.width, 120)\n const TOOLBAR_CLEARANCE = 48\n const KEEP_VISIBLE = 80\n\n return (\n <Box\n ref={overlayRef}\n data-aglyn=\"overlay:inline-text-editor\"\n sx={{\n position: 'fixed',\n left: clampToViewport(live.left, minWidth, viewportWidth),\n top: clampToViewport(\n live.top,\n KEEP_VISIBLE,\n viewportHeight,\n TOOLBAR_CLEARANCE,\n ),\n minWidth,\n maxWidth: '90vw',\n zIndex: (theme) => theme.zIndex.modal,\n }}\n >\n {/* The toolbar survives in-place editing — B / I / U, lists, link\n and the {} token control are the reason this editor exists at\n all, and it is chrome, not text, so it stays an overlay above\n the run being edited rather than inside it. */}\n <Paper\n elevation={4}\n sx={{\n position: 'absolute',\n top: -40,\n left: 0,\n px: 0.5,\n py: 0.25,\n display: 'flex',\n gap: 0.25,\n alignItems: 'center',\n }}\n >\n {rich\n ? RICH_COMMANDS.filter(({ group }) =>\n commandGroups.has(group),\n ).map(({ command, label, title }) => (\n <IconButton\n key={command}\n size=\"small\"\n title={title}\n onMouseDown={keepFocus}\n onClick={exec(command)}\n sx={{\n width: 28,\n height: 28,\n fontSize: 13,\n fontWeight: 700,\n fontStyle: command === 'italic' ? 'italic' : undefined,\n textDecoration:\n command === 'underline' ? 'underline' : undefined,\n borderRadius: 0.5,\n }}\n >\n {label}\n </IconButton>\n ))\n : null}\n {rich && commandGroups.has(RICH_TEXT_COMMANDS.LINK) ? (\n <IconButton\n size=\"small\"\n title=\"Insert link\"\n onMouseDown={keepFocus}\n onClick={handleLink}\n sx={{ width: 28, height: 28, fontSize: 13, borderRadius: 0.5 }}\n >\n {'\\u{1F517}'}\n </IconButton>\n ) : null}\n {insertButton}\n <Button\n size=\"small\"\n color=\"primary\"\n onMouseDown={keepFocus}\n onClick={commit}\n >\n {'Done'}\n </Button>\n </Paper>\n {/* No surface at all when the leaf is the surface (AGL-2486). */}\n {inPlaceActive ? null : rich ? (\n <Box\n ref={richRef}\n contentEditable\n suppressContentEditableWarning\n role=\"textbox\"\n aria-label=\"Edit rich text\"\n onKeyDown={handleRichKeyDown}\n onBlur={handleEditableBlur}\n onClick={handleEditableClick}\n onMouseDown={handleEditableMouseDown}\n sx={richSurfaceSx}\n />\n ) : (\n <Box\n ref={plainRef}\n contentEditable\n suppressContentEditableWarning\n role=\"textbox\"\n aria-label=\"Edit text\"\n onKeyDown={handleKeyDown}\n onBlur={handleEditableBlur}\n onClick={handleEditableClick}\n onMouseDown={handleEditableMouseDown}\n sx={plainSurfaceSx}\n />\n )}\n <InsertTokenMenu\n anchorEl={insertMenu?.anchorEl ?? null}\n open={Boolean(insertMenu)}\n onClose={closeMenus}\n options={insertOptions}\n onInsert={handleInsertPick}\n />\n <TokenPillPopover\n anchorEl={pillMenu}\n token={pillMenu?.getAttribute(TOKEN_PILL_ATTR) ?? ''}\n onClose={closeMenus}\n onReplace={handlePillReplace}\n onRemove={handlePillRemove}\n />\n </Box>\n )\n },\n)\nInlineTextEditorComponent.displayName = 'InlineTextEditorComponent'\n\nexport default InlineTextEditorComponent\n"],"names":["canvas","FEATURE_FLAG","REUSABLE_INSTANCE_PROP_VALUES_KEY","RICH_TEXT_COMMANDS","mdiCodeBraces","MdiIcon","escapeHtml","Box","Button","IconButton","Paper","isEqual","toJS","observer","useCallback","useEffect","useRef","useState","clampToViewport","useAnchoredRect","useInsertTokenOptions","beginInPlaceEdit","selectionOf","inlineTextEdit","richTextCommandGroups","richTextToPlain","sanitizeRichText","createTokenPillElement","materializeTokenPillsInElement","readTokenSegmentsFromDom","replacePillsWithTokenText","TOKEN_PILL_ATTR","parseTokenSegments","resolveTokenLabel","serializeTokenSegments","InsertTokenMenu","TokenPillPopover","tokenPillContainerSx","RICH_COMMANDS","command","label","title","group","EMPHASIS","LIST","EMPTY_RECT","left","top","width","height","BOXED_SURFACE_SX","p","bgcolor","color","border","borderColor","borderRadius","outline","boxShadow","textToHtml","text","replace","InlineTextEditorComponent","node","rect","propTarget","anchor","live","inPlaceActive","setInPlaceActive","overlayRef","plainRef","richRef","committedRef","seededRef","inPlaceRef","undefined","handlersRef","keyDown","_e","richKeyDown","blur","click","mouseDown","menuOpenRef","savedRangeRef","insertMenu","setInsertMenu","pillMenu","setPillMenu","options","insertOptions","labelContext","labelContextRef","current","rich","componentSchema","flags","richTextEditable","DISABLED","ENABLED","commandGroups","phrasingOnly","has","LINK","activeEditable","element","props","resolvedProps","initialText","children","resolve","token","build","target","initial","html","innerHTML","textContent","segment","type","appendChild","ownerDocument","value","createTextNode","surface","focus","selection","range","createRange","selectNodeContents","collapse","removeAllRanges","addRange","dispose","raf","requestAnimationFrame","editable","window","getSelection","document","cancelAnimationFrame","commitProps","next","updateNodeProps","commit","nextWrite","clone","cloneNode","sanitized","plain","hasMarkup","test","nextProps","values","propName","Object","keys","length","close","cancel","handleEditableBlur","commitRef","onKeyDown","event","onBlur","onClick","onMouseDown","addEventListener","removeEventListener","editing","root","getRootNode","host","isInsideTheEditor","contains","overlay","Boolean","handlePointerDownAway","insertPlainNewline","rangeCount","getRangeAt","deleteContents","newline","insertNode","setStartAfter","handleKeyDown","key","preventDefault","shiftKey","handleRichKeyDown","metaKey","ctrlKey","keepFocus","exec","execCommand","handleLink","url","prompt","handleEditableClick","pill","closest","currentTarget","handleEditableMouseDown","handleInsertOpen","startContainer","endContainer","cloneRange","anchorEl","replacePill","closeMenus","handleInsertPick","replaceWith","after","handlePillReplace","handlePillRemove","remove","insertButton","size","aria-label","sx","path","fontSize","viewportWidth","Infinity","innerWidth","viewportHeight","innerHeight","surfaceSx","richSurfaceSx","minHeight","boxSizing","font","pointerEvents","plainSurfaceSx","whiteSpace","wordBreak","minWidth","Math","max","TOOLBAR_CLEARANCE","KEEP_VISIBLE","ref","data-aglyn","position","maxWidth","zIndex","theme","modal","elevation","px","py","display","gap","alignItems","filter","map","fontWeight","fontStyle","textDecoration","contentEditable","suppressContentEditableWarning","role","open","onClose","onInsert","getAttribute","onReplace","onRemove","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;;AAGD,SACEA,MAAM,EACNC,YAAY,EACZC,iCAAiC,EACjCC,kBAAkB,QACb,eAAc;AACrB,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,uDAAuD;AACvD,SAASC,UAAU,QAAQ,uCAAsC;AACjE,SAASC,GAAG,EAAEC,MAAM,EAAEC,UAAU,EAAEC,KAAK,QAAQ,gBAAe;AAG9D,OAAOC,aAAa,uBAAsB;AAC1C,SAASC,IAAI,QAAQ,OAAM;AAC3B,SAASC,QAAQ,QAAQ,kBAAiB;AAC1C,SAGEC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,QAAO;AACd,SAASC,eAAe,EAAEC,eAAe,QAAQ,gCAA4B;AAC7E,OAAOC,2BAA2B,uCAAmC;AACrE,SACEC,gBAAgB,EAEhBC,WAAW,QACN,oCAAgC;AACvC,SAASC,cAAc,QAAQ,qCAAiC;AAChE,SAASC,qBAAqB,QAAQ,iCAA6B;AACnE,SACEC,eAAe,EACfC,gBAAgB,QACX,iCAA6B;AACpC,SACEC,sBAAsB,EACtBC,8BAA8B,EAC9BC,wBAAwB,EACxBC,yBAAyB,EACzBC,eAAe,QACV,iCAA6B;AACpC,SACEC,kBAAkB,EAClBC,iBAAiB,EACjBC,sBAAsB,QACjB,6BAAyB;AAChC,SAASC,eAAe,QAAQ,mCAA+B;AAC/D,SACEC,gBAAgB,EAChBC,oBAAoB,QACf,4BAAwB;AAE/B;;;;;;;;CAQC,GACD,MAAMC,gBAKD;IACH;QACEC,SAAS;QACTC,OAAO;QACPC,OAAO;QACPC,OAAOvC,mBAAmBwC,QAAQ;IACpC;IACA;QACEJ,SAAS;QACTC,OAAO;QACPC,OAAO;QACPC,OAAOvC,mBAAmBwC,QAAQ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C,aAAaoC;gBACbiB,IAAIS;+BAGN,KAAC9N;gBACC2O,KAAK3K;gBACL6L,eAAe;gBACfC,8BAA8B;gBAC9BC,MAAK;gBACL3C,cAAW;gBACXxD,WAAWuB;gBACXrB,QAAQJ;gBACRK,SAASiC;gBACThC,aAAaoC;gBACbiB,IAAIc;;0BAGR,KAACvM;gBACC6K,QAAQ,WAAE1H,8BAAAA,WAAY0H,QAAQ,oBAAI;gBAClCuD,MAAMtF,QAAQ3F;gBACdkL,SAAStD;gBACTxH,SAASC;gBACT8K,UAAUtD;;0BAEZ,KAAC/K;gBACC4K,UAAUxH;gBACVwB,KAAK,WAAExB,4BAAAA,SAAUkL,YAAY,CAAC3O,oCAAoB;gBAClDyO,SAAStD;gBACTyD,WAAWrD;gBACXsD,UAAUrD;;;;AAIlB,GACD;AACDzJ,0BAA0B+M,WAAW,GAAG;AAExC,eAAe/M,0BAAyB"}
@@ -0,0 +1,86 @@
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 { BindingOption } from '../contexts/binding-picker-context';
18
+ /**
19
+ * Insert-token building blocks (AGL-583): the {x} input adornment that
20
+ * opens the data-placeholder picker on token-capable attribute fields, the
21
+ * grouped/searchable picker menu itself, and the pure caret-splice helper.
22
+ * The element props form wires them to the form state so an insert behaves
23
+ * exactly like typing the token by hand (raw `{{...}}` stays supported).
24
+ */
25
+ /**
26
+ * Splices `token` into `text` at the captured selection, replacing any
27
+ * selected range — the concat/builder behavior: existing text before and
28
+ * after the caret is preserved. A null/undefined start means the field was
29
+ * never focused, so the token appends at the end. Returns the new value
30
+ * and the caret position just after the inserted token.
31
+ */
32
+ export declare function insertTokenIntoText(text: string, token: string, start?: number | null, end?: number | null): {
33
+ value: string;
34
+ caret: number;
35
+ };
36
+ /** The input element + selection captured when the adornment is pressed. */
37
+ export interface TokenFieldCapture {
38
+ input: HTMLInputElement | HTMLTextAreaElement | null;
39
+ start: number | null;
40
+ end: number | null;
41
+ }
42
+ /**
43
+ * Reads the adornment's sibling input and, when it holds focus, its
44
+ * selection. Selection is only trusted while the input is focused — an
45
+ * unfocused input reports a stale 0/0 selection, and inserting there
46
+ * would silently prepend; appending at the end is the safer default.
47
+ */
48
+ export declare function captureAdornmentTarget(button: HTMLElement): TokenFieldCapture;
49
+ export interface InsertTokenAdornmentProps {
50
+ onOpen: (anchor: HTMLElement, capture: TokenFieldCapture) => void;
51
+ }
52
+ /**
53
+ * The small {x} button rendered as an end adornment on token-capable
54
+ * attribute inputs. The caret is captured on MOUSEDOWN — before the click
55
+ * would move focus — and the default is prevented so the input keeps both
56
+ * focus and its visible selection while the picker opens.
57
+ */
58
+ export declare function InsertTokenAdornment(props: InsertTokenAdornmentProps): import("react").JSX.Element;
59
+ export declare namespace InsertTokenAdornment {
60
+ var displayName: string;
61
+ }
62
+ export interface InsertTokenMenuProps {
63
+ anchorEl: HTMLElement | null;
64
+ open: boolean;
65
+ onClose: () => void;
66
+ options: BindingOption[];
67
+ onInsert: (token: string) => void;
68
+ /**
69
+ * What the menu says when there is nothing to offer at all, as opposed to
70
+ * nothing matching a search. A field that takes only one kind of value
71
+ * knows where more of that kind comes from, and should say so.
72
+ */
73
+ emptyText?: string;
74
+ }
75
+ /**
76
+ * The grouped, searchable data-placeholder picker (AGL-583) — one menu
77
+ * serving both the per-field {x} adornment and the legacy element-level
78
+ * "Insert binding" button (AGL-100). Groups render in option order with
79
+ * subheaders; context-dependent groups carry a hint line saying where
80
+ * their tokens resolve. Search filters across label, group, and preview.
81
+ */
82
+ export declare function InsertTokenMenu(props: InsertTokenMenuProps): import("react").JSX.Element;
83
+ export declare namespace InsertTokenMenu {
84
+ var displayName: string;
85
+ }
86
+ export default InsertTokenMenu;
@@ -0,0 +1,232 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } 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 { mdiCodeBraces } from "@aglyn/shared-data-mdi";
18
+ import { HelpTip, MdiIcon } from "@aglyn/shared-ui-jsx";
19
+ import { Box, IconButton, InputAdornment, ListSubheader, Menu, MenuItem, Stack, TextField, Typography } from "@mui/material";
20
+ import { useCallback, useMemo, useRef, useState } from "react";
21
+ import { besignerDocsUrl } from "../utils/docs-help.js";
22
+ /**
23
+ * Insert-token building blocks (AGL-583): the {x} input adornment that
24
+ * opens the data-placeholder picker on token-capable attribute fields, the
25
+ * grouped/searchable picker menu itself, and the pure caret-splice helper.
26
+ * The element props form wires them to the form state so an insert behaves
27
+ * exactly like typing the token by hand (raw `{{...}}` stays supported).
28
+ */ /**
29
+ * Splices `token` into `text` at the captured selection, replacing any
30
+ * selected range — the concat/builder behavior: existing text before and
31
+ * after the caret is preserved. A null/undefined start means the field was
32
+ * never focused, so the token appends at the end. Returns the new value
33
+ * and the caret position just after the inserted token.
34
+ */ export function insertTokenIntoText(text, token, start, end) {
35
+ const length = text.length;
36
+ const clamp = (value)=>Math.min(Math.max(value, 0), length);
37
+ const at = start == null ? length : clamp(start);
38
+ const to = end == null ? at : Math.max(clamp(end), at);
39
+ return {
40
+ value: `${text.slice(0, at)}${token}${text.slice(to)}`,
41
+ caret: at + token.length
42
+ };
43
+ }
44
+ /**
45
+ * Reads the adornment's sibling input and, when it holds focus, its
46
+ * selection. Selection is only trusted while the input is focused — an
47
+ * unfocused input reports a stale 0/0 selection, and inserting there
48
+ * would silently prepend; appending at the end is the safer default.
49
+ */ export function captureAdornmentTarget(button) {
50
+ var _ref, _ref1;
51
+ const root = button.closest('.MuiInputBase-root');
52
+ const input = root == null ? void 0 : root.querySelector('input, textarea');
53
+ const focused = Boolean(input) && document.activeElement === input;
54
+ return {
55
+ input,
56
+ start: focused ? (_ref = input == null ? void 0 : input.selectionStart) != null ? _ref : null : null,
57
+ end: focused ? (_ref1 = input == null ? void 0 : input.selectionEnd) != null ? _ref1 : null : null
58
+ };
59
+ }
60
+ /**
61
+ * The small {x} button rendered as an end adornment on token-capable
62
+ * attribute inputs. The caret is captured on MOUSEDOWN — before the click
63
+ * would move focus — and the default is prevented so the input keeps both
64
+ * focus and its visible selection while the picker opens.
65
+ */ export function InsertTokenAdornment(props) {
66
+ const { onOpen } = props;
67
+ const captureRef = useRef(null);
68
+ const handleMouseDown = useCallback((event)=>{
69
+ captureRef.current = captureAdornmentTarget(event.currentTarget);
70
+ event.preventDefault();
71
+ }, []);
72
+ const handleClick = useCallback((event)=>{
73
+ var _captureRef_current;
74
+ // Keyboard activation never fires mousedown — capture on demand
75
+ // (the input isn't focused then, so the token appends at the end).
76
+ const capture = (_captureRef_current = captureRef.current) != null ? _captureRef_current : captureAdornmentTarget(event.currentTarget);
77
+ captureRef.current = null;
78
+ onOpen(event.currentTarget, capture);
79
+ }, [
80
+ onOpen
81
+ ]);
82
+ return /*#__PURE__*/ _jsx(InputAdornment, {
83
+ position: "end",
84
+ children: /*#__PURE__*/ _jsx(IconButton, {
85
+ "aria-label": "Insert data token",
86
+ title: "Insert data",
87
+ size: "small",
88
+ edge: "end",
89
+ onMouseDown: handleMouseDown,
90
+ onClick: handleClick,
91
+ children: /*#__PURE__*/ _jsx(MdiIcon, {
92
+ path: mdiCodeBraces.path,
93
+ fontSize: "small"
94
+ })
95
+ })
96
+ });
97
+ }
98
+ InsertTokenAdornment.displayName = 'InsertTokenAdornment';
99
+ /**
100
+ * The grouped, searchable data-placeholder picker (AGL-583) — one menu
101
+ * serving both the per-field {x} adornment and the legacy element-level
102
+ * "Insert binding" button (AGL-100). Groups render in option order with
103
+ * subheaders; context-dependent groups carry a hint line saying where
104
+ * their tokens resolve. Search filters across label, group, and preview.
105
+ */ export function InsertTokenMenu(props) {
106
+ const { anchorEl, open, onClose, options, onInsert, emptyText } = props;
107
+ // Hosts can have hundreds of variables (AGL-186) — filter as you type.
108
+ const [search, setSearch] = useState('');
109
+ const handleClose = useCallback(()=>{
110
+ setSearch('');
111
+ onClose();
112
+ }, [
113
+ onClose
114
+ ]);
115
+ const visibleOptions = useMemo(()=>{
116
+ const term = search.trim().toLowerCase();
117
+ if (!term) return options;
118
+ return options.filter((option)=>[
119
+ option.label,
120
+ option.group,
121
+ option.preview
122
+ ].filter(Boolean).some((text)=>String(text).toLowerCase().includes(term)));
123
+ }, [
124
+ options,
125
+ search
126
+ ]);
127
+ return /*#__PURE__*/ _jsxs(Menu, {
128
+ anchorEl: anchorEl,
129
+ open: open,
130
+ onClose: handleClose,
131
+ // Focus goes back to the edited input (with the caret placed after
132
+ // the inserted token), never to the adornment button.
133
+ disableRestoreFocus: true,
134
+ slotProps: {
135
+ paper: {
136
+ sx: {
137
+ width: 340,
138
+ maxWidth: '90vw'
139
+ }
140
+ }
141
+ },
142
+ children: [
143
+ /*#__PURE__*/ _jsxs(Box, {
144
+ sx: {
145
+ px: 1.5,
146
+ pb: 1,
147
+ display: 'flex',
148
+ alignItems: 'center',
149
+ gap: 0.5
150
+ },
151
+ children: [
152
+ /*#__PURE__*/ _jsx(TextField, {
153
+ size: "small",
154
+ placeholder: "Search data…",
155
+ value: search,
156
+ onChange: (event)=>setSearch(event.target.value),
157
+ onKeyDown: (event)=>event.stopPropagation(),
158
+ autoFocus: true,
159
+ fullWidth: true
160
+ }),
161
+ /*#__PURE__*/ _jsx(HelpTip, {
162
+ title: "Bindings",
163
+ excerpt: "Insert a variable or function token. It stays a rename-safe reference, and the canvas shows the resolved value until you toggle raw tokens.",
164
+ href: besignerDocsUrl('bindings', '#insert-a-variable'),
165
+ sx: {
166
+ flexShrink: 0,
167
+ fontSize: '0.9em'
168
+ }
169
+ })
170
+ ]
171
+ }),
172
+ visibleOptions.length === 0 ? /*#__PURE__*/ _jsx(MenuItem, {
173
+ disabled: true,
174
+ sx: {
175
+ whiteSpace: 'normal'
176
+ },
177
+ children: options.length === 0 && emptyText ? emptyText : 'No data matches'
178
+ }) : null,
179
+ visibleOptions.map((option, index)=>{
180
+ var _option_group;
181
+ const previous = visibleOptions[index - 1];
182
+ const newGroup = option.group && option.group !== (previous == null ? void 0 : previous.group);
183
+ return [
184
+ newGroup ? /*#__PURE__*/ _jsxs(ListSubheader, {
185
+ sx: {
186
+ lineHeight: option.groupHint ? 1.6 : undefined,
187
+ py: option.groupHint ? 0.75 : undefined
188
+ },
189
+ children: [
190
+ option.group,
191
+ option.groupHint ? /*#__PURE__*/ _jsx(Typography, {
192
+ variant: "caption",
193
+ color: "text.secondary",
194
+ component: "div",
195
+ children: option.groupHint
196
+ }) : null
197
+ ]
198
+ }, `${option.group}-header`) : null,
199
+ /*#__PURE__*/ _jsx(MenuItem, {
200
+ onClick: ()=>{
201
+ setSearch('');
202
+ onInsert(option.token);
203
+ },
204
+ children: /*#__PURE__*/ _jsxs(Stack, {
205
+ sx: {
206
+ minWidth: 0
207
+ },
208
+ children: [
209
+ /*#__PURE__*/ _jsx(Typography, {
210
+ variant: "body2",
211
+ children: option.label
212
+ }),
213
+ option.preview ? /*#__PURE__*/ _jsx(Typography, {
214
+ variant: "caption",
215
+ color: "text.secondary",
216
+ sx: {
217
+ overflowWrap: 'break-word'
218
+ },
219
+ children: option.preview
220
+ }) : null
221
+ ]
222
+ })
223
+ }, `${(_option_group = option.group) != null ? _option_group : ''}-${option.token}-${index}`)
224
+ ];
225
+ })
226
+ ]
227
+ });
228
+ }
229
+ InsertTokenMenu.displayName = 'InsertTokenMenu';
230
+ export default InsertTokenMenu;
231
+
232
+ //# sourceMappingURL=insert-token-menu.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/insert-token-menu.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 { mdiCodeBraces } from '@aglyn/shared-data-mdi'\nimport { HelpTip, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport {\n Box,\n IconButton,\n InputAdornment,\n ListSubheader,\n Menu,\n MenuItem,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { type MouseEvent, useCallback, useMemo, useRef, useState } from 'react'\n\nimport type { BindingOption } from '../contexts/binding-picker-context'\nimport { besignerDocsUrl } from '../utils/docs-help'\n\n/**\n * Insert-token building blocks (AGL-583): the {x} input adornment that\n * opens the data-placeholder picker on token-capable attribute fields, the\n * grouped/searchable picker menu itself, and the pure caret-splice helper.\n * The element props form wires them to the form state so an insert behaves\n * exactly like typing the token by hand (raw `{{...}}` stays supported).\n */\n\n/**\n * Splices `token` into `text` at the captured selection, replacing any\n * selected range — the concat/builder behavior: existing text before and\n * after the caret is preserved. A null/undefined start means the field was\n * never focused, so the token appends at the end. Returns the new value\n * and the caret position just after the inserted token.\n */\nexport function insertTokenIntoText(\n text: string,\n token: string,\n start?: number | null,\n end?: number | null,\n): { value: string; caret: number } {\n const length = text.length\n const clamp = (value: number) => Math.min(Math.max(value, 0), length)\n const at = start == null ? length : clamp(start)\n const to = end == null ? at : Math.max(clamp(end), at)\n return {\n value: `${text.slice(0, at)}${token}${text.slice(to)}`,\n caret: at + token.length,\n }\n}\n\n/** The input element + selection captured when the adornment is pressed. */\nexport interface TokenFieldCapture {\n input: HTMLInputElement | HTMLTextAreaElement | null\n start: number | null\n end: number | null\n}\n\n/**\n * Reads the adornment's sibling input and, when it holds focus, its\n * selection. Selection is only trusted while the input is focused — an\n * unfocused input reports a stale 0/0 selection, and inserting there\n * would silently prepend; appending at the end is the safer default.\n */\nexport function captureAdornmentTarget(button: HTMLElement): TokenFieldCapture {\n const root = button.closest('.MuiInputBase-root')\n const input = root?.querySelector('input, textarea') as\n | HTMLInputElement\n | HTMLTextAreaElement\n | null\n const focused = Boolean(input) && document.activeElement === input\n return {\n input,\n start: focused ? input?.selectionStart ?? null : null,\n end: focused ? input?.selectionEnd ?? null : null,\n }\n}\n\nexport interface InsertTokenAdornmentProps {\n onOpen: (anchor: HTMLElement, capture: TokenFieldCapture) => void\n}\n\n/**\n * The small {x} button rendered as an end adornment on token-capable\n * attribute inputs. The caret is captured on MOUSEDOWN — before the click\n * would move focus — and the default is prevented so the input keeps both\n * focus and its visible selection while the picker opens.\n */\nexport function InsertTokenAdornment(props: InsertTokenAdornmentProps) {\n const { onOpen } = props\n const captureRef = useRef<TokenFieldCapture | null>(null)\n\n const handleMouseDown = useCallback((event: MouseEvent<HTMLElement>) => {\n captureRef.current = captureAdornmentTarget(event.currentTarget)\n event.preventDefault()\n }, [])\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLElement>) => {\n // Keyboard activation never fires mousedown — capture on demand\n // (the input isn't focused then, so the token appends at the end).\n const capture =\n captureRef.current ?? captureAdornmentTarget(event.currentTarget)\n captureRef.current = null\n onOpen(event.currentTarget, capture)\n },\n [onOpen],\n )\n\n return (\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"Insert data token\"\n title=\"Insert data\"\n size=\"small\"\n edge=\"end\"\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n >\n <MdiIcon path={mdiCodeBraces.path} fontSize=\"small\" />\n </IconButton>\n </InputAdornment>\n )\n}\nInsertTokenAdornment.displayName = 'InsertTokenAdornment'\n\nexport interface InsertTokenMenuProps {\n anchorEl: HTMLElement | null\n open: boolean\n onClose: () => void\n options: BindingOption[]\n onInsert: (token: string) => void\n /**\n * What the menu says when there is nothing to offer at all, as opposed to\n * nothing matching a search. A field that takes only one kind of value\n * knows where more of that kind comes from, and should say so.\n */\n emptyText?: string\n}\n\n/**\n * The grouped, searchable data-placeholder picker (AGL-583) — one menu\n * serving both the per-field {x} adornment and the legacy element-level\n * \"Insert binding\" button (AGL-100). Groups render in option order with\n * subheaders; context-dependent groups carry a hint line saying where\n * their tokens resolve. Search filters across label, group, and preview.\n */\nexport function InsertTokenMenu(props: InsertTokenMenuProps) {\n const { anchorEl, open, onClose, options, onInsert, emptyText } = props\n // Hosts can have hundreds of variables (AGL-186) — filter as you type.\n const [search, setSearch] = useState('')\n\n const handleClose = useCallback(() => {\n setSearch('')\n onClose()\n }, [onClose])\n\n const visibleOptions = useMemo(() => {\n const term = search.trim().toLowerCase()\n if (!term) return options\n return options.filter((option) =>\n [option.label, option.group, option.preview]\n .filter(Boolean)\n .some((text) => String(text).toLowerCase().includes(term)),\n )\n }, [options, search])\n\n return (\n <Menu\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n // Focus goes back to the edited input (with the caret placed after\n // the inserted token), never to the adornment button.\n disableRestoreFocus\n slotProps={{ paper: { sx: { width: 340, maxWidth: '90vw' } } }}\n >\n {/* One help affordance for BOTH bindings entry points (AGL-2167):\n this menu is what the per-field {x} adornment opens and what the\n element-level \"Insert binding\" button opens, so the explanation\n of what a token is belongs here rather than duplicated at each. */}\n <Box\n sx={{\n px: 1.5,\n pb: 1,\n display: 'flex',\n alignItems: 'center',\n gap: 0.5,\n }}\n >\n <TextField\n size=\"small\"\n placeholder=\"Search data…\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n onKeyDown={(event) => event.stopPropagation()}\n autoFocus\n fullWidth\n />\n <HelpTip\n title=\"Bindings\"\n excerpt=\"Insert a variable or function token. It stays a rename-safe reference, and the canvas shows the resolved value until you toggle raw tokens.\"\n href={besignerDocsUrl('bindings', '#insert-a-variable')}\n sx={{ flexShrink: 0, fontSize: '0.9em' }}\n />\n </Box>\n {visibleOptions.length === 0 ? (\n <MenuItem disabled sx={{ whiteSpace: 'normal' }}>\n {options.length === 0 && emptyText ? emptyText : 'No data matches'}\n </MenuItem>\n ) : null}\n {visibleOptions.map((option, index) => {\n const previous = visibleOptions[index - 1]\n const newGroup = option.group && option.group !== previous?.group\n return [\n newGroup ? (\n <ListSubheader\n key={`${option.group}-header`}\n sx={{ lineHeight: option.groupHint ? 1.6 : undefined, py: option.groupHint ? 0.75 : undefined }}\n >\n {option.group}\n {/* Context hint (AGL-583): where these tokens resolve. */}\n {option.groupHint ? (\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n component=\"div\"\n >\n {option.groupHint}\n </Typography>\n ) : null}\n </ListSubheader>\n ) : null,\n <MenuItem\n key={`${option.group ?? ''}-${option.token}-${index}`}\n onClick={() => {\n setSearch('')\n onInsert(option.token)\n }}\n >\n <Stack sx={{ minWidth: 0 }}>\n <Typography variant=\"body2\">{option.label}</Typography>\n {/* Live value preview (AGL-262) / token description. */}\n {option.preview ? (\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ overflowWrap: 'break-word' }}\n >\n {option.preview}\n </Typography>\n ) : null}\n </Stack>\n </MenuItem>,\n ]\n })}\n </Menu>\n )\n}\nInsertTokenMenu.displayName = 'InsertTokenMenu'\n\nexport default InsertTokenMenu\n"],"names":["mdiCodeBraces","HelpTip","MdiIcon","Box","IconButton","InputAdornment","ListSubheader","Menu","MenuItem","Stack","TextField","Typography","useCallback","useMemo","useRef","useState","besignerDocsUrl","insertTokenIntoText","text","token","start","end","length","clamp","value","Math","min","max","at","to","slice","caret","captureAdornmentTarget","button","root","closest","input","querySelector","focused","Boolean","document","activeElement","selectionStart","selectionEnd","InsertTokenAdornment","props","onOpen","captureRef","handleMouseDown","event","current","currentTarget","preventDefault","handleClick","capture","position","aria-label","title","size","edge","onMouseDown","onClick","path","fontSize","displayName","InsertTokenMenu","anchorEl","open","onClose","options","onInsert","emptyText","search","setSearch","handleClose","visibleOptions","term","trim","toLowerCase","filter","option","label","group","preview","some","String","includes","disableRestoreFocus","slotProps","paper","sx","width","maxWidth","px","pb","display","alignItems","gap","placeholder","onChange","target","onKeyDown","stopPropagation","autoFocus","fullWidth","excerpt","href","flexShrink","disabled","whiteSpace","map","index","previous","newGroup","lineHeight","groupHint","undefined","py","variant","color","component","minWidth","overflowWrap"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,aAAa,QAAQ,yBAAwB;AACtD,SAASC,OAAO,EAAEC,OAAO,QAAQ,uBAAsB;AACvD,SACEC,GAAG,EACHC,UAAU,EACVC,cAAc,EACdC,aAAa,EACbC,IAAI,EACJC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAA0BC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAG/E,SAASC,eAAe,QAAQ,wBAAoB;AAEpD;;;;;;CAMC,GAED;;;;;;CAMC,GACD,OAAO,SAASC,oBACdC,IAAY,EACZC,KAAa,EACbC,KAAqB,EACrBC,GAAmB;IAEnB,MAAMC,SAASJ,KAAKI,MAAM;IAC1B,MAAMC,QAAQ,CAACC,QAAkBC,KAAKC,GAAG,CAACD,KAAKE,GAAG,CAACH,OAAO,IAAIF;IAC9D,MAAMM,KAAKR,SAAS,OAAOE,SAASC,MAAMH;IAC1C,MAAMS,KAAKR,OAAO,OAAOO,KAAKH,KAAKE,GAAG,CAACJ,MAAMF,MA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9B,eAAeC,gBAAe"}
@@ -0,0 +1,50 @@
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
+ import { type FormRendererProps } from '@aglyn/shared-ui-jsx-forms';
19
+ export interface InstanceAttrOverridesProps {
20
+ /** The selected node, as the panel holds it. */
21
+ node?: Aglyn.NodeSchema<any>;
22
+ /**
23
+ * Passed in rather than imported, so this file does not import the
24
+ * Attributes form that renders it (a cycle) — and so a caller can narrow
25
+ * the editors on offer without this component knowing about any of them.
26
+ */
27
+ componentMapper: FormRendererProps['componentMapper'];
28
+ }
29
+ /**
30
+ * Per-instance ATTRIBUTE overrides for a reusable-component instance
31
+ * (AGL-1899) — the attribute-side twin of the Styles panel's override
32
+ * section (AGL-1332).
33
+ *
34
+ * An instance renders the component's CURRENT nodes; this section layers one
35
+ * placement's own prop values over one node inside it, so a single page's CTA
36
+ * can be `outlined` while every other placement stays `contained` — without
37
+ * the component declaring a prop for it, without detaching, and without
38
+ * pinning the instance to a component version. The graft merges the slice per
39
+ * named prop, so a prop the component ADDS later still reaches this instance
40
+ * with the component's new default.
41
+ *
42
+ * Content is deliberately not editable here: a component's text rides its
43
+ * declared `{{prop.*}}` props and the canvas's double-click editor (AGL-1304),
44
+ * and `children`/`html` are refused by the writer so this panel never becomes
45
+ * a second control writing the same rendered string.
46
+ */
47
+ export declare const InstanceAttrOverrides: (({ node: selectedNode, componentMapper, }: InstanceAttrOverridesProps) => import("react").JSX.Element) & {
48
+ displayName: string;
49
+ };
50
+ export default InstanceAttrOverrides;