@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/token-text-field.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 {\n FormFieldGrid,\n type FormFieldGridProps,\n useFieldApi,\n validationError,\n type ExtendedFieldMeta,\n} from '@aglyn/shared-ui-jsx-forms'\nimport { mdiImageSearch } from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport {\n Box,\n IconButton,\n InputAdornment,\n TextField as MuiTextField,\n} from '@mui/material'\nimport { useContext, forwardRef, memo, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, type ClipboardEvent, type FocusEvent, type FormEvent, type KeyboardEvent, type MouseEvent, type MutableRefObject, type ReactNode } from 'react'\n\nimport MediaPickerContext from '../contexts/media-picker-context'\nimport type { BindingOption } from '../contexts/binding-picker-context'\nimport {\n readTokenSegmentsFromDom,\n selectionUnitsWithin,\n setSelectionUnits,\n TOKEN_PILL_ATTR,\n} from '../utils/token-editable-dom'\nimport {\n hasUnmaterializedTokens,\n parseTokenSegments,\n serializeTokenSegments,\n spliceSegmentsAtUnits,\n textSegment,\n tokenSegment,\n resolveTokenLabel,\n type TokenLabelContext,\n type TokenSegment,\n} from '../utils/token-segments'\nimport {\n InsertTokenAdornment,\n InsertTokenMenu,\n} from './insert-token-menu.component'\nimport {\n TokenPill,\n TokenPillPopover,\n tokenPillContainerSx,\n} from './token-pill.component'\n\n/**\n * TokenTextField (AGL-586): the attributes-panel editor for token-capable\n * free-text attributes. A contentEditable surface styled as a MUI\n * TextField renders the value as plain text plus atomic {@link TokenPill}\n * badges — users see resolved NAMES while the serialized value (what\n * react-final-form holds and the node stores) keeps the raw id-based\n * `{{...}}` grammar. Typing edits text natively; pills are clickable to\n * replace or remove; the {x} adornment inserts at the caret (AGL-583).\n *\n * Model/DOM contract (mirrors the AGL-582 markdown editor): the segment\n * model is source of truth ONLY at version bumps. Between bumps the\n * browser owns the DOM — every `input` event silently syncs the model and\n * emits through `input.onChange`, so the AGL-567 debounced commit treats\n * pill edits exactly like keystrokes. Structural edits (insert/replace/\n * remove pill, paste, Enter-newline) re-render from the model and restore\n * the selection from unit offsets (text char = 1 unit, pill = 1 unit).\n *\n * Raw `{{...}}` typed by hand materializes into a pill on BLUR, not per\n * keystroke: materializing mid-typing would re-render under the caret and\n * fight the IME/undo stack, while on blur there is no caret to disturb.\n *\n * Undo: native browser undo survives for plain typing runs (no re-render\n * happens between keystrokes), but any pill materialization/insert/remove\n * re-renders the surface and truncates the native undo stack — the same\n * trade the markdown editor makes, without its custom history (the canvas\n * model keeps its own undo at commit granularity, AGL-567).\n */\n\n/** Mapper key for the attributes form (editor-internal, never persisted). */\nexport const TOKEN_TEXT_FIELD_COMPONENT = 'aglyn-token-text-field'\n\n/** Imperative surface ops the field chrome (menus) drives. */\nexport interface TokenEditableHandle {\n /** Current selection in unit offsets, or null when unfocused/outside. */\n captureSelection(): { start: number; end: number } | null\n /** Splices a token at the captured units (null capture appends). */\n insertToken(token: string, capture: { start: number; end: number } | null): void\n /** Swaps the nth token segment for a new token, in place. */\n replaceTokenAt(tokenIndex: number, token: string): void\n /** Deletes the nth token segment from the value. */\n removeTokenAt(tokenIndex: number): void\n}\n\ninterface TokenEditableInputProps {\n /** Serialized field value (raw token grammar). */\n /** Typed loosely on purpose: a schema `initialValue` can be a number. */\n tokenValue: string | number | null\n onTokenValueChange: (next: string) => void\n multiline?: boolean\n labelContextRef: MutableRefObject<TokenLabelContext>\n handleRef: MutableRefObject<TokenEditableHandle | null>\n onPillClick: (anchor: HTMLElement, tokenIndex: number, token: string) => void\n // Injected by MUI InputBase:\n className?: string\n disabled?: boolean\n placeholder?: string\n onFocus?: (event: FocusEvent<HTMLDivElement>) => void\n onBlur?: (event: FocusEvent<HTMLDivElement>) => void\n 'aria-invalid'?: boolean\n 'aria-describedby'?: string\n}\n\nconst renderSegments = (\n segments: TokenSegment[],\n labelContext: TokenLabelContext,\n): ReactNode =>\n segments.map((segment, index) =>\n segment.type === 'token' ? (\n <TokenPill\n key={index}\n token={segment.token ?? segment.value}\n resolved={resolveTokenLabel(segment.token ?? segment.value, labelContext)}\n />\n ) : (\n segment.value\n ),\n )\n\n/**\n * The contentEditable input rendered INSIDE MUI's InputBase (via\n * `inputComponent`), so the border, label notch, focus ring and disabled\n * styling all come from the real TextField machinery.\n */\n/**\n * Exported for the AGL-2486 regression test only — a numeric model value must\n * not spin this into \"Maximum update depth exceeded\". `TokenTextField` needs a\n * `<Form>` context (`useFieldApi`), so the loop cannot be reached through it\n * without standing up react-form-renderer around a bug that lives entirely in\n * this inner component.\n */\nexport const TokenEditableInput = memo(\n forwardRef<unknown, TokenEditableInputProps>(function TokenEditableInput(\n props,\n ref,\n ) {\n const {\n tokenValue: rawTokenValue,\n onTokenValueChange,\n multiline,\n labelContextRef,\n handleRef,\n onPillClick,\n className,\n disabled,\n placeholder,\n onFocus,\n onBlur,\n ...rest\n } = props\n /**\n * The model value as TEXT, whatever the schema actually stored.\n *\n * `tokenValue` is typed `string`, but `strictNullChecks` is off repo-wide\n * and a schema's `initialValue` reaches this untouched — so a numeric\n * default arrives as a NUMBER. That was not hypothetical: the element\n * animation fields (AGL-2486) declare `TEXT_FIELD` with\n * `ANIMATION_DEFAULT_DURATION_MS = 600` and `ANIMATION_DEFAULT_DELAY_MS =\n * 0`, and the attributes memo rewrites TEXT_FIELD to this editor.\n *\n * The damage was an INFINITE RENDER LOOP, not a mis-render. `emit`\n * serializes segments and stores a STRING in `lastEmittedRef`, and the\n * sync effect below skips on `tokenValue === lastEmittedRef.current`.\n * `600 === '600'` is false, so the guard never held: every render\n * re-parsed the model and bumped `version`, and React eventually threw\n * \"Maximum update depth exceeded\".\n *\n * Coerced at the boundary rather than fixed at the one call site, because\n * the next numeric default would reintroduce it. `null`/`undefined`\n * become `''` explicitly — `String(null)` is the string \"null\", which\n * would render the word in the box, and `0` must survive as \"0\" rather\n * than being swallowed as falsy.\n */\n const tokenValue =\n typeof rawTokenValue === 'string'\n ? rawTokenValue\n : rawTokenValue === null || rawTokenValue === undefined\n ? ''\n : String(rawTokenValue)\n\n const editableRef = useRef<HTMLDivElement | null>(null)\n const segmentsRef = useRef<TokenSegment[] | null>(null)\n if (segmentsRef.current == null) {\n segmentsRef.current = parseTokenSegments(tokenValue)\n }\n const lastEmittedRef = useRef(tokenValue)\n const pendingSelectionRef = useRef<{ start: number; end: number } | null>(\n null,\n )\n const [version, setVersion] = useState(0)\n\n // MUI focuses the input through `inputRef` on label clicks; `.value`\n // keeps InputBase's filled-state probe from reading `undefined`.\n useImperativeHandle(ref, () => ({\n focus: () => editableRef.current?.focus(),\n get value() {\n return lastEmittedRef.current\n },\n node: editableRef.current,\n }))\n\n // External value changes (form reset, AI rewrite, undo at canvas\n // level): anything this surface didn't just emit re-parses the model.\n useEffect(() => {\n if (tokenValue === lastEmittedRef.current) return\n segmentsRef.current = parseTokenSegments(tokenValue)\n lastEmittedRef.current = tokenValue\n pendingSelectionRef.current = null\n setVersion((current) => current + 1)\n }, [tokenValue])\n\n const emit = useCallback(\n (segments: TokenSegment[]) => {\n segmentsRef.current = segments\n let serialized = serializeTokenSegments(segments)\n // An emptied contentEditable leaves a stray <br> behind in most\n // browsers — a value that is exactly one newline means \"empty\".\n if (serialized === '\\n') serialized = ''\n lastEmittedRef.current = serialized\n onTokenValueChange(serialized)\n return serialized\n },\n [onTokenValueChange],\n )\n\n /** Structural edit: re-render from the model + restore the caret. */\n const commitStructural = useCallback(\n (\n segments: TokenSegment[],\n selection: { start: number; end: number } | null,\n ) => {\n emit(segments)\n pendingSelectionRef.current = selection\n setVersion((current) => current + 1)\n },\n [emit],\n )\n\n useLayoutEffect(() => {\n const pending = pendingSelectionRef.current\n if (!pending || !editableRef.current) return\n pendingSelectionRef.current = null\n editableRef.current.focus()\n setSelectionUnits(editableRef.current, pending.start, pending.end)\n }, [version])\n\n // Plain typing: silent model sync — no re-render, the DOM is already\n // correct and the caret must not move (AGL-582 pattern).\n const handleInput = useCallback(\n (_event: FormEvent<HTMLDivElement>) => {\n if (!editableRef.current) return\n emit(readTokenSegmentsFromDom(editableRef.current))\n },\n [emit],\n )\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Enter' || event.nativeEvent.isComposing) return\n // Single-line surfaces swallow Enter (a contentEditable would\n // otherwise fork the DOM into divs); multiline inserts a literal\n // newline as a model edit so the DOM stays flat text + pills.\n event.preventDefault()\n if (!multiline || !editableRef.current) return\n const current = readTokenSegmentsFromDom(editableRef.current)\n const selection = selectionUnitsWithin(editableRef.current)\n const { segments, caretUnit } = spliceSegmentsAtUnits(\n current,\n [textSegment('\\n')],\n selection?.start ?? null,\n selection?.end ?? null,\n )\n commitStructural(segments, { start: caretUnit, end: caretUnit })\n },\n [commitStructural, multiline],\n )\n\n // Paste is plain-text only; pasted `{{...}}` materializes immediately\n // (the paste is already a structural, selection-restoring edit).\n const handlePaste = useCallback(\n (event: ClipboardEvent<HTMLDivElement>) => {\n event.preventDefault()\n if (!editableRef.current) return\n const raw = event.clipboardData?.getData('text/plain') ?? ''\n if (!raw) return\n const text = multiline ? raw : raw.replace(/\\s*\\n+\\s*/g, ' ')\n const current = readTokenSegmentsFromDom(editableRef.current)\n const selection = selectionUnitsWithin(editableRef.current)\n const { segments, caretUnit } = spliceSegmentsAtUnits(\n current,\n parseTokenSegments(text),\n selection?.start ?? null,\n selection?.end ?? null,\n )\n commitStructural(segments, { start: caretUnit, end: caretUnit })\n },\n [commitStructural, multiline],\n )\n\n // Raw `{{...}}` typed by hand becomes a pill when focus leaves — the\n // least caret-disruptive point (see the component doc block).\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n onBlur?.(event)\n const segments = segmentsRef.current ?? []\n if (!hasUnmaterializedTokens(segments)) return\n commitStructural(\n parseTokenSegments(serializeTokenSegments(segments)),\n null,\n )\n },\n [commitStructural, onBlur],\n )\n\n // Pill clicks bubble to the surface (delegation keeps pills dumb).\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n const pill = (event.target as HTMLElement).closest?.(\n `[${TOKEN_PILL_ATTR}]`,\n ) as HTMLElement | null\n if (!pill || !editableRef.current?.contains(pill)) return\n const pills = Array.from(\n editableRef.current.querySelectorAll(`[${TOKEN_PILL_ATTR}]`),\n )\n onPillClick(\n pill,\n pills.indexOf(pill),\n pill.getAttribute(TOKEN_PILL_ATTR) ?? '',\n )\n },\n [onPillClick],\n )\n\n /** Index (within segments) of the nth token segment. */\n const segmentIndexOfToken = (tokenIndex: number): number => {\n const segments = segmentsRef.current ?? []\n let seen = -1\n for (let index = 0; index < segments.length; index++) {\n if (segments[index]?.type === 'token' && ++seen === tokenIndex) {\n return index\n }\n }\n return -1\n }\n\n useImperativeHandle(\n handleRef,\n (): TokenEditableHandle => ({\n captureSelection: () =>\n editableRef.current ? selectionUnitsWithin(editableRef.current) : null,\n insertToken: (token, capture) => {\n const { segments, caretUnit } = spliceSegmentsAtUnits(\n segmentsRef.current ?? [],\n [tokenSegment(token)],\n capture?.start ?? null,\n capture?.end ?? null,\n )\n commitStructural(segments, { start: caretUnit, end: caretUnit })\n },\n replaceTokenAt: (tokenIndex, token) => {\n const index = segmentIndexOfToken(tokenIndex)\n if (index < 0) return\n const segments = [...(segmentsRef.current ?? [])]\n segments[index] = tokenSegment(token)\n commitStructural(segments, null)\n },\n removeTokenAt: (tokenIndex) => {\n const index = segmentIndexOfToken(tokenIndex)\n if (index < 0) return\n const segments = [...(segmentsRef.current ?? [])]\n segments.splice(index, 1)\n commitStructural(segments, null)\n },\n }),\n [commitStructural],\n )\n\n // Children are FROZEN per version (AGL-582 pattern): parent re-renders\n // (form state changes every keystroke) receive identical element\n // references, so React never touches the browser-managed DOM. A\n // version bump swaps the key, remounting cleanly from the model.\n // Label context is read at render time; renamed variables re-label on\n // the next structural edit rather than yanking the caret mid-typing.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const children = useMemo(\n () => renderSegments(segmentsRef.current ?? [], labelContextRef.current),\n [version],\n )\n\n return (\n <Box\n key={version}\n ref={editableRef}\n component=\"div\"\n contentEditable={!disabled}\n suppressContentEditableWarning\n role=\"textbox\"\n aria-multiline={Boolean(multiline)}\n data-placeholder={placeholder ?? ''}\n data-testid=\"token-text-field\"\n className={className}\n onInput={handleInput}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n onFocus={onFocus}\n onBlur={handleBlur}\n onClick={handleClick}\n {...rest}\n sx={{\n outline: 'none',\n width: '100%',\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-word',\n minHeight: multiline ? '4.5em' : undefined,\n '&:empty::before': {\n content: 'attr(data-placeholder)',\n color: 'text.disabled',\n },\n ...tokenPillContainerSx,\n }}\n >\n {children}\n </Box>\n )\n }),\n)\n\nexport interface TokenTextFieldProps {\n [key: string]: unknown\n placeholder?: string\n multiline?: boolean\n tokenOptions?: BindingOption[]\n tokenLabelContext?: TokenLabelContext\n FormFieldGridProps?: FormFieldGridProps\n /**\n * Opens the host app's media browser for THIS field (AGL-2236). Supplied\n * by the attributes panel for media-bearing attributes only, so a field\n * that cannot hold an asset never grows a control that would write one.\n */\n onBrowseMedia?: () => void\n}\n\n/**\n * The \"Browse media\" end adornment (AGL-2236).\n *\n * The control every `src` field's helper text has named since AGL-1215 —\n * \"Pick from your media library with 'Browse media'\" — and which, until now,\n * lived at the BOTTOM of the Attributes panel, below the Save Element\n * button, separated from the field it fills by every other attribute the\n * element declares. On the Image element that is six fields and a submit\n * button of scroll, and with a single media attribute the button read only\n * \"Browse media\", naming no field. Authors reported it as missing, which for\n * a no-code product it effectively was: the documented way to change an\n * image was to hand-type a `media:org:…/…` reference.\n *\n * Mousedown is prevented so the field keeps focus while the dialog opens —\n * the same reason {@link InsertTokenAdornment} does it. Losing focus here\n * would flush the AGL-567 debounce and commit a half-typed value on the way\n * to picking a different one.\n */\nexport function BrowseMediaAdornment(props: { onBrowse: () => void }) {\n const { onBrowse } = props\n return (\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"Browse media\"\n title=\"Browse media\"\n size=\"small\"\n edge=\"end\"\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onBrowse()}\n >\n <MdiIcon path={mdiImageSearch.path} fontSize=\"small\" />\n </IconButton>\n </InputAdornment>\n )\n}\nBrowseMediaAdornment.displayName = 'BrowseMediaAdornment'\n\n/**\n * The data-driven-forms field (registered as\n * {@link TOKEN_TEXT_FIELD_COMPONENT} in the attributes mapper). The\n * serialized string flows through react-final-form exactly like the plain\n * TextField it replaces — the AGL-567 debounced autosave sees ordinary\n * value changes and commits through the existing path.\n */\nexport const TokenTextField = (props: TokenTextFieldProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n placeholder,\n isRequired,\n label,\n helperText,\n description,\n validateOnMount,\n meta,\n multiline,\n tokenOptions = [],\n tokenLabelContext = {},\n FormFieldGridProps = {},\n // Destructured, never spread onto the input: it is a function, and\n // `...rest` lands on a DOM element.\n onBrowseMedia,\n // Swallowed: htmlInput props from legacy schemas don't apply to a\n // contentEditable surface.\n inputProps: _inputProps,\n ...rest\n } = useFieldApi(props as never) as Record<string, any>\n const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount)\n // The site's approved image hosts, for the media warning below. Read from\n // the SAME context that supplies \"Browse media\", so a designer mounted\n // without a media provider simply has no list and warns about nothing.\n const { approvedImageHosts } = useContext(MediaPickerContext)\n\n const handleRef = useRef<TokenEditableHandle | null>(null)\n // Ref so the frozen editable children read fresh labels at render time\n // without re-rendering on every context identity change.\n const labelContextRef = useRef<TokenLabelContext>(tokenLabelContext)\n labelContextRef.current = tokenLabelContext\n\n const [insertMenu, setInsertMenu] = useState<{\n anchorEl: HTMLElement\n capture: { start: number; end: number } | null\n replaceIndex: number | null\n } | null>(null)\n const [pillMenu, setPillMenu] = useState<{\n anchorEl: HTMLElement\n tokenIndex: number\n token: string\n } | null>(null)\n\n const value =\n typeof input.value === 'string'\n ? input.value\n : input.value == null\n ? ''\n : String(input.value)\n\n const handleOpenInsert = useCallback((anchor: HTMLElement) => {\n // The adornment's mousedown is prevented (AGL-583), so the surface\n // selection is still live here — capture it in unit offsets.\n setInsertMenu({\n anchorEl: anchor,\n capture: handleRef.current?.captureSelection() ?? null,\n replaceIndex: null,\n })\n }, [])\n\n const handleInsert = useCallback(\n (token: string) => {\n if (insertMenu?.replaceIndex != null) {\n handleRef.current?.replaceTokenAt(insertMenu.replaceIndex, token)\n } else {\n handleRef.current?.insertToken(token, insertMenu?.capture ?? null)\n }\n setInsertMenu(null)\n },\n [insertMenu],\n )\n\n const handlePillClick = useCallback(\n (anchorEl: HTMLElement, tokenIndex: number, token: string) => {\n setPillMenu({ anchorEl, tokenIndex, token })\n },\n [],\n )\n\n const handlePillReplace = useCallback(() => {\n if (pillMenu) {\n setInsertMenu({\n anchorEl: pillMenu.anchorEl,\n capture: null,\n replaceIndex: pillMenu.tokenIndex,\n })\n }\n setPillMenu(null)\n }, [pillMenu])\n\n const handlePillRemove = useCallback(() => {\n if (pillMenu) handleRef.current?.removeTokenAt(pillMenu.tokenIndex)\n setPillMenu(null)\n }, [pillMenu])\n\n /**\n * \"This image will be blocked on the published page\" (AGL-1152).\n *\n * The published site's `img-src` is built from the owner's approved-host\n * list, so an external URL from a host they have not approved renders as a\n * broken image for every visitor — and the author is the last person who\n * would find out, because the besigner canvas has no such policy. Saying it\n * HERE, at the moment the URL is typed, is the whole reason enforcing the\n * policy is safe to do at all.\n *\n * Deliberately a WARNING, not a validation error: the value is legitimate,\n * the author may be about to approve the host, and refusing the keystroke\n * would make the picker unusable while they do. It also never fires on:\n *\n * - a non-media field (`onBrowseMedia` is the discriminator the panel\n * already uses for \"this attribute holds media\");\n * - a relative path, a `media:` reference, a `data:`/`blob:` URL, or\n * anything unparseable — none of those reach an external host;\n * - a token-bearing value, because `{{...}}` resolves at render and the\n * host is not knowable here;\n * - ANY value when the list is not known (see the context docs), because a\n * warning that fires on everything is one authors learn to ignore.\n */\n const externalHostWarning = useMemo(() => {\n if (!onBrowseMedia) return null\n if (!approvedImageHosts) return null\n const raw = typeof value === 'string' ? value.trim() : ''\n if (!raw || raw.includes('{{')) return null\n if (!/^https?:\\/\\//i.test(raw)) return null\n let hostname = ''\n try {\n hostname = new URL(raw).hostname.toLowerCase()\n } catch {\n return null\n }\n if (!hostname) return null\n // Same-origin and the pinned Storage host are always served.\n if (hostname === 'firebasestorage.googleapis.com') return null\n const approved = approvedImageHosts.some((entry) => {\n const candidate = String(entry ?? '').trim().toLowerCase()\n if (!candidate) return false\n if (candidate.startsWith('*.')) {\n const suffix = candidate.slice(1) // \".example.com\"\n return hostname.endsWith(suffix)\n }\n return hostname === candidate\n })\n if (approved) return null\n return `${hostname} is not an approved image host for this site, so this image will not load for visitors. Add it under Setup → Approved image hosts.`\n }, [onBrowseMedia, approvedImageHosts, value])\n\n return (\n <FormFieldGrid {...FormFieldGridProps}>\n <MuiTextField\n fullWidth\n error={!!invalid}\n helperText={\n invalid ||\n ((meta.touched || validateOnMount) && meta.warning) ||\n externalHostWarning ||\n helperText ||\n description\n }\n disabled={isDisabled}\n label={label}\n required={isRequired}\n onFocus={input.onFocus}\n onBlur={input.onBlur}\n slotProps={{\n // The surface holds pills, not text MUI can measure — keep the\n // label out of the way permanently.\n inputLabel: { shrink: true },\n input: {\n readOnly: isReadOnly,\n // The surface is a contentEditable that WRAPS, but MUI's\n // single-line input root is a fixed-height flex row (AGL-1214).\n // A long unbroken value — a media URL is the common case —\n // painted straight through the outline and over the next\n // field's label. Let the root grow, and keep the token-insert\n // adornment pinned to the first line rather than centred\n // against a now-tall box.\n sx: {\n height: 'auto',\n alignItems: 'flex-start',\n // The contentEditable IS `.MuiInputBase-input`, and MUI pins\n // that to one line's height for a non-multiline field. The\n // surface wraps regardless, so the content just painted\n // outside the outline. Cap it and scroll instead of letting a\n // long URL push the panel around.\n '& .MuiInputBase-input': {\n height: 'auto',\n maxHeight: '8.5em',\n overflowY: 'auto',\n },\n '& .MuiInputAdornment-root': { mt: '4px' },\n },\n inputComponent: TokenEditableInput as never,\n inputProps: {\n tokenValue: value,\n onTokenValueChange: input.onChange,\n multiline: Boolean(multiline),\n labelContextRef,\n handleRef,\n onPillClick: handlePillClick,\n placeholder,\n disabled: isDisabled || isReadOnly,\n },\n endAdornment: (\n <>\n {/* Media-bearing attributes only (AGL-2236) — the control\n the field's own helper text names, on the field. */}\n {onBrowseMedia ? (\n <BrowseMediaAdornment onBrowse={onBrowseMedia} />\n ) : null}\n <InsertTokenAdornment\n onOpen={(anchor) => handleOpenInsert(anchor)}\n />\n </>\n ),\n },\n }}\n {...rest}\n />\n <InsertTokenMenu\n anchorEl={insertMenu?.anchorEl ?? null}\n open={Boolean(insertMenu)}\n onClose={() => setInsertMenu(null)}\n options={tokenOptions}\n onInsert={handleInsert}\n />\n <TokenPillPopover\n anchorEl={pillMenu?.anchorEl ?? null}\n token={pillMenu?.token ?? ''}\n onClose={() => setPillMenu(null)}\n onReplace={handlePillReplace}\n onRemove={handlePillRemove}\n />\n </FormFieldGrid>\n )\n}\nTokenTextField.displayName = 'TokenTextField'\n\nexport default TokenTextField\n"],"names":["FormFieldGrid","useFieldApi","validationError","mdiImageSearch","MdiIcon","Box","IconButton","InputAdornment","TextField","MuiTextField","useContext","forwardRef","memo","useCallback","useEffect","useImperativeHandle","useLayoutEffect","useMemo","useRef","useState","MediaPickerContext","readTokenSegmentsFromDom","selectionUnitsWithin","setSelectionUnits","TOKEN_PILL_ATTR","hasUnmaterializedTokens","parseTokenSegments","serializeTokenSegments","spliceSegmentsAtUnits","textSegment","tokenSegment","resolveTokenLabel","InsertTokenAdornment","InsertTokenMenu","TokenPill","TokenPillPopover","tokenPillContainerSx","TOKEN_TEXT_FIELD_COMPONENT","renderSegments","segments","labelContext","map","segment","index","type","token","value","resolved","TokenEditableInput","props","ref","tokenValue","rawTokenValue","onTokenValueChange","multiline","labelContextRef","handleRef","onPillClick","className","disabled","placeholder","onFocus","onBlur","rest","undefined","String","editableRef","segmentsRef","current","lastEmittedRef","pendingSelectionRef","version","setVersion","focus","node","emit","serialized","commitStructural","selection","pending","start","end","handleInput","_event","handleKeyDown","event","key","nativeEvent","isComposing","preventDefault","caretUnit","handlePaste","raw","clipboardData","getData","text","replace","handleBlur","handleClick","pill","target","closest","contains","pills","Array","from","querySelectorAll","indexOf","getAttribute","segmentIndexOfToken","tokenIndex","seen","length","captureSelection","insertToken","capture","replaceTokenAt","removeTokenAt","splice","children","component","contentEditable","suppressContentEditableWarning","role","aria-multiline","Boolean","data-placeholder","data-testid","onInput","onKeyDown","onPaste","onClick","sx","outline","width","whiteSpace","wordBreak","minHeight","content","color","BrowseMediaAdornment","onBrowse","position","aria-label","title","size","edge","onMouseDown","path","fontSize","displayName","TokenTextField","input","isReadOnly","isDisabled","isRequired","label","helperText","description","validateOnMount","meta","tokenOptions","tokenLabelContext","FormFieldGridProps","onBrowseMedia","inputProps","_inputProps","invalid","approvedImageHosts","insertMenu","setInsertMenu","pillMenu","setPillMenu","handleOpenInsert","anchor","anchorEl","replaceIndex","handleInsert","handlePillClick","handlePillReplace","handlePillRemove","externalHostWarning","trim","includes","test","hostname","URL","toLowerCase","approved","some","entry","candidate","startsWith","suffix","slice","endsWith","fullWidth","error","touched","warning","required","slotProps","inputLabel","shrink","readOnly","height","alignItems","maxHeight","overflowY","mt","inputComponent","onChange","endAdornment","onOpen","open","onClose","options","onInsert","onReplace","onRemove"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,aAAa,EAEbC,WAAW,EACXC,eAAe,QAEV,6BAA4B;AACnC,SAASC,cAAc,QAAQ,yBAAwB;AACvD,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,SACEC,GAAG,EACHC,UAAU,EACVC,cAAc,EACdC,aAAaC,YAAY,QACpB,gBAAe;AACtB,SAASC,UAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,eAAe,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAA0I,QAAO;AAE/Q,OAAOC,wBAAwB,sCAAkC;AAEjE,SACEC,wBAAwB,EACxBC,oBAAoB,EACpBC,iBAAiB,EACjBC,eAAe,QACV,iCAA6B;AACpC,SACEC,uBAAuB,EACvBC,kBAAkB,EAClBC,sBAAsB,EACtBC,qBAAqB,EACrBC,WAAW,EACXC,YAAY,EACZC,iBAAiB,QAGZ,6BAAyB;AAChC,SACEC,oBAAoB,EACpBC,eAAe,QACV,mCAA+B;AACtC,SACEC,SAAS,EACTC,gBAAgB,EAChBC,oBAAoB,QACf,4BAAwB;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;C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SAASvD;gBACTwD,UAAUxC;;0BAEZ,KAAC9I;gBACC4I,QAAQ,WAAEJ,4BAAAA,SAAUI,QAAQ,oBAAI;gBAChClI,KAAK,WAAE8H,4BAAAA,SAAU9H,KAAK,oBAAI;gBAC1B0K,SAAS,IAAM3C,YAAY;gBAC3B8C,WAAWvC;gBACXwC,UAAUvC;;;;AAIlB,EAAC;AACD7B,eAAeD,WAAW,GAAG;AAE7B,eAAeC,eAAc"}
@@ -0,0 +1,6 @@
1
+ import { type ListProps } from '@mui/material';
2
+ export interface TreeListProps<T> extends ListProps {
3
+ items: T[];
4
+ }
5
+ export declare const TreeList: import("react").FunctionComponent<Omit<TreeListProps<unknown>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
6
+ export default TreeList;
@@ -0,0 +1,108 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ /**
5
+ * @license
6
+ * Copyright 2023 Aglyn LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */ import { generateComponentClassKeys, styled } from "@aglyn/shared-ui-theme";
20
+ import { List as MuiList, listItemButtonClasses, listItemClasses } from "@mui/material";
21
+ import { observer } from "mobx-react-lite";
22
+ import { forwardRef } from "react";
23
+ const classKey = generateComponentClassKeys('TreeList', [
24
+ 'root',
25
+ 'subTreeView',
26
+ 'treeItem',
27
+ 'treeListItem',
28
+ 'dragHandle',
29
+ 'itemSelected',
30
+ 'itemHovered',
31
+ 'itemIsDragging',
32
+ 'itemIsDragOver'
33
+ ]);
34
+ const List = styled(MuiList)(({ theme })=>({
35
+ alignItems: 'stretch',
36
+ flexDirection: 'column',
37
+ width: 'fit-content',
38
+ minWidth: '100%',
39
+ [`& .${listItemButtonClasses.root}`]: {
40
+ zIndex: 0,
41
+ paddingTop: 0,
42
+ paddingBottom: 0,
43
+ // paddingLeft: 0,
44
+ borderTopLeftRadius: 4,
45
+ borderBottomLeftRadius: 4,
46
+ [[
47
+ `&:hover`,
48
+ `&.${listItemButtonClasses.focusVisible}`,
49
+ `&.${listItemButtonClasses.selected}`,
50
+ `&.${classKey.itemSelected}`
51
+ ].join(',')]: {
52
+ backgroundColor: 'transparent'
53
+ }
54
+ },
55
+ [`& .${listItemClasses.root}`]: {
56
+ alignItems: 'stretch',
57
+ flexDirection: 'column',
58
+ borderTopLeftRadius: 4,
59
+ borderBottomLeftRadius: 4,
60
+ [`> .${classKey.treeListItem}`]: {
61
+ borderTopLeftRadius: 4,
62
+ borderBottomLeftRadius: 4,
63
+ [`& .${classKey.dragHandle}`]: {
64
+ visibility: 'hidden'
65
+ },
66
+ [`&:hover, &.${classKey.itemHovered}`]: {
67
+ [`& .${classKey.dragHandle}`]: {
68
+ visibility: 'visible'
69
+ },
70
+ backgroundColor: `rgba(${theme.vars.palette.primary.darkChannel} / calc(${theme.vars.palette.action.hoverOpacity} + 0.2))`,
71
+ [`&:has(> .${listItemButtonClasses.focusVisible})`]: {
72
+ backgroundColor: `rgba(${theme.vars.palette.primary.darkChannel} / calc(${theme.vars.palette.action.focusOpacity} + 0.3))`
73
+ }
74
+ },
75
+ [`&:has(> .${listItemButtonClasses.focusVisible})`]: {
76
+ backgroundColor: `rgba(${theme.vars.palette.primary.darkChannel} / calc(${theme.vars.palette.action.focusOpacity} + 0.2))`
77
+ }
78
+ },
79
+ [`&.${classKey.itemSelected}`]: {
80
+ [`> .${classKey.treeListItem}`]: {
81
+ backgroundColor: `rgba(${theme.vars.palette.secondary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})`,
82
+ [`&:hover, &.${classKey.itemHovered}`]: {
83
+ backgroundColor: `rgba(${theme.vars.palette.secondary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + 0.2))`,
84
+ [`&:has(> .${listItemButtonClasses.focusVisible})`]: {
85
+ backgroundColor: `rgba(${theme.vars.palette.secondary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + 0.2))`
86
+ }
87
+ },
88
+ [`&:has(> .${listItemButtonClasses.focusVisible})`]: {
89
+ backgroundColor: `rgba(${theme.vars.palette.secondary.mainChannel} / ${theme.vars.palette.action.activatedOpacity})`
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }));
95
+ List.displayName = 'List';
96
+ export const TreeList = observer(/*#__PURE__*/ forwardRef((props, ref)=>{
97
+ const { children, items } = props, rest = _object_without_properties_loose(props, [
98
+ "children",
99
+ "items"
100
+ ]);
101
+ return /*#__PURE__*/ _jsx(List, _extends({
102
+ ref: ref
103
+ }, rest));
104
+ }));
105
+ TreeList.displayName = 'TreeList';
106
+ export default TreeList;
107
+
108
+ //# sourceMappingURL=tree-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../libs/besigner/feature/designer/src/lib/components/tree/tree-list.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 */\nimport { generateComponentClassKeys, styled } from '@aglyn/shared-ui-theme'\nimport {\n List as MuiList,\n listItemButtonClasses,\n listItemClasses,\n type ListProps,\n} from '@mui/material'\nimport { observer } from 'mobx-react-lite'\nimport { forwardRef, RefObject } from 'react'\n\nconst classKey = generateComponentClassKeys('TreeList', [\n 'root',\n 'subTreeView',\n 'treeItem',\n 'treeListItem',\n 'dragHandle',\n 'itemSelected',\n 'itemHovered',\n 'itemIsDragging',\n 'itemIsDragOver',\n])\n\nconst List = styled(MuiList)<ListProps>(({ theme }) => ({\n alignItems: 'stretch',\n flexDirection: 'column',\n width: 'fit-content',\n minWidth: '100%',\n\n [`& .${listItemButtonClasses.root}`]: {\n zIndex: 0,\n paddingTop: 0,\n paddingBottom: 0,\n // paddingLeft: 0,\n borderTopLeftRadius: 4,\n borderBottomLeftRadius: 4,\n [[\n `&:hover`,\n `&.${listItemButtonClasses.focusVisible}`,\n `&.${listItemButtonClasses.selected}`,\n `&.${classKey.itemSelected}`,\n ].join(',')]: {\n backgroundColor: 'transparent',\n },\n },\n\n [`& .${listItemClasses.root}`]: {\n alignItems: 'stretch',\n flexDirection: 'column',\n\n borderTopLeftRadius: 4,\n borderBottomLeftRadius: 4,\n\n [`> .${classKey.treeListItem}`]: {\n borderTopLeftRadius: 4,\n borderBottomLeftRadius: 4,\n [`& .${classKey.dragHandle}`]: {\n visibility: 'hidden',\n },\n\n [`&:hover, &.${classKey.itemHovered}`]: {\n [`& .${classKey.dragHandle}`]: {\n visibility: 'visible',\n },\n backgroundColor: `rgba(${(theme as any).vars.palette.primary.darkChannel} / calc(${(theme as any).vars.palette.action.hoverOpacity} + 0.2))`,\n [`&:has(> .${listItemButtonClasses.focusVisible})`]: {\n backgroundColor: `rgba(${(theme as any).vars.palette.primary.darkChannel} / calc(${(theme as any).vars.palette.action.focusOpacity} + 0.3))`,\n },\n },\n [`&:has(> .${listItemButtonClasses.focusVisible})`]: {\n backgroundColor: `rgba(${(theme as any).vars.palette.primary.darkChannel} / calc(${(theme as any).vars.palette.action.focusOpacity} + 0.2))`,\n },\n },\n [`&.${classKey.itemSelected}`]: {\n [`> .${classKey.treeListItem}`]: {\n backgroundColor: `rgba(${(theme as any).vars.palette.secondary.mainChannel} / ${(theme as any).vars.palette.action.selectedOpacity})`,\n\n [`&:hover, &.${classKey.itemHovered}`]: {\n backgroundColor: `rgba(${(theme as any).vars.palette.secondary.mainChannel} / calc(${(theme as any).vars.palette.action.selectedOpacity} + 0.2))`,\n\n [`&:has(> .${listItemButtonClasses.focusVisible})`]: {\n backgroundColor: `rgba(${(theme as any).vars.palette.secondary.mainChannel} / calc(${(theme as any).vars.palette.action.selectedOpacity} + 0.2))`,\n },\n },\n [`&:has(> .${listItemButtonClasses.focusVisible})`]: {\n backgroundColor: `rgba(${(theme as any).vars.palette.secondary.mainChannel} / ${(theme as any).vars.palette.action.activatedOpacity})`,\n },\n },\n },\n },\n}))\nList.displayName = 'List'\n\nexport interface TreeListProps<T> extends ListProps {\n items: T[]\n}\n\nexport const TreeList = observer(\n forwardRef(\n <T,>(props: TreeListProps<T>, ref: RefObject<HTMLUListElement>) => {\n const { children, items, ...rest } = props\n return <List ref={ref} {...rest}></List>\n },\n ),\n)\nTreeList.displayName = 'TreeList'\n\nexport default TreeList\n"],"names":["generateComponentClassKeys","styled","List","MuiList","listItemButtonClasses","listItemClasses","observer","forwardRef","classKey","theme","alignItems","flexDirection","width","minWidth","root","zIndex","paddingTop","paddingBottom","borderTopLeftRadius","borderBottomLeftRadius","focusVisible","selected","itemSelected","join","backgroundColor","treeListItem","dragHandle","visibility","itemHovered","vars","palette","primary","darkChannel","action","hoverOpacity","focusOpacity","secondary","mainChannel","selectedOpacity","activatedOpacity","displayName","TreeList","props","ref","children","items","rest"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GACD,SAASA,0BAA0B,EAAEC,MAAM,QAAQ,yBAAwB;AAC3E,SACEC,QAAQC,OAAO,EACfC,qBAAqB,EACrBC,eAAe,QAEV,gBAAe;AACtB,SAASC,QAAQ,QAAQ,kBAAiB;AAC1C,SAASC,UAAU,QAAmB,QAAO;AAE7C,MAAMC,WAAWR,2BAA2B,YAAY;IACtD;IACA;IACA;IACA;IACA;I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ACM,SAAS,CAACC,WAAW,CAAC,QAAQ,EAAE,AAAC5B,MAAcoB,IAAI,CAACC,OAAO,CAACG,MAAM,CAACK,eAAe,CAAC,QAAQ,CAAC;wBACnJ;oBACF;oBACA,CAAC,CAAC,SAAS,EAAElC,sBAAsBgB,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;wBACnDI,iBAAiB,CAAC,KAAK,EAAE,AAACf,MAAcoB,IAAI,CAACC,OAAO,CAACM,SAAS,CAACC,WAAW,CAAC,GAAG,EAAE,AAAC5B,MAAcoB,IAAI,CAACC,OAAO,CAACG,MAAM,CAACM,gBAAgB,CAAC,CAAC,CAAC;oBACxI;gBACF;YACF;QACF;IACF,CAAA;AACArC,KAAKsC,WAAW,GAAG;AAMnB,OAAO,MAAMC,WAAWnC,uBACtBC,WACE,CAAKmC,OAAyBC;IAC5B,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAW,GAAGH,OAATI,wCAASJ;;;;IACrC,qBAAO,KAACxC;QAAKyC,KAAKA;OAASG;AAC7B,IAEH;AACDL,SAASD,WAAW,GAAG;AAEvB,eAAeC,SAAQ"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 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 { ComponentProps, type Ref } from 'react';
18
+ declare const ViewportCanvas: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
19
+ export interface ViewportCanvasComponentProps extends ComponentProps<typeof ViewportCanvas> {
20
+ pannerRef?: Ref<any>;
21
+ }
22
+ export declare const ViewportCanvasComponent: import("react").ForwardRefExoticComponent<Omit<ViewportCanvasComponentProps, "ref"> & import("react").RefAttributes<any>>;
23
+ export default ViewportCanvasComponent;
@@ -0,0 +1,128 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * @license
5
+ * Copyright 2023 Aglyn LLC
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */ import * as Besigner from "@aglyn/besigner";
19
+ import { BesignerDeviceFlag, DEVICE_PREVIEW_XS_WIDTH } from "@aglyn/besigner";
20
+ import { LOADING_OVERLAY_ELEMENT } from "@aglyn/shared-ui-jsx/const/prebuilt-components";
21
+ import { generateComponentClassKeys, styled } from "@aglyn/shared-ui-theme";
22
+ import clsx from "clsx";
23
+ import dynamic from "next/dynamic";
24
+ // import {ZoomablePanningComponent} from '@aglyn/shared-ui-jsx'
25
+ import { forwardRef } from "react";
26
+ import useAglynBesignerFlag from "../hooks/use-aglyn-besigner-flag.js";
27
+ const canvasArtboardClassKeys = generateComponentClassKeys('AglynCanvasArtboard', [
28
+ 'responsive',
29
+ 'deviceXs',
30
+ 'deviceSm',
31
+ 'deviceMd',
32
+ 'deviceLg',
33
+ 'deviceXl'
34
+ ]);
35
+ const ViewportCanvas = styled('div', {
36
+ name: 'AglynViewportCanvas'
37
+ })({
38
+ flexGrow: 1,
39
+ // minHeight: '100%',
40
+ width: '100%',
41
+ overflowY: 'auto',
42
+ overflowX: 'auto',
43
+ // display: 'flex',
44
+ // Bound-content marker (AGL-97): elements whose props carry binding
45
+ // tokens get a subtle dotted underline so editors can
46
+ // spot dynamic content whether tokens are shown raw or resolved.
47
+ '& [data-aglyn-bound]': {
48
+ textDecorationLine: 'underline',
49
+ textDecorationStyle: 'dotted',
50
+ textDecorationColor: 'rgba(123, 31, 162, 0.55)',
51
+ textUnderlineOffset: 3
52
+ }
53
+ });
54
+ const ViewportArtboard = styled('div', {
55
+ name: 'AglynViewportArtboard'
56
+ })(({ theme })=>({
57
+ overflow: 'hidden',
58
+ minHeight: '100%',
59
+ padding: theme.spacing(3),
60
+ marginLeft: 'auto',
61
+ marginRight: 'auto',
62
+ display: 'flex',
63
+ flexDirection: 'column',
64
+ transition: theme.transitions.create([
65
+ 'width'
66
+ ], {
67
+ easing: theme.transitions.easing.sharp,
68
+ duration: theme.transitions.duration.leavingScreen
69
+ }),
70
+ [`&, &.${canvasArtboardClassKeys.responsive}`]: {
71
+ width: '100%'
72
+ },
73
+ [`&.${canvasArtboardClassKeys.deviceXs}`]: {
74
+ width: DEVICE_PREVIEW_XS_WIDTH
75
+ },
76
+ [`&.${canvasArtboardClassKeys.deviceSm}`]: {
77
+ width: theme.breakpoints.values.sm
78
+ },
79
+ [`&.${canvasArtboardClassKeys.deviceMd}`]: {
80
+ width: theme.breakpoints.values.md
81
+ },
82
+ [`&.${canvasArtboardClassKeys.deviceLg}`]: {
83
+ width: theme.breakpoints.values.lg
84
+ },
85
+ [`&.${canvasArtboardClassKeys.deviceXl}`]: {
86
+ width: theme.breakpoints.values.xl
87
+ }
88
+ }));
89
+ const ViewportFrameComponent = dynamic(()=>import("./viewport-frame.component.js").then((mod)=>mod.ViewportFrameComponent), {
90
+ ssr: false,
91
+ loading: ()=>LOADING_OVERLAY_ELEMENT
92
+ });
93
+ export const ViewportCanvasComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
94
+ const {} = props, rest = _extends({}, props);
95
+ const [devicePreview] = useAglynBesignerFlag('devicePreview');
96
+ const artboardClass = clsx({
97
+ [canvasArtboardClassKeys.responsive]: BesignerDeviceFlag.RESPONSIVE === devicePreview,
98
+ [canvasArtboardClassKeys.deviceXs]: BesignerDeviceFlag.XS === devicePreview,
99
+ [canvasArtboardClassKeys.deviceSm]: BesignerDeviceFlag.SM === devicePreview,
100
+ [canvasArtboardClassKeys.deviceMd]: BesignerDeviceFlag.MD === devicePreview,
101
+ [canvasArtboardClassKeys.deviceLg]: BesignerDeviceFlag.LG === devicePreview,
102
+ [canvasArtboardClassKeys.deviceXl]: BesignerDeviceFlag.XL === devicePreview
103
+ });
104
+ return /*#__PURE__*/ _jsx(ViewportCanvas, _extends({
105
+ ref: ref,
106
+ id: "aglyn:viewport-canvas",
107
+ onMouseDown: (event)=>{
108
+ // Clicking empty canvas — the panning surface or the artboard's own
109
+ // background (node clicks stop propagation in DraggableDroppable) —
110
+ // deselects all (AGL-12).
111
+ const target = event.target;
112
+ if (target === event.currentTarget || target.id === 'aglyn:viewport-artboard') {
113
+ Besigner.focus.clearSelection();
114
+ }
115
+ }
116
+ }, rest, {
117
+ children: /*#__PURE__*/ _jsx(ViewportArtboard, {
118
+ id: "aglyn:viewport-artboard",
119
+ className: artboardClass,
120
+ children: /*#__PURE__*/ _jsx(ViewportFrameComponent, {})
121
+ })
122
+ }));
123
+ });
124
+ ViewportCanvasComponent.displayName = 'ViewportCanvasComponent';
125
+ ViewportCanvasComponent.aglyn = true;
126
+ export default ViewportCanvasComponent;
127
+
128
+ //# sourceMappingURL=viewport-canvas.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/viewport-canvas.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 * as Besigner from '@aglyn/besigner'\nimport { BesignerDeviceFlag, DEVICE_PREVIEW_XS_WIDTH } from '@aglyn/besigner'\nimport { LOADING_OVERLAY_ELEMENT } from '@aglyn/shared-ui-jsx/const/prebuilt-components'\nimport { generateComponentClassKeys, styled } from '@aglyn/shared-ui-theme'\nimport clsx from 'clsx'\nimport dynamic from 'next/dynamic'\n// import {ZoomablePanningComponent} from '@aglyn/shared-ui-jsx'\nimport { ComponentProps, forwardRef, type Ref } from 'react'\nimport useAglynBesignerFlag from '../hooks/use-aglyn-besigner-flag'\nimport type { ViewportFrameComponentProps } from './viewport-frame.component'\n\nconst canvasArtboardClassKeys = generateComponentClassKeys(\n 'AglynCanvasArtboard',\n ['responsive', 'deviceXs', 'deviceSm', 'deviceMd', 'deviceLg', 'deviceXl'],\n)\n\nconst ViewportCanvas = styled('div', {\n name: 'AglynViewportCanvas',\n})({\n flexGrow: 1,\n // minHeight: '100%',\n width: '100%',\n overflowY: 'auto',\n overflowX: 'auto',\n // display: 'flex',\n // Bound-content marker (AGL-97): elements whose props carry binding\n // tokens get a subtle dotted underline so editors can\n // spot dynamic content whether tokens are shown raw or resolved.\n '& [data-aglyn-bound]': {\n textDecorationLine: 'underline',\n textDecorationStyle: 'dotted',\n textDecorationColor: 'rgba(123, 31, 162, 0.55)',\n textUnderlineOffset: 3,\n },\n})\n\nconst ViewportArtboard = styled('div', {\n name: 'AglynViewportArtboard',\n})(({ theme }) => ({\n overflow: 'hidden',\n minHeight: '100%',\n padding: theme.spacing(3),\n marginLeft: 'auto',\n marginRight: 'auto',\n display: 'flex',\n flexDirection: 'column',\n transition: theme.transitions.create(['width'], {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n [`&, &.${canvasArtboardClassKeys.responsive}`]: { width: '100%' },\n [`&.${canvasArtboardClassKeys.deviceXs}`]: {\n width: DEVICE_PREVIEW_XS_WIDTH,\n },\n [`&.${canvasArtboardClassKeys.deviceSm}`]: {\n width: theme.breakpoints.values.sm,\n },\n [`&.${canvasArtboardClassKeys.deviceMd}`]: {\n width: theme.breakpoints.values.md,\n },\n [`&.${canvasArtboardClassKeys.deviceLg}`]: {\n width: theme.breakpoints.values.lg,\n },\n [`&.${canvasArtboardClassKeys.deviceXl}`]: {\n width: theme.breakpoints.values.xl,\n },\n}))\n\nconst ViewportFrameComponent = dynamic<ViewportFrameComponentProps>(\n () =>\n import('./viewport-frame.component').then(\n (mod) => mod.ViewportFrameComponent,\n ),\n { ssr: false, loading: () => LOADING_OVERLAY_ELEMENT },\n)\n\nexport interface ViewportCanvasComponentProps\n extends ComponentProps<typeof ViewportCanvas> {\n pannerRef?: Ref<any>\n}\n\nexport const ViewportCanvasComponent = forwardRef<\n any,\n ViewportCanvasComponentProps\n>((props, ref) => {\n const { ...rest } = props\n\n const [devicePreview] = useAglynBesignerFlag('devicePreview')\n const artboardClass = clsx({\n [canvasArtboardClassKeys.responsive]:\n BesignerDeviceFlag.RESPONSIVE === devicePreview,\n [canvasArtboardClassKeys.deviceXs]: BesignerDeviceFlag.XS === devicePreview,\n [canvasArtboardClassKeys.deviceSm]: BesignerDeviceFlag.SM === devicePreview,\n [canvasArtboardClassKeys.deviceMd]: BesignerDeviceFlag.MD === devicePreview,\n [canvasArtboardClassKeys.deviceLg]: BesignerDeviceFlag.LG === devicePreview,\n [canvasArtboardClassKeys.deviceXl]: BesignerDeviceFlag.XL === devicePreview,\n })\n\n return (\n <ViewportCanvas\n ref={ref}\n id=\"aglyn:viewport-canvas\"\n onMouseDown={(event) => {\n // Clicking empty canvas — the panning surface or the artboard's own\n // background (node clicks stop propagation in DraggableDroppable) —\n // deselects all (AGL-12).\n const target = event.target as HTMLElement\n if (\n target === event.currentTarget ||\n target.id === 'aglyn:viewport-artboard'\n ) {\n Besigner.focus.clearSelection()\n }\n }}\n {...rest}\n >\n <ViewportArtboard id=\"aglyn:viewport-artboard\" className={artboardClass}>\n <ViewportFrameComponent />\n </ViewportArtboard>\n </ViewportCanvas>\n )\n})\n\nViewportCanvasComponent.displayName = 'ViewportCanvasComponent'\nViewportCanvasComponent.aglyn = true\n\nexport default ViewportCanvasComponent\n"],"names":["Besigner","BesignerDeviceFlag","DEVICE_PREVIEW_XS_WIDTH","LOADING_OVERLAY_ELEMENT","generateComponentClassKeys","styled","clsx","dynamic","forwardRef","useAglynBesignerFlag","canvasArtboardClassKeys","ViewportCanvas","name","flexGrow","width","overflowY","overflowX","textDecorationLine","textDecorationStyle","textDecorationColor","textUnderlineOffset","ViewportArtboard","theme","overflow","minHeight","padding","spacing","marginLeft","marginRight","display","flexDirection","transition","transitions","create","easing","sharp","duration","leavingScreen","responsive","deviceXs","deviceSm","breakpoints","values","sm","deviceMd","md","deviceLg","lg","deviceXl","xl","ViewportFrameComponent","then","mod","ssr","loading","ViewportCanvasComponent","props","ref","rest","devicePreview","artboardClass","RESPONSIVE","XS","SM","MD","LG","XL","id","onMouseDown","event","target","currentTarget","focus","clearSelection","className","displayName","aglyn"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,cAAc,kBAAiB;AAC3C,SAASC,kBAAkB,EAAEC,uBAAuB,QAAQ,kBAAiB;AAC7E,SAASC,uBAAuB,QAAQ,iDAAgD;AACxF,SAASC,0BAA0B,EAAEC,MAAM,QAAQ,yBAAwB;AAC3E,OAAOC,UAAU,OAAM;AACvB,OAAOC,aAAa,eAAc;AAClC,gEAAgE;AAChE,SAAyBC,UAAU,QAAkB,QAAO;AAC5D,OAAOC,0BAA0B,sCAAkC;AAGnE,MAAMC,0BAA0BN,2BAC9B,uBACA;IAAC;IAAc;IAAY;IAA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AAwBoB,WAAW,GAAG;AACtCpB,wBAAwBqB,KAAK,GAAG;AAEhC,eAAerB,wBAAuB"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 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 ComponentProps, HTMLAttributes } from 'react';
18
+ declare const ViewportFrame: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof HTMLAttributes<HTMLDivElement>>, {}>;
19
+ /**
20
+ * What `CssBaseline` gives a published page and a closed shadow root never
21
+ * inherits (AGL-3146).
22
+ *
23
+ * `:host { all: initial }` cuts inheritance at the artboard, so the canvas
24
+ * carries the document baseline itself — `FramePaper` takes the body's
25
+ * typography, color and background, and the structural half belongs here,
26
+ * because `box-sizing` is inherited from the root element rather than set on
27
+ * each one. Without it every element on the canvas is `content-box` while the
28
+ * same element on the site is `border-box`, so a band that sets a height AND
29
+ * padding measures the padding twice in the editor and once on the page.
30
+ *
31
+ * The same pair CssBaseline emits, for the same reason: declared on the host
32
+ * and inherited by everything under it, so an author's own `box-sizing` still
33
+ * wins wherever they set one.
34
+ */
35
+ export declare const VIEWPORT_BASELINE_STYLES: {
36
+ readonly ':host': {
37
+ readonly all: "initial";
38
+ readonly boxSizing: "border-box";
39
+ };
40
+ readonly '*, *::before, *::after': {
41
+ readonly boxSizing: "inherit";
42
+ };
43
+ };
44
+ export interface ViewportFrameComponentProps extends ComponentProps<typeof ViewportFrame> {
45
+ }
46
+ export declare const ViewportFrameComponent: import("react").ForwardRefExoticComponent<Omit<ViewportFrameComponentProps, "ref"> & import("react").RefAttributes<any>>;
47
+ export default ViewportFrameComponent;