@shipengine/elements 1.9.0 → 2.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/README.md +0 -4
- package/assertions-dfa95b4d.js +1 -0
- package/carrier-c2a5ed53.js +1 -0
- package/{carrier-logo-1b6c767e.js → carrier-logo-330e926f.js} +1 -1
- package/components.js +1 -1
- package/elements.js +1 -1
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/money-d4f3d7c3.js +1 -0
- package/package.json +7 -3
- package/schemas.js +1 -1
- package/{shipment-90d35708.js → shipment-150160e0.js} +1 -1
- package/src/components/add-funds-form/add-funds-form.d.ts +1 -1
- package/src/components/auto-funding-form/auto-funding-form.d.ts +1 -1
- package/src/components/carrier-balance/carrier-balance.d.ts +1 -1
- package/src/components/collapsible-panel/collapsible-panel.d.ts +1 -1
- package/src/components/display-term/display-term.d.ts +1 -1
- package/src/components/edit-billing-form/edit-billing-form.d.ts +1 -1
- package/src/components/field/money-input/money-input.d.ts +1 -1
- package/src/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
- package/src/components/field/rate-card/rate-card.d.ts +1 -1
- package/src/components/field/rate-select/rate-select.d.ts +1 -1
- package/src/components/fund-and-purchase/fund-and-purchase.d.ts +1 -1
- package/src/components/history/history-card/history-card.d.ts +1 -1
- package/src/components/items-breakdown/items-breakdown.d.ts +1 -1
- package/src/components/pager/pager.d.ts +1 -1
- package/src/components/rate-details/rate-details.d.ts +1 -1
- package/src/components/save-status/save-status.d.ts +1 -1
- package/src/components/service-points/service-points.d.ts +1 -1
- package/src/components/templates/address-display/address-display.d.ts +1 -1
- package/src/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
- package/src/components/templates/address-preference-select/address-preference-select.d.ts +1 -1
- package/src/components/templates/connect-external-carrier-form/connect-external-carrier-form.d.ts +12 -0
- package/src/components/templates/connect-external-carrier-form/index.d.ts +1 -0
- package/src/components/templates/index.d.ts +1 -1
- package/src/components/templates/label/label.d.ts +1 -1
- package/src/components/templates/product-form/product-form.d.ts +1 -1
- package/src/components/templates/products-display/products-display.d.ts +1 -1
- package/src/components/templates/rate-form/rate-form.d.ts +3 -4
- package/src/components/templates/shipment/shipment.d.ts +3 -11
- package/src/components/templates/shipment-form/shipment-form.d.ts +2 -9
- package/src/components/templates/shipment-form/shipment-schema.d.ts +1 -1
- package/src/components/templates/suspend-sales-order/suspend-sales-order.d.ts +1 -1
- package/src/components/templates/suspend-shipment/suspend-shipment.d.ts +1 -1
- package/src/components/templates/wallet-form/edit-wallet-address-form.d.ts +1 -1
- package/src/components/templates/wallet-form/wallet-form.d.ts +2 -4
- package/src/components/templates/wallet-form/wallet-schema.d.ts +1 -1
- package/src/components/wallet-card/wallet-card.d.ts +1 -1
- package/src/components/warehouse-form/warehouse-form.d.ts +1 -1
- package/src/create-element/create-element.d.ts +10 -0
- package/src/create-element/element/element.d.ts +16 -0
- package/src/create-element/element/hooks/index.d.ts +1 -0
- package/src/create-element/element/hooks/use-i18n.d.ts +12 -0
- package/src/create-element/element/index.d.ts +3 -0
- package/src/create-element/element/utils/get-emotion-cache.d.ts +2 -0
- package/src/create-element/element/utils/index.d.ts +1 -0
- package/src/create-element/error-boundary/error-boundary.d.ts +21 -0
- package/src/create-element/error-boundary/index.d.ts +1 -0
- package/src/create-element/index.d.ts +1 -0
- package/src/elements/index.d.ts +5 -4
- package/src/elements/label-layout/label-layout-element.d.ts +1 -1
- package/src/elements/labels-grid/labels-grid.d.ts +2 -2
- package/src/elements/manage-carriers/index.d.ts +1 -0
- package/src/elements/{shipengine-carriers/shipengine-carriers.d.ts → manage-carriers/manage-carriers.d.ts} +52 -46
- package/src/elements/manage-external-carriers/index.d.ts +1 -0
- package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +888 -0
- package/src/elements/manage-funding/manage-funding-element.d.ts +1 -1
- package/src/elements/manage-warehouses/manage-warehouses.d.ts +19 -2
- package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +1 -1
- package/src/elements/purchase-label/configure-shipment.d.ts +4 -27
- package/src/elements/purchase-label/hooks/use-address.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-configure-shipment.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-customs.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-import-sales-order.d.ts +2 -2
- package/src/elements/purchase-label/hooks/use-load-shipment.d.ts +3 -3
- package/src/elements/purchase-label/hooks/use-pending-shipment.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-presets.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-rates-form.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-rates-with-cache.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-request-preferred-rates.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-request-rates.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-shipment-form.d.ts +1 -1
- package/src/elements/purchase-label/purchase-label-by-sales-order.d.ts +1 -1
- package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +1 -1
- package/src/elements/purchase-label/purchase-label.d.ts +18 -41
- package/src/elements/shipment-summary/index.d.ts +1 -0
- package/src/elements/{view-shipment/view-shipment.d.ts → shipment-summary/shipment-summary.d.ts} +42 -59
- package/src/elements/shipments-grid/shipments-grid.d.ts +2 -2
- package/src/elements/theme-creator/theme-creator.d.ts +1 -1
- package/src/elements/transaction-history/index.d.ts +1 -0
- package/src/elements/{wallet-history/wallet-history-element.d.ts → transaction-history/transaction-history-element.d.ts} +1 -1
- package/src/elements/unit-settings/unit-settings-element.d.ts +1 -1
- package/src/elements/vat-settings/vat-settings-element.d.ts +1 -1
- package/src/elements/void-label/components/actions/actions.d.ts +1 -1
- package/src/elements/void-label/components/message/message.d.ts +1 -1
- package/src/elements/void-label/void-label.d.ts +33 -49
- package/src/elements-provider/elements-provider.d.ts +46 -0
- package/src/elements-provider/elements-test-provider.d.ts +3 -0
- package/src/elements-provider/hooks/index.d.ts +1 -0
- package/src/elements-provider/hooks/use-load-icons.d.ts +7 -0
- package/src/elements-provider/index.d.ts +1 -0
- package/src/factories/shipengine/address.d.ts +1 -1
- package/src/factories/shipengine/carrier.d.ts +1 -1
- package/src/factories/shipengine/index.d.ts +1 -1
- package/src/factories/shipengine/label.d.ts +1 -1
- package/src/factories/shipengine/money.d.ts +1 -1
- package/src/factories/shipengine/order-source.d.ts +1 -1
- package/src/factories/shipengine/package.d.ts +1 -1
- package/src/factories/shipengine/resource.d.ts +1 -1
- package/src/factories/shipengine/sales-order.d.ts +1 -1
- package/src/factories/shipengine/service-point.d.ts +1 -1
- package/src/factories/shipengine/service.d.ts +1 -1
- package/src/factories/shipengine/shipment.d.ts +1 -1
- package/src/factories/shipengine/{wallet-history.d.ts → transaction-history.d.ts} +1 -1
- package/src/factories/shipengine/warehouse.d.ts +1 -1
- package/src/factories/shipengine/weight.d.ts +1 -1
- package/src/features/index.d.ts +3 -3
- package/src/features/label-layout/label-layout.d.ts +1 -1
- package/src/features/label-layout/use-label-layout.d.ts +1 -1
- package/src/features/{shipengine-carriers → manage-carriers}/hooks/use-list-funding-source-carriers.d.ts +2 -2
- package/src/features/manage-carriers/index.d.ts +1 -0
- package/src/features/manage-carriers/manage-carriers-row/index.d.ts +1 -0
- package/src/features/{shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.d.ts → manage-carriers/manage-carriers-row/manage-carriers-row.d.ts} +3 -3
- package/src/features/manage-carriers/manage-carriers.d.ts +4 -0
- package/src/features/manage-external-carriers/index.d.ts +1 -0
- package/src/features/manage-external-carriers/manage-external-carriers.d.ts +4 -0
- package/src/features/manage-warehouses/manage-warehouses.d.ts +1 -1
- package/src/features/manage-warehouses/use-manage-warehouses.d.ts +9 -9
- package/src/features/manage-warehouses/warehouse-display/warehouse-display.d.ts +1 -1
- package/src/features/transaction-history/index.d.ts +1 -0
- package/src/features/transaction-history/transaction-history.d.ts +6 -0
- package/src/features/unit-settings/unit-settings.d.ts +1 -1
- package/src/features/unit-settings/use-unit-settings.d.ts +1 -1
- package/src/features/vat-settings/use-vat-settings.d.ts +5 -5
- package/src/hooks/here-map/init.d.ts +1 -1
- package/src/hooks/options/use-confirmation-options.d.ts +1 -1
- package/src/hooks/options/use-customs-contents-options.d.ts +1 -1
- package/src/hooks/options/use-customs-non-delivery-options.d.ts +1 -1
- package/src/hooks/options/use-insurance-provider-options.d.ts +1 -1
- package/src/hooks/options/use-package-options.d.ts +1 -1
- package/src/hooks/options/use-rate-options.d.ts +1 -1
- package/src/hooks/options/use-service-code-options.d.ts +1 -1
- package/src/hooks/options/use-service-points.d.ts +1 -1
- package/src/hooks/options/use-shipment-metadata.d.ts +1 -1
- package/src/hooks/options/use-shipping-presets-options.d.ts +1 -1
- package/src/hooks/options/use-warehouse-options.d.ts +1 -1
- package/src/hooks/use-address-validation.d.ts +1 -1
- package/src/hooks/use-get-or-create-shipment.d.ts +3 -3
- package/src/hooks/use-scrub-errors.d.ts +1 -1
- package/src/index.d.ts +1 -0
- package/src/locales/en/index.d.ts +1 -1
- package/src/mocks/carriers/handlers.d.ts +1 -1
- package/src/mocks/warehouses/handlers.d.ts +1 -1
- package/src/schemas/shipengine/money.d.ts +1 -1
- package/src/testing/test-utils.d.ts +7 -1
- package/src/themes/fallback.d.ts +3 -0
- package/src/themes/index.d.ts +4 -0
- package/src/types/carrier-metadata.d.ts +1 -1
- package/src/types/preferred-rates.d.ts +1 -1
- package/src/types/shipping-preset/shipping-preset.d.ts +1 -1
- package/src/utilities/error.d.ts +1 -1
- package/src/utilities/feature-flags/feature-flags.d.ts +18 -0
- package/src/utilities/feature-flags/index.d.ts +2 -0
- package/src/utilities/feature-flags/types.d.ts +141 -0
- package/src/utilities/money.d.ts +1 -1
- package/src/utilities/rates.d.ts +1 -1
- package/src/utilities/shipengine/address.d.ts +1 -1
- package/src/utilities/shipengine/carrier.d.ts +1 -1
- package/src/utilities/shipengine/dimensions.d.ts +1 -1
- package/src/utilities/shipengine/sales-order.d.ts +1 -1
- package/src/utilities/shipengine/shipment.d.ts +1 -1
- package/src/utilities/shipengine/warehouses.d.ts +1 -1
- package/src/utilities/shipengine/weight.d.ts +1 -1
- package/src/workflows/account-settings/account-settings.d.ts +7 -14
- package/src/workflows/{connect-carrier/connect-carrier.d.ts → carrier-services/carrier-services.d.ts} +35 -49
- package/src/workflows/carrier-services/index.d.ts +1 -0
- package/src/workflows/{manage-wallet-workflow/manage-wallet-workflow.d.ts → connect-external-carrier/connect-external-carrier.d.ts} +16 -21
- package/src/workflows/connect-external-carrier/index.d.ts +1 -0
- package/src/workflows/index.d.ts +3 -2
- package/src/workflows/label-workflow/index.d.ts +1 -0
- package/src/workflows/{purchase-label-workflow/purchase-label-workflow.d.ts → label-workflow/label-workflow.d.ts} +16 -34
- package/src/workflows/onboarding/components/carrier-recovery-form/carrier-recovery-form.d.ts +1 -1
- package/src/workflows/onboarding/components/funding-and-carrier-connection-step/funding-and-carrier-connection-step.d.ts +2 -4
- package/src/workflows/onboarding/components/funding-and-carrier-connection-step/use-funding-and-carrier-connection-step.d.ts +1 -1
- package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -9
- package/src/workflows/onboarding/components/ship-from-address-step/ship-from-address-step.d.ts +1 -1
- package/src/workflows/onboarding/components/ship-from-address-step/use-ship-from-address-step.d.ts +1 -1
- package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.d.ts +1 -1
- package/src/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.d.ts +1 -1
- package/src/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts +1 -1
- package/src/workflows/onboarding/onboarding.d.ts +22 -70
- package/story-notes-c714d2ed.js +1 -0
- package/{suspend-text-c8c7b6b6.js → suspend-text-cad3a977.js} +1 -1
- package/transaction-history-element-cbfe487c.js +1 -0
- package/{use-page-layout-93ffae78.js → use-page-layout-8cb5075f.js} +1 -1
- package/use-scrub-errors-9870a6f3.js +1 -0
- package/use-toggle-866d7938.js +1 -0
- package/use-unit-settings-a5bae16e.js +1 -0
- package/utilities.js +1 -1
- package/validation-528e7834.js +1 -0
- package/wallet-form-9e4bfaea.js +1 -0
- package/warehouse-form-da6a7ac5.js +34 -0
- package/{warehouses-dfcdce23.js → warehouses-a83188ab.js} +1 -1
- package/workflows.js +1 -1
- package/carrier-2abb4760.js +0 -1
- package/feature-flags-3e03717c.js +0 -1
- package/money-fbc4d0b3.js +0 -1
- package/payment-method-settings-element-595cc38d.js +0 -1
- package/src/components/templates/connect-carrier-form/connect-carrier-form.d.ts +0 -12
- package/src/components/templates/connect-carrier-form/index.d.ts +0 -1
- package/src/elements/external-carriers/external-carriers.d.ts +0 -941
- package/src/elements/external-carriers/index.d.ts +0 -1
- package/src/elements/shipengine-carriers/index.d.ts +0 -1
- package/src/elements/view-shipment/index.d.ts +0 -1
- package/src/elements/wallet-history/index.d.ts +0 -1
- package/src/features/external-carriers/external-carriers.d.ts +0 -11
- package/src/features/external-carriers/index.d.ts +0 -1
- package/src/features/shipengine-carriers/index.d.ts +0 -1
- package/src/features/shipengine-carriers/shipengine-carriers-row/index.d.ts +0 -1
- package/src/features/shipengine-carriers/shipengine-carriers.d.ts +0 -10
- package/src/features/wallet-history/index.d.ts +0 -1
- package/src/features/wallet-history/wallet-history.d.ts +0 -6
- package/src/hooks/use-elements.d.ts +0 -35
- package/src/utilities/feature-flags.d.ts +0 -232
- package/src/workflows/connect-carrier/index.d.ts +0 -1
- package/src/workflows/manage-wallet-workflow/index.d.ts +0 -1
- package/src/workflows/purchase-label-workflow/index.d.ts +0 -1
- package/story-notes-ce2d8cca.js +0 -1
- package/use-scrub-errors-2c4db406.js +0 -1
- package/use-toggle-838d2ebd.js +0 -1
- package/validation-b941a548.js +0 -1
- package/wallet-form-3981400b.js +0 -1
- package/wallet-history-5b34c856.js +0 -1
- package/warehouse-form-c0b3ea78.js +0 -34
- /package/src/components/templates/{connect-carrier-form/connect-carrier-form.styles.d.ts → connect-external-carrier-form/connect-external-carrier-form.styles.d.ts} +0 -0
- /package/src/features/{shipengine-carriers → manage-carriers}/hooks/index.d.ts +0 -0
- /package/src/features/{shipengine-carriers → manage-carriers}/hooks/use-carrier-metadata.d.ts +0 -0
- /package/src/features/{shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.styles.d.ts → manage-carriers/manage-carriers-row/manage-carriers-row.styles.d.ts} +0 -0
- /package/src/features/{shipengine-carriers/shipengine-carriers.styles.d.ts → manage-carriers/manage-carriers.styles.d.ts} +0 -0
- /package/src/features/{wallet-history/wallet-history.styles.d.ts → transaction-history/transaction-history.styles.d.ts} +0 -0
- /package/src/workflows/{manage-wallet-workflow → carrier-services}/use-get-wallet-panel-props.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ListServicePointsOptionAddress, ListServicePointsOptionAddressQuery, ListServicePointsOptionCoordinates, Rate, SE } from "@shipengine/
|
|
1
|
+
import { ListServicePointsOptionAddress, ListServicePointsOptionAddressQuery, ListServicePointsOptionCoordinates, Rate, SE } from "@shipengine/react-api";
|
|
2
2
|
export type ServicePointSearchQuery = ListServicePointsOptionAddress["address"] | ListServicePointsOptionAddressQuery["addressQuery"] | ListServicePointsOptionCoordinates;
|
|
3
3
|
export declare const useServicePoints: (rates?: Rate[], shipment?: SE.SalesOrderShipment) => {
|
|
4
4
|
fetchServicePoints: (searchQuery?: ServicePointSearchQuery) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SalesOrderShipment } from "@shipengine/
|
|
1
|
+
import { SalesOrderShipment } from "@shipengine/react-api";
|
|
2
2
|
export declare const useGetOrCreateShipment: (onShipmentUpdated: ((shipment: SalesOrderShipment) => void | Promise<void>) | undefined, shipmentId?: string) => {
|
|
3
|
-
errors: import("@shipengine/
|
|
3
|
+
errors: import("@shipengine/react-api").CodedError[] | undefined;
|
|
4
4
|
isLoading: boolean;
|
|
5
|
-
refetchShipment: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<SalesOrderShipment, import("@shipengine/
|
|
5
|
+
refetchShipment: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<SalesOrderShipment, import("@shipengine/react-api").CodedError[]>>;
|
|
6
6
|
shipment: SalesOrderShipment | undefined;
|
|
7
7
|
};
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepPartial } from "fishery";
|
|
2
|
-
import { SE } from "@shipengine/
|
|
2
|
+
import { SE } from "@shipengine/react-api";
|
|
3
3
|
export type CreateCarrierHandlersParams = {
|
|
4
4
|
get?: DeepPartial<SE.Carrier>;
|
|
5
5
|
list?: [count: number, listParams?: DeepPartial<SE.Carrier>];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepPartial } from "fishery";
|
|
2
|
-
import { SE } from "@shipengine/
|
|
2
|
+
import { SE } from "@shipengine/react-api";
|
|
3
3
|
export type CreateWarehouseHandlersParams = {
|
|
4
4
|
get?: DeepPartial<SE.Warehouse>;
|
|
5
5
|
list?: [count: number, listParams?: DeepPartial<SE.Warehouse>];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { prettyFormat as __ } from "@testing-library/dom/types/pretty-dom";
|
|
3
|
+
import { RenderOptions } from "@testing-library/react";
|
|
3
4
|
import { UserEvent } from "@testing-library/user-event/dist/types/setup/setup";
|
|
4
5
|
import { IconNames, Theme } from "@shipengine/giger-theme";
|
|
6
|
+
import { ElementsTestProviderProps } from "../elements-provider/elements-test-provider";
|
|
5
7
|
import server, { baseUrl } from "../mocks/server";
|
|
6
8
|
declare const theme: Theme;
|
|
7
9
|
declare const delayedFn: () => Promise<void>;
|
|
@@ -170,6 +172,9 @@ declare const customWithin: (element: HTMLElement) => {
|
|
|
170
172
|
export * from "@testing-library/react";
|
|
171
173
|
export { rest } from "msw";
|
|
172
174
|
export { baseUrl, customScreen as screen, customWithin as within, delayedFn, server, theme };
|
|
175
|
+
export declare const ContentWrapper: ({ children }: {
|
|
176
|
+
children: JSX.Element;
|
|
177
|
+
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
173
178
|
export declare const renderWithProviders: (component: any) => {
|
|
174
179
|
readonly user: UserEvent;
|
|
175
180
|
view: import("@testing-library/react").RenderResult<{
|
|
@@ -234,7 +239,7 @@ export declare const renderWithProviders: (component: any) => {
|
|
|
234
239
|
* This allows components to simulate usage in an Element via `decorators: [withAllProviders]`
|
|
235
240
|
**/
|
|
236
241
|
export declare const renderWithAllProviders: (component: any) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
237
|
-
export declare const
|
|
242
|
+
export declare const renderWithElements: (component: any, features?: ElementsTestProviderProps["features"]) => {
|
|
238
243
|
user: UserEvent;
|
|
239
244
|
container: HTMLElement;
|
|
240
245
|
baseElement: HTMLElement;
|
|
@@ -291,3 +296,4 @@ export declare const renderWithAlchemy: (component: any) => {
|
|
|
291
296
|
findByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
|
|
292
297
|
findAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
|
|
293
298
|
};
|
|
299
|
+
export declare const renderWithContent: (ui: React.ReactElement, options?: Omit<RenderOptions, "wrapper">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
package/src/utilities/error.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ElementsFeatureFlags } from "./types";
|
|
2
|
+
declare const defaultFeatureFlags: Required<ElementsFeatureFlags>;
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*
|
|
6
|
+
* # Feature Flags - featureFlagComponentNameLookup
|
|
7
|
+
*/
|
|
8
|
+
export declare const featureFlagComponentNameLookup: (componentName: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*
|
|
12
|
+
* # Feature Flags - getFeatures
|
|
13
|
+
*/
|
|
14
|
+
export declare const getDefaultFeatures: (elements: Array<keyof typeof defaultFeatureFlags>) => ElementsFeatureFlags[keyof typeof defaultFeatureFlags];
|
|
15
|
+
export type FeatureObject = Record<string, unknown>;
|
|
16
|
+
export declare const isObject: (item: unknown) => item is FeatureObject;
|
|
17
|
+
export declare function deepMergeFeatures<T extends FeatureObject>(defaults: T, custom?: T): T;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { CountryCode } from "../../constants";
|
|
2
|
+
export type EnabledExternalCarriers = ("apc" | "asendia" | "better_trucks" | "canpar" | "chronopost" | "couriers_please" | "courierpost" | "dpd" | "hermes_germany" | "intelliquick_delivery" | "lso" | "ontrac" | "seko" | "ups" | "yodel")[];
|
|
3
|
+
export type EnabledShipEngineCarriers = ("aramex_au_walleted" | "canada_post_walleted" | "canpar_walleted" | "couriersplease_walleted" | "sendle_walleted" | "dhl_express_walleted" | "dhl_express_worldwide" | "dpd_germany_walleted" | "dpdwallet" | "globalpost" | "hermes" | "purolator_walleted" | "stamps_com" | "ups_walleted" | "ups" | "yodel_walleted")[];
|
|
4
|
+
export type RateFormFeatures = {
|
|
5
|
+
/**
|
|
6
|
+
* Enables the `funding` section of the rate form.
|
|
7
|
+
*/
|
|
8
|
+
enableFunding?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Enables the `global post filtering` on all rates fetched in the rates form.
|
|
11
|
+
*/
|
|
12
|
+
enableGlobalPostFiltering?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Enables the Pick Up/Drop Off tabs UI in the Rate Form to separate rates with PUDO capability by type.
|
|
15
|
+
*/
|
|
16
|
+
enablePudoUI?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Enables the `label layout` section of the Purchase Label element.
|
|
19
|
+
*/
|
|
20
|
+
labelLayout?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Enables showing the `carrier nickname` when rates are fetched.
|
|
23
|
+
*/
|
|
24
|
+
nicknameRate?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Enables the `DHL terms acknowledgement` when rates are fetched.
|
|
27
|
+
*/
|
|
28
|
+
requireDhlTermsAcknowledgement?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Enables the `save rate` button in the rate form. This allows users to save a `rateId` for a shipment to be purchased later.
|
|
31
|
+
*/
|
|
32
|
+
saveRate?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type ShipmentFormFeatures = {
|
|
35
|
+
/**
|
|
36
|
+
* Enables the `Add-Ons` section of the shipment form. This allows users to add additional services to their shipment such as
|
|
37
|
+
* delivery confirmation and insurance.
|
|
38
|
+
*/
|
|
39
|
+
addOns?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Enables the `browse rates` button in the shipment form. This allows users to browse rates for a shipment with
|
|
42
|
+
* varying shipment configurations. This is useful for rate shopping.
|
|
43
|
+
*/
|
|
44
|
+
browseRates?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Enables the `shipsurance insurance` feature, allowing users to select Shipsurance when insuring their shipment.
|
|
47
|
+
*/
|
|
48
|
+
includeShipsuranceInsurance?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Enables the `third party insurance` feature, allowing users to opt for third party insurance when insuring their shipment.
|
|
51
|
+
*/
|
|
52
|
+
includeThirdPartyInsurance?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Enables the `select service` feature, allowing users to select a service when rate shopping across multiple carrier providers.
|
|
55
|
+
*/
|
|
56
|
+
selectService?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Enables the `shipping presets` feature, allowing users to pass in a set of shipping presets they wish to use within the
|
|
59
|
+
* shipment form of the PurchaseLabel element.
|
|
60
|
+
*/
|
|
61
|
+
shippingPresets?: boolean;
|
|
62
|
+
};
|
|
63
|
+
export type ShipmentSummaryFeatures = {
|
|
64
|
+
schedulePickup?: boolean;
|
|
65
|
+
};
|
|
66
|
+
export type PurchaseLabelFeatures = {
|
|
67
|
+
/**
|
|
68
|
+
* List of all supported `countries` available in ShipEngine Elements.
|
|
69
|
+
*/
|
|
70
|
+
compatibleCountryCodes?: CountryCode[];
|
|
71
|
+
/**
|
|
72
|
+
* When enabled will modify the default behavior of creating a new shipment for a salesorder to throwing an error
|
|
73
|
+
*/
|
|
74
|
+
enableErrorWhenShipmentCancelled?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*
|
|
78
|
+
* `partnerMessages` enables the partner consuming elements to specify override messages in specific cases.
|
|
79
|
+
*/
|
|
80
|
+
partnerMessages?: {
|
|
81
|
+
incompleteLabelPurchaseRequirements?: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* All scoped feature flags for the `rate form` section of the PurchaseLabel element.
|
|
85
|
+
*/
|
|
86
|
+
rateForm?: RateFormFeatures;
|
|
87
|
+
/**
|
|
88
|
+
* All scoped feature flags for the `shipment form` section of the PurchaseLabel element.
|
|
89
|
+
*/
|
|
90
|
+
shipmentForm?: ShipmentFormFeatures;
|
|
91
|
+
};
|
|
92
|
+
export type AccountSettingsFeatures = {
|
|
93
|
+
/**
|
|
94
|
+
* Whether or not to display the ShipEngine Carriers section on the Account Settings element.
|
|
95
|
+
*/
|
|
96
|
+
showCarrierServices?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether or not to display the External Carriers section on the Account Settings element.
|
|
99
|
+
*/
|
|
100
|
+
showExternalCarriers?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Whether or not to display the Shipping Label Layout section on the Account Settings element.
|
|
103
|
+
*/
|
|
104
|
+
showLabelLayout?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Whether or not to display the Ship From Locations section on the Account Settings element.
|
|
107
|
+
*/
|
|
108
|
+
showManageWarehouses?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Whether or not to display the Units of Measure section on the Account Settings element.
|
|
111
|
+
*/
|
|
112
|
+
showUnitSettings?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Whether or not to display the Taxes section on the Account Settings element.
|
|
115
|
+
*/
|
|
116
|
+
showVatSettings?: boolean;
|
|
117
|
+
};
|
|
118
|
+
export type GlobalFeatures = {
|
|
119
|
+
/**
|
|
120
|
+
* Availible "Bring your own carrier" carrier codes for carriers that may be added. If this is omitted, new carriers may not be added by this element.
|
|
121
|
+
*/
|
|
122
|
+
enabledExternalCarriers?: EnabledExternalCarriers;
|
|
123
|
+
/**
|
|
124
|
+
* list of all walleted carriers that are enabled for use in Elements.
|
|
125
|
+
*/
|
|
126
|
+
enabledShipEngineCarriers?: EnabledShipEngineCarriers;
|
|
127
|
+
/**
|
|
128
|
+
* Enables the `Powered by ShipEngine` logo in the footer various elements.
|
|
129
|
+
*/
|
|
130
|
+
poweredByShipEngine?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Enable the VAT settings to be shown
|
|
133
|
+
*/
|
|
134
|
+
showVatSettings?: boolean;
|
|
135
|
+
};
|
|
136
|
+
export type ElementsFeatureFlags = {
|
|
137
|
+
accountSettingsFeatures?: AccountSettingsFeatures;
|
|
138
|
+
globalFeatures?: GlobalFeatures;
|
|
139
|
+
purchaseLabelFeatures?: PurchaseLabelFeatures;
|
|
140
|
+
shipmentSummaryFeatures?: ShipmentSummaryFeatures;
|
|
141
|
+
};
|
package/src/utilities/money.d.ts
CHANGED
package/src/utilities/rates.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
1
|
+
import { SE } from "@shipengine/react-api";
|
|
2
2
|
export declare const getDefaultWarehouse: (warehouses: SE.Warehouse[]) => SE.Warehouse;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { ConnectCarrier } from "../connect-carrier";
|
|
4
|
-
export type AccountSettingsFeatures = ShipEngineCarriersFeatures & ConnectCarrier.ConnectCarrierFeatures & VatSettingsFeatures;
|
|
5
|
-
/**
|
|
6
|
-
* # Account Settings Component Props
|
|
7
|
-
*
|
|
8
|
-
* - These are the base props that will be passed into the `<AccountSettings />` component.
|
|
9
|
-
*
|
|
10
|
-
* @see {@link AccountSettings.Component | This prop types usage in the `<AccountSettings /> component`}
|
|
11
|
-
*/
|
|
2
|
+
import { AccountSettingsFeatures } from "../../utilities";
|
|
12
3
|
export type ComponentProps = {
|
|
13
4
|
/**
|
|
14
|
-
*
|
|
5
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
15
6
|
*/
|
|
16
7
|
features?: AccountSettingsFeatures;
|
|
17
8
|
};
|
|
@@ -35,7 +26,7 @@ export declare const Component: ({ features }: ComponentProps) => import("@emoti
|
|
|
35
26
|
* <br />
|
|
36
27
|
*
|
|
37
28
|
* @see {@link AccountSettings.ComponentProps | The **props** that can be passed into the `<AccountSettings.Element />` component}
|
|
38
|
-
* @see {@link
|
|
29
|
+
* @see {@link CarrierServices.Element | The `<CarrierServices />` component used to view connected carriers and manage funding}
|
|
39
30
|
* @see {@link ManageWarehouses.Component | The `<ManageWarehouses />` component used to add, update, or remove warehouses}
|
|
40
31
|
* @see {@link PaymentMethodSettings | The `<PaymentMethodSettings />` component used to manage payment methods}
|
|
41
32
|
* @see {@link ManageFunding | The `<ManageFunding />` component used to manage funding rules and add funds to a carrier account}
|
|
@@ -138,7 +129,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
138
129
|
genericText: string;
|
|
139
130
|
};
|
|
140
131
|
};
|
|
141
|
-
"
|
|
132
|
+
"manage-carriers": {
|
|
142
133
|
title: string;
|
|
143
134
|
headers: {
|
|
144
135
|
accountCarriers: string;
|
|
@@ -270,7 +261,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
270
261
|
addPackageDetails: string;
|
|
271
262
|
};
|
|
272
263
|
errorMessages: {
|
|
273
|
-
customsItemsRequired: string;
|
|
264
|
+
customsItemsRequired: string; /**
|
|
265
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
266
|
+
*/
|
|
274
267
|
invalidAddress: string;
|
|
275
268
|
noRates: string;
|
|
276
269
|
salesOrderNotLoaded: string;
|
|
@@ -1,43 +1,29 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export type ConnectCarrierFeatures = {
|
|
3
|
-
availableCarrierConnections?: string[];
|
|
4
|
-
};
|
|
5
2
|
/**
|
|
6
|
-
* #
|
|
3
|
+
* # Manage-Wallet-Workflow Component
|
|
7
4
|
*
|
|
8
|
-
* @
|
|
9
|
-
*/
|
|
10
|
-
export type ComponentProps = {
|
|
11
|
-
carrierName?: string;
|
|
12
|
-
features?: ConnectCarrierFeatures;
|
|
13
|
-
onCancel?: () => void;
|
|
14
|
-
onCarrierConnected?: (carrierId: string) => void;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* # Connect-Carriers Component
|
|
5
|
+
* @param ComponentProps The base props that will be passed into the `<CarrierServices />` component.
|
|
18
6
|
*
|
|
19
|
-
* @
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* to connect their own existing carrier account. If no carrier is provided, the user may
|
|
23
|
-
* select from a list of carriers specified by `features.availableCarrierConnections`.
|
|
24
|
-
* This component is composed in the `<AccountSettings />` Element.
|
|
7
|
+
* @returns Element A React element that renders the `<CarrierServices />` component allowing users
|
|
8
|
+
* to view a list of carriers that are connected to their ShipEngine account, add funds to their wallet, view transaction history, and manage their payment method. This component is
|
|
9
|
+
* composed in the `<AccountSettings />` Element.
|
|
25
10
|
*
|
|
26
11
|
* @example
|
|
27
12
|
* ```tsx
|
|
28
13
|
* (() => {
|
|
29
|
-
* const features = useFeatures("
|
|
14
|
+
* const features = useFeatures("Global");
|
|
30
15
|
*
|
|
31
|
-
* return <
|
|
16
|
+
* return <CarrierServices.Element features={features} />;
|
|
32
17
|
* })();
|
|
33
18
|
* ```
|
|
34
19
|
*
|
|
35
20
|
* <br />
|
|
36
21
|
*
|
|
37
|
-
* @see {@link
|
|
22
|
+
* @see {@link CarrierServices.ComponentProps | The props that are passed into the `<Manage-Wallet-Workflow />` component}
|
|
23
|
+
* @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<Manage-Wallet-Workflow />` component}
|
|
38
24
|
*/
|
|
39
|
-
export declare const Component: (
|
|
40
|
-
export declare const Element: ({ resources, ...props }:
|
|
25
|
+
export declare const Component: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const Element: ({ resources, ...props }: object & {
|
|
41
27
|
resources?: {
|
|
42
28
|
en: {
|
|
43
29
|
"wallet-history": {
|
|
@@ -135,7 +121,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
135
121
|
genericText: string;
|
|
136
122
|
};
|
|
137
123
|
};
|
|
138
|
-
"
|
|
124
|
+
"manage-carriers": {
|
|
139
125
|
title: string;
|
|
140
126
|
headers: {
|
|
141
127
|
accountCarriers: string;
|
|
@@ -160,6 +146,29 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
160
146
|
};
|
|
161
147
|
billing: {
|
|
162
148
|
title: string;
|
|
149
|
+
/**
|
|
150
|
+
* # Manage-Wallet-Workflow Component
|
|
151
|
+
*
|
|
152
|
+
* @param ComponentProps The base props that will be passed into the `<CarrierServices />` component.
|
|
153
|
+
*
|
|
154
|
+
* @returns Element A React element that renders the `<CarrierServices />` component allowing users
|
|
155
|
+
* to view a list of carriers that are connected to their ShipEngine account, add funds to their wallet, view transaction history, and manage their payment method. This component is
|
|
156
|
+
* composed in the `<AccountSettings />` Element.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```tsx
|
|
160
|
+
* (() => {
|
|
161
|
+
* const features = useFeatures("Global");
|
|
162
|
+
*
|
|
163
|
+
* return <CarrierServices.Element features={features} />;
|
|
164
|
+
* })();
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* <br />
|
|
168
|
+
*
|
|
169
|
+
* @see {@link CarrierServices.ComponentProps | The props that are passed into the `<Manage-Wallet-Workflow />` component}
|
|
170
|
+
* @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<Manage-Wallet-Workflow />` component}
|
|
171
|
+
*/
|
|
163
172
|
cardSubTitle: string;
|
|
164
173
|
addressSubTitle: string;
|
|
165
174
|
info: string;
|
|
@@ -621,29 +630,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
621
630
|
postalCode: string;
|
|
622
631
|
phone: string;
|
|
623
632
|
email: string;
|
|
624
|
-
/**
|
|
625
|
-
* # Connect-Carriers Component
|
|
626
|
-
*
|
|
627
|
-
* @param ComponentProps The base props that will be passed into the `<ConnectCarrier />` component.
|
|
628
|
-
*
|
|
629
|
-
* @returns Element A React element that renders the `<ConnectCarrier />` component allowing users
|
|
630
|
-
* to connect their own existing carrier account. If no carrier is provided, the user may
|
|
631
|
-
* select from a list of carriers specified by `features.availableCarrierConnections`.
|
|
632
|
-
* This component is composed in the `<AccountSettings />` Element.
|
|
633
|
-
*
|
|
634
|
-
* @example
|
|
635
|
-
* ```tsx
|
|
636
|
-
* (() => {
|
|
637
|
-
* const features = useFeatures("CarrierConnections");
|
|
638
|
-
*
|
|
639
|
-
* return <ConnectCarrier.Component features={features} />;
|
|
640
|
-
* })();
|
|
641
|
-
* ```
|
|
642
|
-
*
|
|
643
|
-
* <br />
|
|
644
|
-
*
|
|
645
|
-
* @see {@link ConnectCarrier.ComponentProps | The props that are passed into the `<ConnectCarrier />` component}
|
|
646
|
-
*/
|
|
647
633
|
addressResidentialIndicator: string;
|
|
648
634
|
};
|
|
649
635
|
noResults: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as CarrierServices from "./carrier-services";
|