@riverbankcms/sdk 0.148.0 → 0.150.0
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 +1 -1
- package/dist/EventEmbeddedCheckoutStep-D00Kc8Zj.mjs +285 -0
- package/dist/{PreviewEditorSidebar-DvEPG3Z2.mjs → PreviewEditorSidebar-7ZhmmnBB.mjs} +103 -66
- package/dist/{PreviewEditorUI-D6eb6fkx.mjs → PreviewEditorUI-BIJucTRd.mjs} +3 -6
- package/dist/{PreviewQueryProvider-5znTyJuz.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
- package/dist/{SdkPreviewModeRuntime-DJ6utQ_R.mjs → SdkPreviewModeRuntime-tj45gmCX.mjs} +96 -67
- package/dist/{SiteChromeCustomizeContext-CFJYh6vo.mjs → SiteChromeCustomizeContext-BFOt0ss-.mjs} +4804 -4161
- package/dist/_dts/ai/src/contracts/proposals.d.ts +660 -0
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +510 -0
- package/dist/_dts/api/src/billing.d.ts +2 -2
- package/dist/_dts/api/src/bookingConfig.d.ts +33 -48
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
- package/dist/_dts/api/src/bookingOperations.d.ts +5 -7
- package/dist/_dts/api/src/bookingRecords.d.ts +15 -11
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
- package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +0 -2
- package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -1
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
- package/dist/_dts/api/src/endpoints.d.ts +2 -10
- package/dist/_dts/api/src/eventManagementContracts.d.ts +4 -7
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +9 -0
- package/dist/_dts/api/src/footerSettings.d.ts +3 -3
- package/dist/_dts/api/src/index.d.ts +4 -4
- package/dist/_dts/api/src/navigation/bookingPortalLink.d.ts +13 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -0
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -2
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +2 -29
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +9 -173
- package/dist/_dts/api/src/request.d.ts +1 -1
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
- package/dist/_dts/api/src/sdkPullEventContracts.d.ts +1 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +12 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -3
- package/dist/_dts/api/src/siteOperations.d.ts +6 -2
- package/dist/_dts/api/src/siteSettings.d.ts +2 -0
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +2 -1
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +38 -10
- package/dist/_dts/blocks/src/portal/types.d.ts +9 -6
- package/dist/_dts/blocks/src/rendering/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +24 -24
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +30 -3
- package/dist/_dts/blocks/src/system/designCapabilities.d.ts +10 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +38 -18
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/FullyBookedStep.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +15 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentLocation.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +72 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +66 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +13 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/sessionStorage.d.ts +11 -52
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +19 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +7 -42
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +7 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +94 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useGuestRegistrationRecovery.d.ts +30 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +24 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.d.ts +18 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +6 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +24 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -6
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
- package/dist/_dts/blocks/src/system/runtime/shared/stripe/browserStripe.d.ts +8 -0
- package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
- package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
- package/dist/_dts/commerce/src/purchase/checkoutCopy.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
- package/dist/_dts/commerce/src/purchase/checkoutPresentation.d.ts +49 -0
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +6 -6
- package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +5 -1
- package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +9 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +3 -3
- package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
- package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
- package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +4 -1
- package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
- package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
- package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +9 -2
- package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/types.d.ts +7 -7
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +3 -2
- package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +6 -1
- package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +7 -0
- package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
- package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
- package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
- package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
- package/dist/_dts/core/src/branded.d.ts +3 -0
- package/dist/_dts/core/src/edit-lease.d.ts +5 -0
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/patch/index.d.ts +30 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +326 -36
- package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
- package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
- package/dist/_dts/media-editor/src/index.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +0 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
- package/dist/_dts/preview-next/src/constants.d.ts +4 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +147 -0
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +22 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +22 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +12 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +198 -0
- package/dist/_dts/theme-core/src/palette/utils/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/palette/utils/scrimContrast.d.ts +22 -0
- package/dist/_dts/theme-core/src/runtime/bridgeColourTokens.d.ts +10 -0
- package/dist/_dts/theme-core/src/schema.d.ts +330 -0
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +11 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +12 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +7 -4
- package/dist/_dts/theme-core/src/site-styles/sectionSurfaceBackgrounds.d.ts +65 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +17 -0
- package/dist/_dts/theme-core/src/surfaces/opaqueSurface.d.ts +43 -0
- package/dist/_dts/ui/src/color-picker.d.ts +1 -1
- package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
- package/dist/client/{BookingMailingListNote-CzRt2dF_.mjs → BookingMailingListNote-CYHOufsI.mjs} +33 -124
- package/dist/client/{CheckboxChoice-B33MqoUo.mjs → CheckboxChoice-M-3HycLw.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-mxqwap3f.mjs → DemoBookingPortalAccess-Cvr9O_ca.mjs} +2 -2
- package/dist/client/{EventCombined.client-CDb11igO.mjs → EventCombined.client-m5UZIobP.mjs} +7 -7
- package/dist/client/EventEmbeddedCheckoutStep-DL6zFAkA.mjs +289 -0
- package/dist/client/{EventListing.client-EgYhzKPa.mjs → EventListing.client-DeMfCM04.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-gtmtaA2b.mjs → LeafletStaticMap-CvZ3gOdD.mjs} +1 -1
- package/dist/client/{checkoutUrls-CXhko2Rv.mjs → RichText-BtfNvQV6.mjs} +2 -29
- package/dist/client/{TerminalPanel-DvNUP5ot.mjs → TerminalPanel-CUCNEwlH.mjs} +2 -18
- package/dist/client/{ThemedButton-C7CeUJjW.mjs → ThemedButton-C7WhXuRl.mjs} +2 -2
- package/dist/client/{accordion-kjvt49rA.mjs → accordion-cQm5mjqs.mjs} +1 -1
- package/dist/client/{bookingForm-pbRZordh.mjs → bookingForm-BVPJE5RQ.mjs} +15 -11
- package/dist/client/bookings.mjs +2860 -1222
- package/dist/client/{carousel-f4Zbmicv.mjs → carousel-3vgnY7LC.mjs} +2 -2
- package/dist/client/{carousel.client-A2lG-9od.mjs → carousel.client-CISsdZvg.mjs} +1 -1
- package/dist/client/{cart-DO20An50.mjs → cart-BGK4oOjm.mjs} +3 -3
- package/dist/client/{checkout-Du5amDR_.mjs → checkout-GsBLUNJD.mjs} +3 -3
- package/dist/client/checkoutUrls-ChxwaNtO.mjs +28 -0
- package/dist/client/client.mjs +3324 -2053
- package/dist/client/{colorStyles-j5U9v5JA.mjs → colorStyles-D-32xHZh.mjs} +2 -30
- package/dist/client/{context-eW97E945.mjs → context-D_8s12Fp.mjs} +1 -1
- package/dist/client/{dates-jPCirRea.mjs → dates-DeJQbQ9T.mjs} +2 -2
- package/dist/client/{eventCalendar-C2M-iE4j.mjs → eventCalendar-cmucD4NR.mjs} +10 -10
- package/dist/client/{eventCombined-W6ns3LHg.mjs → eventCombined-ku3E9FTl.mjs} +4 -4
- package/dist/client/{eventDetails-CR-GT0f0.mjs → eventDetails-CyKZ61sF.mjs} +5 -5
- package/dist/client/{eventListing-BK8AfYZz.mjs → eventListing-B7yxGIhX.mjs} +4 -4
- package/dist/client/{eventRegistration-BJSd4KUu.mjs → eventRegistration-BoXfSFgZ.mjs} +1455 -1184
- package/dist/client/{form-BvpfbQaT.mjs → form-CNQOWhJo.mjs} +5 -5
- package/dist/client/{headerSection-I5sUQ8x-.mjs → headerSection-DahaBJGQ.mjs} +3 -3
- package/dist/client/hooks.mjs +283 -193
- package/dist/client/{locationMap-BLvwf9_f.mjs → locationMap-BoDjqYlW.mjs} +4 -4
- package/dist/client/{media-Cl38iOMI.mjs → media-BFY0y2rb.mjs} +2 -1
- package/dist/client/{newsletterForm-DrQ2weE8.mjs → newsletterForm-DtzXDklw.mjs} +4 -4
- package/dist/client/{pricing-BES87mrR.mjs → pricing-DXEh2Lhh.mjs} +1 -1
- package/dist/client/{productDetail-Url9jcc5.mjs → productDetail-D7cPa-00.mjs} +3 -3
- package/dist/client/{productList-DE7ngEZJ.mjs → productList-D1XMap66.mjs} +3 -3
- package/dist/client/{propsDecoder-D1OtGXDV.mjs → propsDecoder-DiIeBopB.mjs} +913 -322
- package/dist/client/rendering/client.mjs +3913 -2260
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +3302 -2013
- package/dist/client/result-DRW7JWXz.mjs +30 -0
- package/dist/client/{routeIslandApiConfig-BG9Y-SHg.mjs → routeIslandApiConfig-wzR4lKAY.mjs} +1 -1
- package/dist/client/scrollToBlock-C86BYkyV.mjs +17 -0
- package/dist/client/{shop-CJkuySJ3.mjs → shop-CYT5P-S5.mjs} +13 -14
- package/dist/client/{shop-commerce-store-Bxm75Pg6.mjs → shop-commerce-store-wKhsJQxI.mjs} +1 -1
- package/dist/client/{shop-commerce-4rKj5n9h.mjs → shop-commerce-ypBu_dx4.mjs} +9 -9
- package/dist/client/{shopShared-DpoQDWfz.mjs → shopShared-DFGhYrf2.mjs} +52 -6
- package/dist/client/{useEventFilters-D8HliSqR.mjs → useEventFilters-blSbN5o7.mjs} +8 -8
- package/dist/preview-next/before-render.mjs +15 -22
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/constants.mjs +5 -1
- package/dist/preview-next/index.mjs +5 -1
- package/dist/preview-next/keepAlive.mjs +149 -82
- package/dist/preview-next/middleware.mjs +15 -22
- package/dist/{previewAuthStore-BXXF3hhW.mjs → previewAuthStore-BBmV7UsW.mjs} +49 -29
- package/dist/{sdk-runtime-C2a05WjL.mjs → sdk-runtime-2p8uQk1V.mjs} +2 -2
- package/dist/{separator-CuNhBAhS.mjs → separator-Cvvzk0Oo.mjs} +1 -1
- package/dist/server/components.mjs +4041 -3704
- package/dist/server/config-validation.mjs +345 -255
- package/dist/server/config.mjs +345 -255
- package/dist/server/data.mjs +283 -193
- package/dist/server/index.mjs +20 -27
- package/dist/server/next.mjs +788 -469
- package/dist/server/page-converter.mjs +245 -121
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4018 -3690
- package/dist/server/rendering.mjs +4044 -3707
- package/dist/server/routing.mjs +314 -190
- package/dist/server/server.mjs +290 -218
- package/dist/server/theme-bridge.mjs +1122 -310
- package/dist/server/theme.mjs +126 -116
- package/dist/spinner-CDo6AkDz.mjs +658 -0
- package/dist/styles/index.css +75 -212
- package/package.json +1 -1
- package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
- package/dist/_dts/billing/src/checkout/platform.d.ts +0 -77
- package/dist/_dts/billing/src/config/env.d.ts +0 -29
- package/dist/_dts/billing/src/stripe/client.d.ts +0 -29
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +0 -63
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +0 -9
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
- package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
- package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
- package/dist/client/urlParams-D71VXFGx.mjs +0 -47
package/README.md
CHANGED
|
@@ -2835,7 +2835,7 @@ import {
|
|
|
2835
2835
|
|
|
2836
2836
|
## Content Configuration (SDK Content Scaffolding)
|
|
2837
2837
|
|
|
2838
|
-
Define content type schema and SDK-managed configuration in code. File-based documents such as pages, entries, navigation, and settings live in `content/**` and sync with explicit `riverbankcms push` scopes; `push-config` syncs schema/config surfaces only.
|
|
2838
|
+
Define content type schema and SDK-managed configuration in code. File-based documents such as pages, entries, navigation, and settings live in `content/**` and sync with explicit `riverbankcms push` scopes; `push-config` syncs schema/config surfaces only. An existing page or slot block keeps its kind: to use a different kind, create a block with a new identifier and remove the old block.
|
|
2839
2839
|
|
|
2840
2840
|
### Quick Start
|
|
2841
2841
|
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { _ as __commonJSMin, r as checkBrowserStripeKey, t as SpinnerNode } from "./spinner-CDo6AkDz.mjs";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@stripe+stripe-js@9.17.0/node_modules/@stripe/stripe-js/dist/pure.js
|
|
6
|
+
var require_pure$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
function _typeof(obj) {
|
|
9
|
+
"@babel/helpers - typeof";
|
|
10
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") _typeof = function(obj) {
|
|
11
|
+
return typeof obj;
|
|
12
|
+
};
|
|
13
|
+
else _typeof = function(obj) {
|
|
14
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
15
|
+
};
|
|
16
|
+
return _typeof(obj);
|
|
17
|
+
}
|
|
18
|
+
var RELEASE_TRAIN = "dahlia";
|
|
19
|
+
var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {
|
|
20
|
+
return version === 3 ? "v3" : version;
|
|
21
|
+
};
|
|
22
|
+
var ORIGIN = "https://js.stripe.com";
|
|
23
|
+
var STRIPE_JS_URL = "".concat(ORIGIN, "/").concat(RELEASE_TRAIN, "/stripe.js");
|
|
24
|
+
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
25
|
+
var STRIPE_JS_URL_REGEX = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
|
|
26
|
+
var EXISTING_SCRIPT_MESSAGE = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";
|
|
27
|
+
var isStripeJSURL = function isStripeJSURL(url) {
|
|
28
|
+
return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);
|
|
29
|
+
};
|
|
30
|
+
var findScript = function findScript() {
|
|
31
|
+
var scripts = document.querySelectorAll("script[src^=\"".concat(ORIGIN, "\"]"));
|
|
32
|
+
for (var i = 0; i < scripts.length; i++) {
|
|
33
|
+
var script = scripts[i];
|
|
34
|
+
if (!isStripeJSURL(script.src)) continue;
|
|
35
|
+
return script;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
};
|
|
39
|
+
var injectScript = function injectScript(params) {
|
|
40
|
+
var queryString = params && !params.advancedFraudSignals ? "?advancedFraudSignals=false" : "";
|
|
41
|
+
var script = document.createElement("script");
|
|
42
|
+
script.src = "".concat(STRIPE_JS_URL).concat(queryString);
|
|
43
|
+
var headOrBody = document.head || document.body;
|
|
44
|
+
if (!headOrBody) throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
45
|
+
headOrBody.appendChild(script);
|
|
46
|
+
return script;
|
|
47
|
+
};
|
|
48
|
+
var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
49
|
+
if (!stripe || !stripe._registerWrapper) return;
|
|
50
|
+
stripe._registerWrapper({
|
|
51
|
+
name: "stripe-js",
|
|
52
|
+
version: "9.17.0",
|
|
53
|
+
startTime
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
var stripePromise = null;
|
|
57
|
+
var onErrorListener = null;
|
|
58
|
+
var onLoadListener = null;
|
|
59
|
+
var onError = function onError(reject) {
|
|
60
|
+
return function(cause) {
|
|
61
|
+
reject(new Error("Failed to load Stripe.js", { cause }));
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
var onLoad = function onLoad(resolve, reject) {
|
|
65
|
+
return function() {
|
|
66
|
+
if (window.Stripe) resolve(window.Stripe);
|
|
67
|
+
else reject(/* @__PURE__ */ new Error("Stripe.js not available"));
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
var loadScript = function loadScript(params) {
|
|
71
|
+
if (stripePromise !== null) return stripePromise;
|
|
72
|
+
stripePromise = new Promise(function(resolve, reject) {
|
|
73
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
74
|
+
resolve(null);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (window.Stripe && params) console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
78
|
+
if (window.Stripe) {
|
|
79
|
+
resolve(window.Stripe);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
var script = findScript();
|
|
84
|
+
if (script && params) console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
85
|
+
else if (!script) script = injectScript(params);
|
|
86
|
+
else if (script && onLoadListener !== null && onErrorListener !== null) {
|
|
87
|
+
var _script$parentNode;
|
|
88
|
+
script.removeEventListener("load", onLoadListener);
|
|
89
|
+
script.removeEventListener("error", onErrorListener);
|
|
90
|
+
(_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 || _script$parentNode.removeChild(script);
|
|
91
|
+
script = injectScript(params);
|
|
92
|
+
}
|
|
93
|
+
onLoadListener = onLoad(resolve, reject);
|
|
94
|
+
onErrorListener = onError(reject);
|
|
95
|
+
script.addEventListener("load", onLoadListener);
|
|
96
|
+
script.addEventListener("error", onErrorListener);
|
|
97
|
+
} catch (error) {
|
|
98
|
+
reject(error);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return stripePromise["catch"](function(error) {
|
|
103
|
+
stripePromise = null;
|
|
104
|
+
return Promise.reject(error);
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
108
|
+
if (maybeStripe === null) return null;
|
|
109
|
+
var pk = args[0];
|
|
110
|
+
if (typeof pk !== "string") throw new Error("Expected publishable key to be of type string, got type ".concat(_typeof(pk), " instead."));
|
|
111
|
+
var isTestKey = pk.match(/^pk_test/);
|
|
112
|
+
var version = runtimeVersionToUrlVersion(maybeStripe.version);
|
|
113
|
+
var expectedVersion = RELEASE_TRAIN;
|
|
114
|
+
if (isTestKey && version !== expectedVersion) console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.17.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
115
|
+
var stripe = maybeStripe.apply(void 0, args);
|
|
116
|
+
registerWrapper(stripe, startTime);
|
|
117
|
+
return stripe;
|
|
118
|
+
};
|
|
119
|
+
var validateLoadParams = function validateLoadParams(params) {
|
|
120
|
+
var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n");
|
|
121
|
+
if (params === null || _typeof(params) !== "object") throw new Error(errorMessage);
|
|
122
|
+
if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === "boolean") return params;
|
|
123
|
+
throw new Error(errorMessage);
|
|
124
|
+
};
|
|
125
|
+
var loadParams;
|
|
126
|
+
var loadStripeCalled = false;
|
|
127
|
+
var loadStripe = function loadStripe() {
|
|
128
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
129
|
+
loadStripeCalled = true;
|
|
130
|
+
var startTime = Date.now();
|
|
131
|
+
return loadScript(loadParams).then(function(maybeStripe) {
|
|
132
|
+
return initStripe(maybeStripe, args, startTime);
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
loadStripe.setLoadParameters = function(params) {
|
|
136
|
+
if (loadStripeCalled && loadParams) {
|
|
137
|
+
var validatedParams = validateLoadParams(params);
|
|
138
|
+
if (Object.keys(validatedParams).reduce(function(previousValue, currentValue) {
|
|
139
|
+
var _loadParams;
|
|
140
|
+
return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]);
|
|
141
|
+
}, true)) return;
|
|
142
|
+
}
|
|
143
|
+
if (loadStripeCalled) throw new Error("You cannot change load parameters after calling loadStripe");
|
|
144
|
+
loadParams = validateLoadParams(params);
|
|
145
|
+
};
|
|
146
|
+
exports.loadStripe = loadStripe;
|
|
147
|
+
}));
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region ../blocks/src/system/runtime/shared/stripe/browserStripe.ts
|
|
150
|
+
var import_pure = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
151
|
+
module.exports = require_pure$1();
|
|
152
|
+
})))();
|
|
153
|
+
const stripeByContext = /* @__PURE__ */ new Map();
|
|
154
|
+
/** Pure entry loading stays inert until a payment surface calls this function. */
|
|
155
|
+
function loadBrowserStripe(context) {
|
|
156
|
+
const accountId = "kind" in context && context.kind === "connect" ? context.accountId : void 0;
|
|
157
|
+
const cacheKey = JSON.stringify([context.publishableKey, accountId ?? "direct"]);
|
|
158
|
+
const existing = stripeByContext.get(cacheKey);
|
|
159
|
+
if (existing) return existing;
|
|
160
|
+
const loading = (0, import_pure.loadStripe)(context.publishableKey, ...accountId ? [{ stripeAccount: accountId }] : []).then((stripe) => {
|
|
161
|
+
if (!stripe) stripeByContext.delete(cacheKey);
|
|
162
|
+
return stripe;
|
|
163
|
+
}, (error) => {
|
|
164
|
+
stripeByContext.delete(cacheKey);
|
|
165
|
+
throw error;
|
|
166
|
+
});
|
|
167
|
+
stripeByContext.set(cacheKey, loading);
|
|
168
|
+
return loading;
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.tsx
|
|
172
|
+
function useStripeMount(props, container, load) {
|
|
173
|
+
const [status, setStatus] = useState("loading");
|
|
174
|
+
const callbacks = useRef(props);
|
|
175
|
+
callbacks.current = props;
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
const lifecycle = {
|
|
178
|
+
active: true,
|
|
179
|
+
instance: null
|
|
180
|
+
};
|
|
181
|
+
setStatus("loading");
|
|
182
|
+
const fail = () => {
|
|
183
|
+
if (!lifecycle.active) return;
|
|
184
|
+
lifecycle.active = false;
|
|
185
|
+
lifecycle.instance?.destroy();
|
|
186
|
+
lifecycle.instance = null;
|
|
187
|
+
setStatus("failed");
|
|
188
|
+
};
|
|
189
|
+
const timeout = window.setTimeout(fail, 3e4);
|
|
190
|
+
const mount = async () => {
|
|
191
|
+
if (checkBrowserStripeKey(props.checkout.browser.publishableKey, props.checkout.livemode).tag !== "ready") throw new Error("Invalid payment configuration");
|
|
192
|
+
const stripe = await load(props.checkout.browser);
|
|
193
|
+
if (!lifecycle.active) return;
|
|
194
|
+
if (!stripe) throw new Error("Payment form unavailable");
|
|
195
|
+
const instance = await stripe.createEmbeddedCheckoutPage({
|
|
196
|
+
clientSecret: props.checkout.clientSecret,
|
|
197
|
+
onComplete: () => {
|
|
198
|
+
if (lifecycle.active) callbacks.current.onComplete();
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
if (!lifecycle.active || !container.current) {
|
|
202
|
+
instance.destroy();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
lifecycle.instance = instance;
|
|
206
|
+
instance.mount(container.current);
|
|
207
|
+
clearTimeout(timeout);
|
|
208
|
+
setStatus("ready");
|
|
209
|
+
};
|
|
210
|
+
mount().catch(fail);
|
|
211
|
+
return () => {
|
|
212
|
+
lifecycle.active = false;
|
|
213
|
+
clearTimeout(timeout);
|
|
214
|
+
lifecycle.instance?.destroy();
|
|
215
|
+
};
|
|
216
|
+
}, [
|
|
217
|
+
props.checkout,
|
|
218
|
+
container,
|
|
219
|
+
load
|
|
220
|
+
]);
|
|
221
|
+
return status;
|
|
222
|
+
}
|
|
223
|
+
function EventEmbeddedCheckoutStep(props) {
|
|
224
|
+
return /* @__PURE__ */ jsx(EventEmbeddedCheckoutStepWithDeps, {
|
|
225
|
+
...props,
|
|
226
|
+
load: loadBrowserStripe
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function EventEmbeddedCheckoutStepWithDeps(props) {
|
|
230
|
+
const container = useRef(null);
|
|
231
|
+
const heading = useRef(null);
|
|
232
|
+
const status = useStripeMount(props, container, props.load);
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
heading.current?.focus();
|
|
235
|
+
}, []);
|
|
236
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
237
|
+
className: "er-embedded-payment",
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ jsx("h2", {
|
|
240
|
+
ref: heading,
|
|
241
|
+
tabIndex: -1,
|
|
242
|
+
className: "er-title er-message",
|
|
243
|
+
children: "Payment"
|
|
244
|
+
}),
|
|
245
|
+
status === "loading" && /* @__PURE__ */ jsxs("div", {
|
|
246
|
+
className: "er-center er-message",
|
|
247
|
+
role: "status",
|
|
248
|
+
"aria-live": "polite",
|
|
249
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
250
|
+
className: "er-icon",
|
|
251
|
+
children: /* @__PURE__ */ jsx(SpinnerNode, { size: "lg" })
|
|
252
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
253
|
+
className: "er-text--muted",
|
|
254
|
+
children: "Loading secure payment…"
|
|
255
|
+
})]
|
|
256
|
+
}),
|
|
257
|
+
status === "failed" && /* @__PURE__ */ jsxs("div", {
|
|
258
|
+
className: "er-center er-message",
|
|
259
|
+
role: "alert",
|
|
260
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
261
|
+
className: "er-text--muted er-message",
|
|
262
|
+
children: "We couldn’t load the payment form."
|
|
263
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
264
|
+
type: "button",
|
|
265
|
+
className: "er-btn er-btn--primary",
|
|
266
|
+
onClick: props.onRetry,
|
|
267
|
+
children: "Try again"
|
|
268
|
+
})]
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ jsx("div", {
|
|
271
|
+
ref: container,
|
|
272
|
+
className: "er-message",
|
|
273
|
+
style: { width: "100%" }
|
|
274
|
+
}),
|
|
275
|
+
/* @__PURE__ */ jsx("button", {
|
|
276
|
+
type: "button",
|
|
277
|
+
className: "er-back-btn",
|
|
278
|
+
onClick: props.onBack,
|
|
279
|
+
children: "Back to booking"
|
|
280
|
+
})
|
|
281
|
+
]
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
export { EventEmbeddedCheckoutStepWithDeps, EventEmbeddedCheckoutStep as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { a as usePreviewAuth, m as getDashboardUrl, p as unwrapResponse } from "./previewAuthStore-BBmV7UsW.mjs";
|
|
3
|
+
import { $ as FooterComposerPanel, $o as syncStateOf, $t as createStoreBackend, A as markApplySaving, Ai as curatedSiteStyles, An as listPageSurfaceContentSlots, B as setPaletteColors, Ba as CalloutDescription, Bn as resolvePageRouteSlug, C as cancelPreview, D as isPreviewingChange, Do as Maximize2, E as dismissWarnings, Eo as Monitor, F as previewFooterLook, Fa as SelectContent, Fn as routeLifecycleContext, Fo as ChevronDown, Ga as Input, Gi as curatedPalettes, H as syncStyleConfiguratorState, Ha as Popover, Hn as useEditorUiStore, I as previewHeaderLayout, Ia as SelectItem, Ii as resolveSdkFooterMode, Io as Check, Ja as TabsList, Ji as findButtonStyleRecipe, Jt as BlockEditor, Ka as Tabs, Ki as buttonStyleHoverPreferenceValue, L as previewHeaderStyle, La as SelectTrigger, Li as findFooterLook, Ln as isAdapterReferenceKind, Lo as Button, M as palettePreviewProjection, Mi as getCuratedSiteStyle, N as previewButtonStyle, No as ChevronRight, O as markApplyFailed, On as createManifestValidation, Oo as LoaderCircle, P as previewCuratedPalette, Pa as Select, Po as ChevronLeft, Q as resolvePreviewSidebarTab, Qi as buttonStyleSelectionKey, Qo as displayedValues, Qt as FormRenderer, R as previewSiteStyle, Ra as SelectValue, Ri as getHeaderLayout, S as applyTypographyDraftPatch, T as deriveStyleConfiguratorCapabilities, U as toggleRow, Ua as PopoverContent, Un as useEditorUiStoreInstance, Uo as canWriteLinkedEntry, V as styleConfiguratorHistoryEntryForPersistedSelection, Va as SearchInput, Vn as resolveContentTitle, Vo as isEdited, Wa as PopoverTrigger, X as resolveStyleConfiguratorInitialSnapshot, Xi as updateButtonStyleHoverPreference, Ya as TabsTrigger, Yi as resolveButtonStyleSelection, Z as createOptimisticActionRunner, Zi as updateButtonStyleSelectionChoice, Zt as ManifestForm, _ as reportPreviewDesignError, _a as paletteColorEntries, _o as Tablet, ao as Surface, at as ContentFieldsForm, b as planSiteChromeSelection, bo as SlidersHorizontal, c as selectionSnapshotFromApplySiteStyleSelectionResponse, co as DropdownMenuItem, do as DropdownMenuTrigger, es as valueStatus, f as usePreviewDesignCoordinator, fa as VARIANT_ROLES, ft as useAutosaveStatus, g as PREVIEW_DESIGN_SAVE_ERROR_MESSAGE, io as CollapsibleTrigger, ir as toEditorBlockItem, j as openRow, jn as blocksKeys, jr as ThemedButtonSpecimen, k as markApplySaved, kn as listEntryPageContentSlots, l as deriveSiteStylePreviewUpdate, lo as DropdownMenuLabel, lt as useEntryController, n as useSiteChromeCustomizeOptional, no as Collapsible, ns as assertNever$1, oo as DropdownMenu, ot as useUISelector, po as X$1, qa as TabsContent, qi as buttonStyleSelectionParameterValue, ro as CollapsibleContent, s as buildApplySiteStyleSelectionBody, so as DropdownMenuContent, sr as ThemeScope, u as planConfiguratorPreview, uo as DropdownMenuSeparator, v as buildSiteChromeSelectionModels, va as paletteColorsSchema, vt as LinkedEntryLeaseBanner, w as createStyleConfiguratorState, x as applyResolvedSelections, y as cycleSiteChromeSelectionId, yo as Smartphone, z as resetTypographyToSaved, za as Callout, zi as getHeaderStyle, zn as deriveRouteMetadataPresentation, zo as cn } from "./SiteChromeCustomizeContext-BFOt0ss-.mjs";
|
|
4
|
+
import { t as Separator } from "./separator-Cvvzk0Oo.mjs";
|
|
5
|
+
import { C as getSiteFontsStorageUrl, S as generateFontFaceCss, _ as useBlockCustomizeControls, b as previewWidgetOverrides, d as canInspectSiteStyle, f as buildPreviewDashboardSetupUrl, g as usePreviewSiteFontStorageUrl, h as resolvePreviewSidebarChromeModel, m as resolvePreviewEditorGuidanceModel, p as resolvePreviewDashboardSetupHandoff, v as usePreviewBlockCustomizeSelectionOptional, x as buildFontPreviewUrl, y as PreviewFormProvider } from "./SdkPreviewModeRuntime-tj45gmCX.mjs";
|
|
6
6
|
import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
@@ -347,6 +347,88 @@ var R, U = "undefined" != typeof window ? useLayoutEffect : useEffect, V = funct
|
|
|
347
347
|
return React.createElement(Q, u({}, r, { colorModel: W }));
|
|
348
348
|
};
|
|
349
349
|
//#endregion
|
|
350
|
+
//#region ../ui/src/palette/hex.ts
|
|
351
|
+
/**
|
|
352
|
+
* Hex colour helpers shared by every palette-editing surface (Macadamia
|
|
353
|
+
* onboarding swatches, the LiveThemeEditor, the Style configurator advanced
|
|
354
|
+
* row). Consolidates three prior duplicates: `normalizeColorPickerValue` in
|
|
355
|
+
* Macadamia, `normalizeHex` + `contrastRatio` formerly in
|
|
356
|
+
* `theme-editor/utils.ts`, and the inline regex in `updateColorRole`.
|
|
357
|
+
*
|
|
358
|
+
* Pure functions; no DOM, no React.
|
|
359
|
+
*/
|
|
360
|
+
/**
|
|
361
|
+
* Coerces user input into a canonical lowercase `#RRGGBB` form. Accepts
|
|
362
|
+
* 3-digit shorthand, case-insensitive 6-digit hex, and the same forms with or
|
|
363
|
+
* without a leading `#`; returns `fallback` for any other shape (empty
|
|
364
|
+
* string, garbage, characters outside `[0-9a-f]`, wrong length, etc.). Pass
|
|
365
|
+
* a `fallback` to make the fallback explicit at the call site — defaulting
|
|
366
|
+
* to `'#000000'` preserves the former theme-editor helper semantics.
|
|
367
|
+
*/
|
|
368
|
+
function normalizeHex(input, fallback = "#000000") {
|
|
369
|
+
if (!input) return fallback;
|
|
370
|
+
const trimmed = input.trim().replace(/^#/, "").toLowerCase();
|
|
371
|
+
const expanded = trimmed.length === 3 ? trimmed.split("").map((char) => char + char).join("") : trimmed;
|
|
372
|
+
if (!/^[0-9a-f]{6}$/i.test(expanded)) return fallback;
|
|
373
|
+
return `#${expanded}`;
|
|
374
|
+
}
|
|
375
|
+
function hexToRgb(hex) {
|
|
376
|
+
const match = normalizeHex(hex).replace("#", "").match(/.{2}/g);
|
|
377
|
+
if (!match || match.length < 3) return null;
|
|
378
|
+
const [r, g, b] = match.map((value) => parseInt(value, 16));
|
|
379
|
+
return [
|
|
380
|
+
r,
|
|
381
|
+
g,
|
|
382
|
+
b
|
|
383
|
+
];
|
|
384
|
+
}
|
|
385
|
+
function luminanceChannel(raw) {
|
|
386
|
+
const channel = raw / 255;
|
|
387
|
+
return channel <= .03928 ? channel / 12.92 : Math.pow((channel + .055) / 1.055, 2.4);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* WCAG relative luminance + contrast ratio. Rounded to 2 decimal places so
|
|
391
|
+
* the result is stable for UI display.
|
|
392
|
+
*/
|
|
393
|
+
function contrastRatio(hexA, hexB) {
|
|
394
|
+
const rgbA = hexToRgb(hexA);
|
|
395
|
+
const rgbB = hexToRgb(hexB);
|
|
396
|
+
if (!rgbA || !rgbB) return 1;
|
|
397
|
+
const lumA = .2126 * luminanceChannel(rgbA[0]) + .7152 * luminanceChannel(rgbA[1]) + .0722 * luminanceChannel(rgbA[2]);
|
|
398
|
+
const lumB = .2126 * luminanceChannel(rgbB[0]) + .7152 * luminanceChannel(rgbB[1]) + .0722 * luminanceChannel(rgbB[2]);
|
|
399
|
+
const brighter = Math.max(lumA, lumB);
|
|
400
|
+
const darker = Math.min(lumA, lumB);
|
|
401
|
+
return Number(((brighter + .05) / (darker + .05)).toFixed(2));
|
|
402
|
+
}
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region ../ui/src/palette/useHexDraft.ts
|
|
405
|
+
/** Keeps incomplete text local while sending only complete colors to consumers. */
|
|
406
|
+
function useHexDraft(value, onChange) {
|
|
407
|
+
const [draft, setDraft] = useState(value);
|
|
408
|
+
useEffect(() => {
|
|
409
|
+
setDraft(value);
|
|
410
|
+
}, [value]);
|
|
411
|
+
const changeDraft = (next) => {
|
|
412
|
+
setDraft(next);
|
|
413
|
+
if (/^#?[0-9a-fA-F]{6}$/.test(next.trim())) onChange(normalizeHex(next));
|
|
414
|
+
};
|
|
415
|
+
const finishDraft = () => {
|
|
416
|
+
if (/^#?[0-9a-fA-F]{3}$/.test(draft.trim())) {
|
|
417
|
+
const normalized = normalizeHex(draft);
|
|
418
|
+
setDraft(normalized);
|
|
419
|
+
onChange(normalized);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
if (!normalizeHex(draft, "")) setDraft(value);
|
|
423
|
+
};
|
|
424
|
+
return {
|
|
425
|
+
draft,
|
|
426
|
+
changeDraft,
|
|
427
|
+
finishDraft,
|
|
428
|
+
setDraft
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
//#endregion
|
|
350
432
|
//#region ../ui/src/color-picker.tsx
|
|
351
433
|
function useForwardedRef(ref) {
|
|
352
434
|
const innerRef = useRef(null);
|
|
@@ -363,6 +445,7 @@ const ColorPicker = forwardRef(({ disabled, value, onChange, onBlur, name, class
|
|
|
363
445
|
const parsedValue = useMemo(() => {
|
|
364
446
|
return value || "#FFFFFF";
|
|
365
447
|
}, [value]);
|
|
448
|
+
const { draft, changeDraft, finishDraft, setDraft } = useHexDraft(parsedValue, onChange);
|
|
366
449
|
return /* @__PURE__ */ jsxs("div", {
|
|
367
450
|
className: cn("inline-block", props.style ? "" : ""),
|
|
368
451
|
children: [/* @__PURE__ */ jsxs(Popover, {
|
|
@@ -391,14 +474,17 @@ const ColorPicker = forwardRef(({ disabled, value, onChange, onBlur, name, class
|
|
|
391
474
|
className: "w-full",
|
|
392
475
|
children: [/* @__PURE__ */ jsx(Z, {
|
|
393
476
|
color: parsedValue,
|
|
394
|
-
onChange
|
|
477
|
+
onChange: (next) => {
|
|
478
|
+
setDraft(next);
|
|
479
|
+
onChange(next);
|
|
480
|
+
}
|
|
395
481
|
}), /* @__PURE__ */ jsx(Input, {
|
|
482
|
+
"aria-label": "Hex colour",
|
|
396
483
|
maxLength: 7,
|
|
397
|
-
onChange: (
|
|
398
|
-
|
|
399
|
-
},
|
|
484
|
+
onChange: (event) => changeDraft(event.currentTarget.value),
|
|
485
|
+
onBlur: finishDraft,
|
|
400
486
|
ref,
|
|
401
|
-
value:
|
|
487
|
+
value: draft
|
|
402
488
|
})]
|
|
403
489
|
})]
|
|
404
490
|
}), label ? /* @__PURE__ */ jsx("div", {
|
|
@@ -1940,60 +2026,6 @@ function PreviewEditorGuidanceCard({ guidance, completeSetupDisabled, onComplete
|
|
|
1940
2026
|
});
|
|
1941
2027
|
}
|
|
1942
2028
|
//#endregion
|
|
1943
|
-
//#region ../ui/src/palette/hex.ts
|
|
1944
|
-
/**
|
|
1945
|
-
* Hex colour helpers shared by every palette-editing surface (Macadamia
|
|
1946
|
-
* onboarding swatches, the LiveThemeEditor, the Style configurator advanced
|
|
1947
|
-
* row). Consolidates three prior duplicates: `normalizeColorPickerValue` in
|
|
1948
|
-
* Macadamia, `normalizeHex` + `contrastRatio` formerly in
|
|
1949
|
-
* `theme-editor/utils.ts`, and the inline regex in `updateColorRole`.
|
|
1950
|
-
*
|
|
1951
|
-
* Pure functions; no DOM, no React.
|
|
1952
|
-
*/
|
|
1953
|
-
/**
|
|
1954
|
-
* Coerces user input into a canonical lowercase `#RRGGBB` form. Accepts
|
|
1955
|
-
* 3-digit shorthand, case-insensitive 6-digit hex, and the same forms with or
|
|
1956
|
-
* without a leading `#`; returns `fallback` for any other shape (empty
|
|
1957
|
-
* string, garbage, characters outside `[0-9a-f]`, wrong length, etc.). Pass
|
|
1958
|
-
* a `fallback` to make the fallback explicit at the call site — defaulting
|
|
1959
|
-
* to `'#000000'` preserves the former theme-editor helper semantics.
|
|
1960
|
-
*/
|
|
1961
|
-
function normalizeHex(input, fallback = "#000000") {
|
|
1962
|
-
if (!input) return fallback;
|
|
1963
|
-
const trimmed = input.trim().replace(/^#/, "").toLowerCase();
|
|
1964
|
-
const expanded = trimmed.length === 3 ? trimmed.split("").map((char) => char + char).join("") : trimmed;
|
|
1965
|
-
if (!/^[0-9a-f]{6}$/i.test(expanded)) return fallback;
|
|
1966
|
-
return `#${expanded}`;
|
|
1967
|
-
}
|
|
1968
|
-
function hexToRgb(hex) {
|
|
1969
|
-
const match = normalizeHex(hex).replace("#", "").match(/.{2}/g);
|
|
1970
|
-
if (!match || match.length < 3) return null;
|
|
1971
|
-
const [r, g, b] = match.map((value) => parseInt(value, 16));
|
|
1972
|
-
return [
|
|
1973
|
-
r,
|
|
1974
|
-
g,
|
|
1975
|
-
b
|
|
1976
|
-
];
|
|
1977
|
-
}
|
|
1978
|
-
function luminanceChannel(raw) {
|
|
1979
|
-
const channel = raw / 255;
|
|
1980
|
-
return channel <= .03928 ? channel / 12.92 : Math.pow((channel + .055) / 1.055, 2.4);
|
|
1981
|
-
}
|
|
1982
|
-
/**
|
|
1983
|
-
* WCAG relative luminance + contrast ratio. Rounded to 2 decimal places so
|
|
1984
|
-
* the result is stable for UI display.
|
|
1985
|
-
*/
|
|
1986
|
-
function contrastRatio(hexA, hexB) {
|
|
1987
|
-
const rgbA = hexToRgb(hexA);
|
|
1988
|
-
const rgbB = hexToRgb(hexB);
|
|
1989
|
-
if (!rgbA || !rgbB) return 1;
|
|
1990
|
-
const lumA = .2126 * luminanceChannel(rgbA[0]) + .7152 * luminanceChannel(rgbA[1]) + .0722 * luminanceChannel(rgbA[2]);
|
|
1991
|
-
const lumB = .2126 * luminanceChannel(rgbB[0]) + .7152 * luminanceChannel(rgbB[1]) + .0722 * luminanceChannel(rgbB[2]);
|
|
1992
|
-
const brighter = Math.max(lumA, lumB);
|
|
1993
|
-
const darker = Math.min(lumA, lumB);
|
|
1994
|
-
return Number(((brighter + .05) / (darker + .05)).toFixed(2));
|
|
1995
|
-
}
|
|
1996
|
-
//#endregion
|
|
1997
2029
|
//#region ../ui/src/palette/PaletteTokenEditor.tsx
|
|
1998
2030
|
const DEFAULT_BRAND_ROLES = [
|
|
1999
2031
|
{
|
|
@@ -2149,6 +2181,7 @@ function ColorRoleGroup({ title, roles, getColor, onChange, disabled }) {
|
|
|
2149
2181
|
function ColorRoleField({ role, value, onChange, disabled }) {
|
|
2150
2182
|
const inputId = useId();
|
|
2151
2183
|
const colorPickerLabel = `${role.label} colour picker`;
|
|
2184
|
+
const { draft, changeDraft, finishDraft, setDraft } = useHexDraft(value, (hex) => onChange(role.key, hex));
|
|
2152
2185
|
return /* @__PURE__ */ jsxs("div", {
|
|
2153
2186
|
className: "rounded-lg bg-muted p-3 space-y-2",
|
|
2154
2187
|
children: [
|
|
@@ -2160,7 +2193,10 @@ function ColorRoleField({ role, value, onChange, disabled }) {
|
|
|
2160
2193
|
/* @__PURE__ */ jsx(ColorPicker, {
|
|
2161
2194
|
value,
|
|
2162
2195
|
onChange: (next) => {
|
|
2163
|
-
if (typeof next === "string")
|
|
2196
|
+
if (typeof next === "string") {
|
|
2197
|
+
setDraft(next);
|
|
2198
|
+
onChange(role.key, next);
|
|
2199
|
+
}
|
|
2164
2200
|
},
|
|
2165
2201
|
className: "w-full",
|
|
2166
2202
|
"aria-label": colorPickerLabel,
|
|
@@ -2168,8 +2204,9 @@ function ColorRoleField({ role, value, onChange, disabled }) {
|
|
|
2168
2204
|
}),
|
|
2169
2205
|
/* @__PURE__ */ jsx(Input, {
|
|
2170
2206
|
id: inputId,
|
|
2171
|
-
value,
|
|
2172
|
-
onChange: (event) =>
|
|
2207
|
+
value: draft,
|
|
2208
|
+
onChange: (event) => changeDraft(event.target.value),
|
|
2209
|
+
onBlur: finishDraft,
|
|
2173
2210
|
className: "font-mono text-xs uppercase",
|
|
2174
2211
|
placeholder: "#000000",
|
|
2175
2212
|
disabled
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { a as usePreviewAuth, p as unwrapResponse } from "./previewAuthStore-BBmV7UsW.mjs";
|
|
3
|
+
import { Co as Pencil, Fo as ChevronDown, Gn as canDiscardDraft, Gt as useEditor, Hn as useEditorUiStore, Lo as Button, Ma as TooltipContent, Mo as EllipsisVertical, Na as TooltipTrigger, Oo as LoaderCircle, Qa as DialogDescription, Ro as cva, So as Redo2, To as Palette, Un as useEditorUiStoreInstance, Xa as Dialog, Za as DialogContent, a as previewDesignHistoryDomainForCommand, co as DropdownMenuItem, do as DropdownMenuTrigger, dt as classifyHistoryShortcut, eo as DialogHeader, ft as useAutosaveStatus, go as TriangleAlert, ho as Undo2, i as usePreviewDesignHistoryOrder, ja as Tooltip, jo as Eye, n as useSiteChromeCustomizeOptional, o as selectPreviewDesignHistoryDomain, oo as DropdownMenu, so as DropdownMenuContent, to as DialogTitle, ut as useEntryEditorController, vo as Sparkles, wo as PenLine, xt as EditorWriteSurface, zo as cn } from "./SiteChromeCustomizeContext-BFOt0ss-.mjs";
|
|
4
|
+
import { a as usePreviewPageDesignEditorState, c as applyPreviewChromeSurfaceToElement, l as resolvePreviewChromeSurface, o as PREVIEW_CHROME_PORTAL_CLASS_NAME, s as PREVIEW_CHROME_THEME_CLASS_NAME, u as PREVIEW_THEME_COOKIE_NAME, w as FixedBottomSurface } from "./SdkPreviewModeRuntime-tj45gmCX.mjs";
|
|
5
5
|
import * as React$1 from "react";
|
|
6
6
|
import { useCallback, useEffect, useMemo, useState, useTransition } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -473,9 +473,6 @@ function MaintenanceModeBadge({ dashboardBaseUrl, siteId }) {
|
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
|
-
//#region ../preview-next/src/constants.ts
|
|
477
|
-
const PREVIEW_THEME_COOKIE_NAME = "preview_theme_id";
|
|
478
|
-
//#endregion
|
|
479
476
|
//#region ../preview-next/src/client/preview/OnboardingThemeSwitcher.tsx
|
|
480
477
|
function getDefaultThemeId(payload) {
|
|
481
478
|
return payload.currentThemeId ?? payload.themes[0]?.id ?? null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { c as wasPreviewApiAuthErrorHandled, r as markPreviewAuthExpired, u as ApiRequestError } from "./previewAuthStore-BBmV7UsW.mjs";
|
|
3
3
|
import { createContext, useContext, useRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { MutationCache, QueryCache, QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
@@ -33,10 +33,10 @@ function createPreviewQueryClient() {
|
|
|
33
33
|
refetchOnWindowFocus: false
|
|
34
34
|
} },
|
|
35
35
|
queryCache: new QueryCache({ onError: (error) => {
|
|
36
|
-
if (error instanceof ApiRequestError && error.status === 401) markPreviewAuthExpired("query");
|
|
36
|
+
if (error instanceof ApiRequestError && error.status === 401 && !wasPreviewApiAuthErrorHandled(error)) markPreviewAuthExpired("query");
|
|
37
37
|
} }),
|
|
38
38
|
mutationCache: new MutationCache({ onError: (error) => {
|
|
39
|
-
if (error instanceof ApiRequestError && error.status === 401) markPreviewAuthExpired("query");
|
|
39
|
+
if (error instanceof ApiRequestError && error.status === 401 && !wasPreviewApiAuthErrorHandled(error)) markPreviewAuthExpired("query");
|
|
40
40
|
} })
|
|
41
41
|
});
|
|
42
42
|
}
|