@riverbankcms/sdk 0.60.6 → 0.60.9
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/_dts/api/src/appointmentSetup.d.ts +2 -2
- package/dist/_dts/api/src/bookingConfig.d.ts +6 -0
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +45 -3
- package/dist/_dts/api/src/bookingOperations.d.ts +40 -3
- package/dist/_dts/api/src/courses.d.ts +1 -5
- package/dist/_dts/api/src/endpoints.d.ts +80 -1
- package/dist/_dts/api/src/index.d.ts +3 -2
- package/dist/_dts/api/src/navigation/contracts.d.ts +9 -9
- package/dist/_dts/api/src/navigation/linkValue.d.ts +1 -1
- package/dist/_dts/api/src/public/endpoints.d.ts +1 -1
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +15 -1
- package/dist/_dts/api/src/resources.d.ts +1 -1
- package/dist/_dts/api/src/siteBanner.d.ts +8 -8
- package/dist/_dts/api/src/siteOnboarding.d.ts +1 -0
- package/dist/_dts/api/src/teamMembers.d.ts +27 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +35 -29
- package/dist/_dts/blocks/src/system/blocks/courses/shared/types.d.ts +1 -5
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +40 -34
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -5
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/products/shared.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/shared/teamMembers.d.ts +24 -0
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +18 -8
- package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
- package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
- package/dist/_dts/blocks/src/system/data/utils.d.ts +1 -1
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +185 -0
- package/dist/_dts/blocks/src/system/manifest/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +201 -201
- package/dist/_dts/blocks/src/system/manifest/validation.d.ts +2 -84
- package/dist/_dts/blocks/src/system/node/schema.d.ts +5 -5
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +4 -4
- package/dist/_dts/blocks/src/system/transforms/registry/ui.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +3 -3
- package/dist/_dts/blocks/src/system/types/link.d.ts +93 -1
- package/dist/_dts/content-model/src/content-types/schema.d.ts +8 -8
- package/dist/_dts/content-model/src/metadataConfig.d.ts +1 -0
- package/dist/_dts/core/src/branded.d.ts +2 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +124 -8
- package/dist/_dts/db/src/schemas/forms.d.ts +85 -64
- package/dist/_dts/editor-blocks/src/widgets/link/LinkSummary.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidget.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/utils.d.ts +1 -1
- package/dist/_dts/sdk/src/client/types.d.ts +9 -2
- package/dist/_dts/sdk/src/config/typed-entries.d.ts +36 -1
- package/dist/_dts/sdk/src/config/types.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +40 -37
- package/dist/_dts/sdk/src/contracts/content.d.ts +6 -1
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +18 -8
- package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +19 -19
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +87 -69
- package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -5
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +11 -11
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +10 -10
- package/dist/_dts/theme-core/src/buttons/types.d.ts +27 -27
- package/dist/_dts/theme-core/src/cards/types.d.ts +17 -17
- package/dist/_dts/theme-core/src/inputs/types.d.ts +14 -14
- package/dist/_dts/theme-core/src/interactive/baseSchema.d.ts +2 -2
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +438 -438
- package/dist/_dts/theme-core/src/navigation/types.d.ts +16 -16
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +15 -15
- package/dist/_dts/theme-core/src/schema.d.ts +662 -662
- package/dist/_dts/theme-core/src/shared/componentStyles.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +15 -15
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +7 -7
- package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +5 -5
- package/dist/_dts/ui/src/badge.d.ts +1 -1
- package/dist/_dts/ui/src/button-group.d.ts +1 -1
- package/dist/_dts/ui/src/button.d.ts +2 -2
- package/dist/_dts/ui/src/callout.d.ts +1 -1
- package/dist/_dts/ui/src/card.d.ts +1 -1
- package/dist/_dts/ui/src/surface.d.ts +2 -2
- package/dist/_dts/ui/src/toggle.d.ts +4 -4
- package/dist/cli/index.mjs +951 -451
- package/dist/client/client.mjs +39490 -38952
- package/dist/client/hooks.mjs +1992 -1741
- package/dist/client/rendering/client.mjs +179 -130
- package/dist/client/rendering/islands.mjs +68 -43
- package/dist/client/rendering.mjs +1812 -1292
- package/dist/preview-next/before-render.mjs +147 -1
- package/dist/preview-next/client/runtime.mjs +1377 -829
- package/dist/preview-next/middleware.mjs +147 -1
- package/dist/server/components.mjs +3246 -2751
- package/dist/server/config-validation.mjs +2198 -1962
- package/dist/server/config.mjs +2198 -1962
- package/dist/server/data.mjs +1992 -1741
- package/dist/server/index.mjs +168 -2
- package/dist/server/next.mjs +3230 -2701
- package/dist/server/page-converter.mjs +345 -259
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3274 -2763
- package/dist/server/rendering.mjs +3274 -2763
- package/dist/server/routing.mjs +530 -309
- package/dist/server/server.mjs +2011 -1742
- package/package.json +1 -1
|
@@ -1420,7 +1420,9 @@ var init_schemas = __esm({
|
|
|
1420
1420
|
courseTeamMemberSummarySchema = z4.object({
|
|
1421
1421
|
id: z4.string(),
|
|
1422
1422
|
name: z4.string(),
|
|
1423
|
-
|
|
1423
|
+
roleLabel: z4.string().nullable(),
|
|
1424
|
+
summary: z4.string().nullable(),
|
|
1425
|
+
profilePath: z4.string().nullable()
|
|
1424
1426
|
});
|
|
1425
1427
|
coursePricingOptionSchema = z4.object({
|
|
1426
1428
|
id: z4.string(),
|
|
@@ -1535,7 +1537,9 @@ var init_schemas2 = __esm({
|
|
|
1535
1537
|
publicTeamMemberSummarySchema = z5.object({
|
|
1536
1538
|
id: z5.string(),
|
|
1537
1539
|
name: z5.string(),
|
|
1538
|
-
|
|
1540
|
+
roleLabel: z5.string().nullable(),
|
|
1541
|
+
summary: z5.string().nullable(),
|
|
1542
|
+
profilePath: z5.string().nullable()
|
|
1539
1543
|
});
|
|
1540
1544
|
publicEventSchema = z5.object({
|
|
1541
1545
|
kind: z5.enum(["event", "course_session"]).optional(),
|
|
@@ -9946,6 +9950,12 @@ var init_CoursePricingDisplay = __esm({
|
|
|
9946
9950
|
|
|
9947
9951
|
// ../blocks/src/system/runtime/nodes/event-details/view.tsx
|
|
9948
9952
|
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
9953
|
+
function TeamMemberName({
|
|
9954
|
+
name,
|
|
9955
|
+
profilePath
|
|
9956
|
+
}) {
|
|
9957
|
+
return profilePath ? /* @__PURE__ */ jsx12("a", { href: profilePath, className: "rb-hover-opacity-80", children: /* @__PURE__ */ jsx12("strong", { children: name }) }) : /* @__PURE__ */ jsx12("strong", { children: name });
|
|
9958
|
+
}
|
|
9949
9959
|
function EventDetailsView({
|
|
9950
9960
|
selection,
|
|
9951
9961
|
showVenue,
|
|
@@ -10009,7 +10019,13 @@ function EventDetailsView({
|
|
|
10009
10019
|
teamMembers.length > 0 ? /* @__PURE__ */ jsxs8("div", { className: "rb-mt-6", children: [
|
|
10010
10020
|
/* @__PURE__ */ jsx12("div", { className: "rb-label rb-mb-2", children: "Team members" }),
|
|
10011
10021
|
/* @__PURE__ */ jsx12("div", { className: "rb-flex rb-flex-col rb-gap-3", children: teamMembers.map((teamMember) => /* @__PURE__ */ jsxs8("div", { children: [
|
|
10012
|
-
/* @__PURE__ */ jsx12("p", { children: /* @__PURE__ */ jsx12(
|
|
10022
|
+
/* @__PURE__ */ jsx12("p", { children: /* @__PURE__ */ jsx12(
|
|
10023
|
+
TeamMemberName,
|
|
10024
|
+
{
|
|
10025
|
+
name: teamMember.name,
|
|
10026
|
+
profilePath: teamMember.profilePath
|
|
10027
|
+
}
|
|
10028
|
+
) }),
|
|
10013
10029
|
teamMember.summary ? /* @__PURE__ */ jsx12("p", { className: "rb-caption status-muted", children: teamMember.summary }) : null
|
|
10014
10030
|
] }, teamMember.id)) })
|
|
10015
10031
|
] }) : null,
|
|
@@ -21274,7 +21290,16 @@ var init_CourseRegistrationErrorBoundary = __esm({
|
|
|
21274
21290
|
});
|
|
21275
21291
|
|
|
21276
21292
|
// ../blocks/src/system/runtime/nodes/course-registration/components.tsx
|
|
21293
|
+
import React17 from "react";
|
|
21277
21294
|
import { Fragment as Fragment13, jsx as jsx70, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
21295
|
+
function TeamMemberInlineList({
|
|
21296
|
+
teamMembers
|
|
21297
|
+
}) {
|
|
21298
|
+
return /* @__PURE__ */ jsx70(Fragment13, { children: teamMembers.map((teamMember, index) => /* @__PURE__ */ jsxs54(React17.Fragment, { children: [
|
|
21299
|
+
index > 0 ? ", " : "",
|
|
21300
|
+
teamMember.profilePath ? /* @__PURE__ */ jsx70("a", { href: teamMember.profilePath, children: teamMember.name }) : teamMember.name
|
|
21301
|
+
] }, teamMember.id)) });
|
|
21302
|
+
}
|
|
21278
21303
|
function CourseCard({
|
|
21279
21304
|
course,
|
|
21280
21305
|
isSelected,
|
|
@@ -21355,7 +21380,7 @@ function CourseSummary({
|
|
|
21355
21380
|
teamMembers.length > 0 && /* @__PURE__ */ jsxs54("div", { className: "cr-summary__venue", children: [
|
|
21356
21381
|
/* @__PURE__ */ jsx70("strong", { children: "Team:" }),
|
|
21357
21382
|
" ",
|
|
21358
|
-
|
|
21383
|
+
/* @__PURE__ */ jsx70(TeamMemberInlineList, { teamMembers })
|
|
21359
21384
|
] }),
|
|
21360
21385
|
showPrice && pricing.display.kind !== "unavailable" && /* @__PURE__ */ jsxs54("p", { className: "cr-summary__price", children: [
|
|
21361
21386
|
/* @__PURE__ */ jsx70("strong", { children: pricing.selectableOptions.length > 0 ? "Pricing:" : "Price:" }),
|
|
@@ -22913,7 +22938,7 @@ var init_location_map_client = __esm({
|
|
|
22913
22938
|
});
|
|
22914
22939
|
|
|
22915
22940
|
// ../blocks/src/system/runtime/nodes/shop-commerce-store.ts
|
|
22916
|
-
import * as
|
|
22941
|
+
import * as React19 from "react";
|
|
22917
22942
|
function storageKey(siteId) {
|
|
22918
22943
|
return `riverbank:shop-cart:${siteId}`;
|
|
22919
22944
|
}
|
|
@@ -22929,8 +22954,8 @@ function addPassToCommerceCart(siteId, input) {
|
|
|
22929
22954
|
}
|
|
22930
22955
|
function useCommerceCart(siteId) {
|
|
22931
22956
|
const effectiveSiteId = siteId ?? "unknown";
|
|
22932
|
-
const store =
|
|
22933
|
-
const state =
|
|
22957
|
+
const store = React19.useMemo(() => getStore(effectiveSiteId), [effectiveSiteId]);
|
|
22958
|
+
const state = React19.useSyncExternalStore(
|
|
22934
22959
|
(listener) => store.subscribe(listener),
|
|
22935
22960
|
() => store.getSnapshot(),
|
|
22936
22961
|
() => EMPTY_STATE
|
|
@@ -23025,11 +23050,11 @@ var init_shop_commerce_store = __esm({
|
|
|
23025
23050
|
});
|
|
23026
23051
|
|
|
23027
23052
|
// ../blocks/src/system/runtime/nodes/shop-add-feedback.tsx
|
|
23028
|
-
import * as
|
|
23053
|
+
import * as React20 from "react";
|
|
23029
23054
|
import { jsx as jsx76, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
23030
23055
|
function useTransientShopAddFeedback(timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
23031
|
-
const [activeKey, setActiveKey] =
|
|
23032
|
-
|
|
23056
|
+
const [activeKey, setActiveKey] = React20.useState(null);
|
|
23057
|
+
React20.useEffect(() => {
|
|
23033
23058
|
if (!activeKey) return;
|
|
23034
23059
|
const timeoutId = window.setTimeout(() => {
|
|
23035
23060
|
setActiveKey((current) => current === activeKey ? null : current);
|
|
@@ -23186,7 +23211,7 @@ var init_shop_state = __esm({
|
|
|
23186
23211
|
});
|
|
23187
23212
|
|
|
23188
23213
|
// ../blocks/src/system/runtime/nodes/shop.client.tsx
|
|
23189
|
-
import
|
|
23214
|
+
import React21, { useCallback as useCallback10, useEffect as useEffect21, useRef as useRef11, useState as useState17 } from "react";
|
|
23190
23215
|
import { Fragment as Fragment15, jsx as jsx77, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
23191
23216
|
function ShopClient(props) {
|
|
23192
23217
|
return /* @__PURE__ */ jsx77(PassesMembershipsController, { render: props.render });
|
|
@@ -23198,7 +23223,7 @@ function getCheckoutModalTitle(checkout) {
|
|
|
23198
23223
|
}
|
|
23199
23224
|
function PassesMembershipsController({ render }) {
|
|
23200
23225
|
const api = useBlockApi();
|
|
23201
|
-
const [state, dispatch] =
|
|
23226
|
+
const [state, dispatch] = React21.useReducer(
|
|
23202
23227
|
shopPassesMembershipsReducer,
|
|
23203
23228
|
initialShopPassesMembershipsState
|
|
23204
23229
|
);
|
|
@@ -25416,7 +25441,7 @@ var init_embla_carousel_react_esm = __esm({
|
|
|
25416
25441
|
});
|
|
25417
25442
|
|
|
25418
25443
|
// ../blocks/src/system/runtime/nodes/carousel.client.tsx
|
|
25419
|
-
import
|
|
25444
|
+
import React22 from "react";
|
|
25420
25445
|
import { Fragment as Fragment16, jsx as jsx78, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
25421
25446
|
function normalizeCarouselProps(input) {
|
|
25422
25447
|
const transition = input.transition === "fade" ? "fade" : "slide";
|
|
@@ -25471,8 +25496,8 @@ var init_carousel_client = __esm({
|
|
|
25471
25496
|
autoplayDelay,
|
|
25472
25497
|
loop
|
|
25473
25498
|
}) => {
|
|
25474
|
-
const slides =
|
|
25475
|
-
const normalized =
|
|
25499
|
+
const slides = React22.Children.toArray(children).filter(Boolean);
|
|
25500
|
+
const normalized = React22.useMemo(
|
|
25476
25501
|
() => normalizeCarouselProps({
|
|
25477
25502
|
slidesToShow,
|
|
25478
25503
|
transition,
|
|
@@ -25495,11 +25520,11 @@ var init_carousel_client = __esm({
|
|
|
25495
25520
|
]
|
|
25496
25521
|
);
|
|
25497
25522
|
const resolvedSlides = resolveSlidesToShowMobile(normalized.slidesToShow);
|
|
25498
|
-
const cssVars =
|
|
25523
|
+
const cssVars = React22.useMemo(
|
|
25499
25524
|
() => getCarouselSlidesToShowCssVars(normalized.slidesToShow),
|
|
25500
25525
|
[normalized.slidesToShow]
|
|
25501
25526
|
);
|
|
25502
|
-
const plugins =
|
|
25527
|
+
const plugins = React22.useMemo(() => {
|
|
25503
25528
|
if (!normalized.autoplay) return void 0;
|
|
25504
25529
|
return [
|
|
25505
25530
|
Autoplay({
|
|
@@ -25521,11 +25546,11 @@ var init_carousel_client = __esm({
|
|
|
25521
25546
|
},
|
|
25522
25547
|
plugins
|
|
25523
25548
|
);
|
|
25524
|
-
const [selectedIndex, setSelectedIndex] =
|
|
25525
|
-
const [scrollSnaps, setScrollSnaps] =
|
|
25526
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
25527
|
-
const [canScrollNext, setCanScrollNext] =
|
|
25528
|
-
|
|
25549
|
+
const [selectedIndex, setSelectedIndex] = React22.useState(0);
|
|
25550
|
+
const [scrollSnaps, setScrollSnaps] = React22.useState([]);
|
|
25551
|
+
const [canScrollPrev, setCanScrollPrev] = React22.useState(false);
|
|
25552
|
+
const [canScrollNext, setCanScrollNext] = React22.useState(false);
|
|
25553
|
+
React22.useEffect(() => {
|
|
25529
25554
|
if (!api) return;
|
|
25530
25555
|
const onInit = () => {
|
|
25531
25556
|
setScrollSnaps(api.scrollSnapList());
|
|
@@ -25548,7 +25573,7 @@ var init_carousel_client = __esm({
|
|
|
25548
25573
|
api.off("reInit", onSelect);
|
|
25549
25574
|
};
|
|
25550
25575
|
}, [api]);
|
|
25551
|
-
|
|
25576
|
+
React22.useEffect(() => {
|
|
25552
25577
|
if (!api || !normalized.autoplay) return;
|
|
25553
25578
|
const autoplayPlugin = api.plugins()?.autoplay;
|
|
25554
25579
|
if (!autoplayPlugin) return;
|
|
@@ -25759,16 +25784,16 @@ var init_shop_checkout_state = __esm({
|
|
|
25759
25784
|
});
|
|
25760
25785
|
|
|
25761
25786
|
// ../blocks/src/system/runtime/nodes/shop-commerce.tsx
|
|
25762
|
-
import * as
|
|
25787
|
+
import * as React23 from "react";
|
|
25763
25788
|
import { Fragment as Fragment17, jsx as jsx79, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
25764
25789
|
function ProductListController(props) {
|
|
25765
25790
|
const api = useBlockApi();
|
|
25766
25791
|
const cart = useCommerceCart(api.config.siteId);
|
|
25767
25792
|
const addFeedback = useTransientShopAddFeedback();
|
|
25768
|
-
const [variantSelection, setVariantSelection] =
|
|
25793
|
+
const [variantSelection, setVariantSelection] = React23.useState(
|
|
25769
25794
|
() => Object.fromEntries(props.render.display.cards.map((card) => [card.productId, card.selectedVariantId]))
|
|
25770
25795
|
);
|
|
25771
|
-
const cards =
|
|
25796
|
+
const cards = React23.useMemo(
|
|
25772
25797
|
() => props.render.hydration.products.map(
|
|
25773
25798
|
(product) => buildProductCardDisplay(
|
|
25774
25799
|
product,
|
|
@@ -25783,7 +25808,7 @@ function ProductListController(props) {
|
|
|
25783
25808
|
),
|
|
25784
25809
|
[props.render.hydration, variantSelection]
|
|
25785
25810
|
);
|
|
25786
|
-
const display =
|
|
25811
|
+
const display = React23.useMemo(
|
|
25787
25812
|
() => ({
|
|
25788
25813
|
...props.render.display,
|
|
25789
25814
|
state: cards.length === 0 ? "empty" : "ready",
|
|
@@ -25845,17 +25870,17 @@ function ProductDetailController(props) {
|
|
|
25845
25870
|
const api = useBlockApi();
|
|
25846
25871
|
const cart = useCommerceCart(api.config.siteId);
|
|
25847
25872
|
const addFeedback = useTransientShopAddFeedback();
|
|
25848
|
-
const selectedProduct =
|
|
25873
|
+
const selectedProduct = React23.useMemo(
|
|
25849
25874
|
() => props.render.hydration.products.find((product) => product.id === props.render.hydration.productId) ?? null,
|
|
25850
25875
|
[props.render.hydration.productId, props.render.hydration.products]
|
|
25851
25876
|
);
|
|
25852
|
-
const [variantId, setVariantId] =
|
|
25877
|
+
const [variantId, setVariantId] = React23.useState(
|
|
25853
25878
|
props.render.display.state === "ready" ? props.render.display.selectedVariantId : null
|
|
25854
25879
|
);
|
|
25855
|
-
|
|
25880
|
+
React23.useEffect(() => {
|
|
25856
25881
|
setVariantId(props.render.display.state === "ready" ? props.render.display.selectedVariantId : null);
|
|
25857
25882
|
}, [props.render.display]);
|
|
25858
|
-
const display =
|
|
25883
|
+
const display = React23.useMemo(
|
|
25859
25884
|
() => buildProductDetailDisplay(
|
|
25860
25885
|
selectedProduct,
|
|
25861
25886
|
{
|
|
@@ -25923,7 +25948,7 @@ function ProductDetailController(props) {
|
|
|
25923
25948
|
function CartController(props) {
|
|
25924
25949
|
const api = useBlockApi();
|
|
25925
25950
|
const cart = useCommerceCart(api.config.siteId);
|
|
25926
|
-
const display =
|
|
25951
|
+
const display = React23.useMemo(
|
|
25927
25952
|
() => getShopDisplayForItems(props.render, cart.items),
|
|
25928
25953
|
[cart.items, props.render]
|
|
25929
25954
|
);
|
|
@@ -25966,11 +25991,11 @@ function CartController(props) {
|
|
|
25966
25991
|
function CheckoutController(props) {
|
|
25967
25992
|
const api = useBlockApi();
|
|
25968
25993
|
const cart = useCommerceCart(api.config.siteId);
|
|
25969
|
-
const [state, dispatch] =
|
|
25994
|
+
const [state, dispatch] = React23.useReducer(
|
|
25970
25995
|
shopCheckoutReducer,
|
|
25971
25996
|
initialShopCheckoutState
|
|
25972
25997
|
);
|
|
25973
|
-
|
|
25998
|
+
React23.useEffect(() => {
|
|
25974
25999
|
const checkout = consumeSearchParam("checkout");
|
|
25975
26000
|
if (checkout === "success") {
|
|
25976
26001
|
cart.clear();
|
|
@@ -25979,7 +26004,7 @@ function CheckoutController(props) {
|
|
|
25979
26004
|
dispatch({ type: "setNotice", notice: "cancelled" });
|
|
25980
26005
|
}
|
|
25981
26006
|
}, [cart]);
|
|
25982
|
-
const display =
|
|
26007
|
+
const display = React23.useMemo(
|
|
25983
26008
|
() => getShopDisplayForItems(props.render, cart.items),
|
|
25984
26009
|
[cart.items, props.render]
|
|
25985
26010
|
);
|
|
@@ -26139,7 +26164,7 @@ var init_checkout_client = __esm({
|
|
|
26139
26164
|
});
|
|
26140
26165
|
|
|
26141
26166
|
// ../blocks/src/system/runtime/header/HeaderCartDrawer.tsx
|
|
26142
|
-
import * as
|
|
26167
|
+
import * as React24 from "react";
|
|
26143
26168
|
import { jsx as jsx84, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
26144
26169
|
function normalizeQuantityInput(value) {
|
|
26145
26170
|
const parsed = Number(value);
|
|
@@ -26189,8 +26214,8 @@ function HeaderCartDrawerItems(props) {
|
|
|
26189
26214
|
)) });
|
|
26190
26215
|
}
|
|
26191
26216
|
function HeaderCartDrawer(props) {
|
|
26192
|
-
const titleId =
|
|
26193
|
-
const display =
|
|
26217
|
+
const titleId = React24.useId();
|
|
26218
|
+
const display = React24.useMemo(
|
|
26194
26219
|
() => buildCartDisplay(props.cart.items, {
|
|
26195
26220
|
heading: "Cart",
|
|
26196
26221
|
emptyMessage: "Your cart is empty.",
|
|
@@ -26404,15 +26429,15 @@ var init_HeaderCartTrigger = __esm({
|
|
|
26404
26429
|
});
|
|
26405
26430
|
|
|
26406
26431
|
// ../blocks/src/system/runtime/header/headerCartRuntime.tsx
|
|
26407
|
-
import * as
|
|
26432
|
+
import * as React25 from "react";
|
|
26408
26433
|
import { createPortal as createPortal2 } from "react-dom";
|
|
26409
26434
|
import { createRoot } from "react-dom/client";
|
|
26410
26435
|
import { Fragment as Fragment18, jsx as jsx86, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
26411
26436
|
function HeaderCartRuntime(props) {
|
|
26412
26437
|
const cart = useCommerceCart(props.siteId);
|
|
26413
|
-
const itemCount =
|
|
26414
|
-
const [open, setOpen] =
|
|
26415
|
-
const checkoutHref =
|
|
26438
|
+
const itemCount = React25.useMemo(() => getCartItemCount(cart.items), [cart.items]);
|
|
26439
|
+
const [open, setOpen] = React25.useState(false);
|
|
26440
|
+
const checkoutHref = React25.useMemo(
|
|
26416
26441
|
() => resolveHeaderCartCheckoutHref(
|
|
26417
26442
|
props.mounts,
|
|
26418
26443
|
typeof window === "undefined" ? null : window.location.pathname
|
|
@@ -34443,7 +34468,7 @@ init_responsiveMode();
|
|
|
34443
34468
|
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
34444
34469
|
|
|
34445
34470
|
// ../theme-core/src/ThemeFontLoader.tsx
|
|
34446
|
-
import * as
|
|
34471
|
+
import * as React34 from "react";
|
|
34447
34472
|
init_selectorUtils();
|
|
34448
34473
|
import { Fragment as Fragment21, jsx as jsx121, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
34449
34474
|
|