@shipengine/elements 1.6.0 → 1.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.
- package/index.cjs +1286 -1130
- package/index.js +1283 -1130
- package/package.json +1 -1
- package/src/components/collapsible-panel/collapsible-panel.d.ts +6 -1
- package/src/components/collapsible-panel/collapsible-panel.styles.d.ts +1 -1
- package/src/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
- package/src/components/templates/address-form/address-schema.d.ts +2 -0
- package/src/components/templates/index.d.ts +1 -1
- package/src/components/templates/rate-form/rate-form.d.ts +2 -1
- package/src/components/templates/wallet-form/wallet-schema.d.ts +46 -2
- package/src/elements/external-carriers/external-carriers.d.ts +7 -5
- package/src/elements/index.d.ts +2 -1
- package/src/elements/label-layout/label-layout-element.d.ts +7 -1
- package/src/elements/labels-grid/labels-grid.d.ts +7 -1
- package/src/elements/manage-funding/manage-funding-element.d.ts +7 -1
- package/src/elements/manage-warehouses/manage-warehouses.d.ts +10 -44
- package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +7 -1
- package/src/elements/purchase-label/purchase-label.d.ts +11 -5
- package/src/elements/shipengine-carriers/index.d.ts +1 -0
- package/src/elements/{list-carriers/list-carriers.d.ts → shipengine-carriers/shipengine-carriers.d.ts} +46 -37
- package/src/elements/shipments-grid/shipments-grid.d.ts +7 -1
- package/src/elements/theme-creator/theme-creator.d.ts +7 -1
- package/src/elements/unit-settings/unit-settings-element.d.ts +7 -1
- package/src/elements/view-shipment/view-shipment.d.ts +17 -13
- package/src/elements/void-label/void-label.d.ts +16 -11
- package/src/elements/wallet-history/wallet-history-element.d.ts +7 -1
- package/src/features/index.d.ts +1 -1
- package/src/features/label-layout/label-layout.d.ts +6 -1
- package/src/features/label-layout/use-label-layout.d.ts +3 -3
- package/src/features/manage-warehouses/index.d.ts +1 -0
- package/src/features/manage-warehouses/manage-warehouses.d.ts +16 -1
- package/src/features/manage-warehouses/use-manage-warehouses.d.ts +15 -0
- package/src/features/shipengine-carriers/hooks/use-carrier-metadata.d.ts +13 -0
- package/src/features/shipengine-carriers/index.d.ts +1 -0
- package/src/features/shipengine-carriers/shipengine-carriers-row/index.d.ts +1 -0
- package/src/features/{list-carriers/list-carriers-row/list-carriers-row.d.ts → shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.d.ts} +2 -2
- package/src/features/shipengine-carriers/shipengine-carriers.d.ts +10 -0
- package/src/features/unit-settings/index.d.ts +1 -0
- package/src/features/unit-settings/unit-settings.d.ts +9 -1
- package/src/features/unit-settings/use-unit-settings.d.ts +10 -0
- package/src/locales/en/index.d.ts +7 -1
- package/src/types/carrier-metadata.d.ts +3 -0
- package/src/utilities/feature-flags.d.ts +5 -2
- package/src/workflows/account-settings/account-settings.d.ts +14 -11
- package/src/workflows/account-settings/use-get-panel-props.d.ts +7 -1
- package/src/workflows/connect-carrier/connect-carrier.d.ts +7 -1
- package/src/workflows/manage-wallet-workflow/index.d.ts +1 -0
- package/src/workflows/manage-wallet-workflow/manage-wallet-workflow.d.ts +828 -0
- package/src/workflows/manage-wallet-workflow/use-get-wallet-panel-props.d.ts +4 -0
- package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -2
- package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.d.ts +2 -1
- package/src/workflows/onboarding/onboarding.d.ts +11 -6
- package/src/elements/list-carriers/index.d.ts +0 -1
- package/src/features/list-carriers/hooks/use-carrier-metadata.d.ts +0 -10
- package/src/features/list-carriers/index.d.ts +0 -1
- package/src/features/list-carriers/list-carriers-row/index.d.ts +0 -1
- package/src/features/list-carriers/list-carriers.d.ts +0 -9
- /package/src/features/{list-carriers → shipengine-carriers}/hooks/index.d.ts +0 -0
- /package/src/features/{list-carriers → shipengine-carriers}/hooks/use-list-connected-carriers.d.ts +0 -0
- /package/src/features/{list-carriers/list-carriers-row/list-carriers-row.styles.d.ts → shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.styles.d.ts} +0 -0
- /package/src/features/{list-carriers/list-carriers.styles.d.ts → shipengine-carriers/shipengine-carriers.styles.d.ts} +0 -0
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { SE } from "@shipengine/alchemy";
|
|
2
|
+
export type UnitSettingsProps = {
|
|
3
|
+
accountSettings?: SE.AccountSettings;
|
|
4
|
+
getAccountSettingsErrors?: SE.CodedError[] | null;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
refreshAccountSettings: () => void;
|
|
7
|
+
updateAccountSettings: (payload: Partial<SE.AccountSettings>) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const UnitSettings: ({ accountSettings, getAccountSettingsErrors: errors, isLoading, refreshAccountSettings, updateAccountSettings, }: UnitSettingsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SE } from "@shipengine/alchemy";
|
|
2
|
+
export declare const useUnitSettings: () => {
|
|
3
|
+
accountSettings: SE.AccountSettings | undefined;
|
|
4
|
+
getAccountSettingsErrors: SE.CodedError[] | null;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
isUpdatingUnitSettings: boolean;
|
|
7
|
+
refreshAccountSettings: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<SE.AccountSettings, SE.CodedError[]>>;
|
|
8
|
+
updateAccountSettings: (newAccountSetting: Partial<SE.AccountSettings>) => Promise<void>;
|
|
9
|
+
updateUnitSettingsErrors: SE.CodedError[] | null;
|
|
10
|
+
};
|
|
@@ -78,6 +78,7 @@ declare const _default: {
|
|
|
78
78
|
setup: {
|
|
79
79
|
title: string;
|
|
80
80
|
subtitle: string;
|
|
81
|
+
hiddenTermsSubtitle: string;
|
|
81
82
|
descriptionTitle: string;
|
|
82
83
|
description: string;
|
|
83
84
|
};
|
|
@@ -207,6 +208,7 @@ declare const _default: {
|
|
|
207
208
|
needToAcknowledge: string;
|
|
208
209
|
};
|
|
209
210
|
rates: {
|
|
211
|
+
requestedShippingNotification: string;
|
|
210
212
|
uspsMediaMailAcknowledgement: string;
|
|
211
213
|
uspsFirstClassMailAcknowledgement_leof: string;
|
|
212
214
|
rateSavings: string;
|
|
@@ -289,6 +291,8 @@ declare const _default: {
|
|
|
289
291
|
aHR0cHM6Ly93d3cuc2hpcHN0YXRpb24uY29tL3Rlcm1zLXNlcnZpY2UtdW5pdGVkLWtpbmdkb20v: string;
|
|
290
292
|
"aHR0cHM6Ly93d3cuZHBkLmNvLnVrL3N0YW5kYXJkX3Rlcm1zX2FuZF9jb25kaXRpb25zLmpzcA==": string;
|
|
291
293
|
aHR0cHM6Ly93d3cuZ29nbG9iYWxwb3N0LmNvbS9jb25kaXRpb25z: string;
|
|
294
|
+
aHR0cHM6Ly93d3cucHVyb2xhdG9yLmNvbS9mci9tb2RhbGl0ZXMtZXQtY29uZGl0aW9ucy1kZS1zZXJ2aWNl: string;
|
|
295
|
+
aHR0cHM6Ly93d3cucHVyb2xhdG9yLmNvbS9lbi90ZXJtcy1hbmQtY29uZGl0aW9ucy1zZXJ2aWNl: string;
|
|
292
296
|
};
|
|
293
297
|
termsAndAgreementTitles: {
|
|
294
298
|
"WW9kZWwgRGlyZWN0IC0gVGVybXMgYW5kIENvbmRpdGlvbnMgKOKAnFRlcm1z4oCdKQ==": string;
|
|
@@ -296,6 +300,8 @@ declare const _default: {
|
|
|
296
300
|
"VGVybXMgb2YgU2VydmljZSBVbml0ZWQgS2luZ2RvbQ==": string;
|
|
297
301
|
RFBEIFN0YW5kYXJkIFRlcm1zIGFuZCBDb25kaXRpb25z: string;
|
|
298
302
|
"R2xvYmFsUG9zdCBUZXJtcyBhbmQgQ29uZGl0aW9ucw==": string;
|
|
303
|
+
"UHVyb2xhdG9yIFRlcm1zIGFuZCBDb25kaXRpb25zIG9mIFNlcnZpY2U=": string;
|
|
304
|
+
UHVyb2xhdG9yIE1vZGFsaXTDqXMgZXQgY29uZGl0aW9ucyBkZSBzZXJ2aWNl: string;
|
|
299
305
|
};
|
|
300
306
|
};
|
|
301
307
|
"manage-defaults": {
|
|
@@ -431,7 +437,7 @@ declare const _default: {
|
|
|
431
437
|
};
|
|
432
438
|
};
|
|
433
439
|
};
|
|
434
|
-
"
|
|
440
|
+
"shipengine-carriers": {
|
|
435
441
|
title: string;
|
|
436
442
|
headers: {
|
|
437
443
|
accountCarriers: string;
|
|
@@ -82,7 +82,7 @@ export declare const featureFlags: {
|
|
|
82
82
|
/**
|
|
83
83
|
* `enableFunding` enables the `funding` section of the rate form.
|
|
84
84
|
*/
|
|
85
|
-
readonly enableFunding:
|
|
85
|
+
readonly enableFunding: true;
|
|
86
86
|
/**
|
|
87
87
|
* `enableGlobalPostFiltering` enables the `global post filtering` on all rates fetched
|
|
88
88
|
* in the rates form.
|
|
@@ -161,7 +161,7 @@ export declare const featureFlags: {
|
|
|
161
161
|
* `enabledCarriers` is a list of all `carriers` that are enabled for use in ShipEngine
|
|
162
162
|
* Elements.
|
|
163
163
|
*/
|
|
164
|
-
readonly enabledCarriers: readonly ["
|
|
164
|
+
readonly enabledCarriers: readonly ["aramex_au_walleted", "canada_post_walleted", "canpar_walleted", "couriersplease_walleted", "dhl_express_walleted", "dpd_germany_walleted", "dpdwallet", "globalpost", "hermes", "purolator_walleted", "sendle_walleted", "stamps_com", "ups_walleted", "ups", "yodel_walleted"];
|
|
165
165
|
};
|
|
166
166
|
/**
|
|
167
167
|
* All global `presentation` related feature flags.
|
|
@@ -217,3 +217,6 @@ export declare const getFeatures: (...element: string[]) => any;
|
|
|
217
217
|
* @see {@link featureFlags | All available `Feature Flags`}
|
|
218
218
|
*/
|
|
219
219
|
export declare const useFeatures: (...element: string[]) => any;
|
|
220
|
+
export type FeatureObject = Record<string, unknown>;
|
|
221
|
+
export declare const isObject: (item: unknown) => item is FeatureObject;
|
|
222
|
+
export declare function deepMergeFeatures<T extends FeatureObject>(defaults: T, custom?: T): T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ShipEngineCarriersFeatures } from "../../features";
|
|
3
3
|
import { ConnectCarrier } from "../connect-carrier";
|
|
4
|
-
export type AccountSettingsFeatures =
|
|
4
|
+
export type AccountSettingsFeatures = ShipEngineCarriersFeatures & ConnectCarrier.ConnectCarrierFeatures;
|
|
5
5
|
/**
|
|
6
6
|
* # Account Settings Component Props
|
|
7
7
|
*
|
|
@@ -14,13 +14,8 @@ export type ComponentProps = {
|
|
|
14
14
|
* Feature flags controlling operation of various sub components.
|
|
15
15
|
*/
|
|
16
16
|
features?: AccountSettingsFeatures;
|
|
17
|
-
/**
|
|
18
|
-
* This callback function will be used to house the logic you wish to execute when the
|
|
19
|
-
* user saves new changes to their account settings.
|
|
20
|
-
*/
|
|
21
|
-
onSaveSettings: () => void;
|
|
22
17
|
};
|
|
23
|
-
export declare const Component: ({
|
|
18
|
+
export declare const Component: ({ features }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
19
|
/**
|
|
25
20
|
* # Registered Account Settings Element
|
|
26
21
|
*
|
|
@@ -40,7 +35,7 @@ export declare const Component: ({ onSaveSettings, features }: ComponentProps) =
|
|
|
40
35
|
* <br />
|
|
41
36
|
*
|
|
42
37
|
* @see {@link AccountSettings.ComponentProps | The **props** that can be passed into the `<AccountSettings.Element />` component}
|
|
43
|
-
* @see {@link
|
|
38
|
+
* @see {@link ManageWalletWorkflow.Element | The `<Manage-Wallet-Workflow />` component used to view connected carriers and manage funding}
|
|
44
39
|
* @see {@link ManageWarehouses.Component | The `<ManageWarehouses />` component used to add, update, or remove warehouses}
|
|
45
40
|
* @see {@link PaymentMethodSettings | The `<PaymentMethodSettings />` component used to manage payment methods}
|
|
46
41
|
* @see {@link ManageFunding | The `<ManageFunding />` component used to manage funding rules and add funds to a carrier account}
|
|
@@ -127,6 +122,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
127
122
|
setup: {
|
|
128
123
|
title: string;
|
|
129
124
|
subtitle: string;
|
|
125
|
+
hiddenTermsSubtitle: string;
|
|
130
126
|
descriptionTitle: string;
|
|
131
127
|
description: string;
|
|
132
128
|
};
|
|
@@ -199,7 +195,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
199
195
|
customsItemsRequired: string;
|
|
200
196
|
invalidAddress: string;
|
|
201
197
|
noRates: string;
|
|
202
|
-
salesOrderNotLoaded: string;
|
|
198
|
+
salesOrderNotLoaded: string; /**
|
|
199
|
+
* Feature flags controlling operation of various sub components.
|
|
200
|
+
*/
|
|
203
201
|
unsupportedAddress: string;
|
|
204
202
|
saveRateFailedMessage: string;
|
|
205
203
|
saveRateFailedTitle: string;
|
|
@@ -256,6 +254,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
256
254
|
needToAcknowledge: string;
|
|
257
255
|
};
|
|
258
256
|
rates: {
|
|
257
|
+
requestedShippingNotification: string;
|
|
259
258
|
uspsMediaMailAcknowledgement: string;
|
|
260
259
|
uspsFirstClassMailAcknowledgement_leof: string;
|
|
261
260
|
rateSavings: string;
|
|
@@ -338,6 +337,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
338
337
|
aHR0cHM6Ly93d3cuc2hpcHN0YXRpb24uY29tL3Rlcm1zLXNlcnZpY2UtdW5pdGVkLWtpbmdkb20v: string;
|
|
339
338
|
"aHR0cHM6Ly93d3cuZHBkLmNvLnVrL3N0YW5kYXJkX3Rlcm1zX2FuZF9jb25kaXRpb25zLmpzcA==": string;
|
|
340
339
|
aHR0cHM6Ly93d3cuZ29nbG9iYWxwb3N0LmNvbS9jb25kaXRpb25z: string;
|
|
340
|
+
aHR0cHM6Ly93d3cucHVyb2xhdG9yLmNvbS9mci9tb2RhbGl0ZXMtZXQtY29uZGl0aW9ucy1kZS1zZXJ2aWNl: string;
|
|
341
|
+
aHR0cHM6Ly93d3cucHVyb2xhdG9yLmNvbS9lbi90ZXJtcy1hbmQtY29uZGl0aW9ucy1zZXJ2aWNl: string;
|
|
341
342
|
};
|
|
342
343
|
termsAndAgreementTitles: {
|
|
343
344
|
"WW9kZWwgRGlyZWN0IC0gVGVybXMgYW5kIENvbmRpdGlvbnMgKOKAnFRlcm1z4oCdKQ==": string;
|
|
@@ -345,6 +346,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
345
346
|
"VGVybXMgb2YgU2VydmljZSBVbml0ZWQgS2luZ2RvbQ==": string;
|
|
346
347
|
RFBEIFN0YW5kYXJkIFRlcm1zIGFuZCBDb25kaXRpb25z: string;
|
|
347
348
|
"R2xvYmFsUG9zdCBUZXJtcyBhbmQgQ29uZGl0aW9ucw==": string;
|
|
349
|
+
"UHVyb2xhdG9yIFRlcm1zIGFuZCBDb25kaXRpb25zIG9mIFNlcnZpY2U=": string;
|
|
350
|
+
UHVyb2xhdG9yIE1vZGFsaXTDqXMgZXQgY29uZGl0aW9ucyBkZSBzZXJ2aWNl: string;
|
|
348
351
|
};
|
|
349
352
|
};
|
|
350
353
|
"manage-defaults": {
|
|
@@ -480,7 +483,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
480
483
|
};
|
|
481
484
|
};
|
|
482
485
|
};
|
|
483
|
-
"
|
|
486
|
+
"shipengine-carriers": {
|
|
484
487
|
title: string;
|
|
485
488
|
headers: {
|
|
486
489
|
accountCarriers: string;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { CollapsiblePanelProps } from "../../components";
|
|
2
|
+
import { UnitSettingsProps } from "../../features";
|
|
3
|
+
import { LabelLayoutSettingsProps } from "../../features/label-layout/label-layout";
|
|
4
|
+
import { ManageWarehousesProps } from "../../features/manage-warehouses/";
|
|
5
|
+
type SettingProps = LabelLayoutSettingsProps | UnitSettingsProps | ManageWarehousesProps;
|
|
6
|
+
export type SettingPropsIntersection = LabelLayoutSettingsProps & UnitSettingsProps & ManageWarehousesProps;
|
|
2
7
|
export declare const useGetPanelProps: () => {
|
|
3
|
-
getSettingPanelProps: (setting: string) => CollapsiblePanelProps;
|
|
8
|
+
getSettingPanelProps: (setting: string) => [panelProps?: CollapsiblePanelProps, settingProps?: SettingProps];
|
|
4
9
|
};
|
|
10
|
+
export {};
|
|
@@ -119,6 +119,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
119
119
|
setup: {
|
|
120
120
|
title: string;
|
|
121
121
|
subtitle: string;
|
|
122
|
+
hiddenTermsSubtitle: string;
|
|
122
123
|
descriptionTitle: string;
|
|
123
124
|
description: string;
|
|
124
125
|
};
|
|
@@ -248,6 +249,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
248
249
|
needToAcknowledge: string;
|
|
249
250
|
};
|
|
250
251
|
rates: {
|
|
252
|
+
requestedShippingNotification: string;
|
|
251
253
|
uspsMediaMailAcknowledgement: string;
|
|
252
254
|
uspsFirstClassMailAcknowledgement_leof: string;
|
|
253
255
|
rateSavings: string;
|
|
@@ -330,6 +332,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
330
332
|
aHR0cHM6Ly93d3cuc2hpcHN0YXRpb24uY29tL3Rlcm1zLXNlcnZpY2UtdW5pdGVkLWtpbmdkb20v: string;
|
|
331
333
|
"aHR0cHM6Ly93d3cuZHBkLmNvLnVrL3N0YW5kYXJkX3Rlcm1zX2FuZF9jb25kaXRpb25zLmpzcA==": string;
|
|
332
334
|
aHR0cHM6Ly93d3cuZ29nbG9iYWxwb3N0LmNvbS9jb25kaXRpb25z: string;
|
|
335
|
+
aHR0cHM6Ly93d3cucHVyb2xhdG9yLmNvbS9mci9tb2RhbGl0ZXMtZXQtY29uZGl0aW9ucy1kZS1zZXJ2aWNl: string;
|
|
336
|
+
aHR0cHM6Ly93d3cucHVyb2xhdG9yLmNvbS9lbi90ZXJtcy1hbmQtY29uZGl0aW9ucy1zZXJ2aWNl: string;
|
|
333
337
|
};
|
|
334
338
|
termsAndAgreementTitles: {
|
|
335
339
|
"WW9kZWwgRGlyZWN0IC0gVGVybXMgYW5kIENvbmRpdGlvbnMgKOKAnFRlcm1z4oCdKQ==": string;
|
|
@@ -337,6 +341,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
337
341
|
"VGVybXMgb2YgU2VydmljZSBVbml0ZWQgS2luZ2RvbQ==": string;
|
|
338
342
|
RFBEIFN0YW5kYXJkIFRlcm1zIGFuZCBDb25kaXRpb25z: string;
|
|
339
343
|
"R2xvYmFsUG9zdCBUZXJtcyBhbmQgQ29uZGl0aW9ucw==": string;
|
|
344
|
+
"UHVyb2xhdG9yIFRlcm1zIGFuZCBDb25kaXRpb25zIG9mIFNlcnZpY2U=": string;
|
|
345
|
+
UHVyb2xhdG9yIE1vZGFsaXTDqXMgZXQgY29uZGl0aW9ucyBkZSBzZXJ2aWNl: string;
|
|
340
346
|
};
|
|
341
347
|
};
|
|
342
348
|
"manage-defaults": {
|
|
@@ -472,7 +478,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
472
478
|
};
|
|
473
479
|
};
|
|
474
480
|
};
|
|
475
|
-
"
|
|
481
|
+
"shipengine-carriers": {
|
|
476
482
|
title: string;
|
|
477
483
|
headers: {
|
|
478
484
|
accountCarriers: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as ManageWalletWorkflow from "./manage-wallet-workflow";
|