@fluid-app/portal-sdk 0.1.705 → 0.1.707
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ShopScreen-CFiIRrBI.cjs → ShopScreen-Bg11Pzqj.cjs} +16 -3
- package/dist/{ShopScreen-CFiIRrBI.cjs.map → ShopScreen-Bg11Pzqj.cjs.map} +1 -1
- package/dist/{ShopScreen-Cu174AqD.mjs → ShopScreen-C1cLP2wV.mjs} +1 -1
- package/dist/{ShopScreen-CKf7BcYe.cjs → ShopScreen-DuiV5D9p.cjs} +1 -1
- package/dist/{ShopScreen-xKZmcAPv.mjs → ShopScreen-DwgCHg3y.mjs} +16 -3
- package/dist/{ShopScreen-xKZmcAPv.mjs.map → ShopScreen-DwgCHg3y.mjs.map} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +2 -2
|
@@ -8,5 +8,5 @@ import "./translation-api-context-CYkmbwgU.mjs";
|
|
|
8
8
|
import "./use-can-show-volume-CgwtxOwn.mjs";
|
|
9
9
|
import "./MobileActionSheet-BX46ka_3.mjs";
|
|
10
10
|
import "./ScreenHeaderContext-B1sDg6tY.mjs";
|
|
11
|
-
import { n as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-
|
|
11
|
+
import { n as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-DwgCHg3y.mjs";
|
|
12
12
|
export { ShopScreen, shopScreenPropertySchema };
|
|
@@ -9,6 +9,6 @@ require("./src-DMLGq9va.cjs");
|
|
|
9
9
|
require("./use-can-show-volume-CMEwiVm1.cjs");
|
|
10
10
|
require("./MobileActionSheet-DmKPiZGN.cjs");
|
|
11
11
|
require("./ScreenHeaderContext-Dar1JG7O.cjs");
|
|
12
|
-
const require_ShopScreen = require("./ShopScreen-
|
|
12
|
+
const require_ShopScreen = require("./ShopScreen-Bg11Pzqj.cjs");
|
|
13
13
|
exports.ShopScreen = require_ShopScreen.ShopScreen;
|
|
14
14
|
exports.shopScreenPropertySchema = require_ShopScreen.shopScreenPropertySchema;
|
|
@@ -1437,6 +1437,18 @@ function findVariantBySelections(variants, selections) {
|
|
|
1437
1437
|
return matchingVariants.find((v) => v.is_master !== true) ?? matchingVariants[0];
|
|
1438
1438
|
}
|
|
1439
1439
|
/**
|
|
1440
|
+
* Whether some variant carries `valueId` for `optionId` together with every
|
|
1441
|
+
* other current selection. A value that does not combine is dimmed but stays
|
|
1442
|
+
* pickable: where options move together (30 servings in 1 bottle, 90 in 3),
|
|
1443
|
+
* the variant is reached only through a combination that does not exist.
|
|
1444
|
+
*/
|
|
1445
|
+
function isOptionValueCombinable(variants, selections, optionId, valueId) {
|
|
1446
|
+
return findVariantBySelections(variants, {
|
|
1447
|
+
...selections,
|
|
1448
|
+
[optionId]: valueId
|
|
1449
|
+
}) != null;
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1440
1452
|
* Map BFF flat subscription plans to the legacy ProductSubscriptionPlan shape
|
|
1441
1453
|
* expected by the PurchaseOptions component.
|
|
1442
1454
|
*/
|
|
@@ -1502,8 +1514,8 @@ function ProductDetail({ companyLogoUrl, canShowVolume = false, productId, rende
|
|
|
1502
1514
|
]);
|
|
1503
1515
|
const selectedVariant = useMemo(() => {
|
|
1504
1516
|
if (showVariantChoices) return variants.find((v) => v.id === selectedVariantId) ?? masterVariant;
|
|
1505
|
-
if (optionGroups.length === 0) return masterVariant;
|
|
1506
|
-
return findVariantBySelections(variants, selections)
|
|
1517
|
+
if (optionGroups.length === 0 || Object.keys(selections).length === 0) return masterVariant;
|
|
1518
|
+
return findVariantBySelections(variants, selections);
|
|
1507
1519
|
}, [
|
|
1508
1520
|
variants,
|
|
1509
1521
|
optionGroups,
|
|
@@ -1807,6 +1819,7 @@ function ProductDetail({ companyLogoUrl, canShowVolume = false, productId, rende
|
|
|
1807
1819
|
className: "max-h-60",
|
|
1808
1820
|
children: group.values.map((v) => /* @__PURE__ */ jsx(SelectItem, {
|
|
1809
1821
|
value: String(v.id),
|
|
1822
|
+
className: isOptionValueCombinable(variants, selections, group.optionId, v.id) ? void 0 : "opacity-50",
|
|
1810
1823
|
children: v.name
|
|
1811
1824
|
}, v.id))
|
|
1812
1825
|
})]
|
|
@@ -1962,4 +1975,4 @@ function ProductBreadcrumb({ productId }) {
|
|
|
1962
1975
|
//#endregion
|
|
1963
1976
|
export { CartScript as a, CartWidget as i, shopScreenPropertySchema as n, CartButton as r, ShopScreen as t };
|
|
1964
1977
|
|
|
1965
|
-
//# sourceMappingURL=ShopScreen-
|
|
1978
|
+
//# sourceMappingURL=ShopScreen-DwgCHg3y.mjs.map
|