@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,264 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { _ as _extends } from "@swc/helpers/_/_extends";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { getKnownPluginInstall, resolvePluginPropFields, unknownPluginPropKeys } from "@aglyn/aglyn";
20
+ import { FormFieldGrid, useFieldApi, useFormApi } from "@aglyn/shared-ui-jsx-forms";
21
+ import { Alert, Box, Button, Checkbox, FormControlLabel, MenuItem, Stack, TextField, Typography } from "@mui/material";
22
+ import { useMemo, useState } from "react";
23
+ import { readAttributeFieldValue } from "../utils/attribute-field-value.js";
24
+ /** Mapper key for the attributes form (editor-internal, never persisted). */ export const PLUGIN_SETTINGS_FIELD_COMPONENT = 'aglyn-plugin-settings-field';
25
+ /** Parses the stored JSON, tolerating anything an author may have typed. */ function parseSettings(value) {
26
+ if (typeof value !== 'string' || !value.trim()) return {};
27
+ try {
28
+ const parsed = JSON.parse(value);
29
+ return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};
30
+ } catch (unused) {
31
+ return {};
32
+ }
33
+ }
34
+ /** True when the stored value is non-empty but not parseable. */ function isBrokenJson(value) {
35
+ if (typeof value !== 'string' || !value.trim()) return false;
36
+ try {
37
+ JSON.parse(value);
38
+ return false;
39
+ } catch (unused) {
40
+ return true;
41
+ }
42
+ }
43
+ const serialize = (settings)=>Object.keys(settings).length ? JSON.stringify(settings) : '';
44
+ /**
45
+ * A plugin's settings, as real fields (AGL-1049).
46
+ *
47
+ * `Plugin settings (JSON)` was a textarea: authors hand-wrote
48
+ * `{"title":"Spring sale"}` with no validation, no defaults, no idea which keys
49
+ * exist, and no feedback when a key was dropped for not being in the manifest.
50
+ * `filterPluginProps` drops anything undeclared, so a typo does not fail — it
51
+ * quietly does nothing, which is the worst of the options.
52
+ *
53
+ * The fields come from `resolvePluginPropFields`, which is driven by
54
+ * `capabilities.props` — THE allowlist — and merely decorated by the
55
+ * publisher's optional `propSchema`. So the form agrees with the filter by
56
+ * construction: it cannot offer a setting the plugin will not receive, and a
57
+ * plugin that predates `propSchema` still gets a field per declared prop as
58
+ * plain text rather than a blank box.
59
+ *
60
+ * ## Which plugin
61
+ *
62
+ * Read from the SIBLING `listingId` field through the form API rather than
63
+ * from props. The two attributes are edited in one form and the settings are
64
+ * meaningless without the selection, so this has to follow it live — picking a
65
+ * different plugin has to re-render against a different manifest, not keep
66
+ * showing the last one's fields.
67
+ *
68
+ * ## The escape hatch stays
69
+ *
70
+ * Raw JSON behind a toggle, per the issue: a plugin may legitimately accept a
71
+ * key no schema covers, and taking that away to make the generated form look
72
+ * tidier would remove the only way to set it. It is not the way in, though —
73
+ * it is the way out.
74
+ */ export function PluginSettingsField(props) {
75
+ const { input, label, description, isDisabled, listingField, listingFallback, help, FormFieldGridProps } = useFieldApi(props);
76
+ // The corner controls every field has — the help tip, and the `{}` that
77
+ // binds the settings to a property — ride the shared grid wrapper.
78
+ const grid = (children)=>/*#__PURE__*/ _jsx(FormFieldGrid, _extends({
79
+ help: help
80
+ }, FormFieldGridProps != null ? FormFieldGridProps : {}, {
81
+ children: children
82
+ }));
83
+ const formApi = useFormApi();
84
+ const [rawMode, setRawMode] = useState(false);
85
+ // The sibling selection. `getState()` rather than a subscription: the
86
+ // attributes form re-renders on every value change already, so reading here
87
+ // is current without a second subscription to keep in step.
88
+ //
89
+ // A Plugin settings PROPERTY names the Plugin property it follows
90
+ // (`listingField`, e.g. `propValues.plugin`) and that property's default
91
+ // (`listingFallback`), which is what the page renders while it picks none.
92
+ const picked = readAttributeFieldValue(formApi.getState().values, typeof listingField === 'string' && listingField ? listingField : 'listingId');
93
+ const listingId = String(typeof picked === 'string' && picked || (typeof listingFallback === 'string' ? listingFallback : '') || '');
94
+ const install = getKnownPluginInstall(listingId || undefined);
95
+ const fields = useMemo(()=>resolvePluginPropFields(install), [
96
+ install
97
+ ]);
98
+ const settings = useMemo(()=>parseSettings(input.value), [
99
+ input.value
100
+ ]);
101
+ const broken = isBrokenJson(input.value);
102
+ const unknownKeys = useMemo(()=>unknownPluginPropKeys(install, settings), [
103
+ install,
104
+ settings
105
+ ]);
106
+ const setKey = (name, value)=>{
107
+ const next = _extends({}, settings);
108
+ // Removing the key is not the same as storing `""`. An absent key lets the
109
+ // plugin apply its own default; an empty string overrides it with nothing.
110
+ if (value === undefined || value === '' || value === null) delete next[name];
111
+ else next[name] = value;
112
+ input.onChange(serialize(next));
113
+ };
114
+ if (!listingId) {
115
+ return grid(/*#__PURE__*/ _jsxs(Stack, {
116
+ spacing: 0.5,
117
+ children: [
118
+ /*#__PURE__*/ _jsx(Typography, {
119
+ variant: "subtitle2",
120
+ children: label != null ? label : 'Plugin settings'
121
+ }),
122
+ /*#__PURE__*/ _jsx(Typography, {
123
+ variant: "caption",
124
+ color: "text.secondary",
125
+ children: listingField ? 'Choose a plugin for this page to see its settings.' : 'Choose a plugin above to see its settings.'
126
+ })
127
+ ]
128
+ }));
129
+ }
130
+ return grid(/*#__PURE__*/ _jsxs(Stack, {
131
+ spacing: 1.5,
132
+ children: [
133
+ /*#__PURE__*/ _jsxs(Stack, {
134
+ direction: "row",
135
+ spacing: 1,
136
+ sx: {
137
+ alignItems: 'center',
138
+ justifyContent: 'space-between'
139
+ },
140
+ children: [
141
+ /*#__PURE__*/ _jsx(Typography, {
142
+ variant: "subtitle2",
143
+ children: label != null ? label : 'Plugin settings'
144
+ }),
145
+ /*#__PURE__*/ _jsx(Button, {
146
+ size: "small",
147
+ onClick: ()=>setRawMode((raw)=>!raw),
148
+ children: rawMode ? 'Use fields' : 'Edit as JSON'
149
+ })
150
+ ]
151
+ }),
152
+ description ? /*#__PURE__*/ _jsx(Typography, {
153
+ variant: "caption",
154
+ color: "text.secondary",
155
+ children: description
156
+ }) : null,
157
+ broken ? /*#__PURE__*/ _jsx(Alert, {
158
+ severity: "warning",
159
+ children: 'These settings are not valid JSON, so the plugin receives none of ' + 'them. Fix them below, or clear the box.'
160
+ }) : null,
161
+ unknownKeys.length ? // The silent failure, named. This is the whole complaint in AGL-1049.
162
+ /*#__PURE__*/ _jsx(Alert, {
163
+ severity: "warning",
164
+ children: `This plugin does not declare ${unknownKeys.map((key)=>`"${key}"`).join(', ')}, so ${unknownKeys.length === 1 ? 'it is' : 'they are'} ignored. Check the spelling, or remove ${unknownKeys.length === 1 ? 'it' : 'them'}.`
165
+ }) : null,
166
+ rawMode || broken ? /*#__PURE__*/ _jsx(TextField, {
167
+ size: "small",
168
+ multiline: true,
169
+ minRows: 3,
170
+ fullWidth: true,
171
+ value: typeof input.value === 'string' ? input.value : '',
172
+ disabled: isDisabled,
173
+ onChange: (event)=>input.onChange(event.target.value),
174
+ placeholder: '{"title":"Spring sale"}',
175
+ helperText: "Raw JSON — for keys no field covers."
176
+ }) : !fields.length ? /*#__PURE__*/ _jsx(Typography, {
177
+ variant: "caption",
178
+ color: "text.secondary",
179
+ children: 'This plugin declares no settings, so there is nothing to configure.'
180
+ }) : /*#__PURE__*/ _jsx(Stack, {
181
+ spacing: 1.5,
182
+ children: fields.map((field)=>{
183
+ const stored = settings[field.name];
184
+ const shared = {
185
+ key: field.name,
186
+ size: 'small',
187
+ fullWidth: true,
188
+ label: field.label,
189
+ disabled: isDisabled,
190
+ helperText: field.description
191
+ };
192
+ if (field.type === 'boolean') {
193
+ return /*#__PURE__*/ _jsxs(Box, {
194
+ children: [
195
+ /*#__PURE__*/ _jsx(FormControlLabel, {
196
+ control: /*#__PURE__*/ _jsx(Checkbox, {
197
+ checked: stored === undefined ? Boolean(field.default) : Boolean(stored),
198
+ disabled: isDisabled,
199
+ onChange: (event)=>setKey(field.name, event.target.checked)
200
+ }),
201
+ label: field.label
202
+ }),
203
+ field.description ? /*#__PURE__*/ _jsx(Typography, {
204
+ variant: "caption",
205
+ color: "text.secondary",
206
+ sx: {
207
+ display: 'block'
208
+ },
209
+ children: field.description
210
+ }) : null
211
+ ]
212
+ }, field.name);
213
+ }
214
+ if (field.type === 'select') {
215
+ var _ref, _field_options;
216
+ return /*#__PURE__*/ _jsxs(TextField, _extends({}, shared, {
217
+ select: true,
218
+ // MUI renders an empty Select as a collapsed box without
219
+ // this, so "not set" would be invisible.
220
+ slotProps: {
221
+ inputLabel: {
222
+ shrink: true
223
+ }
224
+ },
225
+ value: String((_ref = stored != null ? stored : field.default) != null ? _ref : ''),
226
+ onChange: (event)=>setKey(field.name, event.target.value),
227
+ children: [
228
+ /*#__PURE__*/ _jsx(MenuItem, {
229
+ value: "",
230
+ children: field.default !== undefined ? `Default (${field.default})` : 'Not set'
231
+ }),
232
+ ((_field_options = field.options) != null ? _field_options : []).map((option)=>{
233
+ var _option_label;
234
+ return /*#__PURE__*/ _jsx(MenuItem, {
235
+ value: option.value,
236
+ children: (_option_label = option.label) != null ? _option_label : option.value
237
+ }, option.value);
238
+ })
239
+ ]
240
+ }));
241
+ }
242
+ const inputType = field.type === 'number' ? 'number' : field.type === 'date' ? 'datetime-local' : field.type === 'color' ? 'color' : field.type === 'url' ? 'url' : 'text';
243
+ return /*#__PURE__*/ _jsx(TextField, _extends({}, shared, {
244
+ type: inputType,
245
+ // The manifest's default as the placeholder, so "what happens
246
+ // if I leave this alone" is visible without guessing.
247
+ placeholder: field.default !== undefined ? String(field.default) : undefined,
248
+ slotProps: field.type === 'date' || field.type === 'color' ? {
249
+ inputLabel: {
250
+ shrink: true
251
+ }
252
+ } : undefined,
253
+ value: stored === undefined ? '' : String(stored),
254
+ onChange: (event)=>setKey(field.name, field.type === 'number' && event.target.value !== '' ? Number(event.target.value) : event.target.value)
255
+ }));
256
+ })
257
+ })
258
+ ]
259
+ }));
260
+ }
261
+ PluginSettingsField.displayName = 'PluginSettingsField';
262
+ export default PluginSettingsField;
263
+
264
+ //# sourceMappingURL=plugin-settings-field.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/plugin-settings-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'use client'\n\nimport {\n getKnownPluginInstall,\n resolvePluginPropFields,\n unknownPluginPropKeys,\n} from '@aglyn/aglyn'\nimport {\n FormFieldGrid,\n type FormFieldGridProps,\n useFieldApi,\n useFormApi,\n} from '@aglyn/shared-ui-jsx-forms'\nimport {\n Alert,\n Box,\n Button,\n Checkbox,\n FormControlLabel,\n MenuItem,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { useMemo, useState } from 'react'\n\nimport { readAttributeFieldValue } from '../utils/attribute-field-value'\n\n/** Mapper key for the attributes form (editor-internal, never persisted). */\nexport const PLUGIN_SETTINGS_FIELD_COMPONENT = 'aglyn-plugin-settings-field'\n\n/** Parses the stored JSON, tolerating anything an author may have typed. */\nfunction parseSettings(value: unknown): Record<string, unknown> {\n if (typeof value !== 'string' || !value.trim()) return {}\n try {\n const parsed = JSON.parse(value)\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {}\n } catch {\n return {}\n }\n}\n\n/** True when the stored value is non-empty but not parseable. */\nfunction isBrokenJson(value: unknown): boolean {\n if (typeof value !== 'string' || !value.trim()) return false\n try {\n JSON.parse(value)\n return false\n } catch {\n return true\n }\n}\n\nconst serialize = (settings: Record<string, unknown>): string =>\n Object.keys(settings).length ? JSON.stringify(settings) : ''\n\n/**\n * A plugin's settings, as real fields (AGL-1049).\n *\n * `Plugin settings (JSON)` was a textarea: authors hand-wrote\n * `{\"title\":\"Spring sale\"}` with no validation, no defaults, no idea which keys\n * exist, and no feedback when a key was dropped for not being in the manifest.\n * `filterPluginProps` drops anything undeclared, so a typo does not fail — it\n * quietly does nothing, which is the worst of the options.\n *\n * The fields come from `resolvePluginPropFields`, which is driven by\n * `capabilities.props` — THE allowlist — and merely decorated by the\n * publisher's optional `propSchema`. So the form agrees with the filter by\n * construction: it cannot offer a setting the plugin will not receive, and a\n * plugin that predates `propSchema` still gets a field per declared prop as\n * plain text rather than a blank box.\n *\n * ## Which plugin\n *\n * Read from the SIBLING `listingId` field through the form API rather than\n * from props. The two attributes are edited in one form and the settings are\n * meaningless without the selection, so this has to follow it live — picking a\n * different plugin has to re-render against a different manifest, not keep\n * showing the last one's fields.\n *\n * ## The escape hatch stays\n *\n * Raw JSON behind a toggle, per the issue: a plugin may legitimately accept a\n * key no schema covers, and taking that away to make the generated form look\n * tidier would remove the only way to set it. It is not the way in, though —\n * it is the way out.\n */\nexport function PluginSettingsField(props: Record<string, unknown>) {\n const {\n input,\n label,\n description,\n isDisabled,\n listingField,\n listingFallback,\n help,\n FormFieldGridProps,\n } = useFieldApi(props as never)\n // The corner controls every field has — the help tip, and the `{}` that\n // binds the settings to a property — ride the shared grid wrapper.\n const grid = (children: JSX.Node) => (\n <FormFieldGrid\n help={help as FormFieldGridProps['help']}\n {...((FormFieldGridProps as FormFieldGridProps | undefined) ?? {})}\n >\n {children}\n </FormFieldGrid>\n )\n const formApi = useFormApi()\n const [rawMode, setRawMode] = useState(false)\n\n // The sibling selection. `getState()` rather than a subscription: the\n // attributes form re-renders on every value change already, so reading here\n // is current without a second subscription to keep in step.\n //\n // A Plugin settings PROPERTY names the Plugin property it follows\n // (`listingField`, e.g. `propValues.plugin`) and that property's default\n // (`listingFallback`), which is what the page renders while it picks none.\n const picked = readAttributeFieldValue(\n formApi.getState().values as Record<string, unknown>,\n typeof listingField === 'string' && listingField ? listingField : 'listingId',\n )\n const listingId = String(\n (typeof picked === 'string' && picked) ||\n (typeof listingFallback === 'string' ? listingFallback : '') ||\n '',\n )\n const install = getKnownPluginInstall(listingId || undefined)\n const fields = useMemo(\n () => resolvePluginPropFields(install),\n [install],\n )\n\n const settings = useMemo(() => parseSettings(input.value), [input.value])\n const broken = isBrokenJson(input.value)\n const unknownKeys = useMemo(\n () => unknownPluginPropKeys(install, settings),\n [install, settings],\n )\n\n const setKey = (name: string, value: unknown) => {\n const next = { ...settings }\n // Removing the key is not the same as storing `\"\"`. An absent key lets the\n // plugin apply its own default; an empty string overrides it with nothing.\n if (value === undefined || value === '' || value === null) delete next[name]\n else next[name] = value\n input.onChange(serialize(next))\n }\n\n if (!listingId) {\n return grid(\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{label ?? 'Plugin settings'}</Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {listingField\n ? 'Choose a plugin for this page to see its settings.'\n : 'Choose a plugin above to see its settings.'}\n </Typography>\n </Stack>,\n )\n }\n\n return grid(\n <Stack spacing={1.5}>\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center', justifyContent: 'space-between' }}\n >\n <Typography variant=\"subtitle2\">{label ?? 'Plugin settings'}</Typography>\n <Button size=\"small\" onClick={() => setRawMode((raw) => !raw)}>\n {rawMode ? 'Use fields' : 'Edit as JSON'}\n </Button>\n </Stack>\n {description ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {description}\n </Typography>\n ) : null}\n\n {broken ? (\n <Alert severity=\"warning\">\n {'These settings are not valid JSON, so the plugin receives none of ' +\n 'them. Fix them below, or clear the box.'}\n </Alert>\n ) : null}\n\n {unknownKeys.length ? (\n // The silent failure, named. This is the whole complaint in AGL-1049.\n <Alert severity=\"warning\">\n {`This plugin does not declare ${unknownKeys\n .map((key) => `\"${key}\"`)\n .join(', ')}, so ${\n unknownKeys.length === 1 ? 'it is' : 'they are'\n } ignored. Check the spelling, or remove ${\n unknownKeys.length === 1 ? 'it' : 'them'\n }.`}\n </Alert>\n ) : null}\n\n {rawMode || broken ? (\n <TextField\n size=\"small\"\n multiline\n minRows={3}\n fullWidth\n value={typeof input.value === 'string' ? input.value : ''}\n disabled={isDisabled}\n onChange={(event) => input.onChange(event.target.value)}\n placeholder='{\"title\":\"Spring sale\"}'\n helperText=\"Raw JSON — for keys no field covers.\"\n />\n ) : !fields.length ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'This plugin declares no settings, so there is nothing to configure.'}\n </Typography>\n ) : (\n <Stack spacing={1.5}>\n {fields.map((field) => {\n const stored = settings[field.name]\n const shared = {\n key: field.name,\n size: 'small' as const,\n fullWidth: true,\n label: field.label,\n disabled: isDisabled,\n helperText: field.description,\n }\n if (field.type === 'boolean') {\n return (\n <Box key={field.name}>\n <FormControlLabel\n control={\n <Checkbox\n checked={\n stored === undefined\n ? Boolean(field.default)\n : Boolean(stored)\n }\n disabled={isDisabled}\n onChange={(event) =>\n setKey(field.name, event.target.checked)\n }\n />\n }\n label={field.label}\n />\n {field.description ? (\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ display: 'block' }}\n >\n {field.description}\n </Typography>\n ) : null}\n </Box>\n )\n }\n if (field.type === 'select') {\n return (\n <TextField\n {...shared}\n select\n // MUI renders an empty Select as a collapsed box without\n // this, so \"not set\" would be invisible.\n slotProps={{ inputLabel: { shrink: true } }}\n value={String(stored ?? field.default ?? '')}\n onChange={(event) => setKey(field.name, event.target.value)}\n >\n <MenuItem value=\"\">\n {field.default !== undefined\n ? `Default (${field.default})`\n : 'Not set'}\n </MenuItem>\n {(field.options ?? []).map((option) => (\n <MenuItem key={option.value} value={option.value}>\n {option.label ?? option.value}\n </MenuItem>\n ))}\n </TextField>\n )\n }\n const inputType =\n field.type === 'number'\n ? 'number'\n : field.type === 'date'\n ? 'datetime-local'\n : field.type === 'color'\n ? 'color'\n : field.type === 'url'\n ? 'url'\n : 'text'\n return (\n <TextField\n {...shared}\n type={inputType}\n // The manifest's default as the placeholder, so \"what happens\n // if I leave this alone\" is visible without guessing.\n placeholder={\n field.default !== undefined ? String(field.default) : undefined\n }\n slotProps={\n field.type === 'date' || field.type === 'color'\n ? { inputLabel: { shrink: true } }\n : undefined\n }\n value={stored === undefined ? '' : String(stored)}\n onChange={(event) =>\n setKey(\n field.name,\n field.type === 'number' && event.target.value !== ''\n ? Number(event.target.value)\n : event.target.value,\n )\n }\n />\n )\n })}\n </Stack>\n )}\n </Stack>,\n )\n}\nPluginSettingsField.displayName = 'PluginSettingsField'\n\nexport default PluginSettingsField\n"],"names":["getKnownPluginInstall","resolvePluginPropFields","unknownPluginPropKeys","FormFieldGrid","useFieldApi","useFormApi","Alert","Box","Button","Checkbox","FormControlLabel","MenuItem","Stack","TextField","Typography","useMemo","useState","readAttributeFieldValue","PLUGIN_SETTINGS_FIELD_COMPONENT","parseSettings","value","trim","parsed","JSON","parse","Array","isArray","isBrokenJson","serialize","settings","Object","keys","length","stringify","PluginSettingsField","props","input","label","description","isDisabled","listingField","listingFallback","help","FormFieldGridProps","grid","children","formApi","rawMode","setRawMode","picked","getState","values","listingId","String","install","undefined","fields","broken","unknownKeys","setKey","name","next","onChange","spacing","variant","color","direction","sx","alignItems","justifyContent","size","onClick","raw","severity","map","key","join","multiline","minRows","fullWidth","disabled","event","target","placeholder","helperText","field","stored","shared","type","control","checked","Boolean","default","display","select","slotProps","inputLabel","shrink","options","option","inputType","Number","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SACEA,qBAAqB,EACrBC,uBAAuB,EACvBC,qBAAqB,QAChB,eAAc;AACrB,SACEC,aAAa,EAEbC,WAAW,EACXC,UAAU,QACL,6BAA4B;AACnC,SACEC,KAAK,EACLC,GAAG,EACHC,MAAM,EACNC,QAAQ,EACRC,gBAAgB,EAChBC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AAEzC,SAASC,uBAAuB,QAAQ,oCAAgC;AAExE,2EAA2E,GAC3E,OAAO,MAAMC,kCAAkC,8BAA6B;AAE5E,0EAA0E,GAC1E,SAASC,cAAcC,KAAc;IACnC,IAAI,OAAOA,UAAU,YAAY,CAACA,MAAMC,IAAI,IAAI,OAAO,CAAC;IACxD,IAAI;QACF,MAAMC,SAASC,KAAKC,KAAK,CAACJ;QAC1B,OAAOE,UAAU,OAAOA,WAAW,YAAY,CAACG,MAAMC,OAAO,CAACJ,UACzDA,SACD,CAAC;IACP,EAAE,eAAM;QACN,OAAO,CAAC;IACV;AACF;AAEA,+DAA+D,GAC/D,SAASK,aAAaP,KAAc;IAClC,IAAI,OAAOA,UAAU,YAAY,CAACA,MAAMC,IAAI,IAAI,OAAO;IACvD,IAAI;QACFE,KAAKC,KAAK,C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AAKV;AACAc,oBAAoBoE,WAAW,GAAG;AAElC,eAAepE,oBAAmB"}
@@ -0,0 +1,22 @@
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 { type CloseableDrawerProps } from './closeable-drawer.component';
18
+ export interface PropertiesDialogProps extends Partial<CloseableDrawerProps> {
19
+ children?: JSX.Children;
20
+ }
21
+ export declare const PropertiesDialogComponent: import("react").ForwardRefExoticComponent<Omit<PropertiesDialogProps, "ref"> & import("react").RefAttributes<any>>;
22
+ export default PropertiesDialogComponent;
@@ -0,0 +1,40 @@
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 { forwardRef } from "react";
20
+ import CloseableDrawerComponent from "./closeable-drawer.component.js";
21
+ export const PropertiesDialogComponent = /*#__PURE__*/ forwardRef((props, ref)=>{
22
+ const { children, onClose } = props, rest = _object_without_properties_loose(props, [
23
+ "children",
24
+ "onClose"
25
+ ]);
26
+ return /*#__PURE__*/ _jsx(CloseableDrawerComponent, _extends({
27
+ ref: ref,
28
+ drawerTitle: 'Screen Properties',
29
+ action: 'Done',
30
+ disableCloseButton: true,
31
+ onClose: onClose
32
+ }, rest, {
33
+ children: children
34
+ }));
35
+ });
36
+ PropertiesDialogComponent.displayName = 'PropertiesDialogComponent';
37
+ PropertiesDialogComponent.aglyn = true;
38
+ export default PropertiesDialogComponent;
39
+
40
+ //# sourceMappingURL=properties-dialog.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/properties-dialog.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 { forwardRef } from 'react'\nimport CloseableDrawerComponent, {\n type CloseableDrawerProps,\n} from './closeable-drawer.component'\n\nexport interface PropertiesDialogProps extends Partial<CloseableDrawerProps> {\n children?: JSX.Children\n}\n\nexport const PropertiesDialogComponent = forwardRef<any, PropertiesDialogProps>(\n (props, ref) => {\n const { children, onClose, ...rest } = props\n\n return (\n <CloseableDrawerComponent\n ref={ref}\n drawerTitle={'Screen Properties'}\n action={'Done'}\n disableCloseButton\n onClose={onClose}\n {...rest}\n >\n {children}\n </CloseableDrawerComponent>\n )\n },\n)\nPropertiesDialogComponent.displayName = 'PropertiesDialogComponent'\nPropertiesDialogComponent.aglyn = true\n\nexport default PropertiesDialogComponent\n"],"names":["forwardRef","CloseableDrawerComponent","PropertiesDialogComponent","props","ref","children","onClose","rest","drawerTitle","action","disableCloseButton","displayName","aglyn"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,UAAU,QAAQ,QAAO;AAClC,OAAOC,8BAEA,kCAA8B;AAMrC,OAAO,MAAMC,0CAA4BF,WACvC,CAACG,OAAOC;IACN,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAW,GAAGH,OAATI,wCAASJ;;;;IAEvC,qBACE,KAACF;QACCG,KAAKA;QACLI,aAAa;QACbC,QAAQ;QACRC,kBAAkB;QAClBJ,SAASA;OACLC;kBAEHF;;AAGP,GACD;AACDH,0BAA0BS,WAAW,GAAG;AACxCT,0BAA0BU,KAAK,GAAG;AAElC,eAAeV,0BAAyB"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type * as Aglyn from '@aglyn/aglyn';
18
+ import { type BindableAttributeField } from '@aglyn/aglyn';
19
+ import { type FormFieldGridProps } from '@aglyn/shared-ui-jsx-forms';
20
+ import { type ComponentType, type ReactNode } from 'react';
21
+ import type { BindingOption } from '../contexts/binding-picker-context';
22
+ import { type ResolvedTokenLabel, type TokenLabelContext } from '../utils/token-segments';
23
+ /**
24
+ * Binding a field that has no text to type a token into.
25
+ *
26
+ * A free-text attribute has always taken `{{prop.headline}}`: the token is
27
+ * typed, or picked with the `{}` in the box, and substitution does the rest.
28
+ * A switch, a checkbox, a dropdown or an icon picker has no text to type into,
29
+ * so inside a reusable component it could only ever hold the component's own
30
+ * value — and a property of the matching kind had nothing to drive.
31
+ *
32
+ * This wraps such a field, inside a component editor only. Unbound, it is the
33
+ * field exactly as before, with a `{}` among its corner controls. Bound, the
34
+ * control gives way to the property it is bound to, drawn as the pill a text
35
+ * field would draw — because the control would otherwise go on showing a
36
+ * value the page no longer uses.
37
+ *
38
+ * The stored value is the same exact `{{prop.<name>}}` token a text field
39
+ * holds, so the graft needs nothing new to find it, and a binding to a
40
+ * property of the wrong kind is simply never offered.
41
+ */
42
+ /** Mapper key for {@link PropertyBindingField} (editor-internal, never persisted). */
43
+ export declare const PROPERTY_BINDING_FIELD_COMPONENT = "aglyn-property-binding-field";
44
+ /**
45
+ * The names of the property kinds a declared field can be bound to, in the
46
+ * panel's own words — `Yes / no or Checkbox` for a switch, `Color` for a color
47
+ * picker — for the sentences that tell an author what to add.
48
+ *
49
+ * Every kind is tried as it can be declared (bare, with answers, taking
50
+ * several), so a list-holding dropdown names the kinds that hold lists.
51
+ */
52
+ export declare function propertyKindsBindableTo(declared: BindableAttributeField): string;
53
+ /** A component-mapper entry: a component, or `{ component, ...defaults }`. */
54
+ export type PropertyBindingControl = ComponentType<any> | {
55
+ component: ComponentType<any>;
56
+ [key: string]: unknown;
57
+ };
58
+ export interface PropertyBindingOptions {
59
+ /** The attribute type the component schema declares for this field. */
60
+ declaredComponent: unknown;
61
+ /**
62
+ * The attribute as the schema declares it, for whether it holds one value
63
+ * or several (`isMulti`, a checkbox's `options`). The field itself is read
64
+ * when this is absent.
65
+ */
66
+ declaredField?: BindableAttributeField;
67
+ /**
68
+ * The props the edited component declares, or `undefined` outside a
69
+ * component editor — where `{{prop.*}}` resolves to nothing, so there is
70
+ * nothing to bind to.
71
+ */
72
+ componentProps: readonly Aglyn.ReusableComponentProp[] | null | undefined;
73
+ /** The mapper entry this field renders with while unbound. */
74
+ control: PropertyBindingControl | undefined;
75
+ /** Display-name inputs for the bound pill. */
76
+ tokenLabelContext?: TokenLabelContext;
77
+ /** Whose properties these are, for what an empty picker says. */
78
+ owner?: 'component' | 'layout';
79
+ }
80
+ /**
81
+ * The field, wrapped to take a property binding when it can, or unchanged.
82
+ *
83
+ * Every field kind that holds a value can be bound (AGL-2893), to the
84
+ * properties that hold the same shape of value (`reusablePropBindsToField`):
85
+ * a switch to a Yes / no, a color picker to a Color, a dropdown that takes
86
+ * several answers to a property that holds several.
87
+ *
88
+ * Unchanged outside a component or layout editor, for a free-text field — it
89
+ * takes any property's token typed into it — for a read-only or disabled
90
+ * field (a control that writes an unwritable field is a lie), and whenever the
91
+ * control to fall back to is unknown, since a wrapper with nothing to render
92
+ * would blank the field.
93
+ */
94
+ export declare function withPropertyBinding<T extends Record<string, unknown>>(field: T, options: PropertyBindingOptions): T;
95
+ export interface PropertyBindingFieldProps {
96
+ [key: string]: unknown;
97
+ name: string;
98
+ label?: ReactNode;
99
+ help?: unknown;
100
+ description?: ReactNode;
101
+ helperText?: ReactNode;
102
+ bindingControl?: PropertyBindingControl;
103
+ bindingOptions?: BindingOption[];
104
+ /** The declared props this field can be bound to. */
105
+ bindingProps?: readonly Aglyn.ReusableComponentProp[];
106
+ /** Those props' kinds in the panel's words, e.g. `Choice`. */
107
+ bindingKinds?: string;
108
+ bindingEmptyText?: string;
109
+ tokenLabelContext?: TokenLabelContext;
110
+ FormFieldGridProps?: FormFieldGridProps;
111
+ }
112
+ /**
113
+ * What a bound field says under the property it follows, and whether that is
114
+ * a problem.
115
+ *
116
+ * Three ways a binding can be wrong while still looking bound, each named in
117
+ * words an author can act on: the property is gone (it was renamed or
118
+ * removed, so nothing substitutes), the property is the wrong kind (a token
119
+ * written some other way than this field's picker), or — for a dropdown —
120
+ * some of the property's choices are values the dropdown does not offer.
121
+ */
122
+ export declare function describePropertyBinding(options: {
123
+ token: string;
124
+ resolved: ResolvedTokenLabel;
125
+ bindingProps?: readonly Aglyn.ReusableComponentProp[];
126
+ bindingKinds?: string;
127
+ fieldOptions?: unknown;
128
+ }): {
129
+ text: string;
130
+ error: boolean;
131
+ };
132
+ /**
133
+ * The data-driven-forms field registered as
134
+ * {@link PROPERTY_BINDING_FIELD_COMPONENT}. The token flows through
135
+ * react-final-form like any other value, so the Attributes panel's debounced
136
+ * autosave commits a binding exactly as it commits a tick.
137
+ */
138
+ export declare function PropertyBindingField(props: PropertyBindingFieldProps): import("react").JSX.Element;
139
+ export declare namespace PropertyBindingField {
140
+ var displayName: string;
141
+ }
142
+ export default PropertyBindingField;