@shipengine/elements 0.26.2 → 0.26.3
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 +118 -69
- package/index.js +118 -69
- package/package.json +1 -1
- package/src/components/powered-by-shipengine/powered-by-shipengine.styles.d.ts +4 -4
- package/src/components/templates/onboarding/onboarding.d.ts +9 -1
- package/src/components/templates/rate-form/rate-form.d.ts +2 -8
- package/src/components/templates/shipment/shipment.d.ts +8 -1
- package/src/elements/configure-shipment/configure-shipment.d.ts +13 -1
- package/src/elements/onboarding/onboarding.d.ts +3 -1
- package/src/elements/view-shipment/view-shipment.d.ts +1 -4
- package/src/elements/void-label/void-label.d.ts +8 -1
package/index.cjs
CHANGED
|
@@ -10174,6 +10174,7 @@ const styles$c = createStyles({
|
|
|
10174
10174
|
const Onboarding = ({
|
|
10175
10175
|
carriers,
|
|
10176
10176
|
createWarehouse,
|
|
10177
|
+
features,
|
|
10177
10178
|
onCarrierCreated,
|
|
10178
10179
|
onCompleteOnboarding,
|
|
10179
10180
|
onWarehouseCreated,
|
|
@@ -10185,6 +10186,14 @@ const Onboarding = ({
|
|
|
10185
10186
|
registerUpsCarrierErrors,
|
|
10186
10187
|
warehouses
|
|
10187
10188
|
}) => {
|
|
10189
|
+
var _a, _b;
|
|
10190
|
+
features = Object.assign({
|
|
10191
|
+
global: {
|
|
10192
|
+
presentation: {
|
|
10193
|
+
poweredByShipEngine: false
|
|
10194
|
+
}
|
|
10195
|
+
}
|
|
10196
|
+
}, features !== null && features !== void 0 ? features : {});
|
|
10188
10197
|
const {
|
|
10189
10198
|
t
|
|
10190
10199
|
} = reactI18next.useTranslation(["common", "register-wallet"]);
|
|
@@ -10229,7 +10238,7 @@ const Onboarding = ({
|
|
|
10229
10238
|
carrierCode: "dhl_express_walleted",
|
|
10230
10239
|
nickname: "dhl_express_walleted"
|
|
10231
10240
|
})]);
|
|
10232
|
-
} catch (
|
|
10241
|
+
} catch (_c) {
|
|
10233
10242
|
// Errors shown inline for recovery
|
|
10234
10243
|
}
|
|
10235
10244
|
yield onCarrierCreated();
|
|
@@ -10423,7 +10432,9 @@ const Onboarding = ({
|
|
|
10423
10432
|
css: styles$c.step,
|
|
10424
10433
|
label: t("onboarding:steps.payment")
|
|
10425
10434
|
})]
|
|
10426
|
-
})), renderStep(),
|
|
10435
|
+
})), renderStep(), ((_b = (_a = features === null || features === void 0 ? void 0 : features.global) === null || _a === void 0 ? void 0 : _a.presentation) === null || _b === void 0 ? void 0 : _b.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10436
|
+
children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
|
|
10437
|
+
})]
|
|
10427
10438
|
}));
|
|
10428
10439
|
};
|
|
10429
10440
|
|
|
@@ -10890,8 +10901,8 @@ const FundAndPurchase = ({
|
|
|
10890
10901
|
const renderActionButtons = (addFundsForm = {}) => jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10891
10902
|
children: [isSavingError && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10892
10903
|
children: [jsxRuntime.jsx(giger.InlineNotification, Object.assign({
|
|
10893
|
-
|
|
10894
|
-
|
|
10904
|
+
title: t("purchase-label:errorMessages.saveRateFailedTitle"),
|
|
10905
|
+
type: giger.NotificationType.ERROR
|
|
10895
10906
|
}, {
|
|
10896
10907
|
children: jsxRuntime.jsx(giger.Typography, {
|
|
10897
10908
|
children: t("purchase-label:errorMessages.saveRateFailedMessage")
|
|
@@ -11431,56 +11442,39 @@ const LabelLayout = ({
|
|
|
11431
11442
|
});
|
|
11432
11443
|
};
|
|
11433
11444
|
|
|
11434
|
-
|
|
11435
|
-
fundAndPurchase: theme => ({
|
|
11436
|
-
borderTop: `1px solid ${theme.palette.gray.ultraLight}`
|
|
11437
|
-
}),
|
|
11438
|
-
ratesInterstitial: {
|
|
11439
|
-
alignItems: "center",
|
|
11440
|
-
display: "flex",
|
|
11441
|
-
flexDirection: "column",
|
|
11442
|
-
justifyContent: "center",
|
|
11443
|
-
textAlign: "center"
|
|
11444
|
-
},
|
|
11445
|
-
showMoreOrLessRatesButton: {
|
|
11446
|
-
alignItems: "center",
|
|
11447
|
-
display: "flex"
|
|
11448
|
-
}
|
|
11449
|
-
});
|
|
11450
|
-
|
|
11451
|
-
const rateSchema = zod.z.object({
|
|
11452
|
-
rate: zod.z.object({
|
|
11453
|
-
isAcknowledged: zod.z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
|
|
11454
|
-
rateId: zod.z.string()
|
|
11455
|
-
})
|
|
11456
|
-
}).transform(schema => schema.rate.rateId);
|
|
11457
|
-
|
|
11458
|
-
var _path, _path2;
|
|
11445
|
+
var _g, _defs;
|
|
11459
11446
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11460
11447
|
var SvgShipengineLogo = function SvgShipengineLogo(props) {
|
|
11461
11448
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
11462
|
-
width:
|
|
11463
|
-
height:
|
|
11449
|
+
width: 156,
|
|
11450
|
+
height: 20,
|
|
11464
11451
|
fill: "none",
|
|
11465
11452
|
xmlns: "http://www.w3.org/2000/svg"
|
|
11466
|
-
}, props),
|
|
11467
|
-
|
|
11453
|
+
}, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
|
|
11454
|
+
clipPath: "url(#shipengine-logo_svg__a)"
|
|
11455
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
11456
|
+
d: "M16.007 9.91c0-.61-.228-1.144-.686-1.601-.457-.457-.99-.686-1.6-.686-.61 0-1.144.229-1.601.686-.458.457-.686.99-.686 1.6 0 .61.228 1.144.686 1.601.457.458.99.687 1.6.687.61 0 1.144-.23 1.601-.686.458-.458.686-.991.686-1.601Zm4.574-.991V10.9c0 .076 0 .152-.076.229l-.152.152-1.677.229c-.077.305-.23.61-.382.762.229.305.534.686.991 1.22.077.076.077.152.077.228 0 .076 0 .153-.077.229-.152.229-.457.534-.838.99-.381.458-.686.61-.839.61-.076 0-.152 0-.228-.076l-1.296-.991c-.23.153-.534.23-.839.306-.077.838-.152 1.371-.229 1.676 0 .229-.152.305-.304.305H12.73c-.077 0-.153 0-.23-.076-.076-.076-.076-.152-.076-.229l-.228-1.676c-.305-.077-.534-.23-.839-.306l-1.296.992c-.076.076-.152.076-.228.076-.077 0-.153 0-.229-.076-.762-.686-1.22-1.144-1.448-1.525-.077-.076-.077-.152-.077-.229 0-.076 0-.152.077-.229.076-.152.228-.305.457-.61.229-.304.381-.457.457-.61-.152-.304-.305-.61-.38-.914l-1.602-.229c-.076 0-.152-.076-.152-.076s-.077-.076-.077-.152V8.919c0-.077 0-.153.077-.23l.152-.151 1.677-.23c.077-.304.23-.533.382-.837-.229-.305-.534-.763-.991-1.22-.077-.077-.077-.153-.077-.23 0-.075 0-.151.077-.227.152-.23.457-.534.914-.991.458-.458.686-.61.84-.61.076 0 .151 0 .228.076l1.22.99c.228-.152.533-.228.838-.304.077-.84.152-1.372.229-1.677.076-.153.152-.23.305-.23h1.982c.076 0 .152 0 .228.078.077.076.077.152.077.228l.228 1.677c.305.077.534.229.839.305l1.296-.991c.076-.077.152-.077.228-.077.077 0 .153 0 .229.077.762.686 1.296 1.22 1.448 1.525.077.076.077.076.077.228 0 .077 0 .153-.077.229-.076.153-.228.305-.457.61s-.381.457-.457.61c.152.305.305.61.38.838l1.602.229c.076 0 .152.076.152.076s.076.153.076.229Z",
|
|
11468
11457
|
fill: "#45AAF2"
|
|
11469
|
-
})
|
|
11470
|
-
d: "M0
|
|
11458
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
11459
|
+
d: "M0 10.444V9.3a1.087 1.087 0 0 0 .914-.457c.23-.305.306-.686.306-1.144v-4.65c0-.914.305-1.676.838-2.21C2.668.23 3.278 0 4.041 0h1.372v1.296H4.04c-.381 0-.762.152-1.067.534a1.922 1.922 0 0 0-.458 1.295v4.803c0 1.068-.381 1.677-1.067 1.982.686.305 1.067.99 1.067 1.982v4.878c0 .534.153.991.458 1.297.305.38.686.533 1.067.533h1.372v1.22H4.04a2.77 2.77 0 0 1-1.982-.838c-.61-.534-.838-1.296-.838-2.211v-4.727c0-.457-.077-.838-.305-1.143A1.087 1.087 0 0 0 0 10.444Zm22.107 8.08h1.372c.38 0 .762-.152 1.067-.534.305-.381.457-.762.457-1.295v-4.803c0-1.068.381-1.753 1.067-1.982-.686-.305-1.067-.991-1.067-1.982V3.125c0-.533-.152-.99-.457-1.295-.305-.382-.686-.534-1.067-.534h-1.372V0h1.372c.762 0 1.448.305 1.982.839.534.533.838 1.295.838 2.21v4.65c0 .458.076.839.305 1.144.229.305.534.457.839.457v1.144c-.305 0-.534.152-.763.457-.228.305-.305.686-.305 1.143v4.727c0 .914-.305 1.6-.838 2.21-.61.534-1.296.839-2.058.839h-1.372v-1.296Zm11.434-4.955.762-.991c.381.458.839.762 1.372 1.068.534.304 1.144.38 1.83.38a4.62 4.62 0 0 0 1.143-.152c.305-.077.61-.23.762-.457.23-.077.382-.305.458-.458.076-.228.152-.381.152-.61a1.29 1.29 0 0 0-.229-.762 1.78 1.78 0 0 0-.533-.534c-.229-.152-.534-.228-.839-.381-.304-.152-.61-.228-.99-.305-.382-.076-.687-.152-.992-.304a5.292 5.292 0 0 1-.99-.382c-.305-.152-.61-.305-.839-.533-.228-.23-.457-.458-.533-.763a2.436 2.436 0 0 1-.23-1.067c0-.838.306-1.524.992-2.059.686-.533 1.524-.761 2.515-.761 1.525 0 2.745.457 3.66 1.448l-.763.914c-.763-.837-1.753-1.22-2.973-1.22-.61 0-1.144.154-1.525.458-.38.305-.61.686-.61 1.144 0 .229.077.457.23.686.152.229.304.305.533.457.228.153.533.229.838.305.305.077.61.153.992.305.38.153.685.305.99.381.343.094.675.222.991.382.305.152.61.304.84.533.227.229.456.457.532.762.077.305.23.686.23 1.068 0 .305-.077.61-.154.914-.075.305-.228.534-.38.839l-.687.686c-.31.242-.677.4-1.067.457a5.272 5.272 0 0 1-1.524.229c-1.677 0-2.973-.533-3.964-1.677Zm12.12 1.525V4.803h1.296v4.345h6.023V4.726h1.295v10.29H52.98v-4.725h-6.022v4.726h-1.296v.077Zm13.417 0V4.803h1.296v10.29h-1.296Zm6.174 0V4.803h4.117c.99 0 1.753.304 2.363.914.61.61.839 1.372.839 2.21a3.32 3.32 0 0 1-.84 2.212c-.61.533-1.371.838-2.362.838h-2.897v4.117h-1.22Zm1.296-5.26h2.668c.61 0 1.068-.153 1.525-.534.457-.381.61-.838.61-1.448s-.23-1.068-.61-1.449c-.381-.381-.915-.533-1.525-.533h-2.668v3.964Zm9.91 5.26V4.803h7.547V7.09h-4.88v1.6h4.804v2.287h-4.803v1.753h4.879v2.287h-7.547v.077Zm11.587 0V4.803h2.668l4.193 5.64v-5.64h2.667v10.29h-2.591l-4.345-5.945v5.946h-2.592Zm13.34-5.184c0-.762.152-1.525.457-2.211.305-.686.686-1.22 1.22-1.677.534-.457 1.067-.838 1.753-1.067.686-.229 1.372-.381 2.211-.381.534 0 1.067.077 1.525.229.457.152.914.304 1.219.533.381.229.686.534.915.762l.686.915-2.211 1.144a2.62 2.62 0 0 0-.914-.915 2.572 2.572 0 0 0-1.296-.381c-.839 0-1.525.305-2.059.838-.533.534-.838 1.296-.838 2.135 0 .838.305 1.524.838 2.134.534.534 1.22.839 2.059.839.381 0 .686-.077 1.067-.153.381-.152.61-.305.838-.457v-.762h-2.286V9.148h4.955v4.116c-1.22 1.372-2.745 1.982-4.574 1.982a7.077 7.077 0 0 1-2.211-.381 4.528 4.528 0 0 1-1.753-1.068c-.534-.457-.915-.99-1.22-1.676a7.075 7.075 0 0 1-.381-2.211Zm14.103 5.184V4.803h2.668v10.29h-2.668Zm6.937 0V4.803h2.744l4.193 5.64v-5.64h2.668v10.29h-2.592l-4.345-5.945v5.946h-2.668Zm13.874 0V4.803h7.546V7.09h-4.878v1.6h4.802v2.287h-4.802v1.753h4.878v2.287h-7.546v.077Zm11.586-8.767c0-.457.153-.914.534-1.22.381-.304.762-.533 1.22-.533.304 0 .609.077.914.229.305.152.458.38.61.609.153.229.229.534.229.915 0 .457-.153.914-.534 1.22-.381.305-.762.534-1.219.534-.458 0-.915-.153-1.22-.534-.305-.381-.534-.763-.534-1.22Zm.305 0c0 .381.153.762.458 1.068.305.304.686.457 1.067.457.381 0 .762-.153 1.067-.458a1.514 1.514 0 0 0 .457-1.067c0-.457-.152-.762-.457-1.068a1.51 1.51 0 0 0-1.067-.456c-.458 0-.762.152-1.067.457-.305.229-.458.61-.458 1.068v-.001Zm.839.99V5.337h.838c.153 0 .305.077.458.153.152.076.152.228.152.457s-.076.381-.152.457c-.077.077-.229.153-.305.153l.533.838h-.381l-.533-.838h-.382v.838h-.228v-.076Zm.228-.99h.534c.076 0 .152 0 .229-.077.152-.152.152-.228.152-.304 0-.077 0-.229-.076-.305-.076-.077-.153-.077-.229-.077h-.533v.763h-.077Z",
|
|
11471
11460
|
fill: "#162948"
|
|
11472
|
-
})))
|
|
11461
|
+
}))), _defs || (_defs = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("clipPath", {
|
|
11462
|
+
id: "shipengine-logo_svg__a"
|
|
11463
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
11464
|
+
fill: "#fff",
|
|
11465
|
+
d: "M0 0h156v19.82H0z"
|
|
11466
|
+
})))));
|
|
11473
11467
|
};
|
|
11474
11468
|
|
|
11475
|
-
const styles$
|
|
11469
|
+
const styles$5 = createStyles({
|
|
11476
11470
|
poweredByShipEngine: {
|
|
11477
|
-
display: "flex",
|
|
11478
11471
|
alignItems: "center",
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
margin: "1rem 0",
|
|
11472
|
+
color: "#818F9C",
|
|
11473
|
+
display: "flex",
|
|
11482
11474
|
gap: "1rem",
|
|
11483
|
-
|
|
11475
|
+
justifyContent: "center",
|
|
11476
|
+
padding: "1rem 0",
|
|
11477
|
+
textAlign: "center"
|
|
11484
11478
|
}
|
|
11485
11479
|
});
|
|
11486
11480
|
|
|
@@ -11489,16 +11483,40 @@ const PoweredByShipEngine = () => {
|
|
|
11489
11483
|
t
|
|
11490
11484
|
} = reactI18next.useTranslation();
|
|
11491
11485
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
11492
|
-
css: styles$
|
|
11486
|
+
css: styles$5.poweredByShipEngine
|
|
11493
11487
|
}, {
|
|
11494
11488
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
11495
|
-
variant: "
|
|
11489
|
+
variant: "body2"
|
|
11496
11490
|
}, {
|
|
11497
11491
|
children: t("powered-by")
|
|
11498
11492
|
})), jsxRuntime.jsx(SvgShipengineLogo, {})]
|
|
11499
11493
|
}));
|
|
11500
11494
|
};
|
|
11501
11495
|
|
|
11496
|
+
const styles$4 = createStyles({
|
|
11497
|
+
fundAndPurchase: theme => ({
|
|
11498
|
+
borderTop: `1px solid ${theme.palette.gray.ultraLight}`
|
|
11499
|
+
}),
|
|
11500
|
+
ratesInterstitial: {
|
|
11501
|
+
alignItems: "center",
|
|
11502
|
+
display: "flex",
|
|
11503
|
+
flexDirection: "column",
|
|
11504
|
+
justifyContent: "center",
|
|
11505
|
+
textAlign: "center"
|
|
11506
|
+
},
|
|
11507
|
+
showMoreOrLessRatesButton: {
|
|
11508
|
+
alignItems: "center",
|
|
11509
|
+
display: "flex"
|
|
11510
|
+
}
|
|
11511
|
+
});
|
|
11512
|
+
|
|
11513
|
+
const rateSchema = zod.z.object({
|
|
11514
|
+
rate: zod.z.object({
|
|
11515
|
+
isAcknowledged: zod.z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
|
|
11516
|
+
rateId: zod.z.string()
|
|
11517
|
+
})
|
|
11518
|
+
}).transform(schema => schema.rate.rateId);
|
|
11519
|
+
|
|
11502
11520
|
const RateForm = ({
|
|
11503
11521
|
carriers,
|
|
11504
11522
|
disabled,
|
|
@@ -11517,11 +11535,19 @@ const RateForm = ({
|
|
|
11517
11535
|
shipment,
|
|
11518
11536
|
outOfBandDisplayableErrors
|
|
11519
11537
|
}) => {
|
|
11538
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11520
11539
|
features = Object.assign({
|
|
11521
|
-
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
|
|
11540
|
+
global: {
|
|
11541
|
+
presentation: {
|
|
11542
|
+
poweredByShipEngine: false
|
|
11543
|
+
}
|
|
11544
|
+
},
|
|
11545
|
+
rateForm: {
|
|
11546
|
+
enableGlobalPostFiltering: false,
|
|
11547
|
+
labelLayout: false,
|
|
11548
|
+
nicknameRate: true,
|
|
11549
|
+
saveRate: true
|
|
11550
|
+
}
|
|
11525
11551
|
}, features !== null && features !== void 0 ? features : {});
|
|
11526
11552
|
const allDisplayableErrors = [...(displayableErrors !== null && displayableErrors !== void 0 ? displayableErrors : []), ...(outOfBandDisplayableErrors !== null && outOfBandDisplayableErrors !== void 0 ? outOfBandDisplayableErrors : [])];
|
|
11527
11553
|
const {
|
|
@@ -11558,7 +11584,7 @@ const RateForm = ({
|
|
|
11558
11584
|
});
|
|
11559
11585
|
}
|
|
11560
11586
|
})));
|
|
11561
|
-
const rateOptions = useRateOptions(rates, carriers, shipment, features.enableGlobalPostFiltering);
|
|
11587
|
+
const rateOptions = useRateOptions(rates, carriers, shipment, !!((_a = features === null || features === void 0 ? void 0 : features.rateForm) === null || _a === void 0 ? void 0 : _a.enableGlobalPostFiltering));
|
|
11562
11588
|
// Return true if User has multiple accounts for a single carrier.
|
|
11563
11589
|
const hasDuplicateCarrierCode = carriers => {
|
|
11564
11590
|
const uniqueCarrierCodes = new Set();
|
|
@@ -11630,11 +11656,11 @@ const RateForm = ({
|
|
|
11630
11656
|
name: "rate",
|
|
11631
11657
|
nicknameFeature:
|
|
11632
11658
|
// if feature flag is on, and if account has duplicate carrierCodes, then show nickname
|
|
11633
|
-
features.nicknameRate && carriers && hasDuplicateCarrierCode(carriers),
|
|
11659
|
+
((_b = features === null || features === void 0 ? void 0 : features.rateForm) === null || _b === void 0 ? void 0 : _b.nicknameRate) && carriers && hasDuplicateCarrierCode(carriers),
|
|
11634
11660
|
onClick: onSelectRate,
|
|
11635
11661
|
options: showHiddenRates ? rateOptions : filteredRateOptions
|
|
11636
11662
|
}), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsxRuntime.jsx(giger.Link, Object.assign({
|
|
11637
|
-
css: styles$
|
|
11663
|
+
css: styles$4.showMoreOrLessRatesButton,
|
|
11638
11664
|
onClick: () => {
|
|
11639
11665
|
var _a;
|
|
11640
11666
|
setShowHiddenRates(!showHiddenRates);
|
|
@@ -11655,7 +11681,7 @@ const RateForm = ({
|
|
|
11655
11681
|
}))
|
|
11656
11682
|
}))]
|
|
11657
11683
|
}) : !isLoading && !!allDisplayableErrors.length ? null : jsxRuntime.jsxs("article", Object.assign({
|
|
11658
|
-
css: styles$
|
|
11684
|
+
css: styles$4.ratesInterstitial,
|
|
11659
11685
|
role: "presentation"
|
|
11660
11686
|
}, {
|
|
11661
11687
|
children: [jsxRuntime.jsx(Cube, {
|
|
@@ -11669,7 +11695,7 @@ const RateForm = ({
|
|
|
11669
11695
|
children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
|
|
11670
11696
|
})
|
|
11671
11697
|
}))]
|
|
11672
|
-
})), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsxRuntime.jsx(Section, Object.assign({
|
|
11698
|
+
})), ((_c = features === null || features === void 0 ? void 0 : features.rateForm) === null || _c === void 0 ? void 0 : _c.labelLayout) && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsxRuntime.jsx(Section, Object.assign({
|
|
11673
11699
|
title: t("manage-defaults:label.title")
|
|
11674
11700
|
}, {
|
|
11675
11701
|
children: jsxRuntime.jsx(LabelLayout, {
|
|
@@ -11678,14 +11704,16 @@ const RateForm = ({
|
|
|
11678
11704
|
})), jsxRuntime.jsx(FundAndPurchase, {
|
|
11679
11705
|
carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
|
|
11680
11706
|
control: form.control,
|
|
11681
|
-
css: styles$
|
|
11707
|
+
css: styles$4.fundAndPurchase,
|
|
11682
11708
|
disabled: disabled,
|
|
11683
|
-
isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
|
|
11709
|
+
isFundingEnabled: !!((_d = features === null || features === void 0 ? void 0 : features.rateForm) === null || _d === void 0 ? void 0 : _d.enableFunding),
|
|
11684
11710
|
isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
|
|
11685
11711
|
onPurchase: handleSubmit,
|
|
11686
11712
|
onSave: handleSaveRate,
|
|
11687
11713
|
purchaseAmount: getTotalRateAmount(selectedRate)
|
|
11688
|
-
}),
|
|
11714
|
+
}), ((_f = (_e = features === null || features === void 0 ? void 0 : features.global) === null || _e === void 0 ? void 0 : _e.presentation) === null || _f === void 0 ? void 0 : _f.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
11715
|
+
children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
|
|
11716
|
+
})]
|
|
11689
11717
|
}));
|
|
11690
11718
|
};
|
|
11691
11719
|
|
|
@@ -13011,7 +13039,14 @@ const Shipment = ({
|
|
|
13011
13039
|
shipment,
|
|
13012
13040
|
warehouse
|
|
13013
13041
|
}) => {
|
|
13014
|
-
var _a;
|
|
13042
|
+
var _a, _b, _c, _d;
|
|
13043
|
+
features = Object.assign({
|
|
13044
|
+
global: {
|
|
13045
|
+
presentation: {
|
|
13046
|
+
poweredByShipEngine: false
|
|
13047
|
+
}
|
|
13048
|
+
}
|
|
13049
|
+
}, features !== null && features !== void 0 ? features : {});
|
|
13015
13050
|
const {
|
|
13016
13051
|
t
|
|
13017
13052
|
} = reactI18next.useTranslation(["common", "view-shipment"]);
|
|
@@ -13128,7 +13163,7 @@ const Shipment = ({
|
|
|
13128
13163
|
}) : ""].filter(unit => unit.length).join(" ")
|
|
13129
13164
|
}))]
|
|
13130
13165
|
})), jsxRuntime.jsxs(Section, Object.assign({
|
|
13131
|
-
rightContent: (features === null || features === void 0 ? void 0 : features.schedulePickup) && schedulePickupForCarrier(activeLabel === null || activeLabel === void 0 ? void 0 : activeLabel.carrierCode) ? jsxRuntime.jsx(giger.Link, Object.assign({
|
|
13166
|
+
rightContent: ((_a = features === null || features === void 0 ? void 0 : features.shipment) === null || _a === void 0 ? void 0 : _a.schedulePickup) && schedulePickupForCarrier(activeLabel === null || activeLabel === void 0 ? void 0 : activeLabel.carrierCode) ? jsxRuntime.jsx(giger.Link, Object.assign({
|
|
13132
13167
|
css: theme => ({
|
|
13133
13168
|
fontWeight: theme.typography.fontWeight.normal
|
|
13134
13169
|
}),
|
|
@@ -13140,7 +13175,7 @@ const Shipment = ({
|
|
|
13140
13175
|
})) : undefined,
|
|
13141
13176
|
title: t("view-shipment:sections.labels")
|
|
13142
13177
|
}, {
|
|
13143
|
-
children: [(
|
|
13178
|
+
children: [(_b = sortLabels(labels)) === null || _b === void 0 ? void 0 : _b.map((label, i, data) => {
|
|
13144
13179
|
const carrier = carriers === null || carriers === void 0 ? void 0 : carriers.find(c => c.carrierCode === label.carrierCode);
|
|
13145
13180
|
const service = carrier === null || carrier === void 0 ? void 0 : carrier.services.find(s => s.serviceCode === label.serviceCode);
|
|
13146
13181
|
return jsxRuntime.jsxs(React.Fragment, {
|
|
@@ -13192,7 +13227,9 @@ const Shipment = ({
|
|
|
13192
13227
|
})), "representative."]
|
|
13193
13228
|
}))
|
|
13194
13229
|
}))
|
|
13195
|
-
})),
|
|
13230
|
+
})), ((_d = (_c = features === null || features === void 0 ? void 0 : features.global) === null || _c === void 0 ? void 0 : _c.presentation) === null || _d === void 0 ? void 0 : _d.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13231
|
+
children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
|
|
13232
|
+
})]
|
|
13196
13233
|
});
|
|
13197
13234
|
};
|
|
13198
13235
|
|
|
@@ -14454,6 +14491,7 @@ var manageWarehouses = /*#__PURE__*/Object.freeze({
|
|
|
14454
14491
|
});
|
|
14455
14492
|
|
|
14456
14493
|
const Component$3 = ({
|
|
14494
|
+
features,
|
|
14457
14495
|
onCompleteOnboarding
|
|
14458
14496
|
}) => {
|
|
14459
14497
|
const {
|
|
@@ -14497,6 +14535,7 @@ const Component$3 = ({
|
|
|
14497
14535
|
return jsxRuntime.jsx(Onboarding, {
|
|
14498
14536
|
carriers: carriers,
|
|
14499
14537
|
createWarehouse: createWarehouse,
|
|
14538
|
+
features: features,
|
|
14500
14539
|
onCarrierCreated: onCarrierCreated,
|
|
14501
14540
|
onCompleteOnboarding: onCompleteOnboarding,
|
|
14502
14541
|
onWarehouseCreated: onWarehouseCreated,
|
|
@@ -15229,7 +15268,7 @@ const ConfigureShipment = _a => {
|
|
|
15229
15268
|
onDirty: handleOnDirty
|
|
15230
15269
|
})), jsxRuntime.jsx(RateForm, Object.assign({}, rateFormProps, {
|
|
15231
15270
|
disabled: charsetWarning === null || charsetWarning === void 0 ? void 0 : charsetWarning.error,
|
|
15232
|
-
features: features
|
|
15271
|
+
features: features,
|
|
15233
15272
|
onSelectRate: resetLabel,
|
|
15234
15273
|
outOfBandDisplayableErrors: shipmentFormProps.displayableErrors
|
|
15235
15274
|
}))]
|
|
@@ -15446,7 +15485,6 @@ const useGetOrCreateShipment = shipmentId => {
|
|
|
15446
15485
|
[]);
|
|
15447
15486
|
return reactQuery.useQuery({
|
|
15448
15487
|
onError: reactApi.onError,
|
|
15449
|
-
retry: shipmentId !== undefined,
|
|
15450
15488
|
queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15451
15489
|
var _a;
|
|
15452
15490
|
if (shipmentId) {
|
|
@@ -15456,10 +15494,10 @@ const useGetOrCreateShipment = shipmentId => {
|
|
|
15456
15494
|
const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
|
|
15457
15495
|
if (defaultOrFirstWarehouse === undefined) {
|
|
15458
15496
|
throw [alchemy.CodedError.fromObject({
|
|
15459
|
-
message: "errorMessages.noWarehouses",
|
|
15460
|
-
errorType: "unknown",
|
|
15461
15497
|
errorCode: "unknown",
|
|
15462
|
-
errorSource: "client"
|
|
15498
|
+
errorSource: "client",
|
|
15499
|
+
errorType: "unknown",
|
|
15500
|
+
message: "errorMessages.noWarehouses"
|
|
15463
15501
|
})];
|
|
15464
15502
|
}
|
|
15465
15503
|
const shipTo = {
|
|
@@ -15478,7 +15516,8 @@ const useGetOrCreateShipment = shipmentId => {
|
|
|
15478
15516
|
return newShipment.data.shipments[0];
|
|
15479
15517
|
}
|
|
15480
15518
|
}),
|
|
15481
|
-
queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
|
|
15519
|
+
queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`],
|
|
15520
|
+
retry: shipmentId !== undefined
|
|
15482
15521
|
});
|
|
15483
15522
|
};
|
|
15484
15523
|
|
|
@@ -15589,7 +15628,7 @@ const Component$1 = ({
|
|
|
15589
15628
|
});
|
|
15590
15629
|
return jsxRuntime.jsx(Shipment, {
|
|
15591
15630
|
carriers: carriers.data,
|
|
15592
|
-
features: features
|
|
15631
|
+
features: features,
|
|
15593
15632
|
labels: labels.data,
|
|
15594
15633
|
onClickPrintLabel: onClickPrintLabel,
|
|
15595
15634
|
onClickPurchaseLabel: onClickPurchaseLabel,
|
|
@@ -15721,12 +15760,20 @@ const Message = ({
|
|
|
15721
15760
|
};
|
|
15722
15761
|
|
|
15723
15762
|
const Component = ({
|
|
15763
|
+
features,
|
|
15724
15764
|
labelId,
|
|
15725
15765
|
onComplete,
|
|
15726
15766
|
onSuccess,
|
|
15727
15767
|
onViewShipment
|
|
15728
15768
|
}) => {
|
|
15729
|
-
var _a;
|
|
15769
|
+
var _a, _b, _c;
|
|
15770
|
+
features = Object.assign({
|
|
15771
|
+
global: {
|
|
15772
|
+
presentation: {
|
|
15773
|
+
poweredByShipEngine: false
|
|
15774
|
+
}
|
|
15775
|
+
}
|
|
15776
|
+
}, features !== null && features !== void 0 ? features : {});
|
|
15730
15777
|
// TODO [LMNT-910] - labelId should be a required prop
|
|
15731
15778
|
if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
|
|
15732
15779
|
const {
|
|
@@ -15760,7 +15807,9 @@ const Component = ({
|
|
|
15760
15807
|
onViewShipment: onViewShipment,
|
|
15761
15808
|
shipment: shipment.data,
|
|
15762
15809
|
voidRequest: voidLabel.data
|
|
15763
|
-
}),
|
|
15810
|
+
}), ((_c = (_b = features === null || features === void 0 ? void 0 : features.global) === null || _b === void 0 ? void 0 : _b.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
15811
|
+
children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
|
|
15812
|
+
})]
|
|
15764
15813
|
});
|
|
15765
15814
|
};
|
|
15766
15815
|
const Element = alchemy__default["default"].createElement(Component, ErrorFallback, {
|
package/index.js
CHANGED
|
@@ -10142,6 +10142,7 @@ const styles$c = createStyles({
|
|
|
10142
10142
|
const Onboarding = ({
|
|
10143
10143
|
carriers,
|
|
10144
10144
|
createWarehouse,
|
|
10145
|
+
features,
|
|
10145
10146
|
onCarrierCreated,
|
|
10146
10147
|
onCompleteOnboarding,
|
|
10147
10148
|
onWarehouseCreated,
|
|
@@ -10153,6 +10154,14 @@ const Onboarding = ({
|
|
|
10153
10154
|
registerUpsCarrierErrors,
|
|
10154
10155
|
warehouses
|
|
10155
10156
|
}) => {
|
|
10157
|
+
var _a, _b;
|
|
10158
|
+
features = Object.assign({
|
|
10159
|
+
global: {
|
|
10160
|
+
presentation: {
|
|
10161
|
+
poweredByShipEngine: false
|
|
10162
|
+
}
|
|
10163
|
+
}
|
|
10164
|
+
}, features !== null && features !== void 0 ? features : {});
|
|
10156
10165
|
const {
|
|
10157
10166
|
t
|
|
10158
10167
|
} = useTranslation(["common", "register-wallet"]);
|
|
@@ -10197,7 +10206,7 @@ const Onboarding = ({
|
|
|
10197
10206
|
carrierCode: "dhl_express_walleted",
|
|
10198
10207
|
nickname: "dhl_express_walleted"
|
|
10199
10208
|
})]);
|
|
10200
|
-
} catch (
|
|
10209
|
+
} catch (_c) {
|
|
10201
10210
|
// Errors shown inline for recovery
|
|
10202
10211
|
}
|
|
10203
10212
|
yield onCarrierCreated();
|
|
@@ -10391,7 +10400,9 @@ const Onboarding = ({
|
|
|
10391
10400
|
css: styles$c.step,
|
|
10392
10401
|
label: t("onboarding:steps.payment")
|
|
10393
10402
|
})]
|
|
10394
|
-
})), renderStep(),
|
|
10403
|
+
})), renderStep(), ((_b = (_a = features === null || features === void 0 ? void 0 : features.global) === null || _a === void 0 ? void 0 : _a.presentation) === null || _b === void 0 ? void 0 : _b.poweredByShipEngine) && jsxs(Fragment, {
|
|
10404
|
+
children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
|
|
10405
|
+
})]
|
|
10395
10406
|
}));
|
|
10396
10407
|
};
|
|
10397
10408
|
|
|
@@ -10858,8 +10869,8 @@ const FundAndPurchase = ({
|
|
|
10858
10869
|
const renderActionButtons = (addFundsForm = {}) => jsxs(Fragment, {
|
|
10859
10870
|
children: [isSavingError && jsxs(Fragment, {
|
|
10860
10871
|
children: [jsx(InlineNotification, Object.assign({
|
|
10861
|
-
|
|
10862
|
-
|
|
10872
|
+
title: t("purchase-label:errorMessages.saveRateFailedTitle"),
|
|
10873
|
+
type: NotificationType.ERROR
|
|
10863
10874
|
}, {
|
|
10864
10875
|
children: jsx(Typography, {
|
|
10865
10876
|
children: t("purchase-label:errorMessages.saveRateFailedMessage")
|
|
@@ -11399,56 +11410,39 @@ const LabelLayout = ({
|
|
|
11399
11410
|
});
|
|
11400
11411
|
};
|
|
11401
11412
|
|
|
11402
|
-
|
|
11403
|
-
fundAndPurchase: theme => ({
|
|
11404
|
-
borderTop: `1px solid ${theme.palette.gray.ultraLight}`
|
|
11405
|
-
}),
|
|
11406
|
-
ratesInterstitial: {
|
|
11407
|
-
alignItems: "center",
|
|
11408
|
-
display: "flex",
|
|
11409
|
-
flexDirection: "column",
|
|
11410
|
-
justifyContent: "center",
|
|
11411
|
-
textAlign: "center"
|
|
11412
|
-
},
|
|
11413
|
-
showMoreOrLessRatesButton: {
|
|
11414
|
-
alignItems: "center",
|
|
11415
|
-
display: "flex"
|
|
11416
|
-
}
|
|
11417
|
-
});
|
|
11418
|
-
|
|
11419
|
-
const rateSchema = z.object({
|
|
11420
|
-
rate: z.object({
|
|
11421
|
-
isAcknowledged: z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
|
|
11422
|
-
rateId: z.string()
|
|
11423
|
-
})
|
|
11424
|
-
}).transform(schema => schema.rate.rateId);
|
|
11425
|
-
|
|
11426
|
-
var _path, _path2;
|
|
11413
|
+
var _g, _defs;
|
|
11427
11414
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11428
11415
|
var SvgShipengineLogo = function SvgShipengineLogo(props) {
|
|
11429
11416
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
11430
|
-
width:
|
|
11431
|
-
height:
|
|
11417
|
+
width: 156,
|
|
11418
|
+
height: 20,
|
|
11432
11419
|
fill: "none",
|
|
11433
11420
|
xmlns: "http://www.w3.org/2000/svg"
|
|
11434
|
-
}, props),
|
|
11435
|
-
|
|
11421
|
+
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
11422
|
+
clipPath: "url(#shipengine-logo_svg__a)"
|
|
11423
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
11424
|
+
d: "M16.007 9.91c0-.61-.228-1.144-.686-1.601-.457-.457-.99-.686-1.6-.686-.61 0-1.144.229-1.601.686-.458.457-.686.99-.686 1.6 0 .61.228 1.144.686 1.601.457.458.99.687 1.6.687.61 0 1.144-.23 1.601-.686.458-.458.686-.991.686-1.601Zm4.574-.991V10.9c0 .076 0 .152-.076.229l-.152.152-1.677.229c-.077.305-.23.61-.382.762.229.305.534.686.991 1.22.077.076.077.152.077.228 0 .076 0 .153-.077.229-.152.229-.457.534-.838.99-.381.458-.686.61-.839.61-.076 0-.152 0-.228-.076l-1.296-.991c-.23.153-.534.23-.839.306-.077.838-.152 1.371-.229 1.676 0 .229-.152.305-.304.305H12.73c-.077 0-.153 0-.23-.076-.076-.076-.076-.152-.076-.229l-.228-1.676c-.305-.077-.534-.23-.839-.306l-1.296.992c-.076.076-.152.076-.228.076-.077 0-.153 0-.229-.076-.762-.686-1.22-1.144-1.448-1.525-.077-.076-.077-.152-.077-.229 0-.076 0-.152.077-.229.076-.152.228-.305.457-.61.229-.304.381-.457.457-.61-.152-.304-.305-.61-.38-.914l-1.602-.229c-.076 0-.152-.076-.152-.076s-.077-.076-.077-.152V8.919c0-.077 0-.153.077-.23l.152-.151 1.677-.23c.077-.304.23-.533.382-.837-.229-.305-.534-.763-.991-1.22-.077-.077-.077-.153-.077-.23 0-.075 0-.151.077-.227.152-.23.457-.534.914-.991.458-.458.686-.61.84-.61.076 0 .151 0 .228.076l1.22.99c.228-.152.533-.228.838-.304.077-.84.152-1.372.229-1.677.076-.153.152-.23.305-.23h1.982c.076 0 .152 0 .228.078.077.076.077.152.077.228l.228 1.677c.305.077.534.229.839.305l1.296-.991c.076-.077.152-.077.228-.077.077 0 .153 0 .229.077.762.686 1.296 1.22 1.448 1.525.077.076.077.076.077.228 0 .077 0 .153-.077.229-.076.153-.228.305-.457.61s-.381.457-.457.61c.152.305.305.61.38.838l1.602.229c.076 0 .152.076.152.076s.076.153.076.229Z",
|
|
11436
11425
|
fill: "#45AAF2"
|
|
11437
|
-
})
|
|
11438
|
-
d: "M0
|
|
11426
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
11427
|
+
d: "M0 10.444V9.3a1.087 1.087 0 0 0 .914-.457c.23-.305.306-.686.306-1.144v-4.65c0-.914.305-1.676.838-2.21C2.668.23 3.278 0 4.041 0h1.372v1.296H4.04c-.381 0-.762.152-1.067.534a1.922 1.922 0 0 0-.458 1.295v4.803c0 1.068-.381 1.677-1.067 1.982.686.305 1.067.99 1.067 1.982v4.878c0 .534.153.991.458 1.297.305.38.686.533 1.067.533h1.372v1.22H4.04a2.77 2.77 0 0 1-1.982-.838c-.61-.534-.838-1.296-.838-2.211v-4.727c0-.457-.077-.838-.305-1.143A1.087 1.087 0 0 0 0 10.444Zm22.107 8.08h1.372c.38 0 .762-.152 1.067-.534.305-.381.457-.762.457-1.295v-4.803c0-1.068.381-1.753 1.067-1.982-.686-.305-1.067-.991-1.067-1.982V3.125c0-.533-.152-.99-.457-1.295-.305-.382-.686-.534-1.067-.534h-1.372V0h1.372c.762 0 1.448.305 1.982.839.534.533.838 1.295.838 2.21v4.65c0 .458.076.839.305 1.144.229.305.534.457.839.457v1.144c-.305 0-.534.152-.763.457-.228.305-.305.686-.305 1.143v4.727c0 .914-.305 1.6-.838 2.21-.61.534-1.296.839-2.058.839h-1.372v-1.296Zm11.434-4.955.762-.991c.381.458.839.762 1.372 1.068.534.304 1.144.38 1.83.38a4.62 4.62 0 0 0 1.143-.152c.305-.077.61-.23.762-.457.23-.077.382-.305.458-.458.076-.228.152-.381.152-.61a1.29 1.29 0 0 0-.229-.762 1.78 1.78 0 0 0-.533-.534c-.229-.152-.534-.228-.839-.381-.304-.152-.61-.228-.99-.305-.382-.076-.687-.152-.992-.304a5.292 5.292 0 0 1-.99-.382c-.305-.152-.61-.305-.839-.533-.228-.23-.457-.458-.533-.763a2.436 2.436 0 0 1-.23-1.067c0-.838.306-1.524.992-2.059.686-.533 1.524-.761 2.515-.761 1.525 0 2.745.457 3.66 1.448l-.763.914c-.763-.837-1.753-1.22-2.973-1.22-.61 0-1.144.154-1.525.458-.38.305-.61.686-.61 1.144 0 .229.077.457.23.686.152.229.304.305.533.457.228.153.533.229.838.305.305.077.61.153.992.305.38.153.685.305.99.381.343.094.675.222.991.382.305.152.61.304.84.533.227.229.456.457.532.762.077.305.23.686.23 1.068 0 .305-.077.61-.154.914-.075.305-.228.534-.38.839l-.687.686c-.31.242-.677.4-1.067.457a5.272 5.272 0 0 1-1.524.229c-1.677 0-2.973-.533-3.964-1.677Zm12.12 1.525V4.803h1.296v4.345h6.023V4.726h1.295v10.29H52.98v-4.725h-6.022v4.726h-1.296v.077Zm13.417 0V4.803h1.296v10.29h-1.296Zm6.174 0V4.803h4.117c.99 0 1.753.304 2.363.914.61.61.839 1.372.839 2.21a3.32 3.32 0 0 1-.84 2.212c-.61.533-1.371.838-2.362.838h-2.897v4.117h-1.22Zm1.296-5.26h2.668c.61 0 1.068-.153 1.525-.534.457-.381.61-.838.61-1.448s-.23-1.068-.61-1.449c-.381-.381-.915-.533-1.525-.533h-2.668v3.964Zm9.91 5.26V4.803h7.547V7.09h-4.88v1.6h4.804v2.287h-4.803v1.753h4.879v2.287h-7.547v.077Zm11.587 0V4.803h2.668l4.193 5.64v-5.64h2.667v10.29h-2.591l-4.345-5.945v5.946h-2.592Zm13.34-5.184c0-.762.152-1.525.457-2.211.305-.686.686-1.22 1.22-1.677.534-.457 1.067-.838 1.753-1.067.686-.229 1.372-.381 2.211-.381.534 0 1.067.077 1.525.229.457.152.914.304 1.219.533.381.229.686.534.915.762l.686.915-2.211 1.144a2.62 2.62 0 0 0-.914-.915 2.572 2.572 0 0 0-1.296-.381c-.839 0-1.525.305-2.059.838-.533.534-.838 1.296-.838 2.135 0 .838.305 1.524.838 2.134.534.534 1.22.839 2.059.839.381 0 .686-.077 1.067-.153.381-.152.61-.305.838-.457v-.762h-2.286V9.148h4.955v4.116c-1.22 1.372-2.745 1.982-4.574 1.982a7.077 7.077 0 0 1-2.211-.381 4.528 4.528 0 0 1-1.753-1.068c-.534-.457-.915-.99-1.22-1.676a7.075 7.075 0 0 1-.381-2.211Zm14.103 5.184V4.803h2.668v10.29h-2.668Zm6.937 0V4.803h2.744l4.193 5.64v-5.64h2.668v10.29h-2.592l-4.345-5.945v5.946h-2.668Zm13.874 0V4.803h7.546V7.09h-4.878v1.6h4.802v2.287h-4.802v1.753h4.878v2.287h-7.546v.077Zm11.586-8.767c0-.457.153-.914.534-1.22.381-.304.762-.533 1.22-.533.304 0 .609.077.914.229.305.152.458.38.61.609.153.229.229.534.229.915 0 .457-.153.914-.534 1.22-.381.305-.762.534-1.219.534-.458 0-.915-.153-1.22-.534-.305-.381-.534-.763-.534-1.22Zm.305 0c0 .381.153.762.458 1.068.305.304.686.457 1.067.457.381 0 .762-.153 1.067-.458a1.514 1.514 0 0 0 .457-1.067c0-.457-.152-.762-.457-1.068a1.51 1.51 0 0 0-1.067-.456c-.458 0-.762.152-1.067.457-.305.229-.458.61-.458 1.068v-.001Zm.839.99V5.337h.838c.153 0 .305.077.458.153.152.076.152.228.152.457s-.076.381-.152.457c-.077.077-.229.153-.305.153l.533.838h-.381l-.533-.838h-.382v.838h-.228v-.076Zm.228-.99h.534c.076 0 .152 0 .229-.077.152-.152.152-.228.152-.304 0-.077 0-.229-.076-.305-.076-.077-.153-.077-.229-.077h-.533v.763h-.077Z",
|
|
11439
11428
|
fill: "#162948"
|
|
11440
|
-
})))
|
|
11429
|
+
}))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
11430
|
+
id: "shipengine-logo_svg__a"
|
|
11431
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
11432
|
+
fill: "#fff",
|
|
11433
|
+
d: "M0 0h156v19.82H0z"
|
|
11434
|
+
})))));
|
|
11441
11435
|
};
|
|
11442
11436
|
|
|
11443
|
-
const styles$
|
|
11437
|
+
const styles$5 = createStyles({
|
|
11444
11438
|
poweredByShipEngine: {
|
|
11445
|
-
display: "flex",
|
|
11446
11439
|
alignItems: "center",
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
margin: "1rem 0",
|
|
11440
|
+
color: "#818F9C",
|
|
11441
|
+
display: "flex",
|
|
11450
11442
|
gap: "1rem",
|
|
11451
|
-
|
|
11443
|
+
justifyContent: "center",
|
|
11444
|
+
padding: "1rem 0",
|
|
11445
|
+
textAlign: "center"
|
|
11452
11446
|
}
|
|
11453
11447
|
});
|
|
11454
11448
|
|
|
@@ -11457,16 +11451,40 @@ const PoweredByShipEngine = () => {
|
|
|
11457
11451
|
t
|
|
11458
11452
|
} = useTranslation();
|
|
11459
11453
|
return jsxs("div", Object.assign({
|
|
11460
|
-
css: styles$
|
|
11454
|
+
css: styles$5.poweredByShipEngine
|
|
11461
11455
|
}, {
|
|
11462
11456
|
children: [jsx(Typography, Object.assign({
|
|
11463
|
-
variant: "
|
|
11457
|
+
variant: "body2"
|
|
11464
11458
|
}, {
|
|
11465
11459
|
children: t("powered-by")
|
|
11466
11460
|
})), jsx(SvgShipengineLogo, {})]
|
|
11467
11461
|
}));
|
|
11468
11462
|
};
|
|
11469
11463
|
|
|
11464
|
+
const styles$4 = createStyles({
|
|
11465
|
+
fundAndPurchase: theme => ({
|
|
11466
|
+
borderTop: `1px solid ${theme.palette.gray.ultraLight}`
|
|
11467
|
+
}),
|
|
11468
|
+
ratesInterstitial: {
|
|
11469
|
+
alignItems: "center",
|
|
11470
|
+
display: "flex",
|
|
11471
|
+
flexDirection: "column",
|
|
11472
|
+
justifyContent: "center",
|
|
11473
|
+
textAlign: "center"
|
|
11474
|
+
},
|
|
11475
|
+
showMoreOrLessRatesButton: {
|
|
11476
|
+
alignItems: "center",
|
|
11477
|
+
display: "flex"
|
|
11478
|
+
}
|
|
11479
|
+
});
|
|
11480
|
+
|
|
11481
|
+
const rateSchema = z.object({
|
|
11482
|
+
rate: z.object({
|
|
11483
|
+
isAcknowledged: z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
|
|
11484
|
+
rateId: z.string()
|
|
11485
|
+
})
|
|
11486
|
+
}).transform(schema => schema.rate.rateId);
|
|
11487
|
+
|
|
11470
11488
|
const RateForm = ({
|
|
11471
11489
|
carriers,
|
|
11472
11490
|
disabled,
|
|
@@ -11485,11 +11503,19 @@ const RateForm = ({
|
|
|
11485
11503
|
shipment,
|
|
11486
11504
|
outOfBandDisplayableErrors
|
|
11487
11505
|
}) => {
|
|
11506
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11488
11507
|
features = Object.assign({
|
|
11489
|
-
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11508
|
+
global: {
|
|
11509
|
+
presentation: {
|
|
11510
|
+
poweredByShipEngine: false
|
|
11511
|
+
}
|
|
11512
|
+
},
|
|
11513
|
+
rateForm: {
|
|
11514
|
+
enableGlobalPostFiltering: false,
|
|
11515
|
+
labelLayout: false,
|
|
11516
|
+
nicknameRate: true,
|
|
11517
|
+
saveRate: true
|
|
11518
|
+
}
|
|
11493
11519
|
}, features !== null && features !== void 0 ? features : {});
|
|
11494
11520
|
const allDisplayableErrors = [...(displayableErrors !== null && displayableErrors !== void 0 ? displayableErrors : []), ...(outOfBandDisplayableErrors !== null && outOfBandDisplayableErrors !== void 0 ? outOfBandDisplayableErrors : [])];
|
|
11495
11521
|
const {
|
|
@@ -11526,7 +11552,7 @@ const RateForm = ({
|
|
|
11526
11552
|
});
|
|
11527
11553
|
}
|
|
11528
11554
|
})));
|
|
11529
|
-
const rateOptions = useRateOptions(rates, carriers, shipment, features.enableGlobalPostFiltering);
|
|
11555
|
+
const rateOptions = useRateOptions(rates, carriers, shipment, !!((_a = features === null || features === void 0 ? void 0 : features.rateForm) === null || _a === void 0 ? void 0 : _a.enableGlobalPostFiltering));
|
|
11530
11556
|
// Return true if User has multiple accounts for a single carrier.
|
|
11531
11557
|
const hasDuplicateCarrierCode = carriers => {
|
|
11532
11558
|
const uniqueCarrierCodes = new Set();
|
|
@@ -11598,11 +11624,11 @@ const RateForm = ({
|
|
|
11598
11624
|
name: "rate",
|
|
11599
11625
|
nicknameFeature:
|
|
11600
11626
|
// if feature flag is on, and if account has duplicate carrierCodes, then show nickname
|
|
11601
|
-
features.nicknameRate && carriers && hasDuplicateCarrierCode(carriers),
|
|
11627
|
+
((_b = features === null || features === void 0 ? void 0 : features.rateForm) === null || _b === void 0 ? void 0 : _b.nicknameRate) && carriers && hasDuplicateCarrierCode(carriers),
|
|
11602
11628
|
onClick: onSelectRate,
|
|
11603
11629
|
options: showHiddenRates ? rateOptions : filteredRateOptions
|
|
11604
11630
|
}), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsx(Link, Object.assign({
|
|
11605
|
-
css: styles$
|
|
11631
|
+
css: styles$4.showMoreOrLessRatesButton,
|
|
11606
11632
|
onClick: () => {
|
|
11607
11633
|
var _a;
|
|
11608
11634
|
setShowHiddenRates(!showHiddenRates);
|
|
@@ -11623,7 +11649,7 @@ const RateForm = ({
|
|
|
11623
11649
|
}))
|
|
11624
11650
|
}))]
|
|
11625
11651
|
}) : !isLoading && !!allDisplayableErrors.length ? null : jsxs("article", Object.assign({
|
|
11626
|
-
css: styles$
|
|
11652
|
+
css: styles$4.ratesInterstitial,
|
|
11627
11653
|
role: "presentation"
|
|
11628
11654
|
}, {
|
|
11629
11655
|
children: [jsx(Cube, {
|
|
@@ -11637,7 +11663,7 @@ const RateForm = ({
|
|
|
11637
11663
|
children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
|
|
11638
11664
|
})
|
|
11639
11665
|
}))]
|
|
11640
|
-
})), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
|
|
11666
|
+
})), ((_c = features === null || features === void 0 ? void 0 : features.rateForm) === null || _c === void 0 ? void 0 : _c.labelLayout) && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
|
|
11641
11667
|
title: t("manage-defaults:label.title")
|
|
11642
11668
|
}, {
|
|
11643
11669
|
children: jsx(LabelLayout, {
|
|
@@ -11646,14 +11672,16 @@ const RateForm = ({
|
|
|
11646
11672
|
})), jsx(FundAndPurchase, {
|
|
11647
11673
|
carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
|
|
11648
11674
|
control: form.control,
|
|
11649
|
-
css: styles$
|
|
11675
|
+
css: styles$4.fundAndPurchase,
|
|
11650
11676
|
disabled: disabled,
|
|
11651
|
-
isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
|
|
11677
|
+
isFundingEnabled: !!((_d = features === null || features === void 0 ? void 0 : features.rateForm) === null || _d === void 0 ? void 0 : _d.enableFunding),
|
|
11652
11678
|
isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
|
|
11653
11679
|
onPurchase: handleSubmit,
|
|
11654
11680
|
onSave: handleSaveRate,
|
|
11655
11681
|
purchaseAmount: getTotalRateAmount(selectedRate)
|
|
11656
|
-
}),
|
|
11682
|
+
}), ((_f = (_e = features === null || features === void 0 ? void 0 : features.global) === null || _e === void 0 ? void 0 : _e.presentation) === null || _f === void 0 ? void 0 : _f.poweredByShipEngine) && jsxs(Fragment, {
|
|
11683
|
+
children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
|
|
11684
|
+
})]
|
|
11657
11685
|
}));
|
|
11658
11686
|
};
|
|
11659
11687
|
|
|
@@ -12979,7 +13007,14 @@ const Shipment = ({
|
|
|
12979
13007
|
shipment,
|
|
12980
13008
|
warehouse
|
|
12981
13009
|
}) => {
|
|
12982
|
-
var _a;
|
|
13010
|
+
var _a, _b, _c, _d;
|
|
13011
|
+
features = Object.assign({
|
|
13012
|
+
global: {
|
|
13013
|
+
presentation: {
|
|
13014
|
+
poweredByShipEngine: false
|
|
13015
|
+
}
|
|
13016
|
+
}
|
|
13017
|
+
}, features !== null && features !== void 0 ? features : {});
|
|
12983
13018
|
const {
|
|
12984
13019
|
t
|
|
12985
13020
|
} = useTranslation(["common", "view-shipment"]);
|
|
@@ -13096,7 +13131,7 @@ const Shipment = ({
|
|
|
13096
13131
|
}) : ""].filter(unit => unit.length).join(" ")
|
|
13097
13132
|
}))]
|
|
13098
13133
|
})), jsxs(Section, Object.assign({
|
|
13099
|
-
rightContent: (features === null || features === void 0 ? void 0 : features.schedulePickup) && schedulePickupForCarrier(activeLabel === null || activeLabel === void 0 ? void 0 : activeLabel.carrierCode) ? jsx(Link, Object.assign({
|
|
13134
|
+
rightContent: ((_a = features === null || features === void 0 ? void 0 : features.shipment) === null || _a === void 0 ? void 0 : _a.schedulePickup) && schedulePickupForCarrier(activeLabel === null || activeLabel === void 0 ? void 0 : activeLabel.carrierCode) ? jsx(Link, Object.assign({
|
|
13100
13135
|
css: theme => ({
|
|
13101
13136
|
fontWeight: theme.typography.fontWeight.normal
|
|
13102
13137
|
}),
|
|
@@ -13108,7 +13143,7 @@ const Shipment = ({
|
|
|
13108
13143
|
})) : undefined,
|
|
13109
13144
|
title: t("view-shipment:sections.labels")
|
|
13110
13145
|
}, {
|
|
13111
|
-
children: [(
|
|
13146
|
+
children: [(_b = sortLabels(labels)) === null || _b === void 0 ? void 0 : _b.map((label, i, data) => {
|
|
13112
13147
|
const carrier = carriers === null || carriers === void 0 ? void 0 : carriers.find(c => c.carrierCode === label.carrierCode);
|
|
13113
13148
|
const service = carrier === null || carrier === void 0 ? void 0 : carrier.services.find(s => s.serviceCode === label.serviceCode);
|
|
13114
13149
|
return jsxs(Fragment$1, {
|
|
@@ -13160,7 +13195,9 @@ const Shipment = ({
|
|
|
13160
13195
|
})), "representative."]
|
|
13161
13196
|
}))
|
|
13162
13197
|
}))
|
|
13163
|
-
})),
|
|
13198
|
+
})), ((_d = (_c = features === null || features === void 0 ? void 0 : features.global) === null || _c === void 0 ? void 0 : _c.presentation) === null || _d === void 0 ? void 0 : _d.poweredByShipEngine) && jsxs(Fragment, {
|
|
13199
|
+
children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
|
|
13200
|
+
})]
|
|
13164
13201
|
});
|
|
13165
13202
|
};
|
|
13166
13203
|
|
|
@@ -14422,6 +14459,7 @@ var manageWarehouses = /*#__PURE__*/Object.freeze({
|
|
|
14422
14459
|
});
|
|
14423
14460
|
|
|
14424
14461
|
const Component$3 = ({
|
|
14462
|
+
features,
|
|
14425
14463
|
onCompleteOnboarding
|
|
14426
14464
|
}) => {
|
|
14427
14465
|
const {
|
|
@@ -14465,6 +14503,7 @@ const Component$3 = ({
|
|
|
14465
14503
|
return jsx(Onboarding, {
|
|
14466
14504
|
carriers: carriers,
|
|
14467
14505
|
createWarehouse: createWarehouse,
|
|
14506
|
+
features: features,
|
|
14468
14507
|
onCarrierCreated: onCarrierCreated,
|
|
14469
14508
|
onCompleteOnboarding: onCompleteOnboarding,
|
|
14470
14509
|
onWarehouseCreated: onWarehouseCreated,
|
|
@@ -15197,7 +15236,7 @@ const ConfigureShipment = _a => {
|
|
|
15197
15236
|
onDirty: handleOnDirty
|
|
15198
15237
|
})), jsx(RateForm, Object.assign({}, rateFormProps, {
|
|
15199
15238
|
disabled: charsetWarning === null || charsetWarning === void 0 ? void 0 : charsetWarning.error,
|
|
15200
|
-
features: features
|
|
15239
|
+
features: features,
|
|
15201
15240
|
onSelectRate: resetLabel,
|
|
15202
15241
|
outOfBandDisplayableErrors: shipmentFormProps.displayableErrors
|
|
15203
15242
|
}))]
|
|
@@ -15414,7 +15453,6 @@ const useGetOrCreateShipment = shipmentId => {
|
|
|
15414
15453
|
[]);
|
|
15415
15454
|
return useQuery({
|
|
15416
15455
|
onError,
|
|
15417
|
-
retry: shipmentId !== undefined,
|
|
15418
15456
|
queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15419
15457
|
var _a;
|
|
15420
15458
|
if (shipmentId) {
|
|
@@ -15424,10 +15462,10 @@ const useGetOrCreateShipment = shipmentId => {
|
|
|
15424
15462
|
const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
|
|
15425
15463
|
if (defaultOrFirstWarehouse === undefined) {
|
|
15426
15464
|
throw [CodedError.fromObject({
|
|
15427
|
-
message: "errorMessages.noWarehouses",
|
|
15428
|
-
errorType: "unknown",
|
|
15429
15465
|
errorCode: "unknown",
|
|
15430
|
-
errorSource: "client"
|
|
15466
|
+
errorSource: "client",
|
|
15467
|
+
errorType: "unknown",
|
|
15468
|
+
message: "errorMessages.noWarehouses"
|
|
15431
15469
|
})];
|
|
15432
15470
|
}
|
|
15433
15471
|
const shipTo = {
|
|
@@ -15446,7 +15484,8 @@ const useGetOrCreateShipment = shipmentId => {
|
|
|
15446
15484
|
return newShipment.data.shipments[0];
|
|
15447
15485
|
}
|
|
15448
15486
|
}),
|
|
15449
|
-
queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
|
|
15487
|
+
queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`],
|
|
15488
|
+
retry: shipmentId !== undefined
|
|
15450
15489
|
});
|
|
15451
15490
|
};
|
|
15452
15491
|
|
|
@@ -15557,7 +15596,7 @@ const Component$1 = ({
|
|
|
15557
15596
|
});
|
|
15558
15597
|
return jsx(Shipment, {
|
|
15559
15598
|
carriers: carriers.data,
|
|
15560
|
-
features: features
|
|
15599
|
+
features: features,
|
|
15561
15600
|
labels: labels.data,
|
|
15562
15601
|
onClickPrintLabel: onClickPrintLabel,
|
|
15563
15602
|
onClickPurchaseLabel: onClickPurchaseLabel,
|
|
@@ -15689,12 +15728,20 @@ const Message = ({
|
|
|
15689
15728
|
};
|
|
15690
15729
|
|
|
15691
15730
|
const Component = ({
|
|
15731
|
+
features,
|
|
15692
15732
|
labelId,
|
|
15693
15733
|
onComplete,
|
|
15694
15734
|
onSuccess,
|
|
15695
15735
|
onViewShipment
|
|
15696
15736
|
}) => {
|
|
15697
|
-
var _a;
|
|
15737
|
+
var _a, _b, _c;
|
|
15738
|
+
features = Object.assign({
|
|
15739
|
+
global: {
|
|
15740
|
+
presentation: {
|
|
15741
|
+
poweredByShipEngine: false
|
|
15742
|
+
}
|
|
15743
|
+
}
|
|
15744
|
+
}, features !== null && features !== void 0 ? features : {});
|
|
15698
15745
|
// TODO [LMNT-910] - labelId should be a required prop
|
|
15699
15746
|
if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
|
|
15700
15747
|
const {
|
|
@@ -15728,7 +15775,9 @@ const Component = ({
|
|
|
15728
15775
|
onViewShipment: onViewShipment,
|
|
15729
15776
|
shipment: shipment.data,
|
|
15730
15777
|
voidRequest: voidLabel.data
|
|
15731
|
-
}),
|
|
15778
|
+
}), ((_c = (_b = features === null || features === void 0 ? void 0 : features.global) === null || _b === void 0 ? void 0 : _b.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxs(Fragment, {
|
|
15779
|
+
children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
|
|
15780
|
+
})]
|
|
15732
15781
|
});
|
|
15733
15782
|
};
|
|
15734
15783
|
const Element = alchemy.createElement(Component, ErrorFallback, {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare const styles: {
|
|
2
2
|
poweredByShipEngine: {
|
|
3
|
-
display: "flex";
|
|
4
3
|
alignItems: "center";
|
|
4
|
+
color: "#818F9C";
|
|
5
|
+
display: "flex";
|
|
6
|
+
gap: string;
|
|
5
7
|
justifyContent: "center";
|
|
8
|
+
padding: string;
|
|
6
9
|
textAlign: "center";
|
|
7
|
-
margin: string;
|
|
8
|
-
gap: string;
|
|
9
|
-
color: "#818F9C";
|
|
10
10
|
};
|
|
11
11
|
};
|
|
@@ -12,9 +12,17 @@ export type ValidateBilling = {
|
|
|
12
12
|
type: "billing";
|
|
13
13
|
};
|
|
14
14
|
export type ValidateAddress = ValidateWarehouse | ValidateBilling;
|
|
15
|
+
export type OnboardingFeatures = {
|
|
16
|
+
global?: {
|
|
17
|
+
presentation?: {
|
|
18
|
+
poweredByShipEngine?: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
15
22
|
export type OnboardingProps = {
|
|
16
23
|
carriers: SE.Carrier[];
|
|
17
24
|
createWarehouse: (payload: Partial<SE.Warehouse>) => Promise<SE.Warehouse>;
|
|
25
|
+
features?: OnboardingFeatures;
|
|
18
26
|
onCarrierCreated: () => Promise<void>;
|
|
19
27
|
onCompleteOnboarding: () => void;
|
|
20
28
|
onWarehouseCreated: () => Promise<void>;
|
|
@@ -26,4 +34,4 @@ export type OnboardingProps = {
|
|
|
26
34
|
registerUpsCarrierErrors: SE.CodedError[] | null;
|
|
27
35
|
warehouses: SE.Warehouse[];
|
|
28
36
|
};
|
|
29
|
-
export declare const Onboarding: ({ carriers, createWarehouse, onCarrierCreated, onCompleteOnboarding, onWarehouseCreated, registerDhlCarrier, registerDhlCarrierErrors, registerStampsCarrier, registerStampsCarrierErrors, registerUpsCarrier, registerUpsCarrierErrors, warehouses, }: OnboardingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const Onboarding: ({ carriers, createWarehouse, features, onCarrierCreated, onCompleteOnboarding, onWarehouseCreated, registerDhlCarrier, registerDhlCarrierErrors, registerStampsCarrier, registerStampsCarrierErrors, registerUpsCarrier, registerUpsCarrierErrors, warehouses, }: OnboardingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { SE } from "@shipengine/alchemy";
|
|
2
|
-
|
|
3
|
-
enableFunding?: boolean;
|
|
4
|
-
enableGlobalPostFiltering?: boolean;
|
|
5
|
-
labelLayout?: boolean;
|
|
6
|
-
nicknameRate?: boolean;
|
|
7
|
-
saveRate?: boolean;
|
|
8
|
-
};
|
|
2
|
+
import { ConfigureShipmentFeatures } from "../../../elements/configure-shipment";
|
|
9
3
|
export type RateFormProps = {
|
|
10
4
|
carriers?: SE.Carrier[];
|
|
11
5
|
disabled?: boolean;
|
|
12
6
|
displayableErrors?: string[];
|
|
13
7
|
displayableLabelErrors?: string[];
|
|
14
8
|
errors?: SE.CodedError[];
|
|
15
|
-
features?:
|
|
9
|
+
features?: Pick<ConfigureShipmentFeatures, "global" | "rateForm">;
|
|
16
10
|
isLoading?: boolean;
|
|
17
11
|
labelErrors?: SE.CodedError[];
|
|
18
12
|
labels?: SE.Label[];
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { SE } from "@shipengine/alchemy";
|
|
2
2
|
export declare const schedulePickupForCarrier: (carrierCode?: string, plaftformSchedulePickupUrl?: string) => string | undefined;
|
|
3
3
|
export type ShipmentFeatures = {
|
|
4
|
-
|
|
4
|
+
global?: {
|
|
5
|
+
presentation?: {
|
|
6
|
+
poweredByShipEngine?: boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
shipment?: {
|
|
10
|
+
schedulePickup?: boolean;
|
|
11
|
+
};
|
|
5
12
|
};
|
|
6
13
|
export type ShipmentProps = {
|
|
7
14
|
carriers?: SE.Carrier[];
|
|
@@ -3,9 +3,21 @@ import { Templates } from "../../components";
|
|
|
3
3
|
import { UseShippingPresetsOptionsProps } from "../../hooks";
|
|
4
4
|
import { UseRatesFormProps, UseShipmentFormProps } from "./hooks";
|
|
5
5
|
export type ShipmentFormMode = "browse_rates" | "select_service";
|
|
6
|
+
export type RateFormFeatures = {
|
|
7
|
+
enableFunding?: boolean;
|
|
8
|
+
enableGlobalPostFiltering?: boolean;
|
|
9
|
+
labelLayout?: boolean;
|
|
10
|
+
nicknameRate?: boolean;
|
|
11
|
+
saveRate?: boolean;
|
|
12
|
+
};
|
|
6
13
|
export type ConfigureShipmentFeatures = {
|
|
7
14
|
compatibleCountryCodes?: UseShipmentFormProps["compatibleCountryCodes"];
|
|
8
|
-
|
|
15
|
+
global?: {
|
|
16
|
+
presentation?: {
|
|
17
|
+
poweredByShipEngine?: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
rateForm?: RateFormFeatures;
|
|
9
21
|
shipmentForm?: Templates.ShipmentFormFeatures;
|
|
10
22
|
};
|
|
11
23
|
export type ConfigureShipmentProps = {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { OnboardingProps } from "../../components/templates";
|
|
2
3
|
export type ComponentProps = {
|
|
4
|
+
features?: OnboardingProps["features"];
|
|
3
5
|
onCompleteOnboarding: () => void;
|
|
4
6
|
};
|
|
5
|
-
export declare const Component: ({ onCompleteOnboarding }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Component: ({ features, onCompleteOnboarding }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
8
|
export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
7
9
|
resources?: {
|
|
8
10
|
en: {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SE } from "@shipengine/alchemy";
|
|
3
3
|
import { Templates } from "../../components";
|
|
4
|
-
export type Features = {
|
|
5
|
-
shipment?: Templates.ShipmentFeatures;
|
|
6
|
-
};
|
|
7
4
|
export type ComponentProps = {
|
|
8
|
-
features
|
|
5
|
+
features?: Templates.ShipmentFeatures;
|
|
9
6
|
onClickPrintLabel?: () => void;
|
|
10
7
|
onClickPurchaseLabel?: (order: SE.SalesOrder) => void;
|
|
11
8
|
onClickVoidLabel?: (label: SE.Label) => void;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SE } from "@shipengine/alchemy";
|
|
3
3
|
export type ComponentProps = {
|
|
4
|
+
features: {
|
|
5
|
+
global?: {
|
|
6
|
+
presentation?: {
|
|
7
|
+
poweredByShipEngine?: boolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
4
11
|
labelId?: string;
|
|
5
12
|
onComplete: (request: SE.VoidRequest, shipment: SE.SalesOrderShipment) => void;
|
|
6
13
|
onSuccess?: (label: SE.Label, shipment: SE.SalesOrderShipment) => void;
|
|
7
14
|
onViewShipment: (shipment: SE.SalesOrderShipment) => void;
|
|
8
15
|
};
|
|
9
|
-
export declare const Component: ({ labelId, onComplete, onSuccess, onViewShipment }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Component: ({ features, labelId, onComplete, onSuccess, onViewShipment, }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
17
|
export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
11
18
|
resources?: {
|
|
12
19
|
en: {
|