@cratis/components 4.24.0 → 4.25.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 (201) hide show
  1. package/compat-manifest.json +11 -11
  2. package/dist/esm/CommandDialog/CommandDialog.d.ts.map +1 -1
  3. package/dist/esm/CommandDialog/CommandDialog.js +1 -1
  4. package/dist/esm/CommandDialog/CommandDialog.js.map +1 -1
  5. package/dist/esm/Common/CratisComponentsProvider.d.ts +2 -0
  6. package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
  7. package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
  8. package/dist/esm/ConfigurationEditor/ConfigurationDestination.d.ts +13 -0
  9. package/dist/esm/ConfigurationEditor/ConfigurationDestination.d.ts.map +1 -0
  10. package/dist/esm/ConfigurationEditor/ConfigurationDestination.js +4 -0
  11. package/dist/esm/ConfigurationEditor/ConfigurationDestination.js.map +1 -0
  12. package/dist/esm/ConfigurationEditor/ConfigurationEditor.d.ts +27 -0
  13. package/dist/esm/ConfigurationEditor/ConfigurationEditor.d.ts.map +1 -0
  14. package/dist/esm/ConfigurationEditor/ConfigurationEditor.js +13 -0
  15. package/dist/esm/ConfigurationEditor/ConfigurationEditor.js.map +1 -0
  16. package/dist/esm/ConfigurationEditor/ConfigurationEditorPartAttributes.d.ts +6 -0
  17. package/dist/esm/ConfigurationEditor/ConfigurationEditorPartAttributes.d.ts.map +1 -0
  18. package/dist/esm/ConfigurationEditor/ConfigurationEditorPartAttributes.js +4 -0
  19. package/dist/esm/ConfigurationEditor/ConfigurationEditorPartAttributes.js.map +1 -0
  20. package/dist/esm/ConfigurationEditor/ConfigurationEditorProvider.d.ts +28 -0
  21. package/dist/esm/ConfigurationEditor/ConfigurationEditorProvider.d.ts.map +1 -0
  22. package/dist/esm/ConfigurationEditor/ConfigurationEditorProvider.js +16 -0
  23. package/dist/esm/ConfigurationEditor/ConfigurationEditorProvider.js.map +1 -0
  24. package/dist/esm/ConfigurationEditor/ConfigurationEditorRenderProps.d.ts +20 -0
  25. package/dist/esm/ConfigurationEditor/ConfigurationEditorRenderProps.d.ts.map +1 -0
  26. package/dist/esm/ConfigurationEditor/ConfigurationEditorRenderProps.js +4 -0
  27. package/dist/esm/ConfigurationEditor/ConfigurationEditorRenderProps.js.map +1 -0
  28. package/dist/esm/ConfigurationEditor/ConfigurationEditorRenderer.d.ts +5 -0
  29. package/dist/esm/ConfigurationEditor/ConfigurationEditorRenderer.d.ts.map +1 -0
  30. package/dist/esm/ConfigurationEditor/ConfigurationEditorRenderer.js +4 -0
  31. package/dist/esm/ConfigurationEditor/ConfigurationEditorRenderer.js.map +1 -0
  32. package/dist/esm/ConfigurationEditor/ConfigurationIconReference.d.ts +17 -0
  33. package/dist/esm/ConfigurationEditor/ConfigurationIconReference.d.ts.map +1 -0
  34. package/dist/esm/ConfigurationEditor/ConfigurationIconReference.js +4 -0
  35. package/dist/esm/ConfigurationEditor/ConfigurationIconReference.js.map +1 -0
  36. package/dist/esm/ConfigurationEditor/OrderedItem.d.ts +16 -0
  37. package/dist/esm/ConfigurationEditor/OrderedItem.d.ts.map +1 -0
  38. package/dist/esm/ConfigurationEditor/OrderedItem.js +4 -0
  39. package/dist/esm/ConfigurationEditor/OrderedItem.js.map +1 -0
  40. package/dist/esm/ConfigurationEditor/OrderedItemCapabilities.d.ts +23 -0
  41. package/dist/esm/ConfigurationEditor/OrderedItemCapabilities.d.ts.map +1 -0
  42. package/dist/esm/ConfigurationEditor/OrderedItemCapabilities.js +4 -0
  43. package/dist/esm/ConfigurationEditor/OrderedItemCapabilities.js.map +1 -0
  44. package/dist/esm/ConfigurationEditor/OrderedItemDestinationField.d.ts +22 -0
  45. package/dist/esm/ConfigurationEditor/OrderedItemDestinationField.d.ts.map +1 -0
  46. package/dist/esm/ConfigurationEditor/OrderedItemDestinationField.js +23 -0
  47. package/dist/esm/ConfigurationEditor/OrderedItemDestinationField.js.map +1 -0
  48. package/dist/esm/ConfigurationEditor/OrderedItemEditor.d.ts +74 -0
  49. package/dist/esm/ConfigurationEditor/OrderedItemEditor.d.ts.map +1 -0
  50. package/dist/esm/ConfigurationEditor/OrderedItemEditor.js +188 -0
  51. package/dist/esm/ConfigurationEditor/OrderedItemEditor.js.map +1 -0
  52. package/dist/esm/ConfigurationEditor/OrderedItemEditorParts.d.ts +43 -0
  53. package/dist/esm/ConfigurationEditor/OrderedItemEditorParts.d.ts.map +1 -0
  54. package/dist/esm/ConfigurationEditor/OrderedItemEditorParts.js +4 -0
  55. package/dist/esm/ConfigurationEditor/OrderedItemEditorParts.js.map +1 -0
  56. package/dist/esm/ConfigurationEditor/OrderedItemField.d.ts +3 -0
  57. package/dist/esm/ConfigurationEditor/OrderedItemField.d.ts.map +1 -0
  58. package/dist/esm/ConfigurationEditor/OrderedItemField.js +4 -0
  59. package/dist/esm/ConfigurationEditor/OrderedItemField.js.map +1 -0
  60. package/dist/esm/ConfigurationEditor/OrderedItemFieldAccess.d.ts +9 -0
  61. package/dist/esm/ConfigurationEditor/OrderedItemFieldAccess.d.ts.map +1 -0
  62. package/dist/esm/ConfigurationEditor/OrderedItemFieldAccess.js +4 -0
  63. package/dist/esm/ConfigurationEditor/OrderedItemFieldAccess.js.map +1 -0
  64. package/dist/esm/ConfigurationEditor/OrderedItemIconField.d.ts +32 -0
  65. package/dist/esm/ConfigurationEditor/OrderedItemIconField.d.ts.map +1 -0
  66. package/dist/esm/ConfigurationEditor/OrderedItemIconField.js +26 -0
  67. package/dist/esm/ConfigurationEditor/OrderedItemIconField.js.map +1 -0
  68. package/dist/esm/ConfigurationEditor/OrderedItemIconFieldProps.d.ts +26 -0
  69. package/dist/esm/ConfigurationEditor/OrderedItemIconFieldProps.d.ts.map +1 -0
  70. package/dist/esm/ConfigurationEditor/OrderedItemIconFieldProps.js +4 -0
  71. package/dist/esm/ConfigurationEditor/OrderedItemIconFieldProps.js.map +1 -0
  72. package/dist/esm/ConfigurationEditor/OrderedItemLabels.d.ts +47 -0
  73. package/dist/esm/ConfigurationEditor/OrderedItemLabels.d.ts.map +1 -0
  74. package/dist/esm/ConfigurationEditor/OrderedItemLabels.js +4 -0
  75. package/dist/esm/ConfigurationEditor/OrderedItemLabels.js.map +1 -0
  76. package/dist/esm/ConfigurationEditor/OrderedItemOperation.d.ts +3 -0
  77. package/dist/esm/ConfigurationEditor/OrderedItemOperation.d.ts.map +1 -0
  78. package/dist/esm/ConfigurationEditor/OrderedItemOperation.js +4 -0
  79. package/dist/esm/ConfigurationEditor/OrderedItemOperation.js.map +1 -0
  80. package/dist/esm/ConfigurationEditor/OrderedItemProposal.d.ts +45 -0
  81. package/dist/esm/ConfigurationEditor/OrderedItemProposal.d.ts.map +1 -0
  82. package/dist/esm/ConfigurationEditor/OrderedItemProposal.js +4 -0
  83. package/dist/esm/ConfigurationEditor/OrderedItemProposal.js.map +1 -0
  84. package/dist/esm/ConfigurationEditor/OrderedItemRow.d.ts +5 -0
  85. package/dist/esm/ConfigurationEditor/OrderedItemRow.d.ts.map +1 -0
  86. package/dist/esm/ConfigurationEditor/OrderedItemRow.js +59 -0
  87. package/dist/esm/ConfigurationEditor/OrderedItemRow.js.map +1 -0
  88. package/dist/esm/ConfigurationEditor/OrderedItemRowProps.d.ts +43 -0
  89. package/dist/esm/ConfigurationEditor/OrderedItemRowProps.d.ts.map +1 -0
  90. package/dist/esm/ConfigurationEditor/OrderedItemRowProps.js +4 -0
  91. package/dist/esm/ConfigurationEditor/OrderedItemRowProps.js.map +1 -0
  92. package/dist/esm/ConfigurationEditor/OrderedItemValidation.d.ts +7 -0
  93. package/dist/esm/ConfigurationEditor/OrderedItemValidation.d.ts.map +1 -0
  94. package/dist/esm/ConfigurationEditor/OrderedItemValidation.js +4 -0
  95. package/dist/esm/ConfigurationEditor/OrderedItemValidation.js.map +1 -0
  96. package/dist/esm/ConfigurationEditor/PropertyChangeProposal.d.ts +15 -0
  97. package/dist/esm/ConfigurationEditor/PropertyChangeProposal.d.ts.map +1 -0
  98. package/dist/esm/ConfigurationEditor/PropertyChangeProposal.js +4 -0
  99. package/dist/esm/ConfigurationEditor/PropertyChangeProposal.js.map +1 -0
  100. package/dist/esm/ConfigurationEditor/PropertyChoice.d.ts +8 -0
  101. package/dist/esm/ConfigurationEditor/PropertyChoice.d.ts.map +1 -0
  102. package/dist/esm/ConfigurationEditor/PropertyChoice.js +4 -0
  103. package/dist/esm/ConfigurationEditor/PropertyChoice.js.map +1 -0
  104. package/dist/esm/ConfigurationEditor/PropertyControl.d.ts +17 -0
  105. package/dist/esm/ConfigurationEditor/PropertyControl.d.ts.map +1 -0
  106. package/dist/esm/ConfigurationEditor/PropertyControl.js +88 -0
  107. package/dist/esm/ConfigurationEditor/PropertyControl.js.map +1 -0
  108. package/dist/esm/ConfigurationEditor/PropertyControls.d.ts +40 -0
  109. package/dist/esm/ConfigurationEditor/PropertyControls.d.ts.map +1 -0
  110. package/dist/esm/ConfigurationEditor/PropertyControls.js +41 -0
  111. package/dist/esm/ConfigurationEditor/PropertyControls.js.map +1 -0
  112. package/dist/esm/ConfigurationEditor/PropertyControlsLabels.d.ts +18 -0
  113. package/dist/esm/ConfigurationEditor/PropertyControlsLabels.d.ts.map +1 -0
  114. package/dist/esm/ConfigurationEditor/PropertyControlsLabels.js +4 -0
  115. package/dist/esm/ConfigurationEditor/PropertyControlsLabels.js.map +1 -0
  116. package/dist/esm/ConfigurationEditor/PropertyControlsParts.d.ts +31 -0
  117. package/dist/esm/ConfigurationEditor/PropertyControlsParts.d.ts.map +1 -0
  118. package/dist/esm/ConfigurationEditor/PropertyControlsParts.js +4 -0
  119. package/dist/esm/ConfigurationEditor/PropertyControlsParts.js.map +1 -0
  120. package/dist/esm/ConfigurationEditor/PropertyDescriptor.d.ts +55 -0
  121. package/dist/esm/ConfigurationEditor/PropertyDescriptor.d.ts.map +1 -0
  122. package/dist/esm/ConfigurationEditor/PropertyDescriptor.js +4 -0
  123. package/dist/esm/ConfigurationEditor/PropertyDescriptor.js.map +1 -0
  124. package/dist/esm/ConfigurationEditor/PropertyGroup.d.ts +16 -0
  125. package/dist/esm/ConfigurationEditor/PropertyGroup.d.ts.map +1 -0
  126. package/dist/esm/ConfigurationEditor/PropertyGroup.js +4 -0
  127. package/dist/esm/ConfigurationEditor/PropertyGroup.js.map +1 -0
  128. package/dist/esm/ConfigurationEditor/defaultOrderedItemLabels.d.ts +4 -0
  129. package/dist/esm/ConfigurationEditor/defaultOrderedItemLabels.d.ts.map +1 -0
  130. package/dist/esm/ConfigurationEditor/defaultOrderedItemLabels.js +25 -0
  131. package/dist/esm/ConfigurationEditor/defaultOrderedItemLabels.js.map +1 -0
  132. package/dist/esm/ConfigurationEditor/defaultPropertyControlsLabels.d.ts +4 -0
  133. package/dist/esm/ConfigurationEditor/defaultPropertyControlsLabels.d.ts.map +1 -0
  134. package/dist/esm/ConfigurationEditor/defaultPropertyControlsLabels.js +12 -0
  135. package/dist/esm/ConfigurationEditor/defaultPropertyControlsLabels.js.map +1 -0
  136. package/dist/esm/ConfigurationEditor/index.d.ts +32 -0
  137. package/dist/esm/ConfigurationEditor/index.d.ts.map +1 -0
  138. package/dist/esm/ConfigurationEditor/index.js +7 -0
  139. package/dist/esm/ConfigurationEditor/index.js.map +1 -0
  140. package/dist/esm/ConfigurationEditor/moveOrderedItem.d.ts +5 -0
  141. package/dist/esm/ConfigurationEditor/moveOrderedItem.d.ts.map +1 -0
  142. package/dist/esm/ConfigurationEditor/moveOrderedItem.js +9 -0
  143. package/dist/esm/ConfigurationEditor/moveOrderedItem.js.map +1 -0
  144. package/dist/esm/ConfigurationEditor/resolveOrderedItemDropIndex.d.ts +10 -0
  145. package/dist/esm/ConfigurationEditor/resolveOrderedItemDropIndex.d.ts.map +1 -0
  146. package/dist/esm/ConfigurationEditor/resolveOrderedItemDropIndex.js +7 -0
  147. package/dist/esm/ConfigurationEditor/resolveOrderedItemDropIndex.js.map +1 -0
  148. package/dist/esm/ConfigurationEditor/resolveOrderedItemFieldAccess.d.ts +6 -0
  149. package/dist/esm/ConfigurationEditor/resolveOrderedItemFieldAccess.d.ts.map +1 -0
  150. package/dist/esm/ConfigurationEditor/resolveOrderedItemFieldAccess.js +4 -0
  151. package/dist/esm/ConfigurationEditor/resolveOrderedItemFieldAccess.js.map +1 -0
  152. package/dist/esm/ConfigurationEditor/resolveOrderedItemLabels.d.ts +4 -0
  153. package/dist/esm/ConfigurationEditor/resolveOrderedItemLabels.d.ts.map +1 -0
  154. package/dist/esm/ConfigurationEditor/resolveOrderedItemLabels.js +13 -0
  155. package/dist/esm/ConfigurationEditor/resolveOrderedItemLabels.js.map +1 -0
  156. package/dist/esm/ConfigurationEditor/validateOrderedItem.d.ts +18 -0
  157. package/dist/esm/ConfigurationEditor/validateOrderedItem.d.ts.map +1 -0
  158. package/dist/esm/ConfigurationEditor/validateOrderedItem.js +21 -0
  159. package/dist/esm/ConfigurationEditor/validateOrderedItem.js.map +1 -0
  160. package/dist/esm/Toolbar/ToolbarButton.d.ts +4 -1
  161. package/dist/esm/Toolbar/ToolbarButton.d.ts.map +1 -1
  162. package/dist/esm/Toolbar/ToolbarButton.js +12 -2
  163. package/dist/esm/Toolbar/ToolbarButton.js.map +1 -1
  164. package/dist/esm/Toolbar/ToolbarDrawerContext.d.ts +13 -0
  165. package/dist/esm/Toolbar/ToolbarDrawerContext.d.ts.map +1 -0
  166. package/dist/esm/Toolbar/ToolbarDrawerContext.js +7 -0
  167. package/dist/esm/Toolbar/ToolbarDrawerContext.js.map +1 -0
  168. package/dist/esm/Toolbar/ToolbarDrawerItem.d.ts +23 -0
  169. package/dist/esm/Toolbar/ToolbarDrawerItem.d.ts.map +1 -0
  170. package/dist/esm/Toolbar/ToolbarDrawerItem.js +4 -0
  171. package/dist/esm/Toolbar/ToolbarDrawerItem.js.map +1 -0
  172. package/dist/esm/Toolbar/ToolbarDrawerPlacement.d.ts +57 -0
  173. package/dist/esm/Toolbar/ToolbarDrawerPlacement.d.ts.map +1 -0
  174. package/dist/esm/Toolbar/ToolbarDrawerPlacement.js +51 -0
  175. package/dist/esm/Toolbar/ToolbarDrawerPlacement.js.map +1 -0
  176. package/dist/esm/Toolbar/ToolbarDrawerTile.d.ts +43 -0
  177. package/dist/esm/Toolbar/ToolbarDrawerTile.d.ts.map +1 -0
  178. package/dist/esm/Toolbar/ToolbarDrawerTile.js +31 -0
  179. package/dist/esm/Toolbar/ToolbarDrawerTile.js.map +1 -0
  180. package/dist/esm/Toolbar/ToolbarFolder.d.ts +51 -5
  181. package/dist/esm/Toolbar/ToolbarFolder.d.ts.map +1 -1
  182. package/dist/esm/Toolbar/ToolbarFolder.js +109 -10
  183. package/dist/esm/Toolbar/ToolbarFolder.js.map +1 -1
  184. package/dist/esm/Toolbar/ToolbarFolderPresentation.d.ts +8 -0
  185. package/dist/esm/Toolbar/ToolbarFolderPresentation.d.ts.map +1 -0
  186. package/dist/esm/Toolbar/ToolbarFolderPresentation.js +4 -0
  187. package/dist/esm/Toolbar/ToolbarFolderPresentation.js.map +1 -0
  188. package/dist/esm/Toolbar/index.d.ts +2 -0
  189. package/dist/esm/Toolbar/index.d.ts.map +1 -1
  190. package/dist/esm/configuration/CratisComponentsDefaults.d.ts.map +1 -1
  191. package/dist/esm/configuration/CratisComponentsDefaults.js +1 -0
  192. package/dist/esm/configuration/CratisComponentsDefaults.js.map +1 -1
  193. package/dist/esm/styles.ConfigurationEditor.css +710 -0
  194. package/dist/esm/styles.IconPicker.css +5 -0
  195. package/dist/esm/styles.Toolbar.css +174 -0
  196. package/dist/esm/styles.css +425 -0
  197. package/dist/esm/types/parts.d.ts +41 -1
  198. package/dist/esm/types/parts.d.ts.map +1 -1
  199. package/dist/esm/types/parts.js +41 -1
  200. package/dist/esm/types/parts.js.map +1 -1
  201. package/package.json +6 -1
@@ -68,7 +68,7 @@
68
68
  {
69
69
  "name": "@cratis/components",
70
70
  "role": "core",
71
- "version": "4.24.0",
71
+ "version": "4.25.1",
72
72
  "releaseMajorRange": ">=4 <5",
73
73
  "independentRelease": false,
74
74
  "private": false,
@@ -92,7 +92,7 @@
92
92
  {
93
93
  "name": "@cratis/eslint-plugin-components",
94
94
  "role": "eslint",
95
- "version": "4.24.0",
95
+ "version": "4.25.1",
96
96
  "releaseMajorRange": ">=4 <5",
97
97
  "independentRelease": false,
98
98
  "private": false,
@@ -105,7 +105,7 @@
105
105
  {
106
106
  "name": "@cratis/components.migrator",
107
107
  "role": "migrator",
108
- "version": "4.24.0",
108
+ "version": "4.25.1",
109
109
  "releaseMajorRange": ">=4 <5",
110
110
  "independentRelease": false,
111
111
  "private": false,
@@ -116,13 +116,13 @@
116
116
  {
117
117
  "name": "@cratis/components.conformance",
118
118
  "role": "conformance",
119
- "version": "4.24.0",
119
+ "version": "4.25.1",
120
120
  "releaseMajorRange": ">=4 <5",
121
121
  "independentRelease": false,
122
122
  "private": false,
123
123
  "packageAccess": "public",
124
124
  "peerDependencies": {
125
- "@cratis/components": "4.24.0",
125
+ "@cratis/components": "4.25.1",
126
126
  "react": "^19.0.0",
127
127
  "react-dom": "^19.0.0"
128
128
  },
@@ -132,13 +132,13 @@
132
132
  {
133
133
  "name": "@cratis/components.mui",
134
134
  "role": "renderer-adapter",
135
- "version": "4.24.0",
135
+ "version": "4.25.1",
136
136
  "releaseMajorRange": ">=4 <5",
137
137
  "independentRelease": false,
138
138
  "private": false,
139
139
  "packageAccess": "public",
140
140
  "peerDependencies": {
141
- "@cratis/components": "4.24.0",
141
+ "@cratis/components": "4.25.1",
142
142
  "@emotion/react": ">=11.5 <12",
143
143
  "@emotion/styled": ">=11.11 <12",
144
144
  "@mui/material": ">=9 <10",
@@ -188,13 +188,13 @@
188
188
  {
189
189
  "name": "@cratis/components.primereact",
190
190
  "role": "renderer-adapter",
191
- "version": "4.24.0",
191
+ "version": "4.25.1",
192
192
  "releaseMajorRange": ">=4 <5",
193
193
  "independentRelease": false,
194
194
  "private": false,
195
195
  "packageAccess": "public",
196
196
  "peerDependencies": {
197
- "@cratis/components": "4.24.0",
197
+ "@cratis/components": "4.25.1",
198
198
  "@primereact/core": ">=11 <12",
199
199
  "@primereact/ui": ">=11 <12",
200
200
  "@primeuix/themes": ">=3 <4",
@@ -256,13 +256,13 @@
256
256
  {
257
257
  "name": "@cratis/components.primereact10",
258
258
  "role": "renderer-adapter",
259
- "version": "4.24.0",
259
+ "version": "4.25.1",
260
260
  "releaseMajorRange": ">=4 <5",
261
261
  "independentRelease": false,
262
262
  "private": false,
263
263
  "packageAccess": "public",
264
264
  "peerDependencies": {
265
- "@cratis/components": "4.24.0",
265
+ "@cratis/components": "4.25.1",
266
266
  "primereact": ">=10.9.9 <11",
267
267
  "react": "^19.0.0",
268
268
  "react-dom": "^19.0.0"
@@ -1 +1 @@
1
- {"version":3,"file":"CommandDialog.d.ts","sourceRoot":"","sources":["../../../CommandDialog/CommandDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,sBAAmB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKH,KAAK,gBAAgB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAAwB,CAAC;AAOnE;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB,CAAC,QAAQ,SAAS,MAAM,EAAE,SAAS,GAAG,MAAM,CAC3E,SACI,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,iBAAiB,CAAC,EAC3E,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC5C;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAElD;;;;;;;OAOG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAEtD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,C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IAEtD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAoHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmHG;AACH,QAAA,MAAM,sBAAsB;KAAI,QAAQ,SAAS,MAAM,WAAW,SAAS,kBAChE,kBAAkB,CAAC,QAAQ,EAAE,SAAS,CAAC;;CA8EjD,CAAC;AAEF,QAAA,MAAM,0BAA0B,iBAAkB;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,sBAE9E,CAAC;AAKF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,+BAAyB,CAAC"}
@@ -48,7 +48,7 @@ const CommandDialogWrapper = ({ isValid, onClose, onConfirm, onSuccess, onValida
48
48
  return (jsx(CommandFormFieldWrapper, { field: child }));
49
49
  }
50
50
  const childProps = child.props;
51
- if (childProps.children != null) {
51
+ if (childProps.children != null && typeof childProps.children !== 'function') {
52
52
  return React.cloneElement(child, {
53
53
  children: processChildren(childProps.children),
54
54
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CommandDialog.js","sources":["../../../CommandDialog/CommandDialog.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 { DialogButtons, DialogResult } from '@cratis/arc.react/dialogs';\nimport { Dialog, type DialogProps } from '../Dialogs/Dialog';\nimport React from 'react';\nimport {\n CommandForm,\n CommandFormFieldWrapper,\n useCommandFormContext,\n useCommandInstance,\n type CommandFormProps,\n} from '@cratis/arc.react/commands';\nimport type { BeforeExecuteCallback } from './applyBeforeExecute';\nimport type { ConfirmBeforeExecute } from './confirmBeforeExecute';\nimport { useCommandExecution } from './useCommandExecution';\nimport {\n isCommandFormField,\n markAsCommandFormColumn,\n} from '../CommandForm/commandFormMarkers';\n\n/**\n * Props for {@link CommandDialog}. Combines the props of a `CommandForm`\n * (`command`, `initialValues`, `onSuccess`, `onValidationFailure`, `onFailed`,\n * `onBeforeExecute`, etc.) with the props of a {@link Dialog} (`title`,\n * `buttons`, `width`, `pt`, `unstyled`, …). Dialog presentation props\n * such as `subtitle`, `placement`, and `closeIcon` are forwarded to the dialog.\n *\n * @typeParam TCommand - The command record type (must extend `object`).\n * @typeParam TResponse - The response payload type returned by a successful command. Defaults to `object`.\n */\nexport interface CommandDialogProps<TCommand extends object, TResponse = object>\n extends\n Omit<CommandFormProps<TCommand, TResponse>, 'children' | 'onBeforeExecute'>,\n Omit<DialogProps, 'children' | 'isBusy'> {\n /**\n * A transformer invoked with the current command values immediately before\n * the command executes on confirm. It **must return** the values to run with\n * (mutated or not) — a callback that returns nothing does not execute the\n * command with `undefined`; the current values are kept and a warning is\n * logged. May be async.\n *\n * ⚠️ It runs **only on submit**, after the form has already been validated,\n * so a value produced here can never satisfy required-field validation — the\n * submit button stays disabled if a required value is only seeded here. Seed\n * required values through `initialValues`; reserve `onBeforeExecute` for\n * transforms that do not affect validity (for example a generated id).\n */\n onBeforeExecute?: BeforeExecuteCallback<TCommand>;\n\n /**\n * Ask whether to run the command after validation and `onBeforeExecute`.\n * Receives the transformed values. Only `true` executes; all other outcomes\n * keep the dialog open. May return a promise (for example from a confirmation dialog).\n * If command values change while confirmation is pending, execution is skipped\n * and the dialog stays open; confirm the new values again.\n * Unlike `onConfirm`, this runs before execution, not after success.\n */\n confirmBeforeExecute?: ConfirmBeforeExecute<TCommand>;\n\n /**\n * Form fields and arbitrary content for the dialog body. Children that are\n * `CommandFormField` instances are automatically wrapped so they bind to\n * the command instance.\n */\n children?: React.ReactNode;\n}\n\n// Requiring each key here makes a newly added Dialog prop fail compilation until it is routed.\ntype ForwardedDialogProps = Omit<DialogProps, 'children' | 'isBusy'> &\n Record<keyof Omit<DialogProps, 'children' | 'isBusy'>, unknown>;\n\nconst CommandDialogWrapper = <TCommand extends object, TResponse = object>({\n isValid,\n onClose,\n onConfirm,\n onSuccess,\n onValidationFailure,\n onFailed,\n onException,\n onUnauthorized,\n onBeforeExecute,\n confirmBeforeExecute,\n children,\n ...dialogProps\n}: Omit<DialogProps, 'isBusy'> & {\n onSuccess?: CommandFormProps<TCommand, TResponse>['onSuccess'];\n onValidationFailure?: CommandFormProps<TCommand, TResponse>['onValidationFailure'];\n onFailed?: CommandFormProps<TCommand, TResponse>['onFailed'];\n onException?: CommandFormProps<TCommand, TResponse>['onException'];\n onUnauthorized?: CommandFormProps<TCommand, TResponse>['onUnauthorized'];\n onBeforeExecute?: BeforeExecuteCallback<TCommand>;\n confirmBeforeExecute?: ConfirmBeforeExecute<TCommand>;\n}) => {\n const {\n setCommandValues,\n setCommandResult,\n isValid: isCommandFormValid,\n } = useCommandFormContext<TCommand>();\n const commandInstance = useCommandInstance<TCommand>();\n const submission = useCommandExecution<TCommand, TResponse>(\n commandInstance, setCommandValues, onBeforeExecute, confirmBeforeExecute, onException,\n );\n\n const handleConfirm = async () => {\n const result = await submission.run();\n if (!result) return false;\n\n if (!result.isSuccess) {\n await onFailed?.(result);\n if (result.hasExceptions) {\n await onException?.(result.exceptionMessages, result.exceptionStackTrace);\n }\n if (!result.isAuthorized) await onUnauthorized?.();\n if (!result.isValid) {\n await onValidationFailure?.(result.validationResults);\n }\n if (submission.isMounted()) setCommandResult(result);\n return false;\n }\n\n await onSuccess?.(result.response as TResponse);\n if (onConfirm) {\n const closeResult = await onConfirm();\n return closeResult === true;\n }\n if (onClose) {\n const closeResult = await onClose(DialogResult.Ok);\n return closeResult !== false;\n }\n return true;\n };\n\n const processChildren = (nodes: React.ReactNode): React.ReactNode => {\n return React.Children.map(nodes, (child) => {\n if (!React.isValidElement(child)) return child;\n\n const component = child.type as React.ComponentType<unknown>;\n if (isCommandFormField(component)) {\n type FieldElement = Parameters<\n typeof CommandFormFieldWrapper\n >[0]['field'];\n // SAFETY: isCommandFormField guards that child.type is a command form field component.\n return (\n <CommandFormFieldWrapper field={child as unknown as FieldElement} />\n );\n }\n\n const childProps = child.props as Record<string, unknown>;\n if (childProps.children != null) {\n return React.cloneElement(\n child as React.ReactElement<Record<string, unknown>>,\n {\n children: processChildren(childProps.children as React.ReactNode),\n },\n );\n }\n\n return child;\n });\n };\n\n const processedChildren = processChildren(children);\n const isDialogValid = isValid !== false && isCommandFormValid;\n\n return (\n <Dialog\n {...dialogProps}\n onClose={onClose}\n onConfirm={handleConfirm}\n isValid={isDialogValid}\n isBusy={submission.isSubmitting}\n >\n <div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>\n {processedChildren}\n </div>\n </Dialog>\n );\n};\n\n/**\n * A {@link Dialog} that hosts a Cratis Arc `CommandForm`, runs the bound\n * command on confirm, and only closes when the command succeeds. This is\n * the standard pattern for \"user fills in a form, clicks OK, command runs\n * server-side, dialog dismisses\" — `CommandDialog` collapses about thirty\n * lines of orchestration into the props on a single component.\n *\n * ## Where `TCommand` comes from\n *\n * `TCommand` is an auto-generated TypeScript class produced by the Arc proxy\n * generator from a C# `[Command]` record. `dotnet build` writes a `.ts` file\n * per command with the right property types and a typed `execute()` method;\n * importing the class is all the connection-to-the-backend you need. The\n * class also exposes a `.use()` hook for direct (non-dialog) usage and a\n * `useWithChangeTracking()` variant.\n *\n * ## What happens on confirm\n *\n * 1. If `onBeforeExecute` is supplied, it transforms the command values.\n * Used for generated IDs (`Guid.create()`) that the user did not type in.\n * 2. The command's `execute()` runs through Arc's command pipeline. The\n * backend handler returns either a typed response (mapped to `TResponse`)\n * or a `ValidationResult[]`.\n * 3. On `IsSuccess: true`, `onSuccess(response)` fires and the dialog closes\n * through the dialog host context.\n * 4. On a validation failure, `onValidationFailure(errors)` fires and the\n * form's per-field error display is updated. The dialog stays open.\n * 5. On a domain or transport failure, `onFailed(result)` fires. The dialog\n * stays open and the `CommandResult` is set on the form context so the\n * UI can surface the error to the user.\n *\n * Throughout, the dialog is in the `isBusy` state — every action button is\n * disabled and the confirm button shows a spinner.\n *\n * ## Destructive commands and initial focus\n *\n * The confirm button is focused when the dialog opens, and a focused native\n * button fires `click` from the `keydown` of `Enter`. A command whose form\n * has required fields is protected from a held or double-tapped `Enter` for\n * free, because `isCommandFormValid` keeps confirm disabled until something\n * is filled in. A command that takes **no** input — the typical \"delete\n * this, permanently\" command — has no such gate, so its confirm button is\n * armed the instant the dialog appears.\n *\n * Pass `initialFocus` (forwarded straight to {@link Dialog}) for those:\n *\n * ```tsx\n * <CommandDialog<DeletePerson>\n * command={DeletePerson}\n * title=\"Delete personal data?\"\n * okLabel=\"Delete\"\n * initialFocus={DialogInitialFocus.Cancel}\n * onSuccess={() => closeDialog(DialogResult.Ok)}>\n * This cannot be undone.\n * </CommandDialog>\n * ```\n *\n * Everything else — the footer, the close (X), `Escape`, and the confirm\n * wiring that runs the command — is untouched.\n *\n * ## Field binding\n *\n * Children that are `CommandFormField` instances (`InputTextField`,\n * `NumberField`, `DropdownField`, every `@cratis/components/CommandForm/fields`\n * widget) bind to a property on the command via the `value` accessor:\n *\n * ```tsx\n * <InputTextField value={c => c.name} title=\"Name\" />\n * ```\n *\n * The accessor's argument is the command instance — TypeScript infers\n * `c.name` is a string and the field type-checks against that. Arbitrary\n * non-field children (custom layout, additional text, decorative elements)\n * are rendered as plain content.\n *\n * ## Typed dialog host usage\n *\n * Combine with `useDialog<CommandResult<TResponse>>()` from\n * `@cratis/arc.react/dialogs` to get a fully-typed result at the call site:\n *\n * ```tsx\n * import { useDialog, DialogResult } from '@cratis/arc.react/dialogs';\n * import { CommandDialog } from '@cratis/components/CommandDialog';\n * import { RegisterAuthor } from './RegisterAuthor'; // proxy from C#\n *\n * type RegisterAuthorResponse = { authorId: string };\n *\n * const RegisterAuthorDialog = () => {\n * const { closeDialog } = useDialogContext<CommandResult<RegisterAuthorResponse>>();\n * return (\n * <CommandDialog<RegisterAuthor, RegisterAuthorResponse>\n * command={RegisterAuthor}\n * title=\"Register author\"\n * okLabel=\"Register\"\n * onSuccess={(response) => closeDialog(DialogResult.Ok)}\n * onCancel={() => closeDialog(DialogResult.Cancelled)}>\n * <InputTextField value={c => c.name} title=\"Name\" />\n * <InputTextField value={c => c.email} title=\"Email\" />\n * </CommandDialog>\n * );\n * };\n * ```\n *\n * ## What's special vs. raw Dialog + CommandForm\n *\n * - Confirm wiring (`onConfirm` → `commandInstance.execute()`) is handled\n * internally; you only supply `onSuccess` / `onValidationFailure` / `onFailed`.\n * - The dialog's `isBusy` state tracks the in-flight command without manual\n * `useState`.\n * - Field error propagation from `CommandResult.validationResults` to the\n * form context is automatic.\n *\n * @typeParam TCommand - The command class (proxy generated from C# `[Command]`).\n * @typeParam TResponse - The success payload type returned by the command's `Handle()` method on the backend.\n * @param props - {@link CommandDialogProps}.\n */\nconst CommandDialogComponent = <TCommand extends object = object, TResponse = object>(\n props: CommandDialogProps<TCommand, TResponse>,\n) => {\n const {\n title,\n subtitle,\n placement,\n closeIcon,\n visible,\n width,\n style,\n contentStyle,\n resizable,\n buttons = DialogButtons.OkCancel,\n initialFocus,\n okLabel,\n cancelLabel,\n yesLabel,\n noLabel,\n dismissable,\n closeAriaLabel,\n isValid,\n onClose,\n onConfirm,\n onCancel,\n onBeforeExecute,\n confirmBeforeExecute,\n className,\n pt,\n ptOptions,\n unstyled,\n children,\n ...commandFormProps\n } = props;\n\n const dialogProps = {\n title,\n subtitle,\n placement,\n closeIcon,\n visible,\n width,\n style,\n contentStyle,\n resizable,\n buttons,\n initialFocus,\n okLabel,\n cancelLabel,\n yesLabel,\n noLabel,\n dismissable,\n closeAriaLabel,\n isValid,\n onClose,\n onConfirm,\n onCancel,\n className,\n pt,\n ptOptions,\n unstyled,\n } satisfies ForwardedDialogProps;\n\n return (\n <CommandForm<TCommand, TResponse> {...commandFormProps}>\n <CommandDialogWrapper<TCommand, TResponse>\n {...dialogProps}\n onSuccess={props.onSuccess}\n onValidationFailure={props.onValidationFailure}\n onFailed={props.onFailed}\n onException={props.onException}\n onUnauthorized={props.onUnauthorized}\n onBeforeExecute={onBeforeExecute}\n confirmBeforeExecute={confirmBeforeExecute}\n >\n {children}\n </CommandDialogWrapper>\n </CommandForm>\n );\n};\n\nconst CommandDialogColumnWrapper = ({ children }: { children: React.ReactNode }) => (\n <CommandForm.Column>{children}</CommandForm.Column>\n);\nmarkAsCommandFormColumn(CommandDialogColumnWrapper);\n\nCommandDialogComponent.Column = CommandDialogColumnWrapper;\n\n/**\n * A {@link Dialog} that hosts a Cratis Arc `CommandForm`, runs the bound\n * command on confirm, and only closes when the command succeeds. This is\n * the standard pattern for \"user fills in a form, clicks OK, command runs\n * server-side, dialog dismisses\" — `CommandDialog` collapses about thirty\n * lines of orchestration into the props on a single component.\n *\n * See {@link CommandDialogComponent} for full documentation.\n *\n * @typeParam TCommand - The command class (proxy generated from C# `[Command]`).\n * @typeParam TResponse - The success payload type returned by the command's `Handle()` method on the backend.\n */\nexport const CommandDialog = CommandDialogComponent;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAwEA,MAAM,oBAAoB,GAAG,CAA8C,EACvE,OAAO,EACP,OAAO,EACP,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,GAAG,WAAW,EASjB,KAAI;AACD,IAAA,MAAM,EACF,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EAAE,kBAAkB,GAC9B,GAAG,qBAAqB,EAAY;AACrC,IAAA,MAAM,eAAe,GAAG,kBAAkB,EAAY;AACtD,IAAA,MAAM,UAAU,GAAG,mBAAmB,CAClC,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,WAAW,CACxF;AAED,IAAA,MAAM,aAAa,GAAG,YAAW;AAC7B,QAAA,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,EAAE;AACrC,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,KAAK;AAEzB,QAAA,IAAI,CAAC,MA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AQ;QACR,SAAS;QACT,SAAS;QACT,OAAO;QACP,KAAK;QACL,KAAK;QACL,YAAY;QACZ,SAAS;QACT,OAAO;QACP,YAAY;QACZ,OAAO;QACP,WAAW;QACX,QAAQ;QACR,OAAO;QACP,WAAW;QACX,cAAc;QACd,OAAO;QACP,OAAO;QACP,SAAS;QACT,QAAQ;QACR,SAAS;QACT,EAAE;QACF,SAAS;QACT,QAAQ;KACoB;IAEhC,QACIA,GAAA,CAAC,WAAW,EAAA,EAAA,GAA0B,gBAAgB,YAClDA,GAAA,CAAC,oBAAoB,EAAA,EAAA,GACb,WAAW,EACf,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,eAAe,EAAE,eAAe,EAChC,oBAAoB,EAAE,oBAAoB,EAAA,QAAA,EAEzC,QAAQ,EAAA,CACU,EAAA,CACb;AAEtB,CAAC;AAED,MAAM,0BAA0B,GAAG,CAAC,EAAE,QAAQ,EAAiC,MAC3EA,GAAA,CAAC,WAAW,CAAC,MAAM,cAAE,QAAQ,EAAA,CAAsB,CACtD;AACD,uBAAuB,CAAC,0BAA0B,CAAC;AAEnD,sBAAsB,CAAC,MAAM,GAAG,0BAA0B;AAcnD,MAAM,aAAa,GAAG;;"}
1
+ {"version":3,"file":"CommandDialog.js","sources":["../../../CommandDialog/CommandDialog.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 { DialogButtons, DialogResult } from '@cratis/arc.react/dialogs';\nimport { Dialog, type DialogProps } from '../Dialogs/Dialog';\nimport React from 'react';\nimport {\n CommandForm,\n CommandFormFieldWrapper,\n useCommandFormContext,\n useCommandInstance,\n type CommandFormProps,\n} from '@cratis/arc.react/commands';\nimport type { BeforeExecuteCallback } from './applyBeforeExecute';\nimport type { ConfirmBeforeExecute } from './confirmBeforeExecute';\nimport { useCommandExecution } from './useCommandExecution';\nimport {\n isCommandFormField,\n markAsCommandFormColumn,\n} from '../CommandForm/commandFormMarkers';\n\n/**\n * Props for {@link CommandDialog}. Combines the props of a `CommandForm`\n * (`command`, `initialValues`, `onSuccess`, `onValidationFailure`, `onFailed`,\n * `onBeforeExecute`, etc.) with the props of a {@link Dialog} (`title`,\n * `buttons`, `width`, `pt`, `unstyled`, …). Dialog presentation props\n * such as `subtitle`, `placement`, and `closeIcon` are forwarded to the dialog.\n *\n * @typeParam TCommand - The command record type (must extend `object`).\n * @typeParam TResponse - The response payload type returned by a successful command. Defaults to `object`.\n */\nexport interface CommandDialogProps<TCommand extends object, TResponse = object>\n extends\n Omit<CommandFormProps<TCommand, TResponse>, 'children' | 'onBeforeExecute'>,\n Omit<DialogProps, 'children' | 'isBusy'> {\n /**\n * A transformer invoked with the current command values immediately before\n * the command executes on confirm. It **must return** the values to run with\n * (mutated or not) — a callback that returns nothing does not execute the\n * command with `undefined`; the current values are kept and a warning is\n * logged. May be async.\n *\n * ⚠️ It runs **only on submit**, after the form has already been validated,\n * so a value produced here can never satisfy required-field validation — the\n * submit button stays disabled if a required value is only seeded here. Seed\n * required values through `initialValues`; reserve `onBeforeExecute` for\n * transforms that do not affect validity (for example a generated id).\n */\n onBeforeExecute?: BeforeExecuteCallback<TCommand>;\n\n /**\n * Ask whether to run the command after validation and `onBeforeExecute`.\n * Receives the transformed values. Only `true` executes; all other outcomes\n * keep the dialog open. May return a promise (for example from a confirmation dialog).\n * If command values change while confirmation is pending, execution is skipped\n * and the dialog stays open; confirm the new values again.\n * Unlike `onConfirm`, this runs before execution, not after success.\n */\n confirmBeforeExecute?: ConfirmBeforeExecute<TCommand>;\n\n /**\n * Form fields and arbitrary content for the dialog body. Children that are\n * `CommandFormField` instances are automatically wrapped so they bind to\n * the command instance.\n */\n children?: React.ReactNode;\n}\n\n// Requiring each key here makes a newly added Dialog prop fail compilation until it is routed.\ntype ForwardedDialogProps = Omit<DialogProps, 'children' | 'isBusy'> &\n Record<keyof Omit<DialogProps, 'children' | 'isBusy'>, unknown>;\n\nconst CommandDialogWrapper = <TCommand extends object, TResponse = object>({\n isValid,\n onClose,\n onConfirm,\n onSuccess,\n onValidationFailure,\n onFailed,\n onException,\n onUnauthorized,\n onBeforeExecute,\n confirmBeforeExecute,\n children,\n ...dialogProps\n}: Omit<DialogProps, 'isBusy'> & {\n onSuccess?: CommandFormProps<TCommand, TResponse>['onSuccess'];\n onValidationFailure?: CommandFormProps<TCommand, TResponse>['onValidationFailure'];\n onFailed?: CommandFormProps<TCommand, TResponse>['onFailed'];\n onException?: CommandFormProps<TCommand, TResponse>['onException'];\n onUnauthorized?: CommandFormProps<TCommand, TResponse>['onUnauthorized'];\n onBeforeExecute?: BeforeExecuteCallback<TCommand>;\n confirmBeforeExecute?: ConfirmBeforeExecute<TCommand>;\n}) => {\n const {\n setCommandValues,\n setCommandResult,\n isValid: isCommandFormValid,\n } = useCommandFormContext<TCommand>();\n const commandInstance = useCommandInstance<TCommand>();\n const submission = useCommandExecution<TCommand, TResponse>(\n commandInstance, setCommandValues, onBeforeExecute, confirmBeforeExecute, onException,\n );\n\n const handleConfirm = async () => {\n const result = await submission.run();\n if (!result) return false;\n\n if (!result.isSuccess) {\n await onFailed?.(result);\n if (result.hasExceptions) {\n await onException?.(result.exceptionMessages, result.exceptionStackTrace);\n }\n if (!result.isAuthorized) await onUnauthorized?.();\n if (!result.isValid) {\n await onValidationFailure?.(result.validationResults);\n }\n if (submission.isMounted()) setCommandResult(result);\n return false;\n }\n\n await onSuccess?.(result.response as TResponse);\n if (onConfirm) {\n const closeResult = await onConfirm();\n return closeResult === true;\n }\n if (onClose) {\n const closeResult = await onClose(DialogResult.Ok);\n return closeResult !== false;\n }\n return true;\n };\n\n const processChildren = (nodes: React.ReactNode): React.ReactNode => {\n return React.Children.map(nodes, (child) => {\n if (!React.isValidElement(child)) return child;\n\n const component = child.type as React.ComponentType<unknown>;\n if (isCommandFormField(component)) {\n type FieldElement = Parameters<\n typeof CommandFormFieldWrapper\n >[0]['field'];\n // SAFETY: isCommandFormField guards that child.type is a command form field component.\n return (\n <CommandFormFieldWrapper field={child as unknown as FieldElement} />\n );\n }\n\n const childProps = child.props as Record<string, unknown>;\n // A function child is a render prop, not a node: mapping it would replace the\n // function with its mapped result and break the component that calls it.\n if (childProps.children != null && typeof childProps.children !== 'function') {\n return React.cloneElement(\n child as React.ReactElement<Record<string, unknown>>,\n {\n children: processChildren(childProps.children as React.ReactNode),\n },\n );\n }\n\n return child;\n });\n };\n\n const processedChildren = processChildren(children);\n const isDialogValid = isValid !== false && isCommandFormValid;\n\n return (\n <Dialog\n {...dialogProps}\n onClose={onClose}\n onConfirm={handleConfirm}\n isValid={isDialogValid}\n isBusy={submission.isSubmitting}\n >\n <div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>\n {processedChildren}\n </div>\n </Dialog>\n );\n};\n\n/**\n * A {@link Dialog} that hosts a Cratis Arc `CommandForm`, runs the bound\n * command on confirm, and only closes when the command succeeds. This is\n * the standard pattern for \"user fills in a form, clicks OK, command runs\n * server-side, dialog dismisses\" — `CommandDialog` collapses about thirty\n * lines of orchestration into the props on a single component.\n *\n * ## Where `TCommand` comes from\n *\n * `TCommand` is an auto-generated TypeScript class produced by the Arc proxy\n * generator from a C# `[Command]` record. `dotnet build` writes a `.ts` file\n * per command with the right property types and a typed `execute()` method;\n * importing the class is all the connection-to-the-backend you need. The\n * class also exposes a `.use()` hook for direct (non-dialog) usage and a\n * `useWithChangeTracking()` variant.\n *\n * ## What happens on confirm\n *\n * 1. If `onBeforeExecute` is supplied, it transforms the command values.\n * Used for generated IDs (`Guid.create()`) that the user did not type in.\n * 2. The command's `execute()` runs through Arc's command pipeline. The\n * backend handler returns either a typed response (mapped to `TResponse`)\n * or a `ValidationResult[]`.\n * 3. On `IsSuccess: true`, `onSuccess(response)` fires and the dialog closes\n * through the dialog host context.\n * 4. On a validation failure, `onValidationFailure(errors)` fires and the\n * form's per-field error display is updated. The dialog stays open.\n * 5. On a domain or transport failure, `onFailed(result)` fires. The dialog\n * stays open and the `CommandResult` is set on the form context so the\n * UI can surface the error to the user.\n *\n * Throughout, the dialog is in the `isBusy` state — every action button is\n * disabled and the confirm button shows a spinner.\n *\n * ## Destructive commands and initial focus\n *\n * The confirm button is focused when the dialog opens, and a focused native\n * button fires `click` from the `keydown` of `Enter`. A command whose form\n * has required fields is protected from a held or double-tapped `Enter` for\n * free, because `isCommandFormValid` keeps confirm disabled until something\n * is filled in. A command that takes **no** input — the typical \"delete\n * this, permanently\" command — has no such gate, so its confirm button is\n * armed the instant the dialog appears.\n *\n * Pass `initialFocus` (forwarded straight to {@link Dialog}) for those:\n *\n * ```tsx\n * <CommandDialog<DeletePerson>\n * command={DeletePerson}\n * title=\"Delete personal data?\"\n * okLabel=\"Delete\"\n * initialFocus={DialogInitialFocus.Cancel}\n * onSuccess={() => closeDialog(DialogResult.Ok)}>\n * This cannot be undone.\n * </CommandDialog>\n * ```\n *\n * Everything else — the footer, the close (X), `Escape`, and the confirm\n * wiring that runs the command — is untouched.\n *\n * ## Field binding\n *\n * Children that are `CommandFormField` instances (`InputTextField`,\n * `NumberField`, `DropdownField`, every `@cratis/components/CommandForm/fields`\n * widget) bind to a property on the command via the `value` accessor:\n *\n * ```tsx\n * <InputTextField value={c => c.name} title=\"Name\" />\n * ```\n *\n * The accessor's argument is the command instance — TypeScript infers\n * `c.name` is a string and the field type-checks against that. Arbitrary\n * non-field children (custom layout, additional text, decorative elements)\n * are rendered as plain content.\n *\n * ## Typed dialog host usage\n *\n * Combine with `useDialog<CommandResult<TResponse>>()` from\n * `@cratis/arc.react/dialogs` to get a fully-typed result at the call site:\n *\n * ```tsx\n * import { useDialog, DialogResult } from '@cratis/arc.react/dialogs';\n * import { CommandDialog } from '@cratis/components/CommandDialog';\n * import { RegisterAuthor } from './RegisterAuthor'; // proxy from C#\n *\n * type RegisterAuthorResponse = { authorId: string };\n *\n * const RegisterAuthorDialog = () => {\n * const { closeDialog } = useDialogContext<CommandResult<RegisterAuthorResponse>>();\n * return (\n * <CommandDialog<RegisterAuthor, RegisterAuthorResponse>\n * command={RegisterAuthor}\n * title=\"Register author\"\n * okLabel=\"Register\"\n * onSuccess={(response) => closeDialog(DialogResult.Ok)}\n * onCancel={() => closeDialog(DialogResult.Cancelled)}>\n * <InputTextField value={c => c.name} title=\"Name\" />\n * <InputTextField value={c => c.email} title=\"Email\" />\n * </CommandDialog>\n * );\n * };\n * ```\n *\n * ## What's special vs. raw Dialog + CommandForm\n *\n * - Confirm wiring (`onConfirm` → `commandInstance.execute()`) is handled\n * internally; you only supply `onSuccess` / `onValidationFailure` / `onFailed`.\n * - The dialog's `isBusy` state tracks the in-flight command without manual\n * `useState`.\n * - Field error propagation from `CommandResult.validationResults` to the\n * form context is automatic.\n *\n * @typeParam TCommand - The command class (proxy generated from C# `[Command]`).\n * @typeParam TResponse - The success payload type returned by the command's `Handle()` method on the backend.\n * @param props - {@link CommandDialogProps}.\n */\nconst CommandDialogComponent = <TCommand extends object = object, TResponse = object>(\n props: CommandDialogProps<TCommand, TResponse>,\n) => {\n const {\n title,\n subtitle,\n placement,\n closeIcon,\n visible,\n width,\n style,\n contentStyle,\n resizable,\n buttons = DialogButtons.OkCancel,\n initialFocus,\n okLabel,\n cancelLabel,\n yesLabel,\n noLabel,\n dismissable,\n closeAriaLabel,\n isValid,\n onClose,\n onConfirm,\n onCancel,\n onBeforeExecute,\n confirmBeforeExecute,\n className,\n pt,\n ptOptions,\n unstyled,\n children,\n ...commandFormProps\n } = props;\n\n const dialogProps = {\n title,\n subtitle,\n placement,\n closeIcon,\n visible,\n width,\n style,\n contentStyle,\n resizable,\n buttons,\n initialFocus,\n okLabel,\n cancelLabel,\n yesLabel,\n noLabel,\n dismissable,\n closeAriaLabel,\n isValid,\n onClose,\n onConfirm,\n onCancel,\n className,\n pt,\n ptOptions,\n unstyled,\n } satisfies ForwardedDialogProps;\n\n return (\n <CommandForm<TCommand, TResponse> {...commandFormProps}>\n <CommandDialogWrapper<TCommand, TResponse>\n {...dialogProps}\n onSuccess={props.onSuccess}\n onValidationFailure={props.onValidationFailure}\n onFailed={props.onFailed}\n onException={props.onException}\n onUnauthorized={props.onUnauthorized}\n onBeforeExecute={onBeforeExecute}\n confirmBeforeExecute={confirmBeforeExecute}\n >\n {children}\n </CommandDialogWrapper>\n </CommandForm>\n );\n};\n\nconst CommandDialogColumnWrapper = ({ children }: { children: React.ReactNode }) => (\n <CommandForm.Column>{children}</CommandForm.Column>\n);\nmarkAsCommandFormColumn(CommandDialogColumnWrapper);\n\nCommandDialogComponent.Column = CommandDialogColumnWrapper;\n\n/**\n * A {@link Dialog} that hosts a Cratis Arc `CommandForm`, runs the bound\n * command on confirm, and only closes when the command succeeds. This is\n * the standard pattern for \"user fills in a form, clicks OK, command runs\n * server-side, dialog dismisses\" — `CommandDialog` collapses about thirty\n * lines of orchestration into the props on a single component.\n *\n * See {@link CommandDialogComponent} for full documentation.\n *\n * @typeParam TCommand - The command class (proxy generated from C# `[Command]`).\n * @typeParam TResponse - The success payload type returned by the command's `Handle()` method on the backend.\n */\nexport const CommandDialog = CommandDialogComponent;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAwEA,MAAM,oBAAoB,GAAG,CAA8C,EACvE,OAAO,EACP,OAAO,EACP,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,GAAG,WAAW,EASjB,KAAI;AACD,IAAA,MAAM,EACF,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EAAE,kBAAkB,GAC9B,GAAG,qBAAqB,EAAY;AACrC,IAAA,MAAM,eAAe,GAAG,kBAAkB,EAAY;AACtD,IAAA,MAAM,UAAU,GAAG,mBAAmB,CAClC,eAAe,EAAE,gBAAgB,EAAE,e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AW,EACX,QAAQ,EACR,OAAO,EACP,WAAW,EACX,cAAc,EACd,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,EAAE,EACF,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,gBAAgB,EACtB,GAAG,KAAK;AAET,IAAA,MAAM,WAAW,GAAG;QAChB,KAAK;QACL,QAAQ;QACR,SAAS;QACT,SAAS;QACT,OAAO;QACP,KAAK;QACL,KAAK;QACL,YAAY;QACZ,SAAS;QACT,OAAO;QACP,YAAY;QACZ,OAAO;QACP,WAAW;QACX,QAAQ;QACR,OAAO;QACP,WAAW;QACX,cAAc;QACd,OAAO;QACP,OAAO;QACP,SAAS;QACT,QAAQ;QACR,SAAS;QACT,EAAE;QACF,SAAS;QACT,QAAQ;KACoB;IAEhC,QACIA,GAAA,CAAC,WAAW,EAAA,EAAA,GAA0B,gBAAgB,YAClDA,GAAA,CAAC,oBAAoB,EAAA,EAAA,GACb,WAAW,EACf,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,eAAe,EAAE,eAAe,EAChC,oBAAoB,EAAE,oBAAoB,EAAA,QAAA,EAEzC,QAAQ,EAAA,CACU,EAAA,CACb;AAEtB,CAAC;AAED,MAAM,0BAA0B,GAAG,CAAC,EAAE,QAAQ,EAAiC,MAC3EA,GAAA,CAAC,WAAW,CAAC,MAAM,cAAE,QAAQ,EAAA,CAAsB,CACtD;AACD,uBAAuB,CAAC,0BAA0B,CAAC;AAEnD,sBAAsB,CAAC,MAAM,GAAG,0BAA0B;AAcnD,MAAM,aAAa,GAAG;;"}
@@ -126,6 +126,8 @@ export interface CratisColumnFilterMessages {
126
126
  export interface CratisToolbarMessages {
127
127
  /** Accessible toolbar name used when neither `aria-label` nor `aria-labelledby` is supplied. */
128
128
  label?: string;
129
+ /** Accessible name of the close button in a drawer {@link ToolbarFolder}. Defaults to 'Close'. */
130
+ closeDrawer?: string;
129
131
  }
130
132
  /** Components-owned message groups. */
131
133
  export interface CratisComponentsMessages {
@@ -1 +1 @@
1
- {"version":3,"file":"CratisComponentsProvider.d.ts","sourceRoot":"","sources":["../../../Common/CratisComponentsProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,6BAA0B,CAAC;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAgC,CAAC;AAM/E,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA2C,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA0C,CAAC;AAErF,wDAAwD;AACxD,MAAM,WAAW,uBAAuB;IACpC,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,sEAAsE;AACtE,MAAM,WAAW,wBAAwB;IACrC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+BAA+B;IAC/B,SAAS,CAAC,EAA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CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,UAC7B,sBAAsB,GAAG,SAAS,KAC1C,sBAIF,CAAC;AAmEF,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,6GASlC,6BAA6B,gCAyB/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CratisComponentsProvider.js","sources":["../../../Common/CratisComponentsProvider.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 { useMemo, type ReactNode } from 'react';\nimport { I18nProvider } from 'react-aria-components/I18nProvider';\nimport { merge } from 'ts-deepmerge';\nimport { Toaster, type ToasterProps } from '../Notifications/Toaster';\nimport { unstable_RendererRoot } from '../renderer/RendererContext';\nimport type { CratisRendererSetup, unstable_UiLibrary } from '../renderer/manifest';\nimport type { CratisOverlayEnvironment } from '../renderer/overlayEnvironment';\nimport { CratisComponentsContext } from '../configuration/CratisComponentsContext';\nimport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\n\nconst RendererRoot = unstable_RendererRoot;\n\nexport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\nexport { useCratisComponentsConfig } from '../configuration/CratisComponentsContext';\n\n/** Localizable labels owned by the Cratis paginator. */\nexport interface CratisPaginatorMessages {\n /** Pagination navigation-region name. */\n navigation?: string;\n /** First-page action label. */\n first?: string;\n /** Previous-page action label. */\n previous?: string;\n /** Next-page action label. */\n next?: string;\n /** Last-page action label. */\n last?: string;\n}\n\n/** Localizable labels owned by the Cratis date picker composition. */\nexport interface CratisDatePickerMessages {\n /** Today action label. */\n today?: string;\n /** Clear action label. */\n clear?: string;\n /** Calendar-trigger label. */\n openCalendar?: string;\n /** Previous-month action label. */\n previousMonth?: string;\n /** Next-month action label. */\n nextMonth?: string;\n /**\n * Accessible name for the segmented date input when neither an explicit\n * `aria-label` nor a `placeholder` is supplied. Previously an orphaned\n * `'Date'` literal with no override path.\n */\n label?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Dropdown} composition. */\nexport interface CratisDropdownMessages {\n /** Accessible name for the options-popover trigger. */\n showOptions?: string;\n /** Accessible name for the clear-selection action. */\n clearSelection?: string;\n}\n\n/**\n * Localizable action and dismissal labels shared by every Cratis-owned dialog\n * surface — {@link Dialog}, {@link CommandDialog}, and {@link StepperCommandDialog}.\n */\nexport interface CratisDialogMessages {\n /** Primary confirmation label (the `Ok` action in `DialogButtons.Ok*`). */\n ok?: string;\n /** Cancellation label (the `Cancel` action, and the Stepper footer Cancel). */\n cancel?: string;\n /** Affirmative label (the `Yes` action in `DialogButtons.YesNo*`). */\n yes?: string;\n /** Negative label (the `No` action in `DialogButtons.YesNo*`). */\n no?: string;\n /** Accessible name for the header close (×) action. */\n close?: string;\n}\n\n/** Localizable navigation labels owned by {@link CommandStepper} / {@link StepperCommandDialog}. */\nexport interface CratisStepperMessages {\n /** Advance-to-next-step action label. */\n next?: string;\n /** Return-to-previous-step action label. */\n previous?: string;\n /** Final-step submit action label. */\n submit?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toaster}. */\nexport interface CratisNotificationsMessages {\n /** Accessible name for a toast's dismiss action. */\n dismiss?: string;\n /** Accessible name for the toast region landmark. */\n region?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link DataTableCore} composition. */\nexport interface CratisDataTableMessages {\n /** Accessible name for a single-selection row control. */\n selectRow?: string;\n /** Accessible name for the select-all control in a multiple-selection header. */\n selectAllRows?: string;\n /** Placeholder for the loaded-page search input. */\n search?: string;\n /** Accessible name for the loaded-page search input. */\n searchAriaLabel?: string;\n /** Message shown while loading an empty table. */\n loading?: string;\n /** Message shown when a query fails. */\n failed?: string;\n /** Message shown when a query denies access. */\n unauthorized?: string;\n}\n\n/** Localizable accessible names for the Cratis filter panel and its searches. */\nexport interface CratisFilterMessages {\n /** FilterPanel dialog name. Defaults to 'Filters'. */\n label?: string;\n /**\n * Search-input name for FilterPanel, its option groups, and standalone CheckboxListFilter.\n * Unset by default so an effective search placeholder retains precedence over 'Search'.\n * PivotViewer supplies group-specific names instead of using this shared name for its groups.\n */\n searchAriaLabel?: string;\n}\n\n/** Localizable labels owned by the Cratis column-filter popup. */\nexport interface CratisColumnFilterMessages {\n /** Builds the filter-trigger accessible name from the effective field. */\n filterTriggerAriaLabel?: (field: string) => string;\n /** Builds the value-control accessible name from the effective field. */\n valueAriaLabel?: (field: string) => string;\n /** Accessible name for the match-mode selector. */\n matchModeAriaLabel?: string;\n /** Localizes a match mode while retaining its default label as fallback input. */\n matchModeLabel?: (mode: string, defaultLabel: string) => string;\n /** Clear action label. */\n clear?: string;\n /** Apply action label. */\n apply?: string;\n /** Boolean true option label. */\n true?: string;\n /** Boolean false option label. */\n false?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toolbar} composition. */\nexport interface CratisToolbarMessages {\n /** Accessible toolbar name used when neither `aria-label` nor `aria-labelledby` is supplied. */\n label?: string;\n}\n\n/** Components-owned message groups. */\nexport interface CratisComponentsMessages {\n /** Paginator labels. */\n paginator?: CratisPaginatorMessages;\n /** Date-picker labels. */\n datePicker?: CratisDatePickerMessages;\n /** Dropdown labels. */\n dropdown?: CratisDropdownMessages;\n /** Dialog action/dismissal labels shared by Dialog, CommandDialog, and StepperCommandDialog. */\n dialog?: CratisDialogMessages;\n /** Stepper navigation labels shared by CommandStepper and StepperCommandDialog. */\n stepper?: CratisStepperMessages;\n /** Toaster labels. */\n notifications?: CratisNotificationsMessages;\n /** DataTable search, selection, and query-state messages. */\n dataTable?: CratisDataTableMessages;\n /** FilterPanel dialog and search-input accessible names. */\n filter?: CratisFilterMessages;\n /** Column-filter popup labels and match-mode copy. */\n columnFilter?: CratisColumnFilterMessages;\n /** Toolbar accessible-name fallback. */\n toolbar?: CratisToolbarMessages;\n}\n\n/**\n * Components-owned icon vocabulary. Every name is a concept the library draws in more than one\n * place; registering one replaces that concept's built-in glyph everywhere it is drawn, without\n * touching the surrounding element, its part, or its accessible name.\n *\n * Resolution per site is `per-component prop → provider icon → built-in glyph`: a named prop such\n * as `Dialog`'s `closeIcon` means \"this one call site\" and keeps winning, while the provider\n * replaces the built-in default for the whole product. Registering nothing renders exactly what the\n * library renders today, because the built-in glyph stays at its call site and is never part of\n * {@link cratisDefaults}.\n *\n * A name registered as `null` draws no glyph while the button, its part, and its accessible name\n * remain — the same meaning `closeIcon={null}` already has.\n */\nexport interface CratisComponentsIcons {\n /** Dismissal mark. Drawn by `Dialog`'s header close, `Toaster`'s dismiss, `ChatSidebar`, the `Chat` panel, and the PivotViewer detail panel. Defaults to `×`. */\n close?: ReactNode;\n /** Remove-this-value mark. Drawn by `TagGroup`'s tag remove, `Chip`'s remove control, and `CommandForm`'s chips field. Defaults to `×`. */\n remove?: ReactNode;\n /** Expand/collapse chevron on a closed-by-default surface. Drawn by `Dropdown`'s trigger and `ComboBox`'s trigger. Defaults to `⌄` (`▾` in `ComboBox`). */\n expand?: ReactNode;\n /** Ascending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▲`. */\n sortAscending?: ReactNode;\n /** Descending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▼`. */\n sortDescending?: ReactNode;\n /** Step-backwards mark. Drawn by `TablePaginator`'s previous page and the date picker's previous month. Defaults to `‹`. */\n previous?: ReactNode;\n /** Step-forwards mark. Drawn by `TablePaginator`'s next page and the date picker's next month. Defaults to `›`. */\n next?: ReactNode;\n /** Clear-the-current-value mark. Drawn by `Dropdown`'s clear-selection action and the PivotViewer filter panel's clear action. Defaults to `×`. */\n clear?: ReactNode;\n}\n\ninterface LegacyLocaleMessages {\n today?: string;\n clear?: string;\n aria?: {\n navigation?: string;\n firstPageLabel?: string;\n prevPageLabel?: string;\n nextPageLabel?: string;\n lastPageLabel?: string;\n };\n [message: string]: unknown;\n}\n\n/** Renderer-independent application configuration for Components. */\nexport interface CratisComponentsConfig {\n /** BCP 47 locale used by React Aria for dates, numbers, and interaction announcements. */\n locale?: string;\n /** Cratis-owned labels not supplied by the platform's internationalization APIs. */\n messages?: CratisComponentsMessages;\n /** Cratis-owned icon vocabulary replacing the built-in glyphs the library draws. */\n icons?: CratisComponentsIcons;\n /**\n * @deprecated Use {@link messages}; React Aria supplies its own locale data.\n */\n locales?: Record<string, LegacyLocaleMessages>;\n}\n\n/** Props for the application-root Components provider. */\nexport interface CratisComponentsProviderProps {\n /** Locale and Components-owned messages. */\n value?: CratisComponentsConfig;\n /** Mounts the global toaster with defaults or explicit options. */\n toaster?: boolean | ToasterProps;\n /**\n * Selects one stable presentation library. The broader generic manifest and ordered,\n * last-wins composition form remain experimental.\n */\n library?: unstable_UiLibrary | readonly unstable_UiLibrary[];\n /** Experimental profile-promise behavior. Defaults to strict. */\n libraryMode?: 'strict' | 'degrade';\n /** Terminal slot fallback behavior. Defaults to the built-in Core implementation. */\n rendererFallback?: 'core' | 'throw';\n /** Host environment for overlay portal containers. */\n overlayEnvironment?: CratisOverlayEnvironment;\n /**\n * Non-secret renderer setup attestations. Values are booleans so credentials and license\n * tokens never cross the Components provider boundary.\n */\n rendererSetup?: CratisRendererSetup;\n /** Application content. */\n children: ReactNode;\n}\n\n/**\n * Deep-merges consumer configuration over {@link cratisDefaults}.\n *\n * `icons` merges by name only. An icon value is an opaque node — often a React element — so it is\n * carried over by identity instead of being deep-merged into, while a partial map still leaves every\n * unregistered name to its built-in glyph.\n */\nexport const mergeCratisComponentsConfig = (\n value: CratisComponentsConfig | undefined,\n): CratisComponentsConfig => {\n const { icons, ...rest } = value ?? {};\n const merged = merge(cratisDefaults, rest) as CratisComponentsConfig;\n return icons ? { ...merged, icons: { ...cratisDefaults.icons, ...icons } } : merged;\n};\n\nconst withLegacyLocaleMessages = (\n config: CratisComponentsConfig,\n explicitMessages: CratisComponentsMessages | undefined,\n): CratisComponentsConfig => {\n const legacy = config.locale ? config.locales?.[config.locale] : undefined;\n if (!legacy) return config;\n return {\n ...config,\n messages: {\n ...config.messages,\n paginator: {\n navigation:\n explicitMessages?.paginator?.navigation ??\n legacy.aria?.navigation ??\n config.messages?.paginator?.navigation,\n first:\n explicitMessages?.paginator?.first ??\n legacy.aria?.firstPageLabel ??\n config.messages?.paginator?.first,\n previous:\n explicitMessages?.paginator?.previous ??\n legacy.aria?.prevPageLabel ??\n config.messages?.paginator?.previous,\n next:\n explicitMessages?.paginator?.next ??\n legacy.aria?.nextPageLabel ??\n config.messages?.paginator?.next,\n last:\n explicitMessages?.paginator?.last ??\n legacy.aria?.lastPageLabel ??\n config.messages?.paginator?.last,\n },\n datePicker: {\n ...config.messages?.datePicker,\n today:\n explicitMessages?.datePicker?.today ??\n legacy.today ??\n config.messages?.datePicker?.today,\n clear:\n explicitMessages?.datePicker?.clear ??\n legacy.clear ??\n config.messages?.datePicker?.clear,\n openCalendar:\n explicitMessages?.datePicker?.openCalendar ??\n config.messages?.datePicker?.openCalendar,\n previousMonth:\n explicitMessages?.datePicker?.previousMonth ??\n config.messages?.datePicker?.previousMonth,\n nextMonth:\n explicitMessages?.datePicker?.nextMonth ??\n config.messages?.datePicker?.nextMonth,\n },\n },\n };\n};\n\nconst validLocale = (locale: string | undefined) => {\n if (!locale) return 'en-US';\n try {\n return new Intl.Locale(locale).toString();\n } catch {\n return 'en-US';\n }\n};\n\n/** Application root for locale, labels, and the optional app-wide toaster. */\nexport const CratisComponentsProvider = ({\n value,\n toaster,\n library,\n libraryMode,\n rendererFallback,\n overlayEnvironment,\n rendererSetup,\n children,\n}: CratisComponentsProviderProps) => {\n const resolved = useMemo(\n () =>\n withLegacyLocaleMessages(mergeCratisComponentsConfig(value), value?.messages),\n [value],\n );\n\n return (\n <RendererRoot\n library={library}\n libraryMode={libraryMode}\n rendererFallback={rendererFallback}\n overlayEnvironment={overlayEnvironment}\n rendererSetup={rendererSetup}\n >\n <CratisComponentsContext.Provider value={resolved}>\n <I18nProvider locale={validLocale(resolved.locale)}>\n {children}\n {toaster && (\n <Toaster {...(typeof toaster === 'object' ? toaster : {})} />\n )}\n </I18nProvider>\n </CratisComponentsContext.Provider>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E;IAC7C;AAAE,IAAA,MAAM;AACJ,QAAA,OAAO,OAAO;IAClB;AACJ,CAAC;MAGY,wBAAwB,GAAG,CAAC,EACrC,KAAK,EACL,OAAO,EACP,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,QAAQ,GACoB,KAAI;IAChC,MAAM,QAAQ,GAAG,OAAO,CACpB,MACI,wBAAwB,CAAC,2BAA2B,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,EACjF,CAAC,KAAK,CAAC,CACV;AAED,IAAA,QACIA,GAAA,CAAC,YAAY,EAAA,EACT,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,YAE5BA,GAAA,CAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,EAAA,QAAA,EAC7CC,KAAC,YAAY,EAAA,EAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAA,QAAA,EAAA,CAC7C,QAAQ,EACR,OAAO,KACJD,GAAA,CAAC,OAAO,QAAM,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC,GAAI,CAChE,CAAA,EAAA,CACU,EAAA,CACgB,EAAA,CACxB;AAEvB;;"}
1
+ {"version":3,"file":"CratisComponentsProvider.js","sources":["../../../Common/CratisComponentsProvider.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 { useMemo, type ReactNode } from 'react';\nimport { I18nProvider } from 'react-aria-components/I18nProvider';\nimport { merge } from 'ts-deepmerge';\nimport { Toaster, type ToasterProps } from '../Notifications/Toaster';\nimport { unstable_RendererRoot } from '../renderer/RendererContext';\nimport type { CratisRendererSetup, unstable_UiLibrary } from '../renderer/manifest';\nimport type { CratisOverlayEnvironment } from '../renderer/overlayEnvironment';\nimport { CratisComponentsContext } from '../configuration/CratisComponentsContext';\nimport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\n\nconst RendererRoot = unstable_RendererRoot;\n\nexport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\nexport { useCratisComponentsConfig } from '../configuration/CratisComponentsContext';\n\n/** Localizable labels owned by the Cratis paginator. */\nexport interface CratisPaginatorMessages {\n /** Pagination navigation-region name. */\n navigation?: string;\n /** First-page action label. */\n first?: string;\n /** Previous-page action label. */\n previous?: string;\n /** Next-page action label. */\n next?: string;\n /** Last-page action label. */\n last?: string;\n}\n\n/** Localizable labels owned by the Cratis date picker composition. */\nexport interface CratisDatePickerMessages {\n /** Today action label. */\n today?: string;\n /** Clear action label. */\n clear?: string;\n /** Calendar-trigger label. */\n openCalendar?: string;\n /** Previous-month action label. */\n previousMonth?: string;\n /** Next-month action label. */\n nextMonth?: string;\n /**\n * Accessible name for the segmented date input when neither an explicit\n * `aria-label` nor a `placeholder` is supplied. Previously an orphaned\n * `'Date'` literal with no override path.\n */\n label?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Dropdown} composition. */\nexport interface CratisDropdownMessages {\n /** Accessible name for the options-popover trigger. */\n showOptions?: string;\n /** Accessible name for the clear-selection action. */\n clearSelection?: string;\n}\n\n/**\n * Localizable action and dismissal labels shared by every Cratis-owned dialog\n * surface — {@link Dialog}, {@link CommandDialog}, and {@link StepperCommandDialog}.\n */\nexport interface CratisDialogMessages {\n /** Primary confirmation label (the `Ok` action in `DialogButtons.Ok*`). */\n ok?: string;\n /** Cancellation label (the `Cancel` action, and the Stepper footer Cancel). */\n cancel?: string;\n /** Affirmative label (the `Yes` action in `DialogButtons.YesNo*`). */\n yes?: string;\n /** Negative label (the `No` action in `DialogButtons.YesNo*`). */\n no?: string;\n /** Accessible name for the header close (×) action. */\n close?: string;\n}\n\n/** Localizable navigation labels owned by {@link CommandStepper} / {@link StepperCommandDialog}. */\nexport interface CratisStepperMessages {\n /** Advance-to-next-step action label. */\n next?: string;\n /** Return-to-previous-step action label. */\n previous?: string;\n /** Final-step submit action label. */\n submit?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toaster}. */\nexport interface CratisNotificationsMessages {\n /** Accessible name for a toast's dismiss action. */\n dismiss?: string;\n /** Accessible name for the toast region landmark. */\n region?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link DataTableCore} composition. */\nexport interface CratisDataTableMessages {\n /** Accessible name for a single-selection row control. */\n selectRow?: string;\n /** Accessible name for the select-all control in a multiple-selection header. */\n selectAllRows?: string;\n /** Placeholder for the loaded-page search input. */\n search?: string;\n /** Accessible name for the loaded-page search input. */\n searchAriaLabel?: string;\n /** Message shown while loading an empty table. */\n loading?: string;\n /** Message shown when a query fails. */\n failed?: string;\n /** Message shown when a query denies access. */\n unauthorized?: string;\n}\n\n/** Localizable accessible names for the Cratis filter panel and its searches. */\nexport interface CratisFilterMessages {\n /** FilterPanel dialog name. Defaults to 'Filters'. */\n label?: string;\n /**\n * Search-input name for FilterPanel, its option groups, and standalone CheckboxListFilter.\n * Unset by default so an effective search placeholder retains precedence over 'Search'.\n * PivotViewer supplies group-specific names instead of using this shared name for its groups.\n */\n searchAriaLabel?: string;\n}\n\n/** Localizable labels owned by the Cratis column-filter popup. */\nexport interface CratisColumnFilterMessages {\n /** Builds the filter-trigger accessible name from the effective field. */\n filterTriggerAriaLabel?: (field: string) => string;\n /** Builds the value-control accessible name from the effective field. */\n valueAriaLabel?: (field: string) => string;\n /** Accessible name for the match-mode selector. */\n matchModeAriaLabel?: string;\n /** Localizes a match mode while retaining its default label as fallback input. */\n matchModeLabel?: (mode: string, defaultLabel: string) => string;\n /** Clear action label. */\n clear?: string;\n /** Apply action label. */\n apply?: string;\n /** Boolean true option label. */\n true?: string;\n /** Boolean false option label. */\n false?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toolbar} composition. */\nexport interface CratisToolbarMessages {\n /** Accessible toolbar name used when neither `aria-label` nor `aria-labelledby` is supplied. */\n label?: string;\n /** Accessible name of the close button in a drawer {@link ToolbarFolder}. Defaults to 'Close'. */\n closeDrawer?: string;\n}\n\n/** Components-owned message groups. */\nexport interface CratisComponentsMessages {\n /** Paginator labels. */\n paginator?: CratisPaginatorMessages;\n /** Date-picker labels. */\n datePicker?: CratisDatePickerMessages;\n /** Dropdown labels. */\n dropdown?: CratisDropdownMessages;\n /** Dialog action/dismissal labels shared by Dialog, CommandDialog, and StepperCommandDialog. */\n dialog?: CratisDialogMessages;\n /** Stepper navigation labels shared by CommandStepper and StepperCommandDialog. */\n stepper?: CratisStepperMessages;\n /** Toaster labels. */\n notifications?: CratisNotificationsMessages;\n /** DataTable search, selection, and query-state messages. */\n dataTable?: CratisDataTableMessages;\n /** FilterPanel dialog and search-input accessible names. */\n filter?: CratisFilterMessages;\n /** Column-filter popup labels and match-mode copy. */\n columnFilter?: CratisColumnFilterMessages;\n /** Toolbar accessible-name fallback. */\n toolbar?: CratisToolbarMessages;\n}\n\n/**\n * Components-owned icon vocabulary. Every name is a concept the library draws in more than one\n * place; registering one replaces that concept's built-in glyph everywhere it is drawn, without\n * touching the surrounding element, its part, or its accessible name.\n *\n * Resolution per site is `per-component prop → provider icon → built-in glyph`: a named prop such\n * as `Dialog`'s `closeIcon` means \"this one call site\" and keeps winning, while the provider\n * replaces the built-in default for the whole product. Registering nothing renders exactly what the\n * library renders today, because the built-in glyph stays at its call site and is never part of\n * {@link cratisDefaults}.\n *\n * A name registered as `null` draws no glyph while the button, its part, and its accessible name\n * remain — the same meaning `closeIcon={null}` already has.\n */\nexport interface CratisComponentsIcons {\n /** Dismissal mark. Drawn by `Dialog`'s header close, `Toaster`'s dismiss, `ChatSidebar`, the `Chat` panel, and the PivotViewer detail panel. Defaults to `×`. */\n close?: ReactNode;\n /** Remove-this-value mark. Drawn by `TagGroup`'s tag remove, `Chip`'s remove control, and `CommandForm`'s chips field. Defaults to `×`. */\n remove?: ReactNode;\n /** Expand/collapse chevron on a closed-by-default surface. Drawn by `Dropdown`'s trigger and `ComboBox`'s trigger. Defaults to `⌄` (`▾` in `ComboBox`). */\n expand?: ReactNode;\n /** Ascending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▲`. */\n sortAscending?: ReactNode;\n /** Descending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▼`. */\n sortDescending?: ReactNode;\n /** Step-backwards mark. Drawn by `TablePaginator`'s previous page and the date picker's previous month. Defaults to `‹`. */\n previous?: ReactNode;\n /** Step-forwards mark. Drawn by `TablePaginator`'s next page and the date picker's next month. Defaults to `›`. */\n next?: ReactNode;\n /** Clear-the-current-value mark. Drawn by `Dropdown`'s clear-selection action and the PivotViewer filter panel's clear action. Defaults to `×`. */\n clear?: ReactNode;\n}\n\ninterface LegacyLocaleMessages {\n today?: string;\n clear?: string;\n aria?: {\n navigation?: string;\n firstPageLabel?: string;\n prevPageLabel?: string;\n nextPageLabel?: string;\n lastPageLabel?: string;\n };\n [message: string]: unknown;\n}\n\n/** Renderer-independent application configuration for Components. */\nexport interface CratisComponentsConfig {\n /** BCP 47 locale used by React Aria for dates, numbers, and interaction announcements. */\n locale?: string;\n /** Cratis-owned labels not supplied by the platform's internationalization APIs. */\n messages?: CratisComponentsMessages;\n /** Cratis-owned icon vocabulary replacing the built-in glyphs the library draws. */\n icons?: CratisComponentsIcons;\n /**\n * @deprecated Use {@link messages}; React Aria supplies its own locale data.\n */\n locales?: Record<string, LegacyLocaleMessages>;\n}\n\n/** Props for the application-root Components provider. */\nexport interface CratisComponentsProviderProps {\n /** Locale and Components-owned messages. */\n value?: CratisComponentsConfig;\n /** Mounts the global toaster with defaults or explicit options. */\n toaster?: boolean | ToasterProps;\n /**\n * Selects one stable presentation library. The broader generic manifest and ordered,\n * last-wins composition form remain experimental.\n */\n library?: unstable_UiLibrary | readonly unstable_UiLibrary[];\n /** Experimental profile-promise behavior. Defaults to strict. */\n libraryMode?: 'strict' | 'degrade';\n /** Terminal slot fallback behavior. Defaults to the built-in Core implementation. */\n rendererFallback?: 'core' | 'throw';\n /** Host environment for overlay portal containers. */\n overlayEnvironment?: CratisOverlayEnvironment;\n /**\n * Non-secret renderer setup attestations. Values are booleans so credentials and license\n * tokens never cross the Components provider boundary.\n */\n rendererSetup?: CratisRendererSetup;\n /** Application content. */\n children: ReactNode;\n}\n\n/**\n * Deep-merges consumer configuration over {@link cratisDefaults}.\n *\n * `icons` merges by name only. An icon value is an opaque node — often a React element — so it is\n * carried over by identity instead of being deep-merged into, while a partial map still leaves every\n * unregistered name to its built-in glyph.\n */\nexport const mergeCratisComponentsConfig = (\n value: CratisComponentsConfig | undefined,\n): CratisComponentsConfig => {\n const { icons, ...rest } = value ?? {};\n const merged = merge(cratisDefaults, rest) as CratisComponentsConfig;\n return icons ? { ...merged, icons: { ...cratisDefaults.icons, ...icons } } : merged;\n};\n\nconst withLegacyLocaleMessages = (\n config: CratisComponentsConfig,\n explicitMessages: CratisComponentsMessages | undefined,\n): CratisComponentsConfig => {\n const legacy = config.locale ? config.locales?.[config.locale] : undefined;\n if (!legacy) return config;\n return {\n ...config,\n messages: {\n ...config.messages,\n paginator: {\n navigation:\n explicitMessages?.paginator?.navigation ??\n legacy.aria?.navigation ??\n config.messages?.paginator?.navigation,\n first:\n explicitMessages?.paginator?.first ??\n legacy.aria?.firstPageLabel ??\n config.messages?.paginator?.first,\n previous:\n explicitMessages?.paginator?.previous ??\n legacy.aria?.prevPageLabel ??\n config.messages?.paginator?.previous,\n next:\n explicitMessages?.paginator?.next ??\n legacy.aria?.nextPageLabel ??\n config.messages?.paginator?.next,\n last:\n explicitMessages?.paginator?.last ??\n legacy.aria?.lastPageLabel ??\n config.messages?.paginator?.last,\n },\n datePicker: {\n ...config.messages?.datePicker,\n today:\n explicitMessages?.datePicker?.today ??\n legacy.today ??\n config.messages?.datePicker?.today,\n clear:\n explicitMessages?.datePicker?.clear ??\n legacy.clear ??\n config.messages?.datePicker?.clear,\n openCalendar:\n explicitMessages?.datePicker?.openCalendar ??\n config.messages?.datePicker?.openCalendar,\n previousMonth:\n explicitMessages?.datePicker?.previousMonth ??\n config.messages?.datePicker?.previousMonth,\n nextMonth:\n explicitMessages?.datePicker?.nextMonth ??\n config.messages?.datePicker?.nextMonth,\n },\n },\n };\n};\n\nconst validLocale = (locale: string | undefined) => {\n if (!locale) return 'en-US';\n try {\n return new Intl.Locale(locale).toString();\n } catch {\n return 'en-US';\n }\n};\n\n/** Application root for locale, labels, and the optional app-wide toaster. */\nexport const CratisComponentsProvider = ({\n value,\n toaster,\n library,\n libraryMode,\n rendererFallback,\n overlayEnvironment,\n rendererSetup,\n children,\n}: CratisComponentsProviderProps) => {\n const resolved = useMemo(\n () =>\n withLegacyLocaleMessages(mergeCratisComponentsConfig(value), value?.messages),\n [value],\n );\n\n return (\n <RendererRoot\n library={library}\n libraryMode={libraryMode}\n rendererFallback={rendererFallback}\n overlayEnvironment={overlayEnvironment}\n rendererSetup={rendererSetup}\n >\n <CratisComponentsContext.Provider value={resolved}>\n <I18nProvider locale={validLocale(resolved.locale)}>\n {children}\n {toaster && (\n <Toaster {...(typeof toaster === 'object' ? toaster : {})} />\n )}\n </I18nProvider>\n </CratisComponentsContext.Provider>\n </RendererRoot>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAaA,MAAM,YAAY,GAAG,qBAAqB;AAiQnC,MAAM,2BAA2B,GAAG,CACvC,KAAyC,KACjB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,EAAE,IAAI,CAA2B;IACpE,OAAO,KAAK,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,MAAM;AACvF;AAEA,MAAM,wBAAwB,GAAG,CAC7B,MAA8B,EAC9B,gBAAsD,KAC9B;IACxB,MA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BAAkB,EACtC,aAAa,EAAE,aAAa,YAE5BA,GAAA,CAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,EAAA,QAAA,EAC7CC,KAAC,YAAY,EAAA,EAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAA,QAAA,EAAA,CAC7C,QAAQ,EACR,OAAO,KACJD,GAAA,CAAC,OAAO,QAAM,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC,GAAI,CAChE,CAAA,EAAA,CACU,EAAA,CACgB,EAAA,CACxB;AAEvB;;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A target an item can point at, supplied by the host. The editor lists and selects destinations;
3
+ * it never resolves them, navigates to them or discovers them from an application.
4
+ */
5
+ export interface ConfigurationDestination {
6
+ /** Stable identity stored on the item. Never the label. */
7
+ id: string;
8
+ /** Localizable name shown to the person choosing. */
9
+ label: string;
10
+ /** Optional group the destination is listed under. */
11
+ group?: string;
12
+ }
13
+ //# sourceMappingURL=ConfigurationDestination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationDestination.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationDestination.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACrC,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IAEX,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IAEd,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -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=ConfigurationDestination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationDestination.js","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationDestination.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/**\n * A target an item can point at, supplied by the host. The editor lists and selects destinations;\n * it never resolves them, navigates to them or discovers them from an application.\n */\nexport interface ConfigurationDestination {\n /** Stable identity stored on the item. Never the label. */\n id: string;\n\n /** Localizable name shown to the person choosing. */\n label: string;\n\n /** Optional group the destination is listed under. */\n group?: string;\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ConfigurationEditorRenderProps } from './ConfigurationEditorRenderProps.js';
3
+ /** Props for the {@link ConfigurationEditor} component. */
4
+ export interface ConfigurationEditorProps<TValue = unknown, TContext = unknown> {
5
+ /** The host-defined type of the component being configured. Looked up in the nearest {@link ConfigurationEditorProvider}. */
6
+ componentType: string;
7
+ /** The component's current configuration. */
8
+ value: TValue;
9
+ /** Receives a proposed configuration. Apply it by passing a new `value`; ignore it to cancel. */
10
+ onChange: (proposal: TValue) => void;
11
+ /** Whether the person may change the configuration. */
12
+ readOnly?: boolean;
13
+ /** Host-defined data passed untouched to the registered editor and to the fallback. */
14
+ context?: TContext;
15
+ /**
16
+ * What to show when no editor is registered for the component type, typically generic
17
+ * {@link PropertyControls}. Without a fallback nothing is rendered.
18
+ */
19
+ fallback?: ReactNode | ((props: ConfigurationEditorRenderProps<TValue, TContext>) => ReactNode);
20
+ }
21
+ /**
22
+ * Shows the configuration editor registered for a component type, or the generic fallback. Which
23
+ * component types exist, what an edit means, and which template policy applies are all the host's;
24
+ * this component only chooses the editor.
25
+ */
26
+ export declare const ConfigurationEditor: <TValue, TContext = unknown>({ componentType, value, onChange, readOnly, context, fallback, }: ConfigurationEditorProps<TValue, TContext>) => import("react").JSX.Element;
27
+ //# sourceMappingURL=ConfigurationEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditor.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAkC,CAAC;AAEvF,2DAA2D;AAC3D,MAAM,WAAW,wBAAwB,CAAC,MAAM,GAAG,OAAO,EAAE,QAAQ,GAAG,OAAO;IAC1E,6HAA6H;IAC7H,aAAa,EAAE,MAAM,CAAC;IAEtB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IAEd,iGAAiG;IACjG,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,uFAAuF;IACvF,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,8BAA8B,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,SAAS,CAAC,CAAC;CACnG;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,EAAE,QAAQ,GAAG,OAAO,oEAO3D,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,gCAM5C,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useConfigurationEditor } from './ConfigurationEditorProvider.js';
3
+
4
+ const ConfigurationEditor = ({ componentType, value, onChange, readOnly = false, context, fallback, }) => {
5
+ const editor = useConfigurationEditor(componentType);
6
+ const props = { componentType, value, onChange, readOnly, context };
7
+ if (editor)
8
+ return jsx(Fragment, { children: editor(props) });
9
+ return jsx(Fragment, { children: typeof fallback === 'function' ? fallback(props) : fallback });
10
+ };
11
+
12
+ export { ConfigurationEditor };
13
+ //# sourceMappingURL=ConfigurationEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditor.js","sources":["../../../ConfigurationEditor/ConfigurationEditor.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 type { ReactNode } from 'react';\nimport { useConfigurationEditor } from './ConfigurationEditorProvider';\nimport type { ConfigurationEditorRenderProps } from './ConfigurationEditorRenderProps';\n\n/** Props for the {@link ConfigurationEditor} component. */\nexport interface ConfigurationEditorProps<TValue = unknown, TContext = unknown> {\n /** The host-defined type of the component being configured. Looked up in the nearest {@link ConfigurationEditorProvider}. */\n componentType: string;\n\n /** The component's current configuration. */\n value: TValue;\n\n /** Receives a proposed configuration. Apply it by passing a new `value`; ignore it to cancel. */\n onChange: (proposal: TValue) => void;\n\n /** Whether the person may change the configuration. */\n readOnly?: boolean;\n\n /** Host-defined data passed untouched to the registered editor and to the fallback. */\n context?: TContext;\n\n /**\n * What to show when no editor is registered for the component type, typically generic\n * {@link PropertyControls}. Without a fallback nothing is rendered.\n */\n fallback?: ReactNode | ((props: ConfigurationEditorRenderProps<TValue, TContext>) => ReactNode);\n}\n\n/**\n * Shows the configuration editor registered for a component type, or the generic fallback. Which\n * component types exist, what an edit means, and which template policy applies are all the host's;\n * this component only chooses the editor.\n */\nexport const ConfigurationEditor = <TValue, TContext = unknown>({\n componentType,\n value,\n onChange,\n readOnly = false,\n context,\n fallback,\n}: ConfigurationEditorProps<TValue, TContext>) => {\n const editor = useConfigurationEditor<TValue, TContext>(componentType);\n const props: ConfigurationEditorRenderProps<TValue, TContext> = { componentType, value, onChange, readOnly, context };\n\n if (editor) return <>{editor(props)}</>;\n return <>{typeof fallback === 'function' ? fallback(props) : fallback}</>;\n};\n"],"names":["_jsx"],"mappings":";;;MAoCa,mBAAmB,GAAG,CAA6B,EAC5D,aAAa,EACb,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,QAAQ,GACiC,KAAI;AAC7C,IAAA,MAAM,MAAM,GAAG,sBAAsB,CAAmB,aAAa,CAAC;AACtE,IAAA,MAAM,KAAK,GAAqD,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;AAErH,IAAA,IAAI,MAAM;AAAE,QAAA,OAAOA,0BAAG,MAAM,CAAC,KAAK,CAAC,GAAI;AACvC,IAAA,OAAOA,0BAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,GAAI;AAC7E;;"}
@@ -0,0 +1,6 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ /** Attributes passed through to one part of a configuration editor, including `data-*` attributes. */
3
+ export type ConfigurationEditorPartAttributes<TElement> = HTMLAttributes<TElement> & {
4
+ [attribute: `data-${string}`]: string | number | boolean | undefined;
5
+ };
6
+ //# sourceMappingURL=ConfigurationEditorPartAttributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditorPartAttributes.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationEditorPartAttributes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,sGAAsG;AACtG,MAAM,MAAM,iCAAiC,CAAC,QAAQ,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG;IACjF,CAAC,SAAS,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACxE,CAAC"}
@@ -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=ConfigurationEditorPartAttributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditorPartAttributes.js","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationEditorPartAttributes.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 { HTMLAttributes } from 'react';\n\n/** Attributes passed through to one part of a configuration editor, including `data-*` attributes. */\nexport type ConfigurationEditorPartAttributes<TElement> = HTMLAttributes<TElement> & {\n [attribute: `data-${string}`]: string | number | boolean | undefined;\n};\n"]}
@@ -0,0 +1,28 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ConfigurationEditorRenderer } from './ConfigurationEditorRenderer.js';
3
+ /** The editors available to a subtree, by host-defined component type. */
4
+ export type ConfigurationEditorMap = Readonly<Record<string, ConfigurationEditorRenderer<never, never>>>;
5
+ /** Props for the {@link ConfigurationEditorProvider} component. */
6
+ export interface ConfigurationEditorProviderProps {
7
+ /**
8
+ * The specialised editors the host registers, keyed by its own component type names. A nested
9
+ * provider adds to and overrides its parent's editors.
10
+ */
11
+ editors: ConfigurationEditorMap;
12
+ /** The subtree that can look the editors up. */
13
+ children?: ReactNode;
14
+ }
15
+ /**
16
+ * Makes component-specific configuration editors available to a subtree. This is the extension
17
+ * seam: a component brings its own editor, the host registers it under the type name it already
18
+ * uses, and {@link ConfigurationEditor} falls back to generic controls for everything else.
19
+ */
20
+ export declare const ConfigurationEditorProvider: ({ editors, children }: ConfigurationEditorProviderProps) => import("react").JSX.Element;
21
+ /**
22
+ * Looks up the editor registered for a component type.
23
+ *
24
+ * @param componentType The host-defined component type.
25
+ * @returns The registered editor, or `undefined` when none is registered.
26
+ */
27
+ export declare const useConfigurationEditor: <TValue, TContext = unknown>(componentType: string) => ConfigurationEditorRenderer<TValue, TContext> | undefined;
28
+ //# sourceMappingURL=ConfigurationEditorProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditorProvider.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationEditorProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAA+B,CAAC;AAEjF,0EAA0E;AAC1E,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAIzG,mEAAmE;AACnE,MAAM,WAAW,gCAAgC;IAC7C;;;OAGG;IACH,OAAO,EAAE,sBAAsB,CAAC;IAEhC,gDAAgD;IAChD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,0BAA2B,gCAAgC,gCAIlG,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,EAAE,QAAQ,GAAG,OAAO,iBAC9C,MAAM,KACtB,2BAA2B,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAGlD,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { createContext, useContext, useMemo } from 'react';
3
+
4
+ const ConfigurationEditorContext = createContext({});
5
+ const ConfigurationEditorProvider = ({ editors, children }) => {
6
+ const parent = useContext(ConfigurationEditorContext);
7
+ const merged = useMemo(() => ({ ...parent, ...editors }), [parent, editors]);
8
+ return jsx(ConfigurationEditorContext.Provider, { value: merged, children: children });
9
+ };
10
+ const useConfigurationEditor = (componentType) => {
11
+ const editors = useContext(ConfigurationEditorContext);
12
+ return editors[componentType];
13
+ };
14
+
15
+ export { ConfigurationEditorProvider, useConfigurationEditor };
16
+ //# sourceMappingURL=ConfigurationEditorProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditorProvider.js","sources":["../../../ConfigurationEditor/ConfigurationEditorProvider.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 { createContext, useContext, useMemo, type ReactNode } from 'react';\nimport type { ConfigurationEditorRenderer } from './ConfigurationEditorRenderer';\n\n/** The editors available to a subtree, by host-defined component type. */\nexport type ConfigurationEditorMap = Readonly<Record<string, ConfigurationEditorRenderer<never, never>>>;\n\nconst ConfigurationEditorContext = createContext<ConfigurationEditorMap>({});\n\n/** Props for the {@link ConfigurationEditorProvider} component. */\nexport interface ConfigurationEditorProviderProps {\n /**\n * The specialised editors the host registers, keyed by its own component type names. A nested\n * provider adds to and overrides its parent's editors.\n */\n editors: ConfigurationEditorMap;\n\n /** The subtree that can look the editors up. */\n children?: ReactNode;\n}\n\n/**\n * Makes component-specific configuration editors available to a subtree. This is the extension\n * seam: a component brings its own editor, the host registers it under the type name it already\n * uses, and {@link ConfigurationEditor} falls back to generic controls for everything else.\n */\nexport const ConfigurationEditorProvider = ({ editors, children }: ConfigurationEditorProviderProps) => {\n const parent = useContext(ConfigurationEditorContext);\n const merged = useMemo(() => ({ ...parent, ...editors }), [parent, editors]);\n return <ConfigurationEditorContext.Provider value={merged}>{children}</ConfigurationEditorContext.Provider>;\n};\n\n/**\n * Looks up the editor registered for a component type.\n *\n * @param componentType The host-defined component type.\n * @returns The registered editor, or `undefined` when none is registered.\n */\nexport const useConfigurationEditor = <TValue, TContext = unknown>(\n componentType: string,\n): ConfigurationEditorRenderer<TValue, TContext> | undefined => {\n const editors = useContext(ConfigurationEditorContext);\n return editors[componentType] as unknown as ConfigurationEditorRenderer<TValue, TContext> | undefined;\n};\n"],"names":["_jsx"],"mappings":";;;AASA,MAAM,0BAA0B,GAAG,aAAa,CAAyB,EAAE,CAAC;AAmBrE,MAAM,2BAA2B,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAoC,KAAI;AACnG,IAAA,MAAM,MAAM,GAAG,UAAU,CAAC,0BAA0B,CAAC;IACrD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5E,OAAOA,GAAA,CAAC,0BAA0B,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,MAAM,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAuC;AAC/G;AAQO,MAAM,sBAAsB,GAAG,CAClC,aAAqB,KACsC;AAC3D,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,0BAA0B,CAAC;AACtD,IAAA,OAAO,OAAO,CAAC,aAAa,CAAyE;AACzG;;"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * What a registered editor receives. The value is the host's own configuration for the component;
3
+ * the editor reads it and proposes a replacement through {@link onChange}.
4
+ */
5
+ export interface ConfigurationEditorRenderProps<TValue = unknown, TContext = unknown> {
6
+ /** The host-defined component type the editor was looked up by. */
7
+ componentType: string;
8
+ /** The component's current configuration. */
9
+ value: TValue;
10
+ /**
11
+ * Proposes a new configuration. The editor is controlled: the host applies the proposal by passing
12
+ * a new `value`, or ignores it to cancel. The host still owns permission checks and persistence.
13
+ */
14
+ onChange: (proposal: TValue) => void;
15
+ /** Whether the person may change the configuration. */
16
+ readOnly: boolean;
17
+ /** Host-defined data the editor needs, such as capabilities, destinations or an icon catalog. Passed through untouched. */
18
+ context?: TContext;
19
+ }
20
+ //# sourceMappingURL=ConfigurationEditorRenderProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditorRenderProps.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationEditorRenderProps.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,8BAA8B,CAAC,MAAM,GAAG,OAAO,EAAE,QAAQ,GAAG,OAAO;IAChF,mEAAmE;IACnE,aAAa,EAAE,MAAM,CAAC;IAEtB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,uDAAuD;IACvD,QAAQ,EAAE,OAAO,CAAC;IAElB,2HAA2H;IAC3H,OAAO,CAAC,EAAE,QAAQ,CAAC;CACtB"}
@@ -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=ConfigurationEditorRenderProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditorRenderProps.js","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationEditorRenderProps.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/**\n * What a registered editor receives. The value is the host's own configuration for the component;\n * the editor reads it and proposes a replacement through {@link onChange}.\n */\nexport interface ConfigurationEditorRenderProps<TValue = unknown, TContext = unknown> {\n /** The host-defined component type the editor was looked up by. */\n componentType: string;\n\n /** The component's current configuration. */\n value: TValue;\n\n /**\n * Proposes a new configuration. The editor is controlled: the host applies the proposal by passing\n * a new `value`, or ignores it to cancel. The host still owns permission checks and persistence.\n */\n onChange: (proposal: TValue) => void;\n\n /** Whether the person may change the configuration. */\n readOnly: boolean;\n\n /** Host-defined data the editor needs, such as capabilities, destinations or an icon catalog. Passed through untouched. */\n context?: TContext;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ConfigurationEditorRenderProps } from './ConfigurationEditorRenderProps.js';
3
+ /** Renders the configuration experience of one component type. */
4
+ export type ConfigurationEditorRenderer<TValue = never, TContext = never> = (props: ConfigurationEditorRenderProps<TValue, TContext>) => ReactNode;
5
+ //# sourceMappingURL=ConfigurationEditorRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditorRenderer.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationEditorRenderer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAkC,CAAC;AAEvF,kEAAkE;AAClE,MAAM,MAAM,2BAA2B,CAAC,MAAM,GAAG,KAAK,EAAE,QAAQ,GAAG,KAAK,IAAI,CACxE,KAAK,EAAE,8BAA8B,CAAC,MAAM,EAAE,QAAQ,CAAC,KACtD,SAAS,CAAC"}
@@ -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=ConfigurationEditorRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationEditorRenderer.js","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationEditorRenderer.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 { ReactNode } from 'react';\nimport type { ConfigurationEditorRenderProps } from './ConfigurationEditorRenderProps';\n\n/** Renders the configuration experience of one component type. */\nexport type ConfigurationEditorRenderer<TValue = never, TContext = never> = (\n props: ConfigurationEditorRenderProps<TValue, TContext>,\n) => ReactNode;\n"]}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A qualified, renderer-neutral reference to one icon. Labels, display names, CSS classes, markup
3
+ * and catalog order are never identity: two references are the same icon when `library`, `key` and
4
+ * `variant` all match.
5
+ *
6
+ * The shape is structural, so a host can pass the reference its icon library produces straight
7
+ * through without conversion.
8
+ */
9
+ export interface ConfigurationIconReference {
10
+ /** Stable identity of the icon library the icon belongs to. */
11
+ library: string;
12
+ /** Stable identity of the icon inside its library. */
13
+ key: string;
14
+ /** Optional style variant of the icon. */
15
+ variant?: string;
16
+ }
17
+ //# sourceMappingURL=ConfigurationIconReference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationIconReference.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/ConfigurationIconReference.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACvC,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAEhB,sDAAsD;IACtD,GAAG,EAAE,MAAM,CAAC;IAEZ,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,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=ConfigurationIconReference.js.map