arky-sdk 0.7.125 → 0.7.126
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/storefront-store.cjs +2 -20
- package/dist/storefront-store.cjs.map +1 -1
- package/dist/storefront-store.js +2 -20
- package/dist/storefront-store.js.map +1 -1
- package/dist/storefront.cjs +2 -20
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.d.cts +0 -2
- package/dist/storefront.d.ts +0 -2
- package/dist/storefront.js +2 -20
- package/dist/storefront.js.map +1 -1
- package/package.json +1 -1
|
@@ -1571,23 +1571,6 @@ function toServiceCheckoutItems(items) {
|
|
|
1571
1571
|
slots: [...item.slots].sort((a, b) => a.from - b.from)
|
|
1572
1572
|
}));
|
|
1573
1573
|
}
|
|
1574
|
-
function readStoredOrder(key) {
|
|
1575
|
-
if (!key || typeof window === "undefined") return null;
|
|
1576
|
-
try {
|
|
1577
|
-
const raw = window.localStorage.getItem(key);
|
|
1578
|
-
return raw ? JSON.parse(raw) : null;
|
|
1579
|
-
} catch {
|
|
1580
|
-
return null;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
function writeStoredOrder(key, value) {
|
|
1584
|
-
if (!key || typeof window === "undefined") return;
|
|
1585
|
-
try {
|
|
1586
|
-
if (value) window.localStorage.setItem(key, JSON.stringify(value));
|
|
1587
|
-
else window.localStorage.removeItem(key);
|
|
1588
|
-
} catch {
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
1574
|
function formFieldsFromBlocks(blocks) {
|
|
1592
1575
|
return blocks.map((block) => ({
|
|
1593
1576
|
id: block.id,
|
|
@@ -1714,7 +1697,7 @@ function createArkyStore(config) {
|
|
|
1714
1697
|
const service_items = nanostores.atom([]);
|
|
1715
1698
|
const quote = nanostores.atom(null);
|
|
1716
1699
|
const promo_code = nanostores.atom(null);
|
|
1717
|
-
const last_order = nanostores.atom(
|
|
1700
|
+
const last_order = nanostores.atom(null);
|
|
1718
1701
|
const cart_status = nanostores.map({
|
|
1719
1702
|
loading: false,
|
|
1720
1703
|
syncing: false,
|
|
@@ -1763,7 +1746,6 @@ function createArkyStore(config) {
|
|
|
1763
1746
|
const booking_form_blocks = nanostores.computed(booking_form_node, (node) => node?.blocks || []);
|
|
1764
1747
|
client.onAuthStateChanged((value) => session.set(value));
|
|
1765
1748
|
snapshot.subscribe((value) => config.onCartChange?.(value));
|
|
1766
|
-
last_order.subscribe((value) => writeStoredOrder(config.lastOrderStorageKey, value));
|
|
1767
1749
|
currency.subscribe((value) => booking_state.setKey("currency", value));
|
|
1768
1750
|
session.subscribe((value) => {
|
|
1769
1751
|
const methods = value?.market?.payment_methods || [];
|
|
@@ -2527,7 +2509,7 @@ function createArkyStore(config) {
|
|
|
2527
2509
|
}
|
|
2528
2510
|
}
|
|
2529
2511
|
async function loadWebsiteNode(options) {
|
|
2530
|
-
const node = await loadNode({ key:
|
|
2512
|
+
const node = await loadNode({ key: "website" }, options);
|
|
2531
2513
|
cms_state.setKey("website_node", node);
|
|
2532
2514
|
return node;
|
|
2533
2515
|
}
|