@propeller-commerce/propeller-v2-react-ui 0.19.1 → 0.20.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/CHANGELOG.md +107 -0
- package/dist/index.cjs +67 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -27
- package/dist/index.d.ts +46 -27
- package/dist/index.js +68 -79
- package/dist/index.js.map +1 -1
- package/dist/pure.cjs +3 -2
- package/dist/pure.cjs.map +1 -1
- package/dist/pure.d.cts +6 -4
- package/dist/pure.d.ts +6 -4
- package/dist/pure.js +3 -2
- package/dist/pure.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -2
- package/dist/shared.d.cts +0 -24
- package/dist/shared.d.ts +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,113 @@ once it reaches 1.0. Until then (the `0.x` line) the public API may change
|
|
|
8
8
|
between minor versions; breaking changes are called out below and in
|
|
9
9
|
[MIGRATION.md](./MIGRATION.md).
|
|
10
10
|
|
|
11
|
+
## [0.20.0] - 2026-09-21
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- `FavoriteListDetails` and `useCart.getCrossupsells` priced items for the
|
|
16
|
+
contact's default company instead of the company selected in the switcher, so
|
|
17
|
+
a multi-company contact saw the wrong prices while the cart charged the
|
|
18
|
+
selected company's. Both now resolve the active company as
|
|
19
|
+
`companyId ?? user.company.companyId`, matching `useProductSlider`.
|
|
20
|
+
- `FavoriteListDetails` and `CartItem` fetched only on mount, leaving stale
|
|
21
|
+
prices on screen after a company switch. Both now re-fetch when `companyId`
|
|
22
|
+
changes.
|
|
23
|
+
|
|
24
|
+
- The closed `CartIconAndSidebar` panel widened the document by its own content
|
|
25
|
+
width (~128px once the cart had items), giving signed-in users a stray
|
|
26
|
+
horizontal scrollbar. A transform does not remove an element from scrollable
|
|
27
|
+
overflow, so the parked drawer is now `visibility: hidden` while closed.
|
|
28
|
+
(PWP-1002)
|
|
29
|
+
- `ProductDescription`, `ProductShortDescription`, `CategoryDescription` and
|
|
30
|
+
`CategoryShortDescription` emitted Tailwind Typography `prose` classes, but
|
|
31
|
+
the plugin is installed neither here nor in the consuming apps — so the
|
|
32
|
+
classes compiled to nothing while this package's own Preflight stripped list
|
|
33
|
+
markers, and bullet lists rendered as bare lines. The four surfaces now carry
|
|
34
|
+
real styling in `dist/styles.css`, with no consumer plugin required.
|
|
35
|
+
(PWP-1000)
|
|
36
|
+
- `ItemStock` rendered `(120pcs)` with no separator between the count and the
|
|
37
|
+
unit label. (PWP-1005a)
|
|
38
|
+
- `OrderList` filter labels carried Tailwind's `capitalize`, which title-cases
|
|
39
|
+
every word and mangled translated labels ("Terme De Recherche",
|
|
40
|
+
"Aangemaakt Op"). The dictionaries already carry the right casing.
|
|
41
|
+
(PWP-1005b)
|
|
42
|
+
- `AccountIconAndMenu` hardcoded a dark-header scheme (`text-white`,
|
|
43
|
+
`hover:bg-white/10`) that rendered white-on-light, and styled its active
|
|
44
|
+
sidebar link with the `secondary` ramp where every other selected surface in
|
|
45
|
+
the package uses `primary`. Both now use theme tokens. (PWP-1005c)
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- `FavoriteListDetails` accepts a `companyId` prop, resolved from
|
|
50
|
+
`PropellerProvider` when omitted.
|
|
51
|
+
- `AccountIconAndMenu` accepts a `linkClassName` prop for its sidebar links,
|
|
52
|
+
which previously had no class escape hatch. (PWP-1005c)
|
|
53
|
+
|
|
54
|
+
- The purchase-authorization rule existed in three divergent copies — `useCart`
|
|
55
|
+
compared `<=`, `CartSummary` and `CartIconAndSidebar` compared `>`, and only
|
|
56
|
+
`CartSummary` coerced `companyId` numerically, so a string company id from a
|
|
57
|
+
cookie matched in one place and not the others. All three now call
|
|
58
|
+
`isOverAuthorizationLimit` from core-ui.
|
|
59
|
+
|
|
60
|
+
This also fixes the hook failing open: `useCart.checkoutAllowed` returned
|
|
61
|
+
`true` when its own internal cart was null, which it is until the consumer
|
|
62
|
+
calls `addItem`/`resolveCart` — so an app reading it for a cart it fetched
|
|
63
|
+
itself was told an over-limit cart could check out. (PWP-988)
|
|
64
|
+
|
|
65
|
+
### Removed
|
|
66
|
+
|
|
67
|
+
- **Breaking:** `ProductGrid.renderProductCard` and `renderClusterCard`. Both
|
|
68
|
+
were declared in the public type but never invoked — only tested for
|
|
69
|
+
truthiness, which suppressed the default card and rendered nothing. Setting
|
|
70
|
+
either produced an empty grid. They were superseded by the compound-component
|
|
71
|
+
work that introduced `productCardComponent` / `clusterCardComponent`; the call
|
|
72
|
+
that used them was replaced then, and only the guard survived. Use
|
|
73
|
+
`productCardComponent` / `clusterCardComponent` to swap a whole card, or
|
|
74
|
+
`ProductGrid.Items.renderItem` for per-item control. No working usage was
|
|
75
|
+
possible, so nothing that functioned is lost. (PWP-985)
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
|
|
79
|
+
- `ProductDownloads.downloads` and `ProductVideos.videos` are now optional and
|
|
80
|
+
nullable, matching what the API actually returns — it answers `null`, not an
|
|
81
|
+
empty page, when a product has no documents or videos. Both components
|
|
82
|
+
already handled the absent case; only the types disagreed, which forced casts
|
|
83
|
+
at the `ProductTabs` call sites. Those are gone. (PWP-1009)
|
|
84
|
+
- `GridPagination.products` is now structural (`{ page, pages }`) instead of a
|
|
85
|
+
full `ProductsResponse`. A real response still fits; callers holding the two
|
|
86
|
+
numbers on their own no longer need a cast. (PWP-1005e)
|
|
87
|
+
- **Breaking (types):** `GridToolbar.viewMode` and `onViewChange` are narrowed
|
|
88
|
+
from `string` to `'grid' | 'list'`, matching their documented contract. A
|
|
89
|
+
consumer passing a plain `string` will need a cast or a narrower type.
|
|
90
|
+
(PWP-1005d)
|
|
91
|
+
|
|
92
|
+
## [0.19.2] - 2026-08-27
|
|
93
|
+
|
|
94
|
+
### Fixed
|
|
95
|
+
|
|
96
|
+
- **Money formatted at the Dutch default wherever the host didn't pass
|
|
97
|
+
`language`.** `localeForLanguage(undefined)` is `nl-NL`, so a component that
|
|
98
|
+
reads `props.language` straight off its props prints Dutch separators unless
|
|
99
|
+
every host remembers to thread the prop. `ProductCard` resolved it from
|
|
100
|
+
`<PropellerProvider>`; several others did not, so one English page could show
|
|
101
|
+
`€ 1,42` in its PDP hero price and `€1.70` on the cards beneath it.
|
|
102
|
+
- `ProductPrice` and `ProductBulkPrices` already had provider-resolving
|
|
103
|
+
wrappers on the main entry — but `OrderSummary` and `OrderTotals` did not,
|
|
104
|
+
and are exported from both entries, so a client host got the unresolved
|
|
105
|
+
build with no way to tell. Both now resolve `language` and `currency` from
|
|
106
|
+
the provider on the main entry; `/pure` still exports the context-free
|
|
107
|
+
versions for Server Components, which must pass `language` themselves.
|
|
108
|
+
- `CartCarriers` now resolves its infra props like the rest of the checkout
|
|
109
|
+
components, instead of reading them off its props.
|
|
110
|
+
|
|
111
|
+
### Internal
|
|
112
|
+
|
|
113
|
+
- Vitest now uses the automatic JSX runtime, matching the tsup build. It had
|
|
114
|
+
been defaulting to the classic runtime, so any source file importing only
|
|
115
|
+
named hooks — the context providers among them — threw "React is not defined"
|
|
116
|
+
under test while building and shipping perfectly well.
|
|
117
|
+
|
|
11
118
|
## [0.19.1] - 2026-08-26
|
|
12
119
|
|
|
13
120
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -745,6 +745,7 @@ var DEFAULT_IMAGE_VARIANT_FILTERS = {
|
|
|
745
745
|
function useCart(options) {
|
|
746
746
|
const { graphqlClient, user, companyId, configuration, onCartCreated } = options;
|
|
747
747
|
const language = options.language || configuration?.language || "NL";
|
|
748
|
+
const resolvedCompanyId = companyId ?? (user && "contactId" in user ? user.company?.companyId : void 0);
|
|
748
749
|
const [cart, setCart] = React6.useState(null);
|
|
749
750
|
const [createdCartId, setCreatedCartId] = React6.useState("");
|
|
750
751
|
const cartId = options.cartId || createdCartId;
|
|
@@ -766,20 +767,10 @@ function useCart(options) {
|
|
|
766
767
|
const [loading, setLoading] = React6.useState(false);
|
|
767
768
|
const [error, setError] = React6.useState(null);
|
|
768
769
|
const notesTimers = React6.useRef({});
|
|
769
|
-
const checkoutAllowed = React6.useMemo(
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
const pacData = user.purchaseAuthorizationConfigs;
|
|
774
|
-
const items = pacData?.items ?? [];
|
|
775
|
-
const purchaserPac = items.find(
|
|
776
|
-
(pac) => pac.purchaseRole === propellerSdkV2.PurchaseRole.PURCHASER && pac.company?.companyId === companyId
|
|
777
|
-
);
|
|
778
|
-
if (!purchaserPac) return true;
|
|
779
|
-
const limit = purchaserPac.authorizationLimit ?? 0;
|
|
780
|
-
const totalGross = cart.total?.totalGross ?? 0;
|
|
781
|
-
return totalGross <= limit;
|
|
782
|
-
}, [user, companyId, cart]);
|
|
770
|
+
const checkoutAllowed = React6.useMemo(
|
|
771
|
+
() => propellerV2CoreUi.isCheckoutAllowed(user, companyId, cart),
|
|
772
|
+
[user, companyId, cart]
|
|
773
|
+
);
|
|
783
774
|
function getMinQuantity(product) {
|
|
784
775
|
const min = product?.minimumQuantity;
|
|
785
776
|
return min && min > 0 ? min : 1;
|
|
@@ -968,7 +959,8 @@ function useCart(options) {
|
|
|
968
959
|
imageVariantFilters: opts.imageVariantFilters ?? imageVariantFilters(),
|
|
969
960
|
priceCalculateProductInput: {
|
|
970
961
|
taxZone: taxZone || "NL",
|
|
971
|
-
|
|
962
|
+
// Switcher selection wins; the contact's default company is the fallback.
|
|
963
|
+
...resolvedCompanyId !== void 0 && { companyId: resolvedCompanyId },
|
|
972
964
|
...user && "contactId" in user && { contactId: user?.contactId },
|
|
973
965
|
...user && "customerId" in user && { customerId: user?.customerId }
|
|
974
966
|
}
|
|
@@ -978,7 +970,7 @@ function useCart(options) {
|
|
|
978
970
|
} catch {
|
|
979
971
|
return [];
|
|
980
972
|
}
|
|
981
|
-
}, [graphqlClient, language, user, imageSearchFilters, imageVariantFilters]);
|
|
973
|
+
}, [graphqlClient, language, user, resolvedCompanyId, imageSearchFilters, imageVariantFilters]);
|
|
982
974
|
return { cart, cartId, loading, error, checkoutAllowed, resolveCart, addItem, addItems, updateItemQuantity, updateItemNotes, deleteItem, addActionCode, removeActionCode, requestAuthorization, processCart, getCrossupsells, getMinQuantity, getStep };
|
|
983
975
|
}
|
|
984
976
|
function buildAddressInput(type, addr) {
|
|
@@ -4211,7 +4203,9 @@ function AccountIconAndMenu(rawProps) {
|
|
|
4211
4203
|
href: link.href,
|
|
4212
4204
|
onClick: (event) => handleMenuLinkClick(event, link.href),
|
|
4213
4205
|
"data-active": isActiveLink(link.href) ? "true" : "false",
|
|
4214
|
-
className:
|
|
4206
|
+
className: cn(
|
|
4207
|
+
`propeller-account-menu__link flex w-full items-center gap-3 px-4 py-2.5 text-sm font-medium transition-colors ${isActiveLink(link.href) ? "bg-primary/5 text-primary border-l-2 border-primary" : "text-muted-foreground hover:bg-surface-hover hover:text-foreground"}${props.linkClassName ? " " + props.linkClassName : ""}`
|
|
4208
|
+
),
|
|
4215
4209
|
children: link.label
|
|
4216
4210
|
}
|
|
4217
4211
|
) }, link.href)) }) }),
|
|
@@ -4233,7 +4227,7 @@ function AccountIconAndMenu(rawProps) {
|
|
|
4233
4227
|
onClick: (event) => handleIconClick(),
|
|
4234
4228
|
"aria-label": propellerV2CoreUi.getLabel(props.labels, "accountLabel", "Account"),
|
|
4235
4229
|
"data-open": menuOpen ? "true" : "false",
|
|
4236
|
-
className: cn(`propeller-account-menu__trigger inline-flex items-center gap-2 px-3 py-2 rounded-control text-sm font-medium transition-colors text-
|
|
4230
|
+
className: cn(`propeller-account-menu__trigger inline-flex items-center gap-2 px-3 py-2 rounded-control text-sm font-medium transition-colors text-foreground hover:bg-surface-hover${props.iconClassName ? " " + props.iconClassName : ""}`),
|
|
4237
4231
|
children: [
|
|
4238
4232
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4239
4233
|
"svg",
|
|
@@ -6511,7 +6505,8 @@ function pickPreselected(items, stored, keyOf) {
|
|
|
6511
6505
|
const list = items || [];
|
|
6512
6506
|
return (stored ? list.find((item) => keyOf(item) === stored) : void 0) || list[0];
|
|
6513
6507
|
}
|
|
6514
|
-
function CartCarriers(
|
|
6508
|
+
function CartCarriers(rawProps) {
|
|
6509
|
+
const props = useInfraProps(rawProps);
|
|
6515
6510
|
const [selectedName, setSelectedName] = React6.useState("");
|
|
6516
6511
|
const containerClass = props.carriersContainerClass || "cart-carriers";
|
|
6517
6512
|
const showLogo = props.showCarrierLogo !== false;
|
|
@@ -6630,6 +6625,7 @@ function ItemStock(props) {
|
|
|
6630
6625
|
getTotalQuantity() > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "propeller-item-stock__count opacity-70", children: [
|
|
6631
6626
|
"(",
|
|
6632
6627
|
getTotalQuantity(),
|
|
6628
|
+
" ",
|
|
6633
6629
|
propellerV2CoreUi.getLabel(props.labels, "pieces", "pcs"),
|
|
6634
6630
|
")"
|
|
6635
6631
|
] }) : null
|
|
@@ -6863,7 +6859,7 @@ function CartItem(rawProps) {
|
|
|
6863
6859
|
}
|
|
6864
6860
|
React6.useEffect(() => {
|
|
6865
6861
|
fetchCrossupsells();
|
|
6866
|
-
}, []);
|
|
6862
|
+
}, [props.companyId]);
|
|
6867
6863
|
React6.useEffect(() => {
|
|
6868
6864
|
setQuantity(props.cartItem.quantity || 1);
|
|
6869
6865
|
setNotes(props.cartItem.notes || "");
|
|
@@ -7317,13 +7313,6 @@ CartItemExport.Price = CartItemPrice;
|
|
|
7317
7313
|
CartItemExport.Quantity = CartItemQuantity;
|
|
7318
7314
|
CartItemExport.Delete = CartItemDelete;
|
|
7319
7315
|
var CartItem_default = CartItemExport;
|
|
7320
|
-
function findPurchaserPAC(user, companyId) {
|
|
7321
|
-
if (!user || !("contactId" in user) || !companyId) return void 0;
|
|
7322
|
-
const items = user.purchaseAuthorizationConfigs?.items ?? [];
|
|
7323
|
-
return items.find(
|
|
7324
|
-
(pac) => pac.purchaseRole === propellerSdkV2.PurchaseRole.PURCHASER && pac.company?.companyId === companyId
|
|
7325
|
-
);
|
|
7326
|
-
}
|
|
7327
7316
|
function CartIconAndSidebar(rawProps) {
|
|
7328
7317
|
const props = useInfraProps(rawProps);
|
|
7329
7318
|
const CartBonusItemsImpl = props.cartBonusItemsComponent ?? CartBonusItems_default;
|
|
@@ -7354,10 +7343,9 @@ function CartIconAndSidebar(rawProps) {
|
|
|
7354
7343
|
return useTax ? propellerV2CoreUi.getLabel(props.labels, key, "Total") : propellerV2CoreUi.getLabel(props.labels, "totalExclVat", "Total excl. VAT");
|
|
7355
7344
|
}
|
|
7356
7345
|
const sidebarTitle = props.cartSidebarTitle || props.labels?.["cartSidebarTitle"] || "Shopping cart";
|
|
7357
|
-
const purchaserPAC =
|
|
7358
|
-
const
|
|
7359
|
-
const
|
|
7360
|
-
const showCheckoutButton = props.cartCheckoutButton === false ? false : !props.user || !("contactId" in props.user) || !props.companyId || !purchaserPAC ? true : !overLimit;
|
|
7346
|
+
const purchaserPAC = propellerV2CoreUi.findPurchaserPac(props.user, props.companyId);
|
|
7347
|
+
const overLimit = propellerV2CoreUi.isOverAuthorizationLimit(props.user, props.companyId, props.cart);
|
|
7348
|
+
const showCheckoutButton = props.cartCheckoutButton === false ? false : !purchaserPAC ? true : !overLimit;
|
|
7361
7349
|
const showRequestAuthorizationButton = !!purchaserPAC && overLimit;
|
|
7362
7350
|
function handleIconClick() {
|
|
7363
7351
|
if (props.showCartSidebarOnClick !== false) {
|
|
@@ -7970,17 +7958,7 @@ function CartSummary(rawProps) {
|
|
|
7970
7958
|
}
|
|
7971
7959
|
}
|
|
7972
7960
|
function showRequestAuthorizationButton() {
|
|
7973
|
-
|
|
7974
|
-
if (!props.companyId) return false;
|
|
7975
|
-
if (!props.cart) return false;
|
|
7976
|
-
const items = props.user.purchaseAuthorizationConfigs?.items ?? [];
|
|
7977
|
-
const purchaserPAC = items.find(
|
|
7978
|
-
(pac) => pac.purchaseRole === propellerSdkV2.PurchaseRole.PURCHASER && Number(pac.company?.companyId) === Number(props.companyId)
|
|
7979
|
-
);
|
|
7980
|
-
if (!purchaserPAC) return false;
|
|
7981
|
-
const limit = purchaserPAC.authorizationLimit ?? 0;
|
|
7982
|
-
const totalGross = props.cart.total?.totalGross ?? 0;
|
|
7983
|
-
return totalGross > limit;
|
|
7961
|
+
return propellerV2CoreUi.isOverAuthorizationLimit(props.user, props.companyId, props.cart);
|
|
7984
7962
|
}
|
|
7985
7963
|
function showRequestQuoteButton() {
|
|
7986
7964
|
return !!props.onRequestQuoteClick && !!props.user && "contactId" in props.user;
|
|
@@ -8120,7 +8098,7 @@ function CategoryDescription(props) {
|
|
|
8120
8098
|
!shouldTruncate || expanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8121
8099
|
"div",
|
|
8122
8100
|
{
|
|
8123
|
-
className: "propeller-category-description__content
|
|
8101
|
+
className: "propeller-category-description__content text-muted-foreground",
|
|
8124
8102
|
dangerouslySetInnerHTML: { __html: html }
|
|
8125
8103
|
}
|
|
8126
8104
|
) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "propeller-category-description__truncated text-muted-foreground", children: getTruncated() }),
|
|
@@ -8146,7 +8124,7 @@ function CategoryShortDescription(props) {
|
|
|
8146
8124
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!html ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-category-short-description mb-6 ${props.className || ""}`), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8147
8125
|
"div",
|
|
8148
8126
|
{
|
|
8149
|
-
className: "propeller-category-short-description__content
|
|
8127
|
+
className: "propeller-category-short-description__content text-muted-foreground",
|
|
8150
8128
|
dangerouslySetInnerHTML: { __html: html }
|
|
8151
8129
|
}
|
|
8152
8130
|
) }) : null });
|
|
@@ -9386,27 +9364,24 @@ function ProductGrid(rawProps) {
|
|
|
9386
9364
|
{
|
|
9387
9365
|
children: [
|
|
9388
9366
|
props.beforeItem?.(item, idx),
|
|
9389
|
-
/* @__PURE__ */ jsxRuntime.
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
}
|
|
9408
|
-
) : null }) : null
|
|
9409
|
-
] }),
|
|
9367
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: isClusterItem(item) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9368
|
+
ClusterCardImpl,
|
|
9369
|
+
{
|
|
9370
|
+
cluster: item,
|
|
9371
|
+
labels: props.clusterCardLabels,
|
|
9372
|
+
stockLabels: props.stockLabels
|
|
9373
|
+
}
|
|
9374
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
9375
|
+
ProductCardImpl,
|
|
9376
|
+
{
|
|
9377
|
+
product: item,
|
|
9378
|
+
allowAddToCart: showAddToCart(),
|
|
9379
|
+
labels: props.productCardLabels,
|
|
9380
|
+
stockLabels: props.stockLabels,
|
|
9381
|
+
priceLabels: props.priceLabels,
|
|
9382
|
+
addToCartLabels: props.addToCartLabels
|
|
9383
|
+
}
|
|
9384
|
+
) }),
|
|
9410
9385
|
props.afterItem?.(item, idx)
|
|
9411
9386
|
]
|
|
9412
9387
|
},
|
|
@@ -11928,8 +11903,9 @@ function FavoriteListDetails(rawProps) {
|
|
|
11928
11903
|
if (contact.contactId) {
|
|
11929
11904
|
priceInput.contactId = contact.contactId;
|
|
11930
11905
|
}
|
|
11931
|
-
|
|
11932
|
-
|
|
11906
|
+
const activeCompanyId = props.companyId ?? contact.company?.companyId;
|
|
11907
|
+
if (activeCompanyId) {
|
|
11908
|
+
priceInput.companyId = activeCompanyId;
|
|
11933
11909
|
}
|
|
11934
11910
|
}
|
|
11935
11911
|
}
|
|
@@ -12005,12 +11981,15 @@ function FavoriteListDetails(rawProps) {
|
|
|
12005
11981
|
setPrevListId(props.favoriteListId || "");
|
|
12006
11982
|
fetchList();
|
|
12007
11983
|
}, []);
|
|
11984
|
+
const prevCompanyIdRef = React6.useRef(props.companyId);
|
|
12008
11985
|
React6.useEffect(() => {
|
|
12009
|
-
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
11986
|
+
const listChanged = !!props.favoriteListId && props.favoriteListId !== prevListId;
|
|
11987
|
+
const companyChanged = props.companyId !== prevCompanyIdRef.current;
|
|
11988
|
+
if (!listChanged && !companyChanged) return;
|
|
11989
|
+
if (listChanged) setPrevListId(props.favoriteListId);
|
|
11990
|
+
prevCompanyIdRef.current = props.companyId;
|
|
11991
|
+
fetchList();
|
|
11992
|
+
}, [props.favoriteListId, props.companyId]);
|
|
12014
11993
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-favorite-list-details ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
|
|
12015
11994
|
loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-favorite-list-details__skeleton space-y-4", children: [1, 2, 3]?.map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12016
11995
|
"div",
|
|
@@ -13886,7 +13865,7 @@ function OrderList(rawProps) {
|
|
|
13886
13865
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-order-list ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
|
|
13887
13866
|
props.enableSearch && searchFields().length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-order-list__filters mb-6 bg-card p-4 rounded-container shadow space-y-4", children: [
|
|
13888
13867
|
searchFields().includes("term") ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-order-list__search-field w-full", children: [
|
|
13889
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "propeller-order-list__filter-label block text-sm font-medium text-muted-foreground
|
|
13868
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "propeller-order-list__filter-label block text-sm font-medium text-muted-foreground mb-1", children: getColumnLabel("term") }),
|
|
13890
13869
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13891
13870
|
"input",
|
|
13892
13871
|
{
|
|
@@ -13914,7 +13893,7 @@ function OrderList(rawProps) {
|
|
|
13914
13893
|
)
|
|
13915
13894
|
] }) : null,
|
|
13916
13895
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-4", children: searchFields().filter((f) => f !== "term")?.map((field) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
13917
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "propeller-order-list__filter-label block text-sm font-medium text-muted-foreground
|
|
13896
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "propeller-order-list__filter-label block text-sm font-medium text-muted-foreground", children: getColumnLabel(field) }),
|
|
13918
13897
|
field === "createdAt" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex space-x-2 w-full", children: [
|
|
13919
13898
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13920
13899
|
"input",
|
|
@@ -14963,6 +14942,11 @@ function OrderSummary(props) {
|
|
|
14963
14942
|
] });
|
|
14964
14943
|
}
|
|
14965
14944
|
var OrderSummary_default = OrderSummary;
|
|
14945
|
+
function OrderSummaryWithProvider(rawProps) {
|
|
14946
|
+
const props = useInfraProps(rawProps);
|
|
14947
|
+
return /* @__PURE__ */ jsxRuntime.jsx(OrderSummary_default, { ...props });
|
|
14948
|
+
}
|
|
14949
|
+
var OrderSummaryWithProvider_default = OrderSummaryWithProvider;
|
|
14966
14950
|
function OrderTotals(props) {
|
|
14967
14951
|
const showSubtotal = props.showSubtotal !== false;
|
|
14968
14952
|
const showDiscount = props.showDiscount !== false;
|
|
@@ -15045,6 +15029,11 @@ function OrderTotals(props) {
|
|
|
15045
15029
|
] });
|
|
15046
15030
|
}
|
|
15047
15031
|
var OrderTotals_default = OrderTotals;
|
|
15032
|
+
function OrderTotalsWithProvider(rawProps) {
|
|
15033
|
+
const props = useInfraProps(rawProps);
|
|
15034
|
+
return /* @__PURE__ */ jsxRuntime.jsx(OrderTotals_default, { ...props });
|
|
15035
|
+
}
|
|
15036
|
+
var OrderTotalsWithProvider_default = OrderTotalsWithProvider;
|
|
15048
15037
|
function PriceToggle(props) {
|
|
15049
15038
|
const isControlled = props.value !== void 0;
|
|
15050
15039
|
const [internal, setInternal] = React6.useState(props.initialState ?? true);
|
|
@@ -15608,7 +15597,7 @@ function ProductDescription(props) {
|
|
|
15608
15597
|
!shouldTruncate || expanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15609
15598
|
"div",
|
|
15610
15599
|
{
|
|
15611
|
-
className: "propeller-product-description__content
|
|
15600
|
+
className: "propeller-product-description__content text-muted-foreground",
|
|
15612
15601
|
dangerouslySetInnerHTML: { __html: html }
|
|
15613
15602
|
}
|
|
15614
15603
|
) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "propeller-product-description__truncated text-muted-foreground", children: getTruncated() }),
|
|
@@ -16350,7 +16339,7 @@ function ProductShortDescription(props) {
|
|
|
16350
16339
|
"div",
|
|
16351
16340
|
{
|
|
16352
16341
|
dangerouslySetInnerHTML: { __html: html },
|
|
16353
|
-
className: cn(`propeller-product-short-description
|
|
16342
|
+
className: cn(`propeller-product-short-description text-muted-foreground ${props.className || ""}`)
|
|
16354
16343
|
}
|
|
16355
16344
|
) : null });
|
|
16356
16345
|
}
|
|
@@ -19166,8 +19155,8 @@ exports.OrderBonusItems = OrderBonusItems_default;
|
|
|
19166
19155
|
exports.OrderItemCard = OrderItemCard_default;
|
|
19167
19156
|
exports.OrderList = OrderList_default;
|
|
19168
19157
|
exports.OrderShipments = OrderShipments_default;
|
|
19169
|
-
exports.OrderSummary =
|
|
19170
|
-
exports.OrderTotals =
|
|
19158
|
+
exports.OrderSummary = OrderSummaryWithProvider_default;
|
|
19159
|
+
exports.OrderTotals = OrderTotalsWithProvider_default;
|
|
19171
19160
|
exports.PriceToggle = PriceToggle_default;
|
|
19172
19161
|
exports.ProductBulkPrices = ProductBulkPricesWithProvider_default;
|
|
19173
19162
|
exports.ProductBundles = ProductBundles_default;
|