@riverbankcms/sdk 0.77.1 → 0.78.2
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/README.md +114 -43
- package/dist/{PreviewEditorSidebar-DVUG7GK4.mjs → PreviewEditorSidebar-4DXLYX2V.mjs} +4962 -4885
- package/dist/{PreviewEditorUI-P7RN4CDS.mjs → PreviewEditorUI-CS5P4N3P.mjs} +4 -4
- package/dist/SdkPreviewModeRuntime-IJDHTW4W.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +190 -154
- package/dist/_dts/api/src/accessAdmin.d.ts +5 -0
- package/dist/_dts/api/src/billing.d.ts +3 -26
- package/dist/_dts/api/src/bookingVerticals.d.ts +4 -0
- package/dist/_dts/api/src/content-editor.d.ts +1 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
- package/dist/_dts/api/src/demoDashboardMutationSurfaces.d.ts +46 -0
- package/dist/_dts/api/src/endpoints.d.ts +17 -0
- package/dist/_dts/api/src/index.d.ts +16 -4
- package/dist/_dts/api/src/navigation/dashboardBookingsNav.d.ts +87 -0
- package/dist/_dts/api/src/navigation/dashboardDemoNav.d.ts +5 -0
- package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +45 -0
- package/dist/_dts/api/src/navigation/dashboardSiteNav.d.ts +42 -0
- package/dist/_dts/api/src/navigation/dashboardTeamMemberNav.d.ts +24 -0
- package/dist/_dts/api/src/navigation/linkUrlType.d.ts +3 -0
- package/dist/_dts/api/src/navigation.d.ts +12 -0
- package/dist/_dts/api/src/public/types.d.ts +1 -1
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +55 -26
- package/dist/_dts/api/src/request.d.ts +3 -11
- package/dist/_dts/api/src/sdkConfig/contracts.d.ts +1 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +7 -1
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +10 -0
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +1 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +15 -19
- package/dist/_dts/api/src/staffAccess.d.ts +79 -0
- package/dist/_dts/api/src/types.d.ts +14 -27
- package/dist/_dts/api/src/workflows/automaticWorkflowTriggers.d.ts +21 -0
- package/dist/_dts/block-form/src/fields/types.d.ts +6 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterList.d.ts +3 -2
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterRow.d.ts +6 -3
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterRowActions.d.ts +8 -3
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/index.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useLinearRepeaterDnd.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useRepeaterPointerDragCapability.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/hooks/useResolvedItemLabel.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/buildSummary.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/index.d.ts +3 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/repeaterDndDomain.d.ts +1 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/repeaterLabelSource.d.ts +15 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/repeaterRowActionsDomain.d.ts +50 -0
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +4 -1
- package/dist/_dts/blocks/src/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +885 -289
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +3 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +68 -21
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +879 -288
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +3 -0
- package/dist/_dts/blocks/src/system/data/index.d.ts +5 -3
- package/dist/_dts/blocks/src/system/data/previewResolvedDataState.d.ts +45 -0
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +2 -1
- package/dist/_dts/blocks/src/system/fragments/library/faqAccordion.d.ts +5 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +193 -29
- package/dist/_dts/blocks/src/system/node/fragments/headingDecoration.d.ts +10 -0
- package/dist/_dts/blocks/src/system/node/fragments/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/node/fragments/styledSection.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +3 -2
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +43 -8
- package/dist/_dts/blocks/src/system/runtime/header/shared.d.ts +8 -7
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCompactRow.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.client.d.ts +2 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.server.d.ts +2 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-cart-discount-ui.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-checkout-form.d.ts +76 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-checkout.state.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-commerce-store.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-commerce.shared.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-discount-apply.state.d.ts +52 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.state.d.ts +2 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/useDiscountApply.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.d.ts +54 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/transforms/registry/ui.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -1
- package/dist/_dts/content-editor/src/contentTypeEditorContentState.d.ts +26 -0
- package/dist/_dts/content-editor/src/definitions/factory.d.ts +75 -0
- package/dist/_dts/content-editor/src/entryWorkflows.d.ts +2 -0
- package/dist/_dts/content-editor/src/footerBlocksEditorState.d.ts +76 -0
- package/dist/_dts/content-editor/src/index.d.ts +6 -1
- package/dist/_dts/content-editor/src/pageWorkflowContent.d.ts +29 -0
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +2 -2
- package/dist/_dts/content-model/src/content-types/schema.d.ts +17 -3
- package/dist/_dts/content-model/src/index.d.ts +1 -0
- package/dist/_dts/content-model/src/routeTemplate.d.ts +4 -0
- package/dist/_dts/content-model/src/templates/bindingTypeCompatibility.d.ts +3 -1
- package/dist/_dts/content-model/src/templates/bindingValidation.d.ts +10 -4
- package/dist/_dts/content-model/src/templates/editorState.d.ts +25 -0
- package/dist/_dts/content-model/src/templates/fieldPaths.d.ts +20 -0
- package/dist/_dts/content-model/src/templates/manifestAdapter.d.ts +5 -2
- package/dist/_dts/core/src/branded.d.ts +108 -85
- package/dist/_dts/core/src/csv-cells.d.ts +10 -0
- package/dist/_dts/core/src/csv-date-filter.d.ts +27 -0
- package/dist/_dts/core/src/csv-escape.d.ts +1 -0
- package/dist/_dts/core/src/csv-filename.d.ts +18 -0
- package/dist/_dts/core/src/csv-render.d.ts +4 -0
- package/dist/_dts/core/src/csv-types.d.ts +116 -0
- package/dist/_dts/core/src/currency-format.d.ts +4 -0
- package/dist/_dts/core/src/demo-capability-policy.d.ts +29 -0
- package/dist/_dts/core/src/demo-claim-access.d.ts +14 -0
- package/dist/_dts/core/src/demo-lifecycle-status.d.ts +11 -0
- package/dist/_dts/core/src/demo-runtime.d.ts +47 -0
- package/dist/_dts/core/src/duration.d.ts +14 -0
- package/dist/_dts/core/src/editor-state.d.ts +7 -7
- package/dist/_dts/core/src/email-format.d.ts +10 -0
- package/dist/_dts/core/src/field-errors.d.ts +1 -0
- package/dist/_dts/core/src/form-submission-preview.d.ts +24 -0
- package/dist/_dts/core/src/index.d.ts +20 -0
- package/dist/_dts/core/src/number-input.d.ts +22 -0
- package/dist/_dts/core/src/participants.d.ts +2 -2
- package/dist/_dts/core/src/public-url-validation.d.ts +12 -0
- package/dist/_dts/core/src/slug.d.ts +39 -0
- package/dist/_dts/core/src/string.d.ts +19 -0
- package/dist/_dts/core/src/uuid.d.ts +6 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +11 -0
- package/dist/_dts/db/src/schemas/forms.d.ts +50 -50
- package/dist/_dts/editor-blocks/src/blockPayload.d.ts +1 -1
- package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +34 -0
- package/dist/_dts/media-core/src/bulkDeletePlanning.d.ts +24 -0
- package/dist/_dts/media-core/src/canonicalCropReview.d.ts +66 -0
- package/dist/_dts/media-core/src/classifyAllPlanning.d.ts +48 -0
- package/dist/_dts/media-core/src/filename.d.ts +1 -0
- package/dist/_dts/media-core/src/index.d.ts +10 -0
- package/dist/_dts/media-core/src/mediaAssetUsageStatus.d.ts +47 -0
- package/dist/_dts/media-core/src/mediaSettingsState.d.ts +3 -0
- package/dist/_dts/media-core/src/portableMediaReferences.d.ts +38 -0
- package/dist/_dts/media-core/src/uploadVerificationContract.d.ts +28 -0
- package/dist/_dts/media-core/src/videoAssetRepair.d.ts +38 -0
- package/dist/_dts/media-editor/src/MediaEditor.d.ts +3 -1
- package/dist/_dts/media-editor/src/MediaPreview.d.ts +3 -1
- package/dist/_dts/media-editor/src/fieldUi.d.ts +5 -0
- package/dist/_dts/media-editor/src/index.d.ts +1 -1
- package/dist/_dts/media-editor/src/mediaEditorDebug.d.ts +1 -0
- package/dist/_dts/path-utils/src/index.d.ts +8 -0
- package/dist/_dts/path-utils/src/redirectPaths.d.ts +26 -0
- package/dist/_dts/path-utils/src/safeAppPath.d.ts +26 -0
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeButton.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -0
- package/dist/_dts/preview-next/src/client/preview/previewDocumentFrame.d.ts +31 -0
- package/dist/_dts/sdk/src/cli/commands/push/consts.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/push/metadata.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/commands/push/stale.d.ts +3 -3
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +7 -0
- package/dist/_dts/sdk/src/cli/commands/push.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +13 -0
- package/dist/_dts/sdk/src/cli/content/writer.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/helpers.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandKeys.d.ts +6 -6
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +5 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +4 -0
- package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +5 -2
- package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +10 -1
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionTypes.d.ts +1 -1
- package/dist/_dts/sdk/src/client/error.d.ts +3 -0
- package/dist/_dts/sdk/src/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/management/types.d.ts +6 -0
- package/dist/_dts/sdk/src/client/types.d.ts +39 -21
- package/dist/_dts/sdk/src/config/content-types.d.ts +7 -0
- package/dist/_dts/sdk/src/config/field-definitions.d.ts +2 -0
- package/dist/_dts/sdk/src/index.d.ts +2 -2
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +16 -16
- package/dist/_dts/sdk/src/next/content-load-failure.d.ts +51 -0
- package/dist/_dts/sdk/src/next/index.d.ts +2 -1
- package/dist/_dts/sdk/src/next/types.d.ts +19 -0
- package/dist/_dts/sdk/src/portal/redirects.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +3 -2
- package/dist/_dts/sdk/src/routing/resolvePageContent.d.ts +71 -6
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +15 -12
- package/dist/_dts/site-commands/src/index.d.ts +1 -0
- package/dist/_dts/site-commands/src/pagePaths.d.ts +6 -0
- package/dist/_dts/theme-core/src/accordions/siteStyleDefaults.d.ts +26 -0
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -0
- package/dist/_dts/theme-core/src/blocks/vars/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/fonts/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/fonts/uploadFormat.d.ts +44 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/index.d.ts +3 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +36 -24
- package/dist/_dts/theme-core/src/navigation/generateNavLinkCSS.d.ts +6 -1
- package/dist/_dts/theme-core/src/navigation/types.d.ts +12 -0
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +3 -3
- package/dist/_dts/theme-core/src/runtime/themeCssVarNames.d.ts +7 -0
- package/dist/_dts/theme-core/src/schema.d.ts +64 -18
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +214 -34
- package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +5 -2
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +214 -34
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +24 -0
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +31 -3
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +33 -1
- package/dist/_dts/theme-core/src/site-styles/rawStyleFields.d.ts +4 -2
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +9 -1
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +27 -2
- package/dist/_dts/theme-core/src/siteChrome.d.ts +17 -34
- package/dist/_dts/theme-core/src/siteChromeOverlayClearance.d.ts +22 -0
- package/dist/_dts/theme-core/src/siteChromePlacement.d.ts +22 -0
- package/dist/_dts/theme-core/src/siteChromePlanning.d.ts +32 -0
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +2 -2
- package/dist/{altcha-B5XGSXP5.mjs → altcha-EKUEQ4RP.mjs} +1 -1
- package/dist/{chunk-IENWFSLO.mjs → chunk-4QEGTLK6.mjs} +1 -1
- package/dist/{chunk-ZYEJLCTN.mjs → chunk-6HYXHRAI.mjs} +5 -5
- package/dist/{chunk-VX7B5VAC.mjs → chunk-CR5HKAGU.mjs} +32 -5
- package/dist/{chunk-KWJPDZH2.mjs → chunk-MCRQMPET.mjs} +3793 -1201
- package/dist/{chunk-6SMUFTXD.mjs → chunk-OKMBEAXY.mjs} +1 -1
- package/dist/{chunk-XGB3TDIC.mjs → chunk-R7POPVJR.mjs} +2 -8
- package/dist/{chunk-2SPENC5M.mjs → chunk-RGTOD4AJ.mjs} +242 -57
- package/dist/cli/index.mjs +2361 -668
- package/dist/cli/init-docs/content/cli-reference.md +3 -2
- package/dist/cli/init-docs/content/content-management.md +2 -2
- package/dist/cli/init-docs/content/workflow-preview-mode.md +68 -2
- package/dist/client/{accordion-RZMQSYLR.mjs → accordion-PLYNJIIM.mjs} +2 -2
- package/dist/client/analytics.mjs +1 -1
- package/dist/client/{bookingForm-NF4ASVNV.mjs → bookingForm-BXAP6AO7.mjs} +76 -72
- package/dist/client/bookings.mjs +3765 -310
- package/dist/client/{carousel-LDX47ZIK.mjs → carousel-TRBXDHGF.mjs} +3 -4
- package/dist/client/{cart-RGXDS5F4.mjs → cart-Z7H3HJRS.mjs} +8 -8
- package/dist/client/{checkout-P7WWSNNY.mjs → checkout-WAFCUBIX.mjs} +8 -8
- package/dist/client/{chunk-II7O4XN3.mjs → chunk-75OUS5MT.mjs} +2 -2
- package/dist/client/{chunk-PMAIXMAB.mjs → chunk-AUJ5DBZJ.mjs} +42 -37
- package/dist/client/{chunk-TQ5MSPDX.mjs → chunk-CE7IBGVW.mjs} +3 -1
- package/dist/client/{chunk-E2TDNXCL.mjs → chunk-CWGTG37I.mjs} +2 -1
- package/dist/client/{chunk-UFSWADAO.mjs → chunk-DNRGY432.mjs} +6 -67
- package/dist/client/{chunk-GMVTOKYG.mjs → chunk-FUXW6VW2.mjs} +512 -66
- package/dist/client/{chunk-R56FQ3RR.mjs → chunk-JGXPTEI2.mjs} +322 -106
- package/dist/client/{chunk-L3DNHIJX.mjs → chunk-JRDUHZCT.mjs} +53 -53
- package/dist/client/{chunk-M3L3KYYR.mjs → chunk-UDNSI5PY.mjs} +12 -0
- package/dist/client/{chunk-JEZECJ3W.mjs → chunk-UVQEJJTN.mjs} +129 -3
- package/dist/client/{chunk-F7LHOKEH.mjs → chunk-XSV6KW4D.mjs} +1 -1
- package/dist/client/chunk-ZFHRN6W2.mjs +66 -0
- package/dist/client/{chunk-JNC7CGHX.mjs → chunk-ZI3LLBPZ.mjs} +3 -3
- package/dist/client/client.mjs +7577 -4979
- package/dist/client/{courseRegistration-7F65K5ZR.mjs → courseRegistration-AHFQHWIJ.mjs} +19 -16
- package/dist/client/{eventCalendar-GLSC5KTL.mjs → eventCalendar-LDXTV5R7.mjs} +10 -10
- package/dist/client/{eventCombined-ZHK4WKUR.mjs → eventCombined-A4JGTNJO.mjs} +10 -10
- package/dist/client/{eventDetails-E3PJYBIN.mjs → eventDetails-4YXTZ7EG.mjs} +10 -10
- package/dist/client/{eventListing-EMS3WC3E.mjs → eventListing-P72TPFFM.mjs} +10 -10
- package/dist/client/{eventRegistration-NZOTVNPI.mjs → eventRegistration-LSYJHGMT.mjs} +10 -10
- package/dist/client/{form-ETFZFATW.mjs → form-AOPYOKOW.mjs} +10 -7
- package/dist/client/{headerSection-4LBP7ULT.mjs → headerSection-5TFYDFVQ.mjs} +3 -3
- package/dist/client/hooks.mjs +1119 -327
- package/dist/client/{locationMap-5M655YSJ.mjs → locationMap-QSZ3ZVAZ.mjs} +3 -3
- package/dist/client/{newsletterForm-QOUYW44O.mjs → newsletterForm-KTRHZY52.mjs} +3 -3
- package/dist/client/{productDetail-O4DOCWQG.mjs → productDetail-N4E775RG.mjs} +8 -8
- package/dist/client/{productList-A5RO5WIS.mjs → productList-UGUQ2S45.mjs} +8 -8
- package/dist/client/rendering/client.mjs +7262 -2775
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +6964 -4587
- package/dist/client/{shop-L4MZH4I2.mjs → shop-VHSZEEQ2.mjs} +8 -8
- package/dist/preview-next/before-render.mjs +18 -1
- package/dist/preview-next/client/runtime.mjs +6 -6
- package/dist/preview-next/editor-chrome.css +10 -0
- package/dist/preview-next/middleware.mjs +18 -1
- package/dist/preview-next/tailwind-sources.css +1 -0
- package/dist/sdk-runtime-WHPJEF5G.mjs +8 -0
- package/dist/server/components.mjs +2736 -1316
- package/dist/server/config-template-validation.mjs +221 -15
- package/dist/server/config-validation.mjs +1346 -550
- package/dist/server/config.mjs +1346 -550
- package/dist/server/data.mjs +1118 -326
- package/dist/server/index.mjs +514 -251
- package/dist/server/next.mjs +4446 -2444
- package/dist/server/page-converter.mjs +631 -155
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +2743 -1323
- package/dist/server/rendering.mjs +2764 -1328
- package/dist/server/routing.mjs +1860 -590
- package/dist/server/server.mjs +1622 -575
- package/dist/server/theme-bridge.mjs +3151 -131
- package/dist/server/theme.mjs +10 -1
- package/dist/styles/index.css +488 -48
- package/package.json +2 -1
- package/dist/SdkPreviewModeRuntime-KLPX47SE.mjs +0 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/DiscountCodeSection.d.ts +0 -7
- package/dist/_dts/preview-next/src/client/widgets/PreviewMediaField.d.ts +0 -4
- package/dist/client/chunk-OJPZEZU2.mjs +0 -31
- package/dist/client/chunk-RTZ3JKKX.mjs +0 -178
- package/dist/sdk-runtime-6UT2S7KZ.mjs +0 -8
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { LeafletStaticMap } from './chunk-
|
|
3
|
-
import { MagicLinkForm, useWaitlistClaim } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { TabBarFragment, logoutPortal, StepIndicator, TerminalPanel, StateIcon, formatPrice, CrossIcon, ClockIcon, consumeSearchParam, LoggedInAsUser, CheckIcon } from './chunk-
|
|
2
|
+
import { LeafletStaticMap } from './chunk-XSV6KW4D.mjs';
|
|
3
|
+
import { MagicLinkForm, useWaitlistClaim } from './chunk-ZI3LLBPZ.mjs';
|
|
4
|
+
import { usePolling } from './chunk-DNRGY432.mjs';
|
|
5
|
+
import { SpinnerNode } from './chunk-CE7IBGVW.mjs';
|
|
6
|
+
import { useDiscountCodeUi } from './chunk-ZFHRN6W2.mjs';
|
|
7
|
+
import { TabBarFragment, logoutPortal, StepIndicator, DiscountCodeDisclosure, TerminalPanel, StateIcon, formatPrice, CrossIcon, ClockIcon, consumeSearchParam, LoggedInAsUser, CheckIcon } from './chunk-UVQEJJTN.mjs';
|
|
8
8
|
import { getFieldValidationControlProps, FieldValidationMessage } from './chunk-3DCJ45Z2.mjs';
|
|
9
9
|
import { ModalShell } from './chunk-3PEDD5KJ.mjs';
|
|
10
10
|
import { isSpamProtectionEnabled, AltchaWidget, getChallengeUrl } from './chunk-YLMKMCSJ.mjs';
|
|
11
|
-
import { useBlockApi, FeedbackMessage } from './chunk-
|
|
12
|
-
import { buildEventCalendarListingRender, getWeekCalendarDays, formatCalendarTitle, groupEventsByDate, getOrderedDayNames, getMonthCalendarDays, formatDateKey, themeButtonClassName, normalizeEventBlockKind, EventCompactRow, EmptyState, getContainerClass, getCardOrientation, addMonths, getThreeMonthRange, isToday, MAX_EVENTS_PER_DAY, formatTime, resolveCoursePricingState, formatEventDateParts, formatCoursePriceAmount, DateTimeTile, normalizeIdList, EventCard, buildTimetableModel, formatDate, isEventContentType, formatCoursePriceDisplay, MONTH_NAMES, formatEventPrice, getEventAvailability, formatEventTeacherLine,
|
|
13
|
-
import { getBookingLocalDateKey, toScheduledBookingDateTime, toBookingTimeZone, formatBookingDateTime, formatBookingDate, formatBookingTime } from './chunk-
|
|
11
|
+
import { useBlockApi, FeedbackMessage } from './chunk-UDNSI5PY.mjs';
|
|
12
|
+
import { buildEventCalendarListingRender, getWeekCalendarDays, formatCalendarTitle, groupEventsByDate, getOrderedDayNames, getMonthCalendarDays, formatDateKey, themeButtonClassName, normalizeEventBlockKind, EventCompactRow, EmptyState, getContainerClass, getCardOrientation, addMonths, getThreeMonthRange, isToday, MAX_EVENTS_PER_DAY, formatTime, resolveCoursePricingState, formatEventDateParts, formatCoursePriceAmount, DateTimeTile, normalizeIdList, EventCard, buildTimetableModel, formatDate, isEventContentType, formatCoursePriceDisplay, MONTH_NAMES, formatEventPrice, getEventAvailability, formatEventTeacherLine, CreditCard, Ticket, Star, Sparkles, assertNever11 } from './chunk-JGXPTEI2.mjs';
|
|
13
|
+
import { getBookingLocalDateKey, toScheduledBookingDateTime, toBookingTimeZone, formatBookingDateTime, formatBookingDate, formatBookingTime } from './chunk-AUJ5DBZJ.mjs';
|
|
14
14
|
import { createContext, useId, useMemo, useState, useRef, useEffect, useCallback, useContext, useReducer } from 'react';
|
|
15
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
16
16
|
|
|
@@ -327,7 +327,7 @@ function eligibilityLookupReducer(state, action) {
|
|
|
327
327
|
error: action.message
|
|
328
328
|
};
|
|
329
329
|
default:
|
|
330
|
-
return
|
|
330
|
+
return assertNever11(action);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
var initialExistingRegistrationLookupState = {
|
|
@@ -349,7 +349,7 @@ function existingRegistrationLookupReducer(state, action) {
|
|
|
349
349
|
registration: action.registration
|
|
350
350
|
};
|
|
351
351
|
default:
|
|
352
|
-
return
|
|
352
|
+
return assertNever11(action);
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
|
|
@@ -382,7 +382,7 @@ function usePortalAuth() {
|
|
|
382
382
|
setProfile(null);
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
checkPortalAuth();
|
|
385
|
+
void checkPortalAuth();
|
|
386
386
|
return () => {
|
|
387
387
|
cancelled = true;
|
|
388
388
|
};
|
|
@@ -446,7 +446,7 @@ function useEligibility(params) {
|
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
fetchEligibility();
|
|
449
|
+
void fetchEligibility();
|
|
450
450
|
return () => {
|
|
451
451
|
cancelled = true;
|
|
452
452
|
};
|
|
@@ -491,7 +491,7 @@ function useExistingEventRegistration({
|
|
|
491
491
|
dispatch({ type: "resolved", registration: null });
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
fetchExistingRegistration();
|
|
494
|
+
void fetchExistingRegistration();
|
|
495
495
|
return () => {
|
|
496
496
|
cancelled = true;
|
|
497
497
|
};
|
|
@@ -1551,6 +1551,14 @@ function EventRegistrationWizardContent(props) {
|
|
|
1551
1551
|
const { wizard } = props;
|
|
1552
1552
|
const showSpamProtection = props.showSpamProtection ?? isSpamProtectionEnabled();
|
|
1553
1553
|
switch (wizard.step) {
|
|
1554
|
+
case "error":
|
|
1555
|
+
case "success":
|
|
1556
|
+
case "submitting":
|
|
1557
|
+
case "redirecting":
|
|
1558
|
+
case "verifying-payment":
|
|
1559
|
+
case "verifying-timeout":
|
|
1560
|
+
case "payment-failed":
|
|
1561
|
+
return null;
|
|
1554
1562
|
case "select-event":
|
|
1555
1563
|
return /* @__PURE__ */ jsx(
|
|
1556
1564
|
EventSelectionStep,
|
|
@@ -1647,43 +1655,21 @@ function EventRegistrationWizardContent(props) {
|
|
|
1647
1655
|
onStateChange: wizard.handlePaymentStepStateChange
|
|
1648
1656
|
}
|
|
1649
1657
|
),
|
|
1650
|
-
wizard.discountsAvailableLoading ? null : wizard.shouldShowDiscountToggle ? /* @__PURE__ */ jsx(
|
|
1651
|
-
|
|
1658
|
+
wizard.discountsAvailableLoading ? null : wizard.shouldShowDiscountToggle ? /* @__PURE__ */ jsx(
|
|
1659
|
+
DiscountCodeDisclosure,
|
|
1652
1660
|
{
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1661
|
+
surface: "event-registration",
|
|
1662
|
+
isOpen: wizard.discountUiOpen,
|
|
1663
|
+
code: wizard.discountCode,
|
|
1664
|
+
onOpen: () => wizard.setDiscountUiOpen(true),
|
|
1665
|
+
onChange: wizard.setDiscountCode,
|
|
1666
|
+
onRemove: () => {
|
|
1667
|
+
wizard.setDiscountCode("");
|
|
1668
|
+
wizard.setDiscountUiOpen(false);
|
|
1669
|
+
},
|
|
1670
|
+
id: "er-discount-code"
|
|
1657
1671
|
}
|
|
1658
|
-
) :
|
|
1659
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "er-discount-code", className: "er-discount__label", children: "Discount code" }),
|
|
1660
|
-
/* @__PURE__ */ jsxs("div", { className: "er-discount__row", children: [
|
|
1661
|
-
/* @__PURE__ */ jsx(
|
|
1662
|
-
"input",
|
|
1663
|
-
{
|
|
1664
|
-
id: "er-discount-code",
|
|
1665
|
-
className: "er-discount__input",
|
|
1666
|
-
value: wizard.discountCode,
|
|
1667
|
-
onChange: (e) => wizard.setDiscountCode(e.target.value),
|
|
1668
|
-
placeholder: "Enter code",
|
|
1669
|
-
autoComplete: "off"
|
|
1670
|
-
}
|
|
1671
|
-
),
|
|
1672
|
-
/* @__PURE__ */ jsx(
|
|
1673
|
-
"button",
|
|
1674
|
-
{
|
|
1675
|
-
type: "button",
|
|
1676
|
-
className: "er-discount__remove",
|
|
1677
|
-
onClick: () => {
|
|
1678
|
-
wizard.setDiscountCode("");
|
|
1679
|
-
wizard.setDiscountUiOpen(false);
|
|
1680
|
-
},
|
|
1681
|
-
children: "Remove"
|
|
1682
|
-
}
|
|
1683
|
-
)
|
|
1684
|
-
] }),
|
|
1685
|
-
/* @__PURE__ */ jsx("p", { className: "er-discount__hint", children: "Applied at checkout." })
|
|
1686
|
-
] }) }) : null
|
|
1672
|
+
) : null
|
|
1687
1673
|
] });
|
|
1688
1674
|
default:
|
|
1689
1675
|
return null;
|
|
@@ -1709,6 +1695,14 @@ function EventRegistrationWizardActions(props) {
|
|
|
1709
1695
|
return wizard.eventRequiresPayment ? "Continue to Payment" : props.buttonText;
|
|
1710
1696
|
};
|
|
1711
1697
|
switch (wizard.step) {
|
|
1698
|
+
case "error":
|
|
1699
|
+
case "success":
|
|
1700
|
+
case "submitting":
|
|
1701
|
+
case "redirecting":
|
|
1702
|
+
case "verifying-payment":
|
|
1703
|
+
case "verifying-timeout":
|
|
1704
|
+
case "payment-failed":
|
|
1705
|
+
return null;
|
|
1712
1706
|
case "select-event":
|
|
1713
1707
|
return null;
|
|
1714
1708
|
case "select-tickets": {
|
|
@@ -1760,10 +1754,10 @@ function EventRegistrationWizardActions(props) {
|
|
|
1760
1754
|
const handlePaymentContinue = () => {
|
|
1761
1755
|
if (!selection.method) return;
|
|
1762
1756
|
if (selection.method === "free") {
|
|
1763
|
-
wizard.handlePaymentSelect("free");
|
|
1757
|
+
void wizard.handlePaymentSelect("free");
|
|
1764
1758
|
return;
|
|
1765
1759
|
}
|
|
1766
|
-
wizard.handlePaymentSelect(
|
|
1760
|
+
void wizard.handlePaymentSelect(
|
|
1767
1761
|
selection.method,
|
|
1768
1762
|
selection.passId ?? selection.bundlePassId,
|
|
1769
1763
|
selection.membershipId ?? selection.bundleMembershipId
|
|
@@ -2730,7 +2724,13 @@ function EventRegistrationWizard(props) {
|
|
|
2730
2724
|
return "Details";
|
|
2731
2725
|
case "select-payment":
|
|
2732
2726
|
return "Payment";
|
|
2733
|
-
|
|
2727
|
+
case "error":
|
|
2728
|
+
case "success":
|
|
2729
|
+
case "submitting":
|
|
2730
|
+
case "redirecting":
|
|
2731
|
+
case "verifying-payment":
|
|
2732
|
+
case "verifying-timeout":
|
|
2733
|
+
case "payment-failed":
|
|
2734
2734
|
return "";
|
|
2735
2735
|
}
|
|
2736
2736
|
});
|
|
@@ -4197,7 +4197,7 @@ function useCalendarEvents({
|
|
|
4197
4197
|
);
|
|
4198
4198
|
if (unloadedMonths.length > 0) {
|
|
4199
4199
|
const range = getThreeMonthRange(date);
|
|
4200
|
-
fetchEventsForRange(range.from, range.to, unloadedMonths);
|
|
4200
|
+
void fetchEventsForRange(range.from, range.to, unloadedMonths);
|
|
4201
4201
|
}
|
|
4202
4202
|
}, [preloadMonths, fetchEventsForRange]);
|
|
4203
4203
|
useEffect(() => {
|
|
@@ -223,6 +223,10 @@ var DISCOUNTS = {
|
|
|
223
223
|
available: {
|
|
224
224
|
path: "/public/sites/{siteId}/bookings/discounts/available",
|
|
225
225
|
method: "POST"
|
|
226
|
+
},
|
|
227
|
+
apply: {
|
|
228
|
+
path: "/public/sites/{siteId}/bookings/discounts/apply",
|
|
229
|
+
method: "POST"
|
|
226
230
|
}
|
|
227
231
|
};
|
|
228
232
|
var NEWSLETTER = {
|
|
@@ -834,6 +838,14 @@ function createBlockApi(config) {
|
|
|
834
838
|
body: { context: data.context, subtotalCents: data.subtotalCents }
|
|
835
839
|
});
|
|
836
840
|
},
|
|
841
|
+
async applyDiscountCode(data) {
|
|
842
|
+
const sid = requireSiteId();
|
|
843
|
+
const path = buildPath(DISCOUNTS.apply.path, { siteId: sid });
|
|
844
|
+
return request(DISCOUNTS.apply, {
|
|
845
|
+
path,
|
|
846
|
+
body: data
|
|
847
|
+
});
|
|
848
|
+
},
|
|
837
849
|
// Shop
|
|
838
850
|
async getPublicProducts(params) {
|
|
839
851
|
const sid = requireSiteId();
|
|
@@ -1,7 +1,133 @@
|
|
|
1
|
-
import { FeedbackMessage } from './chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { FeedbackMessage } from './chunk-UDNSI5PY.mjs';
|
|
2
|
+
import { themeButtonClassName } from './chunk-JGXPTEI2.mjs';
|
|
3
|
+
import { clsx_default } from './chunk-AUJ5DBZJ.mjs';
|
|
4
|
+
import { useId } from 'react';
|
|
3
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
6
|
|
|
7
|
+
var BLOCK_DISCOUNT_CODE_DISCLOSURE_CLASSES = {
|
|
8
|
+
"course-registration": {
|
|
9
|
+
root: "cr-discount",
|
|
10
|
+
toggle: "cr-discount__toggle",
|
|
11
|
+
form: "cr-discount__form",
|
|
12
|
+
label: "cr-discount__label",
|
|
13
|
+
row: "cr-discount__row",
|
|
14
|
+
input: "cr-discount__input",
|
|
15
|
+
apply: "cr-discount__apply",
|
|
16
|
+
remove: "cr-discount__remove",
|
|
17
|
+
hint: "cr-discount__hint",
|
|
18
|
+
feedback: "cr-discount__feedback"
|
|
19
|
+
},
|
|
20
|
+
"event-registration": {
|
|
21
|
+
root: "er-discount",
|
|
22
|
+
toggle: "er-discount__toggle",
|
|
23
|
+
form: "er-discount__form",
|
|
24
|
+
label: "er-discount__label",
|
|
25
|
+
row: "er-discount__row",
|
|
26
|
+
input: "er-discount__input",
|
|
27
|
+
apply: "er-discount__apply",
|
|
28
|
+
remove: "er-discount__remove",
|
|
29
|
+
hint: "er-discount__hint",
|
|
30
|
+
feedback: "er-discount__feedback"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var textLinkButtonClassName = ["button", "link"].join("-");
|
|
34
|
+
var themeFormClasses = {
|
|
35
|
+
root: "rb-flex rb-flex-col rb-gap-2 rb-mb-4",
|
|
36
|
+
toggle: `${textLinkButtonClassName} rb-self-start`,
|
|
37
|
+
form: "rb-flex rb-flex-col rb-gap-2",
|
|
38
|
+
label: "form-label",
|
|
39
|
+
row: "rb-flex rb-flex-col rb-gap-2 rb-sm-flex-row",
|
|
40
|
+
input: "form-input",
|
|
41
|
+
apply: themeButtonClassName({ variant: "secondary", size: "sm" }),
|
|
42
|
+
remove: themeButtonClassName({ variant: "secondary", size: "sm" }),
|
|
43
|
+
hint: "rb-caption status-muted",
|
|
44
|
+
feedback: "rb-caption"
|
|
45
|
+
};
|
|
46
|
+
function getDiscountCodeDisclosureClasses(surface) {
|
|
47
|
+
if (surface === "theme-form") return themeFormClasses;
|
|
48
|
+
return BLOCK_DISCOUNT_CODE_DISCLOSURE_CLASSES[surface];
|
|
49
|
+
}
|
|
50
|
+
function DiscountCodeDisclosure({
|
|
51
|
+
surface,
|
|
52
|
+
isOpen,
|
|
53
|
+
code,
|
|
54
|
+
onOpen,
|
|
55
|
+
onChange,
|
|
56
|
+
onRemove,
|
|
57
|
+
onApply,
|
|
58
|
+
id,
|
|
59
|
+
toggleLabel = "Have a discount code?",
|
|
60
|
+
label = "Discount code",
|
|
61
|
+
placeholder = "Enter code",
|
|
62
|
+
applyLabel = "Apply",
|
|
63
|
+
removeLabel = "Remove",
|
|
64
|
+
hint = "Applied at checkout.",
|
|
65
|
+
feedback = null,
|
|
66
|
+
isApplying = false,
|
|
67
|
+
applyDisabled = false,
|
|
68
|
+
disabled = false
|
|
69
|
+
}) {
|
|
70
|
+
const generatedId = useId();
|
|
71
|
+
const inputId = id ?? `discount-code-${generatedId}`;
|
|
72
|
+
const classes = getDiscountCodeDisclosureClasses(surface);
|
|
73
|
+
const handleChange = (event) => {
|
|
74
|
+
onChange(event.target.value);
|
|
75
|
+
};
|
|
76
|
+
const handleKeyDown = (event) => {
|
|
77
|
+
if (!onApply || event.key !== "Enter") return;
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
onApply();
|
|
80
|
+
};
|
|
81
|
+
const feedbackClassName = feedback ? `${classes.feedback} status-${feedback.tone}` : classes.feedback;
|
|
82
|
+
return /* @__PURE__ */ jsx("div", { className: classes.root, children: !isOpen ? /* @__PURE__ */ jsx("button", { type: "button", className: classes.toggle, onClick: onOpen, children: toggleLabel }) : /* @__PURE__ */ jsxs("div", { className: classes.form, children: [
|
|
83
|
+
/* @__PURE__ */ jsx("label", { htmlFor: inputId, className: classes.label, children: label }),
|
|
84
|
+
/* @__PURE__ */ jsxs("div", { className: classes.row, children: [
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
"input",
|
|
87
|
+
{
|
|
88
|
+
id: inputId,
|
|
89
|
+
className: classes.input,
|
|
90
|
+
value: code,
|
|
91
|
+
onChange: handleChange,
|
|
92
|
+
onKeyDown: handleKeyDown,
|
|
93
|
+
placeholder,
|
|
94
|
+
autoComplete: "off",
|
|
95
|
+
disabled: disabled || isApplying
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
onApply ? /* @__PURE__ */ jsx(
|
|
99
|
+
"button",
|
|
100
|
+
{
|
|
101
|
+
type: "button",
|
|
102
|
+
className: classes.apply,
|
|
103
|
+
onClick: onApply,
|
|
104
|
+
disabled: disabled || isApplying || applyDisabled,
|
|
105
|
+
children: isApplying ? "Applying..." : applyLabel
|
|
106
|
+
}
|
|
107
|
+
) : null,
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
"button",
|
|
110
|
+
{
|
|
111
|
+
type: "button",
|
|
112
|
+
className: classes.remove,
|
|
113
|
+
onClick: onRemove,
|
|
114
|
+
disabled: disabled || isApplying,
|
|
115
|
+
children: removeLabel
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsx("p", { className: classes.hint, children: hint }),
|
|
120
|
+
feedback ? /* @__PURE__ */ jsx(
|
|
121
|
+
"p",
|
|
122
|
+
{
|
|
123
|
+
className: feedbackClassName,
|
|
124
|
+
role: feedback.tone === "error" ? "alert" : "status",
|
|
125
|
+
children: feedback.message
|
|
126
|
+
}
|
|
127
|
+
) : null
|
|
128
|
+
] }) });
|
|
129
|
+
}
|
|
130
|
+
|
|
5
131
|
// ../blocks/src/system/runtime/shared/utils/checkoutUrls.ts
|
|
6
132
|
function buildCheckoutReturnUrls(paramName, anchorId) {
|
|
7
133
|
const currentUrl = new URL(window.location.href);
|
|
@@ -380,4 +506,4 @@ function StepIndicator({
|
|
|
380
506
|
}) }) });
|
|
381
507
|
}
|
|
382
508
|
|
|
383
|
-
export { ActionRow, CheckIcon, ClockIcon, CrossIcon, LoggedInAsUser, MembershipHero, StateIcon, StepIndicator, TabBarFragment, TerminalPanel, buildCheckoutReturnUrls, consumeSearchParam, consumeSearchParams, createBodyThemePortalRoot, formatPrice, getStepNumber, logoutPortal, scrollToBlock, validateFormData };
|
|
509
|
+
export { ActionRow, CheckIcon, ClockIcon, CrossIcon, DiscountCodeDisclosure, LoggedInAsUser, MembershipHero, StateIcon, StepIndicator, TabBarFragment, TerminalPanel, buildCheckoutReturnUrls, consumeSearchParam, consumeSearchParams, createBodyThemePortalRoot, formatPrice, getStepNumber, logoutPortal, scrollToBlock, validateFormData };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
// ../blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.ts
|
|
5
|
+
function useDiscountCodeUi(options) {
|
|
6
|
+
const [discountUiOpen, setDiscountUiOpen] = useState(false);
|
|
7
|
+
const [discountCode, setDiscountCode] = useState("");
|
|
8
|
+
const [discountsAvailable, setDiscountsAvailable] = useState(false);
|
|
9
|
+
const [manualCodeEntryAllowed, setManualCodeEntryAllowed] = useState(false);
|
|
10
|
+
const [autoAppliedDiscount, setAutoAppliedDiscount] = useState(null);
|
|
11
|
+
const [discountsAvailableLoading, setDiscountsAvailableLoading] = useState(false);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
let cancelled = false;
|
|
14
|
+
async function checkDiscountAvailability() {
|
|
15
|
+
if (!options.discountContext) {
|
|
16
|
+
setDiscountsAvailable(false);
|
|
17
|
+
setManualCodeEntryAllowed(false);
|
|
18
|
+
setAutoAppliedDiscount(null);
|
|
19
|
+
setDiscountsAvailableLoading(false);
|
|
20
|
+
setDiscountUiOpen(false);
|
|
21
|
+
setDiscountCode("");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
setDiscountsAvailableLoading(true);
|
|
25
|
+
try {
|
|
26
|
+
const res = await options.api.getDiscountsAvailable({
|
|
27
|
+
context: options.discountContext,
|
|
28
|
+
subtotalCents: options.subtotalCents
|
|
29
|
+
});
|
|
30
|
+
if (cancelled) return;
|
|
31
|
+
setDiscountsAvailable(res.hasDiscounts);
|
|
32
|
+
setManualCodeEntryAllowed(res.manualCodeEntryAllowed);
|
|
33
|
+
setAutoAppliedDiscount(res.autoAppliedDiscount);
|
|
34
|
+
if (!res.hasDiscounts || !res.manualCodeEntryAllowed) {
|
|
35
|
+
setDiscountUiOpen(false);
|
|
36
|
+
setDiscountCode("");
|
|
37
|
+
}
|
|
38
|
+
} catch {
|
|
39
|
+
if (cancelled) return;
|
|
40
|
+
setDiscountsAvailable(false);
|
|
41
|
+
setManualCodeEntryAllowed(false);
|
|
42
|
+
setAutoAppliedDiscount(null);
|
|
43
|
+
setDiscountUiOpen(false);
|
|
44
|
+
setDiscountCode("");
|
|
45
|
+
} finally {
|
|
46
|
+
if (!cancelled) setDiscountsAvailableLoading(false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
void checkDiscountAvailability();
|
|
50
|
+
return () => {
|
|
51
|
+
cancelled = true;
|
|
52
|
+
};
|
|
53
|
+
}, [options.api, options.discountContext, options.subtotalCents]);
|
|
54
|
+
return {
|
|
55
|
+
discountUiOpen,
|
|
56
|
+
setDiscountUiOpen,
|
|
57
|
+
discountCode,
|
|
58
|
+
setDiscountCode,
|
|
59
|
+
discountsAvailable,
|
|
60
|
+
manualCodeEntryAllowed,
|
|
61
|
+
autoAppliedDiscount,
|
|
62
|
+
discountsAvailableLoading
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { useDiscountCodeUi };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useBlockApi, BlockApiError } from './chunk-
|
|
3
|
-
import { themeButtonClassName } from './chunk-
|
|
2
|
+
import { useBlockApi, BlockApiError } from './chunk-UDNSI5PY.mjs';
|
|
3
|
+
import { themeButtonClassName } from './chunk-JGXPTEI2.mjs';
|
|
4
4
|
import { useState, useSyncExternalStore, useEffect } from 'react';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -186,7 +186,7 @@ function useWaitlistClaim() {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
resolveClaim();
|
|
189
|
+
void resolveClaim();
|
|
190
190
|
return () => {
|
|
191
191
|
cancelled = true;
|
|
192
192
|
};
|