@numueg/theme-sdk 0.9.0 → 0.10.1
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/{chunk-X3J4GDI7.cjs → chunk-O4GLTNLE.cjs} +3 -3
- package/dist/{chunk-X3J4GDI7.cjs.map → chunk-O4GLTNLE.cjs.map} +1 -1
- package/dist/{chunk-JIAA7TGR.mjs → chunk-QFFTHIFZ.mjs} +3 -3
- package/dist/{chunk-JIAA7TGR.mjs.map → chunk-QFFTHIFZ.mjs.map} +1 -1
- package/dist/{chunk-3C37JX2X.cjs → chunk-V3JDQXD3.cjs} +2 -2
- package/dist/chunk-V3JDQXD3.cjs.map +1 -0
- package/dist/{chunk-PUR3FRGQ.mjs → chunk-ZYZZG4JR.mjs} +2 -2
- package/dist/chunk-ZYZZG4JR.mjs.map +1 -0
- package/dist/index.cjs +131 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +74 -15
- package/dist/index.d.ts +74 -15
- package/dist/index.mjs +66 -13
- package/dist/index.mjs.map +1 -1
- package/dist/{mount-NLjFNyBv.d.mts → mount-BDo4a42I.d.mts} +9 -1
- package/dist/{mount-CM4kGg9w.d.ts → mount-DQZu8aBB.d.ts} +9 -1
- package/dist/v2-compat.cjs +6 -6
- package/dist/v2-compat.mjs +1 -1
- package/dist/validation.cjs +11 -11
- package/dist/validation.mjs +1 -1
- package/dist/verify.cjs +3 -3
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-3C37JX2X.cjs.map +0 -1
- package/dist/chunk-PUR3FRGQ.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkTBSNHHFH_cjs = require('./chunk-TBSNHHFH.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkO4GLTNLE_cjs = require('./chunk-O4GLTNLE.cjs');
|
|
5
|
+
var chunkV3JDQXD3_cjs = require('./chunk-V3JDQXD3.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var client = require('react-dom/client');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -10,28 +10,28 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
10
10
|
// src/types/theme.ts
|
|
11
11
|
var MAX_BLOCK_DEPTH = 5;
|
|
12
12
|
function useProduct() {
|
|
13
|
-
const ctx = react.useContext(
|
|
13
|
+
const ctx = react.useContext(chunkV3JDQXD3_cjs.ProductContext);
|
|
14
14
|
if (!ctx) throw new Error("useProduct must be used within ProductProvider");
|
|
15
15
|
return ctx;
|
|
16
16
|
}
|
|
17
17
|
function useProductOptional() {
|
|
18
|
-
return react.useContext(
|
|
18
|
+
return react.useContext(chunkV3JDQXD3_cjs.ProductContext);
|
|
19
19
|
}
|
|
20
20
|
function useCollection() {
|
|
21
|
-
const ctx = react.useContext(
|
|
21
|
+
const ctx = react.useContext(chunkV3JDQXD3_cjs.CollectionContext);
|
|
22
22
|
if (!ctx) throw new Error("useCollection must be used within CollectionProvider");
|
|
23
23
|
return ctx;
|
|
24
24
|
}
|
|
25
25
|
function useCollectionOptional() {
|
|
26
|
-
return react.useContext(
|
|
26
|
+
return react.useContext(chunkV3JDQXD3_cjs.CollectionContext);
|
|
27
27
|
}
|
|
28
28
|
function useCart() {
|
|
29
|
-
const ctx = react.useContext(
|
|
29
|
+
const ctx = react.useContext(chunkV3JDQXD3_cjs.CartContext);
|
|
30
30
|
if (!ctx) throw new Error("useCart must be used within NuMuProvider");
|
|
31
31
|
return ctx;
|
|
32
32
|
}
|
|
33
33
|
function useCurrentTemplate() {
|
|
34
|
-
return react.useContext(
|
|
34
|
+
return react.useContext(chunkV3JDQXD3_cjs.CurrentTemplateContext);
|
|
35
35
|
}
|
|
36
36
|
var SectionContext = react.createContext(null);
|
|
37
37
|
function useSection() {
|
|
@@ -44,7 +44,7 @@ function useSectionOptional() {
|
|
|
44
44
|
}
|
|
45
45
|
var EMPTY = Object.freeze([]);
|
|
46
46
|
function useSectionGroup(group) {
|
|
47
|
-
const settings = react.useContext(
|
|
47
|
+
const settings = react.useContext(chunkV3JDQXD3_cjs.ThemeSettingsContext);
|
|
48
48
|
return react.useMemo(() => {
|
|
49
49
|
const grp = settings?.section_groups?.[group];
|
|
50
50
|
if (!grp || !Array.isArray(grp.order) || grp.order.length === 0) {
|
|
@@ -61,8 +61,8 @@ function useSectionGroup(group) {
|
|
|
61
61
|
}, [settings, group]);
|
|
62
62
|
}
|
|
63
63
|
function useCurrency() {
|
|
64
|
-
const ctx = react.useContext(
|
|
65
|
-
const shop =
|
|
64
|
+
const ctx = react.useContext(chunkV3JDQXD3_cjs.CurrencyContext);
|
|
65
|
+
const shop = chunkV3JDQXD3_cjs.useShop();
|
|
66
66
|
const fallback = react.useMemo(() => {
|
|
67
67
|
const ccy = shop?.currency || "EGP";
|
|
68
68
|
return {
|
|
@@ -82,8 +82,8 @@ function useCurrency() {
|
|
|
82
82
|
|
|
83
83
|
// src/hooks/useMoney.ts
|
|
84
84
|
function useMoney(currencyOverride) {
|
|
85
|
-
const { formatMoney } =
|
|
86
|
-
const shop =
|
|
85
|
+
const { formatMoney } = chunkV3JDQXD3_cjs.useLocalization();
|
|
86
|
+
const shop = chunkV3JDQXD3_cjs.useShop();
|
|
87
87
|
const { selected, base, autoConvert, convert } = useCurrency();
|
|
88
88
|
return (amount) => {
|
|
89
89
|
const shouldConvert = autoConvert && !currencyOverride && !!selected && selected !== base;
|
|
@@ -131,7 +131,7 @@ function unwrap(json) {
|
|
|
131
131
|
return json;
|
|
132
132
|
}
|
|
133
133
|
function useOrders() {
|
|
134
|
-
const customer =
|
|
134
|
+
const customer = chunkV3JDQXD3_cjs.useCustomer();
|
|
135
135
|
const [orders, setOrders] = react.useState([]);
|
|
136
136
|
const [loading, setLoading] = react.useState(false);
|
|
137
137
|
const [error, setError] = react.useState(null);
|
|
@@ -178,7 +178,7 @@ function useOrders() {
|
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
function useOrder(id) {
|
|
181
|
-
const customer =
|
|
181
|
+
const customer = chunkV3JDQXD3_cjs.useCustomer();
|
|
182
182
|
const [order, setOrder] = react.useState(null);
|
|
183
183
|
const [loading, setLoading] = react.useState(false);
|
|
184
184
|
const [error, setError] = react.useState(null);
|
|
@@ -241,7 +241,7 @@ async function readBody(res) {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
function useCustomerAddresses() {
|
|
244
|
-
const customer =
|
|
244
|
+
const customer = chunkV3JDQXD3_cjs.useCustomer();
|
|
245
245
|
const [addresses, setAddresses] = react.useState([]);
|
|
246
246
|
const [loading, setLoading] = react.useState(false);
|
|
247
247
|
const [error, setError] = react.useState(null);
|
|
@@ -404,8 +404,8 @@ function toNavigationItem(raw, locale) {
|
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
406
|
function useNavigation(handle, options) {
|
|
407
|
-
const navMap = react.useContext(
|
|
408
|
-
const localization = react.useContext(
|
|
407
|
+
const navMap = react.useContext(chunkV3JDQXD3_cjs.NavigationContext);
|
|
408
|
+
const localization = react.useContext(chunkV3JDQXD3_cjs.LocalizationContext);
|
|
409
409
|
const locale = localization?.locale ?? "en";
|
|
410
410
|
const hostProvidedAny = !!navMap && Object.keys(navMap).length > 0;
|
|
411
411
|
const rawItems = handle ? navMap?.[handle] : void 0;
|
|
@@ -589,10 +589,11 @@ function getFingerprint() {
|
|
|
589
589
|
}
|
|
590
590
|
function dispatchAnalyticsEvent(eventName, payload = {}) {
|
|
591
591
|
if (typeof window === "undefined") return;
|
|
592
|
+
const eventId = crypto.randomUUID();
|
|
592
593
|
try {
|
|
593
594
|
window.dispatchEvent(
|
|
594
595
|
new CustomEvent("numu:analytics:event", {
|
|
595
|
-
detail: { event: eventName, payload, ts: Date.now() }
|
|
596
|
+
detail: { event: eventName, payload, event_id: eventId, ts: Date.now() }
|
|
596
597
|
})
|
|
597
598
|
);
|
|
598
599
|
} catch {
|
|
@@ -600,7 +601,7 @@ function dispatchAnalyticsEvent(eventName, payload = {}) {
|
|
|
600
601
|
const step = EVENT_TO_FUNNEL_STEP[eventName] ?? null;
|
|
601
602
|
const customerId = readCustomerId();
|
|
602
603
|
const body = step ? {
|
|
603
|
-
event_id:
|
|
604
|
+
event_id: eventId,
|
|
604
605
|
path: window.location.pathname,
|
|
605
606
|
fingerprint: getFingerprint(),
|
|
606
607
|
step,
|
|
@@ -611,6 +612,7 @@ function dispatchAnalyticsEvent(eventName, payload = {}) {
|
|
|
611
612
|
} : {
|
|
612
613
|
event: eventName,
|
|
613
614
|
payload,
|
|
615
|
+
event_id: eventId,
|
|
614
616
|
ts: Date.now(),
|
|
615
617
|
attribution: readAttribution() ?? void 0,
|
|
616
618
|
customer_id: customerId ?? void 0
|
|
@@ -809,7 +811,7 @@ function useCachedResource(key, fetcher, options) {
|
|
|
809
811
|
|
|
810
812
|
// src/hooks/useApp.ts
|
|
811
813
|
function useApp(slug) {
|
|
812
|
-
const shop =
|
|
814
|
+
const shop = chunkV3JDQXD3_cjs.useShop();
|
|
813
815
|
const key = slug ? `numu:app:${shop.id}:${slug}` : "";
|
|
814
816
|
const fetcher = react.useCallback(
|
|
815
817
|
async (signal) => {
|
|
@@ -957,7 +959,7 @@ function useRelatedProducts(productId, options = {}) {
|
|
|
957
959
|
function useProductSizeChart(productOverride) {
|
|
958
960
|
const ctxProduct = useProductOptional();
|
|
959
961
|
const product = productOverride ?? ctxProduct;
|
|
960
|
-
const shop =
|
|
962
|
+
const shop = chunkV3JDQXD3_cjs.useShop();
|
|
961
963
|
const storeSettings = shop?.settings;
|
|
962
964
|
return react.useMemo(
|
|
963
965
|
() => resolveSizeChart(product?.attributes, storeSettings),
|
|
@@ -1021,6 +1023,25 @@ function availableValues(product, selection) {
|
|
|
1021
1023
|
}
|
|
1022
1024
|
return out;
|
|
1023
1025
|
}
|
|
1026
|
+
|
|
1027
|
+
// src/utils/selectionRegistry.ts
|
|
1028
|
+
var selections = /* @__PURE__ */ new Map();
|
|
1029
|
+
function publishVariantSelection(productId, selection) {
|
|
1030
|
+
if (!productId) return;
|
|
1031
|
+
selections.set(productId, selection);
|
|
1032
|
+
}
|
|
1033
|
+
function readVariantSelection(productId) {
|
|
1034
|
+
if (!productId) return null;
|
|
1035
|
+
const sel = selections.get(productId);
|
|
1036
|
+
if (!sel) return null;
|
|
1037
|
+
const filtered = {};
|
|
1038
|
+
for (const [k, v] of Object.entries(sel)) {
|
|
1039
|
+
if (v) filtered[k] = v;
|
|
1040
|
+
}
|
|
1041
|
+
return Object.keys(filtered).length > 0 ? filtered : null;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
// src/hooks/useVariantSelection.ts
|
|
1024
1045
|
function useVariantSelection(product, opts = {}) {
|
|
1025
1046
|
const autoSelect = opts.autoSelect ?? true;
|
|
1026
1047
|
const initial = react.useMemo(() => {
|
|
@@ -1039,6 +1060,9 @@ function useVariantSelection(product, opts = {}) {
|
|
|
1039
1060
|
() => findVariantByOptions(product, selection),
|
|
1040
1061
|
[product, selection]
|
|
1041
1062
|
);
|
|
1063
|
+
react.useEffect(() => {
|
|
1064
|
+
publishVariantSelection(product.id, selection);
|
|
1065
|
+
}, [product.id, selection]);
|
|
1042
1066
|
const availability = react.useMemo(
|
|
1043
1067
|
() => availableValues(product, selection),
|
|
1044
1068
|
[product, selection]
|
|
@@ -1471,8 +1495,9 @@ async function postCartMutation(endpoint, body, applyCart, reserveToken) {
|
|
|
1471
1495
|
return { ok: false, status: res.status, message };
|
|
1472
1496
|
}
|
|
1473
1497
|
const json = await res.json();
|
|
1474
|
-
|
|
1475
|
-
|
|
1498
|
+
const applied = unwrapCart(json);
|
|
1499
|
+
applyCart(applied);
|
|
1500
|
+
return { ok: true, status: res.status, cart: normalizeCartFromServer(applied) };
|
|
1476
1501
|
}
|
|
1477
1502
|
function NuMuProvider({
|
|
1478
1503
|
store,
|
|
@@ -1706,18 +1731,24 @@ function NuMuProvider({
|
|
|
1706
1731
|
[reserveToken, buildApplyCart]
|
|
1707
1732
|
);
|
|
1708
1733
|
const addItem = react.useCallback(
|
|
1709
|
-
async (productId, variantId, quantity) => {
|
|
1734
|
+
async (productId, variantId, quantity, selectedOptions) => {
|
|
1710
1735
|
const eventId = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}`;
|
|
1711
1736
|
const qty = quantity || 1;
|
|
1737
|
+
const axes = selectedOptions && Object.keys(selectedOptions).length > 0 ? selectedOptions : readVariantSelection(productId) ?? void 0;
|
|
1712
1738
|
const result = await mutate("/api/cart/add", {
|
|
1713
1739
|
product_id: productId,
|
|
1714
1740
|
variant_id: variantId,
|
|
1715
1741
|
quantity: qty,
|
|
1742
|
+
selected_options: axes,
|
|
1716
1743
|
_event_id: eventId
|
|
1717
1744
|
});
|
|
1718
1745
|
if (!result.ok) return result;
|
|
1719
1746
|
try {
|
|
1720
1747
|
if (typeof window !== "undefined") {
|
|
1748
|
+
const line = result.cart?.items.find(
|
|
1749
|
+
(it) => variantId ? it.variant_id === variantId : it.product_id === productId
|
|
1750
|
+
);
|
|
1751
|
+
const value = line && typeof line.price === "number" && line.price > 0 ? Math.round(line.price * qty * 100) / 100 : void 0;
|
|
1721
1752
|
window.dispatchEvent(
|
|
1722
1753
|
new CustomEvent("numu:analytics:event", {
|
|
1723
1754
|
detail: {
|
|
@@ -1725,7 +1756,8 @@ function NuMuProvider({
|
|
|
1725
1756
|
payload: {
|
|
1726
1757
|
content_ids: [productId],
|
|
1727
1758
|
content_type: "product",
|
|
1728
|
-
num_items: qty
|
|
1759
|
+
num_items: qty,
|
|
1760
|
+
...value !== void 0 ? { value, currency: result.cart?.currency } : {}
|
|
1729
1761
|
},
|
|
1730
1762
|
event_id: eventId
|
|
1731
1763
|
}
|
|
@@ -1972,13 +2004,13 @@ function NuMuProvider({
|
|
|
1972
2004
|
convertCurrency
|
|
1973
2005
|
]
|
|
1974
2006
|
);
|
|
1975
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2007
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.ShopContext.Provider, { value: store, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.ThemeSettingsContext.Provider, { value: themeSettings, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.CurrentTemplateContext.Provider, { value: currentTemplate, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.PageContext.Provider, { value: pageValue, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.LocalizationContext.Provider, { value: localization, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.CurrencyContext.Provider, { value: currencyValue, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.CartContext.Provider, { value: cartValue, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.CustomerContext.Provider, { value: customerState, children: /* @__PURE__ */ jsxRuntime.jsx(CustomerActionsContext.Provider, { value: customerActions, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.NavigationContext.Provider, { value: navigation ?? {}, children }) }) }) }) }) }) }) }) }) });
|
|
1976
2008
|
}
|
|
1977
2009
|
function ProductProvider({ product, children }) {
|
|
1978
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2010
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.ProductContext.Provider, { value: product, children });
|
|
1979
2011
|
}
|
|
1980
2012
|
function CollectionProvider({ collection, children }) {
|
|
1981
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2013
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkV3JDQXD3_cjs.CollectionContext.Provider, { value: collection, children });
|
|
1982
2014
|
}
|
|
1983
2015
|
|
|
1984
2016
|
// src/utils/logoStyle.ts
|
|
@@ -2317,8 +2349,8 @@ function Money({
|
|
|
2317
2349
|
className,
|
|
2318
2350
|
as = "span"
|
|
2319
2351
|
}) {
|
|
2320
|
-
const { formatMoney } =
|
|
2321
|
-
const shop =
|
|
2352
|
+
const { formatMoney } = chunkV3JDQXD3_cjs.useLocalization();
|
|
2353
|
+
const shop = chunkV3JDQXD3_cjs.useShop();
|
|
2322
2354
|
const { selected, base, autoConvert, convert } = useCurrency();
|
|
2323
2355
|
const shouldConvert = autoConvert && !currency && !!selected && selected !== base;
|
|
2324
2356
|
const ccy = shouldConvert ? selected : currency || shop?.currency;
|
|
@@ -2582,8 +2614,8 @@ function Logo({
|
|
|
2582
2614
|
style,
|
|
2583
2615
|
fallback
|
|
2584
2616
|
}) {
|
|
2585
|
-
const settings =
|
|
2586
|
-
const shop =
|
|
2617
|
+
const settings = chunkV3JDQXD3_cjs.useThemeSettings();
|
|
2618
|
+
const shop = chunkV3JDQXD3_cjs.useShop();
|
|
2587
2619
|
const g = settings?.global_settings ?? {};
|
|
2588
2620
|
const url = str(src) || str(g.logo_url) || shop?.logo_url || "";
|
|
2589
2621
|
const resolvedShape = shape || str(g.logo_shape) || "none";
|
|
@@ -2609,19 +2641,40 @@ function Logo({
|
|
|
2609
2641
|
);
|
|
2610
2642
|
}
|
|
2611
2643
|
var ABSOLUTE_URL = /^[a-z]+:|^\/\//i;
|
|
2612
|
-
|
|
2613
|
-
|
|
2644
|
+
var NAVIGATE_EVENT = "numu:navigate";
|
|
2645
|
+
function requestNavigate(href) {
|
|
2646
|
+
if (typeof window === "undefined") return false;
|
|
2647
|
+
const event = new CustomEvent(NAVIGATE_EVENT, {
|
|
2648
|
+
detail: { href },
|
|
2649
|
+
cancelable: true
|
|
2650
|
+
});
|
|
2651
|
+
return !window.dispatchEvent(event);
|
|
2652
|
+
}
|
|
2653
|
+
function Link({ to, children, onClick, ...rest }) {
|
|
2654
|
+
const shop = chunkV3JDQXD3_cjs.useShop();
|
|
2614
2655
|
const isAbsolute = ABSOLUTE_URL.test(to);
|
|
2615
2656
|
let href = to;
|
|
2616
2657
|
if (!isAbsolute && shop && !to.startsWith("/")) {
|
|
2617
2658
|
href = `/${to}`;
|
|
2618
2659
|
}
|
|
2619
|
-
|
|
2660
|
+
const handleClick = (e) => {
|
|
2661
|
+
onClick?.(e);
|
|
2662
|
+
if (e.defaultPrevented) return;
|
|
2663
|
+
if (e.button !== 0) return;
|
|
2664
|
+
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
2665
|
+
if (rest.target && rest.target !== "_self") return;
|
|
2666
|
+
if (rest.download !== void 0) return;
|
|
2667
|
+
if (isAbsolute) return;
|
|
2668
|
+
if (to.startsWith("#") || href.startsWith("#")) return;
|
|
2669
|
+
if (requestNavigate(href)) e.preventDefault();
|
|
2670
|
+
};
|
|
2671
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href, onClick: handleClick, ...rest, children });
|
|
2620
2672
|
}
|
|
2621
2673
|
function AddToCartButton({
|
|
2622
2674
|
product,
|
|
2623
2675
|
variant,
|
|
2624
2676
|
quantity = 1,
|
|
2677
|
+
selectedOptions,
|
|
2625
2678
|
label = "Add to cart",
|
|
2626
2679
|
loadingLabel = "Adding\u2026",
|
|
2627
2680
|
soldOutLabel = "Sold out",
|
|
@@ -2648,7 +2701,7 @@ function AddToCartButton({
|
|
|
2648
2701
|
if (state === "adding") return;
|
|
2649
2702
|
setState("adding");
|
|
2650
2703
|
try {
|
|
2651
|
-
await addItem(product.id, variant?.id, quantity);
|
|
2704
|
+
await addItem(product.id, variant?.id, quantity, selectedOptions);
|
|
2652
2705
|
setState("idle");
|
|
2653
2706
|
onAdded?.(product, variant);
|
|
2654
2707
|
} catch {
|
|
@@ -3163,8 +3216,8 @@ function LocaleSwitcher({
|
|
|
3163
3216
|
onSelect,
|
|
3164
3217
|
render
|
|
3165
3218
|
}) {
|
|
3166
|
-
const shop =
|
|
3167
|
-
const { locale } =
|
|
3219
|
+
const shop = chunkV3JDQXD3_cjs.useShop();
|
|
3220
|
+
const { locale } = chunkV3JDQXD3_cjs.useLocalization();
|
|
3168
3221
|
const available = shop.available_locales || [];
|
|
3169
3222
|
const list = available.length > 0 ? available : shop.default_language === "en" ? ["en"] : Array.from(/* @__PURE__ */ new Set([shop.default_language, "en"]));
|
|
3170
3223
|
const labelFor = react.useCallback((code) => {
|
|
@@ -3569,9 +3622,9 @@ function resolveSettingsMap(settings, ctx) {
|
|
|
3569
3622
|
return out;
|
|
3570
3623
|
}
|
|
3571
3624
|
function useResolvedSettings(instance) {
|
|
3572
|
-
const product = react.useContext(
|
|
3573
|
-
const collection = react.useContext(
|
|
3574
|
-
const store = react.useContext(
|
|
3625
|
+
const product = react.useContext(chunkV3JDQXD3_cjs.ProductContext);
|
|
3626
|
+
const collection = react.useContext(chunkV3JDQXD3_cjs.CollectionContext);
|
|
3627
|
+
const store = react.useContext(chunkV3JDQXD3_cjs.ShopContext);
|
|
3575
3628
|
const ctx = react.useMemo(
|
|
3576
3629
|
() => ({ product, collection, store }),
|
|
3577
3630
|
[product, collection, store]
|
|
@@ -3751,131 +3804,131 @@ Object.defineProperty(exports, "resolveThemeSettings", {
|
|
|
3751
3804
|
});
|
|
3752
3805
|
Object.defineProperty(exports, "KNOWN_SETTING_TYPES", {
|
|
3753
3806
|
enumerable: true,
|
|
3754
|
-
get: function () { return
|
|
3807
|
+
get: function () { return chunkO4GLTNLE_cjs.KNOWN_SETTING_TYPES; }
|
|
3755
3808
|
});
|
|
3756
3809
|
Object.defineProperty(exports, "KNOWN_TEMPLATES", {
|
|
3757
3810
|
enumerable: true,
|
|
3758
|
-
get: function () { return
|
|
3811
|
+
get: function () { return chunkO4GLTNLE_cjs.KNOWN_TEMPLATES; }
|
|
3759
3812
|
});
|
|
3760
3813
|
Object.defineProperty(exports, "REQUIRED_TEMPLATES", {
|
|
3761
3814
|
enumerable: true,
|
|
3762
|
-
get: function () { return
|
|
3815
|
+
get: function () { return chunkO4GLTNLE_cjs.REQUIRED_TEMPLATES; }
|
|
3763
3816
|
});
|
|
3764
3817
|
Object.defineProperty(exports, "SDK_VERSION", {
|
|
3765
3818
|
enumerable: true,
|
|
3766
|
-
get: function () { return
|
|
3819
|
+
get: function () { return chunkO4GLTNLE_cjs.SDK_VERSION; }
|
|
3767
3820
|
});
|
|
3768
3821
|
Object.defineProperty(exports, "THEME_CONTRACT_VERSION", {
|
|
3769
3822
|
enumerable: true,
|
|
3770
|
-
get: function () { return
|
|
3823
|
+
get: function () { return chunkO4GLTNLE_cjs.THEME_CONTRACT_VERSION; }
|
|
3771
3824
|
});
|
|
3772
3825
|
Object.defineProperty(exports, "mergeResults", {
|
|
3773
3826
|
enumerable: true,
|
|
3774
|
-
get: function () { return
|
|
3827
|
+
get: function () { return chunkO4GLTNLE_cjs.mergeResults; }
|
|
3775
3828
|
});
|
|
3776
3829
|
Object.defineProperty(exports, "validateBuiltManifest", {
|
|
3777
3830
|
enumerable: true,
|
|
3778
|
-
get: function () { return
|
|
3831
|
+
get: function () { return chunkO4GLTNLE_cjs.validateBuiltManifest; }
|
|
3779
3832
|
});
|
|
3780
3833
|
Object.defineProperty(exports, "validateManifest", {
|
|
3781
3834
|
enumerable: true,
|
|
3782
|
-
get: function () { return
|
|
3835
|
+
get: function () { return chunkO4GLTNLE_cjs.validateManifest; }
|
|
3783
3836
|
});
|
|
3784
3837
|
Object.defineProperty(exports, "validateSectionSchema", {
|
|
3785
3838
|
enumerable: true,
|
|
3786
|
-
get: function () { return
|
|
3839
|
+
get: function () { return chunkO4GLTNLE_cjs.validateSectionSchema; }
|
|
3787
3840
|
});
|
|
3788
3841
|
Object.defineProperty(exports, "validateSettingsAgainstSchema", {
|
|
3789
3842
|
enumerable: true,
|
|
3790
|
-
get: function () { return
|
|
3843
|
+
get: function () { return chunkO4GLTNLE_cjs.validateSettingsAgainstSchema; }
|
|
3791
3844
|
});
|
|
3792
3845
|
Object.defineProperty(exports, "CartContext", {
|
|
3793
3846
|
enumerable: true,
|
|
3794
|
-
get: function () { return
|
|
3847
|
+
get: function () { return chunkV3JDQXD3_cjs.CartContext; }
|
|
3795
3848
|
});
|
|
3796
3849
|
Object.defineProperty(exports, "CollectionContext", {
|
|
3797
3850
|
enumerable: true,
|
|
3798
|
-
get: function () { return
|
|
3851
|
+
get: function () { return chunkV3JDQXD3_cjs.CollectionContext; }
|
|
3799
3852
|
});
|
|
3800
3853
|
Object.defineProperty(exports, "CurrencyContext", {
|
|
3801
3854
|
enumerable: true,
|
|
3802
|
-
get: function () { return
|
|
3855
|
+
get: function () { return chunkV3JDQXD3_cjs.CurrencyContext; }
|
|
3803
3856
|
});
|
|
3804
3857
|
Object.defineProperty(exports, "CustomerContext", {
|
|
3805
3858
|
enumerable: true,
|
|
3806
|
-
get: function () { return
|
|
3859
|
+
get: function () { return chunkV3JDQXD3_cjs.CustomerContext; }
|
|
3807
3860
|
});
|
|
3808
3861
|
Object.defineProperty(exports, "LocalizationContext", {
|
|
3809
3862
|
enumerable: true,
|
|
3810
|
-
get: function () { return
|
|
3863
|
+
get: function () { return chunkV3JDQXD3_cjs.LocalizationContext; }
|
|
3811
3864
|
});
|
|
3812
3865
|
Object.defineProperty(exports, "NavigationContext", {
|
|
3813
3866
|
enumerable: true,
|
|
3814
|
-
get: function () { return
|
|
3867
|
+
get: function () { return chunkV3JDQXD3_cjs.NavigationContext; }
|
|
3815
3868
|
});
|
|
3816
3869
|
Object.defineProperty(exports, "PageContext", {
|
|
3817
3870
|
enumerable: true,
|
|
3818
|
-
get: function () { return
|
|
3871
|
+
get: function () { return chunkV3JDQXD3_cjs.PageContext; }
|
|
3819
3872
|
});
|
|
3820
3873
|
Object.defineProperty(exports, "ProductContext", {
|
|
3821
3874
|
enumerable: true,
|
|
3822
|
-
get: function () { return
|
|
3875
|
+
get: function () { return chunkV3JDQXD3_cjs.ProductContext; }
|
|
3823
3876
|
});
|
|
3824
3877
|
Object.defineProperty(exports, "ShopContext", {
|
|
3825
3878
|
enumerable: true,
|
|
3826
|
-
get: function () { return
|
|
3879
|
+
get: function () { return chunkV3JDQXD3_cjs.ShopContext; }
|
|
3827
3880
|
});
|
|
3828
3881
|
Object.defineProperty(exports, "ThemeSettingsContext", {
|
|
3829
3882
|
enumerable: true,
|
|
3830
|
-
get: function () { return
|
|
3883
|
+
get: function () { return chunkV3JDQXD3_cjs.ThemeSettingsContext; }
|
|
3831
3884
|
});
|
|
3832
3885
|
Object.defineProperty(exports, "useCollections", {
|
|
3833
3886
|
enumerable: true,
|
|
3834
|
-
get: function () { return
|
|
3887
|
+
get: function () { return chunkV3JDQXD3_cjs.useCollections; }
|
|
3835
3888
|
});
|
|
3836
3889
|
Object.defineProperty(exports, "useCustomer", {
|
|
3837
3890
|
enumerable: true,
|
|
3838
|
-
get: function () { return
|
|
3891
|
+
get: function () { return chunkV3JDQXD3_cjs.useCustomer; }
|
|
3839
3892
|
});
|
|
3840
3893
|
Object.defineProperty(exports, "useDirection", {
|
|
3841
3894
|
enumerable: true,
|
|
3842
|
-
get: function () { return
|
|
3895
|
+
get: function () { return chunkV3JDQXD3_cjs.useDirection; }
|
|
3843
3896
|
});
|
|
3844
3897
|
Object.defineProperty(exports, "useFieldTranslation", {
|
|
3845
3898
|
enumerable: true,
|
|
3846
|
-
get: function () { return
|
|
3899
|
+
get: function () { return chunkV3JDQXD3_cjs.useFieldTranslation; }
|
|
3847
3900
|
});
|
|
3848
3901
|
Object.defineProperty(exports, "useLocale", {
|
|
3849
3902
|
enumerable: true,
|
|
3850
|
-
get: function () { return
|
|
3903
|
+
get: function () { return chunkV3JDQXD3_cjs.useLocale; }
|
|
3851
3904
|
});
|
|
3852
3905
|
Object.defineProperty(exports, "useLocalization", {
|
|
3853
3906
|
enumerable: true,
|
|
3854
|
-
get: function () { return
|
|
3907
|
+
get: function () { return chunkV3JDQXD3_cjs.useLocalization; }
|
|
3855
3908
|
});
|
|
3856
3909
|
Object.defineProperty(exports, "useNumberFormat", {
|
|
3857
3910
|
enumerable: true,
|
|
3858
|
-
get: function () { return
|
|
3911
|
+
get: function () { return chunkV3JDQXD3_cjs.useNumberFormat; }
|
|
3859
3912
|
});
|
|
3860
3913
|
Object.defineProperty(exports, "usePage", {
|
|
3861
3914
|
enumerable: true,
|
|
3862
|
-
get: function () { return
|
|
3915
|
+
get: function () { return chunkV3JDQXD3_cjs.usePage; }
|
|
3863
3916
|
});
|
|
3864
3917
|
Object.defineProperty(exports, "useProducts", {
|
|
3865
3918
|
enumerable: true,
|
|
3866
|
-
get: function () { return
|
|
3919
|
+
get: function () { return chunkV3JDQXD3_cjs.useProducts; }
|
|
3867
3920
|
});
|
|
3868
3921
|
Object.defineProperty(exports, "useShop", {
|
|
3869
3922
|
enumerable: true,
|
|
3870
|
-
get: function () { return
|
|
3923
|
+
get: function () { return chunkV3JDQXD3_cjs.useShop; }
|
|
3871
3924
|
});
|
|
3872
3925
|
Object.defineProperty(exports, "useThemeSettings", {
|
|
3873
3926
|
enumerable: true,
|
|
3874
|
-
get: function () { return
|
|
3927
|
+
get: function () { return chunkV3JDQXD3_cjs.useThemeSettings; }
|
|
3875
3928
|
});
|
|
3876
3929
|
Object.defineProperty(exports, "useTranslation", {
|
|
3877
3930
|
enumerable: true,
|
|
3878
|
-
get: function () { return
|
|
3931
|
+
get: function () { return chunkV3JDQXD3_cjs.useTranslation; }
|
|
3879
3932
|
});
|
|
3880
3933
|
exports.AddToCartButton = AddToCartButton;
|
|
3881
3934
|
exports.Block = Block;
|
|
@@ -3897,6 +3950,7 @@ exports.LocaleSwitcher = LocaleSwitcher;
|
|
|
3897
3950
|
exports.Logo = Logo;
|
|
3898
3951
|
exports.MAX_BLOCK_DEPTH = MAX_BLOCK_DEPTH;
|
|
3899
3952
|
exports.Money = Money;
|
|
3953
|
+
exports.NAVIGATE_EVENT = NAVIGATE_EVENT;
|
|
3900
3954
|
exports.NuMuProvider = NuMuProvider;
|
|
3901
3955
|
exports.ProductCard = ProductCard;
|
|
3902
3956
|
exports.ProductProvider = ProductProvider;
|
|
@@ -3932,8 +3986,11 @@ exports.logoImgStyle = logoImgStyle;
|
|
|
3932
3986
|
exports.logoStyleTokens = logoStyleTokens;
|
|
3933
3987
|
exports.mountTheme = mountTheme;
|
|
3934
3988
|
exports.pickTranslations = pickTranslations;
|
|
3989
|
+
exports.publishVariantSelection = publishVariantSelection;
|
|
3990
|
+
exports.readVariantSelection = readVariantSelection;
|
|
3935
3991
|
exports.registerReactSingleton = registerReactSingleton;
|
|
3936
3992
|
exports.registerSdkSingleton = registerSdkSingleton;
|
|
3993
|
+
exports.requestNavigate = requestNavigate;
|
|
3937
3994
|
exports.resolveDynamicValue = resolveDynamicValue;
|
|
3938
3995
|
exports.resolveFontStack = resolveFontStack;
|
|
3939
3996
|
exports.resolveSettingsMap = resolveSettingsMap;
|