@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,246 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
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 { COLLECTION_TOKEN_CATALOG, ENTRY_TOKEN_CATALOG, hostTokenDefinition, humanizeDatasetFieldId } from "@aglyn/aglyn";
18
+ /**
19
+ * Any `{{...}}` occurrence without nested braces — var:/fn:/entry./
20
+ * collection./item.* AND unknown tokens alike. `{{a{{b}}` yields the text
21
+ * `{{a` plus the token `{{b}}` (the opener without a closer is plain text).
22
+ */ export const TOKEN_SEGMENT_PATTERN = /\{\{[^{}]*\}\}/g;
23
+ /** Drops empty text runs and merges adjacent text segments. */ function normalizeSegments(segments) {
24
+ const out = [];
25
+ for (const segment of segments){
26
+ if (segment.type === 'text' && !segment.value) continue;
27
+ const last = out[out.length - 1];
28
+ if (segment.type === 'text' && (last == null ? void 0 : last.type) === 'text') {
29
+ last.value += segment.value;
30
+ } else {
31
+ out.push(_extends({}, segment));
32
+ }
33
+ }
34
+ return out;
35
+ }
36
+ /** Splits `text` on `{{...}}` occurrences into text/token segments. */ export function parseTokenSegments(text) {
37
+ const segments = [];
38
+ let cursor = 0;
39
+ const pattern = new RegExp(TOKEN_SEGMENT_PATTERN.source, 'g');
40
+ for(let match = pattern.exec(text); match; match = pattern.exec(text)){
41
+ if (match.index > cursor) {
42
+ segments.push({
43
+ type: 'text',
44
+ value: text.slice(cursor, match.index)
45
+ });
46
+ }
47
+ segments.push({
48
+ type: 'token',
49
+ value: match[0],
50
+ token: match[0]
51
+ });
52
+ cursor = match.index + match[0].length;
53
+ }
54
+ if (cursor < text.length) {
55
+ segments.push({
56
+ type: 'text',
57
+ value: text.slice(cursor)
58
+ });
59
+ }
60
+ return segments;
61
+ }
62
+ /** Joins segments back to the exact stored string (lossless round-trip). */ export function serializeTokenSegments(segments) {
63
+ return segments.map((segment)=>segment.value).join('');
64
+ }
65
+ /** True when any text run still holds a complete raw `{{...}}` token. */ export function hasUnmaterializedTokens(segments) {
66
+ const probe = new RegExp(TOKEN_SEGMENT_PATTERN.source);
67
+ return segments.some((segment)=>segment.type === 'text' && probe.test(segment.value));
68
+ }
69
+ /** Unit length of one segment: text = char count, token = 1 atomic unit. */ export function segmentUnitLength(segment) {
70
+ return segment.type === 'token' ? 1 : segment.value.length;
71
+ }
72
+ /** Total unit length of a segment list (pills count as 1 unit each). */ export function segmentsUnitLength(segments) {
73
+ return segments.reduce((sum, segment)=>sum + segmentUnitLength(segment), 0);
74
+ }
75
+ /**
76
+ * Extracts [from, to) in unit offsets. Tokens are atomic: since a token is
77
+ * exactly 1 unit, an integer range either includes it wholly or not at all
78
+ * — a caret can never split a pill.
79
+ */ export function sliceSegmentsByUnits(segments, from, to) {
80
+ const out = [];
81
+ let position = 0;
82
+ for (const segment of segments){
83
+ const length = segmentUnitLength(segment);
84
+ const start = Math.max(from, position);
85
+ const stop = Math.min(to, position + length);
86
+ if (stop > start) {
87
+ if (segment.type === 'token') {
88
+ out.push(_extends({}, segment));
89
+ } else {
90
+ out.push({
91
+ type: 'text',
92
+ value: segment.value.slice(start - position, stop - position)
93
+ });
94
+ }
95
+ }
96
+ position += length;
97
+ }
98
+ return normalizeSegments(out);
99
+ }
100
+ /**
101
+ * Splices `replacement` into `segments` at the unit-offset selection,
102
+ * replacing any selected range — the caret-preserving insert used by the
103
+ * {x} picker (AGL-583 semantics, pill-aware). A null/undefined start means
104
+ * "no caret captured": the replacement appends at the end. Returns the new
105
+ * segment list and the caret unit just after the inserted content.
106
+ */ export function spliceSegmentsAtUnits(segments, replacement, start, end) {
107
+ const length = segmentsUnitLength(segments);
108
+ const clamp = (value)=>Math.min(Math.max(value, 0), length);
109
+ const at = start == null ? length : clamp(start);
110
+ const to = end == null ? at : Math.max(clamp(end), at);
111
+ const next = normalizeSegments([
112
+ ...sliceSegmentsByUnits(segments, 0, at),
113
+ ...replacement,
114
+ ...sliceSegmentsByUnits(segments, to, Infinity)
115
+ ]);
116
+ return {
117
+ segments: next,
118
+ caretUnit: at + segmentsUnitLength(replacement)
119
+ };
120
+ }
121
+ /** A single token segment for `spliceSegmentsAtUnits` insertion. */ export function tokenSegment(token) {
122
+ return {
123
+ type: 'token',
124
+ value: token,
125
+ token
126
+ };
127
+ }
128
+ /** A single text segment for `spliceSegmentsAtUnits` insertion. */ export function textSegment(text) {
129
+ return {
130
+ type: 'text',
131
+ value: text
132
+ };
133
+ }
134
+ const stripBraces = (token)=>token.replace(/^\{\{\s*/, '').replace(/\s*\}\}$/, '');
135
+ /** Whitespace-insensitive raw-token comparison (`{{ var:x }}` ≡ `{{var:x}}`). */ const canonical = (token)=>token.replace(/\s+/g, '');
136
+ /**
137
+ * Resolves a raw token to its display name (AGL-586 requirement 2: users
138
+ * see NAMES, storage keeps IDS). The group comes from the token's shape so
139
+ * pills stay consistently colored even when the referent is missing;
140
+ * `known: false` marks unresolvable tokens for warning styling with the
141
+ * raw token surfaced as the tooltip.
142
+ */ export function resolveTokenLabel(token, context = {}) {
143
+ const inner = stripBraces(token).trim();
144
+ const optionByToken = (candidate)=>{
145
+ var _context_options;
146
+ return ((_context_options = context.options) != null ? _context_options : []).find((option)=>canonical(option.token) === canonical(candidate));
147
+ };
148
+ const variableMatch = /^var:([^\s(){}]+)$/.exec(inner);
149
+ if (variableMatch) {
150
+ var _ref;
151
+ var _context_variables_id, _context_variables, _optionByToken;
152
+ const id = variableMatch[1];
153
+ const name = (_ref = (_context_variables = context.variables) == null ? void 0 : (_context_variables_id = _context_variables[id]) == null ? void 0 : _context_variables_id.name) != null ? _ref : (_optionByToken = optionByToken(`{{var:${id}}}`)) == null ? void 0 : _optionByToken.label;
154
+ return {
155
+ label: name != null ? name : id,
156
+ group: 'variable',
157
+ known: Boolean(name)
158
+ };
159
+ }
160
+ const functionMatch = /^fn:([^(){}]+)\(([^)]*)\)$/.exec(inner);
161
+ if (functionMatch) {
162
+ var _ref1, _context_options;
163
+ var _context_functions_id, _context_functions, _find;
164
+ const id = String(functionMatch[1]).trim();
165
+ // A stored call's args differ from the picker's parameter template, so
166
+ // options match on the `{{fn:id(` prefix rather than the whole token.
167
+ const name = (_ref1 = (_context_functions = context.functions) == null ? void 0 : (_context_functions_id = _context_functions[id]) == null ? void 0 : _context_functions_id.name) != null ? _ref1 : (_find = ((_context_options = context.options) != null ? _context_options : []).find((option)=>canonical(option.token).startsWith(canonical(`{{fn:${id}(`)))) == null ? void 0 : _find.label;
168
+ return {
169
+ label: name != null ? name : id,
170
+ group: 'function',
171
+ known: Boolean(name)
172
+ };
173
+ }
174
+ if (inner.startsWith('entry.')) {
175
+ var _ref2;
176
+ const entry = ENTRY_TOKEN_CATALOG.find((candidate)=>canonical(candidate.token) === canonical(`{{${inner}}}`));
177
+ return {
178
+ label: (_ref2 = entry == null ? void 0 : entry.label) != null ? _ref2 : inner,
179
+ group: 'entry',
180
+ known: Boolean(entry)
181
+ };
182
+ }
183
+ // `{{pagination.*}}` (AGL-1386) resolves on the same collection list pages
184
+ // and lives in the same catalog, so it shares the collection pill rather
185
+ // than reading as an unresolvable token in warning colors.
186
+ if (inner.startsWith('collection.') || inner.startsWith('pagination.')) {
187
+ var _ref3;
188
+ const entry = COLLECTION_TOKEN_CATALOG.find((candidate)=>canonical(candidate.token) === canonical(`{{${inner}}}`));
189
+ return {
190
+ label: (_ref3 = entry == null ? void 0 : entry.label) != null ? _ref3 : inner,
191
+ group: 'collection',
192
+ known: Boolean(entry)
193
+ };
194
+ }
195
+ /*
196
+ * A component's own property (AGL-1335), named the way the Attributes panel
197
+ * names it. Known only where the picker offers it — inside the component
198
+ * that declares it — because that is the only place the token substitutes:
199
+ * the same pill on an ordinary screen, or naming a property since removed,
200
+ * resolves to nothing on the page and says so in warning colors.
201
+ */ const propertyMatch = /^prop\.([A-Za-z_][A-Za-z0-9_]*)$/.exec(inner);
202
+ if (propertyMatch) {
203
+ var _ref4;
204
+ const option = optionByToken(`{{${inner}}}`);
205
+ return {
206
+ label: (_ref4 = option == null ? void 0 : option.label) != null ? _ref4 : propertyMatch[1],
207
+ group: 'property',
208
+ known: Boolean(option)
209
+ };
210
+ }
211
+ /*
212
+ * A host variable (AGL-1022), named from the registry that resolves it
213
+ * (AGL-2881), so the pill reads "Business name" wherever the token sits and
214
+ * every surface agrees on what exists. A name the registry does not declare
215
+ * renders nothing on the page, and says so in warning colors.
216
+ */ const hostMatch = /^host\.([a-zA-Z][a-zA-Z0-9_]*)$/.exec(inner);
217
+ if (hostMatch) {
218
+ var _ref5;
219
+ const definition = hostTokenDefinition(hostMatch[1]);
220
+ return {
221
+ label: (_ref5 = definition == null ? void 0 : definition.label) != null ? _ref5 : inner,
222
+ group: 'host',
223
+ known: Boolean(definition)
224
+ };
225
+ }
226
+ const itemMatch = /^item\.([^.\s{}]+)(?:\.([^.\s{}]+))?$/.exec(inner);
227
+ if (itemMatch) {
228
+ var _context_datasetFields;
229
+ const fieldId = itemMatch[1];
230
+ const hopId = itemMatch[2];
231
+ const field = ((_context_datasetFields = context.datasetFields) != null ? _context_datasetFields : []).find((candidate)=>candidate.id === fieldId);
232
+ const label = field ? hopId ? `${field.label} → ${humanizeDatasetFieldId(hopId)}` : field.label : inner;
233
+ return {
234
+ label,
235
+ group: 'dataset',
236
+ known: Boolean(field)
237
+ };
238
+ }
239
+ return {
240
+ label: inner || token,
241
+ group: 'unknown',
242
+ known: false
243
+ };
244
+ }
245
+
246
+ //# sourceMappingURL=token-segments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/token-segments.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n COLLECTION_TOKEN_CATALOG,\n ENTRY_TOKEN_CATALOG,\n hostTokenDefinition,\n humanizeDatasetFieldId,\n} from '@aglyn/aglyn'\n\nimport type { BindingOption } from '../contexts/binding-picker-context'\n\n/**\n * Token-pill segment model (AGL-586). Stored prop strings keep the raw\n * id-based `{{...}}` grammar (AGL-100/185) — these helpers only SPLIT a\n * string into runs of plain text and atomic tokens so editors can render\n * the tokens as friendly, clickable pills. Serializing the segments always\n * reproduces the exact input string; nothing here ever rewrites a token.\n *\n * Offset model: editor carets address \"units\", where every plain-text\n * character is 1 unit and every token — however long its raw text — is 1\n * atomic unit. A caret can therefore sit before or after a pill but never\n * inside one, which is exactly how the pills behave in the DOM\n * (`contenteditable=\"false\"`).\n */\nexport interface TokenSegment {\n type: 'text' | 'token'\n /** The literal slice of the serialized string (raw `{{...}}` for tokens). */\n value: string\n /** Set on token segments: the raw token, identical to `value`. */\n token?: string\n}\n\n/**\n * Any `{{...}}` occurrence without nested braces — var:/fn:/entry./\n * collection./item.* AND unknown tokens alike. `{{a{{b}}` yields the text\n * `{{a` plus the token `{{b}}` (the opener without a closer is plain text).\n */\nexport const TOKEN_SEGMENT_PATTERN = /\\{\\{[^{}]*\\}\\}/g\n\n/** Drops empty text runs and merges adjacent text segments. */\nfunction normalizeSegments(segments: TokenSegment[]): TokenSegment[] {\n const out: TokenSegment[] = []\n for (const segment of segments) {\n if (segment.type === 'text' && !segment.value) continue\n const last = out[out.length - 1]\n if (segment.type === 'text' && last?.type === 'text') {\n last.value += segment.value\n } else {\n out.push({ ...segment })\n }\n }\n return out\n}\n\n/** Splits `text` on `{{...}}` occurrences into text/token segments. */\nexport function parseTokenSegments(text: string): TokenSegment[] {\n const segments: TokenSegment[] = []\n let cursor = 0\n const pattern = new RegExp(TOKEN_SEGMENT_PATTERN.source, 'g')\n for (let match = pattern.exec(text); match; match = pattern.exec(text)) {\n if (match.index > cursor) {\n segments.push({ type: 'text', value: text.slice(cursor, match.index) })\n }\n segments.push({ type: 'token', value: match[0], token: match[0] })\n cursor = match.index + match[0].length\n }\n if (cursor < text.length) {\n segments.push({ type: 'text', value: text.slice(cursor) })\n }\n return segments\n}\n\n/** Joins segments back to the exact stored string (lossless round-trip). */\nexport function serializeTokenSegments(segments: TokenSegment[]): string {\n return segments.map((segment) => segment.value).join('')\n}\n\n/** True when any text run still holds a complete raw `{{...}}` token. */\nexport function hasUnmaterializedTokens(segments: TokenSegment[]): boolean {\n const probe = new RegExp(TOKEN_SEGMENT_PATTERN.source)\n return segments.some(\n (segment) => segment.type === 'text' && probe.test(segment.value),\n )\n}\n\n/** Unit length of one segment: text = char count, token = 1 atomic unit. */\nexport function segmentUnitLength(segment: TokenSegment): number {\n return segment.type === 'token' ? 1 : segment.value.length\n}\n\n/** Total unit length of a segment list (pills count as 1 unit each). */\nexport function segmentsUnitLength(segments: TokenSegment[]): number {\n return segments.reduce((sum, segment) => sum + segmentUnitLength(segment), 0)\n}\n\n/**\n * Extracts [from, to) in unit offsets. Tokens are atomic: since a token is\n * exactly 1 unit, an integer range either includes it wholly or not at all\n * — a caret can never split a pill.\n */\nexport function sliceSegmentsByUnits(\n segments: TokenSegment[],\n from: number,\n to: number,\n): TokenSegment[] {\n const out: TokenSegment[] = []\n let position = 0\n for (const segment of segments) {\n const length = segmentUnitLength(segment)\n const start = Math.max(from, position)\n const stop = Math.min(to, position + length)\n if (stop > start) {\n if (segment.type === 'token') {\n out.push({ ...segment })\n } else {\n out.push({\n type: 'text',\n value: segment.value.slice(start - position, stop - position),\n })\n }\n }\n position += length\n }\n return normalizeSegments(out)\n}\n\n/**\n * Splices `replacement` into `segments` at the unit-offset selection,\n * replacing any selected range — the caret-preserving insert used by the\n * {x} picker (AGL-583 semantics, pill-aware). A null/undefined start means\n * \"no caret captured\": the replacement appends at the end. Returns the new\n * segment list and the caret unit just after the inserted content.\n */\nexport function spliceSegmentsAtUnits(\n segments: TokenSegment[],\n replacement: TokenSegment[],\n start?: number | null,\n end?: number | null,\n): { segments: TokenSegment[]; caretUnit: number } {\n const length = segmentsUnitLength(segments)\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 const next = normalizeSegments([\n ...sliceSegmentsByUnits(segments, 0, at),\n ...replacement,\n ...sliceSegmentsByUnits(segments, to, Infinity),\n ])\n return { segments: next, caretUnit: at + segmentsUnitLength(replacement) }\n}\n\n/** A single token segment for `spliceSegmentsAtUnits` insertion. */\nexport function tokenSegment(token: string): TokenSegment {\n return { type: 'token', value: token, token }\n}\n\n/** A single text segment for `spliceSegmentsAtUnits` insertion. */\nexport function textSegment(text: string): TokenSegment {\n return { type: 'text', value: text }\n}\n\n/** Which catalog family a token belongs to — drives the pill color. */\nexport type TokenGroup =\n | 'variable'\n | 'function'\n | 'entry'\n | 'collection'\n | 'dataset'\n | 'property'\n | 'host'\n | 'unknown'\n\n/**\n * Display-name inputs for {@link resolveTokenLabel}: the picker options\n * (which already carry friendly labels for every insertable token), the\n * host's variable/function docs keyed by id (AGL-194), and the ancestor\n * repeatable's dataset model fields (id → current display name).\n */\nexport interface TokenLabelContext {\n options?: BindingOption[]\n variables?: Record<string, { name?: string } | undefined>\n functions?: Record<string, { name?: string } | undefined>\n datasetFields?: Array<{ id: string; label: string }>\n}\n\nexport interface ResolvedTokenLabel {\n /** Friendly display name (the CURRENT name — ids stay in storage). */\n label: string\n /** Family for the pill color; shape-derived, stable across renames. */\n group: TokenGroup\n /** False when the referent can't be resolved (warning-colored pill). */\n known: boolean\n}\n\nconst stripBraces = (token: string): string =>\n token.replace(/^\\{\\{\\s*/, '').replace(/\\s*\\}\\}$/, '')\n\n/** Whitespace-insensitive raw-token comparison (`{{ var:x }}` ≡ `{{var:x}}`). */\nconst canonical = (token: string): string => token.replace(/\\s+/g, '')\n\n/**\n * Resolves a raw token to its display name (AGL-586 requirement 2: users\n * see NAMES, storage keeps IDS). The group comes from the token's shape so\n * pills stay consistently colored even when the referent is missing;\n * `known: false` marks unresolvable tokens for warning styling with the\n * raw token surfaced as the tooltip.\n */\nexport function resolveTokenLabel(\n token: string,\n context: TokenLabelContext = {},\n): ResolvedTokenLabel {\n const inner = stripBraces(token).trim()\n const optionByToken = (candidate: string): BindingOption | undefined =>\n (context.options ?? []).find(\n (option) => canonical(option.token) === canonical(candidate),\n )\n\n const variableMatch = /^var:([^\\s(){}]+)$/.exec(inner)\n if (variableMatch) {\n const id = variableMatch[1] as string\n const name =\n context.variables?.[id]?.name ?? optionByToken(`{{var:${id}}}`)?.label\n return { label: name ?? id, group: 'variable', known: Boolean(name) }\n }\n\n const functionMatch = /^fn:([^(){}]+)\\(([^)]*)\\)$/.exec(inner)\n if (functionMatch) {\n const id = String(functionMatch[1]).trim()\n // A stored call's args differ from the picker's parameter template, so\n // options match on the `{{fn:id(` prefix rather than the whole token.\n const name =\n context.functions?.[id]?.name ??\n (context.options ?? []).find((option) =>\n canonical(option.token).startsWith(canonical(`{{fn:${id}(`)),\n )?.label\n return { label: name ?? id, group: 'function', known: Boolean(name) }\n }\n\n if (inner.startsWith('entry.')) {\n const entry = ENTRY_TOKEN_CATALOG.find(\n (candidate) => canonical(candidate.token) === canonical(`{{${inner}}}`),\n )\n return { label: entry?.label ?? inner, group: 'entry', known: Boolean(entry) }\n }\n\n // `{{pagination.*}}` (AGL-1386) resolves on the same collection list pages\n // and lives in the same catalog, so it shares the collection pill rather\n // than reading as an unresolvable token in warning colors.\n if (inner.startsWith('collection.') || inner.startsWith('pagination.')) {\n const entry = COLLECTION_TOKEN_CATALOG.find(\n (candidate) => canonical(candidate.token) === canonical(`{{${inner}}}`),\n )\n return {\n label: entry?.label ?? inner,\n group: 'collection',\n known: Boolean(entry),\n }\n }\n\n /*\n * A component's own property (AGL-1335), named the way the Attributes panel\n * names it. Known only where the picker offers it — inside the component\n * that declares it — because that is the only place the token substitutes:\n * the same pill on an ordinary screen, or naming a property since removed,\n * resolves to nothing on the page and says so in warning colors.\n */\n const propertyMatch = /^prop\\.([A-Za-z_][A-Za-z0-9_]*)$/.exec(inner)\n if (propertyMatch) {\n const option = optionByToken(`{{${inner}}}`)\n return {\n label: option?.label ?? (propertyMatch[1] as string),\n group: 'property',\n known: Boolean(option),\n }\n }\n\n /*\n * A host variable (AGL-1022), named from the registry that resolves it\n * (AGL-2881), so the pill reads \"Business name\" wherever the token sits and\n * every surface agrees on what exists. A name the registry does not declare\n * renders nothing on the page, and says so in warning colors.\n */\n const hostMatch = /^host\\.([a-zA-Z][a-zA-Z0-9_]*)$/.exec(inner)\n if (hostMatch) {\n const definition = hostTokenDefinition(hostMatch[1] as string)\n return {\n label: definition?.label ?? inner,\n group: 'host',\n known: Boolean(definition),\n }\n }\n\n const itemMatch = /^item\\.([^.\\s{}]+)(?:\\.([^.\\s{}]+))?$/.exec(inner)\n if (itemMatch) {\n const fieldId = itemMatch[1] as string\n const hopId = itemMatch[2]\n const field = (context.datasetFields ?? []).find(\n (candidate) => candidate.id === fieldId,\n )\n const label = field\n ? hopId\n ? `${field.label} → ${humanizeDatasetFieldId(hopId)}`\n : field.label\n : inner\n return { label, group: 'dataset', known: Boolean(field) }\n }\n\n return { label: inner || token, group: 'unknown', known: false }\n}\n"],"names":["COLLECTION_TOKEN_CATALOG","ENTRY_TOKEN_CATALOG","hostTokenDefinition","humanizeDatasetFieldId","TOKEN_SEGMENT_PATTERN","normalizeSegments","segments","out","segment","type","value","last","length","push","parseTokenSegments","text","cursor","pattern","RegExp","source","match","exec","index","slice","token","serializeTokenSegments","map","join","hasUnmaterializedTokens","probe","some","test","segmentUnitLength","segmentsUnitLength","reduce","sum","sliceSegmentsByUnits","from","to","position","start","Math","max","stop","min","spliceSegmentsAtUnits","replacement","end","clamp","at","next","Infinity","caretUnit","tokenSegment","textSegment","stripBraces","replace","canonical","resolveTokenLabel","context","inner","trim","optionByToken","candidate","options","find","option","variableMatch","id","name","variables","label","group","known","Boolean","functionMatch","String","functions","startsWith","entry","propertyMatch","hostMatch","definition","itemMatch","fieldId","hopId","field","datasetFields"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,wBAAwB,EACxBC,mBAAmB,EACnBC,mBAAmB,EACnBC,sBAAsB,QACjB,eAAc;AAyBrB;;;;CAIC,GACD,OAAO,MAAMC,wBAAwB,kBAAiB;AAEtD,6DAA6D,GAC7D,SAASC,kBAAkBC,QAAwB;IACjD,MAAMC,MAAsB,EAAE;IAC9B,KAAK,MAAMC,WAAWF,SAAU;QAC9B,IAAIE,QAAQC,IAAI,KAAK,UAAU,CAACD,QAAQE,KAAK,EAAE;QAC/C,MAAMC,OAAOJ,GAAG,CA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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 { VISIBILITY_BAND_MEDIA, VISIBILITY_BANDS, type VisibilityBand } from '@aglyn/aglyn';
18
+ /**
19
+ * Responsive visibility control model (AGL-562): "hide on mobile /
20
+ * tablet / desktop" toggles that write `display: none` under
21
+ * range-scoped media keys in the node's sx. Range queries (rather than
22
+ * MUI's mobile-first responsive objects) mean hiding one band never
23
+ * needs a restore `display` value on the others, so an element's
24
+ * natural display — flex for stacks, block for boxes — is untouched
25
+ * where it stays visible. The keys are shared with the plugins-mui
26
+ * Mobile Nav preset via `@aglyn/aglyn`.
27
+ */
28
+ export { VISIBILITY_BAND_MEDIA, VISIBILITY_BANDS };
29
+ export type { VisibilityBand };
30
+ export declare const VISIBILITY_BAND_LABELS: Record<VisibilityBand, string>;
31
+ /** Bands the sx currently hides (band media key with display: none). */
32
+ export declare function readHiddenBands(sx: Record<string, any> | undefined): VisibilityBand[];
33
+ /**
34
+ * Returns a new sx with the band hidden or shown. Other declarations an
35
+ * author placed under the same media key (via the custom-CSS JSON tab)
36
+ * are preserved; the media key itself is dropped once it holds nothing.
37
+ */
38
+ export declare function writeHiddenBand(sx: Record<string, any> | undefined, band: VisibilityBand, hidden: boolean): Record<string, any>;
@@ -0,0 +1,54 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
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 { VISIBILITY_BAND_MEDIA, VISIBILITY_BANDS } from "@aglyn/aglyn";
18
+ /**
19
+ * Responsive visibility control model (AGL-562): "hide on mobile /
20
+ * tablet / desktop" toggles that write `display: none` under
21
+ * range-scoped media keys in the node's sx. Range queries (rather than
22
+ * MUI's mobile-first responsive objects) mean hiding one band never
23
+ * needs a restore `display` value on the others, so an element's
24
+ * natural display — flex for stacks, block for boxes — is untouched
25
+ * where it stays visible. The keys are shared with the plugins-mui
26
+ * Mobile Nav preset via `@aglyn/aglyn`.
27
+ */ export { VISIBILITY_BAND_MEDIA, VISIBILITY_BANDS };
28
+ export const VISIBILITY_BAND_LABELS = {
29
+ mobile: 'Hide on mobile (under 600px)',
30
+ tablet: 'Hide on tablet (600–899px)',
31
+ desktop: 'Hide on desktop (900px and up)'
32
+ };
33
+ /** Bands the sx currently hides (band media key with display: none). */ export function readHiddenBands(sx) {
34
+ return VISIBILITY_BANDS.filter((band)=>{
35
+ var _sx_VISIBILITY_BAND_MEDIA_band;
36
+ return (sx == null ? void 0 : (_sx_VISIBILITY_BAND_MEDIA_band = sx[VISIBILITY_BAND_MEDIA[band]]) == null ? void 0 : _sx_VISIBILITY_BAND_MEDIA_band['display']) === 'none';
37
+ });
38
+ }
39
+ /**
40
+ * Returns a new sx with the band hidden or shown. Other declarations an
41
+ * author placed under the same media key (via the custom-CSS JSON tab)
42
+ * are preserved; the media key itself is dropped once it holds nothing.
43
+ */ export function writeHiddenBand(sx, band, hidden) {
44
+ const key = VISIBILITY_BAND_MEDIA[band];
45
+ const next = _extends({}, sx);
46
+ const slice = typeof next[key] === 'object' && next[key] !== null ? _extends({}, next[key]) : {};
47
+ if (hidden) slice['display'] = 'none';
48
+ else delete slice['display'];
49
+ if (Object.keys(slice).length === 0) delete next[key];
50
+ else next[key] = slice;
51
+ return next;
52
+ }
53
+
54
+ //# sourceMappingURL=visibility-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/visibility-styles.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n VISIBILITY_BAND_MEDIA,\n VISIBILITY_BANDS,\n type VisibilityBand,\n} from '@aglyn/aglyn'\n\n/**\n * Responsive visibility control model (AGL-562): \"hide on mobile /\n * tablet / desktop\" toggles that write `display: none` under\n * range-scoped media keys in the node's sx. Range queries (rather than\n * MUI's mobile-first responsive objects) mean hiding one band never\n * needs a restore `display` value on the others, so an element's\n * natural display — flex for stacks, block for boxes — is untouched\n * where it stays visible. The keys are shared with the plugins-mui\n * Mobile Nav preset via `@aglyn/aglyn`.\n */\n\nexport { VISIBILITY_BAND_MEDIA, VISIBILITY_BANDS }\nexport type { VisibilityBand }\n\nexport const VISIBILITY_BAND_LABELS: Record<VisibilityBand, string> = {\n mobile: 'Hide on mobile (under 600px)',\n tablet: 'Hide on tablet (600–899px)',\n desktop: 'Hide on desktop (900px and up)',\n}\n\n/** Bands the sx currently hides (band media key with display: none). */\nexport function readHiddenBands(\n sx: Record<string, any> | undefined,\n): VisibilityBand[] {\n return VISIBILITY_BANDS.filter(\n (band) => sx?.[VISIBILITY_BAND_MEDIA[band]]?.['display'] === 'none',\n )\n}\n\n/**\n * Returns a new sx with the band hidden or shown. Other declarations an\n * author placed under the same media key (via the custom-CSS JSON tab)\n * are preserved; the media key itself is dropped once it holds nothing.\n */\nexport function writeHiddenBand(\n sx: Record<string, any> | undefined,\n band: VisibilityBand,\n hidden: boolean,\n): Record<string, any> {\n const key = VISIBILITY_BAND_MEDIA[band]\n const next: Record<string, any> = { ...sx }\n const slice: Record<string, any> =\n typeof next[key] === 'object' && next[key] !== null ? { ...next[key] } : {}\n if (hidden) slice['display'] = 'none'\n else delete slice['display']\n if (Object.keys(slice).length === 0) delete next[key]\n else next[key] = slice\n return next\n}\n"],"names":["VISIBILITY_BAND_MEDIA","VISIBILITY_BANDS","VISIBILITY_BAND_LABELS","mobile","tablet","desktop","readHiddenBands","sx","filter","band","writeHiddenBand","hidden","key","next","slice","Object","keys","length"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,qBAAqB,EACrBC,gBAAgB,QAEX,eAAc;AAErB;;;;;;;;;CASC,GAED,SAASD,qBAAqB,EAAEC,gBAAgB,GAAE;AAGlD,OAAO,MAAMC,yBAAyD;IACpEC,QAAQ;IACRC,QAAQ;IACRC,SAAS;AACX,EAAC;AAED,sEAAsE,GACtE,OAAO,SAASC,gBACdC,EAAmC;IAEnC,OAAON,iBAAiBO,MAAM,CAC5B,CAACC;YAASF;eAAAA,CAAAA,uBAAAA,iCAAAA,EAAI,CAACP,qBAAqB,CAACS,KAAK,CAAC,qBAAjCF,8BAAmC,CAAC,UAAU,MAAK;;AAEjE;AAEA;;;;CAIC,GACD,OAAO,SAASG,gBACdH,EAAmC,EACnCE,IAAoB,EACpBE,MAAe;IAEf,MAAMC,MAAMZ,qBAAqB,CAACS,KAAK;IACvC,MAAMI,OAA4B,aAAKN;IACvC,MAAMO,QACJ,OAAOD,IAAI,CAACD,IAAI,KAAK,YAAYC,IAAI,CAACD,IAAI,KAAK,OAAO,aAAKC,IAAI,CAACD,IAAI,IAAK,CAAC;IAC5E,IAAID,QAAQG,KAAK,CAAC,UAAU,GAAG;SAC1B,OAAOA,KAAK,CAAC,UAAU;IAC5B,IAAIC,OAAOC,IAAI,CAACF,OAAOG,MAAM,KAAK,GAAG,OAAOJ,IAAI,CAACD,IAAI;SAChDC,IAAI,CAACD,IAAI,GAAGE;IACjB,OAAOD;AACT"}