@cratis/components 4.38.2 → 4.39.1

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 (314) hide show
  1. package/compat-manifest.json +11 -11
  2. package/dist/esm/Chat/ChatSidebar.d.ts.map +1 -1
  3. package/dist/esm/Chat/ChatSidebar.js +2 -2
  4. package/dist/esm/Chat/ChatSidebar.js.map +1 -1
  5. package/dist/esm/CommandDialog/CommandDialog.d.ts +1 -1
  6. package/dist/esm/CommandDialog/CommandDialog.d.ts.map +1 -1
  7. package/dist/esm/CommandDialog/CommandDialog.js +5 -2
  8. package/dist/esm/CommandDialog/CommandDialog.js.map +1 -1
  9. package/dist/esm/CommandDialog/CommandStepperContent.js +1 -1
  10. package/dist/esm/CommandDialog/CommandStepperContent.js.map +1 -1
  11. package/dist/esm/CommandDialog/StepperCommandDialog.d.ts +7 -0
  12. package/dist/esm/CommandDialog/StepperCommandDialog.d.ts.map +1 -1
  13. package/dist/esm/CommandDialog/StepperCommandDialog.js +4 -4
  14. package/dist/esm/CommandDialog/StepperCommandDialog.js.map +1 -1
  15. package/dist/esm/CommandForm/fields/CheckboxField.d.ts.map +1 -1
  16. package/dist/esm/CommandForm/fields/CheckboxField.js +1 -1
  17. package/dist/esm/CommandForm/fields/CheckboxField.js.map +1 -1
  18. package/dist/esm/CommandForm/fields/ChipsField.d.ts.map +1 -1
  19. package/dist/esm/CommandForm/fields/ChipsField.js +1 -1
  20. package/dist/esm/CommandForm/fields/ChipsField.js.map +1 -1
  21. package/dist/esm/CommandForm/fields/ColorPickerField.d.ts.map +1 -1
  22. package/dist/esm/CommandForm/fields/ColorPickerField.js +1 -1
  23. package/dist/esm/CommandForm/fields/ColorPickerField.js.map +1 -1
  24. package/dist/esm/CommandForm/fields/NumberField.d.ts.map +1 -1
  25. package/dist/esm/CommandForm/fields/NumberField.js +1 -1
  26. package/dist/esm/CommandForm/fields/NumberField.js.map +1 -1
  27. package/dist/esm/CommandForm/fields/PasswordField.d.ts.map +1 -1
  28. package/dist/esm/CommandForm/fields/PasswordField.js +1 -1
  29. package/dist/esm/CommandForm/fields/PasswordField.js.map +1 -1
  30. package/dist/esm/CommandForm/fields/RadioButtonField.d.ts.map +1 -1
  31. package/dist/esm/CommandForm/fields/RadioButtonField.js +1 -1
  32. package/dist/esm/CommandForm/fields/RadioButtonField.js.map +1 -1
  33. package/dist/esm/CommandForm/fields/RadioGroupField.d.ts.map +1 -1
  34. package/dist/esm/CommandForm/fields/RadioGroupField.js +1 -1
  35. package/dist/esm/CommandForm/fields/RadioGroupField.js.map +1 -1
  36. package/dist/esm/CommandForm/fields/RatingField.d.ts.map +1 -1
  37. package/dist/esm/CommandForm/fields/RatingField.js +1 -1
  38. package/dist/esm/CommandForm/fields/RatingField.js.map +1 -1
  39. package/dist/esm/CommandForm/fields/SliderField.d.ts.map +1 -1
  40. package/dist/esm/CommandForm/fields/SliderField.js +1 -1
  41. package/dist/esm/CommandForm/fields/SliderField.js.map +1 -1
  42. package/dist/esm/CommandForm/fields/ToggleSwitchField.d.ts.map +1 -1
  43. package/dist/esm/CommandForm/fields/ToggleSwitchField.js +1 -1
  44. package/dist/esm/CommandForm/fields/ToggleSwitchField.js.map +1 -1
  45. package/dist/esm/Common/ActionMenubar.d.ts.map +1 -1
  46. package/dist/esm/Common/ActionMenubar.js +1 -1
  47. package/dist/esm/Common/ActionMenubar.js.map +1 -1
  48. package/dist/esm/Common/Breadcrumbs.d.ts.map +1 -1
  49. package/dist/esm/Common/Breadcrumbs.js +1 -1
  50. package/dist/esm/Common/Breadcrumbs.js.map +1 -1
  51. package/dist/esm/Common/Button.d.ts.map +1 -1
  52. package/dist/esm/Common/Button.js +4 -1
  53. package/dist/esm/Common/Button.js.map +1 -1
  54. package/dist/esm/Common/CheckboxImplementation.d.ts.map +1 -1
  55. package/dist/esm/Common/CheckboxImplementation.js +1 -1
  56. package/dist/esm/Common/CheckboxImplementation.js.map +1 -1
  57. package/dist/esm/Common/ComboBox.js +1 -1
  58. package/dist/esm/Common/ComboBox.js.map +1 -1
  59. package/dist/esm/Common/CratisComponentsProvider.d.ts +14 -1
  60. package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
  61. package/dist/esm/Common/CratisComponentsProvider.js +6 -2
  62. package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
  63. package/dist/esm/Common/DatePickerInputImplementation.d.ts.map +1 -1
  64. package/dist/esm/Common/DatePickerInputImplementation.js +1 -1
  65. package/dist/esm/Common/DatePickerInputImplementation.js.map +1 -1
  66. package/dist/esm/Common/FormElement.js +1 -1
  67. package/dist/esm/Common/FormElement.js.map +1 -1
  68. package/dist/esm/Common/IconButton.d.ts.map +1 -1
  69. package/dist/esm/Common/IconButton.js +4 -1
  70. package/dist/esm/Common/IconButton.js.map +1 -1
  71. package/dist/esm/Common/NumberInput.d.ts.map +1 -1
  72. package/dist/esm/Common/NumberInput.js +1 -1
  73. package/dist/esm/Common/NumberInput.js.map +1 -1
  74. package/dist/esm/Common/Page.d.ts +1 -1
  75. package/dist/esm/Common/Page.d.ts.map +1 -1
  76. package/dist/esm/Common/Page.js +11 -2
  77. package/dist/esm/Common/Page.js.map +1 -1
  78. package/dist/esm/Common/RadioImplementation.d.ts.map +1 -1
  79. package/dist/esm/Common/RadioImplementation.js +1 -1
  80. package/dist/esm/Common/RadioImplementation.js.map +1 -1
  81. package/dist/esm/Common/SurfaceImplementation.d.ts.map +1 -1
  82. package/dist/esm/Common/SurfaceImplementation.js +1 -1
  83. package/dist/esm/Common/SurfaceImplementation.js.map +1 -1
  84. package/dist/esm/Common/SwitchImplementation.d.ts.map +1 -1
  85. package/dist/esm/Common/SwitchImplementation.js +1 -1
  86. package/dist/esm/Common/SwitchImplementation.js.map +1 -1
  87. package/dist/esm/Common/Tabs.d.ts.map +1 -1
  88. package/dist/esm/Common/Tabs.js +1 -1
  89. package/dist/esm/Common/Tabs.js.map +1 -1
  90. package/dist/esm/Common/TagGroup.d.ts.map +1 -1
  91. package/dist/esm/Common/TagGroup.js +1 -1
  92. package/dist/esm/Common/TagGroup.js.map +1 -1
  93. package/dist/esm/Common/TextArea.d.ts.map +1 -1
  94. package/dist/esm/Common/TextArea.js +4 -1
  95. package/dist/esm/Common/TextArea.js.map +1 -1
  96. package/dist/esm/Common/TextInput.d.ts.map +1 -1
  97. package/dist/esm/Common/TextInput.js +4 -1
  98. package/dist/esm/Common/TextInput.js.map +1 -1
  99. package/dist/esm/Common/ToggleGroup.d.ts.map +1 -1
  100. package/dist/esm/Common/ToggleGroup.js +1 -1
  101. package/dist/esm/Common/ToggleGroup.js.map +1 -1
  102. package/dist/esm/Common/buttonDescriptor.d.ts +7 -0
  103. package/dist/esm/Common/buttonDescriptor.d.ts.map +1 -0
  104. package/dist/esm/Common/buttonDescriptor.js +28 -0
  105. package/dist/esm/Common/buttonDescriptor.js.map +1 -0
  106. package/dist/esm/Common/textFieldDescriptors.d.ts +7 -0
  107. package/dist/esm/Common/textFieldDescriptors.d.ts.map +1 -0
  108. package/dist/esm/Common/textFieldDescriptors.js +25 -0
  109. package/dist/esm/Common/textFieldDescriptors.js.map +1 -0
  110. package/dist/esm/ComponentPicker/ComponentHighlight.d.ts +14 -0
  111. package/dist/esm/ComponentPicker/ComponentHighlight.d.ts.map +1 -0
  112. package/dist/esm/ComponentPicker/ComponentHighlight.js +12 -0
  113. package/dist/esm/ComponentPicker/ComponentHighlight.js.map +1 -0
  114. package/dist/esm/ComponentPicker/ComponentPicker.d.ts +24 -0
  115. package/dist/esm/ComponentPicker/ComponentPicker.d.ts.map +1 -0
  116. package/dist/esm/ComponentPicker/ComponentPicker.js +116 -0
  117. package/dist/esm/ComponentPicker/ComponentPicker.js.map +1 -0
  118. package/dist/esm/ComponentPicker/ComponentResolver.d.ts +6 -0
  119. package/dist/esm/ComponentPicker/ComponentResolver.d.ts.map +1 -0
  120. package/dist/esm/ComponentPicker/ComponentResolver.js +4 -0
  121. package/dist/esm/ComponentPicker/ComponentResolver.js.map +1 -0
  122. package/dist/esm/ComponentPicker/HighlightFrame.d.ts +14 -0
  123. package/dist/esm/ComponentPicker/HighlightFrame.d.ts.map +1 -0
  124. package/dist/esm/ComponentPicker/HighlightFrame.js +70 -0
  125. package/dist/esm/ComponentPicker/HighlightFrame.js.map +1 -0
  126. package/dist/esm/ComponentPicker/PickedAncestor.d.ts +10 -0
  127. package/dist/esm/ComponentPicker/PickedAncestor.d.ts.map +1 -0
  128. package/dist/esm/ComponentPicker/PickedAncestor.js +4 -0
  129. package/dist/esm/ComponentPicker/PickedAncestor.js.map +1 -0
  130. package/dist/esm/ComponentPicker/PickedComponent.d.ts +23 -0
  131. package/dist/esm/ComponentPicker/PickedComponent.d.ts.map +1 -0
  132. package/dist/esm/ComponentPicker/PickedComponent.js +4 -0
  133. package/dist/esm/ComponentPicker/PickedComponent.js.map +1 -0
  134. package/dist/esm/ComponentPicker/PickedPresentationProperty.d.ts +22 -0
  135. package/dist/esm/ComponentPicker/PickedPresentationProperty.d.ts.map +1 -0
  136. package/dist/esm/ComponentPicker/PickedPresentationProperty.js +4 -0
  137. package/dist/esm/ComponentPicker/PickedPresentationProperty.js.map +1 -0
  138. package/dist/esm/ComponentPicker/PickedRect.d.ts +20 -0
  139. package/dist/esm/ComponentPicker/PickedRect.d.ts.map +1 -0
  140. package/dist/esm/ComponentPicker/PickedRect.js +4 -0
  141. package/dist/esm/ComponentPicker/PickedRect.js.map +1 -0
  142. package/dist/esm/ComponentPicker/PresentationPropertyEditor.d.ts +25 -0
  143. package/dist/esm/ComponentPicker/PresentationPropertyEditor.d.ts.map +1 -0
  144. package/dist/esm/ComponentPicker/PresentationPropertyEditor.js +51 -0
  145. package/dist/esm/ComponentPicker/PresentationPropertyEditor.js.map +1 -0
  146. package/dist/esm/ComponentPicker/componentElements.d.ts +14 -0
  147. package/dist/esm/ComponentPicker/componentElements.d.ts.map +1 -0
  148. package/dist/esm/ComponentPicker/componentElements.js +18 -0
  149. package/dist/esm/ComponentPicker/componentElements.js.map +1 -0
  150. package/dist/esm/ComponentPicker/describeComponentElement.d.ts +11 -0
  151. package/dist/esm/ComponentPicker/describeComponentElement.d.ts.map +1 -0
  152. package/dist/esm/ComponentPicker/describeComponentElement.js +63 -0
  153. package/dist/esm/ComponentPicker/describeComponentElement.js.map +1 -0
  154. package/dist/esm/ComponentPicker/index.d.ts +24 -0
  155. package/dist/esm/ComponentPicker/index.d.ts.map +1 -0
  156. package/dist/esm/ComponentPicker/index.js +12 -0
  157. package/dist/esm/ComponentPicker/index.js.map +1 -0
  158. package/dist/esm/ComponentPicker/pickerStacking.d.ts +3 -0
  159. package/dist/esm/ComponentPicker/pickerStacking.d.ts.map +1 -0
  160. package/dist/esm/ComponentPicker/pickerStacking.js +10 -0
  161. package/dist/esm/ComponentPicker/pickerStacking.js.map +1 -0
  162. package/dist/esm/ComponentPicker/proposedChanges.d.ts +11 -0
  163. package/dist/esm/ComponentPicker/proposedChanges.d.ts.map +1 -0
  164. package/dist/esm/ComponentPicker/proposedChanges.js +6 -0
  165. package/dist/esm/ComponentPicker/proposedChanges.js.map +1 -0
  166. package/dist/esm/ComponentPicker/useComponentPicker.d.ts +30 -0
  167. package/dist/esm/ComponentPicker/useComponentPicker.d.ts.map +1 -0
  168. package/dist/esm/ComponentPicker/useComponentPicker.js +31 -0
  169. package/dist/esm/ComponentPicker/useComponentPicker.js.map +1 -0
  170. package/dist/esm/ConfigurationEditor/OrderedItemEditor.d.ts.map +1 -1
  171. package/dist/esm/ConfigurationEditor/OrderedItemEditor.js +1 -1
  172. package/dist/esm/ConfigurationEditor/OrderedItemEditor.js.map +1 -1
  173. package/dist/esm/ConfigurationEditor/PropertyControls.d.ts.map +1 -1
  174. package/dist/esm/ConfigurationEditor/PropertyControls.js +1 -1
  175. package/dist/esm/ConfigurationEditor/PropertyControls.js.map +1 -1
  176. package/dist/esm/DataPage/DataPage.js +1 -1
  177. package/dist/esm/DataPage/DataPage.js.map +1 -1
  178. package/dist/esm/DataTables/DataTableCore.d.ts.map +1 -1
  179. package/dist/esm/DataTables/DataTableCore.js +1 -1
  180. package/dist/esm/DataTables/DataTableCore.js.map +1 -1
  181. package/dist/esm/DataTables/DataTableHeaderCell.d.ts +2 -2
  182. package/dist/esm/DataTables/DataTableHeaderCell.d.ts.map +1 -1
  183. package/dist/esm/DataTables/DataTableHeaderCell.js +7 -2
  184. package/dist/esm/DataTables/DataTableHeaderCell.js.map +1 -1
  185. package/dist/esm/DataTables/TablePaginatorImplementation.d.ts.map +1 -1
  186. package/dist/esm/DataTables/TablePaginatorImplementation.js +1 -1
  187. package/dist/esm/DataTables/TablePaginatorImplementation.js.map +1 -1
  188. package/dist/esm/DataTables/columnDescriptor.d.ts +4 -0
  189. package/dist/esm/DataTables/columnDescriptor.d.ts.map +1 -0
  190. package/dist/esm/DataTables/columnDescriptor.js +10 -0
  191. package/dist/esm/DataTables/columnDescriptor.js.map +1 -0
  192. package/dist/esm/Dialogs/Dialog.d.ts +18 -0
  193. package/dist/esm/Dialogs/Dialog.d.ts.map +1 -1
  194. package/dist/esm/Dialogs/Dialog.js.map +1 -1
  195. package/dist/esm/Dialogs/DialogGlobalHeaderActions.d.ts +8 -0
  196. package/dist/esm/Dialogs/DialogGlobalHeaderActions.d.ts.map +1 -0
  197. package/dist/esm/Dialogs/DialogGlobalHeaderActions.js +6 -0
  198. package/dist/esm/Dialogs/DialogGlobalHeaderActions.js.map +1 -0
  199. package/dist/esm/Dialogs/DialogImplementation.d.ts +1 -1
  200. package/dist/esm/Dialogs/DialogImplementation.d.ts.map +1 -1
  201. package/dist/esm/Dialogs/DialogImplementation.js +22 -6
  202. package/dist/esm/Dialogs/DialogImplementation.js.map +1 -1
  203. package/dist/esm/Dialogs/dialogDescriptor.d.ts +4 -0
  204. package/dist/esm/Dialogs/dialogDescriptor.d.ts.map +1 -0
  205. package/dist/esm/Dialogs/dialogDescriptor.js +12 -0
  206. package/dist/esm/Dialogs/dialogDescriptor.js.map +1 -0
  207. package/dist/esm/Dialogs/index.d.ts +3 -0
  208. package/dist/esm/Dialogs/index.d.ts.map +1 -1
  209. package/dist/esm/Display/Avatar.d.ts.map +1 -1
  210. package/dist/esm/Display/Avatar.js +1 -1
  211. package/dist/esm/Display/Avatar.js.map +1 -1
  212. package/dist/esm/Display/Badge.d.ts.map +1 -1
  213. package/dist/esm/Display/Badge.js +1 -1
  214. package/dist/esm/Display/Badge.js.map +1 -1
  215. package/dist/esm/Display/Chip.d.ts.map +1 -1
  216. package/dist/esm/Display/Chip.js +1 -1
  217. package/dist/esm/Display/Chip.js.map +1 -1
  218. package/dist/esm/Display/Message.d.ts.map +1 -1
  219. package/dist/esm/Display/Message.js +1 -1
  220. package/dist/esm/Display/Message.js.map +1 -1
  221. package/dist/esm/Display/ProgressBarImplementation.d.ts.map +1 -1
  222. package/dist/esm/Display/ProgressBarImplementation.js +1 -1
  223. package/dist/esm/Display/ProgressBarImplementation.js.map +1 -1
  224. package/dist/esm/Display/ProgressSpinner.d.ts.map +1 -1
  225. package/dist/esm/Display/ProgressSpinner.js +1 -1
  226. package/dist/esm/Display/ProgressSpinner.js.map +1 -1
  227. package/dist/esm/Display/Skeleton.d.ts.map +1 -1
  228. package/dist/esm/Display/Skeleton.js +1 -1
  229. package/dist/esm/Display/Skeleton.js.map +1 -1
  230. package/dist/esm/Display/Tag.d.ts.map +1 -1
  231. package/dist/esm/Display/Tag.js +1 -1
  232. package/dist/esm/Display/Tag.js.map +1 -1
  233. package/dist/esm/Dropdown/DropdownImplementation.js +4 -4
  234. package/dist/esm/Dropdown/DropdownImplementation.js.map +1 -1
  235. package/dist/esm/IconPicker/IconPicker.d.ts.map +1 -1
  236. package/dist/esm/IconPicker/IconPicker.js +1 -1
  237. package/dist/esm/IconPicker/IconPicker.js.map +1 -1
  238. package/dist/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
  239. package/dist/esm/MarkdownEditor/MarkdownEditor.js +1 -1
  240. package/dist/esm/MarkdownEditor/MarkdownEditor.js.map +1 -1
  241. package/dist/esm/Toolbar/Toolbar.d.ts.map +1 -1
  242. package/dist/esm/Toolbar/Toolbar.js +1 -1
  243. package/dist/esm/Toolbar/Toolbar.js.map +1 -1
  244. package/dist/esm/configuration/DialogHeaderActionsRenderer.d.ts +8 -0
  245. package/dist/esm/configuration/DialogHeaderActionsRenderer.d.ts.map +1 -0
  246. package/dist/esm/configuration/DialogHeaderActionsRenderer.js +4 -0
  247. package/dist/esm/configuration/DialogHeaderActionsRenderer.js.map +1 -0
  248. package/dist/esm/configuration/DialogHeaderContext.d.ts +13 -0
  249. package/dist/esm/configuration/DialogHeaderContext.d.ts.map +1 -0
  250. package/dist/esm/configuration/DialogHeaderContext.js +4 -0
  251. package/dist/esm/configuration/DialogHeaderContext.js.map +1 -0
  252. package/dist/esm/configuration/DialogSliceLocation.d.ts +13 -0
  253. package/dist/esm/configuration/DialogSliceLocation.d.ts.map +1 -0
  254. package/dist/esm/configuration/DialogSliceLocation.js +4 -0
  255. package/dist/esm/configuration/DialogSliceLocation.js.map +1 -0
  256. package/dist/esm/configuration/identity/ComponentDescriptor.d.ts +12 -0
  257. package/dist/esm/configuration/identity/ComponentDescriptor.d.ts.map +1 -0
  258. package/dist/esm/configuration/identity/ComponentDescriptor.js +4 -0
  259. package/dist/esm/configuration/identity/ComponentDescriptor.js.map +1 -0
  260. package/dist/esm/configuration/identity/ComponentMarkerAttributes.d.ts +10 -0
  261. package/dist/esm/configuration/identity/ComponentMarkerAttributes.d.ts.map +1 -0
  262. package/dist/esm/configuration/identity/ComponentMarkerAttributes.js +4 -0
  263. package/dist/esm/configuration/identity/ComponentMarkerAttributes.js.map +1 -0
  264. package/dist/esm/configuration/identity/PresentationChange.d.ts +11 -0
  265. package/dist/esm/configuration/identity/PresentationChange.d.ts.map +1 -0
  266. package/dist/esm/configuration/identity/PresentationChange.js +4 -0
  267. package/dist/esm/configuration/identity/PresentationChange.js.map +1 -0
  268. package/dist/esm/configuration/identity/PresentationPropertyDescriptor.d.ts +22 -0
  269. package/dist/esm/configuration/identity/PresentationPropertyDescriptor.d.ts.map +1 -0
  270. package/dist/esm/configuration/identity/PresentationPropertyDescriptor.js +4 -0
  271. package/dist/esm/configuration/identity/PresentationPropertyDescriptor.js.map +1 -0
  272. package/dist/esm/configuration/identity/PresentationPropertyType.d.ts +3 -0
  273. package/dist/esm/configuration/identity/PresentationPropertyType.d.ts.map +1 -0
  274. package/dist/esm/configuration/identity/PresentationPropertyType.js +4 -0
  275. package/dist/esm/configuration/identity/PresentationPropertyType.js.map +1 -0
  276. package/dist/esm/configuration/identity/PresentationPropertyValue.d.ts +3 -0
  277. package/dist/esm/configuration/identity/PresentationPropertyValue.d.ts.map +1 -0
  278. package/dist/esm/configuration/identity/PresentationPropertyValue.js +4 -0
  279. package/dist/esm/configuration/identity/PresentationPropertyValue.js.map +1 -0
  280. package/dist/esm/configuration/identity/RegisteredComponent.d.ts +9 -0
  281. package/dist/esm/configuration/identity/RegisteredComponent.d.ts.map +1 -0
  282. package/dist/esm/configuration/identity/RegisteredComponent.js +4 -0
  283. package/dist/esm/configuration/identity/RegisteredComponent.js.map +1 -0
  284. package/dist/esm/configuration/identity/componentIdentityAttributes.d.ts +7 -0
  285. package/dist/esm/configuration/identity/componentIdentityAttributes.d.ts.map +1 -0
  286. package/dist/esm/configuration/identity/componentIdentityAttributes.js +6 -0
  287. package/dist/esm/configuration/identity/componentIdentityAttributes.js.map +1 -0
  288. package/dist/esm/configuration/identity/componentInstances.d.ts +30 -0
  289. package/dist/esm/configuration/identity/componentInstances.d.ts.map +1 -0
  290. package/dist/esm/configuration/identity/componentInstances.js +61 -0
  291. package/dist/esm/configuration/identity/componentInstances.js.map +1 -0
  292. package/dist/esm/configuration/identity/componentMarker.d.ts +9 -0
  293. package/dist/esm/configuration/identity/componentMarker.d.ts.map +1 -0
  294. package/dist/esm/configuration/identity/componentMarker.js +7 -0
  295. package/dist/esm/configuration/identity/componentMarker.js.map +1 -0
  296. package/dist/esm/configuration/identity/describeComponent.d.ts +11 -0
  297. package/dist/esm/configuration/identity/describeComponent.d.ts.map +1 -0
  298. package/dist/esm/configuration/identity/describeComponent.js +4 -0
  299. package/dist/esm/configuration/identity/describeComponent.js.map +1 -0
  300. package/dist/esm/configuration/identity/useComponentPresentation.d.ts +15 -0
  301. package/dist/esm/configuration/identity/useComponentPresentation.d.ts.map +1 -0
  302. package/dist/esm/configuration/identity/useComponentPresentation.js +18 -0
  303. package/dist/esm/configuration/identity/useComponentPresentation.js.map +1 -0
  304. package/dist/esm/index.d.ts +3 -0
  305. package/dist/esm/index.d.ts.map +1 -1
  306. package/dist/esm/renderer/dialogStack.d.ts +2 -0
  307. package/dist/esm/renderer/dialogStack.d.ts.map +1 -1
  308. package/dist/esm/renderer/dialogStack.js +2 -1
  309. package/dist/esm/renderer/dialogStack.js.map +1 -1
  310. package/dist/esm/types/parts.d.ts +25 -2
  311. package/dist/esm/types/parts.d.ts.map +1 -1
  312. package/dist/esm/types/parts.js +25 -2
  313. package/dist/esm/types/parts.js.map +1 -1
  314. package/package.json +5 -1
@@ -0,0 +1,70 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { createPortal } from 'react-dom';
3
+ import { useState, useEffect } from 'react';
4
+ import { unstable_useOverlayEnvironment } from '../renderer/RendererContext.js';
5
+ import { pickerZIndex } from './pickerStacking.js';
6
+
7
+ const useEnvironmentContainer = () => {
8
+ const environment = unstable_useOverlayEnvironment();
9
+ const [container, setContainer] = useState(null);
10
+ useEffect(() => {
11
+ setContainer(environment.getContainer());
12
+ }, [environment]);
13
+ return container;
14
+ };
15
+ const useRemeasure = (active) => {
16
+ const [, setTick] = useState(0);
17
+ useEffect(() => {
18
+ if (!active)
19
+ return;
20
+ const update = () => setTick((tick) => tick + 1);
21
+ window.addEventListener('scroll', update, true);
22
+ window.addEventListener('resize', update);
23
+ return () => {
24
+ window.removeEventListener('scroll', update, true);
25
+ window.removeEventListener('resize', update);
26
+ };
27
+ }, [active]);
28
+ };
29
+ const HighlightFrame = ({ element, label, announcement, kind }) => {
30
+ const container = useEnvironmentContainer();
31
+ useRemeasure(element !== null);
32
+ if (!container)
33
+ return null;
34
+ const rect = element?.getBoundingClientRect();
35
+ const zIndex = pickerZIndex();
36
+ const labelAbove = rect ? rect.top > 28 : true;
37
+ return createPortal(jsxs("div", { "data-cratis-part": 'overlay', "data-cratis-kind": kind, "data-live-announcer": 'true', "data-react-aria-top-layer": 'true', "data-cratis-picker-ignore": 'true', style: { position: 'fixed', inset: 0, pointerEvents: 'none', zIndex }, children: [announcement !== undefined && (jsx("div", { role: 'status', "aria-live": 'polite', style: {
38
+ position: 'absolute',
39
+ width: 1,
40
+ height: 1,
41
+ overflow: 'hidden',
42
+ clipPath: 'inset(50%)',
43
+ whiteSpace: 'nowrap',
44
+ }, children: announcement })), rect && (jsx("div", { "data-cratis-part": 'frame', "aria-hidden": 'true', style: {
45
+ position: 'fixed',
46
+ top: rect.top,
47
+ left: rect.left,
48
+ width: rect.width,
49
+ height: rect.height,
50
+ boxSizing: 'border-box',
51
+ outline: '2px solid var(--cratis-focus-ring-color, Highlight)',
52
+ outlineOffset: 1,
53
+ background: 'color-mix(in srgb, var(--cratis-focus-ring-color, Highlight) 12%, transparent)',
54
+ borderRadius: 'var(--cratis-border-radius, 4px)',
55
+ }, children: label && (jsx("span", { "data-cratis-part": 'name', style: {
56
+ position: 'absolute',
57
+ left: 0,
58
+ [labelAbove ? 'bottom' : 'top']: '100%',
59
+ marginBlock: 4,
60
+ padding: '2px 6px',
61
+ whiteSpace: 'nowrap',
62
+ font: '600 12px/1.4 system-ui, sans-serif',
63
+ color: 'var(--cratis-surface-background, Canvas)',
64
+ background: 'var(--cratis-text-color, CanvasText)',
65
+ borderRadius: 'var(--cratis-border-radius, 4px)',
66
+ }, children: label })) }))] }), container);
67
+ };
68
+
69
+ export { HighlightFrame };
70
+ //# sourceMappingURL=HighlightFrame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighlightFrame.js","sources":["../../../ComponentPicker/HighlightFrame.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { createPortal } from 'react-dom';\nimport { useEffect, useState } from 'react';\nimport { unstable_useOverlayEnvironment } from '../renderer/RendererContext';\nimport { pickerZIndex } from './pickerStacking';\n\n/** Props for {@link HighlightFrame}. */\nexport interface HighlightFrameProps {\n /** The element to frame. */\n element: Element | null;\n /** Text for the tooltip above (or below) the frame. */\n label?: string;\n /** Announced politely when the framed element changes. Omit for a passive, silent frame. */\n announcement?: string;\n /** Which overlay this is, rendered as `data-cratis-kind` so the two can be told apart. */\n kind: 'picker' | 'highlight';\n}\n\nconst useEnvironmentContainer = () => {\n const environment = unstable_useOverlayEnvironment();\n const [container, setContainer] = useState<HTMLElement | null>(null);\n useEffect(() => {\n setContainer(environment.getContainer());\n }, [environment]);\n return container;\n};\n\n/** Re-measures when the page scrolls or resizes. */\nconst useRemeasure = (active: boolean) => {\n const [, setTick] = useState(0);\n useEffect(() => {\n if (!active) return;\n const update = () => setTick((tick) => tick + 1);\n window.addEventListener('scroll', update, true);\n window.addEventListener('resize', update);\n return () => {\n window.removeEventListener('scroll', update, true);\n window.removeEventListener('resize', update);\n };\n }, [active]);\n};\n\n/** The shared outline and name tooltip drawn by {@link ComponentPicker} and {@link ComponentHighlight}. */\nexport const HighlightFrame = ({ element, label, announcement, kind }: HighlightFrameProps) => {\n const container = useEnvironmentContainer();\n useRemeasure(element !== null);\n if (!container) return null;\n\n const rect = element?.getBoundingClientRect();\n const zIndex = pickerZIndex();\n const labelAbove = rect ? rect.top > 28 : true;\n\n return createPortal(\n <div\n data-cratis-part='overlay'\n data-cratis-kind={kind}\n data-live-announcer='true'\n data-react-aria-top-layer='true'\n data-cratis-picker-ignore='true'\n style={{ position: 'fixed', inset: 0, pointerEvents: 'none', zIndex }}\n >\n {announcement !== undefined && (\n <div\n role='status'\n aria-live='polite'\n style={{\n position: 'absolute',\n width: 1,\n height: 1,\n overflow: 'hidden',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n }}\n >\n {announcement}\n </div>\n )}\n {rect && (\n <div\n data-cratis-part='frame'\n aria-hidden='true'\n style={{\n position: 'fixed',\n top: rect.top,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n boxSizing: 'border-box',\n outline: '2px solid var(--cratis-focus-ring-color, Highlight)',\n outlineOffset: 1,\n background: 'color-mix(in srgb, var(--cratis-focus-ring-color, Highlight) 12%, transparent)',\n borderRadius: 'var(--cratis-border-radius, 4px)',\n }}\n >\n {label && (\n <span\n data-cratis-part='name'\n style={{\n position: 'absolute',\n left: 0,\n [labelAbove ? 'bottom' : 'top']: '100%',\n marginBlock: 4,\n padding: '2px 6px',\n whiteSpace: 'nowrap',\n font: '600 12px/1.4 system-ui, sans-serif',\n color: 'var(--cratis-surface-background, Canvas)',\n background: 'var(--cratis-text-color, CanvasText)',\n borderRadius: 'var(--cratis-border-radius, 4px)',\n }}\n >\n {label}\n </span>\n )}\n </div>\n )}\n </div>,\n container,\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;AAoBA,MAAM,uBAAuB,GAAG,MAAK;AACjC,IAAA,MAAM,WAAW,GAAG,8BAA8B,EAAE;IACpD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAqB,IAAI,CAAC;IACpE,SAAS,CAAC,MAAK;AACX,QAAA,YAAY,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;AAC5C,IAAA,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AACjB,IAAA,OAAO,SAAS;AACpB,CAAC;AAGD,MAAM,YAAY,GAAG,CAAC,MAAe,KAAI;IACrC,MAAM,GAAG,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IAC/B,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,CAAC,MAAM;YAAE;AACb,QAAA,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CA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ncestor {
3
+ /** The component name, from `data-cratis-component`. */
4
+ component: string;
5
+ /** The consumer's `id` or `name` for it, when it had one. */
6
+ id?: string;
7
+ /** The component root element. */
8
+ element: Element;
9
+ }
10
+ //# sourceMappingURL=PickedAncestor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickedAncestor.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/PickedAncestor.ts"],"names":[],"mappings":"AAGA,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC3B,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=PickedAncestor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickedAncestor.js","sourceRoot":"","sources":["../../../ComponentPicker/PickedAncestor.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** A component enclosing a picked component. */\nexport interface PickedAncestor {\n /** The component name, from `data-cratis-component`. */\n component: string;\n /** The consumer's `id` or `name` for it, when it had one. */\n id?: string;\n /** The component root element. */\n element: Element;\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import type { PickedAncestor } from './PickedAncestor.js';
2
+ import type { PickedPresentationProperty } from './PickedPresentationProperty.js';
3
+ import type { PickedRect } from './PickedRect.js';
4
+ /** What the picker found: a component, where it is, and what can be changed on it. */
5
+ export interface PickedComponent {
6
+ /** The component name, from `data-cratis-component`. */
7
+ component: string;
8
+ /** The consumer's `id` or `name` for it, when it had one. */
9
+ id?: string;
10
+ /** The `data-cratis-part` the pointer or focus was on inside the component, when there was one. */
11
+ part?: string;
12
+ /** The component root element. */
13
+ element: Element;
14
+ /** The component's rectangle when it was picked. */
15
+ rect: PickedRect;
16
+ /** The component's presentation properties with their rendered values. Empty when it declares none. */
17
+ presentationProperties: readonly PickedPresentationProperty[];
18
+ /** The enclosing components, nearest first. */
19
+ ancestors: readonly PickedAncestor[];
20
+ /** What the host's `ComponentResolver` returned for this component. */
21
+ context: Record<string, unknown>;
22
+ }
23
+ //# sourceMappingURL=PickedComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickedComponent.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/PickedComponent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAE/C,sFAAsF;AACtF,MAAM,WAAW,eAAe;IAC5B,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mGAAmG;IACnG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,oDAAoD;IACpD,IAAI,EAAE,UAAU,CAAC;IACjB,uGAAuG;IACvG,sBAAsB,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAC9D,+CAA+C;IAC/C,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IACrC,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=PickedComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickedComponent.js","sourceRoot":"","sources":["../../../ComponentPicker/PickedComponent.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { PickedAncestor } from './PickedAncestor';\nimport type { PickedPresentationProperty } from './PickedPresentationProperty';\nimport type { PickedRect } from './PickedRect';\n\n/** What the picker found: a component, where it is, and what can be changed on it. */\nexport interface PickedComponent {\n /** The component name, from `data-cratis-component`. */\n component: string;\n /** The consumer's `id` or `name` for it, when it had one. */\n id?: string;\n /** The `data-cratis-part` the pointer or focus was on inside the component, when there was one. */\n part?: string;\n /** The component root element. */\n element: Element;\n /** The component's rectangle when it was picked. */\n rect: PickedRect;\n /** The component's presentation properties with their rendered values. Empty when it declares none. */\n presentationProperties: readonly PickedPresentationProperty[];\n /** The enclosing components, nearest first. */\n ancestors: readonly PickedAncestor[];\n /** What the host's `ComponentResolver` returned for this component. */\n context: Record<string, unknown>;\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import type { PresentationPropertyType } from '../configuration/identity/PresentationPropertyType.js';
2
+ import type { PresentationPropertyValue } from '../configuration/identity/PresentationPropertyValue.js';
3
+ /** One presentation property of a picked component, with the value it was rendered with. */
4
+ export interface PickedPresentationProperty {
5
+ /** The prop name. */
6
+ name: string;
7
+ /** Human-readable label. */
8
+ label: string;
9
+ /** How the property is edited. */
10
+ type: PresentationPropertyType;
11
+ /** The allowed values of an enumeration. */
12
+ values?: readonly (string | number)[];
13
+ /** What the property changes. */
14
+ description?: string;
15
+ /** The value the component uses when the prop is not set. */
16
+ defaultValue?: PresentationPropertyValue;
17
+ /** The value the component was rendered with. `undefined` when the prop is not set. */
18
+ value: PresentationPropertyValue;
19
+ /** `false` when the rendered value is not a plain string, number or boolean, so it cannot be edited here. */
20
+ editable: boolean;
21
+ }
22
+ //# sourceMappingURL=PickedPresentationProperty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickedPresentationProperty.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/PickedPresentationProperty.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uDAAoD,CAAC;AACnG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wDAAqD,CAAC;AAErG,4FAA4F;AAC5F,MAAM,WAAW,0BAA0B;IACvC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACtC,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,uFAAuF;IACvF,KAAK,EAAE,yBAAyB,CAAC;IACjC,6GAA6G;IAC7G,QAAQ,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=PickedPresentationProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickedPresentationProperty.js","sourceRoot":"","sources":["../../../ComponentPicker/PickedPresentationProperty.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { PresentationPropertyType } from '../configuration/identity/PresentationPropertyType';\nimport type { PresentationPropertyValue } from '../configuration/identity/PresentationPropertyValue';\n\n/** One presentation property of a picked component, with the value it was rendered with. */\nexport interface PickedPresentationProperty {\n /** The prop name. */\n name: string;\n /** Human-readable label. */\n label: string;\n /** How the property is edited. */\n type: PresentationPropertyType;\n /** The allowed values of an enumeration. */\n values?: readonly (string | number)[];\n /** What the property changes. */\n description?: string;\n /** The value the component uses when the prop is not set. */\n defaultValue?: PresentationPropertyValue;\n /** The value the component was rendered with. `undefined` when the prop is not set. */\n value: PresentationPropertyValue;\n /** `false` when the rendered value is not a plain string, number or boolean, so it cannot be edited here. */\n editable: boolean;\n}\n"]}
@@ -0,0 +1,20 @@
1
+ /** A plain, serializable snapshot of an element's viewport rectangle. */
2
+ export interface PickedRect {
3
+ /** Left edge, in viewport pixels. */
4
+ x: number;
5
+ /** Top edge, in viewport pixels. */
6
+ y: number;
7
+ /** Width, in pixels. */
8
+ width: number;
9
+ /** Height, in pixels. */
10
+ height: number;
11
+ /** Top edge, in viewport pixels. */
12
+ top: number;
13
+ /** Right edge, in viewport pixels. */
14
+ right: number;
15
+ /** Bottom edge, in viewport pixels. */
16
+ bottom: number;
17
+ /** Left edge, in viewport pixels. */
18
+ left: number;
19
+ }
20
+ //# sourceMappingURL=PickedRect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickedRect.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/PickedRect.ts"],"names":[],"mappings":"AAGA,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACvB,qCAAqC;IACrC,CAAC,EAAE,MAAM,CAAC;IACV,oCAAoC;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=PickedRect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickedRect.js","sourceRoot":"","sources":["../../../ComponentPicker/PickedRect.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** A plain, serializable snapshot of an element's viewport rectangle. */\nexport interface PickedRect {\n /** Left edge, in viewport pixels. */\n x: number;\n /** Top edge, in viewport pixels. */\n y: number;\n /** Width, in pixels. */\n width: number;\n /** Height, in pixels. */\n height: number;\n /** Top edge, in viewport pixels. */\n top: number;\n /** Right edge, in viewport pixels. */\n right: number;\n /** Bottom edge, in viewport pixels. */\n bottom: number;\n /** Left edge, in viewport pixels. */\n left: number;\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import type { PresentationChange } from '../configuration/identity/PresentationChange.js';
2
+ import type { PickedComponent } from './PickedComponent.js';
3
+ /** Props for {@link PresentationPropertyEditor}. */
4
+ export interface PresentationPropertyEditorProps {
5
+ /** The picked component whose presentation properties are edited. */
6
+ picked: PickedComponent;
7
+ /** Called every time the proposed changes change, including with `[]` when nothing differs. Nothing is applied. */
8
+ onChange: (changes: PresentationChange[]) => void;
9
+ /**
10
+ * Applies the proposed changes to the rendered component while editing, through the same
11
+ * registry the picker reads. The component returns to how it was when the editor unmounts,
12
+ * when this turns off, and when a change is edited back to its original value.
13
+ */
14
+ preview?: boolean;
15
+ /** Extra class name for the editor root. */
16
+ className?: string;
17
+ }
18
+ /**
19
+ * A form for the presentation properties of a {@link PickedComponent}: a text, toggle, select or
20
+ * number input per property, built from the component's descriptor. It reports the proposed changes
21
+ * as `{ property, from, to }` and never applies them to the app, except for the optional live
22
+ * `preview`.
23
+ */
24
+ export declare const PresentationPropertyEditor: ({ picked, onChange, preview, className }: PresentationPropertyEditorProps) => import("react").JSX.Element;
25
+ //# sourceMappingURL=PresentationPropertyEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresentationPropertyEditor.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/PresentationPropertyEditor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAA8C,CAAC;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAIzD,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC5C,qEAAqE;IACrE,MAAM,EAAE,eAAe,CAAC;IACxB,mHAAmH;IACnH,QAAQ,EAAE,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IAClD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAmED;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,6CAAsD,+BAA+B,gCA+C3H,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useId, useState, useMemo, useRef, useEffect } from 'react';
3
+ import { previewPresentationChanges } from '../configuration/identity/componentInstances.js';
4
+ import { proposedChanges } from './proposedChanges.js';
5
+
6
+ const unsetValue = '';
7
+ const field = (property, id, value, set) => {
8
+ const common = { id, disabled: !property.editable, 'data-cratis-part': 'input' };
9
+ switch (property.type) {
10
+ case 'boolean':
11
+ return (jsx("input", { ...common, type: 'checkbox', checked: value === true, onChange: (event) => set(event.currentTarget.checked) }));
12
+ case 'number':
13
+ return (jsx("input", { ...common, className: 'cratis-text-input', type: 'number', value: typeof value === 'number' ? value : '', onChange: (event) => set(event.currentTarget.value === '' ? undefined : Number(event.currentTarget.value)) }));
14
+ case 'enum':
15
+ return (jsxs("select", { ...common, className: 'cratis-text-input', value: value === undefined ? unsetValue : String(value), onChange: (event) => {
16
+ const chosen = event.currentTarget.value;
17
+ set(chosen === unsetValue ? undefined : property.values?.find((v) => String(v) === chosen));
18
+ }, children: [jsx("option", { value: unsetValue, children: property.defaultValue === undefined ? '(not set)' : `(default: ${String(property.defaultValue)})` }), property.values?.map((option) => (jsx("option", { value: String(option), children: String(option) }, String(option))))] }));
19
+ default:
20
+ return (jsx("input", { ...common, className: 'cratis-text-input', type: 'text', value: typeof value === 'string' ? value : '', onChange: (event) => set(event.currentTarget.value) }));
21
+ }
22
+ };
23
+ const PresentationPropertyEditor = ({ picked, onChange, preview = false, className }) => {
24
+ const prefix = useId();
25
+ const [draft, setDraft] = useState({});
26
+ const changes = useMemo(() => proposedChanges(picked, draft), [picked, draft]);
27
+ const reportChange = useRef(onChange);
28
+ reportChange.current = onChange;
29
+ useEffect(() => {
30
+ setDraft({});
31
+ }, [picked]);
32
+ useEffect(() => {
33
+ reportChange.current(changes);
34
+ }, [changes]);
35
+ useEffect(() => {
36
+ if (!preview || changes.length === 0)
37
+ return;
38
+ return previewPresentationChanges(picked.element, changes);
39
+ }, [preview, changes, picked.element]);
40
+ if (picked.presentationProperties.length === 0) {
41
+ return (jsxs("p", { "data-cratis-part": 'empty', className: className, children: [picked.component, " has no properties that can be changed here."] }));
42
+ }
43
+ return (jsx("div", { "data-cratis-part": 'root', "data-cratis-component": 'PresentationPropertyEditor', className: className, children: picked.presentationProperties.map((property) => {
44
+ const id = `${prefix}-${property.name}`;
45
+ const value = property.name in draft ? draft[property.name] : property.value;
46
+ return (jsxs("div", { "data-cratis-part": 'property', children: [jsx("label", { htmlFor: id, "data-cratis-part": 'label', children: property.label }), field(property, id, value, (next) => setDraft((current) => ({ ...current, [property.name]: next }))), property.description && jsx("small", { "data-cratis-part": 'description', children: property.description })] }, property.name));
47
+ }) }));
48
+ };
49
+
50
+ export { PresentationPropertyEditor };
51
+ //# sourceMappingURL=PresentationPropertyEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresentationPropertyEditor.js","sources":["../../../ComponentPicker/PresentationPropertyEditor.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { previewPresentationChanges } from '../configuration/identity/componentInstances';\nimport type { PresentationChange } from '../configuration/identity/PresentationChange';\nimport type { PresentationPropertyValue } from '../configuration/identity/PresentationPropertyValue';\nimport type { PickedComponent } from './PickedComponent';\nimport type { PickedPresentationProperty } from './PickedPresentationProperty';\nimport { proposedChanges } from './proposedChanges';\n\n/** Props for {@link PresentationPropertyEditor}. */\nexport interface PresentationPropertyEditorProps {\n /** The picked component whose presentation properties are edited. */\n picked: PickedComponent;\n /** Called every time the proposed changes change, including with `[]` when nothing differs. Nothing is applied. */\n onChange: (changes: PresentationChange[]) => void;\n /**\n * Applies the proposed changes to the rendered component while editing, through the same\n * registry the picker reads. The component returns to how it was when the editor unmounts,\n * when this turns off, and when a change is edited back to its original value.\n */\n preview?: boolean;\n /** Extra class name for the editor root. */\n className?: string;\n}\n\nconst unsetValue = '';\n\nconst field = (\n property: PickedPresentationProperty,\n id: string,\n value: PresentationPropertyValue,\n set: (next: PresentationPropertyValue) => void,\n) => {\n const common = { id, disabled: !property.editable, 'data-cratis-part': 'input' } as const;\n switch (property.type) {\n case 'boolean':\n return (\n <input\n {...common}\n type='checkbox'\n checked={value === true}\n onChange={(event) => set(event.currentTarget.checked)}\n />\n );\n case 'number':\n return (\n <input\n {...common}\n className='cratis-text-input'\n type='number'\n value={typeof value === 'number' ? value : ''}\n onChange={(event) =>\n set(event.currentTarget.value === '' ? undefined : Number(event.currentTarget.value))\n }\n />\n );\n case 'enum':\n return (\n <select\n {...common}\n className='cratis-text-input'\n value={value === undefined ? unsetValue : String(value)}\n onChange={(event) => {\n const chosen = event.currentTarget.value;\n set(chosen === unsetValue ? undefined : property.values?.find((v) => String(v) === chosen));\n }}\n >\n <option value={unsetValue}>\n {property.defaultValue === undefined ? '(not set)' : `(default: ${String(property.defaultValue)})`}\n </option>\n {property.values?.map((option) => (\n <option key={String(option)} value={String(option)}>\n {String(option)}\n </option>\n ))}\n </select>\n );\n default:\n return (\n <input\n {...common}\n className='cratis-text-input'\n type='text'\n value={typeof value === 'string' ? value : ''}\n onChange={(event) => set(event.currentTarget.value)}\n />\n );\n }\n};\n\n/**\n * A form for the presentation properties of a {@link PickedComponent}: a text, toggle, select or\n * number input per property, built from the component's descriptor. It reports the proposed changes\n * as `{ property, from, to }` and never applies them to the app, except for the optional live\n * `preview`.\n */\nexport const PresentationPropertyEditor = ({ picked, onChange, preview = false, className }: PresentationPropertyEditorProps) => {\n const prefix = useId();\n const [draft, setDraft] = useState<Record<string, PresentationPropertyValue>>({});\n const changes = useMemo(() => proposedChanges(picked, draft), [picked, draft]);\n const reportChange = useRef(onChange);\n reportChange.current = onChange;\n\n useEffect(() => {\n setDraft({});\n }, [picked]);\n\n useEffect(() => {\n reportChange.current(changes);\n }, [changes]);\n\n useEffect(() => {\n if (!preview || changes.length === 0) return;\n return previewPresentationChanges(picked.element, changes);\n }, [preview, changes, picked.element]);\n\n if (picked.presentationProperties.length === 0) {\n return (\n <p data-cratis-part='empty' className={className}>\n {picked.component} has no properties that can be changed here.\n </p>\n );\n }\n\n return (\n <div data-cratis-part='root' data-cratis-component='PresentationPropertyEditor' className={className}>\n {picked.presentationProperties.map((property) => {\n const id = `${prefix}-${property.name}`;\n const value = property.name in draft ? draft[property.name] : property.value;\n return (\n <div key={property.name} data-cratis-part='property'>\n <label htmlFor={id} data-cratis-part='label'>\n {property.label}\n </label>\n {field(property, id, value, (next) =>\n setDraft((current) => ({ ...current, [property.name]: next })),\n )}\n {property.description && <small data-cratis-part='description'>{property.description}</small>}\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AA2BA,MAAM,UAAU,GAAG,EAAE;AAErB,MAAM,KAAK,GAAG,CACV,QAAoC,EACpC,EAAU,EACV,KAAgC,EAChC,GAA8C,KAC9C;AACA,IAAA,MAAM,MAAM,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CA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C7B,QAAQ,CAAC,CAAC,OAAO,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC,CACjE,EACA,QAAQ,CAAC,WAAW,IAAIA,GAAA,CAAA,OAAA,EAAA,EAAA,kBAAA,EAAwB,aAAa,YAAE,QAAQ,CAAC,WAAW,EAAA,CAAS,KAPvF,QAAQ,CAAC,IAAI,CAQjB;QAEd,CAAC,CAAC,EAAA,CACA;AAEd;;"}
@@ -0,0 +1,14 @@
1
+ /** The nearest component root at or above an element, or `null`. */
2
+ export declare const nearestComponent: (element: Element | null) => Element | null;
3
+ /** The component root enclosing another component root, or `null`. */
4
+ export declare const parentComponent: (component: Element) => Element | null;
5
+ /** The component roots whose nearest enclosing component is `parent`, in document order. */
6
+ export declare const childComponents: (parent: Element) => Element[];
7
+ /** The component roots sharing `component`'s parent (or, for a top-level one, the top-level roots in `scope`). */
8
+ export declare const siblingComponents: (component: Element, scope: ParentNode) => Element[];
9
+ /**
10
+ * The element keyboard navigation moves within: the topmost open dialog when there is one, so
11
+ * picking never leaves a modal, otherwise the document.
12
+ */
13
+ export declare const navigationScope: (document: Document) => ParentNode;
14
+ //# sourceMappingURL=componentElements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentElements.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/componentElements.ts"],"names":[],"mappings":"AAKA,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,YAAa,OAAO,GAAG,IAAI,KAAG,OAAO,GAAG,IACd,CAAC;AAExD,sEAAsE;AACtE,eAAO,MAAM,eAAe,cAAe,OAAO,KAAG,OAAO,GAAG,IAClB,CAAC;AAE9C,4FAA4F;AAC5F,eAAO,MAAM,eAAe,WAAY,OAAO,KAAG,OAAO,EAGpD,CAAC;AAEN,kHAAkH;AAClH,eAAO,MAAM,iBAAiB,cAAe,OAAO,SAAS,UAAU,KAAG,OAAO,EAOhF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,aAAc,QAAQ,KAAG,UAGpD,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { componentAttribute } from '../configuration/identity/componentIdentityAttributes.js';
2
+
3
+ const nearestComponent = (element) => element?.closest(`[${componentAttribute}]`) ?? null;
4
+ const parentComponent = (component) => nearestComponent(component.parentElement);
5
+ const childComponents = (parent) => Array.from(parent.querySelectorAll(`[${componentAttribute}]`)).filter((candidate) => parentComponent(candidate) === parent);
6
+ const siblingComponents = (component, scope) => {
7
+ const parent = parentComponent(component);
8
+ return parent
9
+ ? childComponents(parent)
10
+ : Array.from(scope.querySelectorAll(`[${componentAttribute}]`)).filter((candidate) => parentComponent(candidate) === null);
11
+ };
12
+ const navigationScope = (document) => {
13
+ const dialogs = document.querySelectorAll(`[${componentAttribute}="Dialog"]`);
14
+ return dialogs.length > 0 ? dialogs[dialogs.length - 1].parentElement ?? document : document;
15
+ };
16
+
17
+ export { childComponents, navigationScope, nearestComponent, parentComponent, siblingComponents };
18
+ //# sourceMappingURL=componentElements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentElements.js","sources":["../../../ComponentPicker/componentElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { componentAttribute } from '../configuration/identity/componentIdentityAttributes';\n\n/** The nearest component root at or above an element, or `null`. */\nexport const nearestComponent = (element: Element | null): Element | null =>\n element?.closest(`[${componentAttribute}]`) ?? null;\n\n/** The component root enclosing another component root, or `null`. */\nexport const parentComponent = (component: Element): Element | null =>\n nearestComponent(component.parentElement);\n\n/** The component roots whose nearest enclosing component is `parent`, in document order. */\nexport const childComponents = (parent: Element): Element[] =>\n Array.from(parent.querySelectorAll(`[${componentAttribute}]`)).filter(\n (candidate) => parentComponent(candidate) === parent,\n );\n\n/** The component roots sharing `component`'s parent (or, for a top-level one, the top-level roots in `scope`). */\nexport const siblingComponents = (component: Element, scope: ParentNode): Element[] => {\n const parent = parentComponent(component);\n return parent\n ? childComponents(parent)\n : Array.from(scope.querySelectorAll(`[${componentAttribute}]`)).filter(\n (candidate) => parentComponent(candidate) === null,\n );\n};\n\n/**\n * The element keyboard navigation moves within: the topmost open dialog when there is one, so\n * picking never leaves a modal, otherwise the document.\n */\nexport const navigationScope = (document: Document): ParentNode => {\n const dialogs = document.querySelectorAll(`[${componentAttribute}=\"Dialog\"]`);\n return dialogs.length > 0 ? dialogs[dialogs.length - 1].parentElement ?? document : document;\n};\n"],"names":[],"mappings":";;AAMO,MAAM,gBAAgB,GAAG,CAAC,OAAuB,KACpD,OAAO,EAAE,OAAO,CAAC,CAAA,CAAA,EAAI,kBAAkB,GAAG,CAAC,IAAI;AAG5C,MAAM,eAAe,GAAG,CAAC,SAAkB,KAC9C,gBAAgB,CAAC,SAAS,CAAC,aAAa;AAGrC,MAAM,eAAe,GAAG,CAAC,MAAe,KAC3C,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA,CAAA,EAAI,kBAAkB,CAAA,CAAA,CAAG,CAAC,CAAC,CAAC,MAAM,CACjE,CAAC,SAAS,KAAK,eAAe,CAAC,SAAS,CAAC,KAAK,MAAM;MAI/C,iBAAiB,GAAG,CAAC,SAAkB,EAAE,KAAiB,KAAe;AAClF,IAAA,MAAM,MAAM,GAAG,eAAe,CAAC,SAAS,CAAC;AACzC,IAAA,OAAO;AACH,UAAE,eAAe,CAAC,MAAM;AACxB,UAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA,CAAA,EAAI,kBAAkB,CAAA,CAAA,CAAG,CAAC,CAAC,CAAC,MAAM,CAChE,CAAC,SAAS,KAAK,eAAe,CAAC,SAAS,CAAC,KAAK,IAAI,CACrD;AACX;AAMO,MAAM,eAAe,GAAG,CAAC,QAAkB,KAAgB;IAC9D,MAAM,OAAO,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAA,CAAA,EAAI,kBAAkB,CAAA,UAAA,CAAY,CAAC;IAC7E,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,IAAI,QAAQ,GAAG,QAAQ;AAChG;;"}
@@ -0,0 +1,11 @@
1
+ import type { ComponentResolver } from './ComponentResolver.js';
2
+ import type { PickedComponent } from './PickedComponent.js';
3
+ /**
4
+ * Describes a component root as a {@link PickedComponent}.
5
+ * @param root - The component root element (an element carrying `data-cratis-component`).
6
+ * @param target - The element the pointer or focus was on, to report the part.
7
+ * @param resolve - The host's context resolver.
8
+ * @returns The description.
9
+ */
10
+ export declare const describeComponentElement: (root: Element, target?: Element | null, resolve?: ComponentResolver) => PickedComponent;
11
+ //# sourceMappingURL=describeComponentElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describeComponentElement.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/describeComponentElement.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAgDzD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,SAC3B,OAAO,WACJ,OAAO,GAAG,IAAI,YACb,iBAAiB,KAC5B,eAgBF,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { componentIdAttribute, componentAttribute } from '../configuration/identity/componentIdentityAttributes.js';
2
+ import { registeredComponentFor } from '../configuration/identity/componentInstances.js';
3
+ import { nearestComponent, parentComponent } from './componentElements.js';
4
+
5
+ const snapshot = (rect) => ({
6
+ x: rect.x,
7
+ y: rect.y,
8
+ width: rect.width,
9
+ height: rect.height,
10
+ top: rect.top,
11
+ right: rect.right,
12
+ bottom: rect.bottom,
13
+ left: rect.left,
14
+ });
15
+ const isPlain = (value) => value === undefined || ['string', 'number', 'boolean'].includes(typeof value);
16
+ const propertiesOf = (root) => {
17
+ const registered = registeredComponentFor(root);
18
+ if (!registered)
19
+ return [];
20
+ return registered.descriptor.properties.map((property) => {
21
+ const value = registered.props[property.name];
22
+ return {
23
+ name: property.name,
24
+ label: property.label,
25
+ type: property.type,
26
+ values: property.type === 'enum' ? property.values : undefined,
27
+ description: property.description,
28
+ defaultValue: property.defaultValue,
29
+ value: isPlain(value) ? value : undefined,
30
+ editable: isPlain(value),
31
+ };
32
+ });
33
+ };
34
+ const ancestorsOf = (root) => {
35
+ const ancestors = [];
36
+ for (let parent = parentComponent(root); parent; parent = parentComponent(parent)) {
37
+ ancestors.push({
38
+ component: parent.getAttribute(componentAttribute) ?? '',
39
+ id: parent.getAttribute(componentIdAttribute) ?? undefined,
40
+ element: parent,
41
+ });
42
+ }
43
+ return ancestors;
44
+ };
45
+ const describeComponentElement = (root, target, resolve) => {
46
+ const partElement = target && root.contains(target) ? target.closest('[data-cratis-part]') : null;
47
+ const part = partElement && root.contains(partElement) && nearestComponent(partElement) === root
48
+ ? (partElement.getAttribute('data-cratis-part') ?? undefined)
49
+ : undefined;
50
+ return {
51
+ component: root.getAttribute(componentAttribute) ?? '',
52
+ id: root.getAttribute(componentIdAttribute) ?? undefined,
53
+ part,
54
+ element: root,
55
+ rect: snapshot(root.getBoundingClientRect()),
56
+ presentationProperties: propertiesOf(root),
57
+ ancestors: ancestorsOf(root),
58
+ context: resolve?.(root) ?? {},
59
+ };
60
+ };
61
+
62
+ export { describeComponentElement };
63
+ //# sourceMappingURL=describeComponentElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describeComponentElement.js","sources":["../../../ComponentPicker/describeComponentElement.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n componentAttribute,\n componentIdAttribute,\n} from '../configuration/identity/componentIdentityAttributes';\nimport { registeredComponentFor } from '../configuration/identity/componentInstances';\nimport { nearestComponent, parentComponent } from './componentElements';\nimport type { ComponentResolver } from './ComponentResolver';\nimport type { PickedAncestor } from './PickedAncestor';\nimport type { PickedComponent } from './PickedComponent';\nimport type { PickedPresentationProperty } from './PickedPresentationProperty';\nimport type { PickedRect } from './PickedRect';\n\nconst snapshot = (rect: DOMRect): PickedRect => ({\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n});\n\nconst isPlain = (value: unknown): value is string | number | boolean | undefined =>\n value === undefined || ['string', 'number', 'boolean'].includes(typeof value);\n\nconst propertiesOf = (root: Element): PickedPresentationProperty[] => {\n const registered = registeredComponentFor(root);\n if (!registered) return [];\n return registered.descriptor.properties.map((property) => {\n const value = registered.props[property.name];\n return {\n name: property.name,\n label: property.label,\n type: property.type,\n values: property.type === 'enum' ? property.values : undefined,\n description: property.description,\n defaultValue: property.defaultValue,\n value: isPlain(value) ? value : undefined,\n editable: isPlain(value),\n };\n });\n};\n\nconst ancestorsOf = (root: Element): PickedAncestor[] => {\n const ancestors: PickedAncestor[] = [];\n for (let parent = parentComponent(root); parent; parent = parentComponent(parent)) {\n ancestors.push({\n component: parent.getAttribute(componentAttribute) ?? '',\n id: parent.getAttribute(componentIdAttribute) ?? undefined,\n element: parent,\n });\n }\n return ancestors;\n};\n\n/**\n * Describes a component root as a {@link PickedComponent}.\n * @param root - The component root element (an element carrying `data-cratis-component`).\n * @param target - The element the pointer or focus was on, to report the part.\n * @param resolve - The host's context resolver.\n * @returns The description.\n */\nexport const describeComponentElement = (\n root: Element,\n target?: Element | null,\n resolve?: ComponentResolver,\n): PickedComponent => {\n const partElement = target && root.contains(target) ? target.closest('[data-cratis-part]') : null;\n const part =\n partElement && root.contains(partElement) && nearestComponent(partElement) === root\n ? (partElement.getAttribute('data-cratis-part') ?? undefined)\n : undefined;\n return {\n component: root.getAttribute(componentAttribute) ?? '',\n id: root.getAttribute(componentIdAttribute) ?? undefined,\n part,\n element: root,\n rect: snapshot(root.getBoundingClientRect()),\n presentationProperties: propertiesOf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AAC,IAAI,CAAC;AAC1C,QAAA,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC;AAC5B,QAAA,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE;KACjC;AACL;;"}
@@ -0,0 +1,24 @@
1
+ export * from './ComponentHighlight.js';
2
+ export * from './ComponentPicker.js';
3
+ export * from './ComponentResolver.js';
4
+ export * from './PickedAncestor.js';
5
+ export * from './PickedComponent.js';
6
+ export * from './PickedPresentationProperty.js';
7
+ export * from './PickedRect.js';
8
+ export * from './PresentationPropertyEditor.js';
9
+ export * from './describeComponentElement.js';
10
+ export * from './proposedChanges.js';
11
+ export * from './useComponentPicker.js';
12
+ export { describeComponent } from '../configuration/identity/describeComponent.js';
13
+ export { knownComponentDescriptors, previewPresentationChanges, registeredComponentFor, } from '../configuration/identity/componentInstances.js';
14
+ export { componentAttribute, componentIdAttribute, componentInstanceAttribute, } from '../configuration/identity/componentIdentityAttributes.js';
15
+ export type { ComponentDescriptor } from '../configuration/identity/ComponentDescriptor.js';
16
+ export type { PresentationChange } from '../configuration/identity/PresentationChange.js';
17
+ export type { PresentationPropertyDescriptor } from '../configuration/identity/PresentationPropertyDescriptor.js';
18
+ export type { PresentationPropertyType } from '../configuration/identity/PresentationPropertyType.js';
19
+ export type { PresentationPropertyValue } from '../configuration/identity/PresentationPropertyValue.js';
20
+ export type { RegisteredComponent } from '../configuration/identity/RegisteredComponent.js';
21
+ export { useComponentPresentation } from '../configuration/identity/useComponentPresentation.js';
22
+ export { componentMarker } from '../configuration/identity/componentMarker.js';
23
+ export type { ComponentMarkerAttributes } from '../configuration/identity/ComponentMarkerAttributes.js';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/index.ts"],"names":[],"mappings":"AAGA,cAAc,yBAAsB,CAAC;AACrC,cAAc,sBAAmB,CAAC;AAClC,cAAc,wBAAqB,CAAC;AACpC,cAAc,qBAAkB,CAAC;AACjC,cAAc,sBAAmB,CAAC;AAClC,cAAc,iCAA8B,CAAC;AAC7C,cAAc,iBAAc,CAAC;AAC7B,cAAc,iCAA8B,CAAC;AAC7C,cAAc,+BAA4B,CAAC;AAC3C,cAAc,sBAAmB,CAAC;AAClC,cAAc,yBAAsB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAA6C,CAAC;AAChF,OAAO,EACH,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,GACzB,MAAM,iDAA8C,CAAC;AACtD,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,GAC7B,MAAM,0DAAuD,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAM,kDAA+C,CAAC;AACzF,YAAY,EAAE,kBAAkB,EAAE,MAAM,iDAA8C,CAAC;AACvF,YAAY,EAAE,8BAA8B,EAAE,MAAM,6DAA0D,CAAC;AAC/G,YAAY,EAAE,wBAAwB,EAAE,MAAM,uDAAoD,CAAC;AACnG,YAAY,EAAE,yBAAyB,EAAE,MAAM,wDAAqD,CAAC;AACrG,YAAY,EAAE,mBAAmB,EAAE,MAAM,kDAA+C,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uDAAoD,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA2C,CAAC;AAC5E,YAAY,EAAE,yBAAyB,EAAE,MAAM,wDAAqD,CAAC"}
@@ -0,0 +1,12 @@
1
+ export { ComponentHighlight } from './ComponentHighlight.js';
2
+ export { ComponentPicker } from './ComponentPicker.js';
3
+ export { PresentationPropertyEditor } from './PresentationPropertyEditor.js';
4
+ export { describeComponentElement } from './describeComponentElement.js';
5
+ export { proposedChanges } from './proposedChanges.js';
6
+ export { useComponentPicker } from './useComponentPicker.js';
7
+ export { describeComponent } from '../configuration/identity/describeComponent.js';
8
+ export { knownComponentDescriptors, previewPresentationChanges, registeredComponentFor } from '../configuration/identity/componentInstances.js';
9
+ export { componentAttribute, componentIdAttribute, componentInstanceAttribute } from '../configuration/identity/componentIdentityAttributes.js';
10
+ export { useComponentPresentation } from '../configuration/identity/useComponentPresentation.js';
11
+ export { componentMarker } from '../configuration/identity/componentMarker.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ /** The z-index that keeps picker overlays above the topmost open dialog and everything it hosts. */
2
+ export declare const pickerZIndex: () => string;
3
+ //# sourceMappingURL=pickerStacking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickerStacking.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/pickerStacking.ts"],"names":[],"mappings":"AAaA,oGAAoG;AACpG,eAAO,MAAM,YAAY,QAAO,MAG/B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { topDialogTier, zIndexAboveDialog, DIALOG_ZINDEX_TOKEN, dialogZIndexForTier } from '../renderer/dialogStack.js';
2
+
3
+ const pickerOffset = 300;
4
+ const pickerZIndex = () => {
5
+ const tier = topDialogTier();
6
+ return zIndexAboveDialog(tier === null ? DIALOG_ZINDEX_TOKEN : dialogZIndexForTier(tier), pickerOffset);
7
+ };
8
+
9
+ export { pickerZIndex };
10
+ //# sourceMappingURL=pickerStacking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickerStacking.js","sources":["../../../ComponentPicker/pickerStacking.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n DIALOG_ZINDEX_TOKEN,\n dialogZIndexForTier,\n topDialogTier,\n zIndexAboveDialog,\n} from '../renderer/dialogStack';\n\n/** Above tooltips, which sit 200 above their dialog. */\nconst pickerOffset = 300;\n\n/** The z-index that keeps picker overlays above the topmost open dialog and everything it hosts. */\nexport const pickerZIndex = (): string => {\n const tier = topDialogTier();\n return zIndexAboveDialog(tier === null ? DIALOG_ZINDEX_TOKEN : dialogZIndexForTier(tier), pickerOffset);\n};\n"],"names":[],"mappings":";;AAWA,MAAM,YAAY,GAAG,GAAG;AAGjB,MAAM,YAAY,GAAG,MAAa;AACrC,IAAA,MAAM,IAAI,GAAG,aAAa,EAAE;AAC5B,IAAA,OAAO,iBAAiB,CAAC,IAAI,KAAK,IAAI,GAAG,mBAAmB,GAAG,mBAAmB,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;AAC3G;;"}
@@ -0,0 +1,11 @@
1
+ import type { PresentationChange } from '../configuration/identity/PresentationChange.js';
2
+ import type { PresentationPropertyValue } from '../configuration/identity/PresentationPropertyValue.js';
3
+ import type { PickedComponent } from './PickedComponent.js';
4
+ /**
5
+ * The changes between a picked component's rendered values and a draft of new values.
6
+ * @param picked - The picked component.
7
+ * @param draft - New values by property name. A property missing from the draft is unchanged.
8
+ * @returns One `{ property, from, to }` per property whose value differs, in descriptor order.
9
+ */
10
+ export declare const proposedChanges: (picked: PickedComponent, draft: Readonly<Record<string, PresentationPropertyValue>>) => PresentationChange[];
11
+ //# sourceMappingURL=proposedChanges.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposedChanges.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/proposedChanges.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAA8C,CAAC;AACvF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wDAAqD,CAAC;AACrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,WAChB,eAAe,SAChB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,KAC3D,kBAAkB,EAGoF,CAAC"}
@@ -0,0 +1,6 @@
1
+ const proposedChanges = (picked, draft) => picked.presentationProperties
2
+ .filter((property) => property.editable && property.name in draft && draft[property.name] !== property.value)
3
+ .map((property) => ({ property: property.name, from: property.value, to: draft[property.name] }));
4
+
5
+ export { proposedChanges };
6
+ //# sourceMappingURL=proposedChanges.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposedChanges.js","sources":["../../../ComponentPicker/proposedChanges.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { PresentationChange } from '../configuration/identity/PresentationChange';\nimport type { PresentationPropertyValue } from '../configuration/identity/PresentationPropertyValue';\nimport type { PickedComponent } from './PickedComponent';\n\n/**\n * The changes between a picked component's rendered values and a draft of new values.\n * @param picked - The picked component.\n * @param draft - New values by property name. A property missing from the draft is unchanged.\n * @returns One `{ property, from, to }` per property whose value differs, in descriptor order.\n */\nexport const proposedChanges = (\n picked: PickedComponent,\n draft: Readonly<Record<string, PresentationPropertyValue>>,\n): PresentationChange[] =>\n picked.presentationProperties\n .filter((property) => property.editable && property.name in draft && draft[property.name] !== property.value)\n .map((property) => ({ property: property.name, from: property.value, to: draft[property.name] }));\n"],"names":[],"mappings":"AAaO,MAAM,eAAe,GAAG,CAC3B,MAAuB,EACvB,KAA0D,KAE1D,MAAM,CAAC;KACF,MAAM,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,KAAK;AAC3G,KAAA,GAAG,CAAC,CAAC,QAAQ,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;;"}