@commercelayer/app-elements 5.5.4 → 5.7.0

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 (216) hide show
  1. package/dist/CodeEditorComponent--5lVbv6t.js +720 -0
  2. package/dist/InputDateComponent-NpCZmpgY.js +4887 -0
  3. package/dist/RuleEngineComponent-BbIy4caP.js +1404 -0
  4. package/dist/dictionaries/customers.d.ts +1 -1
  5. package/dist/dictionaries/orders.d.ts +7 -7
  6. package/dist/dictionaries/promotions.d.ts +2 -2
  7. package/dist/dictionaries/returns.d.ts +4 -4
  8. package/dist/dictionaries/shipments.d.ts +4 -4
  9. package/dist/dictionaries/stockTransfers.d.ts +4 -4
  10. package/dist/dictionaries/types.d.ts +2 -2
  11. package/dist/fetchCoreResourcesSuggestions-DLZhtrDX.js +124 -0
  12. package/dist/helpers/appsNavigation.d.ts +2 -2
  13. package/dist/helpers/attachments.d.ts +1 -1
  14. package/dist/helpers/date.d.ts +13 -13
  15. package/dist/helpers/downloadJsonAsFile.d.ts +1 -1
  16. package/dist/helpers/resources.d.ts +4 -4
  17. package/dist/helpers/tracking.d.ts +4 -4
  18. package/dist/hooks/useClickAway.d.ts +1 -1
  19. package/dist/hooks/useEditMetadataOverlay.d.ts +3 -3
  20. package/dist/hooks/useEditTagsOverlay.d.ts +2 -2
  21. package/dist/hooks/useIsChanged.d.ts +1 -1
  22. package/dist/{main-DR-JViDx.js → main-BqlK85T7.js} +26963 -28780
  23. package/dist/main.d.ts +60 -60
  24. package/dist/main.js +1 -1
  25. package/dist/{parseISO-BGAQxnde.js → parseISO-B-bk2SyC.js} +17 -17
  26. package/dist/providers/CoreSdkProvider/CoreSdkProvider.d.ts +1 -1
  27. package/dist/providers/CoreSdkProvider/makeSdkClient.d.ts +1 -1
  28. package/dist/providers/CoreSdkProvider/useCoreApi.d.ts +1 -1
  29. package/dist/providers/GTMProvider.d.ts +1 -1
  30. package/dist/providers/TokenProvider/MockTokenProvider.d.ts +1 -1
  31. package/dist/providers/TokenProvider/TokenProvider.d.ts +1 -1
  32. package/dist/providers/TokenProvider/getAccessTokenFromUrl.d.ts +1 -1
  33. package/dist/providers/TokenProvider/index.d.ts +1 -1
  34. package/dist/providers/TokenProvider/reducer.d.ts +2 -2
  35. package/dist/providers/TokenProvider/storage.d.ts +4 -4
  36. package/dist/providers/TokenProvider/types.d.ts +10 -10
  37. package/dist/providers/TokenProvider/url.d.ts +1 -1
  38. package/dist/providers/TokenProvider/validateToken.d.ts +2 -2
  39. package/dist/providers/createApp.d.ts +1 -1
  40. package/dist/style.css +1 -1
  41. package/dist/tailwind.config.js +141 -142
  42. package/dist/ui/atoms/A.d.ts +1 -1
  43. package/dist/ui/atoms/Alert.d.ts +1 -1
  44. package/dist/ui/atoms/Avatar.d.ts +3 -3
  45. package/dist/ui/atoms/Avatar.utils.d.ts +18 -18
  46. package/dist/ui/atoms/AvatarLetter/colors.d.ts +1 -1
  47. package/dist/ui/atoms/Badge/Badge.d.ts +3 -3
  48. package/dist/ui/atoms/Badge/badgeVariants.d.ts +1 -1
  49. package/dist/ui/atoms/ButtonFilter.d.ts +1 -1
  50. package/dist/ui/atoms/Card.d.ts +15 -11
  51. package/dist/ui/atoms/CodeBlock.d.ts +1 -1
  52. package/dist/ui/atoms/EmptyState.d.ts +1 -1
  53. package/dist/ui/atoms/Grid.d.ts +6 -6
  54. package/dist/ui/atoms/Hint.d.ts +1 -1
  55. package/dist/ui/atoms/Hr.d.ts +2 -2
  56. package/dist/ui/atoms/Icon/Icon.d.ts +2 -2
  57. package/dist/ui/atoms/Icon/icons.d.ts +1 -1
  58. package/dist/ui/atoms/PageHeading/PageHeading.d.ts +3 -3
  59. package/dist/ui/atoms/PageHeading/PageHeadingToolbar.d.ts +2 -2
  60. package/dist/ui/atoms/Progress.d.ts +1 -1
  61. package/dist/ui/atoms/RadialProgress.d.ts +2 -2
  62. package/dist/ui/atoms/Section.d.ts +2 -2
  63. package/dist/ui/atoms/Skeleton.d.ts +1 -1
  64. package/dist/ui/atoms/Spacer.d.ts +3 -3
  65. package/dist/ui/atoms/StatusDot.d.ts +1 -1
  66. package/dist/ui/atoms/StatusIcon.d.ts +2 -2
  67. package/dist/ui/atoms/Table/Table.d.ts +1 -1
  68. package/dist/ui/atoms/Tag.d.ts +3 -3
  69. package/dist/ui/atoms/Text.d.ts +6 -6
  70. package/dist/ui/atoms/Tooltip.d.ts +2 -2
  71. package/dist/ui/composite/ActionButtons/ActionButtons.d.ts +2 -2
  72. package/dist/ui/composite/Address.d.ts +1 -1
  73. package/dist/ui/composite/Dropdown/Dropdown.d.ts +1 -1
  74. package/dist/ui/composite/Dropdown/DropdownItem.d.ts +11 -7
  75. package/dist/ui/composite/Dropdown/DropdownMenu.d.ts +3 -3
  76. package/dist/ui/composite/HomePageLayout.d.ts +3 -3
  77. package/dist/ui/composite/List.d.ts +2 -2
  78. package/dist/ui/composite/ListDetails.d.ts +2 -2
  79. package/dist/ui/composite/ListDetailsItem.d.ts +3 -3
  80. package/dist/ui/composite/ListItem.d.ts +7 -7
  81. package/dist/ui/composite/PageError.d.ts +2 -2
  82. package/dist/ui/composite/PageLayout.d.ts +6 -6
  83. package/dist/ui/composite/Routes/Routes.d.ts +3 -3
  84. package/dist/ui/composite/Routes/index.d.ts +2 -2
  85. package/dist/ui/composite/Routes/utils.d.ts +5 -5
  86. package/dist/ui/composite/SearchBar.d.ts +1 -1
  87. package/dist/ui/composite/Timeline.d.ts +1 -1
  88. package/dist/ui/composite/Toast.d.ts +1 -1
  89. package/dist/ui/composite/Toolbar.d.ts +6 -6
  90. package/dist/ui/forms/CodeEditor/CodeEditorComponent.d.ts +4 -4
  91. package/dist/ui/forms/CodeEditor/HookedCodeEditor.d.ts +1 -1
  92. package/dist/ui/forms/CodeEditor/fetchCoreResourcesSuggestions.d.ts +7 -7
  93. package/dist/ui/forms/CodeEditor/index.d.ts +1 -1
  94. package/dist/ui/forms/Input/Input.d.ts +2 -2
  95. package/dist/ui/forms/InputCheckbox/HookedInputCheckbox.d.ts +1 -1
  96. package/dist/ui/forms/InputCheckbox/InputCheckbox.d.ts +2 -2
  97. package/dist/ui/forms/InputCheckbox/index.d.ts +1 -1
  98. package/dist/ui/forms/InputCheckboxGroup/HookedInputCheckboxGroup.d.ts +1 -1
  99. package/dist/ui/forms/InputCheckboxGroup/InputCheckboxGroupItem.d.ts +2 -2
  100. package/dist/ui/forms/InputCheckboxGroup/index.d.ts +2 -2
  101. package/dist/ui/forms/InputCheckboxGroup/reducer.d.ts +3 -3
  102. package/dist/ui/forms/InputCurrency/HookedInputCurrency.d.ts +1 -1
  103. package/dist/ui/forms/InputCurrency/InputCurrency.d.ts +3 -3
  104. package/dist/ui/forms/InputCurrency/index.d.ts +1 -1
  105. package/dist/ui/forms/InputCurrency/utils.d.ts +1 -1
  106. package/dist/ui/forms/InputCurrencyRange.d.ts +3 -3
  107. package/dist/ui/forms/InputDate/HookedInputDate.d.ts +1 -1
  108. package/dist/ui/forms/InputDateRange/HookedInputDateRange.d.ts +1 -1
  109. package/dist/ui/forms/InputDateRange/InputDateRange.d.ts +5 -5
  110. package/dist/ui/forms/InputDateRange/index.d.ts +1 -1
  111. package/dist/ui/forms/InputFeedback.d.ts +1 -1
  112. package/dist/ui/forms/InputFile.d.ts +1 -1
  113. package/dist/ui/forms/InputJson.d.ts +1 -1
  114. package/dist/ui/forms/InputRadioGroup/HookedInputRadioGroup.d.ts +1 -1
  115. package/dist/ui/forms/InputRadioGroup/index.d.ts +1 -1
  116. package/dist/ui/forms/InputResourceGroup/FullList.d.ts +3 -3
  117. package/dist/ui/forms/InputResourceGroup/HookedInputResourceGroup.d.ts +1 -1
  118. package/dist/ui/forms/InputResourceGroup/InputResourceGroup.d.ts +1 -1
  119. package/dist/ui/forms/InputResourceGroup/index.d.ts +2 -2
  120. package/dist/ui/forms/InputResourceGroup/utils.d.ts +3 -3
  121. package/dist/ui/forms/InputSelect/CreatableComponent.d.ts +1 -1
  122. package/dist/ui/forms/InputSelect/GenericAsyncComponent.d.ts +1 -1
  123. package/dist/ui/forms/InputSelect/HookedInputSelect.d.ts +1 -1
  124. package/dist/ui/forms/InputSelect/InputSelect.d.ts +1 -1
  125. package/dist/ui/forms/InputSelect/SelectComponent.d.ts +1 -1
  126. package/dist/ui/forms/InputSelect/index.d.ts +3 -3
  127. package/dist/ui/forms/InputSelect/styles.d.ts +1 -1
  128. package/dist/ui/forms/InputSelect/utils.d.ts +1 -1
  129. package/dist/ui/forms/InputSimpleSelect/InputSimpleSelect.d.ts +1 -1
  130. package/dist/ui/forms/InputSimpleSelect/index.d.ts +2 -2
  131. package/dist/ui/forms/InputSpinner/HookedInputSpinner.d.ts +1 -1
  132. package/dist/ui/forms/InputSpinner/InputSpinner.d.ts +1 -1
  133. package/dist/ui/forms/InputSpinner/index.d.ts +1 -1
  134. package/dist/ui/forms/InputSwitch/InputSwitch.d.ts +1 -1
  135. package/dist/ui/forms/InputSwitch/index.d.ts +1 -1
  136. package/dist/ui/forms/InputTextArea/index.d.ts +1 -1
  137. package/dist/ui/forms/InputToggleButton/HookedInputToggleButton.d.ts +1 -1
  138. package/dist/ui/forms/InputToggleButton/InputToggleButton.d.ts +4 -4
  139. package/dist/ui/forms/InputToggleButton/index.d.ts +2 -2
  140. package/dist/ui/forms/MarketWithCurrencySelector/HookedMarketWithCurrencySelector.d.ts +2 -2
  141. package/dist/ui/forms/MarketWithCurrencySelector/index.d.ts +1 -1
  142. package/dist/ui/forms/ReactHookForm/HookedValidationApiError.d.ts +1 -1
  143. package/dist/ui/forms/ReactHookForm/setApiFormErrors.d.ts +1 -1
  144. package/dist/ui/forms/ReactHookForm/useValidationFeedback.d.ts +1 -1
  145. package/dist/ui/forms/RuleEngine/Action/ActionListItem.d.ts +1 -1
  146. package/dist/ui/forms/RuleEngine/Action/ActionValue.d.ts +1 -1
  147. package/dist/ui/forms/RuleEngine/Action/index.d.ts +1 -1
  148. package/dist/ui/forms/RuleEngine/Condition/ArrayMatch.d.ts +0 -0
  149. package/dist/ui/forms/RuleEngine/Condition/ConditionListItem.d.ts +1 -1
  150. package/dist/ui/forms/RuleEngine/Condition/ConditionMatcher.d.ts +1 -1
  151. package/dist/ui/forms/RuleEngine/Condition/ConditionValue.d.ts +1 -1
  152. package/dist/ui/forms/RuleEngine/Condition/Connector.d.ts +0 -0
  153. package/dist/ui/forms/RuleEngine/Condition/RangeInputs.d.ts +0 -0
  154. package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputArrayMatch.d.ts +2 -2
  155. package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputNumberRange.d.ts +2 -2
  156. package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputTextRange.d.ts +2 -2
  157. package/dist/ui/forms/RuleEngine/Condition/dictionaries.d.ts +0 -0
  158. package/dist/ui/forms/RuleEngine/Condition/index.d.ts +1 -1
  159. package/dist/ui/forms/RuleEngine/Condition/types.d.ts +0 -0
  160. package/dist/ui/forms/RuleEngine/Condition/utils.d.ts +1 -1
  161. package/dist/ui/forms/RuleEngine/RuleEngineComponent.d.ts +4 -4
  162. package/dist/ui/forms/RuleEngine/RuleEngineContext.d.ts +1 -1
  163. package/dist/ui/forms/RuleEngine/utils.d.ts +6 -6
  164. package/dist/ui/internals/FlexRow.d.ts +1 -1
  165. package/dist/ui/internals/InputWrapper.d.ts +6 -6
  166. package/dist/ui/internals/InteractiveElement.className.d.ts +4 -4
  167. package/dist/ui/internals/Overlay.d.ts +1 -1
  168. package/dist/ui/resources/ResourceAddress/ResourceAddress.d.ts +2 -2
  169. package/dist/ui/resources/ResourceAddress/ResourceAddressFormFields.d.ts +1 -1
  170. package/dist/ui/resources/ResourceAddress/index.d.ts +1 -1
  171. package/dist/ui/resources/ResourceAddress/useResourceAddressOverlay.d.ts +2 -2
  172. package/dist/ui/resources/ResourceAttachments/index.d.ts +1 -1
  173. package/dist/ui/resources/ResourceDetails/useEditDetailsOverlay.d.ts +2 -2
  174. package/dist/ui/resources/ResourceLineItems/index.d.ts +1 -1
  175. package/dist/ui/resources/ResourceListItem/ResourceListItem.d.ts +2 -2
  176. package/dist/ui/resources/ResourceListItem/ResourceListItem.mocks.d.ts +9 -0
  177. package/dist/ui/resources/ResourceListItem/index.d.ts +1 -1
  178. package/dist/ui/resources/ResourceListItem/types.d.ts +3 -3
  179. package/dist/ui/resources/ResourceMetadata/ResourceMetadata.d.ts +2 -2
  180. package/dist/ui/resources/ResourceMetadata/index.d.ts +1 -1
  181. package/dist/ui/resources/ResourceOrderTimeline.d.ts +1 -1
  182. package/dist/ui/resources/ResourcePaymentMethod.d.ts +3 -3
  183. package/dist/ui/resources/ResourceShipmentParcels.mocks.d.ts +2 -2
  184. package/dist/ui/resources/ResourceTags.d.ts +3 -3
  185. package/dist/ui/resources/useResourceFilters/FieldCurrencyRange.d.ts +1 -2
  186. package/dist/ui/resources/useResourceFilters/FiltersForm.d.ts +1 -1
  187. package/dist/ui/resources/useResourceFilters/FiltersNav.d.ts +1 -2
  188. package/dist/ui/resources/useResourceFilters/FiltersSearchBar.d.ts +3 -3
  189. package/dist/ui/resources/useResourceFilters/adaptFormValuesToSdk.d.ts +1 -1
  190. package/dist/ui/resources/useResourceFilters/adaptFormValuesToUrlQuery.d.ts +1 -1
  191. package/dist/ui/resources/useResourceFilters/adaptSdkToMetrics.d.ts +4 -4
  192. package/dist/ui/resources/useResourceFilters/adaptSdkToUrlQuery.d.ts +2 -2
  193. package/dist/ui/resources/useResourceFilters/adaptUrlQueryToFormValues.d.ts +1 -1
  194. package/dist/ui/resources/useResourceFilters/adaptUrlQueryToSdk.d.ts +1 -1
  195. package/dist/ui/resources/useResourceFilters/adaptUrlQueryToUrlQuery.d.ts +1 -1
  196. package/dist/ui/resources/useResourceFilters/adapters.types.d.ts +8 -8
  197. package/dist/ui/resources/useResourceFilters/timeUtils.d.ts +1 -1
  198. package/dist/ui/resources/useResourceFilters/types.d.ts +18 -18
  199. package/dist/ui/resources/useResourceFilters/useResourceFilters.d.ts +10 -11
  200. package/dist/ui/resources/useResourceFilters/utils.d.ts +2 -2
  201. package/dist/ui/resources/useResourceList/adaptMetricsOrderToCore.d.ts +1 -1
  202. package/dist/ui/resources/useResourceList/index.d.ts +1 -1
  203. package/dist/ui/resources/useResourceList/infiniteFetcher.d.ts +5 -5
  204. package/dist/ui/resources/useResourceList/metricsApiClient.d.ts +4 -4
  205. package/dist/ui/resources/useResourceList/reducer.d.ts +5 -5
  206. package/dist/ui/resources/useResourceList/useResourceList.d.ts +10 -10
  207. package/dist/ui/resources/useResourceList/utils.d.ts +1 -1
  208. package/dist/utils/array.d.ts +1 -1
  209. package/dist/utils/htmltags.d.ts +1 -1
  210. package/dist/utils/pagination.d.ts +4 -4
  211. package/dist/vendor.css +1 -1
  212. package/package.json +32 -35
  213. package/dist/CodeEditorComponent-BTinRSNU.js +0 -739
  214. package/dist/InputDateComponent-DbOIWLmQ.js +0 -4964
  215. package/dist/RuleEngineComponent-BTMemWTZ.js +0 -1389
  216. package/dist/fetchCoreResourcesSuggestions-CZkDwjO2.js +0 -126
@@ -3,4 +3,4 @@ import { DisplayStatus } from './types';
3
3
  export interface CustomerDisplayStatus extends DisplayStatus {
4
4
  }
5
5
  export declare function getCustomerDisplayStatus(customerObj: Customer): CustomerDisplayStatus;
6
- export declare function getCustomerStatusName(status: Customer['status']): string;
6
+ export declare function getCustomerStatusName(status: Customer["status"]): string;
@@ -1,17 +1,17 @@
1
- import { StatusIconProps } from '../ui/atoms/StatusIcon';
2
1
  import { Order } from '@commercelayer/sdk';
2
+ import { StatusIconProps } from '../ui/atoms/StatusIcon';
3
3
  import { DisplayStatus } from './types';
4
4
  export interface OrderDisplayStatus extends DisplayStatus {
5
5
  label: string;
6
- icon: StatusIconProps['name'];
7
- color: StatusIconProps['background'];
6
+ icon: StatusIconProps["name"];
7
+ color: StatusIconProps["background"];
8
8
  task?: string;
9
9
  }
10
10
  export declare function getOrderDisplayStatus(order: Order): OrderDisplayStatus;
11
- export declare function getOrderTransactionName(type: NonNullable<Order['transactions']>[number]['type']): {
11
+ export declare function getOrderTransactionName(type: NonNullable<Order["transactions"]>[number]["type"]): {
12
12
  pastTense: string;
13
13
  singular: string;
14
14
  };
15
- export declare function getOrderStatusName(status: Order['status']): string;
16
- export declare function getOrderPaymentStatusName(status: Order['payment_status']): string;
17
- export declare function getOrderFulfillmentStatusName(status: Order['fulfillment_status']): string;
15
+ export declare function getOrderStatusName(status: Order["status"]): string;
16
+ export declare function getOrderPaymentStatusName(status: Order["payment_status"]): string;
17
+ export declare function getOrderFulfillmentStatusName(status: Order["fulfillment_status"]): string;
@@ -1,7 +1,7 @@
1
1
  import { Promotion } from '@commercelayer/sdk';
2
2
  import { DisplayStatus } from './types';
3
3
  interface PromotionDisplayStatus extends DisplayStatus {
4
- status: 'disabled' | 'active' | 'upcoming' | 'expired' | 'used';
4
+ status: "disabled" | "active" | "upcoming" | "expired" | "used";
5
5
  }
6
- export declare function getPromotionDisplayStatus(promotion: Omit<Promotion, 'type' | 'promotion_rules'>): PromotionDisplayStatus;
6
+ export declare function getPromotionDisplayStatus(promotion: Omit<Promotion, "type" | "promotion_rules">): PromotionDisplayStatus;
7
7
  export {};
@@ -1,11 +1,11 @@
1
- import { StatusIconProps } from '../ui/atoms/StatusIcon';
2
1
  import { Return } from '@commercelayer/sdk';
2
+ import { StatusIconProps } from '../ui/atoms/StatusIcon';
3
3
  import { DisplayStatus } from './types';
4
4
  export interface ReturnDisplayStatus extends DisplayStatus {
5
5
  label: string;
6
- icon: StatusIconProps['name'];
7
- color: StatusIconProps['background'];
6
+ icon: StatusIconProps["name"];
7
+ color: StatusIconProps["background"];
8
8
  task?: string;
9
9
  }
10
10
  export declare function getReturnDisplayStatus(returnObj: Return): ReturnDisplayStatus;
11
- export declare function getReturnStatusName(status: Return['status']): string;
11
+ export declare function getReturnStatusName(status: Return["status"]): string;
@@ -1,11 +1,11 @@
1
- import { StatusIconProps } from '../ui/atoms/StatusIcon';
2
1
  import { Shipment } from '@commercelayer/sdk';
2
+ import { StatusIconProps } from '../ui/atoms/StatusIcon';
3
3
  import { DisplayStatus } from './types';
4
4
  export interface ShipmentDisplayStatus extends DisplayStatus {
5
5
  label: string;
6
- icon: StatusIconProps['name'];
7
- color: StatusIconProps['background'];
6
+ icon: StatusIconProps["name"];
7
+ color: StatusIconProps["background"];
8
8
  task?: string;
9
9
  }
10
10
  export declare function getShipmentDisplayStatus(shipment: Shipment, awaitingStockTransfer?: boolean): ShipmentDisplayStatus;
11
- export declare function getShipmentStatusName(status: Shipment['status']): string;
11
+ export declare function getShipmentStatusName(status: Shipment["status"]): string;
@@ -1,11 +1,11 @@
1
- import { StatusIconProps } from '../ui/atoms/StatusIcon';
2
1
  import { StockTransfer } from '@commercelayer/sdk';
2
+ import { StatusIconProps } from '../ui/atoms/StatusIcon';
3
3
  import { DisplayStatus } from './types';
4
4
  export interface StockTransferDisplayStatus extends DisplayStatus {
5
5
  label: string;
6
- icon: StatusIconProps['name'];
7
- color: StatusIconProps['background'];
6
+ icon: StatusIconProps["name"];
7
+ color: StatusIconProps["background"];
8
8
  task?: string;
9
9
  }
10
10
  export declare function getStockTransferDisplayStatus(stockTransfer: StockTransfer): StockTransferDisplayStatus;
11
- export declare function getStockTransferStatusName(status: StockTransfer['status']): string;
11
+ export declare function getStockTransferStatusName(status: StockTransfer["status"]): string;
@@ -1,7 +1,7 @@
1
1
  import { StatusIconProps } from '../ui/atoms/StatusIcon';
2
2
  export interface DisplayStatus {
3
3
  label: string;
4
- icon: StatusIconProps['name'];
5
- color: StatusIconProps['background'];
4
+ icon: StatusIconProps["name"];
5
+ color: StatusIconProps["background"];
6
6
  task?: string;
7
7
  }
@@ -0,0 +1,124 @@
1
+ "use client";
2
+ const c = /* @__PURE__ */ (() => {
3
+ let t;
4
+ return async (a = !0) => {
5
+ if (a) {
6
+ for (; t == null; )
7
+ await new Promise((e) => setTimeout(e, 100));
8
+ return t;
9
+ }
10
+ return t != null || (t = await fetch("https://core.commercelayer.io/api/public/resources").then(async (e) => await e.json()).then((e) => ({
11
+ data: e.data.concat([
12
+ {
13
+ id: "inventory",
14
+ type: "resources",
15
+ attributes: {
16
+ fields: {
17
+ available: {
18
+ type: "boolean",
19
+ desc: "Indicates if the sku is available."
20
+ },
21
+ quantity: {
22
+ type: "integer",
23
+ desc: "The available stock quantity."
24
+ }
25
+ },
26
+ relationships: {}
27
+ }
28
+ }
29
+ ]).map((s) => s.id === "sku" ? (delete s.attributes.fields.inventory, {
30
+ ...s,
31
+ attributes: {
32
+ ...s.attributes,
33
+ relationships: {
34
+ ...s.attributes.relationships,
35
+ inventory: {
36
+ type: "has_one",
37
+ desc: "The associated inventory.",
38
+ required: "required",
39
+ creatable: !0,
40
+ updatable: !0,
41
+ filterable: !0,
42
+ sortable: !0,
43
+ parent_resource: "Api::SkuResource",
44
+ class_name: "Inventory"
45
+ }
46
+ }
47
+ }
48
+ }) : s)
49
+ })).then(
50
+ ({ data: e }) => e.reduce((s, r, i, u) => ({
51
+ ...s,
52
+ [r.id]: {
53
+ ...r,
54
+ fields: Object.entries(r.attributes.fields).filter(([n]) => !n.startsWith("_")),
55
+ relationships: Object.entries(r.attributes.relationships).filter(([n]) => !n.startsWith("_")).filter(
56
+ ([, n]) => e.find(
57
+ (o) => o.id === h(n.class_name)
58
+ ) != null
59
+ )
60
+ }
61
+ }), {})
62
+ ).catch((e) => {
63
+ throw e;
64
+ })), t;
65
+ };
66
+ })();
67
+ c(!1);
68
+ async function f(t, a) {
69
+ if (!new RegExp(`^(${t.join("|")})(.|$)`).test(a))
70
+ return t.map((r) => ({
71
+ value: r,
72
+ type: "relationship"
73
+ }));
74
+ const e = await p(a);
75
+ return [].concat(
76
+ e.resource?.fields.map(([r]) => ({
77
+ value: `${e.resourcePath}.${r}`,
78
+ type: "field"
79
+ })) ?? []
80
+ ).concat(
81
+ e.resource?.relationships.map(([r]) => ({
82
+ value: `${e.resourcePath}.${r}`,
83
+ type: "relationship"
84
+ })) ?? []
85
+ );
86
+ }
87
+ async function p(t, a) {
88
+ const e = await c(), s = t.replace(/\.$/, "").split("."), r = s.shift();
89
+ return a ??= e[r ?? ""], s.reduce(
90
+ (i, u) => {
91
+ const n = i.resource?.relationships.find(
92
+ ([l]) => l === u
93
+ )?.[1].class_name;
94
+ if (n == null) {
95
+ const l = i.resource?.fields.find(([d]) => d === u)?.[1];
96
+ return {
97
+ ...i,
98
+ field: l != null ? {
99
+ ...l,
100
+ name: u
101
+ } : void 0
102
+ };
103
+ }
104
+ const o = e[h(n)];
105
+ return o == null ? i : {
106
+ path: i.path,
107
+ resourcePath: `${i.resourcePath == null ? "" : `${i.resourcePath}.`}${u}`,
108
+ resource: o
109
+ };
110
+ },
111
+ {
112
+ path: t,
113
+ resourcePath: a != null ? r ?? "" : "",
114
+ resource: a
115
+ }
116
+ );
117
+ }
118
+ function h(t) {
119
+ return t.replace(/([A-Z])/g, "_$1").replace(/^_/, "").toLowerCase();
120
+ }
121
+ export {
122
+ p as a,
123
+ f
124
+ };
@@ -12,7 +12,7 @@ export interface BackToItem {
12
12
  /**
13
13
  * Navigate back to the url found in sessionStorage or to the default relative path.
14
14
  */
15
- export declare function goBack({ setLocation, defaultRelativePath }: {
15
+ export declare function goBack({ setLocation, defaultRelativePath, }: {
16
16
  /**
17
17
  * React router's history.push method, this is used when linking internal app pages.
18
18
  */
@@ -57,7 +57,7 @@ interface NavigateToExternalParams {
57
57
  /**
58
58
  * required when linking to another app, it indicates if the destination app should be opened in test or live mode
59
59
  */
60
- mode: 'test' | 'live';
60
+ mode: "test" | "live";
61
61
  };
62
62
  }
63
63
  /**
@@ -5,4 +5,4 @@ export declare const referenceOrigins: {
5
5
  readonly appOrdersRefundNote: "app-orders--refund-note";
6
6
  readonly appShipmentsNote: "app-shipments--note";
7
7
  };
8
- export declare function isAttachmentValidNote(attachment: Attachment, validReferenceOrigins: Array<(typeof referenceOrigins)[keyof typeof referenceOrigins]>): attachment is SetNonNullable<SetRequired<Attachment, 'description' | 'reference_origin'>, 'description' | 'reference_origin'>;
8
+ export declare function isAttachmentValidNote(attachment: Attachment, validReferenceOrigins: Array<(typeof referenceOrigins)[keyof typeof referenceOrigins]>): attachment is SetNonNullable<SetRequired<Attachment, "description" | "reference_origin">, "description" | "reference_origin">;
@@ -1,6 +1,6 @@
1
- import { I18NLocale } from '../providers/I18NProvider';
2
1
  import { Simplify } from 'type-fest';
3
- type Format = 'date' | 'time' | 'timeWithSeconds' | 'full' | 'fullWithSeconds' | 'distanceToNow';
2
+ import { I18NLocale } from '../providers/I18NProvider';
3
+ type Format = "date" | "time" | "timeWithSeconds" | "full" | "fullWithSeconds" | "distanceToNow";
4
4
  interface FormatDateOptions {
5
5
  /**
6
6
  * JavaScript ISO date string. Example '2022-10-06T11:59:30.371Z'
@@ -49,7 +49,7 @@ interface FormatDateWithPredicateOptions extends FormatDateOptions {
49
49
  * @param opts a set of `FormatDateOptions` along with a date verb predicate. In this method `format` prop has 'full' default value.
50
50
  * @returns a nice string representation of the predicate, followed by the proper separator and the formatted date. Examples: 'Created today · 1:16 PM', 'Updated on Jul 21, 2022 · 1:16 PM' or 'Updated at 1:16 PM'
51
51
  */
52
- export declare function formatDateWithPredicate({ isoDate, timezone, format, predicate, locale }: FormatDateWithPredicateOptions): string;
52
+ export declare function formatDateWithPredicate({ isoDate, timezone, format, predicate, locale, }: FormatDateWithPredicateOptions): string;
53
53
  export declare const timeSeparator = ", ";
54
54
  type DateISOString = string;
55
55
  /**
@@ -61,9 +61,9 @@ type DateISOString = string;
61
61
  * @returns a JavaScript ISO date string that reflect the start or end of the day
62
62
  * based on the user timezone. Example '2022-10-06T22:00:00.000Z' when timezone is 'Europe/Rome'
63
63
  */
64
- export declare function getIsoDateAtDayEdge({ isoString, edge, timezone }: {
64
+ export declare function getIsoDateAtDayEdge({ isoString, edge, timezone, }: {
65
65
  isoString: DateISOString;
66
- edge: 'startOfTheDay' | 'endOfTheDay';
66
+ edge: "startOfTheDay" | "endOfTheDay";
67
67
  timezone?: string;
68
68
  }): string | undefined;
69
69
  /**
@@ -80,7 +80,7 @@ export declare function getIsoDateAtDayEdge({ isoString, edge, timezone }: {
80
80
  * @param timezone (optional) in case of working with a specific timezone different from UTC
81
81
  * @returns a new iso string
82
82
  */
83
- export declare function getIsoDateAtDaysBefore({ isoString, days, timezone }: {
83
+ export declare function getIsoDateAtDaysBefore({ isoString, days, timezone, }: {
84
84
  isoString: DateISOString;
85
85
  days: number;
86
86
  timezone?: string;
@@ -88,19 +88,19 @@ export declare function getIsoDateAtDaysBefore({ isoString, days, timezone }: {
88
88
  /**
89
89
  * Given the event date (`startsAt` and `expiresAt`) it returns whether the the event is `active`, `past` or `upcoming`.
90
90
  */
91
- export declare function getEventDateInfo({ startsAt, expiresAt, timezone }: {
91
+ export declare function getEventDateInfo({ startsAt, expiresAt, timezone, }: {
92
92
  /** The activation date/time of the event (ISO date string. Example '2022-10-06T11:59:30.371Z'). */
93
93
  startsAt: DateISOString;
94
94
  /** The expiration date/time of the promotion (must be after startsAt) (ISO date string. Example '2022-10-06T11:59:30.371Z'). */
95
95
  expiresAt: DateISOString;
96
96
  /** Set a specific timezone, when not passed default value is 'UTC' */
97
97
  timezone?: string;
98
- }): 'active' | 'past' | 'upcoming';
98
+ }): "active" | "past" | "upcoming";
99
99
  /**
100
100
  * Format a date range as a nice string also specifying a custom timezone
101
101
  * @returns a nice string representation. Example: '1-21 Jul, 2022' or 'Jul 21, 2022 - Jan 12, 2023'
102
102
  */
103
- export declare function formatDateRange({ rangeFrom, rangeTo, timezone, locale }: {
103
+ export declare function formatDateRange({ rangeFrom, rangeTo, timezone, locale, }: {
104
104
  /** JavaScript Date or ISO string. Example '2022-10-06T11:59:30.371Z' */
105
105
  rangeFrom: DateISOString | Date;
106
106
  /** JavaScript Date or ISO string. Example '2022-11-06T11:59:30.371Z' */
@@ -114,17 +114,17 @@ export declare function formatDateRange({ rangeFrom, rangeTo, timezone, locale }
114
114
  export interface Event {
115
115
  date: string;
116
116
  }
117
- type Position = 'first' | 'other';
117
+ type Position = "first" | "other";
118
118
  /**
119
119
  *
120
120
  * @param events
121
121
  * @param options
122
122
  * @returns
123
123
  */
124
- export declare function sortAndGroupByDate<T extends Event>(events: T[], { timezone, locale, orders }?: {
124
+ export declare function sortAndGroupByDate<T extends Event>(events: T[], { timezone, locale, orders, }?: {
125
125
  timezone?: string;
126
126
  locale?: I18NLocale;
127
- orders?: 'asc' | 'desc';
127
+ orders?: "asc" | "desc";
128
128
  }): Record<string, Array<Simplify<T & {
129
129
  position: Position;
130
130
  }>>>;
@@ -159,7 +159,7 @@ export declare function removeMillisecondsFromIsoDate(isoDate: string): string;
159
159
  * // { date_from: '2022-04-24T13:45:01.000Z, date_to: '2023-04-24T13:45:00.000Z' }
160
160
  * ```
161
161
  */
162
- export declare function makeDateYearsRange({ now, yearsAgo, showMilliseconds }: {
162
+ export declare function makeDateYearsRange({ now, yearsAgo, showMilliseconds, }: {
163
163
  now: Date;
164
164
  yearsAgo: number;
165
165
  showMilliseconds: boolean;
@@ -3,7 +3,7 @@
3
3
  * @param json - optional JSON object that will be the content of downloaded file
4
4
  * @param filename - string to define the downloaded file name
5
5
  */
6
- export declare function downloadJsonAsFile({ json, filename }: {
6
+ export declare function downloadJsonAsFile({ json, filename, }: {
7
7
  json?: object;
8
8
  filename: string;
9
9
  }): void;
@@ -3,13 +3,13 @@ import { ListableResourceType, ResourceTypeLock, ResourceUpdate } from '@commerc
3
3
  * Format a resource name for display in the UI based on the count and format.
4
4
  * default format is lower case and singular
5
5
  */
6
- export declare function formatResourceName({ resource, count, format }: {
6
+ export declare function formatResourceName({ resource, count, format, }: {
7
7
  resource: ListableResourceType;
8
- count?: number | 'singular' | 'plural';
9
- format?: 'lower' | 'title';
8
+ count?: number | "singular" | "plural";
9
+ format?: "lower" | "title";
10
10
  }): string;
11
11
  export type TriggerAttribute<Resource extends ResourceUpdate> = Extract<keyof Resource, `_${string}`>;
12
- export type ResourceEndpoint = Exclude<ResourceTypeLock, 'applications' | 'organizations'> | ('organization' | 'application');
12
+ export type ResourceEndpoint = Exclude<ResourceTypeLock, "applications" | "organizations"> | ("organization" | "application");
13
13
  /**
14
14
  * Get the resource endpoint for a given resource type.
15
15
  * @param resourceType The resource type
@@ -1,8 +1,8 @@
1
- import { AvatarProps } from '../ui/atoms/Avatar';
2
1
  import { Parcel, Shipment } from '@commercelayer/sdk';
3
2
  import { SetNonNullable } from 'type-fest';
4
3
  import { z } from 'zod';
5
- export declare function getAvatarSrcFromRate(rate: Rate): AvatarProps['src'];
4
+ import { AvatarProps } from '../ui/atoms/Avatar';
5
+ export declare function getAvatarSrcFromRate(rate: Rate): AvatarProps["src"];
6
6
  /**
7
7
  * Get tracking details descending sorted from a parcel.
8
8
  */
@@ -86,9 +86,9 @@ declare const trackingDetailSchema: z.ZodObject<{
86
86
  carrier_code: z.ZodNullable<z.ZodString>;
87
87
  }, "strip", z.ZodTypeAny, {
88
88
  object: "TrackingDetail";
89
- description: string | null;
90
89
  source: string | null;
91
90
  status: string | null;
91
+ description: string | null;
92
92
  message: string | null;
93
93
  status_detail: string | null;
94
94
  datetime: string | null;
@@ -102,9 +102,9 @@ declare const trackingDetailSchema: z.ZodObject<{
102
102
  carrier_code: string | null;
103
103
  }, {
104
104
  object: "TrackingDetail";
105
- description: string | null;
106
105
  source: string | null;
107
106
  status: string | null;
107
+ description: string | null;
108
108
  message: string | null;
109
109
  status_detail: string | null;
110
110
  datetime: string | null;
@@ -1,2 +1,2 @@
1
1
  import { RefObject } from 'react';
2
- export declare const useClickAway: (onClickAway?: () => void) => RefObject<HTMLDivElement> | undefined;
2
+ export declare const useClickAway: (onClickAway: () => void) => RefObject<HTMLDivElement> | undefined;
@@ -1,12 +1,12 @@
1
- import { ResourceMetadataProps } from '../ui/resources/ResourceMetadata';
2
1
  import { FC } from 'react';
2
+ import { ResourceMetadataProps } from '../ui/resources/ResourceMetadata';
3
3
  export interface EditMetadataOverlayProps {
4
4
  /**
5
5
  * Optional title shown as first line in edit overlay heading
6
6
  */
7
7
  title?: string;
8
- resourceId: ResourceMetadataProps['resourceId'];
9
- resourceType: ResourceMetadataProps['resourceType'];
8
+ resourceId: ResourceMetadataProps["resourceId"];
9
+ resourceType: ResourceMetadataProps["resourceType"];
10
10
  }
11
11
  interface MetadataOverlayHook {
12
12
  show: () => void;
@@ -8,8 +8,8 @@ export interface EditTagsOverlayProps {
8
8
  * Optional setting to define if tags app management link is to be shown in edit overlay heading
9
9
  */
10
10
  showManageAction?: boolean;
11
- resourceId: ResourceTagsProps['resourceId'];
12
- resourceType: ResourceTagsProps['resourceType'];
11
+ resourceId: ResourceTagsProps["resourceId"];
12
+ resourceType: ResourceTagsProps["resourceType"];
13
13
  }
14
14
  interface TagsOverlayHook {
15
15
  show: () => void;
@@ -5,7 +5,7 @@
5
5
  * @param onChange - the action to trigger when the value has changed
6
6
  * @returns - a boolean that is true when the value has changed
7
7
  */
8
- export declare function useIsChanged<T>({ value, onChange }: {
8
+ export declare function useIsChanged<T>({ value, onChange, }: {
9
9
  value: T;
10
10
  onChange?: () => void;
11
11
  }): boolean;