@commercelayer/app-elements 5.6.0 → 6.0.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.
- package/dist/CodeEditorComponent-9BjmYH9v.js +720 -0
- package/dist/InputDateComponent-DeKe0ONv.js +4887 -0
- package/dist/RuleEngineComponent-C1DXm3EO.js +1404 -0
- package/dist/dictionaries/customers.d.ts +1 -1
- package/dist/dictionaries/orders.d.ts +7 -7
- package/dist/dictionaries/promotions.d.ts +2 -2
- package/dist/dictionaries/returns.d.ts +4 -4
- package/dist/dictionaries/shipments.d.ts +4 -4
- package/dist/dictionaries/stockTransfers.d.ts +4 -4
- package/dist/dictionaries/types.d.ts +2 -2
- package/dist/fetchCoreResourcesSuggestions-DLZhtrDX.js +124 -0
- package/dist/helpers/appsNavigation.d.ts +2 -2
- package/dist/helpers/attachments.d.ts +1 -1
- package/dist/helpers/date.d.ts +13 -13
- package/dist/helpers/downloadJsonAsFile.d.ts +1 -1
- package/dist/helpers/resources.d.ts +4 -4
- package/dist/helpers/tracking.d.ts +4 -4
- package/dist/hooks/useClickAway.d.ts +1 -1
- package/dist/hooks/useEditMetadataOverlay.d.ts +3 -3
- package/dist/hooks/useEditTagsOverlay.d.ts +2 -2
- package/dist/hooks/useIsChanged.d.ts +1 -1
- package/dist/{main-YD7ko8U-.js → main-BANV9Udl.js} +26949 -28776
- package/dist/main.d.ts +60 -60
- package/dist/main.js +1 -1
- package/dist/{parseISO-Cq_loYUP.js → parseISO-8P5gMU86.js} +17 -17
- package/dist/providers/CoreSdkProvider/CoreSdkProvider.d.ts +1 -1
- package/dist/providers/CoreSdkProvider/makeSdkClient.d.ts +1 -1
- package/dist/providers/CoreSdkProvider/useCoreApi.d.ts +1 -1
- package/dist/providers/GTMProvider.d.ts +1 -1
- package/dist/providers/TokenProvider/MockTokenProvider.d.ts +1 -1
- package/dist/providers/TokenProvider/TokenProvider.d.ts +1 -1
- package/dist/providers/TokenProvider/getAccessTokenFromUrl.d.ts +1 -1
- package/dist/providers/TokenProvider/index.d.ts +1 -1
- package/dist/providers/TokenProvider/reducer.d.ts +2 -2
- package/dist/providers/TokenProvider/storage.d.ts +4 -4
- package/dist/providers/TokenProvider/types.d.ts +10 -10
- package/dist/providers/TokenProvider/url.d.ts +1 -1
- package/dist/providers/TokenProvider/validateToken.d.ts +2 -2
- package/dist/providers/createApp.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/tailwind.global.css +291 -0
- package/dist/ui/atoms/A.d.ts +1 -1
- package/dist/ui/atoms/Alert.d.ts +1 -1
- package/dist/ui/atoms/Avatar.d.ts +3 -3
- package/dist/ui/atoms/Avatar.utils.d.ts +18 -18
- package/dist/ui/atoms/AvatarLetter/colors.d.ts +1 -1
- package/dist/ui/atoms/Badge/Badge.d.ts +3 -3
- package/dist/ui/atoms/Badge/badgeVariants.d.ts +1 -1
- package/dist/ui/atoms/ButtonFilter.d.ts +1 -1
- package/dist/ui/atoms/Card.d.ts +15 -11
- package/dist/ui/atoms/CodeBlock.d.ts +1 -1
- package/dist/ui/atoms/EmptyState.d.ts +1 -1
- package/dist/ui/atoms/Grid.d.ts +6 -6
- package/dist/ui/atoms/Hint.d.ts +1 -1
- package/dist/ui/atoms/Hr.d.ts +2 -2
- package/dist/ui/atoms/Icon/Icon.d.ts +2 -2
- package/dist/ui/atoms/Icon/icons.d.ts +1 -1
- package/dist/ui/atoms/PageHeading/PageHeading.d.ts +3 -3
- package/dist/ui/atoms/PageHeading/PageHeadingToolbar.d.ts +2 -2
- package/dist/ui/atoms/Progress.d.ts +1 -1
- package/dist/ui/atoms/RadialProgress.d.ts +2 -2
- package/dist/ui/atoms/Section.d.ts +2 -2
- package/dist/ui/atoms/Skeleton.d.ts +1 -1
- package/dist/ui/atoms/Spacer.d.ts +3 -3
- package/dist/ui/atoms/StatusDot.d.ts +1 -1
- package/dist/ui/atoms/StatusIcon.d.ts +2 -2
- package/dist/ui/atoms/Table/Table.d.ts +1 -1
- package/dist/ui/atoms/Tag.d.ts +3 -3
- package/dist/ui/atoms/Text.d.ts +6 -6
- package/dist/ui/atoms/Tooltip.d.ts +2 -2
- package/dist/ui/composite/ActionButtons/ActionButtons.d.ts +2 -2
- package/dist/ui/composite/Address.d.ts +1 -1
- package/dist/ui/composite/Dropdown/Dropdown.d.ts +1 -1
- package/dist/ui/composite/Dropdown/DropdownItem.d.ts +11 -7
- package/dist/ui/composite/Dropdown/DropdownMenu.d.ts +3 -3
- package/dist/ui/composite/HomePageLayout.d.ts +3 -3
- package/dist/ui/composite/List.d.ts +2 -2
- package/dist/ui/composite/ListDetails.d.ts +2 -2
- package/dist/ui/composite/ListDetailsItem.d.ts +3 -3
- package/dist/ui/composite/ListItem.d.ts +7 -7
- package/dist/ui/composite/PageError.d.ts +2 -2
- package/dist/ui/composite/PageLayout.d.ts +6 -6
- package/dist/ui/composite/Routes/Routes.d.ts +3 -3
- package/dist/ui/composite/Routes/index.d.ts +2 -2
- package/dist/ui/composite/Routes/utils.d.ts +5 -5
- package/dist/ui/composite/SearchBar.d.ts +1 -1
- package/dist/ui/composite/Timeline.d.ts +1 -1
- package/dist/ui/composite/Toast.d.ts +1 -1
- package/dist/ui/composite/Toolbar.d.ts +6 -6
- package/dist/ui/forms/CodeEditor/CodeEditorComponent.d.ts +4 -4
- package/dist/ui/forms/CodeEditor/HookedCodeEditor.d.ts +1 -1
- package/dist/ui/forms/CodeEditor/fetchCoreResourcesSuggestions.d.ts +7 -7
- package/dist/ui/forms/CodeEditor/index.d.ts +1 -1
- package/dist/ui/forms/Input/Input.d.ts +2 -2
- package/dist/ui/forms/InputCheckbox/HookedInputCheckbox.d.ts +1 -1
- package/dist/ui/forms/InputCheckbox/InputCheckbox.d.ts +2 -2
- package/dist/ui/forms/InputCheckbox/index.d.ts +1 -1
- package/dist/ui/forms/InputCheckboxGroup/HookedInputCheckboxGroup.d.ts +1 -1
- package/dist/ui/forms/InputCheckboxGroup/InputCheckboxGroupItem.d.ts +2 -2
- package/dist/ui/forms/InputCheckboxGroup/index.d.ts +2 -2
- package/dist/ui/forms/InputCheckboxGroup/reducer.d.ts +3 -3
- package/dist/ui/forms/InputCurrency/HookedInputCurrency.d.ts +1 -1
- package/dist/ui/forms/InputCurrency/InputCurrency.d.ts +3 -3
- package/dist/ui/forms/InputCurrency/index.d.ts +1 -1
- package/dist/ui/forms/InputCurrency/utils.d.ts +1 -1
- package/dist/ui/forms/InputCurrencyRange.d.ts +3 -3
- package/dist/ui/forms/InputDate/HookedInputDate.d.ts +1 -1
- package/dist/ui/forms/InputDateRange/HookedInputDateRange.d.ts +1 -1
- package/dist/ui/forms/InputDateRange/InputDateRange.d.ts +5 -5
- package/dist/ui/forms/InputDateRange/index.d.ts +1 -1
- package/dist/ui/forms/InputFeedback.d.ts +1 -1
- package/dist/ui/forms/InputFile.d.ts +1 -1
- package/dist/ui/forms/InputJson.d.ts +1 -1
- package/dist/ui/forms/InputRadioGroup/HookedInputRadioGroup.d.ts +1 -1
- package/dist/ui/forms/InputRadioGroup/index.d.ts +1 -1
- package/dist/ui/forms/InputResourceGroup/FullList.d.ts +3 -3
- package/dist/ui/forms/InputResourceGroup/HookedInputResourceGroup.d.ts +1 -1
- package/dist/ui/forms/InputResourceGroup/InputResourceGroup.d.ts +1 -1
- package/dist/ui/forms/InputResourceGroup/index.d.ts +2 -2
- package/dist/ui/forms/InputResourceGroup/utils.d.ts +3 -3
- package/dist/ui/forms/InputSelect/CreatableComponent.d.ts +1 -1
- package/dist/ui/forms/InputSelect/GenericAsyncComponent.d.ts +1 -1
- package/dist/ui/forms/InputSelect/HookedInputSelect.d.ts +1 -1
- package/dist/ui/forms/InputSelect/InputSelect.d.ts +1 -1
- package/dist/ui/forms/InputSelect/SelectComponent.d.ts +1 -1
- package/dist/ui/forms/InputSelect/index.d.ts +3 -3
- package/dist/ui/forms/InputSelect/styles.d.ts +1 -1
- package/dist/ui/forms/InputSelect/utils.d.ts +1 -1
- package/dist/ui/forms/InputSimpleSelect/InputSimpleSelect.d.ts +1 -1
- package/dist/ui/forms/InputSimpleSelect/index.d.ts +2 -2
- package/dist/ui/forms/InputSpinner/HookedInputSpinner.d.ts +1 -1
- package/dist/ui/forms/InputSpinner/InputSpinner.d.ts +1 -1
- package/dist/ui/forms/InputSpinner/index.d.ts +1 -1
- package/dist/ui/forms/InputSwitch/InputSwitch.d.ts +1 -1
- package/dist/ui/forms/InputSwitch/index.d.ts +1 -1
- package/dist/ui/forms/InputTextArea/index.d.ts +1 -1
- package/dist/ui/forms/InputToggleButton/HookedInputToggleButton.d.ts +1 -1
- package/dist/ui/forms/InputToggleButton/InputToggleButton.d.ts +4 -4
- package/dist/ui/forms/InputToggleButton/index.d.ts +2 -2
- package/dist/ui/forms/MarketWithCurrencySelector/HookedMarketWithCurrencySelector.d.ts +2 -2
- package/dist/ui/forms/MarketWithCurrencySelector/index.d.ts +1 -1
- package/dist/ui/forms/ReactHookForm/HookedValidationApiError.d.ts +1 -1
- package/dist/ui/forms/ReactHookForm/setApiFormErrors.d.ts +1 -1
- package/dist/ui/forms/ReactHookForm/useValidationFeedback.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/Action/ActionListItem.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/Action/ActionValue.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/Action/index.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/Condition/ArrayMatch.d.ts +0 -0
- package/dist/ui/forms/RuleEngine/Condition/ConditionListItem.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/Condition/ConditionMatcher.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/Condition/ConditionValue.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/Condition/Connector.d.ts +0 -0
- package/dist/ui/forms/RuleEngine/Condition/RangeInputs.d.ts +0 -0
- package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputArrayMatch.d.ts +2 -2
- package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputNumberRange.d.ts +2 -2
- package/dist/ui/forms/RuleEngine/Condition/ValueComponents/InputTextRange.d.ts +2 -2
- package/dist/ui/forms/RuleEngine/Condition/dictionaries.d.ts +0 -0
- package/dist/ui/forms/RuleEngine/Condition/index.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/Condition/types.d.ts +0 -0
- package/dist/ui/forms/RuleEngine/Condition/utils.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/RuleEngineComponent.d.ts +4 -4
- package/dist/ui/forms/RuleEngine/RuleEngineContext.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/utils.d.ts +6 -6
- package/dist/ui/internals/FlexRow.d.ts +1 -1
- package/dist/ui/internals/InputWrapper.d.ts +6 -6
- package/dist/ui/internals/InteractiveElement.className.d.ts +4 -4
- package/dist/ui/internals/Overlay.d.ts +1 -1
- package/dist/ui/resources/ResourceAddress/ResourceAddress.d.ts +2 -2
- package/dist/ui/resources/ResourceAddress/ResourceAddressFormFields.d.ts +1 -1
- package/dist/ui/resources/ResourceAddress/index.d.ts +1 -1
- package/dist/ui/resources/ResourceAddress/useResourceAddressOverlay.d.ts +2 -2
- package/dist/ui/resources/ResourceAttachments/index.d.ts +1 -1
- package/dist/ui/resources/ResourceDetails/useEditDetailsOverlay.d.ts +2 -2
- package/dist/ui/resources/ResourceLineItems/index.d.ts +1 -1
- package/dist/ui/resources/ResourceListItem/ResourceListItem.d.ts +2 -2
- package/dist/ui/resources/ResourceListItem/ResourceListItem.mocks.d.ts +9 -0
- package/dist/ui/resources/ResourceListItem/index.d.ts +1 -1
- package/dist/ui/resources/ResourceListItem/types.d.ts +3 -3
- package/dist/ui/resources/ResourceMetadata/ResourceMetadata.d.ts +2 -2
- package/dist/ui/resources/ResourceMetadata/index.d.ts +1 -1
- package/dist/ui/resources/ResourceOrderTimeline.d.ts +1 -1
- package/dist/ui/resources/ResourcePaymentMethod.d.ts +3 -3
- package/dist/ui/resources/ResourceShipmentParcels.mocks.d.ts +2 -2
- package/dist/ui/resources/ResourceTags.d.ts +3 -3
- package/dist/ui/resources/useResourceFilters/FieldCurrencyRange.d.ts +1 -2
- package/dist/ui/resources/useResourceFilters/FiltersForm.d.ts +1 -1
- package/dist/ui/resources/useResourceFilters/FiltersNav.d.ts +1 -2
- package/dist/ui/resources/useResourceFilters/FiltersSearchBar.d.ts +3 -3
- package/dist/ui/resources/useResourceFilters/adaptFormValuesToSdk.d.ts +1 -1
- package/dist/ui/resources/useResourceFilters/adaptFormValuesToUrlQuery.d.ts +1 -1
- package/dist/ui/resources/useResourceFilters/adaptSdkToMetrics.d.ts +4 -4
- package/dist/ui/resources/useResourceFilters/adaptSdkToUrlQuery.d.ts +2 -2
- package/dist/ui/resources/useResourceFilters/adaptUrlQueryToFormValues.d.ts +1 -1
- package/dist/ui/resources/useResourceFilters/adaptUrlQueryToSdk.d.ts +1 -1
- package/dist/ui/resources/useResourceFilters/adaptUrlQueryToUrlQuery.d.ts +1 -1
- package/dist/ui/resources/useResourceFilters/adapters.types.d.ts +8 -8
- package/dist/ui/resources/useResourceFilters/timeUtils.d.ts +1 -1
- package/dist/ui/resources/useResourceFilters/types.d.ts +18 -18
- package/dist/ui/resources/useResourceFilters/useResourceFilters.d.ts +10 -11
- package/dist/ui/resources/useResourceFilters/utils.d.ts +2 -2
- package/dist/ui/resources/useResourceList/adaptMetricsOrderToCore.d.ts +1 -1
- package/dist/ui/resources/useResourceList/index.d.ts +1 -1
- package/dist/ui/resources/useResourceList/infiniteFetcher.d.ts +5 -5
- package/dist/ui/resources/useResourceList/metricsApiClient.d.ts +4 -4
- package/dist/ui/resources/useResourceList/reducer.d.ts +5 -5
- package/dist/ui/resources/useResourceList/useResourceList.d.ts +10 -10
- package/dist/ui/resources/useResourceList/utils.d.ts +1 -1
- package/dist/utils/array.d.ts +1 -1
- package/dist/utils/htmltags.d.ts +1 -1
- package/dist/utils/pagination.d.ts +4 -4
- package/dist/vendor.css +2 -1
- package/package.json +38 -41
- package/dist/CodeEditorComponent-DhpbUF3I.js +0 -739
- package/dist/InputDateComponent-BZyuY3F6.js +0 -4964
- package/dist/RuleEngineComponent-UggkM5Zc.js +0 -1390
- package/dist/fetchCoreResourcesSuggestions-CZkDwjO2.js +0 -126
- package/dist/tailwind.config.js +0 -197
package/dist/main.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
export { getCustomerDisplayStatus, getCustomerStatusName, } from './dictionaries/customers';
|
|
2
|
+
export { getOrderDisplayStatus, getOrderFulfillmentStatusName, getOrderPaymentStatusName, getOrderStatusName, getOrderTransactionName, } from './dictionaries/orders';
|
|
3
|
+
export { getPromotionDisplayStatus } from './dictionaries/promotions';
|
|
4
|
+
export { getReturnDisplayStatus, getReturnStatusName, } from './dictionaries/returns';
|
|
5
|
+
export { getShipmentDisplayStatus, getShipmentStatusName, } from './dictionaries/shipments';
|
|
6
|
+
export { getStockTransferDisplayStatus, getStockTransferStatusName, } from './dictionaries/stockTransfers';
|
|
1
7
|
export { goBack, navigateTo } from './helpers/appsNavigation';
|
|
2
8
|
export { isAttachmentValidNote, referenceOrigins } from './helpers/attachments';
|
|
3
|
-
export { currencies, currencyInputSelectOptions,
|
|
4
|
-
export { formatDate, formatDateRange, formatDateWithPredicate, getEventDateInfo, getIsoDateAtDayEdge, getIsoDateAtDaysBefore, isDateValid, makeDateYearsRange, removeMillisecondsFromIsoDate, sortAndGroupByDate, timeSeparator } from './helpers/date';
|
|
9
|
+
export { type CurrencyCode, currencies, currencyInputSelectOptions, } from './helpers/currencies';
|
|
10
|
+
export { formatDate, formatDateRange, formatDateWithPredicate, getEventDateInfo, getIsoDateAtDayEdge, getIsoDateAtDaysBefore, isDateValid, makeDateYearsRange, removeMillisecondsFromIsoDate, sortAndGroupByDate, timeSeparator, } from './helpers/date';
|
|
5
11
|
export { downloadJsonAsFile } from './helpers/downloadJsonAsFile';
|
|
6
12
|
export { maskGiftCardCode } from './helpers/giftCards';
|
|
7
13
|
export { isMock, isMockedId } from './helpers/mocks';
|
|
8
14
|
export { computeFullname, formatDisplayName } from './helpers/name';
|
|
9
|
-
export { formatResourceName, getResourceEndpoint, type TriggerAttribute } from './helpers/resources';
|
|
10
|
-
export { getAvatarSrcFromRate, getParcelTrackingDetail, getParcelTrackingDetails, getShipmentRate, getShipmentRates, hasBeenPurchased, hasSingleTracking, type Rate, type TrackingDetail } from './helpers/tracking';
|
|
15
|
+
export { formatResourceName, getResourceEndpoint, type TriggerAttribute, } from './helpers/resources';
|
|
16
|
+
export { getAvatarSrcFromRate, getParcelTrackingDetail, getParcelTrackingDetails, getShipmentRate, getShipmentRates, hasBeenPurchased, hasSingleTracking, type Rate, type TrackingDetail, } from './helpers/tracking';
|
|
11
17
|
export { orderTransactionIsAnAsyncCapture } from './helpers/transactions';
|
|
12
|
-
export { getUnitOfWeightName, getUnitsOfWeightForSelect, type UnitOfWeight } from './helpers/unitsOfWeight';
|
|
18
|
+
export { getUnitOfWeightName, getUnitsOfWeightForSelect, type UnitOfWeight, } from './helpers/unitsOfWeight';
|
|
13
19
|
export { useAppLinking } from './helpers/useAppLinking';
|
|
14
20
|
export { useClickAway } from './hooks/useClickAway';
|
|
15
21
|
export { useDelayShow } from './hooks/useDelayShow';
|
|
@@ -18,12 +24,12 @@ export { useEditTagsOverlay } from './hooks/useEditTagsOverlay';
|
|
|
18
24
|
export { useIsChanged } from './hooks/useIsChanged';
|
|
19
25
|
export { useOnBlurFromContainer } from './hooks/useOnBlurFromContainer';
|
|
20
26
|
export { useOverlay } from './hooks/useOverlay';
|
|
21
|
-
export { CoreSdkProvider, useCoreApi, useCoreSdkProvider } from './providers/CoreSdkProvider';
|
|
22
|
-
export {
|
|
27
|
+
export { CoreSdkProvider, useCoreApi, useCoreSdkProvider, } from './providers/CoreSdkProvider';
|
|
28
|
+
export { type ClAppKey, type ClAppProps, createApp } from './providers/createApp';
|
|
23
29
|
export { ErrorBoundary } from './providers/ErrorBoundary';
|
|
24
30
|
export { GTMProvider, useTagManager } from './providers/GTMProvider';
|
|
25
|
-
export {
|
|
26
|
-
export { encodeExtras, MetaTags, TokenProvider,
|
|
31
|
+
export { type I18NLocale, I18NProvider, i18nLocales, Trans, t, useTranslation, } from './providers/I18NProvider';
|
|
32
|
+
export { encodeExtras, MetaTags, TokenProvider, type TokenProviderAllowedApp, type TokenProviderAllowedAppKind, type TokenProviderAllowedAppSlug, type TokenProviderClAppSlug, type TokenProviderExtras, type TokenProviderPermissionItem, type TokenProviderRoleActions, type TokenProviderRolePermissions, type TokenProviderTokenApplicationKind, useTokenProvider, } from './providers/TokenProvider';
|
|
27
33
|
export { A, type AProps } from './ui/atoms/A';
|
|
28
34
|
export { Alert, type AlertProps } from './ui/atoms/Alert';
|
|
29
35
|
export { Avatar, type AvatarProps } from './ui/atoms/Avatar';
|
|
@@ -31,11 +37,11 @@ export { AvatarLetter, type AvatarLetterProps } from './ui/atoms/AvatarLetter';
|
|
|
31
37
|
export { Badge, type BadgeProps } from './ui/atoms/Badge';
|
|
32
38
|
export { Button, type ButtonProps } from './ui/atoms/Button';
|
|
33
39
|
export { ButtonFilter, type ButtonFilterProps } from './ui/atoms/ButtonFilter';
|
|
34
|
-
export { ButtonImageSelect, type ButtonImageSelectProps } from './ui/atoms/ButtonImageSelect';
|
|
40
|
+
export { ButtonImageSelect, type ButtonImageSelectProps, } from './ui/atoms/ButtonImageSelect';
|
|
35
41
|
export { Card, type CardProps } from './ui/atoms/Card';
|
|
36
42
|
export { CodeBlock, type CodeBlockProps } from './ui/atoms/CodeBlock';
|
|
37
43
|
export { Container, type ContainerProps } from './ui/atoms/Container';
|
|
38
|
-
export { CopyToClipboard, type CopyToClipboardProps } from './ui/atoms/CopyToClipboard';
|
|
44
|
+
export { CopyToClipboard, type CopyToClipboardProps, } from './ui/atoms/CopyToClipboard';
|
|
39
45
|
export { EmptyState, type EmptyStateProps } from './ui/atoms/EmptyState';
|
|
40
46
|
export { Grid, type GridProps } from './ui/atoms/Grid';
|
|
41
47
|
export { Hint, type HintProps } from './ui/atoms/Hint';
|
|
@@ -44,81 +50,75 @@ export { Icon, type IconProps } from './ui/atoms/Icon';
|
|
|
44
50
|
export { PageHeading, type PageHeadingProps } from './ui/atoms/PageHeading';
|
|
45
51
|
export { Pagination, type PaginationProps } from './ui/atoms/Pagination';
|
|
46
52
|
export { Progress, type ProgressProps } from './ui/atoms/Progress';
|
|
47
|
-
export { RadialProgress, type RadialProgressProps } from './ui/atoms/RadialProgress';
|
|
53
|
+
export { RadialProgress, type RadialProgressProps, } from './ui/atoms/RadialProgress';
|
|
48
54
|
export { RemoveButton, type RemoveButtonProps } from './ui/atoms/RemoveButton';
|
|
49
55
|
export { ScrollToTop } from './ui/atoms/ScrollToTop';
|
|
50
56
|
export { Section, type SectionProps } from './ui/atoms/Section';
|
|
51
|
-
export { Skeleton, SkeletonItem, type SkeletonItemProps, type SkeletonProps } from './ui/atoms/Skeleton';
|
|
52
|
-
export { SkeletonTemplate, withSkeletonTemplate } from './ui/atoms/SkeletonTemplate';
|
|
57
|
+
export { Skeleton, SkeletonItem, type SkeletonItemProps, type SkeletonProps, } from './ui/atoms/Skeleton';
|
|
58
|
+
export { SkeletonTemplate, withSkeletonTemplate, } from './ui/atoms/SkeletonTemplate';
|
|
53
59
|
export { Spacer, type SpacerProps } from './ui/atoms/Spacer';
|
|
54
60
|
export { Stack, type StackProps } from './ui/atoms/Stack';
|
|
55
61
|
export { StatusDot, type StatusDotProps } from './ui/atoms/StatusDot';
|
|
56
62
|
export { StatusIcon, type StatusIconProps } from './ui/atoms/StatusIcon';
|
|
57
63
|
export { Steps, type StepsProps } from './ui/atoms/Steps';
|
|
58
|
-
export { Table,
|
|
59
|
-
export { Tab,
|
|
64
|
+
export { Table, type TableProps, Td, type TdProps, Th, type ThProps, Tr, type TrProps, } from './ui/atoms/Table';
|
|
65
|
+
export { Tab, type TabProps, Tabs, type TabsProps } from './ui/atoms/Tabs';
|
|
60
66
|
export { Tag, type TagProps } from './ui/atoms/Tag';
|
|
61
67
|
export { Text, type TextProps } from './ui/atoms/Text';
|
|
62
|
-
export { Tooltip, type TooltipProps, type TooltipRefProps } from './ui/atoms/Tooltip';
|
|
63
|
-
export { ActionButtons, type ActionButtonsProps } from './ui/composite/ActionButtons';
|
|
68
|
+
export { Tooltip, type TooltipProps, type TooltipRefProps, } from './ui/atoms/Tooltip';
|
|
69
|
+
export { ActionButtons, type ActionButtonsProps, } from './ui/composite/ActionButtons';
|
|
64
70
|
export { Address, type AddressProps } from './ui/composite/Address';
|
|
65
71
|
export { CardDialog, type CardDialogProps } from './ui/composite/CardDialog';
|
|
66
|
-
export { Dropdown, DropdownDivider,
|
|
67
|
-
export { HomePageLayout, type HomePageLayoutProps } from './ui/composite/HomePageLayout';
|
|
72
|
+
export { Dropdown, DropdownDivider, type DropdownDividerProps, DropdownItem, type DropdownItemProps, type DropdownProps, DropdownSearch, type DropdownSearchProps, } from './ui/composite/Dropdown';
|
|
73
|
+
export { HomePageLayout, type HomePageLayoutProps, } from './ui/composite/HomePageLayout';
|
|
68
74
|
export { List, type ListProps } from './ui/composite/List';
|
|
69
75
|
export { ListDetails, type ListDetailsProps } from './ui/composite/ListDetails';
|
|
70
|
-
export { ListDetailsItem, type ListDetailsItemProps } from './ui/composite/ListDetailsItem';
|
|
76
|
+
export { ListDetailsItem, type ListDetailsItemProps, } from './ui/composite/ListDetailsItem';
|
|
71
77
|
export { ListItem, type ListItemProps } from './ui/composite/ListItem';
|
|
72
78
|
export { PageError, type PageErrorProps } from './ui/composite/PageError';
|
|
73
79
|
export { PageLayout, type PageLayoutProps } from './ui/composite/PageLayout';
|
|
74
80
|
export { PageSkeleton } from './ui/composite/PageSkeleton';
|
|
75
81
|
export { Report, type ReportProps } from './ui/composite/Report';
|
|
76
|
-
export { createRoute, createTypedRoute, GenericPageNotFound,
|
|
82
|
+
export { createRoute, createTypedRoute, GenericPageNotFound, type GetParams, LoadingPage, type PageProps, type Route, Routes, } from './ui/composite/Routes';
|
|
77
83
|
export { SearchBar, type SearchBarProps } from './ui/composite/SearchBar';
|
|
78
84
|
export { TableData, type TableDataProps } from './ui/composite/TableData';
|
|
79
|
-
export { Timeline, type TimelineEvent, type TimelineProps } from './ui/composite/Timeline';
|
|
80
|
-
export {
|
|
85
|
+
export { Timeline, type TimelineEvent, type TimelineProps, } from './ui/composite/Timeline';
|
|
86
|
+
export { ToastContainer, toast } from './ui/composite/Toast';
|
|
81
87
|
export { Toolbar, type ToolbarProps } from './ui/composite/Toolbar';
|
|
82
|
-
export { CodeEditor,
|
|
88
|
+
export { CodeEditor, type CodeEditorProps, HookedCodeEditor, type HookedCodeEditorProps, } from './ui/forms/CodeEditor';
|
|
83
89
|
export { HookedForm } from './ui/forms/Form';
|
|
84
|
-
export { HookedInput,
|
|
85
|
-
export { HookedInputCheckbox,
|
|
86
|
-
export { HookedInputCheckboxGroup,
|
|
87
|
-
export { formatCentsToCurrency, HookedInputCurrency,
|
|
88
|
-
export { InputCurrencyRange, type InputCurrencyRangeProps } from './ui/forms/InputCurrencyRange';
|
|
89
|
-
export { HookedInputDate,
|
|
90
|
-
export { HookedInputDateRange,
|
|
90
|
+
export { HookedInput, type HookedInputProps, Input, type InputProps, } from './ui/forms/Input';
|
|
91
|
+
export { HookedInputCheckbox, type HookedInputCheckboxProps, InputCheckbox, type InputCheckboxProps, } from './ui/forms/InputCheckbox';
|
|
92
|
+
export { HookedInputCheckboxGroup, type HookedInputCheckboxGroupProps, InputCheckboxGroup, type InputCheckboxGroupProps, } from './ui/forms/InputCheckboxGroup';
|
|
93
|
+
export { formatCentsToCurrency, HookedInputCurrency, type HookedInputCurrencyProps, InputCurrency, type InputCurrencyProps, } from './ui/forms/InputCurrency';
|
|
94
|
+
export { InputCurrencyRange, type InputCurrencyRangeProps, } from './ui/forms/InputCurrencyRange';
|
|
95
|
+
export { HookedInputDate, type HookedInputDateProps, InputDate, type InputDateProps, } from './ui/forms/InputDate';
|
|
96
|
+
export { HookedInputDateRange, type HookedInputDateRangeProps, InputDateRange, type InputDateRangeProps, } from './ui/forms/InputDateRange';
|
|
91
97
|
export { InputFeedback, type InputFeedbackProps } from './ui/forms/InputFeedback';
|
|
92
98
|
export { InputFile, type InputFileProps } from './ui/forms/InputFile';
|
|
93
99
|
export { InputJson, type InputJsonProps } from './ui/forms/InputJson';
|
|
94
|
-
export { HookedInputRadioGroup,
|
|
95
|
-
export { HookedInputResourceGroup,
|
|
96
|
-
export { flatSelectValues, getDefaultValueFromFlatten, HookedInputSelect,
|
|
97
|
-
export { HookedInputSimpleSelect,
|
|
98
|
-
export { HookedInputSpinner,
|
|
99
|
-
export { HookedInputSwitch,
|
|
100
|
-
export { HookedInputTextArea,
|
|
101
|
-
export { HookedInputToggleButton,
|
|
100
|
+
export { HookedInputRadioGroup, type HookedInputRadioGroupProps, InputRadioGroup, type InputRadioGroupProps, } from './ui/forms/InputRadioGroup';
|
|
101
|
+
export { HookedInputResourceGroup, type HookedInputResourceGroupProps, InputResourceGroup, type InputResourceGroupProps, useInputResourceGroupOverlay, } from './ui/forms/InputResourceGroup';
|
|
102
|
+
export { flatSelectValues, getDefaultValueFromFlatten, HookedInputSelect, type HookedInputSelectProps, InputSelect, type InputSelectProps, type InputSelectValue, isGroupedSelectValues, isMultiValueSelected, isSingleValueSelected, } from './ui/forms/InputSelect';
|
|
103
|
+
export { HookedInputSimpleSelect, type HookedInputSimpleSelectProps, InputSimpleSelect, type InputSimpleSelectProps, } from './ui/forms/InputSimpleSelect';
|
|
104
|
+
export { HookedInputSpinner, type HookedInputSpinnerProps, InputSpinner, type InputSpinnerProps, } from './ui/forms/InputSpinner';
|
|
105
|
+
export { HookedInputSwitch, type HookedInputSwitchProps, InputSwitch, type InputSwitchProps, } from './ui/forms/InputSwitch';
|
|
106
|
+
export { HookedInputTextArea, type HookedInputTextAreaProps, InputTextArea, type InputTextAreaProps, } from './ui/forms/InputTextArea';
|
|
107
|
+
export { HookedInputToggleButton, type HookedInputToggleButtonProps, InputToggleButton, type InputToggleButtonProps, } from './ui/forms/InputToggleButton';
|
|
102
108
|
export { Label, type LabelProps } from './ui/forms/Label';
|
|
103
109
|
export { Legend, type LegendProps } from './ui/forms/Legend';
|
|
104
|
-
export { HookedMarketWithCurrencySelector, type HookedMarketWithCurrencySelectorProps } from './ui/forms/MarketWithCurrencySelector';
|
|
105
|
-
export { HookedValidationApiError, HookedValidationError, setApiFormErrors, useValidationFeedback } from './ui/forms/ReactHookForm';
|
|
110
|
+
export { HookedMarketWithCurrencySelector, type HookedMarketWithCurrencySelectorProps, } from './ui/forms/MarketWithCurrencySelector';
|
|
111
|
+
export { HookedValidationApiError, HookedValidationError, setApiFormErrors, useValidationFeedback, } from './ui/forms/ReactHookForm';
|
|
106
112
|
export { RuleEngine, type RuleEngineProps } from './ui/forms/RuleEngine';
|
|
107
|
-
export { getResourceAddressFormFieldsSchema, ResourceAddress, ResourceAddressFormFields,
|
|
108
|
-
export { ResourceAttachments, type ResourceAttachmentsProps } from './ui/resources/ResourceAttachments';
|
|
109
|
-
export { ResourceDetails, type ResourceDetailsProps } from './ui/resources/ResourceDetails';
|
|
110
|
-
export { ResourceLineItems, type ResourceLineItemsProps } from './ui/resources/ResourceLineItems';
|
|
111
|
-
export { ResourceListItem, type ResourceListItemProps } from './ui/resources/ResourceListItem';
|
|
112
|
-
export { ResourceMetadata, type ResourceMetadataProps } from './ui/resources/ResourceMetadata';
|
|
113
|
-
export { ResourceOrderTimeline, type ResourceOrderTimelineProps } from './ui/resources/ResourceOrderTimeline';
|
|
114
|
-
export { getPaymentMethodLogoSrc, ResourcePaymentMethod, type ResourcePaymentMethodProps } from './ui/resources/ResourcePaymentMethod';
|
|
115
|
-
export { ResourceShipmentParcels, type ResourceShipmentParcelsProps } from './ui/resources/ResourceShipmentParcels';
|
|
116
|
-
export { ResourceTags, type ResourceTagsProps } from './ui/resources/ResourceTags';
|
|
117
|
-
export {
|
|
118
|
-
export {
|
|
119
|
-
export { getCustomerDisplayStatus, getCustomerStatusName } from './dictionaries/customers';
|
|
120
|
-
export { getOrderDisplayStatus, getOrderFulfillmentStatusName, getOrderPaymentStatusName, getOrderStatusName, getOrderTransactionName } from './dictionaries/orders';
|
|
121
|
-
export { getPromotionDisplayStatus } from './dictionaries/promotions';
|
|
122
|
-
export { getReturnDisplayStatus, getReturnStatusName } from './dictionaries/returns';
|
|
123
|
-
export { getShipmentDisplayStatus, getShipmentStatusName } from './dictionaries/shipments';
|
|
124
|
-
export { getStockTransferDisplayStatus, getStockTransferStatusName } from './dictionaries/stockTransfers';
|
|
113
|
+
export { getResourceAddressFormFieldsSchema, ResourceAddress, ResourceAddressFormFields, type ResourceAddressFormFieldsProps, type ResourceAddressProps, useResourceAddressOverlay, } from './ui/resources/ResourceAddress';
|
|
114
|
+
export { ResourceAttachments, type ResourceAttachmentsProps, } from './ui/resources/ResourceAttachments';
|
|
115
|
+
export { ResourceDetails, type ResourceDetailsProps, } from './ui/resources/ResourceDetails';
|
|
116
|
+
export { ResourceLineItems, type ResourceLineItemsProps, } from './ui/resources/ResourceLineItems';
|
|
117
|
+
export { ResourceListItem, type ResourceListItemProps, } from './ui/resources/ResourceListItem';
|
|
118
|
+
export { ResourceMetadata, type ResourceMetadataProps, } from './ui/resources/ResourceMetadata';
|
|
119
|
+
export { ResourceOrderTimeline, type ResourceOrderTimelineProps, } from './ui/resources/ResourceOrderTimeline';
|
|
120
|
+
export { getPaymentMethodLogoSrc, ResourcePaymentMethod, type ResourcePaymentMethodProps, } from './ui/resources/ResourcePaymentMethod';
|
|
121
|
+
export { ResourceShipmentParcels, type ResourceShipmentParcelsProps, } from './ui/resources/ResourceShipmentParcels';
|
|
122
|
+
export { ResourceTags, type ResourceTagsProps, } from './ui/resources/ResourceTags';
|
|
123
|
+
export { type FiltersInstructions, useResourceFilters, } from './ui/resources/useResourceFilters';
|
|
124
|
+
export { type ResourceListItemTemplateProps, type ResourceListProps, type UseResourceListConfig, useResourceList, } from './ui/resources/useResourceList';
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { bj as s, bX as t, bY as o, bk as r, bl as c, bm as n, bn as u, B as i, bo as d, bp as l, bq as p, bZ as b, br as g, C as m, bs as S, bt as I, b4 as k, D as T, s as D, l as R, b_ as y, bu as C, b8 as h, b9 as A, ca as P, bv as H, bw as F, b$ as f, cj as v, ck as B, cl as L, cm as O, co as E, cr as N, cu as G, cv as M, cz as w, cB as V, cG as x, cI as W, cK as J, cM as U, cO as q, cQ as Y, cU as j, cV as z, cW as K, bx as Q, bb as X, n as Z, f as _, cn as $, cp as aa, cs as ea, ct as sa, r as ta, q as oa, cw as ra, cx as ca, cy as na, cA as ua, cC as ia, h as da, cJ as la, cL as pa, cN as ba, cP as ga, cR as ma, cS as Sa, cT as Ia, c0 as ka, c1 as Ta, c2 as Da, c3 as Ra, cb as ya, bh as Ca, c4 as ha, by as Aa, c5 as Pa, c6 as Ha, bz as Fa, bA as fa, bB as va, bC as Ba, c7 as La, c$ as Oa, d0 as Ea, d2 as Na, d3 as Ga, d4 as Ma, d5 as wa, d6 as Va, d7 as xa, d9 as Wa, da as Ja, db as Ua, cc as qa, cZ as Ya, bD as ja, cd as za, bE as Ka, bF as Qa, bG as Xa, bH as Za, bJ as _a, bK as $a, bL as ae, bM as ee, bN as se, bS as te, bO as oe, ce as re, bT as ce, bU as ne, bP as ue, bV as ie, bQ as de, cf as le, cg as pe, bi as be, ci as ge, bW as me, bR as Se, bd as Ie, aK as ke, b7 as Te, c8 as De, c9 as Re, au as ye, av as Ce, aG as he, bg as Ae, cE as Pe, cq as He, aw as Fe, ax as fe, ay as ve, aL as Be, aM as Le, aO as Oe, ac as Ee, ad as Ne, cF as Ge, az as Me, aA as we, aB as Ve, ae as xe, af as We, ag as Je, ah as Ue, ai as qe, aP as Ye, aQ as je, d8 as ze, aj as Ke, c_ as Qe, aN as Xe, ak as Ze, al as _e, am as $e, aR as as, aS as es, an as ss, ao as ts, ap as os, aW as rs, aX as cs, aq as ns, aT as us, aU as is, bc as ds, as as ls, a8 as ps, cH as bs, aI as gs, aJ as ms, p as Ss, k as Is, aC as ks, aH as Ts, ar as Ds, aV as Rs, at as ys, aD as Cs, cX as hs, aE as As, be as Ps, aF as Hs, ch as Fs, aY as fs, aZ as vs, b5 as Bs, b6 as Ls, a_ as Os, a$ as Es, b0 as Ns, cD as Gs, b1 as Ms, b2 as ws, b3 as Vs, d1 as xs, dc as Ws, dd as Js, ba as Us, u as qs, bf as Ys, cY as js, bI as zs } from "./main-BANV9Udl.js";
|
|
3
3
|
export {
|
|
4
4
|
s as A,
|
|
5
5
|
t as ActionButtons,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as T, t as D, m as p, a as N } from "./main-BANV9Udl.js";
|
|
3
3
|
function W(t, e) {
|
|
4
|
-
const n = () =>
|
|
4
|
+
const n = () => T(e?.in, NaN), a = I(t);
|
|
5
5
|
let s;
|
|
6
6
|
if (a.date) {
|
|
7
7
|
const i = x(a.date, 2);
|
|
8
8
|
s = Y(i.restDateString, i.year);
|
|
9
9
|
}
|
|
10
10
|
if (!s || isNaN(+s)) return n();
|
|
11
|
-
const
|
|
12
|
-
let
|
|
13
|
-
if (a.time && (
|
|
11
|
+
const u = +s;
|
|
12
|
+
let o = 0, c;
|
|
13
|
+
if (a.time && (o = w(a.time), isNaN(o)))
|
|
14
14
|
return n();
|
|
15
15
|
if (a.timezone) {
|
|
16
|
-
if (
|
|
16
|
+
if (c = y(a.timezone), isNaN(c)) return n();
|
|
17
17
|
} else {
|
|
18
|
-
const i = new Date(
|
|
18
|
+
const i = new Date(u + o), d = D(0, e?.in);
|
|
19
19
|
return d.setFullYear(
|
|
20
20
|
i.getUTCFullYear(),
|
|
21
21
|
i.getUTCMonth(),
|
|
@@ -27,7 +27,7 @@ function W(t, e) {
|
|
|
27
27
|
i.getUTCMilliseconds()
|
|
28
28
|
), d;
|
|
29
29
|
}
|
|
30
|
-
return D(
|
|
30
|
+
return D(u + o + c, e?.in);
|
|
31
31
|
}
|
|
32
32
|
const f = {
|
|
33
33
|
dateTimeDelimiter: /[T ]/,
|
|
@@ -63,22 +63,22 @@ function Y(t, e) {
|
|
|
63
63
|
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
64
64
|
const n = t.match(U);
|
|
65
65
|
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
66
|
-
const r = !!n[4], a =
|
|
66
|
+
const r = !!n[4], a = l(n[1]), s = l(n[2]) - 1, u = l(n[3]), o = l(n[4]), c = l(n[5]) - 1;
|
|
67
67
|
if (r)
|
|
68
|
-
return Z(e,
|
|
68
|
+
return Z(e, o, c) ? z(e, o, c) : /* @__PURE__ */ new Date(NaN);
|
|
69
69
|
{
|
|
70
70
|
const i = /* @__PURE__ */ new Date(0);
|
|
71
|
-
return !M(e, s,
|
|
71
|
+
return !M(e, s, u) || !O(e, a) ? /* @__PURE__ */ new Date(NaN) : (i.setUTCFullYear(e, s, Math.max(a, u)), i);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function l(t) {
|
|
75
75
|
return t ? parseInt(t) : 1;
|
|
76
76
|
}
|
|
77
77
|
function w(t) {
|
|
78
78
|
const e = t.match(h);
|
|
79
79
|
if (!e) return NaN;
|
|
80
80
|
const n = m(e[1]), r = m(e[2]), a = m(e[3]);
|
|
81
|
-
return k(n, r, a) ? n *
|
|
81
|
+
return k(n, r, a) ? n * p + r * N + a * 1e3 : NaN;
|
|
82
82
|
}
|
|
83
83
|
function m(t) {
|
|
84
84
|
return t && parseFloat(t.replace(",", ".")) || 0;
|
|
@@ -88,7 +88,7 @@ function y(t) {
|
|
|
88
88
|
const e = t.match(C);
|
|
89
89
|
if (!e) return 0;
|
|
90
90
|
const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), a = e[3] && parseInt(e[3]) || 0;
|
|
91
|
-
return R(r, a) ? n * (r *
|
|
91
|
+
return R(r, a) ? n * (r * p + a * N) : NaN;
|
|
92
92
|
}
|
|
93
93
|
function z(t, e, n) {
|
|
94
94
|
const r = /* @__PURE__ */ new Date(0);
|
|
@@ -97,14 +97,14 @@ function z(t, e, n) {
|
|
|
97
97
|
return r.setUTCDate(r.getUTCDate() + s), r;
|
|
98
98
|
}
|
|
99
99
|
const F = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
100
|
-
function
|
|
100
|
+
function g(t) {
|
|
101
101
|
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
102
102
|
}
|
|
103
103
|
function M(t, e, n) {
|
|
104
|
-
return e >= 0 && e <= 11 && n >= 1 && n <= (F[e] || (
|
|
104
|
+
return e >= 0 && e <= 11 && n >= 1 && n <= (F[e] || (g(t) ? 29 : 28));
|
|
105
105
|
}
|
|
106
106
|
function O(t, e) {
|
|
107
|
-
return e >= 1 && e <= (
|
|
107
|
+
return e >= 1 && e <= (g(t) ? 366 : 365);
|
|
108
108
|
}
|
|
109
109
|
function Z(t, e, n) {
|
|
110
110
|
return e >= 1 && e <= 53 && n >= 0 && n <= 6;
|
|
@@ -13,7 +13,7 @@ interface CoreSdkProviderProps {
|
|
|
13
13
|
children: ((props: CoreSdkProviderValue) => ReactNode) | ReactNode;
|
|
14
14
|
}
|
|
15
15
|
export declare const useCoreSdkProvider: () => CoreSdkProviderValue;
|
|
16
|
-
export declare function CoreSdkProvider({ children }: CoreSdkProviderProps): JSX.Element | null;
|
|
16
|
+
export declare function CoreSdkProvider({ children, }: CoreSdkProviderProps): JSX.Element | null;
|
|
17
17
|
export declare namespace CoreSdkProvider {
|
|
18
18
|
var displayName: string;
|
|
19
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommerceLayerClient } from '@commercelayer/sdk';
|
|
2
|
-
export declare function makeSdkClient({ accessToken, organization, domain, onInvalidToken }: {
|
|
2
|
+
export declare function makeSdkClient({ accessToken, organization, domain, onInvalidToken, }: {
|
|
3
3
|
accessToken: string;
|
|
4
4
|
organization: string;
|
|
5
5
|
domain?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResourceEndpoint } from '../../helpers/resources';
|
|
2
1
|
import { CommerceLayerClient } from '@commercelayer/sdk';
|
|
3
2
|
import { Fetcher, SWRConfiguration, SWRResponse } from 'swr';
|
|
4
3
|
import { ConditionalKeys } from 'type-fest';
|
|
4
|
+
import { ResourceEndpoint } from '../../helpers/resources';
|
|
5
5
|
type GenericMethod = (...args: any) => Promise<any>;
|
|
6
6
|
type ForceToBeMethod<Method> = Method extends GenericMethod ? Method : GenericMethod;
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataLayerArgs } from 'react-gtm-module';
|
|
2
2
|
interface GTMProviderValue {
|
|
3
|
-
push: (data: DataLayerArgs[
|
|
3
|
+
push: (data: DataLayerArgs["dataLayer"], customDataLayerName?: DataLayerArgs["dataLayerName"]) => void;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Hook that is aimed to expose the provider context containing the `tagManager` object and its methods.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { TokenProviderProps } from './TokenProvider';
|
|
3
|
-
export declare function MockTokenProvider({ children, isInDashboard, onAppClose }: TokenProviderProps): JSX.Element;
|
|
3
|
+
export declare function MockTokenProvider({ children, isInDashboard, onAppClose, }: TokenProviderProps): JSX.Element;
|
|
4
4
|
export declare namespace MockTokenProvider {
|
|
5
5
|
var displayName: string;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TokenProviderTokenApplicationKind } from '.';
|
|
2
1
|
import { ListableResourceType } from '@commercelayer/sdk';
|
|
3
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { TokenProviderTokenApplicationKind } from '.';
|
|
4
4
|
import { TokenProviderAllowedAppSlug, TokenProviderAuthSettings, TokenProviderAuthUser, TokenProviderClAppSlug, TokenProviderExtras, TokenProviderRoleActions } from './types';
|
|
5
5
|
export interface TokenProviderValue {
|
|
6
6
|
settings: TokenProviderAuthSettings;
|
|
@@ -4,7 +4,7 @@ export declare const getAccessTokenFromUrl: () => string | null;
|
|
|
4
4
|
* Try to get the current mode from the access token (also if expired) or from the URL params.
|
|
5
5
|
* If no mode is found, return 'live' as optimistic default.
|
|
6
6
|
*/
|
|
7
|
-
export declare const getCurrentMode: ({ accessToken }: {
|
|
7
|
+
export declare const getCurrentMode: ({ accessToken, }: {
|
|
8
8
|
accessToken?: string | null;
|
|
9
9
|
}) => Mode;
|
|
10
10
|
export declare const removeAuthParamsFromUrl: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { encodeExtras } from './extras';
|
|
2
2
|
export { MetaTags } from './MetaTags';
|
|
3
3
|
export { TokenProvider, useTokenProvider } from './TokenProvider';
|
|
4
|
-
export type { TokenProviderAllowedApp, TokenProviderAllowedAppKind, TokenProviderAllowedAppSlug, TokenProviderClAppSlug, TokenProviderExtras, TokenProviderPermissionItem, TokenProviderRoleActions, TokenProviderRolePermissions, TokenProviderTokenApplicationKind } from './types';
|
|
4
|
+
export type { TokenProviderAllowedApp, TokenProviderAllowedAppKind, TokenProviderAllowedAppSlug, TokenProviderClAppSlug, TokenProviderExtras, TokenProviderPermissionItem, TokenProviderRoleActions, TokenProviderRolePermissions, TokenProviderTokenApplicationKind, } from './types';
|
|
@@ -11,9 +11,9 @@ interface TokenProviderInternalState {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const initialTokenProviderState: TokenProviderInternalState;
|
|
13
13
|
type Action = {
|
|
14
|
-
type:
|
|
14
|
+
type: "invalidAuth";
|
|
15
15
|
} | {
|
|
16
|
-
type:
|
|
16
|
+
type: "validToken";
|
|
17
17
|
payload: {
|
|
18
18
|
settings: TokenProviderAuthSettings;
|
|
19
19
|
user: TokenProviderAuthUser | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TokenProviderAllowedAppSlug } from './types';
|
|
2
|
-
type ItemType =
|
|
3
|
-
export declare function makeStorageKey({ appSlug, organizationSlug, itemType }: {
|
|
2
|
+
type ItemType = "accessToken" | "extras";
|
|
3
|
+
export declare function makeStorageKey({ appSlug, organizationSlug, itemType, }: {
|
|
4
4
|
appSlug: TokenProviderAllowedAppSlug;
|
|
5
5
|
organizationSlug: string;
|
|
6
6
|
itemType: ItemType;
|
|
7
7
|
}): string;
|
|
8
|
-
export declare function getPersistentJWT({ appSlug, organizationSlug, itemType }: {
|
|
8
|
+
export declare function getPersistentJWT({ appSlug, organizationSlug, itemType, }: {
|
|
9
9
|
/** The app for which to get the token. */
|
|
10
10
|
appSlug: TokenProviderAllowedAppSlug;
|
|
11
11
|
/** The organization slug for the token we want to retrieve. */
|
|
@@ -13,7 +13,7 @@ export declare function getPersistentJWT({ appSlug, organizationSlug, itemType }
|
|
|
13
13
|
/** The JWT item type you want to retrieve. */
|
|
14
14
|
itemType: ItemType;
|
|
15
15
|
}): string | null;
|
|
16
|
-
export declare function savePersistentJWT({ appSlug, jwt, organizationSlug, itemType }: {
|
|
16
|
+
export declare function savePersistentJWT({ appSlug, jwt, organizationSlug, itemType, }: {
|
|
17
17
|
/** The app for which to get the token. */
|
|
18
18
|
appSlug: TokenProviderAllowedAppSlug;
|
|
19
19
|
/** The token to save. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ParsedScopes } from './getInfoFromJwt';
|
|
2
1
|
import { ListableResourceType } from '@commercelayer/sdk';
|
|
3
|
-
|
|
2
|
+
import { ParsedScopes } from './getInfoFromJwt';
|
|
3
|
+
export type TokenProviderClAppSlug = "bundles" | "customers" | "exports" | "gift_cards" | "imports" | "inventory" | "orders" | "price_lists" | "promotions" | "returns" | "shipments" | "sku_lists" | "skus" | "stock_transfers" | "subscriptions" | "tags" | "webhooks";
|
|
4
4
|
/**
|
|
5
5
|
* TokenProviderAllowedApp is a type that contains all the possible kinds of the app that you can create inside the dashboard.
|
|
6
6
|
* As a convention Commerce Layer official apps have a slug that matches the kind of the app.
|
|
7
7
|
*/
|
|
8
|
-
export type TokenProviderAllowedAppKind = TokenProviderClAppSlug |
|
|
8
|
+
export type TokenProviderAllowedAppKind = TokenProviderClAppSlug | "generic";
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated Use `TokenProviderAllowedAppKind` instead.
|
|
11
11
|
*/
|
|
@@ -22,12 +22,12 @@ export type TokenProviderAllowedAppSlug = TokenProviderClAppSlug | (string & {})
|
|
|
22
22
|
* - a particular feature in the dashboard (eg. `resources`, `links`)
|
|
23
23
|
* - an app with its dedicated set of permissions (eg. `order`, `customers`, etc...)
|
|
24
24
|
*/
|
|
25
|
-
export type TokenProviderTokenApplicationKind =
|
|
26
|
-
export type TokenProviderRoleActions =
|
|
25
|
+
export type TokenProviderTokenApplicationKind = "integration" | "sales_channel" | "webapp" | "resources" | "links" | TokenProviderAllowedAppKind;
|
|
26
|
+
export type TokenProviderRoleActions = "create" | "destroy" | "read" | "update";
|
|
27
27
|
export type TokenProviderPermissionItem = Record<TokenProviderRoleActions, boolean>;
|
|
28
|
-
export type TokenProviderRolePermissions = Partial<Record<ListableResourceType |
|
|
28
|
+
export type TokenProviderRolePermissions = Partial<Record<ListableResourceType | "organizations", TokenProviderPermissionItem>>;
|
|
29
29
|
interface CoreApiOwnerUser {
|
|
30
|
-
type:
|
|
30
|
+
type: "User";
|
|
31
31
|
id: string;
|
|
32
32
|
first_name: string;
|
|
33
33
|
last_name: string;
|
|
@@ -36,7 +36,7 @@ interface CoreApiOwnerUser {
|
|
|
36
36
|
time_zone: string;
|
|
37
37
|
}
|
|
38
38
|
interface CoreApiOwnerCustomer {
|
|
39
|
-
type:
|
|
39
|
+
type: "Customer";
|
|
40
40
|
id: string;
|
|
41
41
|
email: string;
|
|
42
42
|
}
|
|
@@ -95,7 +95,7 @@ export interface TokenProviderTokenInfo {
|
|
|
95
95
|
core: boolean;
|
|
96
96
|
}>;
|
|
97
97
|
}
|
|
98
|
-
export type Mode =
|
|
98
|
+
export type Mode = "live" | "test";
|
|
99
99
|
export interface TokenProviderAuthSettings {
|
|
100
100
|
/**
|
|
101
101
|
* Access token that is being used to authenticate Core API requests.
|
|
@@ -148,7 +148,7 @@ export interface TokenProviderAuthUser {
|
|
|
148
148
|
displayName: string;
|
|
149
149
|
fullName: string;
|
|
150
150
|
timezone: string;
|
|
151
|
-
locale:
|
|
151
|
+
locale: "en-US" | "it-IT";
|
|
152
152
|
}
|
|
153
153
|
export interface TokenProviderExtras {
|
|
154
154
|
/** List of sales channel to be used inside the app. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TokenProviderTokenApplicationKind } from '.';
|
|
2
2
|
import { ParsedScopes } from './getInfoFromJwt';
|
|
3
3
|
import { Mode, TokenProviderAuthUser, TokenProviderClAppSlug, TokenProviderRolePermissions } from './types';
|
|
4
|
-
export declare function isTokenExpired({ accessToken, compareTo }: {
|
|
4
|
+
export declare function isTokenExpired({ accessToken, compareTo, }: {
|
|
5
5
|
accessToken: string;
|
|
6
6
|
compareTo: Date;
|
|
7
7
|
}): boolean;
|
|
@@ -18,7 +18,7 @@ interface ValidToken {
|
|
|
18
18
|
interface InvalidToken {
|
|
19
19
|
isValidToken: false;
|
|
20
20
|
}
|
|
21
|
-
export declare function isValidTokenForCurrentApp({ accessToken, kind, isProduction, currentMode, organizationSlug }: {
|
|
21
|
+
export declare function isValidTokenForCurrentApp({ accessToken, kind, isProduction, currentMode, organizationSlug, }: {
|
|
22
22
|
accessToken: string;
|
|
23
23
|
kind: TokenProviderTokenApplicationKind;
|
|
24
24
|
isProduction: boolean;
|
|
@@ -19,7 +19,7 @@ declare global {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
export interface ClAppProps extends Partial<Omit<TokenProviderProps,
|
|
22
|
+
export interface ClAppProps extends Partial<Omit<TokenProviderProps, "appSlug" | "children">> {
|
|
23
23
|
/**
|
|
24
24
|
* Base path for internal routing.
|
|
25
25
|
* Example: `my-app` if you want to serve the app at `https://my-domain.com/my-app/`.
|