@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemFieldAccess.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemFieldAccess.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,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=OrderedItemFieldAccess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemFieldAccess.js","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemFieldAccess.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 host lets a person do with one field.\n *\n * - `'editable'` — the field has an input.\n * - `'readonly'` — the value is shown as text and cannot change.\n * - `'hidden'` — the field is not shown. This is also the meaning of a field the host leaves out.\n */\nexport type OrderedItemFieldAccess = 'editable' | 'readonly' | 'hidden';\n"]}
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IconPickerAllowed } from '../IconPicker/IconPickerAllowed.js';
3
+ import type { IconPickerCatalog } from '../IconPicker/IconPickerCatalog.js';
4
+ import type { IconPickerLabels } from '../IconPicker/IconPickerLabels.js';
5
+ import type { ConfigurationIconReference } from './ConfigurationIconReference.js';
6
+ import type { OrderedItem } from './OrderedItem.js';
7
+ import type { OrderedItemEditorParts } from './OrderedItemEditorParts.js';
8
+ import type { OrderedItemIconFieldProps } from './OrderedItemIconFieldProps.js';
9
+ import type { OrderedItemLabels } from './OrderedItemLabels.js';
10
+ interface IconFieldProps<TItem extends OrderedItem> {
11
+ item: TItem;
12
+ editable: boolean;
13
+ itemName: string;
14
+ labels: Required<OrderedItemLabels>;
15
+ message: string | undefined;
16
+ messageId: string;
17
+ parts: OrderedItemEditorParts | undefined;
18
+ renderIconField?: (props: OrderedItemIconFieldProps<TItem>) => ReactNode;
19
+ isIconAvailable?: (icon: ConfigurationIconReference) => boolean;
20
+ iconCatalog?: IconPickerCatalog;
21
+ allowedIcons?: IconPickerAllowed;
22
+ iconPickerLabels?: IconPickerLabels;
23
+ onChange: (icon: ConfigurationIconReference) => void;
24
+ }
25
+ /**
26
+ * The icon field of one item. `renderIconField` overrides everything; otherwise the Components
27
+ * {@link IconPicker} is used when the host supplies an `iconCatalog`. With neither, the icon is
28
+ * shown as text, because choosing an icon needs the host's catalog.
29
+ */
30
+ export declare const OrderedItemIconField: <TItem extends OrderedItem>({ item, editable, itemName, labels, message, messageId, parts, renderIconField, isIconAvailable, iconCatalog, allowedIcons, iconPickerLabels, onChange, }: IconFieldProps<TItem>) => import("react").JSX.Element;
31
+ export {};
32
+ //# sourceMappingURL=OrderedItemIconField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemIconField.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemIconField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAe,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAqB,CAAC;AAE7D,UAAU,cAAc,CAAC,KAAK,SAAS,WAAW;IAC9C,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC1C,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;IACzE,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,0BAA0B,KAAK,OAAO,CAAC;IAChE,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,0BAA0B,KAAK,IAAI,CAAC;CACxD;AAKD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,SAAS,WAAW,6JAc3D,cAAc,CAAC,KAAK,CAAC,gCA8DvB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { IconPicker } from '../IconPicker/IconPicker.js';
3
+
4
+ const describe = (icon) => `${icon.library}/${icon.key}${icon.variant ? `:${icon.variant}` : ''}`;
5
+ const OrderedItemIconField = ({ item, editable, itemName, labels, message, messageId, parts, renderIconField, isIconAvailable, iconCatalog, allowedIcons, iconPickerLabels, onChange, }) => {
6
+ const unavailable = item.icon !== undefined && isIconAvailable?.(item.icon) === false;
7
+ const feedback = message ?? (unavailable ? labels.iconUnavailable : undefined);
8
+ const accessibleName = `${labels.iconField}: ${itemName}`;
9
+ if (renderIconField === undefined && iconCatalog !== undefined) {
10
+ const pickerMessage = message ?? (unavailable ? labels.iconUnavailable : undefined);
11
+ return (jsx("div", { ...parts?.icon, className: `cratis-ordered-item__icon ${parts?.icon?.className ?? ''}`, "data-cratis-part": 'icon', "data-control": 'icon', "data-unavailable": unavailable || undefined, children: jsx(IconPicker, { value: item.icon, onChange: onChange, catalog: iconCatalog, allowed: allowedIcons, readOnly: !editable, validationMessage: pickerMessage, labels: iconPickerLabels, "aria-label": accessibleName }) }));
12
+ }
13
+ return (jsxs("div", { ...parts?.icon, className: `cratis-ordered-item__icon ${parts?.icon?.className ?? ''}`, "data-cratis-part": 'icon', "data-control": 'icon', "data-unavailable": unavailable || undefined, children: [renderIconField ? (renderIconField({
14
+ item,
15
+ value: item.icon,
16
+ onChange,
17
+ readOnly: !editable,
18
+ 'aria-label': accessibleName,
19
+ 'aria-describedby': feedback ? messageId : undefined,
20
+ invalid: feedback !== undefined,
21
+ validationMessage: feedback,
22
+ })) : (jsxs("span", { className: 'cratis-ordered-item__text', children: [jsxs("span", { className: 'cratis-ordered-item__hidden', children: [accessibleName, ": "] }), item.icon ? describe(item.icon) : labels.noIcon] })), feedback && (jsx("p", { ...parts?.message, id: messageId, role: 'alert', className: `cratis-ordered-item__message ${parts?.message?.className ?? ''}`, "data-cratis-part": 'message', "data-invalid": true, children: feedback }))] }));
23
+ };
24
+
25
+ export { OrderedItemIconField };
26
+ //# sourceMappingURL=OrderedItemIconField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemIconField.js","sources":["../../../ConfigurationEditor/OrderedItemIconField.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 { IconPicker } from '../IconPicker/IconPicker';\nimport type { IconPickerAllowed } from '../IconPicker/IconPickerAllowed';\nimport type { IconPickerCatalog } from '../IconPicker/IconPickerCatalog';\nimport type { IconPickerLabels } from '../IconPicker/IconPickerLabels';\nimport type { ConfigurationIconReference } from './ConfigurationIconReference';\nimport type { OrderedItem } from './OrderedItem';\nimport type { OrderedItemEditorParts } from './OrderedItemEditorParts';\nimport type { OrderedItemIconFieldProps } from './OrderedItemIconFieldProps';\nimport type { OrderedItemLabels } from './OrderedItemLabels';\n\ninterface IconFieldProps<TItem extends OrderedItem> {\n item: TItem;\n editable: boolean;\n itemName: string;\n labels: Required<OrderedItemLabels>;\n message: string | undefined;\n messageId: string;\n parts: OrderedItemEditorParts | undefined;\n renderIconField?: (props: OrderedItemIconFieldProps<TItem>) => ReactNode;\n isIconAvailable?: (icon: ConfigurationIconReference) => boolean;\n iconCatalog?: IconPickerCatalog;\n allowedIcons?: IconPickerAllowed;\n iconPickerLabels?: IconPickerLabels;\n onChange: (icon: ConfigurationIconReference) => void;\n}\n\nconst describe = (icon: ConfigurationIconReference): string =>\n `${icon.library}/${icon.key}${icon.variant ? `:${icon.variant}` : ''}`;\n\n/**\n * The icon field of one item. `renderIconField` overrides everything; otherwise the Components\n * {@link IconPicker} is used when the host supplies an `iconCatalog`. With neither, the icon is\n * shown as text, because choosing an icon needs the host's catalog.\n */\nexport const OrderedItemIconField = <TItem extends OrderedItem>({\n item,\n editable,\n itemName,\n labels,\n message,\n messageId,\n parts,\n renderIconField,\n isIconAvailable,\n iconCatalog,\n allowedIcons,\n iconPickerLabels,\n onChange,\n}: IconFieldProps<TItem>) => {\n const unavailable = item.icon !== undefined && isIconAvailable?.(item.icon) === false;\n const feedback = message ?? (unavailable ? labels.iconUnavailable : undefined);\n const accessibleName = `${labels.iconField}: ${itemName}`;\n\n if (renderIconField === undefined && iconCatalog !== undefined) {\n // The picker renders its own validation message under the trigger, so none is added here.\n const pickerMessage = message ?? (unavailable ? labels.iconUnavailable : undefined);\n return (\n <div\n {...parts?.icon}\n className={`cratis-ordered-item__icon ${parts?.icon?.className ?? ''}`}\n data-cratis-part='icon'\n data-control='icon'\n data-unavailable={unavailable || undefined}\n >\n <IconPicker\n value={item.icon}\n onChange={onChange}\n catalog={iconCatalog}\n allowed={allowedIcons}\n readOnly={!editable}\n validationMessage={pickerMessage}\n labels={iconPickerLabels}\n aria-label={accessibleName}\n />\n </div>\n );\n }\n\n return (\n <div\n {...parts?.icon}\n className={`cratis-ordered-item__icon ${parts?.icon?.className ?? ''}`}\n data-cratis-part='icon'\n data-control='icon'\n data-unavailable={unavailable || undefined}\n >\n {renderIconField ? (\n renderIconField({\n item,\n value: item.icon,\n onChange,\n readOnly: !editable,\n 'aria-label': accessibleName,\n 'aria-describedby': feedback ? messageId : undefined,\n invalid: feedback !== undefined,\n validationMessage: feedback,\n })\n ) : (\n <span className='cratis-ordered-item__text'>\n <span className='cratis-ordered-item__hidden'>{accessibleName}: </span>\n {item.icon ? describe(item.icon) : labels.noIcon}\n </span>\n )}\n {feedback && (\n <p {...parts?.message} id={messageId} role='alert' className={`cratis-ordered-item__message ${parts?.message?.className ?? ''}`} data-cratis-part='message' data-invalid>\n {feedback}\n </p>\n )}\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;AA8BA,MAAM,QAAQ,GAAG,CAAC,IAAgC,KAC9C,CAAA,EAAG,IAAI,CAAC,OAAO,CAAA,CAAA,EAAI,IAAI,CAAC,GAAG,CAAA,EAAG,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,OAAO,CAAA,CAAE,GAAG,EAAE,EAAE;AAOnE,MAAM,oBAAoB,GAAG,CAA4B,EAC5D,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,EACT,KAAK,EACL,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,QAAQ,GACY,KAAI;AACxB,IAAA,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK;AACrF,IAAA,MAAM,QAAQ,GAAG,OAAO,KAAK,WAAW,GAAG,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC;IAC9E,MAAM,cAAc,GAAG,CAAA,EAAG,MAAM,CAAC,SAAS,CAAA,EAAA,EAAK,QAAQ,CAAA,CAAE;IAEzD,IAAI,eAAe,KAAK,SAAS,IAAI,WAAW,KAAK,SAAS,EAAE;AAE5D,QAAA,MAAM,aAAa,G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AA2B,aACvCA,IAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,6BAA6B,aAAE,cAAc,EAAA,IAAA,CAAA,EAAA,CAAU,EACtE,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAA,EAAA,CAC7C,CACV,EACA,QAAQ,KACLD,GAAA,CAAA,GAAA,EAAA,EAAA,GAAO,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,CAAA,6BAAA,EAAgC,KAAK,EAAE,OAAO,EAAE,SAAS,IAAI,EAAE,CAAA,CAAE,EAAA,kBAAA,EAAmB,SAAS,kCACtJ,QAAQ,EAAA,CACT,CACP,CAAA,EAAA,CACC;AAEd;;"}
@@ -0,0 +1,26 @@
1
+ import type { ConfigurationIconReference } from './ConfigurationIconReference.js';
2
+ import type { OrderedItem } from './OrderedItem.js';
3
+ /**
4
+ * What the editor hands to `renderIconField`. The host renders its icon chooser with it and
5
+ * reports the choice through {@link OrderedItemIconFieldProps.onChange}; the editor turns that into
6
+ * a validated proposal, or ignores it when the field is not editable.
7
+ */
8
+ export interface OrderedItemIconFieldProps<TItem extends OrderedItem = OrderedItem> {
9
+ /** The item being edited. */
10
+ item: TItem;
11
+ /** The item's current icon. */
12
+ value: ConfigurationIconReference | undefined;
13
+ /** Reports the icon the person picked. */
14
+ onChange: (icon: ConfigurationIconReference) => void;
15
+ /** Whether the person can change the icon. */
16
+ readOnly: boolean;
17
+ /** The accessible name of the field, including the item it belongs to. */
18
+ 'aria-label': string;
19
+ /** The id of the element that describes the field, which holds its validation message. */
20
+ 'aria-describedby'?: string;
21
+ /** Whether the field has a validation message. */
22
+ invalid: boolean;
23
+ /** The validation message, if any. */
24
+ validationMessage?: string;
25
+ }
26
+ //# sourceMappingURL=OrderedItemIconFieldProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemIconFieldProps.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemIconFieldProps.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAe,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,yBAAyB,CAAC,KAAK,SAAS,WAAW,GAAG,WAAW;IAC9E,6BAA6B;IAC7B,IAAI,EAAE,KAAK,CAAC;IAEZ,+BAA+B;IAC/B,KAAK,EAAE,0BAA0B,GAAG,SAAS,CAAC;IAE9C,0CAA0C;IAC1C,QAAQ,EAAE,CAAC,IAAI,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAErD,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAElB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IAErB,0FAA0F;IAC1F,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IAEjB,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
@@ -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=OrderedItemIconFieldProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemIconFieldProps.js","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemIconFieldProps.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 { ConfigurationIconReference } from './ConfigurationIconReference';\nimport type { OrderedItem } from './OrderedItem';\n\n/**\n * What the editor hands to `renderIconField`. The host renders its icon chooser with it and\n * reports the choice through {@link OrderedItemIconFieldProps.onChange}; the editor turns that into\n * a validated proposal, or ignores it when the field is not editable.\n */\nexport interface OrderedItemIconFieldProps<TItem extends OrderedItem = OrderedItem> {\n /** The item being edited. */\n item: TItem;\n\n /** The item's current icon. */\n value: ConfigurationIconReference | undefined;\n\n /** Reports the icon the person picked. */\n onChange: (icon: ConfigurationIconReference) => void;\n\n /** Whether the person can change the icon. */\n readOnly: boolean;\n\n /** The accessible name of the field, including the item it belongs to. */\n 'aria-label': string;\n\n /** The id of the element that describes the field, which holds its validation message. */\n 'aria-describedby'?: string;\n\n /** Whether the field has a validation message. */\n invalid: boolean;\n\n /** The validation message, if any. */\n validationMessage?: string;\n}\n"]}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Every visible and accessible string the {@link OrderedItemEditor} owns. Unset fields fall back to
3
+ * English. Functions receive the item's label so each control names the item it acts on.
4
+ */
5
+ export interface OrderedItemLabels {
6
+ /** Heading of the fixed (inherited) items section. */
7
+ fixedItems?: string;
8
+ /** Heading of the configurable items section. */
9
+ localItems?: string;
10
+ /** Text shown on every locked item. */
11
+ locked?: string;
12
+ /** Shown when the configurable collection is empty. */
13
+ empty?: string;
14
+ /** The add action. */
15
+ add?: string;
16
+ /** Why the add action is unavailable once `maxItems` is reached. */
17
+ maxItemsReached?: string;
18
+ /** Accessible name of the label input. */
19
+ labelField?: string;
20
+ /** Accessible name of the icon field. */
21
+ iconField?: string;
22
+ /** Accessible name of the destination select. */
23
+ destinationField?: string;
24
+ /** Placeholder option of the destination select. */
25
+ noDestination?: string;
26
+ /** Shown instead of an icon that has none. */
27
+ noIcon?: string;
28
+ /** Shown for an icon the host's catalog can no longer supply. */
29
+ iconUnavailable?: string;
30
+ /** Shown for a destination the host no longer lists. */
31
+ destinationUnavailable?: string;
32
+ /** Message for a blank label. */
33
+ labelRequired?: string;
34
+ /** Accessible name of the remove action for an item. */
35
+ remove?: (itemLabel: string) => string;
36
+ /** Accessible name of the move-up action for an item. */
37
+ moveUp?: (itemLabel: string) => string;
38
+ /** Accessible name of the move-down action for an item. */
39
+ moveDown?: (itemLabel: string) => string;
40
+ /** Accessible name of the drag and keyboard handle of an item. */
41
+ handle?: (itemLabel: string) => string;
42
+ /** Name used for an item whose label is blank. */
43
+ untitled?: string;
44
+ /** Live announcement after an item moved. */
45
+ moved?: (itemLabel: string, position: number, total: number) => string;
46
+ }
47
+ //# sourceMappingURL=OrderedItemLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemLabels.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemLabels.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,yDAAyD;IACzD,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC1E"}
@@ -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=OrderedItemLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemLabels.js","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemLabels.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 * Every visible and accessible string the {@link OrderedItemEditor} owns. Unset fields fall back to\n * English. Functions receive the item's label so each control names the item it acts on.\n */\nexport interface OrderedItemLabels {\n /** Heading of the fixed (inherited) items section. */\n fixedItems?: string;\n /** Heading of the configurable items section. */\n localItems?: string;\n /** Text shown on every locked item. */\n locked?: string;\n /** Shown when the configurable collection is empty. */\n empty?: string;\n /** The add action. */\n add?: string;\n /** Why the add action is unavailable once `maxItems` is reached. */\n maxItemsReached?: string;\n /** Accessible name of the label input. */\n labelField?: string;\n /** Accessible name of the icon field. */\n iconField?: string;\n /** Accessible name of the destination select. */\n destinationField?: string;\n /** Placeholder option of the destination select. */\n noDestination?: string;\n /** Shown instead of an icon that has none. */\n noIcon?: string;\n /** Shown for an icon the host's catalog can no longer supply. */\n iconUnavailable?: string;\n /** Shown for a destination the host no longer lists. */\n destinationUnavailable?: string;\n /** Message for a blank label. */\n labelRequired?: string;\n /** Accessible name of the remove action for an item. */\n remove?: (itemLabel: string) => string;\n /** Accessible name of the move-up action for an item. */\n moveUp?: (itemLabel: string) => string;\n /** Accessible name of the move-down action for an item. */\n moveDown?: (itemLabel: string) => string;\n /** Accessible name of the drag and keyboard handle of an item. */\n handle?: (itemLabel: string) => string;\n /** Name used for an item whose label is blank. */\n untitled?: string;\n /** Live announcement after an item moved. */\n moved?: (itemLabel: string, position: number, total: number) => string;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ /** The collection operations an editor can offer. */
2
+ export type OrderedItemOperation = 'add' | 'remove' | 'reorder';
3
+ //# sourceMappingURL=OrderedItemOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemOperation.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemOperation.ts"],"names":[],"mappings":"AAGA,qDAAqD;AACrD,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,GAAG,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=OrderedItemOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemOperation.js","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemOperation.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/** The collection operations an editor can offer. */\nexport type OrderedItemOperation = 'add' | 'remove' | 'reorder';\n"]}
@@ -0,0 +1,45 @@
1
+ import type { OrderedItem } from './OrderedItem.js';
2
+ import type { OrderedItemField } from './OrderedItemField.js';
3
+ /**
4
+ * A change the person asked for, validated and permitted by the capabilities. The editor is
5
+ * controlled: nothing changes until the host applies the proposal by passing new `items`. Every
6
+ * proposal carries the `items` that would result, so accepting one is a single assignment.
7
+ */
8
+ export type OrderedItemProposal<TItem extends OrderedItem = OrderedItem> = {
9
+ kind: 'add';
10
+ /** The item the host created. */
11
+ item: TItem;
12
+ /** Where the item would be inserted. */
13
+ index: number;
14
+ /** The collection after the change. */
15
+ items: ReadonlyArray<TItem>;
16
+ } | {
17
+ kind: 'remove';
18
+ /** The item that would be removed. */
19
+ item: TItem;
20
+ /** Where the item was. */
21
+ index: number;
22
+ /** The collection after the change. */
23
+ items: ReadonlyArray<TItem>;
24
+ } | {
25
+ kind: 'move';
26
+ /** The item that would move. */
27
+ item: TItem;
28
+ /** Where the item was. */
29
+ fromIndex: number;
30
+ /** Where the item would be. */
31
+ toIndex: number;
32
+ /** The collection after the change. */
33
+ items: ReadonlyArray<TItem>;
34
+ } | {
35
+ kind: 'update';
36
+ /** The item as it would be after the change. */
37
+ item: TItem;
38
+ /** The item as it is now. */
39
+ previous: TItem;
40
+ /** The field that changed. */
41
+ field: OrderedItemField;
42
+ /** The collection after the change. */
43
+ items: ReadonlyArray<TItem>;
44
+ };
45
+ //# sourceMappingURL=OrderedItemProposal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemProposal.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemProposal.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAe,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,KAAK,SAAS,WAAW,GAAG,WAAW,IACjE;IACI,IAAI,EAAE,KAAK,CAAC;IACZ,iCAAiC;IACjC,IAAI,EAAE,KAAK,CAAC;IACZ,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;CAC/B,GACD;IACI,IAAI,EAAE,QAAQ,CAAC;IACf,sCAAsC;IACtC,IAAI,EAAE,KAAK,CAAC;IACZ,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;CAC/B,GACD;IACI,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;CAC/B,GACD;IACI,IAAI,EAAE,QAAQ,CAAC;IACf,gDAAgD;IAChD,IAAI,EAAE,KAAK,CAAC;IACZ,6BAA6B;IAC7B,QAAQ,EAAE,KAAK,CAAC;IAChB,8BAA8B;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,uCAAuC;IACvC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;CAC/B,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=OrderedItemProposal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemProposal.js","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemProposal.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 { OrderedItem } from './OrderedItem';\nimport type { OrderedItemField } from './OrderedItemField';\n\n/**\n * A change the person asked for, validated and permitted by the capabilities. The editor is\n * controlled: nothing changes until the host applies the proposal by passing new `items`. Every\n * proposal carries the `items` that would result, so accepting one is a single assignment.\n */\nexport type OrderedItemProposal<TItem extends OrderedItem = OrderedItem> =\n | {\n kind: 'add';\n /** The item the host created. */\n item: TItem;\n /** Where the item would be inserted. */\n index: number;\n /** The collection after the change. */\n items: ReadonlyArray<TItem>;\n }\n | {\n kind: 'remove';\n /** The item that would be removed. */\n item: TItem;\n /** Where the item was. */\n index: number;\n /** The collection after the change. */\n items: ReadonlyArray<TItem>;\n }\n | {\n kind: 'move';\n /** The item that would move. */\n item: TItem;\n /** Where the item was. */\n fromIndex: number;\n /** Where the item would be. */\n toIndex: number;\n /** The collection after the change. */\n items: ReadonlyArray<TItem>;\n }\n | {\n kind: 'update';\n /** The item as it would be after the change. */\n item: TItem;\n /** The item as it is now. */\n previous: TItem;\n /** The field that changed. */\n field: OrderedItemField;\n /** The collection after the change. */\n items: ReadonlyArray<TItem>;\n };\n"]}
@@ -0,0 +1,5 @@
1
+ import type { OrderedItem } from './OrderedItem.js';
2
+ import type { OrderedItemRowProps } from './OrderedItemRowProps.js';
3
+ /** One item of an {@link OrderedItemEditor}, either editable or locked. */
4
+ export declare const OrderedItemRow: <TItem extends OrderedItem>({ item, index, count, locked, capabilities, labels, destinations, validation, baseId, parts, renderIconField, isIconAvailable, iconCatalog, allowedIcons, iconPickerLabels, dragging, dropPosition, onField, onFieldBlur, onMove, onRemove, onDragStart, onDragOver, onDrop, onDragEnd, }: OrderedItemRowProps<TItem>) => import("react").JSX.Element;
5
+ //# sourceMappingURL=OrderedItemRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemRow.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemRow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAAuB,CAAC;AAMjE,2EAA2E;AAC3E,eAAO,MAAM,cAAc,GAAI,KAAK,SAAS,WAAW,6RA0BrD,mBAAmB,CAAC,KAAK,CAAC,gCA8L5B,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
3
+ import { resolveOrderedItemFieldAccess } from './resolveOrderedItemFieldAccess.js';
4
+ import { OrderedItemIconField } from './OrderedItemIconField.js';
5
+ import { OrderedItemDestinationField } from './OrderedItemDestinationField.js';
6
+
7
+ const joinClassNames = (...names) => names.filter(Boolean).join(' ');
8
+ const OrderedItemRow = ({ item, index, count, locked, capabilities, labels, destinations, validation, baseId, parts, renderIconField, isIconAvailable, iconCatalog, allowedIcons, iconPickerLabels, dragging, dropPosition, onField, onFieldBlur, onMove, onRemove, onDragStart, onDragOver, onDrop, onDragEnd, }) => {
9
+ const [labelDraft, setLabelDraft] = useState(null);
10
+ const rowId = `${baseId}-${item.id.replace(/[^A-Za-z0-9_-]/gu, '_')}`;
11
+ const itemName = item.label.trim().length > 0 ? item.label : labels.untitled;
12
+ const labelAccess = resolveOrderedItemFieldAccess(capabilities, 'label');
13
+ const iconAccess = resolveOrderedItemFieldAccess(capabilities, 'icon');
14
+ const destinationAccess = resolveOrderedItemFieldAccess(capabilities, 'destination');
15
+ const canReorder = !locked && capabilities.reorder;
16
+ const canRemove = !locked && capabilities.remove;
17
+ const labelMessage = validation?.label;
18
+ const itemMessage = validation?.item;
19
+ const labelMessageId = `${rowId}-label-message`;
20
+ const itemMessageId = `${rowId}-item-message`;
21
+ const labelDescribedBy = [labelMessage ? labelMessageId : undefined, itemMessage ? itemMessageId : undefined]
22
+ .filter(Boolean)
23
+ .join(' ');
24
+ useEffect(() => {
25
+ setLabelDraft(null);
26
+ }, [item.label]);
27
+ const handleKeyDown = (event) => {
28
+ parts?.handle?.onKeyDown?.(event);
29
+ if (event.defaultPrevented)
30
+ return;
31
+ if (event.key === 'ArrowUp') {
32
+ event.preventDefault();
33
+ onMove(item, -1, 'handle');
34
+ }
35
+ else if (event.key === 'ArrowDown') {
36
+ event.preventDefault();
37
+ onMove(item, 1, 'handle');
38
+ }
39
+ };
40
+ return (jsxs("li", { ...parts?.item, id: rowId, tabIndex: -1, className: joinClassNames('cratis-ordered-item', parts?.item?.className), onDragOver: canReorder ? (event) => onDragOver(item, event) : undefined, onDrop: canReorder ? (event) => onDrop(item, event) : undefined, "data-cratis-part": 'item', "data-item-id": item.id, "data-locked": locked || undefined, "data-dragging": dragging || undefined, "data-drop-position": dropPosition, children: [canReorder && (jsxs("div", { className: 'cratis-ordered-item__reorder', children: [jsx("button", { ...parts?.handle, type: 'button', draggable: true, "aria-label": labels.handle(itemName), "aria-keyshortcuts": 'ArrowUp ArrowDown', onKeyDown: handleKeyDown, onDragStart: (event) => onDragStart(item, event), onDragEnd: onDragEnd, className: joinClassNames('cratis-ordered-item__button cratis-ordered-item__handle', parts?.handle?.className), "data-cratis-part": 'handle', "data-control": 'handle', children: jsx("span", { "aria-hidden": 'true', children: "\u283F" }) }), jsx("button", { ...parts?.moveUp, type: 'button', "aria-label": labels.moveUp(itemName), "aria-disabled": index === 0 || undefined, onClick: () => onMove(item, -1, 'moveUp'), className: joinClassNames('cratis-ordered-item__button', parts?.moveUp?.className), "data-cratis-part": 'moveUp', "data-control": 'moveUp', children: jsx("span", { "aria-hidden": 'true', children: "\u2191" }) }), jsx("button", { ...parts?.moveDown, type: 'button', "aria-label": labels.moveDown(itemName), "aria-disabled": index === count - 1 || undefined, onClick: () => onMove(item, 1, 'moveDown'), className: joinClassNames('cratis-ordered-item__button', parts?.moveDown?.className), "data-cratis-part": 'moveDown', "data-control": 'moveDown', children: jsx("span", { "aria-hidden": 'true', children: "\u2193" }) })] })), jsxs("div", { className: 'cratis-ordered-item__fields', children: [labelAccess === 'editable' && !locked && (jsx("input", { ...parts?.label, type: 'text', value: labelDraft ?? item.label, "aria-label": labels.labelField, "aria-invalid": labelMessage ? true : undefined, "aria-describedby": labelDescribedBy.length > 0 ? labelDescribedBy : undefined, onChange: (event) => {
41
+ setLabelDraft(event.target.value);
42
+ onField(item, 'label', event.target.value);
43
+ }, onBlur: (event) => {
44
+ parts?.label?.onBlur?.(event);
45
+ setLabelDraft(null);
46
+ onFieldBlur(item, 'label');
47
+ }, onKeyDown: (event) => {
48
+ parts?.label?.onKeyDown?.(event);
49
+ if (event.key === 'Escape' && labelDraft !== null) {
50
+ event.preventDefault();
51
+ event.stopPropagation();
52
+ setLabelDraft(null);
53
+ onFieldBlur(item, 'label');
54
+ }
55
+ }, className: joinClassNames('cratis-ordered-item__input', parts?.label?.className), "data-cratis-part": 'label', "data-control": 'label', "data-invalid": labelMessage ? true : undefined })), (labelAccess === 'readonly' || (labelAccess === 'editable' && locked)) && (jsxs("span", { className: 'cratis-ordered-item__text', "data-control": 'label', children: [jsxs("span", { className: 'cratis-ordered-item__hidden', children: [labels.labelField, ": "] }), item.label] })), labelMessage && (jsx("p", { ...parts?.message, id: labelMessageId, role: 'alert', className: joinClassNames('cratis-ordered-item__message', parts?.message?.className), "data-cratis-part": 'message', "data-invalid": true, children: labelMessage })), iconAccess !== 'hidden' && (jsx(OrderedItemIconField, { item: item, editable: iconAccess === 'editable' && !locked, itemName: itemName, labels: labels, message: validation?.icon, messageId: `${rowId}-icon-message`, parts: parts, renderIconField: renderIconField, isIconAvailable: isIconAvailable, iconCatalog: iconCatalog, allowedIcons: allowedIcons, iconPickerLabels: iconPickerLabels, onChange: (icon) => onField(item, 'icon', icon) })), destinationAccess !== 'hidden' && (jsx(OrderedItemDestinationField, { item: item, editable: destinationAccess === 'editable' && !locked, itemName: itemName, labels: labels, destinations: destinations, message: validation?.destination, messageId: `${rowId}-destination-message`, parts: parts, onChange: (destination) => onField(item, 'destination', destination) })), itemMessage && (jsx("p", { ...parts?.message, id: itemMessageId, role: 'alert', className: joinClassNames('cratis-ordered-item__message', parts?.message?.className), "data-cratis-part": 'message', "data-invalid": true, children: itemMessage }))] }), locked && (jsx("span", { ...parts?.state, className: joinClassNames('cratis-ordered-item__state', parts?.state?.className), "data-cratis-part": 'state', children: labels.locked })), canRemove && (jsx("button", { ...parts?.remove, type: 'button', "aria-label": labels.remove(itemName), onClick: () => onRemove(item), className: joinClassNames('cratis-ordered-item__button cratis-ordered-item__remove', parts?.remove?.className), "data-cratis-part": 'remove', "data-control": 'remove', children: jsx("span", { "aria-hidden": 'true', children: "\u00D7" }) }))] }));
56
+ };
57
+
58
+ export { OrderedItemRow };
59
+ //# sourceMappingURL=OrderedItemRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemRow.js","sources":["../../../ConfigurationEditor/OrderedItemRow.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useEffect, useState, type KeyboardEvent } from 'react';\nimport type { OrderedItem } from './OrderedItem';\nimport { resolveOrderedItemFieldAccess } from './resolveOrderedItemFieldAccess';\nimport type { OrderedItemRowProps } from './OrderedItemRowProps';\nimport { OrderedItemIconField } from './OrderedItemIconField';\nimport { OrderedItemDestinationField } from './OrderedItemDestinationField';\n\nconst joinClassNames = (...names: Array<string | undefined>) => names.filter(Boolean).join(' ');\n\n/** One item of an {@link OrderedItemEditor}, either editable or locked. */\nexport const OrderedItemRow = <TItem extends OrderedItem>({\n item,\n index,\n count,\n locked,\n capabilities,\n labels,\n destinations,\n validation,\n baseId,\n parts,\n renderIconField,\n isIconAvailable,\n iconCatalog,\n allowedIcons,\n iconPickerLabels,\n dragging,\n dropPosition,\n onField,\n onFieldBlur,\n onMove,\n onRemove,\n onDragStart,\n onDragOver,\n onDrop,\n onDragEnd,\n}: OrderedItemRowProps<TItem>) => {\n const [labelDraft, setLabelDraft] = useState<string | null>(null);\n const rowId = `${baseId}-${item.id.replace(/[^A-Za-z0-9_-]/gu, '_')}`;\n const itemName = item.label.trim().length > 0 ? item.label : labels.untitled;\n const labelAccess = resolveOrderedItemFieldAccess(capabilities, 'label');\n const iconAccess = resolveOrderedItemFieldAccess(capabilities, 'icon');\n const destinationAccess = resolveOrderedItemFieldAccess(capabilities, 'destination');\n const canReorder = !locked && capabilities.reorder;\n const canRemove = !locked && capabilities.remove;\n const labelMessage = validation?.label;\n const itemMessage = validation?.item;\n const labelMessageId = `${rowId}-label-message`;\n const itemMessageId = `${rowId}-item-message`;\n const labelDescribedBy = [labelMessage ? labelMessageId : undefined, itemMessage ? itemMessageId : undefined]\n .filter(Boolean)\n .join(' ');\n\n useEffect(() => {\n setLabelDraft(null);\n }, [item.label]);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n parts?.handle?.onKeyDown?.(event);\n if (event.defaultPrevented) return;\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n onMove(item, -1, 'handle');\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n onMove(item, 1, 'handle');\n }\n };\n\n return (\n <li\n {...parts?.item}\n id={rowId}\n tabIndex={-1}\n className={joinClassNames('cratis-ordered-item', parts?.item?.className)}\n onDragOver={canReorder ? (event) => onDragOver(item, event) : undefined}\n onDrop={canReorder ? (event) => onDrop(item, event) : undefined}\n data-cratis-part='item'\n data-item-id={item.id}\n data-locked={locked || undefined}\n data-dragging={dragging || undefined}\n data-drop-position={dropPosition}\n >\n {canReorder && (\n <div className='cratis-ordered-item__reorder'>\n <button\n {...parts?.handle}\n type='button'\n draggable\n aria-label={labels.handle(itemName)}\n aria-keyshortcuts='ArrowUp ArrowDown'\n onKeyDown={handleKeyDown}\n onDragStart={(event) => onDragStart(item, event)}\n onDragEnd={onDragEnd}\n className={joinClassNames('cratis-ordered-item__button cratis-ordered-item__handle', parts?.handle?.className)}\n data-cratis-part='handle'\n data-control='handle'\n >\n <span aria-hidden='true'>⠿</span>\n </button>\n <button\n {...parts?.moveUp}\n type='button'\n aria-label={labels.moveUp(itemName)}\n aria-disabled={index === 0 || undefined}\n onClick={() => onMove(item, -1, 'moveUp')}\n className={joinClassNames('cratis-ordered-item__button', parts?.moveUp?.className)}\n data-cratis-part='moveUp'\n data-control='moveUp'\n >\n <span aria-hidden='true'>↑</span>\n </button>\n <button\n {...parts?.moveDown}\n type='button'\n aria-label={labels.moveDown(itemName)}\n aria-disabled={index === count - 1 || undefined}\n onClick={() => onMove(item, 1, 'moveDown')}\n className={joinClassNames('cratis-ordered-item__button', parts?.moveDown?.className)}\n data-cratis-part='moveDown'\n data-control='moveDown'\n >\n <span aria-hidden='true'>↓</span>\n </button>\n </div>\n )}\n <div className='cratis-ordered-item__fields'>\n {labelAccess === 'editable' && !locked && (\n <input\n {...parts?.label}\n type='text'\n value={labelDraft ?? item.label}\n aria-label={labels.labelField}\n aria-invalid={labelMessage ? true : undefined}\n aria-describedby={labelDescribedBy.length > 0 ? labelDescribedBy : undefined}\n onChange={(event) => {\n setLabelDraft(event.target.value);\n onField(item, 'label', event.target.value);\n }}\n onBlur={(event) => {\n parts?.label?.onBlur?.(event);\n setLabelDraft(null);\n onFieldBlur(item, 'label');\n }}\n onKeyDown={(event) => {\n parts?.label?.onKeyDown?.(event);\n if (event.key === 'Escape' && labelDraft !== null) {\n event.preventDefault();\n event.stopPropagation();\n setLabelDraft(null);\n onFieldBlur(item, 'label');\n }\n }}\n className={joinClassNames('cratis-ordered-item__input', parts?.label?.className)}\n data-cratis-part='label'\n data-control='label'\n data-invalid={labelMessage ? true : undefined}\n />\n )}\n {(labelAccess === 'readonly' || (labelAccess === 'editable' && locked)) && (\n <span className='cratis-ordered-item__text' data-control='label'>\n <span className='cratis-ordered-item__hidden'>{labels.labelField}: </span>\n {item.label}\n </span>\n )}\n {labelMessage && (\n <p {...parts?.message} id={labelMessageId} role='alert' className={joinClassNames('cratis-ordered-item__message', parts?.message?.className)} data-cratis-part='message' data-invalid>\n {labelMessage}\n </p>\n )}\n {iconAccess !== 'hidden' && (\n <OrderedItemIconField\n item={item}\n editable={iconAccess === 'editable' && !locked}\n itemName={itemName}\n labels={labels}\n message={validation?.icon}\n messageId={`${rowId}-icon-message`}\n parts={parts}\n renderIconField={renderIconField}\n isIconAvailable={isIconAvailable}\n iconCatalog={iconCatalog}\n allowedIcons={allowedIcons}\n iconPickerLabels={iconPickerLabels}\n onChange={(icon) => onField(item, 'icon', icon)}\n />\n )}\n {destinationAccess !== 'hidden' && (\n <OrderedItemDestinationField\n item={item}\n editable={destinationAccess === 'editable' && !locked}\n itemName={itemName}\n labels={labels}\n destinations={destinations}\n message={validation?.destination}\n messageId={`${rowId}-destination-message`}\n parts={parts}\n onChange={(destination) => onField(item, 'destination', destination)}\n />\n )}\n {itemMessage && (\n <p {...parts?.message} id={itemMessageId} role='alert' className={joinClassNames('cratis-ordered-item__message', parts?.message?.className)} data-cratis-part='message' data-invalid>\n {itemMessage}\n </p>\n )}\n </div>\n {locked && (\n <span {...parts?.state} className={joinClassNames('cratis-ordered-item__state', parts?.state?.className)} data-cratis-part='state'>\n {labels.locked}\n </span>\n )}\n {canRemove && (\n <button\n {...parts?.remove}\n type='button'\n aria-label={labels.remove(itemName)}\n onClick={() => onRemove(item)}\n className={joinClassNames('cratis-ordered-item__button cratis-ordered-item__remove', parts?.remove?.className)}\n data-cratis-part='remove'\n data-control='remove'\n >\n <span aria-hidden='true'>×</span>\n </button>\n )}\n </li>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;AAUA,MAAM,cAAc,GAAG,CAAC,GAAG,KAAgC,KAAK,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAGxF,MAAM,cAAc,GAAG,CAA4B,EACtD,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACV,MAAM,EACN,KAAK,EACL,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,WAAW,EACX,MAAM,EACN,QAAQ,EACR,WAAW,EACX,UAAU,EACV,MAAM,EACN,SAAS,GACgB,KAAI;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC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 -0,0 +1,43 @@
1
+ import type { DragEvent, ReactNode } from 'react';
2
+ import type { IconPickerAllowed } from '../IconPicker/IconPickerAllowed.js';
3
+ import type { IconPickerCatalog } from '../IconPicker/IconPickerCatalog.js';
4
+ import type { IconPickerLabels } from '../IconPicker/IconPickerLabels.js';
5
+ import type { ConfigurationDestination } from './ConfigurationDestination.js';
6
+ import type { ConfigurationIconReference } from './ConfigurationIconReference.js';
7
+ import type { OrderedItem } from './OrderedItem.js';
8
+ import type { OrderedItemCapabilities } from './OrderedItemCapabilities.js';
9
+ import type { OrderedItemEditorParts } from './OrderedItemEditorParts.js';
10
+ import type { OrderedItemField } from './OrderedItemField.js';
11
+ import type { OrderedItemIconFieldProps } from './OrderedItemIconFieldProps.js';
12
+ import type { OrderedItemLabels } from './OrderedItemLabels.js';
13
+ import type { OrderedItemValidation } from './OrderedItemValidation.js';
14
+ /** Props of the internal row that renders one item of an {@link OrderedItemEditor}. */
15
+ export interface OrderedItemRowProps<TItem extends OrderedItem> {
16
+ item: TItem;
17
+ index: number;
18
+ count: number;
19
+ /** A locked item shows its values as text and offers no control. */
20
+ locked: boolean;
21
+ capabilities: OrderedItemCapabilities;
22
+ labels: Required<OrderedItemLabels>;
23
+ destinations: ReadonlyArray<ConfigurationDestination>;
24
+ validation: OrderedItemValidation | undefined;
25
+ baseId: string;
26
+ parts: OrderedItemEditorParts | undefined;
27
+ renderIconField?: (props: OrderedItemIconFieldProps<TItem>) => ReactNode;
28
+ isIconAvailable?: (icon: ConfigurationIconReference) => boolean;
29
+ iconCatalog?: IconPickerCatalog;
30
+ allowedIcons?: IconPickerAllowed;
31
+ iconPickerLabels?: IconPickerLabels;
32
+ dragging: boolean;
33
+ dropPosition: 'before' | 'after' | undefined;
34
+ onField: (item: TItem, field: OrderedItemField, value: string | ConfigurationIconReference | undefined) => void;
35
+ onFieldBlur: (item: TItem, field: OrderedItemField) => void;
36
+ onMove: (item: TItem, delta: -1 | 1, control: 'handle' | 'moveUp' | 'moveDown') => void;
37
+ onRemove: (item: TItem) => void;
38
+ onDragStart: (item: TItem, event: DragEvent<HTMLButtonElement>) => void;
39
+ onDragOver: (item: TItem, event: DragEvent<HTMLLIElement>) => void;
40
+ onDrop: (item: TItem, event: DragEvent<HTMLLIElement>) => void;
41
+ onDragEnd: () => void;
42
+ }
43
+ //# sourceMappingURL=OrderedItemRowProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemRowProps.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemRowProps.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAe,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAAyB,CAAC;AAErE,uFAAuF;AACvF,MAAM,WAAW,mBAAmB,CAAC,KAAK,SAAS,WAAW;IAC1D,IAAI,EAAE,KAAK,CAAC;IACZ,KA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AC,KAAK,IAAI,CAAC;IACxE,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IACnE,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC/D,SAAS,EAAE,MAAM,IAAI,CAAC;CACzB"}
@@ -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=OrderedItemRowProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemRowProps.js","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemRowProps.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 { DragEvent, ReactNode } from 'react';\nimport type { IconPickerAllowed } from '../IconPicker/IconPickerAllowed';\nimport type { IconPickerCatalog } from '../IconPicker/IconPickerCatalog';\nimport type { IconPickerLabels } from '../IconPicker/IconPickerLabels';\nimport type { ConfigurationDestination } from './ConfigurationDestination';\nimport type { ConfigurationIconReference } from './ConfigurationIconReference';\nimport type { OrderedItem } from './OrderedItem';\nimport type { OrderedItemCapabilities } from './OrderedItemCapabilities';\nimport type { OrderedItemEditorParts } from './OrderedItemEditorParts';\nimport type { OrderedItemField } from './OrderedItemField';\nimport type { OrderedItemIconFieldProps } from './OrderedItemIconFieldProps';\nimport type { OrderedItemLabels } from './OrderedItemLabels';\nimport type { OrderedItemValidation } from './OrderedItemValidation';\n\n/** Props of the internal row that renders one item of an {@link OrderedItemEditor}. */\nexport interface OrderedItemRowProps<TItem extends OrderedItem> {\n item: TItem;\n index: number;\n count: number;\n /** A locked item shows its values as text and offers no control. */\n locked: boolean;\n capabilities: OrderedItemCapabilities;\n labels: Required<OrderedItemLabels>;\n destinations: ReadonlyArray<ConfigurationDestination>;\n validation: OrderedItemValidation | undefined;\n baseId: string;\n parts: OrderedItemEditorParts | undefined;\n renderIconField?: (props: OrderedItemIconFieldProps<TItem>) => ReactNode;\n isIconAvailable?: (icon: ConfigurationIconReference) => boolean;\n iconCatalog?: IconPickerCatalog;\n allowedIcons?: IconPickerAllowed;\n iconPickerLabels?: IconPickerLabels;\n dragging: boolean;\n dropPosition: 'before' | 'after' | undefined;\n onField: (item: TItem, field: OrderedItemField, value: string | ConfigurationIconReference | undefined) => void;\n onFieldBlur: (item: TItem, field: OrderedItemField) => void;\n onMove: (item: TItem, delta: -1 | 1, control: 'handle' | 'moveUp' | 'moveDown') => void;\n onRemove: (item: TItem) => void;\n onDragStart: (item: TItem, event: DragEvent<HTMLButtonElement>) => void;\n onDragOver: (item: TItem, event: DragEvent<HTMLLIElement>) => void;\n onDrop: (item: TItem, event: DragEvent<HTMLLIElement>) => void;\n onDragEnd: () => void;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { OrderedItemField } from './OrderedItemField.js';
2
+ /**
3
+ * Validation messages for one item, by field. The `item` key holds a message about the item as a
4
+ * whole. A field without a message is valid.
5
+ */
6
+ export type OrderedItemValidation = Partial<Record<OrderedItemField | 'item', string>>;
7
+ //# sourceMappingURL=OrderedItemValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemValidation.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemValidation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,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=OrderedItemValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderedItemValidation.js","sourceRoot":"","sources":["../../../ConfigurationEditor/OrderedItemValidation.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 { OrderedItemField } from './OrderedItemField';\n\n/**\n * Validation messages for one item, by field. The `item` key holds a message about the item as a\n * whole. A field without a message is valid.\n */\nexport type OrderedItemValidation = Partial<Record<OrderedItemField | 'item', string>>;\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A change to one property, validated and permitted. The controls are controlled: nothing changes
3
+ * until the host applies the proposal by passing new `values`.
4
+ */
5
+ export interface PropertyChangeProposal {
6
+ /** The property that changed. */
7
+ name: string;
8
+ /** The new value. `undefined` clears the property. */
9
+ value: unknown;
10
+ /** The value now. */
11
+ previous: unknown;
12
+ /** The values object after the change. */
13
+ values: Readonly<Record<string, unknown>>;
14
+ }
15
+ //# sourceMappingURL=PropertyChangeProposal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyChangeProposal.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/PropertyChangeProposal.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IAEb,sDAAsD;IACtD,KAAK,EAAE,OAAO,CAAC;IAEf,qBAAqB;IACrB,QAAQ,EAAE,OAAO,CAAC;IAElB,0CAA0C;IAC1C,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC7C"}
@@ -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=PropertyChangeProposal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyChangeProposal.js","sourceRoot":"","sources":["../../../ConfigurationEditor/PropertyChangeProposal.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 change to one property, validated and permitted. The controls are controlled: nothing changes\n * until the host applies the proposal by passing new `values`.\n */\nexport interface PropertyChangeProposal {\n /** The property that changed. */\n name: string;\n\n /** The new value. `undefined` clears the property. */\n value: unknown;\n\n /** The value now. */\n previous: unknown;\n\n /** The values object after the change. */\n values: Readonly<Record<string, unknown>>;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /** One option of a choice property. */
2
+ export interface PropertyChoice {
3
+ /** Stable value stored for the choice. Never the label. */
4
+ value: string;
5
+ /** Localizable name shown to the person choosing. */
6
+ label: string;
7
+ }
8
+ //# sourceMappingURL=PropertyChoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyChoice.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/PropertyChoice.ts"],"names":[],"mappings":"AAGA,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC3B,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IAEd,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CACjB"}
@@ -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=PropertyChoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyChoice.js","sourceRoot":"","sources":["../../../ConfigurationEditor/PropertyChoice.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/** One option of a choice property. */\nexport interface PropertyChoice {\n /** Stable value stored for the choice. Never the label. */\n value: string;\n\n /** Localizable name shown to the person choosing. */\n label: string;\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import type { PropertyControlsLabels } from './PropertyControlsLabels.js';
2
+ import type { PropertyControlsParts } from './PropertyControlsParts.js';
3
+ import type { PropertyDescriptor } from './PropertyDescriptor.js';
4
+ /** Props of the internal control that renders one property. */
5
+ export interface PropertyControlProps {
6
+ descriptor: PropertyDescriptor;
7
+ value: unknown;
8
+ readOnly: boolean;
9
+ message: string | undefined;
10
+ labels: Required<PropertyControlsLabels>;
11
+ parts: PropertyControlsParts | undefined;
12
+ /** Reports a value the person entered. Returns a message when the entry is not acceptable. */
13
+ onChange: (name: string, value: unknown) => string | undefined;
14
+ }
15
+ /** One labeled property control: text, number, on/off or choice, or its value as text when it cannot change. */
16
+ export declare const PropertyControl: ({ descriptor, value, readOnly, message, labels, parts, onChange }: PropertyControlProps) => import("react").JSX.Element;
17
+ //# sourceMappingURL=PropertyControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertyControl.d.ts","sourceRoot":"","sources":["../../../ConfigurationEditor/PropertyControl.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AAE/D,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACzC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACzC,8FAA8F;IAC9F,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;CAClE;AAyBD,gHAAgH;AAChH,eAAO,MAAM,eAAe,sEAAuE,oBAAoB,gCA6JtH,CAAC"}