@riverbankcms/sdk 0.95.0 → 0.98.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 +47 -5
- package/dist/{PreviewEditorSidebar-6FQYKOSB.mjs → PreviewEditorSidebar-CG3SSJND.mjs} +3 -3
- package/dist/{PreviewEditorUI-NPO2XMFB.mjs → PreviewEditorUI-RHNGKAAU.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-OV5PNJBB.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +10 -10
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +35 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +246 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +109 -40
- package/dist/_dts/api/src/endpoints.d.ts +80 -0
- package/dist/_dts/api/src/index.d.ts +3 -2
- package/dist/_dts/api/src/public/endpoints.d.ts +1 -1
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +10 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +2 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +2 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +7 -1
- package/dist/_dts/block-form/src/client/index.d.ts +1 -1
- package/dist/_dts/block-form/src/fields/types.d.ts +9 -1
- package/dist/_dts/block-form/src/registry/schemas.d.ts +4 -0
- package/dist/_dts/block-form/src/registry/widgets.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/InlineTextField/InlineTextField.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/InlineTextField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/InlineTextField/inlineTextFieldDefaults.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/InlineTextField/inlineTextFieldSchema.d.ts +3 -0
- package/dist/_dts/blocks/src/PageRenderer.d.ts +2 -1
- package/dist/_dts/blocks/src/bindings/index.d.ts +1 -0
- package/dist/_dts/blocks/src/bindings/types.d.ts +1 -4
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +7 -0
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +12 -12
- package/dist/_dts/blocks/src/index.d.ts +2 -0
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -0
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +2 -29631
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +2 -29614
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +2 -29634
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +2 -29627
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +2 -29585
- package/dist/_dts/blocks/src/system/blocks/events/shared/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/layout.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +2 -29677
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +2 -29655
- package/dist/_dts/blocks/src/system/blocks/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +220 -0
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +2 -29655
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +2 -29685
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -29761
- package/dist/_dts/blocks/src/system/blocks/weekly-slot-availability.d.ts +34 -0
- package/dist/_dts/blocks/src/system/componentFactory.d.ts +1 -0
- package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
- package/dist/_dts/blocks/src/system/customize/facets.d.ts +2 -2
- package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
- package/dist/_dts/blocks/src/system/data/prefetchBlockData.d.ts +4 -1
- package/dist/_dts/blocks/src/system/fragments/library/heroCopy.d.ts +9 -0
- package/dist/_dts/blocks/src/system/inlineText.d.ts +78 -0
- package/dist/_dts/blocks/src/system/manifest/derivedContent.d.ts +3 -1
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +15 -3
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +188 -7
- package/dist/_dts/blocks/src/system/node/builder.d.ts +2 -0
- package/dist/_dts/blocks/src/system/node/schema.d.ts +13 -0
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/registry.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAppointmentCheckoutVerification.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +8 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +133 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/renderInlineText.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.controller.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.state.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.server.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.view.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +31 -1
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +5 -0
- package/dist/_dts/blocks/src/utils/date-formatting.d.ts +1 -1
- package/dist/_dts/content-editor/src/index.d.ts +1 -0
- package/dist/_dts/content-editor/src/primitives/PreviewInlineTextEditor.d.ts +9 -0
- package/dist/_dts/content-editor/src/primitives/PreviewRichTextEditor.d.ts +1 -1
- package/dist/_dts/content-model/src/templates/bindingTypeCompatibility.d.ts +1 -1
- package/dist/_dts/content-model/src/templates/defaults.d.ts +30 -0
- package/dist/_dts/content-model/src/templates/types.d.ts +3 -6
- package/dist/_dts/core/src/branded.d.ts +8 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +505 -2
- package/dist/_dts/editor/src/inline/FloatingToolbar.d.ts +18 -0
- package/dist/_dts/editor/src/inline/InlineTextEditor.d.ts +18 -1
- package/dist/_dts/editor/src/inline/InlineTextEditorStyles.d.ts +1 -0
- package/dist/_dts/editor/src/inline/domParse.d.ts +3 -0
- package/dist/_dts/editor/src/inline/presentation.d.ts +48 -0
- package/dist/_dts/editor/src/inline/selection.d.ts +12 -0
- package/dist/_dts/editor-blocks/src/widgets/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/widgets/inline-text/InlineTextField.d.ts +3 -0
- package/dist/_dts/editor-blocks/src/widgets/inline-text/index.d.ts +1 -0
- package/dist/_dts/field-primitives/src/bindings/index.d.ts +8 -0
- package/dist/_dts/path-utils/src/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/commands/content.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +4 -0
- package/dist/_dts/sdk/src/cli/commands/push/publishGuidance.d.ts +15 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +4 -7
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +5 -1
- package/dist/_dts/sdk/src/cli/commands/push/stale-resolution.d.ts +9 -3
- package/dist/_dts/sdk/src/cli/commands/push/verification.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/commands/push/workflowPlan.d.ts +34 -0
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/commands/setup.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/config-loader.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/content/edit/format.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/content/edit/path.d.ts +14 -0
- package/dist/_dts/sdk/src/cli/content/edit/planner.d.ts +46 -0
- package/dist/_dts/sdk/src/cli/content/fs-utils.d.ts +4 -0
- package/dist/_dts/sdk/src/cli/content/metadataStore.d.ts +29 -0
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +16 -14
- package/dist/_dts/sdk/src/cli/content/writer.d.ts +8 -4
- package/dist/_dts/sdk/src/cli/env-scope.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/helpers.d.ts +6 -7
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/merge-remote/mergeFieldChanges.d.ts +22 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageLocal.d.ts +3 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMerge.d.ts +78 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePlan.d.ts +36 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePush.d.ts +23 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergeReport.d.ts +29 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageSnapshots.d.ts +48 -0
- package/dist/_dts/sdk/src/cli/push-config.d.ts +13 -2
- package/dist/_dts/sdk/src/cli/setup/setupPlan.d.ts +51 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +21 -0
- package/dist/_dts/sdk/src/cli/sync/diff.d.ts +3 -6
- package/dist/_dts/sdk/src/cli/sync/field-diff.d.ts +39 -0
- package/dist/_dts/sdk/src/cli/sync/index.d.ts +1 -0
- package/dist/_dts/sdk/src/client/runtimeCachePolicy.d.ts +1 -1
- package/dist/_dts/sdk/src/client/types.d.ts +18 -2
- package/dist/_dts/sdk/src/config/field-definitions.d.ts +8 -3
- package/dist/_dts/sdk/src/config/typed-entries.d.ts +5 -3
- package/dist/_dts/sdk/src/config/types.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +3 -0
- package/dist/_dts/sdk/src/contracts/bindings.d.ts +4 -7
- package/dist/_dts/sdk/src/contracts/content.d.ts +18 -0
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +16 -2
- package/dist/_dts/sdk/src/next/route-outcome-proxy.d.ts +3 -3
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +174 -78
- package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/bindings.d.ts +4 -3
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +52 -1
- package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +18 -66
- package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/cards/types.d.ts +15 -15
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/inputs/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +42 -42
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/schema.d.ts +44 -44
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +16 -16
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +1 -1
- package/dist/{chunk-4A6NWO3X.mjs → chunk-6WDBXCPX.mjs} +73 -12
- package/dist/{chunk-VZBSD4AJ.mjs → chunk-DBRI3PQF.mjs} +2281 -322
- package/dist/{chunk-PJPFTVZG.mjs → chunk-H24OU7WG.mjs} +106 -4
- package/dist/{chunk-K2SJTZMX.mjs → chunk-PKDPQHB5.mjs} +2 -2
- package/dist/{chunk-VTPPVAOL.mjs → chunk-QPXE2OUZ.mjs} +1 -1
- package/dist/{chunk-7ED5UNHL.mjs → chunk-V2BYFSPW.mjs} +109 -0
- package/dist/cli/index.mjs +4182 -1165
- package/dist/cli/init-docs/content/cli-reference.md +72 -5
- package/dist/cli/init-docs/content/content-management.md +22 -0
- package/dist/cli/init-docs/content/getting-started.md +8 -0
- package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +3 -1
- package/dist/cli/init-docs/content/workflow-preview-mode.md +6 -0
- package/dist/cli/init-docs/content/workflow-remote-setup.md +51 -0
- package/dist/client/{accordion-LGO4IO5U.mjs → accordion-Q2BDNL53.mjs} +1 -1
- package/dist/client/{bookingForm-MWLS4LGU.mjs → bookingForm-ZMP4P7EK.mjs} +16 -6
- package/dist/client/bookings.mjs +98 -18
- package/dist/client/{carousel-6AHNP5HA.mjs → carousel-LW3UXPWO.mjs} +1 -1
- package/dist/client/{cart-CIXGYAZB.mjs → cart-Z6D3KS6K.mjs} +5 -5
- package/dist/client/{checkout-OTX6O3DN.mjs → checkout-YMT2QJQM.mjs} +5 -5
- package/dist/client/{chunk-Y2PMKCXO.mjs → chunk-26ZBRXFR.mjs} +9 -3
- package/dist/client/{chunk-MYCXAKWP.mjs → chunk-DRRQ7QSL.mjs} +2 -2
- package/dist/client/{chunk-TREIML53.mjs → chunk-ET2MDQQT.mjs} +4 -4
- package/dist/client/{chunk-AVBQSUIS.mjs → chunk-HBQEAOG4.mjs} +1 -1
- package/dist/client/{chunk-INRIT6DP.mjs → chunk-IEOECM7U.mjs} +62 -43
- package/dist/client/{chunk-TNGL2WJF.mjs → chunk-KDP7ZRZV.mjs} +16 -0
- package/dist/client/{chunk-V67AT7ZW.mjs → chunk-R4XK3CKR.mjs} +18 -1
- package/dist/client/{chunk-R3NQTBWE.mjs → chunk-SK2BMD22.mjs} +2 -2
- package/dist/client/{chunk-HOP7MKAZ.mjs → chunk-XNTHVZ25.mjs} +1 -1
- package/dist/client/client.mjs +5172 -4177
- package/dist/client/{courseRegistration-2LU6C3JL.mjs → courseRegistration-DGKCMC77.mjs} +4 -4
- package/dist/client/{eventCalendar-OKUSISBZ.mjs → eventCalendar-74Z2NNFM.mjs} +7 -7
- package/dist/client/{eventCombined-CMF6CD4S.mjs → eventCombined-GK2ODOX2.mjs} +7 -7
- package/dist/client/{eventDetails-XYWH7WXI.mjs → eventDetails-MONAGT3N.mjs} +7 -7
- package/dist/client/{eventListing-EK5DJTAH.mjs → eventListing-SKGAO6PS.mjs} +7 -7
- package/dist/client/{eventRegistration-XDOSICV6.mjs → eventRegistration-6KISGXRD.mjs} +7 -7
- package/dist/client/{form-J6GOHKYG.mjs → form-FXPRTXHI.mjs} +2 -2
- package/dist/client/{headerSection-C5SYJTRW.mjs → headerSection-7NAN5WNB.mjs} +2 -2
- package/dist/client/hooks.mjs +1681 -1337
- package/dist/client/{locationMap-QSQIFVVT.mjs → locationMap-UERN74U4.mjs} +2 -2
- package/dist/client/{newsletterForm-47VXJRWK.mjs → newsletterForm-SGWXMJ7U.mjs} +2 -2
- package/dist/client/{productDetail-5U6ISCC2.mjs → productDetail-HN3HWZQZ.mjs} +5 -5
- package/dist/client/{productList-XDZUMR3P.mjs → productList-YT22Z5UR.mjs} +5 -5
- package/dist/client/rendering/client.mjs +4796 -4288
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +2120 -1106
- package/dist/client/{shop-ZSZKIY3R.mjs → shop-TKEDNWUS.mjs} +5 -5
- package/dist/preview-next/before-render.mjs +109 -0
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/middleware.mjs +109 -0
- package/dist/{sdk-runtime-PHNM7MRD.mjs → sdk-runtime-LWNYCQF2.mjs} +6 -6
- package/dist/server/components.mjs +3777 -2981
- package/dist/server/config-template-validation.mjs +35 -22
- package/dist/server/config-validation.mjs +1883 -1565
- package/dist/server/config.mjs +1883 -1565
- package/dist/server/data.mjs +1667 -1334
- package/dist/server/index.mjs +208 -9
- package/dist/server/next/middleware.mjs +2 -2
- package/dist/server/next.mjs +4077 -3060
- package/dist/server/page-converter.mjs +1481 -1279
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3806 -2993
- package/dist/server/rendering.mjs +4000 -3060
- package/dist/server/routing.mjs +1737 -1357
- package/dist/server/server.mjs +2918 -2276
- package/dist/server/theme-bridge.mjs +43 -0
- package/dist/styles/index.css +44 -0
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-PBEFH5AL.mjs +0 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { unwrapResponse, ApiRequestError, ApiEnvelopeError, extractApiEnvelopeErrorDetails } from './chunk-
|
|
2
|
+
import { unwrapResponse, ApiRequestError, ApiEnvelopeError, extractApiEnvelopeErrorDetails } from './chunk-V2BYFSPW.mjs';
|
|
3
3
|
import { __commonJS, __export, __toESM } from './chunk-R7POPVJR.mjs';
|
|
4
4
|
import * as React61 from 'react';
|
|
5
5
|
import React61__default, { createContext, forwardRef, useContext, createElement, useRef, useMemo, useEffect, useState, useCallback, useImperativeHandle, useLayoutEffect, memo, createRef, Component as Component$1, useDebugValue, useId as useId$1, useSyncExternalStore, isValidElement, cloneElement, useReducer, startTransition } from 'react';
|
|
6
|
-
import
|
|
6
|
+
import z42, { z } from 'zod';
|
|
7
7
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
import deepEqual2 from 'fast-deep-equal';
|
|
9
9
|
import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
|
|
@@ -30992,10 +30992,20 @@ var repeatSchema = z.object({
|
|
|
30992
30992
|
direction: z.enum(["asc", "desc"]).default("asc")
|
|
30993
30993
|
}).optional()
|
|
30994
30994
|
});
|
|
30995
|
+
var conditionalAuthoringPresenceSchema = z.discriminatedUnion("kind", [
|
|
30996
|
+
z.object({ kind: z.literal("visitor-only") }),
|
|
30997
|
+
z.object({
|
|
30998
|
+
kind: z.literal("recover-empty-when-active"),
|
|
30999
|
+
placeholder: z.string().min(1).optional()
|
|
31000
|
+
})
|
|
31001
|
+
]);
|
|
30995
31002
|
var conditionSchema = z.object({
|
|
30996
31003
|
when: bindingSchema,
|
|
30997
31004
|
equals: z.unknown().optional(),
|
|
30998
|
-
not: z.boolean().default(false)
|
|
31005
|
+
not: z.boolean().default(false),
|
|
31006
|
+
authoringPresence: conditionalAuthoringPresenceSchema.default({
|
|
31007
|
+
kind: "visitor-only"
|
|
31008
|
+
})
|
|
30999
31009
|
});
|
|
31000
31010
|
var dataScopeSchema = z.object({
|
|
31001
31011
|
name: z.string().min(1),
|
|
@@ -31543,6 +31553,11 @@ var textFieldSchema = baseFieldSchema.extend({
|
|
|
31543
31553
|
var richTextFieldSchema = baseFieldSchema.extend({
|
|
31544
31554
|
type: z.literal("richText")
|
|
31545
31555
|
});
|
|
31556
|
+
var inlineTextFieldSchema = baseFieldSchema.extend({
|
|
31557
|
+
type: z.literal("inlineText"),
|
|
31558
|
+
maxLength: z.number().int().positive().optional(),
|
|
31559
|
+
plainTextField: z.string().min(1).optional()
|
|
31560
|
+
});
|
|
31546
31561
|
var mediaFieldSchema = baseFieldSchema.extend({
|
|
31547
31562
|
type: z.literal("media"),
|
|
31548
31563
|
// Keep full MEDIA_KINDS parse compatibility for pre-file-field manifests.
|
|
@@ -31865,6 +31880,7 @@ function getFieldSchemaInternal() {
|
|
|
31865
31880
|
_fieldSchemaInternal = z.discriminatedUnion("type", [
|
|
31866
31881
|
textFieldSchema,
|
|
31867
31882
|
richTextFieldSchema,
|
|
31883
|
+
inlineTextFieldSchema,
|
|
31868
31884
|
mediaFieldSchema,
|
|
31869
31885
|
fileFieldSchema,
|
|
31870
31886
|
booleanFieldSchema,
|
|
@@ -32048,6 +32064,205 @@ z.object({
|
|
|
32048
32064
|
tags: z.array(z.string()).optional(),
|
|
32049
32065
|
icon: z.string().optional()
|
|
32050
32066
|
});
|
|
32067
|
+
var inlineTextAccentTones = ["accent", "brand", "contrast"];
|
|
32068
|
+
var inlineTextHighlightTones = ["soft", "accent", "brand"];
|
|
32069
|
+
var inlineTextMarkSchema = z.discriminatedUnion("kind", [
|
|
32070
|
+
z.object({ kind: z.literal("strong") }),
|
|
32071
|
+
z.object({ kind: z.literal("emphasis") }),
|
|
32072
|
+
z.object({
|
|
32073
|
+
kind: z.literal("accent"),
|
|
32074
|
+
tone: z.enum(inlineTextAccentTones)
|
|
32075
|
+
}),
|
|
32076
|
+
z.object({
|
|
32077
|
+
kind: z.literal("highlight"),
|
|
32078
|
+
tone: z.enum(inlineTextHighlightTones)
|
|
32079
|
+
})
|
|
32080
|
+
]);
|
|
32081
|
+
var inlineTextRunSchema = z.object({
|
|
32082
|
+
text: z.string(),
|
|
32083
|
+
marks: z.array(inlineTextMarkSchema).optional()
|
|
32084
|
+
});
|
|
32085
|
+
z.array(inlineTextRunSchema);
|
|
32086
|
+
var MARK_ORDER = {
|
|
32087
|
+
strong: 0,
|
|
32088
|
+
emphasis: 1,
|
|
32089
|
+
accent: 2,
|
|
32090
|
+
highlight: 3
|
|
32091
|
+
};
|
|
32092
|
+
function plainTextToInlineText(value) {
|
|
32093
|
+
return normalizeInlineText(value.length > 0 ? [{ text: value }] : []);
|
|
32094
|
+
}
|
|
32095
|
+
function inlineTextToPlainText(value) {
|
|
32096
|
+
return value.map((run3) => run3.text).join("");
|
|
32097
|
+
}
|
|
32098
|
+
function isInlineTextEmpty(value) {
|
|
32099
|
+
return inlineTextToPlainText(value).trim().length === 0;
|
|
32100
|
+
}
|
|
32101
|
+
function coerceInlineTextWithFallback(value, fallbackPlainText) {
|
|
32102
|
+
const parsed = parseInlineTextFromUnknown(value);
|
|
32103
|
+
if (parsed.ok && !isInlineTextEmpty(parsed.value)) {
|
|
32104
|
+
return parsed.value;
|
|
32105
|
+
}
|
|
32106
|
+
if (fallbackPlainText && fallbackPlainText.length > 0) {
|
|
32107
|
+
return plainTextToInlineText(fallbackPlainText);
|
|
32108
|
+
}
|
|
32109
|
+
return parsed.ok ? parsed.value : [];
|
|
32110
|
+
}
|
|
32111
|
+
function parseInlineTextFromUnknown(value) {
|
|
32112
|
+
if (!Array.isArray(value)) {
|
|
32113
|
+
return { ok: false, error: { kind: "not-array" } };
|
|
32114
|
+
}
|
|
32115
|
+
const runs = [];
|
|
32116
|
+
for (let index2 = 0; index2 < value.length; index2 += 1) {
|
|
32117
|
+
const parsed = inlineTextRunSchema.safeParse(value[index2]);
|
|
32118
|
+
if (!parsed.success) {
|
|
32119
|
+
return { ok: false, error: { kind: "invalid-run", index: index2 } };
|
|
32120
|
+
}
|
|
32121
|
+
runs.push(parsed.data);
|
|
32122
|
+
}
|
|
32123
|
+
return { ok: true, value: normalizeInlineText(runs) };
|
|
32124
|
+
}
|
|
32125
|
+
function normalizeInlineText(value) {
|
|
32126
|
+
const normalized = [];
|
|
32127
|
+
for (const run3 of value) {
|
|
32128
|
+
if (run3.text.length === 0) continue;
|
|
32129
|
+
const marks = normalizeInlineTextMarks(run3.marks ?? []);
|
|
32130
|
+
const nextRun = marks.length > 0 ? { text: run3.text, marks } : { text: run3.text };
|
|
32131
|
+
const previous = normalized[normalized.length - 1];
|
|
32132
|
+
if (previous && inlineTextMarksEqual(previous.marks ?? [], nextRun.marks ?? [])) {
|
|
32133
|
+
normalized[normalized.length - 1] = previous.marks && previous.marks.length > 0 ? { text: previous.text + nextRun.text, marks: previous.marks } : { text: previous.text + nextRun.text };
|
|
32134
|
+
continue;
|
|
32135
|
+
}
|
|
32136
|
+
normalized.push(nextRun);
|
|
32137
|
+
}
|
|
32138
|
+
return normalized;
|
|
32139
|
+
}
|
|
32140
|
+
function normalizeInlineTextMarks(marks) {
|
|
32141
|
+
let strong = null;
|
|
32142
|
+
let emphasis = null;
|
|
32143
|
+
let accent = null;
|
|
32144
|
+
let highlight = null;
|
|
32145
|
+
for (const mark of marks) {
|
|
32146
|
+
switch (mark.kind) {
|
|
32147
|
+
case "strong":
|
|
32148
|
+
strong = { kind: "strong" };
|
|
32149
|
+
break;
|
|
32150
|
+
case "emphasis":
|
|
32151
|
+
emphasis = { kind: "emphasis" };
|
|
32152
|
+
break;
|
|
32153
|
+
case "accent":
|
|
32154
|
+
accent = { kind: "accent", tone: mark.tone };
|
|
32155
|
+
break;
|
|
32156
|
+
case "highlight":
|
|
32157
|
+
highlight = { kind: "highlight", tone: mark.tone };
|
|
32158
|
+
break;
|
|
32159
|
+
}
|
|
32160
|
+
}
|
|
32161
|
+
return [strong, emphasis, accent, highlight].filter((mark) => mark !== null).sort((left, right) => MARK_ORDER[left.kind] - MARK_ORDER[right.kind]);
|
|
32162
|
+
}
|
|
32163
|
+
function inlineTextMarksEqual(left, right) {
|
|
32164
|
+
const normalizedLeft = normalizeInlineTextMarks(left);
|
|
32165
|
+
const normalizedRight = normalizeInlineTextMarks(right);
|
|
32166
|
+
if (normalizedLeft.length !== normalizedRight.length) return false;
|
|
32167
|
+
return normalizedLeft.every((mark, index2) => inlineTextMarkEqual(mark, normalizedRight[index2]));
|
|
32168
|
+
}
|
|
32169
|
+
function inlineTextEqual(left, right) {
|
|
32170
|
+
const normalizedLeft = normalizeInlineText(left);
|
|
32171
|
+
const normalizedRight = normalizeInlineText(right);
|
|
32172
|
+
if (normalizedLeft.length !== normalizedRight.length) return false;
|
|
32173
|
+
return normalizedLeft.every((leftRun, index2) => {
|
|
32174
|
+
const rightRun = normalizedRight[index2];
|
|
32175
|
+
return rightRun !== void 0 && leftRun.text === rightRun.text && inlineTextMarksEqual(leftRun.marks ?? [], rightRun.marks ?? []);
|
|
32176
|
+
});
|
|
32177
|
+
}
|
|
32178
|
+
function inlineTextMarkEqual(left, right) {
|
|
32179
|
+
if (!right || left.kind !== right.kind) return false;
|
|
32180
|
+
switch (left.kind) {
|
|
32181
|
+
case "strong":
|
|
32182
|
+
case "emphasis":
|
|
32183
|
+
return true;
|
|
32184
|
+
case "accent":
|
|
32185
|
+
return right.kind === "accent" && left.tone === right.tone;
|
|
32186
|
+
case "highlight":
|
|
32187
|
+
return right.kind === "highlight" && left.tone === right.tone;
|
|
32188
|
+
}
|
|
32189
|
+
}
|
|
32190
|
+
function applyInlineTextMarkToRange(value, range, mark) {
|
|
32191
|
+
return mapInlineTextRange(value, range, (marks) => normalizeInlineTextMarks([...marks, mark]));
|
|
32192
|
+
}
|
|
32193
|
+
function removeInlineTextMarkFromRange(value, range, kind) {
|
|
32194
|
+
return mapInlineTextRange(value, range, (marks) => marks.filter((mark) => mark.kind !== kind));
|
|
32195
|
+
}
|
|
32196
|
+
function replaceInlineTextRange(value, range, replacement) {
|
|
32197
|
+
const textLength = inlineTextToPlainText(value).length;
|
|
32198
|
+
const start = Math.max(0, Math.min(range.start, range.end, textLength));
|
|
32199
|
+
const end = Math.max(0, Math.min(Math.max(range.start, range.end), textLength));
|
|
32200
|
+
return normalizeInlineText([
|
|
32201
|
+
...sliceInlineText(value, 0, start),
|
|
32202
|
+
...normalizeInlineText(replacement),
|
|
32203
|
+
...sliceInlineText(value, end, textLength)
|
|
32204
|
+
]);
|
|
32205
|
+
}
|
|
32206
|
+
function truncateInlineText(value, maxLength) {
|
|
32207
|
+
if (typeof maxLength !== "number" || !Number.isFinite(maxLength) || maxLength < 0) {
|
|
32208
|
+
return normalizeInlineText(value);
|
|
32209
|
+
}
|
|
32210
|
+
const next = [];
|
|
32211
|
+
let remaining = maxLength;
|
|
32212
|
+
for (const run3 of normalizeInlineText(value)) {
|
|
32213
|
+
if (remaining <= 0) break;
|
|
32214
|
+
const text2 = run3.text.slice(0, remaining);
|
|
32215
|
+
next.push(withMarks(text2, run3.marks ?? []));
|
|
32216
|
+
remaining -= text2.length;
|
|
32217
|
+
}
|
|
32218
|
+
return normalizeInlineText(next);
|
|
32219
|
+
}
|
|
32220
|
+
function sliceInlineText(value, start, end) {
|
|
32221
|
+
if (start >= end) return [];
|
|
32222
|
+
const next = [];
|
|
32223
|
+
let offset4 = 0;
|
|
32224
|
+
for (const run3 of normalizeInlineText(value)) {
|
|
32225
|
+
const runStart = offset4;
|
|
32226
|
+
const runEnd = offset4 + run3.text.length;
|
|
32227
|
+
offset4 = runEnd;
|
|
32228
|
+
if (runEnd <= start || runStart >= end) continue;
|
|
32229
|
+
const localStart = Math.max(0, start - runStart);
|
|
32230
|
+
const localEnd = Math.min(run3.text.length, end - runStart);
|
|
32231
|
+
next.push(withMarks(run3.text.slice(localStart, localEnd), run3.marks ?? []));
|
|
32232
|
+
}
|
|
32233
|
+
return normalizeInlineText(next);
|
|
32234
|
+
}
|
|
32235
|
+
function mapInlineTextRange(value, range, mapMarks) {
|
|
32236
|
+
const start = Math.max(0, Math.min(range.start, range.end));
|
|
32237
|
+
const end = Math.max(0, Math.max(range.start, range.end));
|
|
32238
|
+
if (start === end) return normalizeInlineText(value);
|
|
32239
|
+
const next = [];
|
|
32240
|
+
let offset4 = 0;
|
|
32241
|
+
for (const run3 of normalizeInlineText(value)) {
|
|
32242
|
+
const runStart = offset4;
|
|
32243
|
+
const runEnd = offset4 + run3.text.length;
|
|
32244
|
+
offset4 = runEnd;
|
|
32245
|
+
if (runEnd <= start || runStart >= end) {
|
|
32246
|
+
next.push(run3);
|
|
32247
|
+
continue;
|
|
32248
|
+
}
|
|
32249
|
+
const localStart = Math.max(0, start - runStart);
|
|
32250
|
+
const localEnd = Math.min(run3.text.length, end - runStart);
|
|
32251
|
+
const marks = run3.marks ?? [];
|
|
32252
|
+
if (localStart > 0) {
|
|
32253
|
+
next.push(withMarks(run3.text.slice(0, localStart), marks));
|
|
32254
|
+
}
|
|
32255
|
+
next.push(withMarks(run3.text.slice(localStart, localEnd), mapMarks(marks)));
|
|
32256
|
+
if (localEnd < run3.text.length) {
|
|
32257
|
+
next.push(withMarks(run3.text.slice(localEnd), marks));
|
|
32258
|
+
}
|
|
32259
|
+
}
|
|
32260
|
+
return normalizeInlineText(next);
|
|
32261
|
+
}
|
|
32262
|
+
function withMarks(text2, marks) {
|
|
32263
|
+
const normalized = normalizeInlineTextMarks(marks);
|
|
32264
|
+
return normalized.length > 0 ? { text: text2, marks: normalized } : { text: text2 };
|
|
32265
|
+
}
|
|
32051
32266
|
|
|
32052
32267
|
// ../blocks/src/system/icons/ids.ts
|
|
32053
32268
|
var GENERATED_ICON_SET_ID_PATTERN = /^generated-icon-set:[a-z0-9][a-z0-9:_-]{0,107}$/u;
|
|
@@ -32875,6 +33090,13 @@ function formatFieldPath(path) {
|
|
|
32875
33090
|
function toZodIssuePath(path) {
|
|
32876
33091
|
return [...path];
|
|
32877
33092
|
}
|
|
33093
|
+
function parseFieldPathKey(key) {
|
|
33094
|
+
if (!key) return [];
|
|
33095
|
+
return key.split(".").map((segment) => {
|
|
33096
|
+
const numeric2 = Number(segment);
|
|
33097
|
+
return Number.isInteger(numeric2) && String(numeric2) === segment ? numeric2 : segment;
|
|
33098
|
+
});
|
|
33099
|
+
}
|
|
32878
33100
|
function fieldIssueToMessage(issue2) {
|
|
32879
33101
|
switch (issue2.kind) {
|
|
32880
33102
|
case "required":
|
|
@@ -32913,6 +33135,8 @@ function fieldIssueToMessage(issue2) {
|
|
|
32913
33135
|
return `${issue2.label} must have at most ${issue2.maximum} ${pluralize(issue2.itemLabel, issue2.maximum)}`;
|
|
32914
33136
|
case "invalidRichText":
|
|
32915
33137
|
return `${issue2.label} must be valid rich text`;
|
|
33138
|
+
case "invalidInlineText":
|
|
33139
|
+
return `${issue2.label} must be valid styled text`;
|
|
32916
33140
|
case "invalidMedia":
|
|
32917
33141
|
return `${issue2.label} must be a valid media item`;
|
|
32918
33142
|
case "invalidLink":
|
|
@@ -33001,6 +33225,16 @@ function deriveFieldValidationPlan(field, path = [field.id]) {
|
|
|
33001
33225
|
);
|
|
33002
33226
|
case "richText":
|
|
33003
33227
|
return makePlan("richText", "object", field, path, required, commonConstraints(required, { kind: "richTextDoc" }));
|
|
33228
|
+
case "inlineText": {
|
|
33229
|
+
const constraints = commonConstraints(required, { kind: "inlineText" });
|
|
33230
|
+
if (typeof field.maxLength === "number") {
|
|
33231
|
+
constraints.push({ kind: "maxPlainTextLength", maximum: field.maxLength });
|
|
33232
|
+
}
|
|
33233
|
+
return {
|
|
33234
|
+
...makePlan("inlineText", "array", field, path, required, constraints),
|
|
33235
|
+
...field.plainTextField ? { plainTextFallbackPath: parseFieldPathKey(field.plainTextField) } : {}
|
|
33236
|
+
};
|
|
33237
|
+
}
|
|
33004
33238
|
case "media":
|
|
33005
33239
|
case "file":
|
|
33006
33240
|
return {
|
|
@@ -33125,6 +33359,7 @@ function normalizeStoredContentValues(plans, content, options = {}) {
|
|
|
33125
33359
|
const plan = planMap.get(key);
|
|
33126
33360
|
normalized[key] = plan ? normalizeStoredFieldValueWithContext(plan, value, ctx) : value;
|
|
33127
33361
|
}
|
|
33362
|
+
normalizeInlineTextFallbacks(plans, normalized, ctx);
|
|
33128
33363
|
return normalized;
|
|
33129
33364
|
}
|
|
33130
33365
|
function normalizeStoredFieldValueWithContext(plan, value, ctx) {
|
|
@@ -33140,6 +33375,7 @@ function normalizeStoredFieldValueWithContext(plan, value, ctx) {
|
|
|
33140
33375
|
case "number":
|
|
33141
33376
|
case "boolean":
|
|
33142
33377
|
case "richText":
|
|
33378
|
+
case "inlineText":
|
|
33143
33379
|
case "media":
|
|
33144
33380
|
case "link":
|
|
33145
33381
|
case "select":
|
|
@@ -33155,12 +33391,9 @@ function normalizeStoredObjectChildren(children, value, ctx) {
|
|
|
33155
33391
|
}
|
|
33156
33392
|
const normalized = { ...value };
|
|
33157
33393
|
for (const child of children) {
|
|
33158
|
-
normalized[child.fieldId] = normalizeStoredFieldValueWithContext(
|
|
33159
|
-
child,
|
|
33160
|
-
normalized[child.fieldId],
|
|
33161
|
-
ctx
|
|
33162
|
-
);
|
|
33394
|
+
normalized[child.fieldId] = normalizeStoredFieldValueWithContext(child, normalized[child.fieldId], ctx);
|
|
33163
33395
|
}
|
|
33396
|
+
normalizeInlineTextFallbacks(children, normalized, ctx);
|
|
33164
33397
|
return normalized;
|
|
33165
33398
|
}
|
|
33166
33399
|
function normalizeStoredRepeaterItems(plan, value, ctx) {
|
|
@@ -33191,6 +33424,7 @@ function normalizeFieldValue(plan, value, ctx) {
|
|
|
33191
33424
|
return normalizeRepeaterItems(plan, value, ctx);
|
|
33192
33425
|
case "boolean":
|
|
33193
33426
|
case "richText":
|
|
33427
|
+
case "inlineText":
|
|
33194
33428
|
case "link":
|
|
33195
33429
|
case "select":
|
|
33196
33430
|
case "passthrough":
|
|
@@ -33216,8 +33450,24 @@ function normalizeObjectChildren(children, value, ctx) {
|
|
|
33216
33450
|
for (const child of children) {
|
|
33217
33451
|
normalized[child.fieldId] = normalizeFieldValue(child, normalized[child.fieldId], ctx);
|
|
33218
33452
|
}
|
|
33453
|
+
normalizeInlineTextFallbacks(children, normalized, ctx);
|
|
33219
33454
|
return normalized;
|
|
33220
33455
|
}
|
|
33456
|
+
function normalizeInlineTextFallbacks(plans, values, ctx) {
|
|
33457
|
+
for (const plan of plans) {
|
|
33458
|
+
if (plan.kind !== "inlineText" || !plan.plainTextFallbackPath) continue;
|
|
33459
|
+
if (!isMissingForPlan(plan, values[plan.fieldId])) continue;
|
|
33460
|
+
const fallback2 = getAtFieldPath(values, plan.plainTextFallbackPath);
|
|
33461
|
+
if (typeof fallback2 !== "string" || fallback2.trim().length === 0) continue;
|
|
33462
|
+
values[plan.fieldId] = normalizeFieldValue(plan, plainTextToInlineText(fallback2), ctx);
|
|
33463
|
+
}
|
|
33464
|
+
}
|
|
33465
|
+
function getAtFieldPath(source, path) {
|
|
33466
|
+
return path.reduce((current, segment) => {
|
|
33467
|
+
if (!current || typeof current !== "object" || Array.isArray(current)) return void 0;
|
|
33468
|
+
return current[String(segment)];
|
|
33469
|
+
}, source);
|
|
33470
|
+
}
|
|
33221
33471
|
function normalizeRepeaterItems(plan, value, ctx) {
|
|
33222
33472
|
if (!isUnknownArray(value)) return value;
|
|
33223
33473
|
return value.map((item) => {
|
|
@@ -33255,6 +33505,8 @@ function validateNormalizedFieldValue(plan, value, ctx) {
|
|
|
33255
33505
|
return validateSelectPlan(plan, value);
|
|
33256
33506
|
case "richText":
|
|
33257
33507
|
return isValidRichTextDoc(value) ? [] : [issue(plan, "invalidRichText")];
|
|
33508
|
+
case "inlineText":
|
|
33509
|
+
return validateInlineTextPlan(plan, value);
|
|
33258
33510
|
case "media":
|
|
33259
33511
|
return isPlainObject(value) ? [] : [issue(plan, "invalidMedia")];
|
|
33260
33512
|
case "link":
|
|
@@ -33428,6 +33680,7 @@ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
|
|
|
33428
33680
|
case "number":
|
|
33429
33681
|
case "boolean":
|
|
33430
33682
|
case "richText":
|
|
33683
|
+
case "inlineText":
|
|
33431
33684
|
case "media":
|
|
33432
33685
|
case "link":
|
|
33433
33686
|
case "select":
|
|
@@ -33440,6 +33693,18 @@ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
|
|
|
33440
33693
|
return assertNever4(plan);
|
|
33441
33694
|
}
|
|
33442
33695
|
}
|
|
33696
|
+
function validateInlineTextPlan(plan, value) {
|
|
33697
|
+
const parsed = parseInlineTextFromUnknown(value);
|
|
33698
|
+
if (!parsed.ok) return [issue(plan, "invalidInlineText")];
|
|
33699
|
+
const text2 = inlineTextToPlainText(parsed.value);
|
|
33700
|
+
const lengthIssue = plan.constraints.find(
|
|
33701
|
+
(constraint) => constraint.kind === "maxPlainTextLength"
|
|
33702
|
+
);
|
|
33703
|
+
if (lengthIssue && text2.length > lengthIssue.maximum) {
|
|
33704
|
+
return [issue(plan, "tooLong", { maximum: lengthIssue.maximum })];
|
|
33705
|
+
}
|
|
33706
|
+
return [];
|
|
33707
|
+
}
|
|
33443
33708
|
function rebaseFieldPath(path, fromPrefix, toPrefix) {
|
|
33444
33709
|
if (!startsWithFieldPath(path, fromPrefix)) {
|
|
33445
33710
|
throw new Error(`Cannot rebase field path ${formatFieldPath(path)} from ${formatFieldPath(fromPrefix)}`);
|
|
@@ -33533,6 +33798,7 @@ function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
|
|
|
33533
33798
|
case "tooFewItems":
|
|
33534
33799
|
case "tooManyItems":
|
|
33535
33800
|
case "invalidRichText":
|
|
33801
|
+
case "invalidInlineText":
|
|
33536
33802
|
case "invalidMedia":
|
|
33537
33803
|
case "invalidLink":
|
|
33538
33804
|
case "invalidReference":
|
|
@@ -33580,6 +33846,7 @@ function findNestedFieldValidationPlan(plan, path) {
|
|
|
33580
33846
|
case "number":
|
|
33581
33847
|
case "boolean":
|
|
33582
33848
|
case "richText":
|
|
33849
|
+
case "inlineText":
|
|
33583
33850
|
case "media":
|
|
33584
33851
|
case "link":
|
|
33585
33852
|
case "select":
|
|
@@ -36709,44 +36976,44 @@ var styleTagsSchema = z.object({
|
|
|
36709
36976
|
motion: z.enum(STYLE_AXIS_VALUES.motion).optional(),
|
|
36710
36977
|
era: z.enum(STYLE_AXIS_VALUES.era).optional()
|
|
36711
36978
|
});
|
|
36712
|
-
var hotspotSchema =
|
|
36713
|
-
x:
|
|
36714
|
-
y:
|
|
36715
|
-
radius:
|
|
36716
|
-
});
|
|
36717
|
-
var rotationSchema =
|
|
36718
|
-
var rectSchema =
|
|
36719
|
-
var aspectCropSchema =
|
|
36720
|
-
aspect:
|
|
36721
|
-
rect:
|
|
36722
|
-
hotspot:
|
|
36723
|
-
rotation:
|
|
36724
|
-
});
|
|
36725
|
-
var transformSchema =
|
|
36726
|
-
aspectCrops:
|
|
36979
|
+
var hotspotSchema = z42.object({
|
|
36980
|
+
x: z42.number().min(0).max(1),
|
|
36981
|
+
y: z42.number().min(0).max(1),
|
|
36982
|
+
radius: z42.number().optional()
|
|
36983
|
+
});
|
|
36984
|
+
var rotationSchema = z42.union([z42.literal(0), z42.literal(90), z42.literal(180), z42.literal(270)]);
|
|
36985
|
+
var rectSchema = z42.tuple([z42.number(), z42.number(), z42.number(), z42.number()]);
|
|
36986
|
+
var aspectCropSchema = z42.object({
|
|
36987
|
+
aspect: z42.preprocess((value) => value == null ? void 0 : value, z42.string().optional()),
|
|
36988
|
+
rect: z42.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
36989
|
+
hotspot: z42.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
36990
|
+
rotation: z42.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
36991
|
+
});
|
|
36992
|
+
var transformSchema = z42.object({
|
|
36993
|
+
aspectCrops: z42.preprocess((value) => {
|
|
36727
36994
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
36728
36995
|
return void 0;
|
|
36729
36996
|
}
|
|
36730
36997
|
return value;
|
|
36731
|
-
},
|
|
36998
|
+
}, z42.record(z42.string(), aspectCropSchema.catch({}))).optional(),
|
|
36732
36999
|
rect: rectSchema.optional(),
|
|
36733
37000
|
hotspot: hotspotSchema.optional(),
|
|
36734
37001
|
rotation: rotationSchema.optional()
|
|
36735
37002
|
});
|
|
36736
|
-
var mediaSchema =
|
|
36737
|
-
type:
|
|
36738
|
-
purpose:
|
|
36739
|
-
placeholder:
|
|
36740
|
-
assetId:
|
|
36741
|
-
identifier:
|
|
36742
|
-
src:
|
|
36743
|
-
alt:
|
|
36744
|
-
filename:
|
|
36745
|
-
mimeType:
|
|
36746
|
-
width:
|
|
36747
|
-
height:
|
|
36748
|
-
storageBucket:
|
|
36749
|
-
storagePath:
|
|
37003
|
+
var mediaSchema = z42.object({
|
|
37004
|
+
type: z42.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
|
|
37005
|
+
purpose: z42.string().optional(),
|
|
37006
|
+
placeholder: z42.boolean().default(true).optional(),
|
|
37007
|
+
assetId: z42.string().optional(),
|
|
37008
|
+
identifier: z42.string().optional(),
|
|
37009
|
+
src: z42.string().optional(),
|
|
37010
|
+
alt: z42.string().optional(),
|
|
37011
|
+
filename: z42.string().optional(),
|
|
37012
|
+
mimeType: z42.string().optional(),
|
|
37013
|
+
width: z42.number().optional(),
|
|
37014
|
+
height: z42.number().optional(),
|
|
37015
|
+
storageBucket: z42.string().optional(),
|
|
37016
|
+
storagePath: z42.string().optional(),
|
|
36750
37017
|
transform: transformSchema.optional()
|
|
36751
37018
|
});
|
|
36752
37019
|
|
|
@@ -49946,7 +50213,8 @@ function when(path, options) {
|
|
|
49946
50213
|
$when: {
|
|
49947
50214
|
when: { from: path },
|
|
49948
50215
|
...options?.equals !== void 0 ? { equals: options.equals } : {},
|
|
49949
|
-
...options?.not ? { not: true } : {}
|
|
50216
|
+
...options?.not ? { not: true } : {},
|
|
50217
|
+
...options?.authoringPresence ? { authoringPresence: options.authoringPresence } : {}
|
|
49950
50218
|
}
|
|
49951
50219
|
});
|
|
49952
50220
|
}
|
|
@@ -52057,8 +52325,16 @@ var heroCopyFragment = defineFragment({
|
|
|
52057
52325
|
id: "headline",
|
|
52058
52326
|
type: "text",
|
|
52059
52327
|
label: "Headline",
|
|
52328
|
+
maxLength: 120,
|
|
52329
|
+
ui: { hidden: true }
|
|
52330
|
+
},
|
|
52331
|
+
{
|
|
52332
|
+
id: "headlineInline",
|
|
52333
|
+
type: "inlineText",
|
|
52334
|
+
label: "Headline",
|
|
52060
52335
|
required: true,
|
|
52061
|
-
maxLength: 120
|
|
52336
|
+
maxLength: 120,
|
|
52337
|
+
plainTextField: "headline"
|
|
52062
52338
|
},
|
|
52063
52339
|
{
|
|
52064
52340
|
id: "subheadline",
|
|
@@ -52083,9 +52359,12 @@ var heroCopyFragment = defineFragment({
|
|
|
52083
52359
|
as: "h1",
|
|
52084
52360
|
// heading-display: uses fluid typography from theme (--fs-h1-display-fluid)
|
|
52085
52361
|
// Color in blocks-static/index.css (.hero-headline)
|
|
52086
|
-
className: "hero-headline heading-display"
|
|
52362
|
+
className: "hero-headline heading-display",
|
|
52363
|
+
// Resolved against top-level block content; keep this beside the sibling headline field.
|
|
52364
|
+
inlineTextFallbackPath: "headline",
|
|
52365
|
+
maxLength: 120
|
|
52087
52366
|
},
|
|
52088
|
-
bind("content.
|
|
52367
|
+
bind("content.headlineInline")
|
|
52089
52368
|
),
|
|
52090
52369
|
text(
|
|
52091
52370
|
{
|
|
@@ -59944,72 +60223,239 @@ var appointmentBookingBlockDefinition = {
|
|
|
59944
60223
|
}
|
|
59945
60224
|
}
|
|
59946
60225
|
};
|
|
60226
|
+
var weeklySlotAvailabilityManifest = createBlockManifest({
|
|
60227
|
+
id: "block.weekly-slot-availability",
|
|
60228
|
+
version: "1.0.0",
|
|
60229
|
+
title: "Weekly Slot Availability",
|
|
60230
|
+
titleSource: "heading",
|
|
60231
|
+
description: "Shows available recurring appointment slot patterns",
|
|
60232
|
+
skipSectionStyles: true,
|
|
60233
|
+
additionalFields: [
|
|
60234
|
+
{
|
|
60235
|
+
id: "serviceId",
|
|
60236
|
+
type: "reference",
|
|
60237
|
+
label: "Appointment service",
|
|
60238
|
+
description: "Choose which appointment service to show availability for",
|
|
60239
|
+
required: true,
|
|
60240
|
+
referenceKind: "appointmentService",
|
|
60241
|
+
allowManualEntry: false,
|
|
60242
|
+
ui: { intent: "behavior" }
|
|
60243
|
+
},
|
|
60244
|
+
{
|
|
60245
|
+
id: "resourceId",
|
|
60246
|
+
type: "reference",
|
|
60247
|
+
label: "Appointment resource",
|
|
60248
|
+
description: "Optionally narrow the availability to one practitioner or room",
|
|
60249
|
+
required: false,
|
|
60250
|
+
referenceKind: "appointmentResource",
|
|
60251
|
+
allowManualEntry: false,
|
|
60252
|
+
ui: { intent: "behavior" }
|
|
60253
|
+
},
|
|
60254
|
+
{
|
|
60255
|
+
id: "horizonWeeks",
|
|
60256
|
+
type: "select",
|
|
60257
|
+
label: "Look ahead",
|
|
60258
|
+
required: false,
|
|
60259
|
+
multiple: false,
|
|
60260
|
+
defaultValue: "4",
|
|
60261
|
+
options: [
|
|
60262
|
+
{ value: "1", label: "1 week" },
|
|
60263
|
+
{ value: "2", label: "2 weeks" },
|
|
60264
|
+
{ value: "4", label: "4 weeks" }
|
|
60265
|
+
],
|
|
60266
|
+
ui: { intent: "behavior" }
|
|
60267
|
+
},
|
|
60268
|
+
{
|
|
60269
|
+
id: "timezone",
|
|
60270
|
+
type: "text",
|
|
60271
|
+
label: "Timezone",
|
|
60272
|
+
description: "Leave blank to use the visitor timezone when the block loads",
|
|
60273
|
+
required: false,
|
|
60274
|
+
multiline: false,
|
|
60275
|
+
defaultValue: "",
|
|
60276
|
+
maxLength: 64,
|
|
60277
|
+
ui: { intent: "behavior" }
|
|
60278
|
+
},
|
|
60279
|
+
{
|
|
60280
|
+
id: "heading",
|
|
60281
|
+
type: "text",
|
|
60282
|
+
label: "Heading",
|
|
60283
|
+
required: false,
|
|
60284
|
+
multiline: false,
|
|
60285
|
+
defaultValue: "Weekly availability"
|
|
60286
|
+
},
|
|
60287
|
+
{
|
|
60288
|
+
id: "description",
|
|
60289
|
+
type: "richText",
|
|
60290
|
+
label: "Description",
|
|
60291
|
+
required: false
|
|
60292
|
+
},
|
|
60293
|
+
{
|
|
60294
|
+
id: "emptyMessage",
|
|
60295
|
+
type: "text",
|
|
60296
|
+
label: "Empty message",
|
|
60297
|
+
required: false,
|
|
60298
|
+
multiline: true,
|
|
60299
|
+
defaultValue: "No regular weekly openings are currently available.",
|
|
60300
|
+
maxLength: 180
|
|
60301
|
+
},
|
|
60302
|
+
{
|
|
60303
|
+
id: "ctaText",
|
|
60304
|
+
type: "text",
|
|
60305
|
+
label: "Enquiry button text",
|
|
60306
|
+
required: false,
|
|
60307
|
+
multiline: false,
|
|
60308
|
+
defaultValue: "Enquire about this slot",
|
|
60309
|
+
maxLength: 60
|
|
60310
|
+
},
|
|
60311
|
+
{
|
|
60312
|
+
id: "ctaUrl",
|
|
60313
|
+
type: "url",
|
|
60314
|
+
label: "Enquiry URL",
|
|
60315
|
+
required: false,
|
|
60316
|
+
ui: { intent: "behavior" }
|
|
60317
|
+
},
|
|
60318
|
+
sectionStylesField({
|
|
60319
|
+
id: "_sectionStyles",
|
|
60320
|
+
label: "Section styles"
|
|
60321
|
+
})
|
|
60322
|
+
],
|
|
60323
|
+
styleTokens: { background: "surface", typography: "body", spacing: "md" },
|
|
60324
|
+
behaviours: {
|
|
60325
|
+
supportsThemeSwitching: true,
|
|
60326
|
+
inlineEditing: false,
|
|
60327
|
+
animation: false,
|
|
60328
|
+
paletteHidden: false
|
|
60329
|
+
},
|
|
60330
|
+
category: "interactive",
|
|
60331
|
+
tags: ["booking", "appointment", "calendar", "weekly", "availability"],
|
|
60332
|
+
icon: "CalendarDays",
|
|
60333
|
+
layout: [
|
|
60334
|
+
styledSection({
|
|
60335
|
+
children: sectionContainer([
|
|
60336
|
+
text({ as: "h2" }, bind("content.heading"), when("content.heading")),
|
|
60337
|
+
richText({}, bind("content.description"), when("content.description")),
|
|
60338
|
+
el(
|
|
60339
|
+
"weekly-slot-availability",
|
|
60340
|
+
withApiBindings({
|
|
60341
|
+
serviceId: { $bind: { from: "content.serviceId" } },
|
|
60342
|
+
resourceId: { $bind: { from: "content.resourceId", fallback: null } },
|
|
60343
|
+
horizonWeeks: { $bind: { from: "content.horizonWeeks", fallback: "4" } },
|
|
60344
|
+
timezone: { $bind: { from: "content.timezone", fallback: null } },
|
|
60345
|
+
availability: { $bind: { from: "data.availability", fallback: null } },
|
|
60346
|
+
emptyMessage: { $bind: { from: "content.emptyMessage", fallback: null } },
|
|
60347
|
+
ctaText: { $bind: { from: "content.ctaText", fallback: null } },
|
|
60348
|
+
ctaUrl: { $bind: { from: "content.ctaUrl", fallback: null } }
|
|
60349
|
+
})
|
|
60350
|
+
)
|
|
60351
|
+
], {
|
|
60352
|
+
gap: "lg"
|
|
60353
|
+
}),
|
|
60354
|
+
baseClass: "",
|
|
60355
|
+
spacing: "spacious"
|
|
60356
|
+
})
|
|
60357
|
+
]
|
|
60358
|
+
});
|
|
60359
|
+
var weeklySlotAvailabilityOptionSchema = z.object({
|
|
60360
|
+
id: z.string(),
|
|
60361
|
+
resourceId: z.string(),
|
|
60362
|
+
weekday: z.number(),
|
|
60363
|
+
weekdayLabel: z.string(),
|
|
60364
|
+
startTime: z.string(),
|
|
60365
|
+
endTime: z.string(),
|
|
60366
|
+
nextDate: z.string(),
|
|
60367
|
+
availableWeeks: z.number()
|
|
60368
|
+
});
|
|
60369
|
+
var weeklySlotAvailabilityDataSchema = z.object({
|
|
60370
|
+
slots: z.array(weeklySlotAvailabilityOptionSchema),
|
|
60371
|
+
horizonWeeks: z.number(),
|
|
60372
|
+
timezone: z.string(),
|
|
60373
|
+
startDate: z.string(),
|
|
60374
|
+
endDate: z.string()
|
|
60375
|
+
});
|
|
60376
|
+
var weeklySlotAvailabilityBlockDefinition = {
|
|
60377
|
+
manifest: weeklySlotAvailabilityManifest,
|
|
60378
|
+
dataSchemas: { availability: weeklySlotAvailabilityDataSchema.optional() },
|
|
60379
|
+
dataLoaders: {
|
|
60380
|
+
availability: {
|
|
60381
|
+
endpoint: "getPublicWeeklySlotAvailability",
|
|
60382
|
+
params: {
|
|
60383
|
+
siteId: { $bind: { from: "$root.siteId" } },
|
|
60384
|
+
serviceId: { $bind: { from: "content.serviceId" } },
|
|
60385
|
+
resourceId: { $bind: { from: "content.resourceId", fallback: void 0 } },
|
|
60386
|
+
horizonWeeks: { $bind: { from: "content.horizonWeeks", fallback: "4" } },
|
|
60387
|
+
timezone: { $bind: { from: "content.timezone", fallback: void 0 } }
|
|
60388
|
+
},
|
|
60389
|
+
mode: "server"
|
|
60390
|
+
}
|
|
60391
|
+
}
|
|
60392
|
+
};
|
|
59947
60393
|
var PUBLIC_DOWNLOAD_MEDIA_TYPES = [
|
|
59948
60394
|
"document",
|
|
59949
60395
|
"spreadsheet",
|
|
59950
60396
|
"archive",
|
|
59951
60397
|
"audio"
|
|
59952
60398
|
];
|
|
59953
|
-
var hotspotSchema2 =
|
|
59954
|
-
x:
|
|
59955
|
-
y:
|
|
59956
|
-
radius:
|
|
59957
|
-
});
|
|
59958
|
-
var rotationSchema2 =
|
|
59959
|
-
var rectSchema2 =
|
|
59960
|
-
var aspectCropSchema2 =
|
|
59961
|
-
aspect:
|
|
59962
|
-
rect:
|
|
59963
|
-
hotspot:
|
|
59964
|
-
rotation:
|
|
59965
|
-
});
|
|
59966
|
-
var transformSchema2 =
|
|
59967
|
-
aspectCrops:
|
|
60399
|
+
var hotspotSchema2 = z42.object({
|
|
60400
|
+
x: z42.number().min(0).max(1),
|
|
60401
|
+
y: z42.number().min(0).max(1),
|
|
60402
|
+
radius: z42.number().optional()
|
|
60403
|
+
});
|
|
60404
|
+
var rotationSchema2 = z42.union([z42.literal(0), z42.literal(90), z42.literal(180), z42.literal(270)]);
|
|
60405
|
+
var rectSchema2 = z42.tuple([z42.number(), z42.number(), z42.number(), z42.number()]);
|
|
60406
|
+
var aspectCropSchema2 = z42.object({
|
|
60407
|
+
aspect: z42.preprocess((value) => value == null ? void 0 : value, z42.string().optional()),
|
|
60408
|
+
rect: z42.preprocess((value) => value == null ? void 0 : value, rectSchema2.optional()),
|
|
60409
|
+
hotspot: z42.preprocess((value) => value == null ? void 0 : value, hotspotSchema2.optional()),
|
|
60410
|
+
rotation: z42.preprocess((value) => value == null ? void 0 : value, rotationSchema2.optional())
|
|
60411
|
+
});
|
|
60412
|
+
var transformSchema2 = z42.object({
|
|
60413
|
+
aspectCrops: z42.preprocess((value) => {
|
|
59968
60414
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
59969
60415
|
return void 0;
|
|
59970
60416
|
}
|
|
59971
60417
|
return value;
|
|
59972
|
-
},
|
|
60418
|
+
}, z42.record(z42.string(), aspectCropSchema2.catch({}))).optional(),
|
|
59973
60419
|
rect: rectSchema2.optional(),
|
|
59974
60420
|
hotspot: hotspotSchema2.optional(),
|
|
59975
60421
|
rotation: rotationSchema2.optional()
|
|
59976
60422
|
});
|
|
59977
|
-
var mediaPosterSchema =
|
|
59978
|
-
|
|
59979
|
-
tag:
|
|
59980
|
-
assetId:
|
|
59981
|
-
storageBucket:
|
|
59982
|
-
storagePath:
|
|
60423
|
+
var mediaPosterSchema = z42.discriminatedUnion("tag", [
|
|
60424
|
+
z42.object({
|
|
60425
|
+
tag: z42.literal("storage"),
|
|
60426
|
+
assetId: z42.string().optional(),
|
|
60427
|
+
storageBucket: z42.string().min(1),
|
|
60428
|
+
storagePath: z42.string().min(1)
|
|
59983
60429
|
}),
|
|
59984
|
-
|
|
59985
|
-
tag:
|
|
59986
|
-
assetId:
|
|
59987
|
-
src:
|
|
60430
|
+
z42.object({
|
|
60431
|
+
tag: z42.literal("external-src"),
|
|
60432
|
+
assetId: z42.string().optional(),
|
|
60433
|
+
src: z42.string().url()
|
|
59988
60434
|
})
|
|
59989
60435
|
]);
|
|
59990
|
-
var mediaBaseSchema =
|
|
59991
|
-
purpose:
|
|
59992
|
-
placeholder:
|
|
59993
|
-
assetId:
|
|
59994
|
-
identifier:
|
|
59995
|
-
src:
|
|
59996
|
-
alt:
|
|
59997
|
-
filename:
|
|
59998
|
-
mimeType:
|
|
59999
|
-
width:
|
|
60000
|
-
height:
|
|
60001
|
-
storageBucket:
|
|
60002
|
-
storagePath:
|
|
60436
|
+
var mediaBaseSchema = z42.object({
|
|
60437
|
+
purpose: z42.string().optional(),
|
|
60438
|
+
placeholder: z42.boolean().default(true).optional(),
|
|
60439
|
+
assetId: z42.string().optional(),
|
|
60440
|
+
identifier: z42.string().optional(),
|
|
60441
|
+
src: z42.string().optional(),
|
|
60442
|
+
alt: z42.string().optional(),
|
|
60443
|
+
filename: z42.string().optional(),
|
|
60444
|
+
mimeType: z42.string().optional(),
|
|
60445
|
+
width: z42.number().optional(),
|
|
60446
|
+
height: z42.number().optional(),
|
|
60447
|
+
storageBucket: z42.string().optional(),
|
|
60448
|
+
storagePath: z42.string().optional(),
|
|
60003
60449
|
poster: mediaPosterSchema.optional(),
|
|
60004
60450
|
transform: transformSchema2.optional()
|
|
60005
60451
|
});
|
|
60006
|
-
var imageMediaSchema = mediaBaseSchema.extend({ type:
|
|
60007
|
-
var videoMediaSchema = mediaBaseSchema.extend({ type:
|
|
60008
|
-
var audioMediaSchema = mediaBaseSchema.extend({ type:
|
|
60009
|
-
var documentMediaSchema = mediaBaseSchema.extend({ type:
|
|
60010
|
-
var spreadsheetMediaSchema = mediaBaseSchema.extend({ type:
|
|
60011
|
-
var archiveMediaSchema = mediaBaseSchema.extend({ type:
|
|
60012
|
-
var mediaSchema2 =
|
|
60452
|
+
var imageMediaSchema = mediaBaseSchema.extend({ type: z42.literal("image") });
|
|
60453
|
+
var videoMediaSchema = mediaBaseSchema.extend({ type: z42.literal("video") });
|
|
60454
|
+
var audioMediaSchema = mediaBaseSchema.extend({ type: z42.literal("audio") });
|
|
60455
|
+
var documentMediaSchema = mediaBaseSchema.extend({ type: z42.literal("document") });
|
|
60456
|
+
var spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z42.literal("spreadsheet") });
|
|
60457
|
+
var archiveMediaSchema = mediaBaseSchema.extend({ type: z42.literal("archive") });
|
|
60458
|
+
var mediaSchema2 = z42.discriminatedUnion("type", [
|
|
60013
60459
|
imageMediaSchema,
|
|
60014
60460
|
videoMediaSchema,
|
|
60015
60461
|
audioMediaSchema,
|
|
@@ -60653,6 +61099,34 @@ function normalizeEventStaffMemberId(value) {
|
|
|
60653
61099
|
const trimmed = value.trim();
|
|
60654
61100
|
return trimmed ? trimmed : null;
|
|
60655
61101
|
}
|
|
61102
|
+
|
|
61103
|
+
// ../blocks/src/system/blocks/events/shared/layout.ts
|
|
61104
|
+
var recoverEmptyHeadingWhenActive = {
|
|
61105
|
+
kind: "recover-empty-when-active",
|
|
61106
|
+
placeholder: "Add heading"
|
|
61107
|
+
};
|
|
61108
|
+
var recoverEmptyDescriptionWhenActive = {
|
|
61109
|
+
kind: "recover-empty-when-active",
|
|
61110
|
+
placeholder: "Add description"
|
|
61111
|
+
};
|
|
61112
|
+
function eventSectionHeaderLayoutNodes() {
|
|
61113
|
+
return [
|
|
61114
|
+
text(
|
|
61115
|
+
{ as: "h2" },
|
|
61116
|
+
bind("content.heading"),
|
|
61117
|
+
when("content.heading", {
|
|
61118
|
+
authoringPresence: recoverEmptyHeadingWhenActive
|
|
61119
|
+
})
|
|
61120
|
+
),
|
|
61121
|
+
richText(
|
|
61122
|
+
{ className: "rb-prose rb-max-w-none" },
|
|
61123
|
+
bind("content.description"),
|
|
61124
|
+
when("content.description", {
|
|
61125
|
+
authoringPresence: recoverEmptyDescriptionWhenActive
|
|
61126
|
+
})
|
|
61127
|
+
)
|
|
61128
|
+
];
|
|
61129
|
+
}
|
|
60656
61130
|
var publicPassProductSchema = z.object({
|
|
60657
61131
|
id: z.string(),
|
|
60658
61132
|
productUseCase: z.enum(["event_pass", "appointment_package"]).default("event_pass"),
|
|
@@ -62297,18 +62771,7 @@ var eventSpotlightFields = [
|
|
|
62297
62771
|
var eventSpotlightLayout = [
|
|
62298
62772
|
styledSection({
|
|
62299
62773
|
children: sectionContainer([
|
|
62300
|
-
|
|
62301
|
-
text(
|
|
62302
|
-
{ as: "h2" },
|
|
62303
|
-
bind("content.heading"),
|
|
62304
|
-
when("content.heading")
|
|
62305
|
-
),
|
|
62306
|
-
// Optional description
|
|
62307
|
-
richText(
|
|
62308
|
-
{ className: "rb-prose rb-max-w-none" },
|
|
62309
|
-
bind("content.description"),
|
|
62310
|
-
when("content.description")
|
|
62311
|
-
),
|
|
62774
|
+
...eventSectionHeaderLayoutNodes(),
|
|
62312
62775
|
// Event spotlight component
|
|
62313
62776
|
el("event-spotlight", {
|
|
62314
62777
|
events: { $bind: { from: "data.events" } },
|
|
@@ -65010,18 +65473,7 @@ var eventListingAdditionalFields = [
|
|
|
65010
65473
|
var eventListingLayout = [
|
|
65011
65474
|
styledSection({
|
|
65012
65475
|
children: sectionContainer([
|
|
65013
|
-
|
|
65014
|
-
text(
|
|
65015
|
-
{ as: "h2" },
|
|
65016
|
-
bind("content.heading"),
|
|
65017
|
-
when("content.heading")
|
|
65018
|
-
),
|
|
65019
|
-
// Optional description
|
|
65020
|
-
richText(
|
|
65021
|
-
{ className: "rb-prose rb-max-w-none" },
|
|
65022
|
-
bind("content.description"),
|
|
65023
|
-
when("content.description")
|
|
65024
|
-
),
|
|
65476
|
+
...eventSectionHeaderLayoutNodes(),
|
|
65025
65477
|
// Event listing component with pagination
|
|
65026
65478
|
el("event-listing", withApiBindings({
|
|
65027
65479
|
events: { $bind: { from: "data.events" } },
|
|
@@ -65361,14 +65813,7 @@ var eventCalendarLayout = [
|
|
|
65361
65813
|
styledSection({
|
|
65362
65814
|
children: sectionContainer(
|
|
65363
65815
|
[
|
|
65364
|
-
|
|
65365
|
-
text({ as: "h2" }, bind("content.heading"), when("content.heading")),
|
|
65366
|
-
// Optional description
|
|
65367
|
-
richText(
|
|
65368
|
-
{ className: "rb-prose rb-max-w-none" },
|
|
65369
|
-
bind("content.description"),
|
|
65370
|
-
when("content.description")
|
|
65371
|
-
),
|
|
65816
|
+
...eventSectionHeaderLayoutNodes(),
|
|
65372
65817
|
// Event calendar component (handles all display modes)
|
|
65373
65818
|
el(
|
|
65374
65819
|
"event-calendar",
|
|
@@ -71344,6 +71789,10 @@ var systemBlockDefinitionsRaw = [
|
|
|
71344
71789
|
flow: conversionFlow,
|
|
71345
71790
|
layoutProfiles: [layoutProfile({ variantKey: "default", family: "form", weight: "standard" })]
|
|
71346
71791
|
})),
|
|
71792
|
+
withDesignCapability("block.weekly-slot-availability", weeklySlotAvailabilityBlockDefinition, sectionOnly(), defineBlockDesignMetadata({
|
|
71793
|
+
flow: offeringsFlow,
|
|
71794
|
+
layoutProfiles: [layoutProfile({ variantKey: "default", family: "stack", weight: "standard" })]
|
|
71795
|
+
})),
|
|
71347
71796
|
withDesignCapability("block.event-registration", eventRegistrationBlockDefinition, sectionOnly(), defineBlockDesignMetadata({
|
|
71348
71797
|
flow: conversionFlow,
|
|
71349
71798
|
layoutProfiles: [layoutProfile({ variantKey: "default", family: "form", weight: "standard" })]
|
|
@@ -72608,6 +73057,123 @@ var FigureNode = ({
|
|
|
72608
73057
|
...props2
|
|
72609
73058
|
}) => /* @__PURE__ */ jsx("figure", { ...props2 });
|
|
72610
73059
|
|
|
73060
|
+
// ../path-utils/src/index.ts
|
|
73061
|
+
var PATH_SEPARATOR_REGEX = /\./g;
|
|
73062
|
+
var BRACKET_ACCESS_REGEX = /\[([^\]]+)\]/g;
|
|
73063
|
+
function isRecord12(value) {
|
|
73064
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
73065
|
+
}
|
|
73066
|
+
function isPathContainer(value) {
|
|
73067
|
+
return Array.isArray(value) || isRecord12(value);
|
|
73068
|
+
}
|
|
73069
|
+
function createPathContainer(nextIsIndex) {
|
|
73070
|
+
return nextIsIndex ? [] : {};
|
|
73071
|
+
}
|
|
73072
|
+
function getContainerValue(container, segment) {
|
|
73073
|
+
if (typeof segment === "number") {
|
|
73074
|
+
return Array.isArray(container) ? container[segment] : void 0;
|
|
73075
|
+
}
|
|
73076
|
+
if (segment in container) {
|
|
73077
|
+
return Reflect.get(container, segment);
|
|
73078
|
+
}
|
|
73079
|
+
return void 0;
|
|
73080
|
+
}
|
|
73081
|
+
function ensureContainerProperty(container, key, nextIsIndex) {
|
|
73082
|
+
const existing = Reflect.get(container, key);
|
|
73083
|
+
if (isPathContainer(existing)) {
|
|
73084
|
+
return existing;
|
|
73085
|
+
}
|
|
73086
|
+
const nextContainer = createPathContainer(nextIsIndex);
|
|
73087
|
+
Reflect.set(container, key, nextContainer);
|
|
73088
|
+
return nextContainer;
|
|
73089
|
+
}
|
|
73090
|
+
function parsePath(path) {
|
|
73091
|
+
if (Array.isArray(path)) return path;
|
|
73092
|
+
const segments = [];
|
|
73093
|
+
const parts = path.split(PATH_SEPARATOR_REGEX);
|
|
73094
|
+
for (const raw of parts) {
|
|
73095
|
+
if (!raw) continue;
|
|
73096
|
+
const baseMatch = raw.match(/^[^\[]+/);
|
|
73097
|
+
if (baseMatch !== null) {
|
|
73098
|
+
const base2 = baseMatch[1] ?? baseMatch[0];
|
|
73099
|
+
if (/^\d+$/.test(base2)) {
|
|
73100
|
+
segments.push(Number(base2));
|
|
73101
|
+
} else {
|
|
73102
|
+
segments.push(base2);
|
|
73103
|
+
}
|
|
73104
|
+
}
|
|
73105
|
+
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX);
|
|
73106
|
+
for (const match2 of bracketMatches) {
|
|
73107
|
+
const token = match2[1] ?? "";
|
|
73108
|
+
if (token.startsWith('"') || token.startsWith("'")) {
|
|
73109
|
+
segments.push(token.slice(1, -1));
|
|
73110
|
+
} else if (/^\d+$/.test(token)) {
|
|
73111
|
+
segments.push(Number(token));
|
|
73112
|
+
} else {
|
|
73113
|
+
segments.push(token);
|
|
73114
|
+
}
|
|
73115
|
+
}
|
|
73116
|
+
if (baseMatch === null && !raw.includes("[")) {
|
|
73117
|
+
segments.push(raw);
|
|
73118
|
+
}
|
|
73119
|
+
}
|
|
73120
|
+
return segments;
|
|
73121
|
+
}
|
|
73122
|
+
function segmentsToPath(segments) {
|
|
73123
|
+
if (!segments.length) return void 0;
|
|
73124
|
+
return segments.map((s2) => String(s2)).join(".");
|
|
73125
|
+
}
|
|
73126
|
+
function siblingPath(path, siblingFieldPath) {
|
|
73127
|
+
const segments = parsePath(path);
|
|
73128
|
+
const siblingSegments = parsePath(siblingFieldPath);
|
|
73129
|
+
const parentSegments = segments.slice(0, -1);
|
|
73130
|
+
return segmentsToPath([...parentSegments, ...siblingSegments]) ?? siblingFieldPath;
|
|
73131
|
+
}
|
|
73132
|
+
function getAtPath(source, path) {
|
|
73133
|
+
const segments = parsePath(path);
|
|
73134
|
+
return segments.reduce((current, segment) => {
|
|
73135
|
+
if (current === void 0 || current === null) return void 0;
|
|
73136
|
+
if (!isPathContainer(current)) return void 0;
|
|
73137
|
+
return getContainerValue(current, segment);
|
|
73138
|
+
}, source);
|
|
73139
|
+
}
|
|
73140
|
+
function setAtPath(target, path, value) {
|
|
73141
|
+
const segments = parsePath(path);
|
|
73142
|
+
let current = target;
|
|
73143
|
+
for (let index2 = 0; index2 < segments.length; index2 += 1) {
|
|
73144
|
+
const segment = segments[index2];
|
|
73145
|
+
if (segment === void 0) continue;
|
|
73146
|
+
const isLast = index2 === segments.length - 1;
|
|
73147
|
+
const nextIsIndex = typeof segments[index2 + 1] === "number";
|
|
73148
|
+
if (isLast) {
|
|
73149
|
+
if (typeof segment === "number") {
|
|
73150
|
+
if (Array.isArray(current)) {
|
|
73151
|
+
current[segment] = value;
|
|
73152
|
+
}
|
|
73153
|
+
} else {
|
|
73154
|
+
Reflect.set(current, segment, value);
|
|
73155
|
+
}
|
|
73156
|
+
return;
|
|
73157
|
+
}
|
|
73158
|
+
if (typeof segment === "number") {
|
|
73159
|
+
if (Array.isArray(current)) {
|
|
73160
|
+
const existing = current[segment];
|
|
73161
|
+
if (isPathContainer(existing)) {
|
|
73162
|
+
current = existing;
|
|
73163
|
+
} else {
|
|
73164
|
+
const nextContainer = createPathContainer(nextIsIndex);
|
|
73165
|
+
current[segment] = nextContainer;
|
|
73166
|
+
current = nextContainer;
|
|
73167
|
+
}
|
|
73168
|
+
continue;
|
|
73169
|
+
}
|
|
73170
|
+
current = ensureContainerProperty(current, String(segment), nextIsIndex);
|
|
73171
|
+
continue;
|
|
73172
|
+
}
|
|
73173
|
+
current = ensureContainerProperty(current, segment, nextIsIndex);
|
|
73174
|
+
}
|
|
73175
|
+
}
|
|
73176
|
+
|
|
72611
73177
|
// ../blocks/src/primitives/content/utils/sanitizeHref.ts
|
|
72612
73178
|
var SAFE_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
72613
73179
|
var CONTROL_CHARS_PATTERN = /[\u0000-\u001F\u007F]+/g;
|
|
@@ -72783,9 +73349,44 @@ function coerceRichTextDoc(value) {
|
|
|
72783
73349
|
}
|
|
72784
73350
|
return null;
|
|
72785
73351
|
}
|
|
72786
|
-
|
|
72787
|
-
return
|
|
73352
|
+
function renderInlineText(value) {
|
|
73353
|
+
return value.map((run3, index2) => renderRun(run3, index2));
|
|
73354
|
+
}
|
|
73355
|
+
function renderRun(run3, key) {
|
|
73356
|
+
return (run3.marks ?? []).reduceRight(
|
|
73357
|
+
(child, mark, index2) => renderMark(mark, `${String(key)}-${index2}`, child),
|
|
73358
|
+
run3.text
|
|
73359
|
+
);
|
|
73360
|
+
}
|
|
73361
|
+
function renderMark(mark, key, child) {
|
|
73362
|
+
switch (mark.kind) {
|
|
73363
|
+
case "strong":
|
|
73364
|
+
return /* @__PURE__ */ jsx("strong", { children: child }, key);
|
|
73365
|
+
case "emphasis":
|
|
73366
|
+
return /* @__PURE__ */ jsx("em", { children: child }, key);
|
|
73367
|
+
case "accent":
|
|
73368
|
+
return /* @__PURE__ */ jsx("span", { className: `rb-inline-text-accent rb-inline-text-accent-${mark.tone}`, children: child }, key);
|
|
73369
|
+
case "highlight":
|
|
73370
|
+
return /* @__PURE__ */ jsx("span", { className: `rb-inline-text-highlight rb-inline-text-highlight-${mark.tone}`, children: child }, key);
|
|
73371
|
+
}
|
|
73372
|
+
}
|
|
73373
|
+
var TextNode = ({ value, children, blockId: _blockId, blockKind: _blockKind, blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, inlineTextFallbackPath, ...rest }) => {
|
|
73374
|
+
const inlineText = parseInlineTextFromUnknown(value);
|
|
73375
|
+
if (inlineText.ok && !isInlineTextEmpty(inlineText.value)) {
|
|
73376
|
+
return /* @__PURE__ */ jsx(Text, { ...rest, children: renderInlineText(inlineText.value) });
|
|
73377
|
+
}
|
|
73378
|
+
const fallbackValue = inlineTextFallbackPath ? readStringPath(blockContent, inlineTextFallbackPath) : null;
|
|
73379
|
+
return /* @__PURE__ */ jsx(Text, { ...rest, children: fallbackValue ?? textNodeContent(value) ?? children });
|
|
72788
73380
|
};
|
|
73381
|
+
function textNodeContent(value) {
|
|
73382
|
+
if (value === null || value === void 0) return null;
|
|
73383
|
+
if (typeof value === "string" || typeof value === "number") return value;
|
|
73384
|
+
return null;
|
|
73385
|
+
}
|
|
73386
|
+
function readStringPath(source, path) {
|
|
73387
|
+
const value = getAtPath(source, path);
|
|
73388
|
+
return typeof value === "string" ? value : null;
|
|
73389
|
+
}
|
|
72789
73390
|
var RichTextNode = ({ value, blockId: _blockId, blockKind: _blockKind, blockContent: _blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, ...rest }) => {
|
|
72790
73391
|
const doc3 = coerceRichTextDoc(value);
|
|
72791
73392
|
return /* @__PURE__ */ jsx(RichText, { doc: doc3 ?? void 0, ...rest });
|
|
@@ -74012,12 +74613,12 @@ function resolveBookingSiteId(siteId, form2) {
|
|
|
74012
74613
|
return siteId || form2?.siteId || "";
|
|
74013
74614
|
}
|
|
74014
74615
|
function normalizeBookingFormConfig(form2) {
|
|
74015
|
-
if (!
|
|
74616
|
+
if (!isRecord13(form2)) return null;
|
|
74016
74617
|
const id = readNonEmptyString(form2.id);
|
|
74017
74618
|
const name = readNonEmptyString(form2.name);
|
|
74018
74619
|
if (!id || !name) return null;
|
|
74019
|
-
const schemaSource =
|
|
74020
|
-
const settingsSource =
|
|
74620
|
+
const schemaSource = isRecord13(form2.schema) ? form2.schema : isRecord13(form2.schemaJson) ? form2.schemaJson : null;
|
|
74621
|
+
const settingsSource = isRecord13(form2.settings) ? form2.settings : isRecord13(form2.settingsJson) ? form2.settingsJson : null;
|
|
74021
74622
|
return {
|
|
74022
74623
|
id,
|
|
74023
74624
|
name,
|
|
@@ -74041,10 +74642,10 @@ function normalizeBookingServices(services) {
|
|
|
74041
74642
|
if (Array.isArray(services)) {
|
|
74042
74643
|
return services.filter(isBookingFormService).map(normalizeService);
|
|
74043
74644
|
}
|
|
74044
|
-
if (
|
|
74645
|
+
if (isRecord13(services) && "services" in services) {
|
|
74045
74646
|
return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
74046
74647
|
}
|
|
74047
|
-
return
|
|
74648
|
+
return isRecord13(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
74048
74649
|
}
|
|
74049
74650
|
function normalizeBookingSchema(value) {
|
|
74050
74651
|
if (!value) return void 0;
|
|
@@ -74056,7 +74657,7 @@ function normalizeBookingSchema(value) {
|
|
|
74056
74657
|
};
|
|
74057
74658
|
}
|
|
74058
74659
|
function readBookingFormField(value) {
|
|
74059
|
-
if (!
|
|
74660
|
+
if (!isRecord13(value)) return null;
|
|
74060
74661
|
const id = readNonEmptyString(value.id);
|
|
74061
74662
|
const label = readNonEmptyString(value.label);
|
|
74062
74663
|
const type = readBookingFieldType(value.type);
|
|
@@ -74102,7 +74703,7 @@ function readBookingFieldOptions(value) {
|
|
|
74102
74703
|
return options.length > 0 ? options : void 0;
|
|
74103
74704
|
}
|
|
74104
74705
|
function readBookingFieldOption(value) {
|
|
74105
|
-
if (!
|
|
74706
|
+
if (!isRecord13(value)) return null;
|
|
74106
74707
|
const optionValue = readNonEmptyString(value.value);
|
|
74107
74708
|
const label = readNonEmptyString(value.label);
|
|
74108
74709
|
return optionValue && label ? { value: optionValue, label } : null;
|
|
@@ -74119,7 +74720,7 @@ function normalizeBookingSettings(value) {
|
|
|
74119
74720
|
};
|
|
74120
74721
|
}
|
|
74121
74722
|
function isBookingFormService(value) {
|
|
74122
|
-
return
|
|
74723
|
+
return isRecord13(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
74123
74724
|
}
|
|
74124
74725
|
function collectBookingCustomFields(data) {
|
|
74125
74726
|
const customFields = {};
|
|
@@ -74175,7 +74776,7 @@ function readStringArray(value) {
|
|
|
74175
74776
|
const strings = value.filter((item) => typeof item === "string");
|
|
74176
74777
|
return strings.length > 0 ? strings : void 0;
|
|
74177
74778
|
}
|
|
74178
|
-
function
|
|
74779
|
+
function isRecord13(value) {
|
|
74179
74780
|
return typeof value === "object" && value !== null;
|
|
74180
74781
|
}
|
|
74181
74782
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -76110,6 +76711,80 @@ function cardTreatmentClass(value) {
|
|
|
76110
76711
|
}
|
|
76111
76712
|
}
|
|
76112
76713
|
var offerings_preview_default = OfferingsPreviewNode;
|
|
76714
|
+
function pluralizeWeeks(count3) {
|
|
76715
|
+
return count3 === 1 ? "1 upcoming week" : `${count3} upcoming weeks`;
|
|
76716
|
+
}
|
|
76717
|
+
function buildSlotCtaUrl(ctaUrl, slot) {
|
|
76718
|
+
const placeholderOrigin = "https://weekly-slot-availability.local";
|
|
76719
|
+
const isAbsoluteUrl = /^[a-z][a-z\d+.-]*:/i.test(ctaUrl);
|
|
76720
|
+
try {
|
|
76721
|
+
const parsed = new URL(ctaUrl, placeholderOrigin);
|
|
76722
|
+
parsed.searchParams.set("slotId", slot.id);
|
|
76723
|
+
parsed.searchParams.set("weekday", String(slot.weekday));
|
|
76724
|
+
parsed.searchParams.set("startTime", slot.startTime);
|
|
76725
|
+
parsed.searchParams.set("endTime", slot.endTime);
|
|
76726
|
+
parsed.searchParams.set("resourceId", slot.resourceId);
|
|
76727
|
+
parsed.searchParams.set("nextDate", slot.nextDate);
|
|
76728
|
+
if (isAbsoluteUrl) {
|
|
76729
|
+
return parsed.toString();
|
|
76730
|
+
}
|
|
76731
|
+
return `${parsed.pathname}${parsed.search}${parsed.hash}`;
|
|
76732
|
+
} catch {
|
|
76733
|
+
return ctaUrl;
|
|
76734
|
+
}
|
|
76735
|
+
}
|
|
76736
|
+
function buildSlotCtaLabel(ctaText, slot) {
|
|
76737
|
+
return `${ctaText}: ${slot.weekdayLabel} ${slot.startTime} to ${slot.endTime}`;
|
|
76738
|
+
}
|
|
76739
|
+
function WeeklySlotAvailabilityView({
|
|
76740
|
+
availability,
|
|
76741
|
+
loading = false,
|
|
76742
|
+
error,
|
|
76743
|
+
emptyMessage,
|
|
76744
|
+
ctaText,
|
|
76745
|
+
ctaUrl
|
|
76746
|
+
}) {
|
|
76747
|
+
const slots = availability?.slots ?? [];
|
|
76748
|
+
const resolvedEmptyMessage = emptyMessage ?? "No regular weekly openings are currently available.";
|
|
76749
|
+
const resolvedCtaText = ctaText ?? "Enquire about this slot";
|
|
76750
|
+
const resolvedCtaUrl = typeof ctaUrl === "string" ? ctaUrl.trim() : "";
|
|
76751
|
+
return /* @__PURE__ */ jsxs("div", { className: "weekly-slot-availability", children: [
|
|
76752
|
+
loading ? /* @__PURE__ */ jsx("p", { className: "weekly-slot-availability__status", children: "Loading availability..." }) : null,
|
|
76753
|
+
error ? /* @__PURE__ */ jsx("p", { className: "weekly-slot-availability__status", role: "status", children: error }) : null,
|
|
76754
|
+
!loading && !error && slots.length === 0 ? /* @__PURE__ */ jsx("p", { className: "weekly-slot-availability__empty", children: resolvedEmptyMessage }) : null,
|
|
76755
|
+
slots.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "weekly-slot-availability__list", children: slots.map((slot) => /* @__PURE__ */ jsxs("li", { className: "weekly-slot-availability__item", children: [
|
|
76756
|
+
/* @__PURE__ */ jsxs("div", { className: "weekly-slot-availability__time", children: [
|
|
76757
|
+
/* @__PURE__ */ jsx("span", { className: "weekly-slot-availability__weekday", children: slot.weekdayLabel }),
|
|
76758
|
+
/* @__PURE__ */ jsxs("span", { className: "weekly-slot-availability__range", children: [
|
|
76759
|
+
slot.startTime,
|
|
76760
|
+
" - ",
|
|
76761
|
+
slot.endTime
|
|
76762
|
+
] })
|
|
76763
|
+
] }),
|
|
76764
|
+
/* @__PURE__ */ jsxs("p", { className: "weekly-slot-availability__meta", children: [
|
|
76765
|
+
"Available in ",
|
|
76766
|
+
pluralizeWeeks(slot.availableWeeks),
|
|
76767
|
+
". Next open date",
|
|
76768
|
+
" ",
|
|
76769
|
+
slot.nextDate,
|
|
76770
|
+
"."
|
|
76771
|
+
] }),
|
|
76772
|
+
resolvedCtaUrl ? /* @__PURE__ */ jsx(
|
|
76773
|
+
"a",
|
|
76774
|
+
{
|
|
76775
|
+
className: "weekly-slot-availability__cta",
|
|
76776
|
+
href: buildSlotCtaUrl(resolvedCtaUrl, slot),
|
|
76777
|
+
"aria-label": buildSlotCtaLabel(resolvedCtaText, slot),
|
|
76778
|
+
children: resolvedCtaText
|
|
76779
|
+
}
|
|
76780
|
+
) : null
|
|
76781
|
+
] }, slot.id)) }) : null
|
|
76782
|
+
] });
|
|
76783
|
+
}
|
|
76784
|
+
function WeeklySlotAvailabilitySSR(props2) {
|
|
76785
|
+
return /* @__PURE__ */ jsx(WeeklySlotAvailabilityView, { ...props2 });
|
|
76786
|
+
}
|
|
76787
|
+
var weekly_slot_availability_server_default = WeeklySlotAvailabilitySSR;
|
|
76113
76788
|
function VariantSelectView(props2) {
|
|
76114
76789
|
const { options, selectedVariantId, disabled = false, onChange } = props2;
|
|
76115
76790
|
if (options.length === 0) return null;
|
|
@@ -77744,6 +78419,7 @@ var serverComponentRegistry = {
|
|
|
77744
78419
|
"event-spotlight": EventSpotlight,
|
|
77745
78420
|
"event-combined": EventCombinedSSR,
|
|
77746
78421
|
"offerings-preview": offerings_preview_default,
|
|
78422
|
+
"weekly-slot-availability": weekly_slot_availability_server_default,
|
|
77747
78423
|
...runtimeBackedBlockServerRegistry
|
|
77748
78424
|
};
|
|
77749
78425
|
|
|
@@ -77802,14 +78478,14 @@ function isDecoratedHeadingBlockKind(blockKind) {
|
|
|
77802
78478
|
return blockKind === "block.intro" || blockKind === "block.feature-cards" || blockKind === "block.testimonials" || blockKind === "block.faq";
|
|
77803
78479
|
}
|
|
77804
78480
|
function readVariant(blockContent) {
|
|
77805
|
-
if (!
|
|
78481
|
+
if (!isRecord14(blockContent)) return void 0;
|
|
77806
78482
|
const variant = blockContent.variant;
|
|
77807
78483
|
return typeof variant === "string" ? variant : void 0;
|
|
77808
78484
|
}
|
|
77809
78485
|
function isFaqDecoratedVariant(variant) {
|
|
77810
78486
|
return variant === "default" || variant === "question-columns";
|
|
77811
78487
|
}
|
|
77812
|
-
function
|
|
78488
|
+
function isRecord14(value) {
|
|
77813
78489
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
77814
78490
|
}
|
|
77815
78491
|
function buildHeadingDecorationWrapperClassName(className) {
|
|
@@ -77834,8 +78510,8 @@ var META_PATH_TO_STORE_KEY = {
|
|
|
77834
78510
|
function mapMetaPathToStoreKey(path) {
|
|
77835
78511
|
return META_PATH_TO_STORE_KEY[path] ?? path;
|
|
77836
78512
|
}
|
|
77837
|
-
var
|
|
77838
|
-
var
|
|
78513
|
+
var PATH_SEPARATOR_REGEX2 = /\./g;
|
|
78514
|
+
var BRACKET_ACCESS_REGEX2 = /\[([^\]]+)\]/g;
|
|
77839
78515
|
function parseBracketToken(token) {
|
|
77840
78516
|
if (token.startsWith('"') || token.startsWith("'")) {
|
|
77841
78517
|
return token.slice(1, -1);
|
|
@@ -77852,7 +78528,7 @@ function extractSegmentsFromPart(part) {
|
|
|
77852
78528
|
if (baseMatch && baseMatch[1]) {
|
|
77853
78529
|
segments.push(baseMatch[1]);
|
|
77854
78530
|
}
|
|
77855
|
-
const bracketMatches = Array.from(part.matchAll(
|
|
78531
|
+
const bracketMatches = Array.from(part.matchAll(BRACKET_ACCESS_REGEX2));
|
|
77856
78532
|
const bracketSegments = bracketMatches.map((match2) => match2[1] ?? "").filter((token) => token.length > 0).map(parseBracketToken);
|
|
77857
78533
|
segments.push(...bracketSegments);
|
|
77858
78534
|
if (!baseMatch && !part.includes("[")) {
|
|
@@ -77861,9 +78537,9 @@ function extractSegmentsFromPart(part) {
|
|
|
77861
78537
|
return segments;
|
|
77862
78538
|
}
|
|
77863
78539
|
function splitPath(path) {
|
|
77864
|
-
return path.split(
|
|
78540
|
+
return path.split(PATH_SEPARATOR_REGEX2).flatMap(extractSegmentsFromPart).filter((segment) => segment !== "");
|
|
77865
78541
|
}
|
|
77866
|
-
function
|
|
78542
|
+
function segmentsToPath2(segments) {
|
|
77867
78543
|
if (!segments.length) return void 0;
|
|
77868
78544
|
return segments.map((s2) => String(s2)).join(".");
|
|
77869
78545
|
}
|
|
@@ -77879,10 +78555,32 @@ function previewEditableTargetToPath(target) {
|
|
|
77879
78555
|
return assertNever(target);
|
|
77880
78556
|
}
|
|
77881
78557
|
}
|
|
78558
|
+
function previewEditableTargetToFieldKey(target) {
|
|
78559
|
+
if (target.kind !== "block-field") return null;
|
|
78560
|
+
return {
|
|
78561
|
+
kind: "block-field",
|
|
78562
|
+
blockId: blockIdFromEditorPath(target.path),
|
|
78563
|
+
fieldPath: target.fieldPath
|
|
78564
|
+
};
|
|
78565
|
+
}
|
|
78566
|
+
function blockIdFromEditorPath(path) {
|
|
78567
|
+
const match2 = /^blocks\.([^.]+)\./.exec(path);
|
|
78568
|
+
return match2?.[1] ?? "";
|
|
78569
|
+
}
|
|
77882
78570
|
function previewEditableTargetFieldConstraints(target, context) {
|
|
77883
78571
|
if (target.kind !== "block-field") return void 0;
|
|
77884
78572
|
return context.fieldConstraints?.[target.fieldPath] ?? context.fieldConstraints?.[stripNumericPathSegments(target.fieldPath)];
|
|
77885
78573
|
}
|
|
78574
|
+
function propsWithAuthoringPlaceholder(props2, node) {
|
|
78575
|
+
const authoringPresence = conditionalAuthoringPresenceFor(node.$when?.authoringPresence);
|
|
78576
|
+
if (authoringPresence.kind !== "recover-empty-when-active") return props2;
|
|
78577
|
+
if (!authoringPresence.placeholder || typeof props2.placeholder === "string") return props2;
|
|
78578
|
+
return {
|
|
78579
|
+
...props2,
|
|
78580
|
+
placeholder: authoringPresence.placeholder,
|
|
78581
|
+
ariaLabel: typeof props2.ariaLabel === "string" ? props2.ariaLabel : authoringPresence.placeholder
|
|
78582
|
+
};
|
|
78583
|
+
}
|
|
77886
78584
|
function isIdentityBinding(binding) {
|
|
77887
78585
|
return binding.transforms.length === 0 && binding.fallback === void 0 && binding.coerce === void 0 && binding.pick === "value";
|
|
77888
78586
|
}
|
|
@@ -77896,7 +78594,7 @@ function derivePreviewLinkedEntryFieldBinding(node, parsedBinding, context) {
|
|
|
77896
78594
|
if (displaySegments.length === 0) return null;
|
|
77897
78595
|
const scoped = [...context.scopes].reverse().find((entry) => entry.name === scopeName);
|
|
77898
78596
|
if (!scoped) return null;
|
|
77899
|
-
const displayPath =
|
|
78597
|
+
const displayPath = segmentsToPath2(displaySegments);
|
|
77900
78598
|
if (!displayPath) return null;
|
|
77901
78599
|
const eligibility = resolveLinkedEntryInlineFieldEligibility({
|
|
77902
78600
|
entry: scoped.value,
|
|
@@ -78107,6 +78805,62 @@ function coerceBindingValue(value, binding) {
|
|
|
78107
78805
|
}
|
|
78108
78806
|
}
|
|
78109
78807
|
}
|
|
78808
|
+
function conditionalAuthoringPresenceFor(value) {
|
|
78809
|
+
return value ?? { kind: "visitor-only" };
|
|
78810
|
+
}
|
|
78811
|
+
function conditionalValuePresence(nodeType, value) {
|
|
78812
|
+
switch (nodeType) {
|
|
78813
|
+
case "text":
|
|
78814
|
+
return isTextConditionValueEmpty(value) ? { kind: "empty" } : { kind: "present" };
|
|
78815
|
+
case "richText":
|
|
78816
|
+
return isRichTextConditionValueEmpty(value) ? { kind: "empty" } : { kind: "present" };
|
|
78817
|
+
default:
|
|
78818
|
+
return value ? { kind: "present" } : { kind: "empty" };
|
|
78819
|
+
}
|
|
78820
|
+
}
|
|
78821
|
+
function isTextConditionValueEmpty(value) {
|
|
78822
|
+
const inlineText = parseInlineTextFromUnknown(value);
|
|
78823
|
+
if (inlineText.ok) {
|
|
78824
|
+
return inlineTextToPlainText(inlineText.value).trim().length === 0;
|
|
78825
|
+
}
|
|
78826
|
+
if (typeof value === "string") return value.trim().length === 0;
|
|
78827
|
+
if (value === null || value === void 0) return true;
|
|
78828
|
+
return !value;
|
|
78829
|
+
}
|
|
78830
|
+
function isRichTextConditionValueEmpty(value) {
|
|
78831
|
+
const root = unwrapRichTextRoot(value);
|
|
78832
|
+
if (typeof root === "string") return root.trim().length === 0;
|
|
78833
|
+
if (!isTipTapNode(root)) return root === null || root === void 0 || !root;
|
|
78834
|
+
return richTextPlainText(root).trim().length === 0;
|
|
78835
|
+
}
|
|
78836
|
+
function isTipTapNode(value) {
|
|
78837
|
+
return isPlainObject3(value) && typeof value.type === "string";
|
|
78838
|
+
}
|
|
78839
|
+
function richTextPlainText(node) {
|
|
78840
|
+
const ownText = typeof node.text === "string" ? node.text : "";
|
|
78841
|
+
const childText = (node.content ?? []).map(richTextPlainText).join("");
|
|
78842
|
+
return ownText + childText;
|
|
78843
|
+
}
|
|
78844
|
+
function planConditionalNodeRender(input) {
|
|
78845
|
+
if (input.conditionMatched) {
|
|
78846
|
+
return { kind: "render", reason: "condition-passed" };
|
|
78847
|
+
}
|
|
78848
|
+
if (input.authoringPresence.kind !== "recover-empty-when-active" || !input.conditionUsesPresenceSemantics || input.conditionPresence.kind !== "empty") {
|
|
78849
|
+
return { kind: "skip", reason: "condition-failed" };
|
|
78850
|
+
}
|
|
78851
|
+
if (!input.editableTarget) {
|
|
78852
|
+
return { kind: "skip", reason: "not-editable" };
|
|
78853
|
+
}
|
|
78854
|
+
if (!previewAuthoringFieldsEqual(input.editableTarget, input.authoringContext?.activeField ?? null)) {
|
|
78855
|
+
return { kind: "skip", reason: "inactive-authoring-context" };
|
|
78856
|
+
}
|
|
78857
|
+
return { kind: "render", reason: "authoring-presence" };
|
|
78858
|
+
}
|
|
78859
|
+
function previewAuthoringFieldsEqual(left, right) {
|
|
78860
|
+
return Boolean(
|
|
78861
|
+
right && left.kind === right.kind && left.blockId === right.blockId && left.fieldPath === right.fieldPath
|
|
78862
|
+
);
|
|
78863
|
+
}
|
|
78110
78864
|
function resolveBindingValue(binding, context) {
|
|
78111
78865
|
const fullPath = binding.from;
|
|
78112
78866
|
const segments = splitPath(fullPath);
|
|
@@ -78171,9 +78925,23 @@ function shouldRenderNode(node, context) {
|
|
|
78171
78925
|
const binding = parseBinding(node.$when.when, "$when");
|
|
78172
78926
|
const value = resolveBindingValue(binding, context);
|
|
78173
78927
|
const equals = node.$when.equals;
|
|
78174
|
-
const
|
|
78175
|
-
const
|
|
78176
|
-
|
|
78928
|
+
const conditionPresence = conditionalValuePresence(node.type, value);
|
|
78929
|
+
const usesPresenceSemantics = typeof equals === "undefined" && !node.$when.not;
|
|
78930
|
+
const matches2 = typeof equals === "undefined" ? conditionPresence.kind === "present" : value === equals;
|
|
78931
|
+
const conditionMatched = node.$when.not ? !matches2 : matches2;
|
|
78932
|
+
const parsedNodeBinding = node.$bind ? parseBinding(node.$bind, "$bind") : void 0;
|
|
78933
|
+
const editableTarget = node.type === "text" || node.type === "richText" ? previewEditableTargetToFieldKey(
|
|
78934
|
+
derivePreviewTextEditableTarget(parsedNodeBinding, context)
|
|
78935
|
+
) : null;
|
|
78936
|
+
const decision = planConditionalNodeRender({
|
|
78937
|
+
conditionMatched,
|
|
78938
|
+
conditionPresence,
|
|
78939
|
+
conditionUsesPresenceSemantics: usesPresenceSemantics,
|
|
78940
|
+
authoringPresence: conditionalAuthoringPresenceFor(node.$when.authoringPresence),
|
|
78941
|
+
editableTarget,
|
|
78942
|
+
authoringContext: context.previewAuthoring
|
|
78943
|
+
});
|
|
78944
|
+
return decision.kind === "render";
|
|
78177
78945
|
}
|
|
78178
78946
|
function applyScopes(node, context) {
|
|
78179
78947
|
if (!node.$scopes) return context;
|
|
@@ -78293,7 +79061,7 @@ function resolveBindingToEditorPath(fieldName, bindings, editableRouteMetadataFi
|
|
|
78293
79061
|
function derivePreviewTextEditableTarget(parsedBinding, context) {
|
|
78294
79062
|
if (!parsedBinding) return { kind: "read-only", reason: "missing-binding" };
|
|
78295
79063
|
const abs = getAbsoluteSegments(parsedBinding.from, context);
|
|
78296
|
-
const absolutePath = abs ?
|
|
79064
|
+
const absolutePath = abs ? segmentsToPath2(abs) : void 0;
|
|
78297
79065
|
if (!absolutePath) return { kind: "read-only", reason: "unresolved-binding" };
|
|
78298
79066
|
if (absolutePath !== "content" && !absolutePath.startsWith("content.")) {
|
|
78299
79067
|
return { kind: "read-only", reason: "non-content-binding" };
|
|
@@ -78323,31 +79091,32 @@ function derivePreviewTextEditableTarget(parsedBinding, context) {
|
|
|
78323
79091
|
}
|
|
78324
79092
|
function injectEditorPath(props2, node, parsedBinding, context) {
|
|
78325
79093
|
if (node.type !== "text" && node.type !== "richText") return props2;
|
|
79094
|
+
const propsWithPlaceholder = propsWithAuthoringPlaceholder(props2, node);
|
|
78326
79095
|
const linkedEntryField = derivePreviewLinkedEntryFieldBinding(
|
|
78327
79096
|
node,
|
|
78328
79097
|
parsedBinding,
|
|
78329
79098
|
context
|
|
78330
79099
|
);
|
|
78331
79100
|
if (linkedEntryField) {
|
|
78332
|
-
return { ...
|
|
79101
|
+
return { ...propsWithPlaceholder, linkedEntryField };
|
|
78333
79102
|
}
|
|
78334
79103
|
const editableTarget = derivePreviewTextEditableTarget(parsedBinding, context);
|
|
78335
79104
|
const path = previewEditableTargetToPath(editableTarget);
|
|
78336
|
-
if (!path) return
|
|
79105
|
+
if (!path) return propsWithPlaceholder;
|
|
78337
79106
|
if (node.type === "text") {
|
|
78338
79107
|
const constraints = previewEditableTargetFieldConstraints(
|
|
78339
79108
|
editableTarget,
|
|
78340
79109
|
context
|
|
78341
79110
|
);
|
|
78342
|
-
return constraints ? { ...
|
|
79111
|
+
return constraints ? { ...propsWithPlaceholder, path, ...constraints } : { ...propsWithPlaceholder, path };
|
|
78343
79112
|
}
|
|
78344
|
-
return { ...
|
|
79113
|
+
return { ...propsWithPlaceholder, path };
|
|
78345
79114
|
}
|
|
78346
79115
|
function injectMediaSlotPath(props2, node, parsedBinding, context) {
|
|
78347
79116
|
if (!parsedBinding) return props2;
|
|
78348
79117
|
if (node.type !== "media") return props2;
|
|
78349
79118
|
const abs = getAbsoluteSegments(parsedBinding.from, context);
|
|
78350
|
-
const absolutePath = abs ?
|
|
79119
|
+
const absolutePath = abs ? segmentsToPath2(abs) : void 0;
|
|
78351
79120
|
if (!absolutePath) return props2;
|
|
78352
79121
|
if (absolutePath !== "content" && !absolutePath.startsWith("content.")) {
|
|
78353
79122
|
return props2;
|
|
@@ -78433,7 +79202,8 @@ function resolveNode2(node, context, indexFallback) {
|
|
|
78433
79202
|
blockKind: context.blockKind,
|
|
78434
79203
|
blockContent: context.blockContent,
|
|
78435
79204
|
...node.type === "media" && context.imageResolveContext ? { imageResolveContext: context.imageResolveContext } : {},
|
|
78436
|
-
fragmentRegistry: context.fragmentRegistry
|
|
79205
|
+
fragmentRegistry: context.fragmentRegistry,
|
|
79206
|
+
previewAuthoring: context.previewAuthoring
|
|
78437
79207
|
};
|
|
78438
79208
|
const element = React61__default.createElement(component, elementProps, ...children);
|
|
78439
79209
|
if (headingDecorationPlan.kind === "skip") {
|
|
@@ -78765,6 +79535,7 @@ function collectNestedPreviewFieldConstraintEntries(field, path) {
|
|
|
78765
79535
|
case "datetime":
|
|
78766
79536
|
case "entryPicker":
|
|
78767
79537
|
case "file":
|
|
79538
|
+
case "inlineText":
|
|
78768
79539
|
case "link":
|
|
78769
79540
|
case "media":
|
|
78770
79541
|
case "number":
|
|
@@ -78797,7 +79568,8 @@ function makeDefaultBlockComponent(args) {
|
|
|
78797
79568
|
blockBindings,
|
|
78798
79569
|
editableRouteMetadataFieldIds,
|
|
78799
79570
|
fragmentRegistry: fragmentRegistry2,
|
|
78800
|
-
imageResolveContext
|
|
79571
|
+
imageResolveContext,
|
|
79572
|
+
previewAuthoring
|
|
78801
79573
|
}) {
|
|
78802
79574
|
const perfEnv = globalThis.process?.env;
|
|
78803
79575
|
const perfEnabled = perfEnv?.DEBUG_PERF === "1" && typeof window === "undefined";
|
|
@@ -78857,7 +79629,8 @@ function makeDefaultBlockComponent(args) {
|
|
|
78857
79629
|
editableRouteMetadataFieldIds,
|
|
78858
79630
|
fragmentRegistry: fragmentRegistry2,
|
|
78859
79631
|
fieldConstraints,
|
|
78860
|
-
imageResolveContext
|
|
79632
|
+
imageResolveContext,
|
|
79633
|
+
previewAuthoring
|
|
78861
79634
|
});
|
|
78862
79635
|
if (perfStart) {
|
|
78863
79636
|
const durationMs = Date.now() - perfStart;
|
|
@@ -82853,7 +83626,8 @@ function PageRenderer({
|
|
|
82853
83626
|
routeMap,
|
|
82854
83627
|
blockOverrides,
|
|
82855
83628
|
sdkConfig,
|
|
82856
|
-
customBlocks
|
|
83629
|
+
customBlocks,
|
|
83630
|
+
previewAuthoring
|
|
82857
83631
|
}) {
|
|
82858
83632
|
const imageResolveContext = React61.useMemo(
|
|
82859
83633
|
() => resolvePageRendererImageResolveContext(dataContext),
|
|
@@ -82892,7 +83666,8 @@ function PageRenderer({
|
|
|
82892
83666
|
blockOverrides,
|
|
82893
83667
|
sdkConfig,
|
|
82894
83668
|
customBlocks,
|
|
82895
|
-
imageResolveContext
|
|
83669
|
+
imageResolveContext,
|
|
83670
|
+
previewAuthoring
|
|
82896
83671
|
};
|
|
82897
83672
|
if (!shouldUseWrapper) {
|
|
82898
83673
|
return /* @__PURE__ */ jsx(MemoBlockSection, { ...blockSectionProps }, blockKey);
|
|
@@ -83013,7 +83788,8 @@ var MemoBlockSection = React61.memo(
|
|
|
83013
83788
|
blockOverrides,
|
|
83014
83789
|
sdkConfig,
|
|
83015
83790
|
customBlocks,
|
|
83016
|
-
imageResolveContext
|
|
83791
|
+
imageResolveContext,
|
|
83792
|
+
previewAuthoring
|
|
83017
83793
|
}) {
|
|
83018
83794
|
const perfEnv = globalThis.process?.env?.DEBUG_PERF;
|
|
83019
83795
|
const perfStart = perfEnv === "1" && typeof window === "undefined" ? Date.now() : 0;
|
|
@@ -83232,7 +84008,8 @@ var MemoBlockSection = React61.memo(
|
|
|
83232
84008
|
editableRouteMetadataFieldIds: dataContext?.editableRouteMetadataFieldIds ?? void 0,
|
|
83233
84009
|
viewModelOverrides: rootContext,
|
|
83234
84010
|
fragmentRegistry: fragmentRegistry2,
|
|
83235
|
-
imageResolveContext: resolvedImageResolveContext
|
|
84011
|
+
imageResolveContext: resolvedImageResolveContext,
|
|
84012
|
+
previewAuthoring
|
|
83236
84013
|
}
|
|
83237
84014
|
);
|
|
83238
84015
|
}
|
|
@@ -83253,7 +84030,7 @@ var MemoBlockSection = React61.memo(
|
|
|
83253
84030
|
}
|
|
83254
84031
|
},
|
|
83255
84032
|
(prev, next) => {
|
|
83256
|
-
return prev.block === next.block && prev.registry === next.registry && prev.dataContext === next.dataContext && prev.themeTokens === next.themeTokens && prev.themeConfig === next.themeConfig && prev.routeMap === next.routeMap && prev.usePlaceholders === next.usePlaceholders && prev.wrapBlock === next.wrapBlock && prev.blockOverrides === next.blockOverrides && prev.sdkConfig === next.sdkConfig && prev.customBlocks === next.customBlocks && prev.imageResolveContext === next.imageResolveContext;
|
|
84033
|
+
return prev.block === next.block && prev.registry === next.registry && prev.dataContext === next.dataContext && prev.themeTokens === next.themeTokens && prev.themeConfig === next.themeConfig && prev.routeMap === next.routeMap && prev.usePlaceholders === next.usePlaceholders && prev.wrapBlock === next.wrapBlock && prev.blockOverrides === next.blockOverrides && prev.sdkConfig === next.sdkConfig && prev.customBlocks === next.customBlocks && prev.imageResolveContext === next.imageResolveContext && prev.previewAuthoring === next.previewAuthoring;
|
|
83257
84034
|
}
|
|
83258
84035
|
);
|
|
83259
84036
|
function fallback(message2) {
|
|
@@ -90233,6 +91010,49 @@ var containerResponsiveThemeCss = `/*
|
|
|
90233
91010
|
margin-top: 0.5rem;
|
|
90234
91011
|
}
|
|
90235
91012
|
|
|
91013
|
+
/* =============================================================================
|
|
91014
|
+
* Shared: Inline Text Marks
|
|
91015
|
+
* =============================================================================
|
|
91016
|
+
*/
|
|
91017
|
+
|
|
91018
|
+
:where(.theme-scope) .rb-inline-text-accent,
|
|
91019
|
+
:where(.theme-scope) .rb-inline-text-highlight {
|
|
91020
|
+
font: inherit;
|
|
91021
|
+
letter-spacing: inherit;
|
|
91022
|
+
text-transform: inherit;
|
|
91023
|
+
}
|
|
91024
|
+
|
|
91025
|
+
:where(.theme-scope) .rb-inline-text-accent-accent {
|
|
91026
|
+
color: rgb(var(--tb-accent));
|
|
91027
|
+
}
|
|
91028
|
+
|
|
91029
|
+
:where(.theme-scope) .rb-inline-text-accent-brand {
|
|
91030
|
+
color: rgb(var(--tb-primary));
|
|
91031
|
+
}
|
|
91032
|
+
|
|
91033
|
+
:where(.theme-scope) .rb-inline-text-accent-contrast {
|
|
91034
|
+
color: var(--section-text-color, rgb(var(--tb-text)));
|
|
91035
|
+
}
|
|
91036
|
+
|
|
91037
|
+
:where(.theme-scope) .rb-inline-text-highlight {
|
|
91038
|
+
border-radius: 0.22em;
|
|
91039
|
+
box-decoration-break: clone;
|
|
91040
|
+
-webkit-box-decoration-break: clone;
|
|
91041
|
+
padding: 0.02em 0.12em;
|
|
91042
|
+
}
|
|
91043
|
+
|
|
91044
|
+
:where(.theme-scope) .rb-inline-text-highlight-soft {
|
|
91045
|
+
background: color-mix(in oklab, var(--section-text-color, rgb(var(--tb-text))) 14%, transparent);
|
|
91046
|
+
}
|
|
91047
|
+
|
|
91048
|
+
:where(.theme-scope) .rb-inline-text-highlight-accent {
|
|
91049
|
+
background: color-mix(in oklab, rgb(var(--tb-accent)) 28%, transparent);
|
|
91050
|
+
}
|
|
91051
|
+
|
|
91052
|
+
:where(.theme-scope) .rb-inline-text-highlight-brand {
|
|
91053
|
+
background: color-mix(in oklab, rgb(var(--tb-primary)) 24%, transparent);
|
|
91054
|
+
}
|
|
91055
|
+
|
|
90236
91056
|
/* =============================================================================
|
|
90237
91057
|
* Block: Hero (Phase 2)
|
|
90238
91058
|
* Uses theme palette vars directly (no Tier 3 vars needed)
|
|
@@ -94943,14 +95763,21 @@ function coercePayload(payload) {
|
|
|
94943
95763
|
|
|
94944
95764
|
// ../blocks/src/system/data/prefetchBlockData.ts
|
|
94945
95765
|
async function prefetchBlockData(page, context, options) {
|
|
94946
|
-
const {
|
|
95766
|
+
const {
|
|
95767
|
+
apiClient,
|
|
95768
|
+
isValidEndpoint,
|
|
95769
|
+
onError,
|
|
95770
|
+
getCustomBlockLoaders,
|
|
95771
|
+
getBlockDefinition: getBlockDefinition2 = getBlockDefinition,
|
|
95772
|
+
resolveParamsBindings: resolveParamsBindings2 = resolveParamsBindings
|
|
95773
|
+
} = options;
|
|
94947
95774
|
const results = {};
|
|
94948
95775
|
const tasks = [];
|
|
94949
95776
|
for (const block of page.blocks) {
|
|
94950
95777
|
const blockId = block.id;
|
|
94951
95778
|
if (!blockId) continue;
|
|
94952
95779
|
let loaders;
|
|
94953
|
-
const def =
|
|
95780
|
+
const def = getBlockDefinition2(block.kind);
|
|
94954
95781
|
if (def) {
|
|
94955
95782
|
loaders = normalizeDataLoaders(def);
|
|
94956
95783
|
} else if (getCustomBlockLoaders) {
|
|
@@ -94973,14 +95800,14 @@ async function prefetchBlockData(page, context, options) {
|
|
|
94973
95800
|
continue;
|
|
94974
95801
|
}
|
|
94975
95802
|
if (typeof loader.when !== "undefined") {
|
|
94976
|
-
const resolvedWhen =
|
|
95803
|
+
const resolvedWhen = resolveParamsBindings2(loader.when, vm, {
|
|
94977
95804
|
blockKind: block.kind
|
|
94978
95805
|
});
|
|
94979
95806
|
if (resolvedWhen !== true) {
|
|
94980
95807
|
continue;
|
|
94981
95808
|
}
|
|
94982
95809
|
}
|
|
94983
|
-
const rawParams =
|
|
95810
|
+
const rawParams = resolveParamsBindings2(loader.params, vm, {
|
|
94984
95811
|
blockKind: block.kind
|
|
94985
95812
|
});
|
|
94986
95813
|
const params = normalizeParams(rawParams);
|
|
@@ -95023,7 +95850,8 @@ var SUPPORTED_LOADER_ENDPOINTS = [
|
|
|
95023
95850
|
"listPublicPasses",
|
|
95024
95851
|
"listPublicMemberships",
|
|
95025
95852
|
"getPublicFormById",
|
|
95026
|
-
"getPublicBookingServices"
|
|
95853
|
+
"getPublicBookingServices",
|
|
95854
|
+
"getPublicWeeklySlotAvailability"
|
|
95027
95855
|
];
|
|
95028
95856
|
function isSupportedLoaderEndpoint(endpoint) {
|
|
95029
95857
|
return SUPPORTED_LOADER_ENDPOINTS.includes(endpoint);
|
|
@@ -95175,6 +96003,10 @@ function normalizeLoaderParams(endpoint, params, context) {
|
|
|
95175
96003
|
ensureSiteId(out, context);
|
|
95176
96004
|
return out;
|
|
95177
96005
|
}
|
|
96006
|
+
if (endpoint === "getPublicWeeklySlotAvailability") {
|
|
96007
|
+
ensureSiteId(out, context);
|
|
96008
|
+
return out;
|
|
96009
|
+
}
|
|
95178
96010
|
if (endpoint === "listPublicEvents") {
|
|
95179
96011
|
ensureSiteId(out, context);
|
|
95180
96012
|
return out;
|
|
@@ -95521,14 +96353,14 @@ function backgroundCapabilityFromModes(modeCapabilities) {
|
|
|
95521
96353
|
};
|
|
95522
96354
|
}
|
|
95523
96355
|
function parseBackgroundOverrideFromContent(content) {
|
|
95524
|
-
const sectionStyles =
|
|
96356
|
+
const sectionStyles = isRecord15(content._sectionStyles) ? content._sectionStyles : null;
|
|
95525
96357
|
return parseBackgroundOverride(sectionStyles?.background);
|
|
95526
96358
|
}
|
|
95527
96359
|
function parseBackgroundOverride(value) {
|
|
95528
96360
|
if (value === null || value === void 0) {
|
|
95529
96361
|
return { kind: "supported", override: DEFAULT_BACKGROUND_OVERRIDE };
|
|
95530
96362
|
}
|
|
95531
|
-
if (!
|
|
96363
|
+
if (!isRecord15(value)) {
|
|
95532
96364
|
return { kind: "legacy", reason: "unsupported-shape", background: {} };
|
|
95533
96365
|
}
|
|
95534
96366
|
if (Object.keys(value).length === 0) {
|
|
@@ -95609,7 +96441,7 @@ function serializeBackgroundOverride(override) {
|
|
|
95609
96441
|
}
|
|
95610
96442
|
}
|
|
95611
96443
|
function applyBackgroundOverrideContentPatch(content, override) {
|
|
95612
|
-
const sectionStyles =
|
|
96444
|
+
const sectionStyles = isRecord15(content._sectionStyles) ? content._sectionStyles : {};
|
|
95613
96445
|
const serialized = serializeBackgroundOverride(override);
|
|
95614
96446
|
if (serialized === null) {
|
|
95615
96447
|
const nextSectionStyles = omitRecordKey2(sectionStyles, "background");
|
|
@@ -95811,7 +96643,7 @@ function imageAllowed(mediaId, pool) {
|
|
|
95811
96643
|
return pool?.some((item) => item.mediaId === mediaId) ?? false;
|
|
95812
96644
|
}
|
|
95813
96645
|
function parseImageMediaAssetId(value) {
|
|
95814
|
-
if (!
|
|
96646
|
+
if (!isRecord15(value)) return { kind: "missing" };
|
|
95815
96647
|
if (value.type !== void 0 && value.type !== "image") return { kind: "missing" };
|
|
95816
96648
|
const parsed = parseMediaAssetId(value.assetId);
|
|
95817
96649
|
if (!parsed.ok) {
|
|
@@ -95859,116 +96691,9 @@ function omitRecordKey2(content, key) {
|
|
|
95859
96691
|
Object.entries(content).filter(([entryKey]) => entryKey !== key)
|
|
95860
96692
|
);
|
|
95861
96693
|
}
|
|
95862
|
-
function isRecord14(value) {
|
|
95863
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95864
|
-
}
|
|
95865
|
-
|
|
95866
|
-
// ../path-utils/src/index.ts
|
|
95867
|
-
var PATH_SEPARATOR_REGEX2 = /\./g;
|
|
95868
|
-
var BRACKET_ACCESS_REGEX2 = /\[([^\]]+)\]/g;
|
|
95869
96694
|
function isRecord15(value) {
|
|
95870
96695
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95871
96696
|
}
|
|
95872
|
-
function isPathContainer(value) {
|
|
95873
|
-
return Array.isArray(value) || isRecord15(value);
|
|
95874
|
-
}
|
|
95875
|
-
function createPathContainer(nextIsIndex) {
|
|
95876
|
-
return nextIsIndex ? [] : {};
|
|
95877
|
-
}
|
|
95878
|
-
function getContainerValue(container, segment) {
|
|
95879
|
-
if (typeof segment === "number") {
|
|
95880
|
-
return Array.isArray(container) ? container[segment] : void 0;
|
|
95881
|
-
}
|
|
95882
|
-
if (segment in container) {
|
|
95883
|
-
return Reflect.get(container, segment);
|
|
95884
|
-
}
|
|
95885
|
-
return void 0;
|
|
95886
|
-
}
|
|
95887
|
-
function ensureContainerProperty(container, key, nextIsIndex) {
|
|
95888
|
-
const existing = Reflect.get(container, key);
|
|
95889
|
-
if (isPathContainer(existing)) {
|
|
95890
|
-
return existing;
|
|
95891
|
-
}
|
|
95892
|
-
const nextContainer = createPathContainer(nextIsIndex);
|
|
95893
|
-
Reflect.set(container, key, nextContainer);
|
|
95894
|
-
return nextContainer;
|
|
95895
|
-
}
|
|
95896
|
-
function parsePath(path) {
|
|
95897
|
-
if (Array.isArray(path)) return path;
|
|
95898
|
-
const segments = [];
|
|
95899
|
-
const parts = path.split(PATH_SEPARATOR_REGEX2);
|
|
95900
|
-
for (const raw of parts) {
|
|
95901
|
-
if (!raw) continue;
|
|
95902
|
-
const baseMatch = raw.match(/^[^\[]+/);
|
|
95903
|
-
if (baseMatch !== null) {
|
|
95904
|
-
const base2 = baseMatch[1] ?? baseMatch[0];
|
|
95905
|
-
if (/^\d+$/.test(base2)) {
|
|
95906
|
-
segments.push(Number(base2));
|
|
95907
|
-
} else {
|
|
95908
|
-
segments.push(base2);
|
|
95909
|
-
}
|
|
95910
|
-
}
|
|
95911
|
-
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX2);
|
|
95912
|
-
for (const match2 of bracketMatches) {
|
|
95913
|
-
const token = match2[1] ?? "";
|
|
95914
|
-
if (token.startsWith('"') || token.startsWith("'")) {
|
|
95915
|
-
segments.push(token.slice(1, -1));
|
|
95916
|
-
} else if (/^\d+$/.test(token)) {
|
|
95917
|
-
segments.push(Number(token));
|
|
95918
|
-
} else {
|
|
95919
|
-
segments.push(token);
|
|
95920
|
-
}
|
|
95921
|
-
}
|
|
95922
|
-
if (baseMatch === null && !raw.includes("[")) {
|
|
95923
|
-
segments.push(raw);
|
|
95924
|
-
}
|
|
95925
|
-
}
|
|
95926
|
-
return segments;
|
|
95927
|
-
}
|
|
95928
|
-
function getAtPath(source, path) {
|
|
95929
|
-
const segments = parsePath(path);
|
|
95930
|
-
return segments.reduce((current, segment) => {
|
|
95931
|
-
if (current === void 0 || current === null) return void 0;
|
|
95932
|
-
if (!isPathContainer(current)) return void 0;
|
|
95933
|
-
return getContainerValue(current, segment);
|
|
95934
|
-
}, source);
|
|
95935
|
-
}
|
|
95936
|
-
function setAtPath(target, path, value) {
|
|
95937
|
-
const segments = parsePath(path);
|
|
95938
|
-
let current = target;
|
|
95939
|
-
for (let index2 = 0; index2 < segments.length; index2 += 1) {
|
|
95940
|
-
const segment = segments[index2];
|
|
95941
|
-
if (segment === void 0) continue;
|
|
95942
|
-
const isLast = index2 === segments.length - 1;
|
|
95943
|
-
const nextIsIndex = typeof segments[index2 + 1] === "number";
|
|
95944
|
-
if (isLast) {
|
|
95945
|
-
if (typeof segment === "number") {
|
|
95946
|
-
if (Array.isArray(current)) {
|
|
95947
|
-
current[segment] = value;
|
|
95948
|
-
}
|
|
95949
|
-
} else {
|
|
95950
|
-
Reflect.set(current, segment, value);
|
|
95951
|
-
}
|
|
95952
|
-
return;
|
|
95953
|
-
}
|
|
95954
|
-
if (typeof segment === "number") {
|
|
95955
|
-
if (Array.isArray(current)) {
|
|
95956
|
-
const existing = current[segment];
|
|
95957
|
-
if (isPathContainer(existing)) {
|
|
95958
|
-
current = existing;
|
|
95959
|
-
} else {
|
|
95960
|
-
const nextContainer = createPathContainer(nextIsIndex);
|
|
95961
|
-
current[segment] = nextContainer;
|
|
95962
|
-
current = nextContainer;
|
|
95963
|
-
}
|
|
95964
|
-
continue;
|
|
95965
|
-
}
|
|
95966
|
-
current = ensureContainerProperty(current, String(segment), nextIsIndex);
|
|
95967
|
-
continue;
|
|
95968
|
-
}
|
|
95969
|
-
current = ensureContainerProperty(current, segment, nextIsIndex);
|
|
95970
|
-
}
|
|
95971
|
-
}
|
|
95972
96697
|
|
|
95973
96698
|
// ../content-editor/src/linkedEntries/domain.ts
|
|
95974
96699
|
function unsafeAsLinkedContentEntryId(value) {
|
|
@@ -124307,6 +125032,7 @@ function toManifestFieldInput(field) {
|
|
|
124307
125032
|
case "button":
|
|
124308
125033
|
throw new Error("Button fields do not have canonical content validation");
|
|
124309
125034
|
case "text":
|
|
125035
|
+
case "inlineText":
|
|
124310
125036
|
case "richText":
|
|
124311
125037
|
case "media":
|
|
124312
125038
|
case "file":
|
|
@@ -124661,6 +125387,17 @@ function getRichTextFieldDefaultValue(_config) {
|
|
|
124661
125387
|
return EMPTY_RICH_TEXT_DOC;
|
|
124662
125388
|
}
|
|
124663
125389
|
|
|
125390
|
+
// ../block-form/src/widgets/InlineTextField/inlineTextFieldSchema.ts
|
|
125391
|
+
function buildInlineTextFieldSchema(field) {
|
|
125392
|
+
return buildCanonicalFieldSchema(field);
|
|
125393
|
+
}
|
|
125394
|
+
|
|
125395
|
+
// ../block-form/src/widgets/InlineTextField/inlineTextFieldDefaults.ts
|
|
125396
|
+
function getInlineTextFieldDefaultValue(field) {
|
|
125397
|
+
if (field.defaultValue !== void 0) return field.defaultValue;
|
|
125398
|
+
return field.required ? plainTextToInlineText(field.label) : [];
|
|
125399
|
+
}
|
|
125400
|
+
|
|
124664
125401
|
// ../block-form/src/widgets/MediaField/mediaFieldSchema.ts
|
|
124665
125402
|
function buildMediaFieldSchema(config) {
|
|
124666
125403
|
return buildCanonicalFieldSchema(config);
|
|
@@ -124771,6 +125508,7 @@ var SCHEMA_BUILDERS = {
|
|
|
124771
125508
|
slug: buildSlugFieldSchema,
|
|
124772
125509
|
link: buildLinkFieldSchema,
|
|
124773
125510
|
richText: buildRichTextFieldSchema,
|
|
125511
|
+
inlineText: buildInlineTextFieldSchema,
|
|
124774
125512
|
media: buildMediaFieldSchema,
|
|
124775
125513
|
file: buildMediaFieldSchema,
|
|
124776
125514
|
tabGroup: buildTabGroupFieldSchema,
|
|
@@ -124794,6 +125532,7 @@ var DEFAULT_VALUE_BUILDERS = {
|
|
|
124794
125532
|
slug: getSlugFieldDefault,
|
|
124795
125533
|
link: getLinkFieldDefault,
|
|
124796
125534
|
richText: getRichTextFieldDefaultValue,
|
|
125535
|
+
inlineText: getInlineTextFieldDefaultValue,
|
|
124797
125536
|
media: getMediaFieldDefaultValue,
|
|
124798
125537
|
file: getMediaFieldDefaultValue,
|
|
124799
125538
|
tabGroup: getTabGroupFieldDefault,
|
|
@@ -124933,6 +125672,7 @@ function shouldUseCanonicalSchema(field) {
|
|
|
124933
125672
|
case "media":
|
|
124934
125673
|
case "file":
|
|
124935
125674
|
case "reference":
|
|
125675
|
+
case "inlineText":
|
|
124936
125676
|
return true;
|
|
124937
125677
|
case "group":
|
|
124938
125678
|
return getGroupChildFields(field).every(shouldUseCanonicalSchema);
|
|
@@ -126377,6 +127117,10 @@ var BOOKINGS = {
|
|
|
126377
127117
|
path: "/public/bookings/availability/slots",
|
|
126378
127118
|
method: "GET"
|
|
126379
127119
|
},
|
|
127120
|
+
getWeeklySlotAvailability: {
|
|
127121
|
+
path: "/public/bookings/weekly-slot-availability",
|
|
127122
|
+
method: "GET"
|
|
127123
|
+
},
|
|
126380
127124
|
getAvailableDates: {
|
|
126381
127125
|
path: "/public/bookings/availability/dates",
|
|
126382
127126
|
method: "GET"
|
|
@@ -126919,6 +127663,18 @@ function createBlockApi(config) {
|
|
|
126919
127663
|
}
|
|
126920
127664
|
});
|
|
126921
127665
|
},
|
|
127666
|
+
async getWeeklySlotAvailability(params) {
|
|
127667
|
+
const sid = requireSiteId();
|
|
127668
|
+
return request(BOOKINGS.getWeeklySlotAvailability, {
|
|
127669
|
+
query: {
|
|
127670
|
+
siteId: sid,
|
|
127671
|
+
serviceId: params.serviceId,
|
|
127672
|
+
resourceId: params.resourceId,
|
|
127673
|
+
horizonWeeks: params.horizonWeeks,
|
|
127674
|
+
timezone: params.timezone
|
|
127675
|
+
}
|
|
127676
|
+
});
|
|
127677
|
+
},
|
|
126922
127678
|
async getAvailableDates(params) {
|
|
126923
127679
|
const sid = requireSiteId();
|
|
126924
127680
|
return request(BOOKINGS.getAvailableDates, {
|
|
@@ -129962,8 +130718,18 @@ function usePolling(config) {
|
|
|
129962
130718
|
}
|
|
129963
130719
|
|
|
129964
130720
|
// ../blocks/src/system/runtime/hooks/useAppointmentCheckoutVerification.ts
|
|
130721
|
+
var appointmentCheckoutVerificationDeps = {
|
|
130722
|
+
useBlockApi,
|
|
130723
|
+
usePolling
|
|
130724
|
+
};
|
|
129965
130725
|
function useAppointmentCheckoutVerification(config) {
|
|
129966
|
-
|
|
130726
|
+
return useAppointmentCheckoutVerificationWithDeps(
|
|
130727
|
+
config,
|
|
130728
|
+
appointmentCheckoutVerificationDeps
|
|
130729
|
+
);
|
|
130730
|
+
}
|
|
130731
|
+
function useAppointmentCheckoutVerificationWithDeps(config, deps) {
|
|
130732
|
+
const api = deps.useBlockApi();
|
|
129967
130733
|
const pollingConfig = useMemo(() => {
|
|
129968
130734
|
if (!config) return null;
|
|
129969
130735
|
return {
|
|
@@ -129974,7 +130740,7 @@ function useAppointmentCheckoutVerification(config) {
|
|
|
129974
130740
|
interval: config.pollInterval
|
|
129975
130741
|
};
|
|
129976
130742
|
}, [api, config]);
|
|
129977
|
-
const polling = usePolling(pollingConfig);
|
|
130743
|
+
const polling = deps.usePolling(pollingConfig);
|
|
129978
130744
|
const state = resolveAppointmentCheckoutVerificationState({
|
|
129979
130745
|
config,
|
|
129980
130746
|
pollingStatus: polling.status,
|
|
@@ -132189,8 +132955,14 @@ function existingRegistrationLookupReducer(state, action) {
|
|
|
132189
132955
|
}
|
|
132190
132956
|
|
|
132191
132957
|
// ../blocks/src/system/runtime/nodes/event-registration/hooks.ts
|
|
132958
|
+
var eventRegistrationHooksDeps = {
|
|
132959
|
+
useBlockApi
|
|
132960
|
+
};
|
|
132192
132961
|
function usePortalAuth() {
|
|
132193
|
-
|
|
132962
|
+
return usePortalAuthWithDeps(eventRegistrationHooksDeps);
|
|
132963
|
+
}
|
|
132964
|
+
function usePortalAuthWithDeps(deps) {
|
|
132965
|
+
const api = deps.useBlockApi();
|
|
132194
132966
|
const [authState, setAuthState] = useState("checking");
|
|
132195
132967
|
const [profile, setProfile] = useState(null);
|
|
132196
132968
|
useEffect(() => {
|
|
@@ -132238,7 +133010,10 @@ function usePortalAuth() {
|
|
|
132238
133010
|
};
|
|
132239
133011
|
}
|
|
132240
133012
|
function useEligibility(params) {
|
|
132241
|
-
|
|
133013
|
+
return useEligibilityWithDeps(params, eventRegistrationHooksDeps);
|
|
133014
|
+
}
|
|
133015
|
+
function useEligibilityWithDeps(params, deps) {
|
|
133016
|
+
const api = deps.useBlockApi();
|
|
132242
133017
|
const ticketSelectionsKey = JSON.stringify(normalizeTicketSelectionLines(params.ticketSelections));
|
|
132243
133018
|
const [state, dispatch] = useReducer(
|
|
132244
133019
|
eligibilityLookupReducer,
|
|
@@ -132307,7 +133082,16 @@ function useExistingEventRegistration({
|
|
|
132307
133082
|
isAuthenticated,
|
|
132308
133083
|
occurrenceId
|
|
132309
133084
|
}) {
|
|
132310
|
-
|
|
133085
|
+
return useExistingEventRegistrationWithDeps(
|
|
133086
|
+
{ isAuthenticated, occurrenceId },
|
|
133087
|
+
eventRegistrationHooksDeps
|
|
133088
|
+
);
|
|
133089
|
+
}
|
|
133090
|
+
function useExistingEventRegistrationWithDeps({
|
|
133091
|
+
isAuthenticated,
|
|
133092
|
+
occurrenceId
|
|
133093
|
+
}, deps) {
|
|
133094
|
+
const api = deps.useBlockApi();
|
|
132311
133095
|
const [state, dispatch] = useReducer(
|
|
132312
133096
|
existingRegistrationLookupReducer,
|
|
132313
133097
|
initialExistingRegistrationLookupState
|
|
@@ -132643,9 +133427,6 @@ function SlidingScaleAmountField(props2) {
|
|
|
132643
133427
|
}
|
|
132644
133428
|
function TicketTypeQuantityRows(props2) {
|
|
132645
133429
|
const totalSelectedQuantity = getTicketSelectionTotal(props2.ticketSelections);
|
|
132646
|
-
const selectedTicketTypes = props2.ticketTypes.filter(
|
|
132647
|
-
(ticketType) => getTicketLineQuantity(props2.ticketSelections, ticketType.id) > 0
|
|
132648
|
-
);
|
|
132649
133430
|
return /* @__PURE__ */ jsxs("div", { className: "er-ticket-lines", children: [
|
|
132650
133431
|
/* @__PURE__ */ jsx("div", { className: "er-ticket-line-list", role: "list", "aria-label": "Tickets", children: props2.ticketTypes.map((ticketType) => {
|
|
132651
133432
|
const quantity = getTicketLineQuantity(props2.ticketSelections, ticketType.id);
|
|
@@ -132704,22 +133485,7 @@ function TicketTypeQuantityRows(props2) {
|
|
|
132704
133485
|
availabilityLabel: props2.availableSpots != null ? `${props2.availableSpots} spots available` : null
|
|
132705
133486
|
}
|
|
132706
133487
|
),
|
|
132707
|
-
|
|
132708
|
-
/* @__PURE__ */ jsxs("div", { className: "er-ticket-line-summary-title", children: [
|
|
132709
|
-
totalSelectedQuantity,
|
|
132710
|
-
" ticket",
|
|
132711
|
-
totalSelectedQuantity === 1 ? "" : "s",
|
|
132712
|
-
" selected"
|
|
132713
|
-
] }),
|
|
132714
|
-
/* @__PURE__ */ jsx("ul", { className: "er-ticket-line-summary-list", children: selectedTicketTypes.map((ticketType) => {
|
|
132715
|
-
const quantity = getTicketLineQuantity(props2.ticketSelections, ticketType.id);
|
|
132716
|
-
return /* @__PURE__ */ jsxs("li", { children: [
|
|
132717
|
-
quantity,
|
|
132718
|
-
" x ",
|
|
132719
|
-
ticketType.name
|
|
132720
|
-
] }, ticketType.id);
|
|
132721
|
-
}) })
|
|
132722
|
-
] }) : props2.hasAvailableTicketTypes ? /* @__PURE__ */ jsx("p", { className: "er-text er-text--muted", children: "Choose at least one ticket to continue." }) : /* @__PURE__ */ jsx("p", { className: "er-text er-text--muted", children: "No ticket types are currently available." })
|
|
133488
|
+
totalSelectedQuantity === 0 && props2.hasAvailableTicketTypes ? /* @__PURE__ */ jsx("p", { className: "er-text er-text--muted", children: "Choose at least one ticket to continue." }) : totalSelectedQuantity === 0 ? /* @__PURE__ */ jsx("p", { className: "er-text er-text--muted", children: "No ticket types are currently available." }) : null
|
|
132723
133489
|
] });
|
|
132724
133490
|
}
|
|
132725
133491
|
function getAttendanceModeDetail(attendanceMode) {
|
|
@@ -133931,7 +134697,6 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
133931
134697
|
const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
|
|
133932
134698
|
const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
|
|
133933
134699
|
const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
|
|
133934
|
-
const selectedLineSummary = (wizard.ticketSelectionSummaryLines ?? []).filter((line) => line.ticketTypeId !== null).map((line) => `${line.quantity} x ${line.label}`).join(", ");
|
|
133935
134700
|
const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
|
|
133936
134701
|
wizard,
|
|
133937
134702
|
totalCents: discountedTotalCents,
|
|
@@ -133968,10 +134733,6 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
133968
134733
|
/* @__PURE__ */ jsx("h4", { className: "er-summary-bar-event", children: summaryTitle }),
|
|
133969
134734
|
/* @__PURE__ */ jsxs("span", { className: "er-summary-bar-meta", children: [
|
|
133970
134735
|
summaryDate && formatEventDateTime(summaryDate, { timeZone: summaryTimeZone }),
|
|
133971
|
-
selectedLineSummary ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
133972
|
-
" \xB7 ",
|
|
133973
|
-
selectedLineSummary
|
|
133974
|
-
] }) : null,
|
|
133975
134736
|
wizard.step !== "select-event" && wizard.step !== "select-tickets" && wizard.ticketsCount > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
133976
134737
|
" \xB7 ",
|
|
133977
134738
|
wizard.ticketsCount,
|
|
@@ -134113,6 +134874,9 @@ function getWaitlistClaimTokenFromUrl() {
|
|
|
134113
134874
|
const token = new URLSearchParams(window.location.search).get("waitlist_claim")?.trim() ?? "";
|
|
134114
134875
|
return token.length > 0 ? token : null;
|
|
134115
134876
|
}
|
|
134877
|
+
var useWaitlistClaimDeps = {
|
|
134878
|
+
useBlockApi
|
|
134879
|
+
};
|
|
134116
134880
|
function subscribeToWaitlistClaimToken(callback) {
|
|
134117
134881
|
if (typeof window === "undefined") {
|
|
134118
134882
|
return () => {
|
|
@@ -134128,7 +134892,10 @@ function getWaitlistClaimTokenSnapshot() {
|
|
|
134128
134892
|
return getWaitlistClaimTokenFromUrl();
|
|
134129
134893
|
}
|
|
134130
134894
|
function useWaitlistClaim() {
|
|
134131
|
-
|
|
134895
|
+
return useWaitlistClaimWithDeps(useWaitlistClaimDeps);
|
|
134896
|
+
}
|
|
134897
|
+
function useWaitlistClaimWithDeps(deps) {
|
|
134898
|
+
const api = deps.useBlockApi();
|
|
134132
134899
|
const token = useSyncExternalStore(
|
|
134133
134900
|
subscribeToWaitlistClaimToken,
|
|
134134
134901
|
getWaitlistClaimTokenSnapshot,
|
|
@@ -134173,8 +134940,14 @@ function useWaitlistClaim() {
|
|
|
134173
134940
|
isLoading: isWaitlistClaimLoading(state)
|
|
134174
134941
|
};
|
|
134175
134942
|
}
|
|
134943
|
+
var paymentVerificationDeps = {
|
|
134944
|
+
useBlockApi
|
|
134945
|
+
};
|
|
134176
134946
|
function usePaymentVerification(config) {
|
|
134177
|
-
|
|
134947
|
+
return usePaymentVerificationWithDeps(config, paymentVerificationDeps);
|
|
134948
|
+
}
|
|
134949
|
+
function usePaymentVerificationWithDeps(config, deps) {
|
|
134950
|
+
const api = deps.useBlockApi();
|
|
134178
134951
|
const pollingConfig = useMemo(() => {
|
|
134179
134952
|
if (!config) return null;
|
|
134180
134953
|
return {
|
|
@@ -134284,7 +135057,13 @@ function useEventRegistrationStripeReturn(options) {
|
|
|
134284
135057
|
}
|
|
134285
135058
|
|
|
134286
135059
|
// ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.ts
|
|
135060
|
+
var eventRegistrationSubmitDeps = {
|
|
135061
|
+
savePendingRegistration
|
|
135062
|
+
};
|
|
134287
135063
|
function useEventRegistrationSubmit(options) {
|
|
135064
|
+
return useEventRegistrationSubmitWithDeps(options, eventRegistrationSubmitDeps);
|
|
135065
|
+
}
|
|
135066
|
+
function useEventRegistrationSubmitWithDeps(options, deps) {
|
|
134288
135067
|
return async (method, passId, membershipId, selection, submitOptions) => {
|
|
134289
135068
|
const submitOccurrenceId = options.registrationTarget?.occurrenceId;
|
|
134290
135069
|
if (!submitOccurrenceId) {
|
|
@@ -134373,7 +135152,7 @@ function useEventRegistrationSubmit(options) {
|
|
|
134373
135152
|
}
|
|
134374
135153
|
const siteId = options.api.config.siteId;
|
|
134375
135154
|
if (siteId && submitOccurrenceId) {
|
|
134376
|
-
savePendingRegistration(siteId, submitOccurrenceId, {
|
|
135155
|
+
deps.savePendingRegistration(siteId, submitOccurrenceId, {
|
|
134377
135156
|
attendeeId: result.attendeeId,
|
|
134378
135157
|
formData: options.formData,
|
|
134379
135158
|
ticketSelections,
|
|
@@ -134429,6 +135208,15 @@ function useEventRegistrationSubmit(options) {
|
|
|
134429
135208
|
}
|
|
134430
135209
|
|
|
134431
135210
|
// ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.ts
|
|
135211
|
+
var eventRegistrationWizardDeps = {
|
|
135212
|
+
usePortalAuth,
|
|
135213
|
+
useEligibility,
|
|
135214
|
+
useExistingEventRegistration,
|
|
135215
|
+
useWaitlistClaim,
|
|
135216
|
+
useEventRegistrationStripeReturn,
|
|
135217
|
+
useEventRegistrationSubmit,
|
|
135218
|
+
useDiscountCodeUi
|
|
135219
|
+
};
|
|
134432
135220
|
function parseCurrencyInputToCents(value) {
|
|
134433
135221
|
const trimmed = value.trim();
|
|
134434
135222
|
if (!trimmed) return null;
|
|
@@ -134459,6 +135247,9 @@ function getSlidingScaleSelectionMessage(input) {
|
|
|
134459
135247
|
return null;
|
|
134460
135248
|
}
|
|
134461
135249
|
function useEventRegistrationWizard(options) {
|
|
135250
|
+
return useEventRegistrationWizardWithDeps(options, eventRegistrationWizardDeps);
|
|
135251
|
+
}
|
|
135252
|
+
function useEventRegistrationWizardWithDeps(options, deps) {
|
|
134462
135253
|
const api = useBlockApi();
|
|
134463
135254
|
const registrationEvents = useMemo(
|
|
134464
135255
|
() => toRegistrationEvents(options.events ?? []),
|
|
@@ -134508,8 +135299,8 @@ function useEventRegistrationWizard(options) {
|
|
|
134508
135299
|
const [registrationResult, setRegistrationResult] = useState(null);
|
|
134509
135300
|
const [errorMessage, setErrorMessage] = useState("");
|
|
134510
135301
|
const [altchaSolution, setAltchaSolution] = useState(null);
|
|
134511
|
-
const { authState: portalAuthState, profile: portalProfile } = usePortalAuth();
|
|
134512
|
-
const waitlistClaim = useWaitlistClaim();
|
|
135302
|
+
const { authState: portalAuthState, profile: portalProfile } = deps.usePortalAuth();
|
|
135303
|
+
const waitlistClaim = deps.useWaitlistClaim();
|
|
134513
135304
|
const [showMagicLinkModal, setShowMagicLinkModal] = useState(false);
|
|
134514
135305
|
const [pendingAttendeeId, setPendingAttendeeId] = useState(null);
|
|
134515
135306
|
const [paymentStepState, setPaymentStepState] = useState({
|
|
@@ -134574,7 +135365,7 @@ function useEventRegistrationWizard(options) {
|
|
|
134574
135365
|
if (flowState.ticketsCount === ticketsCount) return;
|
|
134575
135366
|
dispatchFlow({ type: "set-tickets-count", ticketsCount });
|
|
134576
135367
|
}, [flowState.ticketsCount, ticketsCount]);
|
|
134577
|
-
const eligibilityResult = useEligibility({
|
|
135368
|
+
const eligibilityResult = deps.useEligibility({
|
|
134578
135369
|
enabled: portalAuthState === "authenticated" || step === "enter-details" || step === "select-payment",
|
|
134579
135370
|
occurrenceId,
|
|
134580
135371
|
attendanceMode: selectedAttendanceMode,
|
|
@@ -134582,7 +135373,7 @@ function useEventRegistrationWizard(options) {
|
|
|
134582
135373
|
selectedSlidingAmount: parseCurrencyInputToCents(selectedSlidingAmountInput),
|
|
134583
135374
|
email: formData.email
|
|
134584
135375
|
});
|
|
134585
|
-
const existingRegistrationResult = useExistingEventRegistration({
|
|
135376
|
+
const existingRegistrationResult = deps.useExistingEventRegistration({
|
|
134586
135377
|
isAuthenticated: portalAuthState === "authenticated",
|
|
134587
135378
|
occurrenceId
|
|
134588
135379
|
});
|
|
@@ -134676,7 +135467,7 @@ function useEventRegistrationWizard(options) {
|
|
|
134676
135467
|
useEffect(() => {
|
|
134677
135468
|
dispatchFlow({ type: "eligibility-updated", eligibility });
|
|
134678
135469
|
}, [eligibility]);
|
|
134679
|
-
const verification = useEventRegistrationStripeReturn({
|
|
135470
|
+
const verification = deps.useEventRegistrationStripeReturn({
|
|
134680
135471
|
api,
|
|
134681
135472
|
events: registrationEvents,
|
|
134682
135473
|
occurrenceId,
|
|
@@ -134940,10 +135731,10 @@ function useEventRegistrationWizard(options) {
|
|
|
134940
135731
|
if (discountContext?.type !== "event") return void 0;
|
|
134941
135732
|
return ticketSelectionSubtotalCents;
|
|
134942
135733
|
}, [discountContext, ticketSelectionSubtotalCents]);
|
|
134943
|
-
const discountUi = useDiscountCodeUi({ api, discountContext, subtotalCents: discountSubtotalCents });
|
|
135734
|
+
const discountUi = deps.useDiscountCodeUi({ api, discountContext, subtotalCents: discountSubtotalCents });
|
|
134944
135735
|
const selectionMethod = paymentSelection.method;
|
|
134945
135736
|
const shouldShowDiscountToggle = discountContext !== null && discountUi.manualCodeEntryAllowed && (selectionMethod === "stripe" || selectionMethod === "pass_bundle" || selectionMethod === "membership_bundle");
|
|
134946
|
-
const handleSubmit = useEventRegistrationSubmit({
|
|
135737
|
+
const handleSubmit = deps.useEventRegistrationSubmit({
|
|
134947
135738
|
api,
|
|
134948
135739
|
registrationTarget,
|
|
134949
135740
|
selectedAttendanceMode,
|
|
@@ -143735,6 +144526,114 @@ function NewsletterFormClient({
|
|
|
143735
144526
|
}
|
|
143736
144527
|
var newsletter_form_client_default = NewsletterFormClient;
|
|
143737
144528
|
|
|
144529
|
+
// ../blocks/src/system/runtime/nodes/weekly-slot-availability.client.state.ts
|
|
144530
|
+
function normalizeWeeklySlotAvailabilityHorizonWeeks(value) {
|
|
144531
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
144532
|
+
return value;
|
|
144533
|
+
}
|
|
144534
|
+
if (typeof value === "string" && value.trim()) {
|
|
144535
|
+
const parsed = Number.parseInt(value, 10);
|
|
144536
|
+
if (Number.isFinite(parsed)) {
|
|
144537
|
+
return parsed;
|
|
144538
|
+
}
|
|
144539
|
+
}
|
|
144540
|
+
return 4;
|
|
144541
|
+
}
|
|
144542
|
+
|
|
144543
|
+
// ../blocks/src/system/runtime/nodes/weekly-slot-availability.client.controller.ts
|
|
144544
|
+
function resolveWeeklySlotAvailabilityTimezone(value) {
|
|
144545
|
+
return value?.trim() || getRuntimeTimeZone();
|
|
144546
|
+
}
|
|
144547
|
+
function useWeeklySlotAvailabilityLoadState(api, input) {
|
|
144548
|
+
const { serviceId, resourceId, horizonWeeks, timezone, availability: initialAvailability } = input;
|
|
144549
|
+
const hasExplicitTimezone = Boolean(timezone?.trim());
|
|
144550
|
+
const canUseInitialAvailability = Boolean(
|
|
144551
|
+
initialAvailability && hasExplicitTimezone
|
|
144552
|
+
);
|
|
144553
|
+
const [availability, setAvailability] = React61.useState(
|
|
144554
|
+
initialAvailability ?? null
|
|
144555
|
+
);
|
|
144556
|
+
const [loading, setLoading] = React61.useState(
|
|
144557
|
+
() => Boolean(serviceId) && !initialAvailability
|
|
144558
|
+
);
|
|
144559
|
+
const [error, setError] = React61.useState(null);
|
|
144560
|
+
React61.useEffect(() => {
|
|
144561
|
+
if (!serviceId) {
|
|
144562
|
+
setAvailability(null);
|
|
144563
|
+
setLoading(false);
|
|
144564
|
+
setError(null);
|
|
144565
|
+
return;
|
|
144566
|
+
}
|
|
144567
|
+
if (canUseInitialAvailability) {
|
|
144568
|
+
setAvailability(initialAvailability ?? null);
|
|
144569
|
+
setLoading(false);
|
|
144570
|
+
setError(null);
|
|
144571
|
+
return;
|
|
144572
|
+
}
|
|
144573
|
+
let active = true;
|
|
144574
|
+
setLoading(true);
|
|
144575
|
+
setError(null);
|
|
144576
|
+
api.getWeeklySlotAvailability({
|
|
144577
|
+
serviceId,
|
|
144578
|
+
resourceId: resourceId ?? void 0,
|
|
144579
|
+
horizonWeeks: normalizeWeeklySlotAvailabilityHorizonWeeks(horizonWeeks),
|
|
144580
|
+
timezone: resolveWeeklySlotAvailabilityTimezone(timezone)
|
|
144581
|
+
}).then((result) => {
|
|
144582
|
+
if (!active) return;
|
|
144583
|
+
setAvailability(result);
|
|
144584
|
+
}).catch(() => {
|
|
144585
|
+
if (!active) return;
|
|
144586
|
+
setError("Availability could not be loaded right now.");
|
|
144587
|
+
}).finally(() => {
|
|
144588
|
+
if (!active) return;
|
|
144589
|
+
setLoading(false);
|
|
144590
|
+
});
|
|
144591
|
+
return () => {
|
|
144592
|
+
active = false;
|
|
144593
|
+
};
|
|
144594
|
+
}, [
|
|
144595
|
+
api,
|
|
144596
|
+
serviceId,
|
|
144597
|
+
resourceId,
|
|
144598
|
+
horizonWeeks,
|
|
144599
|
+
timezone,
|
|
144600
|
+
initialAvailability,
|
|
144601
|
+
canUseInitialAvailability
|
|
144602
|
+
]);
|
|
144603
|
+
return { availability, loading, error };
|
|
144604
|
+
}
|
|
144605
|
+
function WeeklySlotAvailabilityClient({
|
|
144606
|
+
serviceId,
|
|
144607
|
+
resourceId,
|
|
144608
|
+
horizonWeeks,
|
|
144609
|
+
timezone,
|
|
144610
|
+
availability: initialAvailability,
|
|
144611
|
+
emptyMessage,
|
|
144612
|
+
ctaText,
|
|
144613
|
+
ctaUrl
|
|
144614
|
+
}) {
|
|
144615
|
+
const api = useBlockApi();
|
|
144616
|
+
const { availability, loading, error } = useWeeklySlotAvailabilityLoadState(api, {
|
|
144617
|
+
serviceId,
|
|
144618
|
+
resourceId,
|
|
144619
|
+
horizonWeeks,
|
|
144620
|
+
timezone,
|
|
144621
|
+
availability: initialAvailability
|
|
144622
|
+
});
|
|
144623
|
+
return /* @__PURE__ */ jsx(
|
|
144624
|
+
WeeklySlotAvailabilityView,
|
|
144625
|
+
{
|
|
144626
|
+
availability,
|
|
144627
|
+
loading,
|
|
144628
|
+
error,
|
|
144629
|
+
emptyMessage,
|
|
144630
|
+
ctaText,
|
|
144631
|
+
ctaUrl
|
|
144632
|
+
}
|
|
144633
|
+
);
|
|
144634
|
+
}
|
|
144635
|
+
var weekly_slot_availability_client_default = WeeklySlotAvailabilityClient;
|
|
144636
|
+
|
|
143738
144637
|
// ../blocks/src/system/runtime/components/registry.client.tsx
|
|
143739
144638
|
function isRecord20(value) {
|
|
143740
144639
|
return typeof value === "object" && value !== null;
|
|
@@ -143875,7 +144774,8 @@ var clientComponentRegistryEntries = {
|
|
|
143875
144774
|
"booking-form": defineExplicitAdapterClientEntry(BookingFormNodeClient, { produces: "island-props" }),
|
|
143876
144775
|
"event-details": defineExplicitAdapterClientEntry(EventDetailsIslandClient, { produces: "client-props" }),
|
|
143877
144776
|
"location-map": defineExplicitAdapterClientEntry(LocationMapIslandClient, { produces: "client-props" }),
|
|
143878
|
-
"event-combined": defineExplicitAdapterClientEntry(EventCombinedIslandClient, { produces: "client-props" })
|
|
144777
|
+
"event-combined": defineExplicitAdapterClientEntry(EventCombinedIslandClient, { produces: "client-props" }),
|
|
144778
|
+
"weekly-slot-availability": defineSourcePropsClientEntry(weekly_slot_availability_client_default)
|
|
143879
144779
|
};
|
|
143880
144780
|
var clientComponentRegistry = buildClientRegistryFromEntries(
|
|
143881
144781
|
serverComponentRegistry,
|
|
@@ -149270,7 +150170,8 @@ var riverbankSiteConfigInputSchema = z.object({
|
|
|
149270
150170
|
}).strict();
|
|
149271
150171
|
z.object({
|
|
149272
150172
|
config: riverbankSiteConfigInputSchema,
|
|
149273
|
-
forceContentTypes: z.boolean().optional()
|
|
150173
|
+
forceContentTypes: z.boolean().optional(),
|
|
150174
|
+
mode: z.enum(["apply", "preview"]).optional()
|
|
149274
150175
|
}).strict();
|
|
149275
150176
|
var LAUNCH_REQUIREMENT_OVERRIDE_DEFINITIONS = {
|
|
149276
150177
|
configure_appointments: {
|
|
@@ -161428,10 +162329,92 @@ function SliderField({ path, backend, config }) {
|
|
|
161428
162329
|
}
|
|
161429
162330
|
);
|
|
161430
162331
|
}
|
|
162332
|
+
function InlineTextField({
|
|
162333
|
+
path,
|
|
162334
|
+
backend,
|
|
162335
|
+
config
|
|
162336
|
+
}) {
|
|
162337
|
+
const plainTextPath = config.plainTextField ? siblingPath(path, config.plainTextField) : null;
|
|
162338
|
+
return plainTextPath ? /* @__PURE__ */ jsx(LinkedInlineTextField, { path, backend, config, plainTextPath }) : /* @__PURE__ */ jsx(StandaloneInlineTextField, { path, backend, config });
|
|
162339
|
+
}
|
|
162340
|
+
function StandaloneInlineTextField({
|
|
162341
|
+
path,
|
|
162342
|
+
backend,
|
|
162343
|
+
config
|
|
162344
|
+
}) {
|
|
162345
|
+
const { value, error, setValue } = useField(path, backend);
|
|
162346
|
+
const inlineValue = useMemo(
|
|
162347
|
+
() => coerceInlineTextWithFallback(value, void 0),
|
|
162348
|
+
[value]
|
|
162349
|
+
);
|
|
162350
|
+
const plainText = inlineTextToPlainText(inlineValue);
|
|
162351
|
+
return /* @__PURE__ */ jsx(
|
|
162352
|
+
FieldFrame,
|
|
162353
|
+
{
|
|
162354
|
+
fieldPath: path,
|
|
162355
|
+
label: config.label,
|
|
162356
|
+
required: config.required,
|
|
162357
|
+
description: config.description,
|
|
162358
|
+
error: error?.message,
|
|
162359
|
+
children: ({ id }) => /* @__PURE__ */ jsx(
|
|
162360
|
+
Textarea,
|
|
162361
|
+
{
|
|
162362
|
+
id,
|
|
162363
|
+
value: plainText,
|
|
162364
|
+
maxLength: config.maxLength,
|
|
162365
|
+
rows: 2,
|
|
162366
|
+
onChange: (event) => {
|
|
162367
|
+
const nextPlainText = event.target.value;
|
|
162368
|
+
setValue(plainTextToInlineText(nextPlainText));
|
|
162369
|
+
}
|
|
162370
|
+
}
|
|
162371
|
+
)
|
|
162372
|
+
}
|
|
162373
|
+
);
|
|
162374
|
+
}
|
|
162375
|
+
function LinkedInlineTextField({
|
|
162376
|
+
path,
|
|
162377
|
+
backend,
|
|
162378
|
+
config,
|
|
162379
|
+
plainTextPath
|
|
162380
|
+
}) {
|
|
162381
|
+
const { value, error, setValue } = useField(path, backend);
|
|
162382
|
+
const plainTextField = useField(plainTextPath, backend);
|
|
162383
|
+
const inlineValue = useMemo(
|
|
162384
|
+
() => coerceInlineTextWithFallback(value, plainTextField.value),
|
|
162385
|
+
[plainTextField.value, value]
|
|
162386
|
+
);
|
|
162387
|
+
const plainText = inlineTextToPlainText(inlineValue);
|
|
162388
|
+
return /* @__PURE__ */ jsx(
|
|
162389
|
+
FieldFrame,
|
|
162390
|
+
{
|
|
162391
|
+
fieldPath: path,
|
|
162392
|
+
label: config.label,
|
|
162393
|
+
required: config.required,
|
|
162394
|
+
description: config.description,
|
|
162395
|
+
error: error?.message,
|
|
162396
|
+
children: ({ id }) => /* @__PURE__ */ jsx(
|
|
162397
|
+
Textarea,
|
|
162398
|
+
{
|
|
162399
|
+
id,
|
|
162400
|
+
value: plainText,
|
|
162401
|
+
maxLength: config.maxLength,
|
|
162402
|
+
rows: 2,
|
|
162403
|
+
onChange: (event) => {
|
|
162404
|
+
const nextPlainText = event.target.value;
|
|
162405
|
+
setValue(plainTextToInlineText(nextPlainText));
|
|
162406
|
+
plainTextField.setValue(nextPlainText);
|
|
162407
|
+
}
|
|
162408
|
+
}
|
|
162409
|
+
)
|
|
162410
|
+
}
|
|
162411
|
+
);
|
|
162412
|
+
}
|
|
161431
162413
|
|
|
161432
162414
|
// ../block-form/src/registry/widgets.ts
|
|
161433
162415
|
var WIDGET_COMPONENTS = {
|
|
161434
162416
|
text: TextField,
|
|
162417
|
+
inlineText: InlineTextField,
|
|
161435
162418
|
number: NumberField,
|
|
161436
162419
|
select: SelectField,
|
|
161437
162420
|
sdkSelect: SdkSelectField,
|
|
@@ -162733,6 +163716,914 @@ function EditorChrome({
|
|
|
162733
163716
|
] });
|
|
162734
163717
|
}
|
|
162735
163718
|
|
|
163719
|
+
// ../editor/src/inline/domParse.ts
|
|
163720
|
+
function parseEditableInlineText(root) {
|
|
163721
|
+
const runs = [];
|
|
163722
|
+
for (const child of Array.from(root.childNodes)) {
|
|
163723
|
+
collectInlineTextRuns(child, [], runs);
|
|
163724
|
+
}
|
|
163725
|
+
return normalizeInlineText(runs);
|
|
163726
|
+
}
|
|
163727
|
+
function inlineTextToEditableHtml(value) {
|
|
163728
|
+
return normalizeInlineText(value).map(runToHtml).join("");
|
|
163729
|
+
}
|
|
163730
|
+
function collectInlineTextRuns(node, inheritedMarks, runs) {
|
|
163731
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
163732
|
+
const text2 = node.textContent ?? "";
|
|
163733
|
+
if (text2.length === 0) return;
|
|
163734
|
+
const marks = normalizeInlineTextMarks(inheritedMarks);
|
|
163735
|
+
runs.push(marks.length > 0 ? { text: text2, marks } : { text: text2 });
|
|
163736
|
+
return;
|
|
163737
|
+
}
|
|
163738
|
+
if (!(node instanceof HTMLElement)) return;
|
|
163739
|
+
const nextMarks = normalizeInlineTextMarks([...inheritedMarks, ...marksForElement(node)]);
|
|
163740
|
+
for (const child of Array.from(node.childNodes)) {
|
|
163741
|
+
collectInlineTextRuns(child, nextMarks, runs);
|
|
163742
|
+
}
|
|
163743
|
+
}
|
|
163744
|
+
function marksForElement(element) {
|
|
163745
|
+
const tagName = element.tagName.toLowerCase();
|
|
163746
|
+
const marks = [];
|
|
163747
|
+
if (tagName === "strong" || tagName === "b") marks.push({ kind: "strong" });
|
|
163748
|
+
if (tagName === "em" || tagName === "i") marks.push({ kind: "emphasis" });
|
|
163749
|
+
for (const tone of inlineTextAccentTones) {
|
|
163750
|
+
if (element.classList.contains(`rb-inline-text-accent-${tone}`)) {
|
|
163751
|
+
marks.push({ kind: "accent", tone });
|
|
163752
|
+
}
|
|
163753
|
+
}
|
|
163754
|
+
for (const tone of inlineTextHighlightTones) {
|
|
163755
|
+
if (element.classList.contains(`rb-inline-text-highlight-${tone}`)) {
|
|
163756
|
+
marks.push({ kind: "highlight", tone });
|
|
163757
|
+
}
|
|
163758
|
+
}
|
|
163759
|
+
return marks;
|
|
163760
|
+
}
|
|
163761
|
+
function runToHtml(run3) {
|
|
163762
|
+
return normalizeInlineTextMarks(run3.marks ?? []).reduceRight(
|
|
163763
|
+
(html, mark) => wrapHtmlWithMark(html, mark),
|
|
163764
|
+
escapeHtml(run3.text)
|
|
163765
|
+
);
|
|
163766
|
+
}
|
|
163767
|
+
function wrapHtmlWithMark(html, mark) {
|
|
163768
|
+
switch (mark.kind) {
|
|
163769
|
+
case "strong":
|
|
163770
|
+
return `<strong>${html}</strong>`;
|
|
163771
|
+
case "emphasis":
|
|
163772
|
+
return `<em>${html}</em>`;
|
|
163773
|
+
case "accent":
|
|
163774
|
+
return `<span class="rb-inline-text-accent rb-inline-text-accent-${accentClass(mark.tone)}">${html}</span>`;
|
|
163775
|
+
case "highlight":
|
|
163776
|
+
return `<span class="rb-inline-text-highlight rb-inline-text-highlight-${highlightClass(mark.tone)}">${html}</span>`;
|
|
163777
|
+
}
|
|
163778
|
+
}
|
|
163779
|
+
function accentClass(tone) {
|
|
163780
|
+
return tone;
|
|
163781
|
+
}
|
|
163782
|
+
function highlightClass(tone) {
|
|
163783
|
+
return tone;
|
|
163784
|
+
}
|
|
163785
|
+
function escapeHtml(value) {
|
|
163786
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
163787
|
+
}
|
|
163788
|
+
|
|
163789
|
+
// ../editor/src/inline/presentation.ts
|
|
163790
|
+
var DARK_TOOLBAR_SURFACE = { r: 15, g: 23, b: 42, a: 1 };
|
|
163791
|
+
var LIGHT_TOOLBAR_SURFACE = { r: 255, g: 255, b: 255, a: 1 };
|
|
163792
|
+
var DARK_TEXT = { r: 15, g: 23, b: 42, a: 1 };
|
|
163793
|
+
var LIGHT_TEXT = { r: 255, g: 255, b: 255, a: 1 };
|
|
163794
|
+
var UNKNOWN_SURFACE_CANDIDATES = [
|
|
163795
|
+
LIGHT_TOOLBAR_SURFACE,
|
|
163796
|
+
DARK_TOOLBAR_SURFACE
|
|
163797
|
+
];
|
|
163798
|
+
var MIN_SAMPLE_CONTRAST = 3;
|
|
163799
|
+
function defaultInlineTextPresentationContext(tone) {
|
|
163800
|
+
const surface = fallbackSurfaceForToolbarTone(tone);
|
|
163801
|
+
const selectedTextRgba = tone === "dark" ? LIGHT_TEXT : DARK_TEXT;
|
|
163802
|
+
return {
|
|
163803
|
+
surface,
|
|
163804
|
+
selectedTextColor: colorToCss(selectedTextRgba),
|
|
163805
|
+
selectedTextRgba,
|
|
163806
|
+
accentTextRgbaByTone: defaultAccentTextRgbaByTone(selectedTextRgba),
|
|
163807
|
+
typography: {}
|
|
163808
|
+
};
|
|
163809
|
+
}
|
|
163810
|
+
function readInlineTextPresentationContext(editable, toolbarTone) {
|
|
163811
|
+
const computed = window.getComputedStyle(editable);
|
|
163812
|
+
const selectedTextRgba = parseCssColor(computed.color) ?? fallbackTextColorForTone(toolbarTone);
|
|
163813
|
+
return {
|
|
163814
|
+
surface: readInlineTextSurface(editable, toolbarTone),
|
|
163815
|
+
selectedTextColor: colorToCss(selectedTextRgba),
|
|
163816
|
+
selectedTextRgba,
|
|
163817
|
+
accentTextRgbaByTone: readAccentTextRgbaByTone(editable, selectedTextRgba),
|
|
163818
|
+
typography: {
|
|
163819
|
+
fontFamily: computed.fontFamily,
|
|
163820
|
+
fontSize: computed.fontSize,
|
|
163821
|
+
fontStyle: computed.fontStyle,
|
|
163822
|
+
fontWeight: computed.fontWeight,
|
|
163823
|
+
letterSpacing: computed.letterSpacing,
|
|
163824
|
+
lineHeight: computed.lineHeight,
|
|
163825
|
+
textTransform: computed.textTransform
|
|
163826
|
+
}
|
|
163827
|
+
};
|
|
163828
|
+
}
|
|
163829
|
+
function buildAccentTonePreview(tone, context) {
|
|
163830
|
+
const textColor = accentColorValue(tone);
|
|
163831
|
+
const textRgba = context.accentTextRgbaByTone[tone] ?? context.selectedTextRgba;
|
|
163832
|
+
return buildPreview({ color: textColor }, textRgba, context);
|
|
163833
|
+
}
|
|
163834
|
+
function buildHighlightTonePreview(tone, context) {
|
|
163835
|
+
const background = highlightBackgroundValue(tone);
|
|
163836
|
+
return buildPreview(
|
|
163837
|
+
{ color: context.selectedTextColor, background },
|
|
163838
|
+
context.selectedTextRgba,
|
|
163839
|
+
context
|
|
163840
|
+
);
|
|
163841
|
+
}
|
|
163842
|
+
function buildPlainTonePreview(context) {
|
|
163843
|
+
return buildPreview(
|
|
163844
|
+
{ color: context.selectedTextColor },
|
|
163845
|
+
context.selectedTextRgba,
|
|
163846
|
+
context
|
|
163847
|
+
);
|
|
163848
|
+
}
|
|
163849
|
+
function buildPreview(markStyle, textRgba, context) {
|
|
163850
|
+
const surface = previewSurfaceForText(textRgba, context.surface);
|
|
163851
|
+
const textOnSurface = contrastRatio2(textRgba, surface.rgba);
|
|
163852
|
+
const lowContrast = textOnSurface < MIN_SAMPLE_CONTRAST;
|
|
163853
|
+
return {
|
|
163854
|
+
lowContrast,
|
|
163855
|
+
surfaceStyle: {
|
|
163856
|
+
backgroundColor: surface.color
|
|
163857
|
+
},
|
|
163858
|
+
surfaceRgba: surface.rgba,
|
|
163859
|
+
textRgba,
|
|
163860
|
+
textStyle: {
|
|
163861
|
+
...previewTypography(context.typography),
|
|
163862
|
+
...markStyle
|
|
163863
|
+
}
|
|
163864
|
+
};
|
|
163865
|
+
}
|
|
163866
|
+
function inlineTextTonePreviewLooksSame(left, right) {
|
|
163867
|
+
return sameRgba(left.surfaceRgba, right.surfaceRgba) && sameRgba(left.textRgba, right.textRgba) && left.textStyle.background === right.textStyle.background && left.textStyle.backgroundColor === right.textStyle.backgroundColor;
|
|
163868
|
+
}
|
|
163869
|
+
function previewTypography(typography) {
|
|
163870
|
+
const fontSize = parseCssPixelValue(typography.fontSize);
|
|
163871
|
+
if (fontSize === null || fontSize <= 22) {
|
|
163872
|
+
return typography;
|
|
163873
|
+
}
|
|
163874
|
+
return {
|
|
163875
|
+
...typography,
|
|
163876
|
+
fontSize: "18px",
|
|
163877
|
+
lineHeight: "1.15"
|
|
163878
|
+
};
|
|
163879
|
+
}
|
|
163880
|
+
function previewSurfaceForText(textRgba, surface) {
|
|
163881
|
+
if (surface.kind === "block-solid" || surface.kind === "image-overlay") {
|
|
163882
|
+
return surface;
|
|
163883
|
+
}
|
|
163884
|
+
const currentContrast = contrastRatio2(textRgba, surface.rgba);
|
|
163885
|
+
if (currentContrast >= MIN_SAMPLE_CONTRAST) {
|
|
163886
|
+
return surface;
|
|
163887
|
+
}
|
|
163888
|
+
return [surface.rgba, ...UNKNOWN_SURFACE_CANDIDATES].map((candidate) => ({
|
|
163889
|
+
color: colorToCss(candidate),
|
|
163890
|
+
rgba: candidate,
|
|
163891
|
+
contrast: contrastRatio2(textRgba, candidate)
|
|
163892
|
+
})).reduce((best, candidate) => candidate.contrast > best.contrast ? candidate : best);
|
|
163893
|
+
}
|
|
163894
|
+
function defaultAccentTextRgbaByTone(fallback2) {
|
|
163895
|
+
return Object.fromEntries(
|
|
163896
|
+
inlineTextAccentTones.map((tone) => [tone, fallback2])
|
|
163897
|
+
);
|
|
163898
|
+
}
|
|
163899
|
+
function readAccentTextRgbaByTone(editable, fallback2) {
|
|
163900
|
+
return Object.fromEntries(
|
|
163901
|
+
inlineTextAccentTones.map((tone) => [
|
|
163902
|
+
tone,
|
|
163903
|
+
resolveCssColor(editable, accentColorValue(tone), "color") ?? fallback2
|
|
163904
|
+
])
|
|
163905
|
+
);
|
|
163906
|
+
}
|
|
163907
|
+
function readInlineTextSurface(editable, toolbarTone) {
|
|
163908
|
+
const fallback2 = readThemeFallbackSurface(editable) ?? fallbackSurfaceForToolbarTone(toolbarTone);
|
|
163909
|
+
const block = editable.closest("[data-block]") ?? editable.closest(".rb-section");
|
|
163910
|
+
if (!block) return fallback2;
|
|
163911
|
+
const styleLayer = block.querySelector(".background-style");
|
|
163912
|
+
const overlay = block.querySelector(".background-overlay");
|
|
163913
|
+
const hasImage = Boolean(block.querySelector(".background-image"));
|
|
163914
|
+
const overlayColor = overlay ? readVisibleBackgroundColor(overlay) : null;
|
|
163915
|
+
if (hasImage && overlay && overlayColor) {
|
|
163916
|
+
const opacity = readOpacity(overlay);
|
|
163917
|
+
const composited = opacity < 1 || overlayColor.a < 1 ? compositeColors(overlayColor, fallback2.rgba, opacity) : overlayColor;
|
|
163918
|
+
return {
|
|
163919
|
+
kind: "image-overlay",
|
|
163920
|
+
color: colorToCss(composited),
|
|
163921
|
+
rgba: composited
|
|
163922
|
+
};
|
|
163923
|
+
}
|
|
163924
|
+
if (!hasImage && styleLayer) {
|
|
163925
|
+
const styleLayerColor = readVisibleBackgroundColor(styleLayer, { includeElementOpacity: true });
|
|
163926
|
+
if (styleLayerColor) {
|
|
163927
|
+
return {
|
|
163928
|
+
kind: "block-solid",
|
|
163929
|
+
color: colorToCss(styleLayerColor),
|
|
163930
|
+
rgba: styleLayerColor
|
|
163931
|
+
};
|
|
163932
|
+
}
|
|
163933
|
+
}
|
|
163934
|
+
if (!hasImage) {
|
|
163935
|
+
const blockColor = readVisibleBackgroundColor(block, { includeElementOpacity: true });
|
|
163936
|
+
if (blockColor) {
|
|
163937
|
+
return {
|
|
163938
|
+
kind: "block-solid",
|
|
163939
|
+
color: colorToCss(blockColor),
|
|
163940
|
+
rgba: blockColor
|
|
163941
|
+
};
|
|
163942
|
+
}
|
|
163943
|
+
}
|
|
163944
|
+
return fallback2;
|
|
163945
|
+
}
|
|
163946
|
+
function readThemeFallbackSurface(root) {
|
|
163947
|
+
const themeScope = root.closest(".theme-scope") ?? root;
|
|
163948
|
+
const computed = window.getComputedStyle(themeScope);
|
|
163949
|
+
const color = readRgbTripletCustomProperty(computed, "--section-bg-color") ?? readRgbTripletCustomProperty(computed, "--tb-background") ?? readRgbTripletCustomProperty(computed, "--tb-surface");
|
|
163950
|
+
return color ? {
|
|
163951
|
+
kind: "theme-fallback",
|
|
163952
|
+
color: colorToCss(color),
|
|
163953
|
+
rgba: color
|
|
163954
|
+
} : null;
|
|
163955
|
+
}
|
|
163956
|
+
function fallbackSurfaceForToolbarTone(tone) {
|
|
163957
|
+
const rgba = tone === "dark" ? DARK_TOOLBAR_SURFACE : LIGHT_TOOLBAR_SURFACE;
|
|
163958
|
+
return {
|
|
163959
|
+
kind: "toolbar-fallback",
|
|
163960
|
+
color: colorToCss(rgba),
|
|
163961
|
+
rgba
|
|
163962
|
+
};
|
|
163963
|
+
}
|
|
163964
|
+
function fallbackTextColorForTone(tone) {
|
|
163965
|
+
return tone === "dark" ? LIGHT_TEXT : DARK_TEXT;
|
|
163966
|
+
}
|
|
163967
|
+
function readVisibleBackgroundColor(element, options = {}) {
|
|
163968
|
+
const computed = window.getComputedStyle(element);
|
|
163969
|
+
if (computed.display === "none" || computed.visibility === "hidden") return null;
|
|
163970
|
+
const color = parseCssColor(computed.backgroundColor);
|
|
163971
|
+
if (!color || color.a === 0) return null;
|
|
163972
|
+
if (!options.includeElementOpacity) return color;
|
|
163973
|
+
const opacity = readOpacity(element);
|
|
163974
|
+
return opacity < 1 ? { ...color, a: color.a * opacity } : color;
|
|
163975
|
+
}
|
|
163976
|
+
function readOpacity(element) {
|
|
163977
|
+
const opacity = Number.parseFloat(window.getComputedStyle(element).opacity);
|
|
163978
|
+
if (!Number.isFinite(opacity)) return 1;
|
|
163979
|
+
return Math.max(0, Math.min(1, opacity));
|
|
163980
|
+
}
|
|
163981
|
+
function accentColorValue(tone) {
|
|
163982
|
+
switch (tone) {
|
|
163983
|
+
case "accent":
|
|
163984
|
+
return "rgb(var(--tb-accent))";
|
|
163985
|
+
case "brand":
|
|
163986
|
+
return "rgb(var(--tb-primary))";
|
|
163987
|
+
case "contrast":
|
|
163988
|
+
return "var(--section-text-color, rgb(var(--tb-text)))";
|
|
163989
|
+
}
|
|
163990
|
+
}
|
|
163991
|
+
function highlightBackgroundValue(tone) {
|
|
163992
|
+
switch (tone) {
|
|
163993
|
+
case "soft":
|
|
163994
|
+
return "color-mix(in oklab, var(--section-text-color, rgb(var(--tb-text))) 14%, transparent)";
|
|
163995
|
+
case "accent":
|
|
163996
|
+
return "color-mix(in oklab, rgb(var(--tb-accent)) 28%, transparent)";
|
|
163997
|
+
case "brand":
|
|
163998
|
+
return "color-mix(in oklab, rgb(var(--tb-primary)) 24%, transparent)";
|
|
163999
|
+
}
|
|
164000
|
+
}
|
|
164001
|
+
function resolveCssColor(referenceElement, value, property) {
|
|
164002
|
+
if (!referenceElement) return parseCssColor(value);
|
|
164003
|
+
const probe = document.createElement("span");
|
|
164004
|
+
probe.textContent = "";
|
|
164005
|
+
probe.style.position = "absolute";
|
|
164006
|
+
probe.style.pointerEvents = "none";
|
|
164007
|
+
probe.style.visibility = "hidden";
|
|
164008
|
+
probe.style[property] = value;
|
|
164009
|
+
referenceElement.appendChild(probe);
|
|
164010
|
+
const resolved = window.getComputedStyle(probe)[property];
|
|
164011
|
+
probe.remove();
|
|
164012
|
+
return parseCssColor(resolved);
|
|
164013
|
+
}
|
|
164014
|
+
function readRgbTripletCustomProperty(computed, propertyName) {
|
|
164015
|
+
const value = computed.getPropertyValue(propertyName).trim();
|
|
164016
|
+
const parts = value.split(/\s+/).map((part) => Number.parseFloat(part));
|
|
164017
|
+
const [r4, g2, b2] = parts;
|
|
164018
|
+
if (!isValidRgbChannel(r4) || !isValidRgbChannel(g2) || !isValidRgbChannel(b2)) {
|
|
164019
|
+
return null;
|
|
164020
|
+
}
|
|
164021
|
+
return { r: r4, g: g2, b: b2, a: 1 };
|
|
164022
|
+
}
|
|
164023
|
+
function parseCssColor(value) {
|
|
164024
|
+
const trimmed = value.trim().toLowerCase();
|
|
164025
|
+
if (!trimmed || trimmed === "transparent") {
|
|
164026
|
+
return { r: 0, g: 0, b: 0, a: 0 };
|
|
164027
|
+
}
|
|
164028
|
+
const hex = parseHexColor(trimmed);
|
|
164029
|
+
if (hex) return hex;
|
|
164030
|
+
const rgbMatch = trimmed.match(/^rgba?\(([^)]+)\)$/);
|
|
164031
|
+
if (!rgbMatch?.[1]) return null;
|
|
164032
|
+
const normalized = rgbMatch[1].replace(/\s*\/\s*/, ", ");
|
|
164033
|
+
const parts = normalized.split(/[,\s]+/).filter(Boolean);
|
|
164034
|
+
const [rawR, rawG, rawB, rawAlpha] = parts;
|
|
164035
|
+
const r4 = parseRgbChannel(rawR);
|
|
164036
|
+
const g2 = parseRgbChannel(rawG);
|
|
164037
|
+
const b2 = parseRgbChannel(rawB);
|
|
164038
|
+
const alpha2 = rawAlpha === void 0 ? 1 : parseAlphaChannel(rawAlpha);
|
|
164039
|
+
if (!isValidRgbChannel(r4) || !isValidRgbChannel(g2) || !isValidRgbChannel(b2)) {
|
|
164040
|
+
return null;
|
|
164041
|
+
}
|
|
164042
|
+
return {
|
|
164043
|
+
r: r4,
|
|
164044
|
+
g: g2,
|
|
164045
|
+
b: b2,
|
|
164046
|
+
a: isValidAlpha(alpha2) ? alpha2 : 1
|
|
164047
|
+
};
|
|
164048
|
+
}
|
|
164049
|
+
function parseRgbChannel(value) {
|
|
164050
|
+
if (!value) return void 0;
|
|
164051
|
+
return value.endsWith("%") ? Number.parseFloat(value) / 100 * 255 : Number.parseFloat(value);
|
|
164052
|
+
}
|
|
164053
|
+
function parseAlphaChannel(value) {
|
|
164054
|
+
return value.endsWith("%") ? Number.parseFloat(value) / 100 : Number.parseFloat(value);
|
|
164055
|
+
}
|
|
164056
|
+
function parseHexColor(value) {
|
|
164057
|
+
const hex = value.startsWith("#") ? value.slice(1) : value;
|
|
164058
|
+
if (!/^[0-9a-f]{3}([0-9a-f]{3})?$/i.test(hex)) return null;
|
|
164059
|
+
const normalized = hex.length === 3 ? hex.split("").map((part) => `${part}${part}`).join("") : hex;
|
|
164060
|
+
return {
|
|
164061
|
+
r: Number.parseInt(normalized.slice(0, 2), 16),
|
|
164062
|
+
g: Number.parseInt(normalized.slice(2, 4), 16),
|
|
164063
|
+
b: Number.parseInt(normalized.slice(4, 6), 16),
|
|
164064
|
+
a: 1
|
|
164065
|
+
};
|
|
164066
|
+
}
|
|
164067
|
+
function isValidRgbChannel(value) {
|
|
164068
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 255;
|
|
164069
|
+
}
|
|
164070
|
+
function isValidAlpha(value) {
|
|
164071
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 1;
|
|
164072
|
+
}
|
|
164073
|
+
function parseCssPixelValue(value) {
|
|
164074
|
+
if (typeof value !== "string") return null;
|
|
164075
|
+
const match2 = value.trim().match(/^(\d+(?:\.\d+)?)px$/);
|
|
164076
|
+
return match2?.[1] ? Number.parseFloat(match2[1]) : null;
|
|
164077
|
+
}
|
|
164078
|
+
function sameRgba(left, right) {
|
|
164079
|
+
return Math.abs(left.r - right.r) < 1 && Math.abs(left.g - right.g) < 1 && Math.abs(left.b - right.b) < 1 && Math.abs(left.a - right.a) < 0.01;
|
|
164080
|
+
}
|
|
164081
|
+
function colorToCss(color) {
|
|
164082
|
+
const r4 = Math.round(color.r);
|
|
164083
|
+
const g2 = Math.round(color.g);
|
|
164084
|
+
const b2 = Math.round(color.b);
|
|
164085
|
+
return color.a < 1 ? `rgba(${r4}, ${g2}, ${b2}, ${color.a})` : `rgb(${r4}, ${g2}, ${b2})`;
|
|
164086
|
+
}
|
|
164087
|
+
function compositeColors(foreground, background, opacity) {
|
|
164088
|
+
const alpha2 = Math.max(0, Math.min(1, foreground.a * opacity));
|
|
164089
|
+
return {
|
|
164090
|
+
r: foreground.r * alpha2 + background.r * (1 - alpha2),
|
|
164091
|
+
g: foreground.g * alpha2 + background.g * (1 - alpha2),
|
|
164092
|
+
b: foreground.b * alpha2 + background.b * (1 - alpha2),
|
|
164093
|
+
a: 1
|
|
164094
|
+
};
|
|
164095
|
+
}
|
|
164096
|
+
function contrastRatio2(foreground, background) {
|
|
164097
|
+
const fg = foreground.a < 1 ? compositeColors(foreground, background, 1) : foreground;
|
|
164098
|
+
const bg = background.a < 1 ? compositeColors(background, LIGHT_TOOLBAR_SURFACE, 1) : background;
|
|
164099
|
+
const lighter = Math.max(relativeLuminance2(fg), relativeLuminance2(bg));
|
|
164100
|
+
const darker = Math.min(relativeLuminance2(fg), relativeLuminance2(bg));
|
|
164101
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
164102
|
+
}
|
|
164103
|
+
function relativeLuminance2(color) {
|
|
164104
|
+
const r4 = srgbToLinear2(color.r);
|
|
164105
|
+
const g2 = srgbToLinear2(color.g);
|
|
164106
|
+
const b2 = srgbToLinear2(color.b);
|
|
164107
|
+
return 0.2126 * r4 + 0.7152 * g2 + 0.0722 * b2;
|
|
164108
|
+
}
|
|
164109
|
+
function srgbToLinear2(channel) {
|
|
164110
|
+
const normalized = channel / 255;
|
|
164111
|
+
return normalized <= 0.03928 ? normalized / 12.92 : Math.pow((normalized + 0.055) / 1.055, 2.4);
|
|
164112
|
+
}
|
|
164113
|
+
function FloatingToolbar({
|
|
164114
|
+
selection,
|
|
164115
|
+
selectedText,
|
|
164116
|
+
tone,
|
|
164117
|
+
presentationContext,
|
|
164118
|
+
openMenu,
|
|
164119
|
+
setOpenMenu,
|
|
164120
|
+
onToggleStrong,
|
|
164121
|
+
onToggleEmphasis,
|
|
164122
|
+
onApplyAccent,
|
|
164123
|
+
onRemoveAccent,
|
|
164124
|
+
onApplyHighlight,
|
|
164125
|
+
onRemoveHighlight
|
|
164126
|
+
}) {
|
|
164127
|
+
const { style: style2, placement } = toolbarPlacement(selection.rect, openMenu !== null);
|
|
164128
|
+
const clampedSelectedText = selectedText.trim().length > 0 ? selectedText.trim() : "Selected text";
|
|
164129
|
+
const plainPreview = buildPlainTonePreview(presentationContext);
|
|
164130
|
+
const accentPreviews = inlineTextAccentTones.map((toneOption) => ({
|
|
164131
|
+
toneOption,
|
|
164132
|
+
preview: buildAccentTonePreview(toneOption, presentationContext)
|
|
164133
|
+
})).filter(({ preview }) => !inlineTextTonePreviewLooksSame(preview, plainPreview));
|
|
164134
|
+
return /* @__PURE__ */ jsxs(
|
|
164135
|
+
"div",
|
|
164136
|
+
{
|
|
164137
|
+
"data-rb-inline-text-toolbar": true,
|
|
164138
|
+
"data-tone": tone,
|
|
164139
|
+
"data-placement": placement,
|
|
164140
|
+
className: "rb-inline-text-toolbar",
|
|
164141
|
+
style: style2,
|
|
164142
|
+
onMouseDown: (event) => {
|
|
164143
|
+
event.preventDefault();
|
|
164144
|
+
},
|
|
164145
|
+
children: [
|
|
164146
|
+
/* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Bold", title: "Bold", onClick: onToggleStrong, children: /* @__PURE__ */ jsx(Bold, { "aria-hidden": true, size: 16 }) }),
|
|
164147
|
+
/* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Italic", title: "Italic", onClick: onToggleEmphasis, children: /* @__PURE__ */ jsx(Italic, { "aria-hidden": true, size: 16 }) }),
|
|
164148
|
+
/* @__PURE__ */ jsx(
|
|
164149
|
+
"button",
|
|
164150
|
+
{
|
|
164151
|
+
type: "button",
|
|
164152
|
+
"aria-label": "Accent color",
|
|
164153
|
+
title: "Accent color",
|
|
164154
|
+
"data-open": openMenu === "accent" ? "true" : void 0,
|
|
164155
|
+
onClick: () => setOpenMenu(openMenu === "accent" ? null : "accent"),
|
|
164156
|
+
children: /* @__PURE__ */ jsx(Palette, { "aria-hidden": true, size: 16 })
|
|
164157
|
+
}
|
|
164158
|
+
),
|
|
164159
|
+
/* @__PURE__ */ jsx(
|
|
164160
|
+
"button",
|
|
164161
|
+
{
|
|
164162
|
+
type: "button",
|
|
164163
|
+
"aria-label": "Highlight background",
|
|
164164
|
+
title: "Highlight background",
|
|
164165
|
+
"data-open": openMenu === "highlight" ? "true" : void 0,
|
|
164166
|
+
onClick: () => setOpenMenu(openMenu === "highlight" ? null : "highlight"),
|
|
164167
|
+
children: /* @__PURE__ */ jsx(Highlighter, { "aria-hidden": true, size: 16 })
|
|
164168
|
+
}
|
|
164169
|
+
),
|
|
164170
|
+
openMenu === "accent" ? /* @__PURE__ */ jsxs(ToneMenu, { label: "Accent color", children: [
|
|
164171
|
+
accentPreviews.map(({ toneOption, preview }) => /* @__PURE__ */ jsx(
|
|
164172
|
+
"button",
|
|
164173
|
+
{
|
|
164174
|
+
type: "button",
|
|
164175
|
+
"aria-label": `Apply ${toneOption} accent color`,
|
|
164176
|
+
title: `Apply ${toneOption} accent color`,
|
|
164177
|
+
onClick: () => onApplyAccent(toneOption),
|
|
164178
|
+
children: /* @__PURE__ */ jsx(
|
|
164179
|
+
TonePreview,
|
|
164180
|
+
{
|
|
164181
|
+
preview,
|
|
164182
|
+
selectedText: clampedSelectedText
|
|
164183
|
+
}
|
|
164184
|
+
)
|
|
164185
|
+
},
|
|
164186
|
+
toneOption
|
|
164187
|
+
)),
|
|
164188
|
+
/* @__PURE__ */ jsx(
|
|
164189
|
+
"button",
|
|
164190
|
+
{
|
|
164191
|
+
type: "button",
|
|
164192
|
+
"aria-label": "Use plain text color",
|
|
164193
|
+
title: "Use plain text color",
|
|
164194
|
+
onClick: onRemoveAccent,
|
|
164195
|
+
children: /* @__PURE__ */ jsx(
|
|
164196
|
+
TonePreview,
|
|
164197
|
+
{
|
|
164198
|
+
preview: plainPreview,
|
|
164199
|
+
selectedText: clampedSelectedText
|
|
164200
|
+
}
|
|
164201
|
+
)
|
|
164202
|
+
}
|
|
164203
|
+
)
|
|
164204
|
+
] }) : null,
|
|
164205
|
+
openMenu === "highlight" ? /* @__PURE__ */ jsxs(ToneMenu, { label: "Highlight background", children: [
|
|
164206
|
+
inlineTextHighlightTones.map((toneOption) => /* @__PURE__ */ jsx(
|
|
164207
|
+
"button",
|
|
164208
|
+
{
|
|
164209
|
+
type: "button",
|
|
164210
|
+
"aria-label": `Apply ${toneOption} highlight background`,
|
|
164211
|
+
title: `Apply ${toneOption} highlight background`,
|
|
164212
|
+
onClick: () => onApplyHighlight(toneOption),
|
|
164213
|
+
children: /* @__PURE__ */ jsx(
|
|
164214
|
+
TonePreview,
|
|
164215
|
+
{
|
|
164216
|
+
preview: buildHighlightTonePreview(toneOption, presentationContext),
|
|
164217
|
+
selectedText: clampedSelectedText
|
|
164218
|
+
}
|
|
164219
|
+
)
|
|
164220
|
+
},
|
|
164221
|
+
toneOption
|
|
164222
|
+
)),
|
|
164223
|
+
/* @__PURE__ */ jsx(
|
|
164224
|
+
"button",
|
|
164225
|
+
{
|
|
164226
|
+
type: "button",
|
|
164227
|
+
"aria-label": "Remove highlight background",
|
|
164228
|
+
title: "Remove highlight background",
|
|
164229
|
+
onClick: onRemoveHighlight,
|
|
164230
|
+
children: /* @__PURE__ */ jsx(
|
|
164231
|
+
TonePreview,
|
|
164232
|
+
{
|
|
164233
|
+
preview: plainPreview,
|
|
164234
|
+
selectedText: clampedSelectedText
|
|
164235
|
+
}
|
|
164236
|
+
)
|
|
164237
|
+
}
|
|
164238
|
+
)
|
|
164239
|
+
] }) : null
|
|
164240
|
+
]
|
|
164241
|
+
}
|
|
164242
|
+
);
|
|
164243
|
+
}
|
|
164244
|
+
function TonePreview({
|
|
164245
|
+
preview,
|
|
164246
|
+
selectedText
|
|
164247
|
+
}) {
|
|
164248
|
+
return /* @__PURE__ */ jsx(
|
|
164249
|
+
"span",
|
|
164250
|
+
{
|
|
164251
|
+
className: "rb-inline-text-toolbar-preview",
|
|
164252
|
+
"data-low-contrast": preview.lowContrast ? "true" : void 0,
|
|
164253
|
+
style: preview.surfaceStyle,
|
|
164254
|
+
children: /* @__PURE__ */ jsx("span", { className: "rb-inline-text-toolbar-preview-text", style: preview.textStyle, children: selectedText })
|
|
164255
|
+
}
|
|
164256
|
+
);
|
|
164257
|
+
}
|
|
164258
|
+
function ToneMenu({ label, children }) {
|
|
164259
|
+
return /* @__PURE__ */ jsx("div", { className: "rb-inline-text-toolbar-menu", role: "menu", "aria-label": label, children });
|
|
164260
|
+
}
|
|
164261
|
+
function toolbarPlacement(rect, hasOpenMenu) {
|
|
164262
|
+
const toolbarWidth = hasOpenMenu ? 340 : 188;
|
|
164263
|
+
const left = Math.min(
|
|
164264
|
+
Math.max(12, rect.left + rect.width / 2 - toolbarWidth / 2),
|
|
164265
|
+
Math.max(12, window.innerWidth - toolbarWidth - 12)
|
|
164266
|
+
);
|
|
164267
|
+
const aboveTop = rect.top - 48;
|
|
164268
|
+
if (aboveTop < 12) {
|
|
164269
|
+
return {
|
|
164270
|
+
placement: "below",
|
|
164271
|
+
style: { left, top: rect.bottom + 10, width: toolbarWidth }
|
|
164272
|
+
};
|
|
164273
|
+
}
|
|
164274
|
+
return {
|
|
164275
|
+
placement: "above",
|
|
164276
|
+
style: { left, top: aboveTop, width: toolbarWidth }
|
|
164277
|
+
};
|
|
164278
|
+
}
|
|
164279
|
+
function InlineTextEditorStyles() {
|
|
164280
|
+
return /* @__PURE__ */ jsx("style", { children: `
|
|
164281
|
+
[data-rb-inline-text-editor] {
|
|
164282
|
+
min-width: 1ch;
|
|
164283
|
+
outline: 1px dashed transparent;
|
|
164284
|
+
outline-offset: 3px;
|
|
164285
|
+
}
|
|
164286
|
+
|
|
164287
|
+
[data-rb-inline-text-editor]:hover,
|
|
164288
|
+
[data-rb-inline-text-editor]:focus-visible {
|
|
164289
|
+
outline-color: rgba(148, 163, 184, 0.76);
|
|
164290
|
+
}
|
|
164291
|
+
|
|
164292
|
+
[data-rb-inline-text-editor][data-rb-inline-text-empty="true"]::before {
|
|
164293
|
+
content: attr(data-placeholder);
|
|
164294
|
+
color: rgba(148, 163, 184, 0.82);
|
|
164295
|
+
}
|
|
164296
|
+
|
|
164297
|
+
[data-rb-inline-text-editor] .rb-inline-text-accent,
|
|
164298
|
+
[data-rb-inline-text-editor] .rb-inline-text-highlight {
|
|
164299
|
+
font: inherit;
|
|
164300
|
+
letter-spacing: inherit;
|
|
164301
|
+
text-transform: inherit;
|
|
164302
|
+
}
|
|
164303
|
+
|
|
164304
|
+
.rb-inline-text-toolbar {
|
|
164305
|
+
align-items: center;
|
|
164306
|
+
background: rgba(15, 23, 42, 0.94);
|
|
164307
|
+
border: 1px solid rgba(255, 255, 255, 0.14);
|
|
164308
|
+
border-radius: 8px;
|
|
164309
|
+
box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
|
|
164310
|
+
color: white;
|
|
164311
|
+
display: flex;
|
|
164312
|
+
gap: 3px;
|
|
164313
|
+
justify-content: center;
|
|
164314
|
+
padding: 5px;
|
|
164315
|
+
position: fixed;
|
|
164316
|
+
z-index: 80;
|
|
164317
|
+
}
|
|
164318
|
+
|
|
164319
|
+
.rb-inline-text-toolbar[data-tone="light"] {
|
|
164320
|
+
background: rgba(255, 255, 255, 0.98);
|
|
164321
|
+
border-color: rgba(15, 23, 42, 0.14);
|
|
164322
|
+
color: rgb(15, 23, 42);
|
|
164323
|
+
}
|
|
164324
|
+
|
|
164325
|
+
.rb-inline-text-toolbar > button,
|
|
164326
|
+
.rb-inline-text-toolbar-menu > button {
|
|
164327
|
+
align-items: center;
|
|
164328
|
+
background: transparent;
|
|
164329
|
+
border: 0;
|
|
164330
|
+
border-radius: 6px;
|
|
164331
|
+
color: inherit;
|
|
164332
|
+
cursor: pointer;
|
|
164333
|
+
display: inline-flex;
|
|
164334
|
+
font: inherit;
|
|
164335
|
+
justify-content: center;
|
|
164336
|
+
min-height: 30px;
|
|
164337
|
+
min-width: 30px;
|
|
164338
|
+
padding: 5px 7px;
|
|
164339
|
+
}
|
|
164340
|
+
|
|
164341
|
+
.rb-inline-text-toolbar > button:hover,
|
|
164342
|
+
.rb-inline-text-toolbar > button[data-open="true"],
|
|
164343
|
+
.rb-inline-text-toolbar-menu > button:hover {
|
|
164344
|
+
background: rgba(148, 163, 184, 0.22);
|
|
164345
|
+
}
|
|
164346
|
+
|
|
164347
|
+
.rb-inline-text-toolbar-menu {
|
|
164348
|
+
background: inherit;
|
|
164349
|
+
border: inherit;
|
|
164350
|
+
border-radius: 8px;
|
|
164351
|
+
box-shadow: inherit;
|
|
164352
|
+
display: grid;
|
|
164353
|
+
gap: 2px;
|
|
164354
|
+
left: 0;
|
|
164355
|
+
min-width: 100%;
|
|
164356
|
+
padding: 5px;
|
|
164357
|
+
position: absolute;
|
|
164358
|
+
top: calc(100% + 6px);
|
|
164359
|
+
}
|
|
164360
|
+
|
|
164361
|
+
.rb-inline-text-toolbar[data-placement="below"] .rb-inline-text-toolbar-menu {
|
|
164362
|
+
bottom: calc(100% + 6px);
|
|
164363
|
+
top: auto;
|
|
164364
|
+
}
|
|
164365
|
+
|
|
164366
|
+
.rb-inline-text-toolbar-menu > button {
|
|
164367
|
+
justify-content: flex-start;
|
|
164368
|
+
width: 100%;
|
|
164369
|
+
overflow: hidden;
|
|
164370
|
+
text-align: left;
|
|
164371
|
+
white-space: nowrap;
|
|
164372
|
+
}
|
|
164373
|
+
|
|
164374
|
+
.rb-inline-text-toolbar-preview {
|
|
164375
|
+
align-items: center;
|
|
164376
|
+
border: 1px solid rgba(148, 163, 184, 0.32);
|
|
164377
|
+
border-radius: 5px;
|
|
164378
|
+
display: inline-flex;
|
|
164379
|
+
max-width: 100%;
|
|
164380
|
+
width: 100%;
|
|
164381
|
+
min-height: 28px;
|
|
164382
|
+
overflow: hidden;
|
|
164383
|
+
padding: 3px 7px;
|
|
164384
|
+
}
|
|
164385
|
+
|
|
164386
|
+
.rb-inline-text-toolbar-preview[data-low-contrast="true"] {
|
|
164387
|
+
box-shadow:
|
|
164388
|
+
inset 0 0 0 1px rgba(255, 255, 255, 0.52),
|
|
164389
|
+
0 0 0 1px rgba(15, 23, 42, 0.26);
|
|
164390
|
+
}
|
|
164391
|
+
|
|
164392
|
+
.rb-inline-text-toolbar-preview-text {
|
|
164393
|
+
display: inline;
|
|
164394
|
+
max-width: 100%;
|
|
164395
|
+
overflow: hidden;
|
|
164396
|
+
text-overflow: ellipsis;
|
|
164397
|
+
white-space: nowrap;
|
|
164398
|
+
}
|
|
164399
|
+
` });
|
|
164400
|
+
}
|
|
164401
|
+
|
|
164402
|
+
// ../editor/src/inline/selection.ts
|
|
164403
|
+
function readSelection(root) {
|
|
164404
|
+
const range = readSelectionRange(root);
|
|
164405
|
+
if (!range || range.start === range.end) return null;
|
|
164406
|
+
return range;
|
|
164407
|
+
}
|
|
164408
|
+
function readSelectionRange(root) {
|
|
164409
|
+
if (!root) return null;
|
|
164410
|
+
const selection = window.getSelection();
|
|
164411
|
+
if (!selection || selection.rangeCount === 0) return null;
|
|
164412
|
+
const range = selection.getRangeAt(0);
|
|
164413
|
+
if (!root.contains(range.commonAncestorContainer)) return null;
|
|
164414
|
+
const startProbe = document.createRange();
|
|
164415
|
+
startProbe.selectNodeContents(root);
|
|
164416
|
+
startProbe.setEnd(range.startContainer, range.startOffset);
|
|
164417
|
+
const start = startProbe.toString().length;
|
|
164418
|
+
const end = start + range.toString().length;
|
|
164419
|
+
return {
|
|
164420
|
+
start: Math.min(start, end),
|
|
164421
|
+
end: Math.max(start, end),
|
|
164422
|
+
rect: range.getBoundingClientRect()
|
|
164423
|
+
};
|
|
164424
|
+
}
|
|
164425
|
+
function rangeHasMark(value, range, kind) {
|
|
164426
|
+
const start = Math.min(range.start, range.end);
|
|
164427
|
+
const end = Math.max(range.start, range.end);
|
|
164428
|
+
if (start === end) return false;
|
|
164429
|
+
let offset4 = 0;
|
|
164430
|
+
let sawText = false;
|
|
164431
|
+
for (const run3 of normalizeInlineText(value)) {
|
|
164432
|
+
const runStart = offset4;
|
|
164433
|
+
const runEnd = offset4 + run3.text.length;
|
|
164434
|
+
offset4 = runEnd;
|
|
164435
|
+
if (runEnd <= start || runStart >= end) continue;
|
|
164436
|
+
sawText = true;
|
|
164437
|
+
if (!(run3.marks ?? []).some((mark) => mark.kind === kind)) {
|
|
164438
|
+
return false;
|
|
164439
|
+
}
|
|
164440
|
+
}
|
|
164441
|
+
return sawText;
|
|
164442
|
+
}
|
|
164443
|
+
function InlineTextEditor({
|
|
164444
|
+
value,
|
|
164445
|
+
onChange,
|
|
164446
|
+
as: Comp = "span",
|
|
164447
|
+
id,
|
|
164448
|
+
className,
|
|
164449
|
+
placeholder,
|
|
164450
|
+
maxLength,
|
|
164451
|
+
ariaLabel,
|
|
164452
|
+
ariaDescribedBy,
|
|
164453
|
+
toolbarTone = "dark",
|
|
164454
|
+
onFocus,
|
|
164455
|
+
onBlur
|
|
164456
|
+
}) {
|
|
164457
|
+
const editableRef = useRef(null);
|
|
164458
|
+
const initialValue = useMemo(() => truncateInlineText(value, maxLength), [maxLength, value]);
|
|
164459
|
+
const currentValueRef = useRef(initialValue);
|
|
164460
|
+
const [plainText, setPlainText] = useState(() => inlineTextToPlainText(initialValue));
|
|
164461
|
+
const [selection, setSelection] = useState(null);
|
|
164462
|
+
const [presentationContext, setPresentationContext] = useState(() => defaultInlineTextPresentationContext(toolbarTone));
|
|
164463
|
+
const [openMenu, setOpenMenu] = useState(null);
|
|
164464
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
164465
|
+
const syncEditableDom = useCallback((nextValue) => {
|
|
164466
|
+
if (!editableRef.current) return;
|
|
164467
|
+
editableRef.current.innerHTML = inlineTextToEditableHtml(nextValue);
|
|
164468
|
+
}, []);
|
|
164469
|
+
const setEditableRef = useCallback((node) => {
|
|
164470
|
+
if (node && editableRef.current !== node) {
|
|
164471
|
+
node.innerHTML = inlineTextToEditableHtml(currentValueRef.current);
|
|
164472
|
+
}
|
|
164473
|
+
editableRef.current = node;
|
|
164474
|
+
}, []);
|
|
164475
|
+
useEffect(() => {
|
|
164476
|
+
const nextValue = truncateInlineText(value, maxLength);
|
|
164477
|
+
if (inlineTextEqual(nextValue, currentValueRef.current)) return;
|
|
164478
|
+
if (isFocused) return;
|
|
164479
|
+
currentValueRef.current = nextValue;
|
|
164480
|
+
setPlainText(inlineTextToPlainText(nextValue));
|
|
164481
|
+
syncEditableDom(nextValue);
|
|
164482
|
+
}, [isFocused, maxLength, syncEditableDom, value]);
|
|
164483
|
+
const commitValue = useCallback(
|
|
164484
|
+
(nextValue, options = {}) => {
|
|
164485
|
+
const normalized = normalizeInlineText(nextValue);
|
|
164486
|
+
const limited = truncateInlineText(normalized, maxLength);
|
|
164487
|
+
const shouldSyncDom = Boolean(options.syncDom) || !inlineTextEqual(normalized, limited) || limited.length === 0 && (editableRef.current?.innerHTML ?? "").length > 0;
|
|
164488
|
+
const nextPlainText = inlineTextToPlainText(limited);
|
|
164489
|
+
currentValueRef.current = limited;
|
|
164490
|
+
setPlainText((previous) => previous === nextPlainText ? previous : nextPlainText);
|
|
164491
|
+
if (shouldSyncDom) {
|
|
164492
|
+
syncEditableDom(limited);
|
|
164493
|
+
}
|
|
164494
|
+
onChange(limited, nextPlainText);
|
|
164495
|
+
},
|
|
164496
|
+
[maxLength, onChange, syncEditableDom]
|
|
164497
|
+
);
|
|
164498
|
+
const updateSelectionFromDom = useCallback(() => {
|
|
164499
|
+
const editable = editableRef.current;
|
|
164500
|
+
const nextSelection = readSelection(editable);
|
|
164501
|
+
setSelection(nextSelection);
|
|
164502
|
+
if (editable && nextSelection) {
|
|
164503
|
+
setPresentationContext(readInlineTextPresentationContext(editable, toolbarTone));
|
|
164504
|
+
}
|
|
164505
|
+
if (!nextSelection) {
|
|
164506
|
+
setOpenMenu(null);
|
|
164507
|
+
}
|
|
164508
|
+
}, [toolbarTone]);
|
|
164509
|
+
const clearSelectionUi = useCallback(() => {
|
|
164510
|
+
setSelection(null);
|
|
164511
|
+
setOpenMenu(null);
|
|
164512
|
+
}, []);
|
|
164513
|
+
const applyMark = useCallback(
|
|
164514
|
+
(mark) => {
|
|
164515
|
+
if (!selection) return;
|
|
164516
|
+
const nextValue = applyInlineTextMarkToRange(currentValueRef.current, selection, mark);
|
|
164517
|
+
commitValue(nextValue, { syncDom: true });
|
|
164518
|
+
clearSelectionUi();
|
|
164519
|
+
},
|
|
164520
|
+
[clearSelectionUi, commitValue, selection]
|
|
164521
|
+
);
|
|
164522
|
+
const removeMark2 = useCallback(
|
|
164523
|
+
(kind) => {
|
|
164524
|
+
if (!selection) return;
|
|
164525
|
+
const nextValue = removeInlineTextMarkFromRange(currentValueRef.current, selection, kind);
|
|
164526
|
+
commitValue(nextValue, { syncDom: true });
|
|
164527
|
+
clearSelectionUi();
|
|
164528
|
+
},
|
|
164529
|
+
[clearSelectionUi, commitValue, selection]
|
|
164530
|
+
);
|
|
164531
|
+
const toggleMark2 = useCallback(
|
|
164532
|
+
(kind) => {
|
|
164533
|
+
if (!selection) return;
|
|
164534
|
+
if (rangeHasMark(currentValueRef.current, selection, kind)) {
|
|
164535
|
+
removeMark2(kind);
|
|
164536
|
+
return;
|
|
164537
|
+
}
|
|
164538
|
+
applyMark({ kind });
|
|
164539
|
+
},
|
|
164540
|
+
[applyMark, removeMark2, selection]
|
|
164541
|
+
);
|
|
164542
|
+
return /* @__PURE__ */ jsxs("span", { className: "rb-inline-text-editor-root", children: [
|
|
164543
|
+
/* @__PURE__ */ jsx(InlineTextEditorStyles, {}),
|
|
164544
|
+
/* @__PURE__ */ jsx(
|
|
164545
|
+
Comp,
|
|
164546
|
+
{
|
|
164547
|
+
id,
|
|
164548
|
+
ref: setEditableRef,
|
|
164549
|
+
"data-rb-inline-text-editor": true,
|
|
164550
|
+
"data-rb-inline-text-empty": plainText.length === 0 ? "true" : void 0,
|
|
164551
|
+
"data-placeholder": placeholder,
|
|
164552
|
+
contentEditable: true,
|
|
164553
|
+
suppressContentEditableWarning: true,
|
|
164554
|
+
spellCheck: true,
|
|
164555
|
+
role: "textbox",
|
|
164556
|
+
"aria-multiline": "false",
|
|
164557
|
+
"aria-label": ariaLabel,
|
|
164558
|
+
"aria-describedby": ariaDescribedBy,
|
|
164559
|
+
className,
|
|
164560
|
+
onInput: (event) => {
|
|
164561
|
+
commitValue(parseEditableInlineText(event.currentTarget));
|
|
164562
|
+
updateSelectionFromDom();
|
|
164563
|
+
},
|
|
164564
|
+
onKeyDown: (event) => {
|
|
164565
|
+
if (event.key === "Enter") {
|
|
164566
|
+
event.preventDefault();
|
|
164567
|
+
}
|
|
164568
|
+
},
|
|
164569
|
+
onPaste: (event) => {
|
|
164570
|
+
event.preventDefault();
|
|
164571
|
+
const range = readSelectionRange(editableRef.current) ?? selection;
|
|
164572
|
+
const text2 = event.clipboardData.getData("text/plain").replace(/\s+/g, " ");
|
|
164573
|
+
if (!range) {
|
|
164574
|
+
commitValue(plainTextToInlineText(plainText + text2), { syncDom: true });
|
|
164575
|
+
clearSelectionUi();
|
|
164576
|
+
return;
|
|
164577
|
+
}
|
|
164578
|
+
commitValue(
|
|
164579
|
+
replaceInlineTextRange(currentValueRef.current, range, plainTextToInlineText(text2)),
|
|
164580
|
+
{ syncDom: true }
|
|
164581
|
+
);
|
|
164582
|
+
clearSelectionUi();
|
|
164583
|
+
},
|
|
164584
|
+
onMouseUp: () => updateSelectionFromDom(),
|
|
164585
|
+
onKeyUp: (event) => {
|
|
164586
|
+
if (event.key === "Escape") {
|
|
164587
|
+
clearSelectionUi();
|
|
164588
|
+
return;
|
|
164589
|
+
}
|
|
164590
|
+
updateSelectionFromDom();
|
|
164591
|
+
},
|
|
164592
|
+
onFocus: () => {
|
|
164593
|
+
setIsFocused(true);
|
|
164594
|
+
onFocus?.();
|
|
164595
|
+
},
|
|
164596
|
+
onBlur: () => {
|
|
164597
|
+
window.setTimeout(() => {
|
|
164598
|
+
const activeElement = document.activeElement;
|
|
164599
|
+
if (activeElement?.closest("[data-rb-inline-text-toolbar]")) return;
|
|
164600
|
+
setIsFocused(false);
|
|
164601
|
+
clearSelectionUi();
|
|
164602
|
+
onBlur?.();
|
|
164603
|
+
}, 0);
|
|
164604
|
+
}
|
|
164605
|
+
}
|
|
164606
|
+
),
|
|
164607
|
+
selection ? /* @__PURE__ */ jsx(
|
|
164608
|
+
FloatingToolbar,
|
|
164609
|
+
{
|
|
164610
|
+
selection,
|
|
164611
|
+
selectedText: plainText.slice(selection.start, selection.end),
|
|
164612
|
+
tone: toolbarTone,
|
|
164613
|
+
presentationContext,
|
|
164614
|
+
openMenu,
|
|
164615
|
+
setOpenMenu,
|
|
164616
|
+
onToggleStrong: () => toggleMark2("strong"),
|
|
164617
|
+
onToggleEmphasis: () => toggleMark2("emphasis"),
|
|
164618
|
+
onApplyAccent: (tone) => applyMark({ kind: "accent", tone }),
|
|
164619
|
+
onRemoveAccent: () => removeMark2("accent"),
|
|
164620
|
+
onApplyHighlight: (tone) => applyMark({ kind: "highlight", tone }),
|
|
164621
|
+
onRemoveHighlight: () => removeMark2("highlight")
|
|
164622
|
+
}
|
|
164623
|
+
) : null
|
|
164624
|
+
] });
|
|
164625
|
+
}
|
|
164626
|
+
|
|
162736
164627
|
// ../../node_modules/.pnpm/orderedmap@2.1.1/node_modules/orderedmap/dist/index.js
|
|
162737
164628
|
function OrderedMap(content) {
|
|
162738
164629
|
this.content = content;
|
|
@@ -183340,7 +185231,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
183340
185231
|
return x === y2 && (x !== 0 || 1 / x === 1 / y2) || x !== x && y2 !== y2;
|
|
183341
185232
|
}
|
|
183342
185233
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
183343
|
-
var
|
|
185234
|
+
var useState98 = React$1.useState, useEffect103 = React$1.useEffect, useLayoutEffect11 = React$1.useLayoutEffect, useDebugValue2 = React$1.useDebugValue;
|
|
183344
185235
|
var didWarnOld18Alpha = false;
|
|
183345
185236
|
var didWarnUncachedGetSnapshot = false;
|
|
183346
185237
|
function useSyncExternalStore7(subscribe, getSnapshot, getServerSnapshot) {
|
|
@@ -183362,7 +185253,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
183362
185253
|
}
|
|
183363
185254
|
}
|
|
183364
185255
|
}
|
|
183365
|
-
var _useState =
|
|
185256
|
+
var _useState = useState98({
|
|
183366
185257
|
inst: {
|
|
183367
185258
|
value,
|
|
183368
185259
|
getSnapshot
|
|
@@ -183377,7 +185268,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
183377
185268
|
});
|
|
183378
185269
|
}
|
|
183379
185270
|
}, [subscribe, value, getSnapshot]);
|
|
183380
|
-
|
|
185271
|
+
useEffect103(function() {
|
|
183381
185272
|
if (checkIfSnapshotChanged(inst)) {
|
|
183382
185273
|
forceUpdate({
|
|
183383
185274
|
inst
|
|
@@ -183642,9 +185533,9 @@ function requireWithSelector_development() {
|
|
|
183642
185533
|
}
|
|
183643
185534
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
183644
185535
|
var useSyncExternalStore7 = shim2.useSyncExternalStore;
|
|
183645
|
-
var
|
|
185536
|
+
var useRef84 = React$1.useRef, useEffect103 = React$1.useEffect, useMemo95 = React$1.useMemo, useDebugValue2 = React$1.useDebugValue;
|
|
183646
185537
|
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
183647
|
-
var instRef =
|
|
185538
|
+
var instRef = useRef84(null);
|
|
183648
185539
|
var inst;
|
|
183649
185540
|
if (instRef.current === null) {
|
|
183650
185541
|
inst = {
|
|
@@ -183655,7 +185546,7 @@ function requireWithSelector_development() {
|
|
|
183655
185546
|
} else {
|
|
183656
185547
|
inst = instRef.current;
|
|
183657
185548
|
}
|
|
183658
|
-
var _useMemo =
|
|
185549
|
+
var _useMemo = useMemo95(function() {
|
|
183659
185550
|
var hasMemo = false;
|
|
183660
185551
|
var memoizedSnapshot;
|
|
183661
185552
|
var memoizedSelection;
|
|
@@ -183699,7 +185590,7 @@ function requireWithSelector_development() {
|
|
|
183699
185590
|
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
183700
185591
|
}, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection2 = _useMemo[0], getServerSelection = _useMemo[1];
|
|
183701
185592
|
var value = useSyncExternalStore7(subscribe, getSelection2, getServerSelection);
|
|
183702
|
-
|
|
185593
|
+
useEffect103(function() {
|
|
183703
185594
|
inst.hasValue = true;
|
|
183704
185595
|
inst.value = value;
|
|
183705
185596
|
}, [value]);
|
|
@@ -184558,6 +186449,8 @@ function PreviewTextEditor(props2) {
|
|
|
184558
186449
|
children,
|
|
184559
186450
|
className,
|
|
184560
186451
|
maxLength,
|
|
186452
|
+
placeholder = "Add text",
|
|
186453
|
+
ariaLabel,
|
|
184561
186454
|
as: Comp = "span"
|
|
184562
186455
|
} = props2;
|
|
184563
186456
|
const { isEditingMode } = useEditor();
|
|
@@ -184574,6 +186467,8 @@ function PreviewTextEditor(props2) {
|
|
|
184574
186467
|
const [lastSyncedVersion, setLastSyncedVersion] = useState(version2);
|
|
184575
186468
|
const [isFocused, setIsFocused] = useState(false);
|
|
184576
186469
|
const normalizedValue = normalizeValue(value, fallbackValue);
|
|
186470
|
+
const isEmpty = normalizedValue.trim().length === 0;
|
|
186471
|
+
const accessibleLabel = ariaLabel ?? placeholder;
|
|
184577
186472
|
const handleSetValue = useCallback(
|
|
184578
186473
|
(nextValue) => {
|
|
184579
186474
|
setValue(limitTextLength(nextValue, maxLength));
|
|
@@ -184606,6 +186501,7 @@ function PreviewTextEditor(props2) {
|
|
|
184606
186501
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
184607
186502
|
/* @__PURE__ */ jsx("style", { children: `
|
|
184608
186503
|
[data-rb-preview-text-editor] {
|
|
186504
|
+
min-width: 1ch;
|
|
184609
186505
|
outline: 1px dashed transparent;
|
|
184610
186506
|
outline-offset: 2px;
|
|
184611
186507
|
transition: outline-color 160ms ease, background-color 160ms ease;
|
|
@@ -184618,12 +186514,18 @@ function PreviewTextEditor(props2) {
|
|
|
184618
186514
|
outline: 1px dashed rgba(156, 163, 175, 0.75) !important;
|
|
184619
186515
|
outline-offset: 2px !important;
|
|
184620
186516
|
}
|
|
186517
|
+
[data-rb-preview-text-editor][data-rb-preview-text-empty="true"]::before {
|
|
186518
|
+
content: attr(data-placeholder);
|
|
186519
|
+
color: rgba(148, 163, 184, 0.86);
|
|
186520
|
+
}
|
|
184621
186521
|
` }),
|
|
184622
186522
|
/* @__PURE__ */ jsx(
|
|
184623
186523
|
Comp,
|
|
184624
186524
|
{
|
|
184625
186525
|
"data-rb-preview-text-editor": true,
|
|
186526
|
+
"data-rb-preview-text-empty": isEmpty ? "true" : void 0,
|
|
184626
186527
|
"data-rb-preview-text-linked-focus": isLinkedSidebarFocus ? "true" : void 0,
|
|
186528
|
+
"data-placeholder": placeholder,
|
|
184627
186529
|
ref: (node) => {
|
|
184628
186530
|
editableRef.current = node;
|
|
184629
186531
|
if (!node) return;
|
|
@@ -184633,6 +186535,9 @@ function PreviewTextEditor(props2) {
|
|
|
184633
186535
|
},
|
|
184634
186536
|
contentEditable: true,
|
|
184635
186537
|
suppressContentEditableWarning: true,
|
|
186538
|
+
role: "textbox",
|
|
186539
|
+
"aria-multiline": "false",
|
|
186540
|
+
"aria-label": accessibleLabel,
|
|
184636
186541
|
className: `rounded px-1 transition-colors focus:bg-white/10 focus-visible:bg-white/10 ${isLinkedSidebarFocus || isFocused ? "bg-white/5" : ""} ${className ?? ""}`,
|
|
184637
186542
|
onInput: (event) => {
|
|
184638
186543
|
const nextValue = readLimitedEditableText(event.currentTarget);
|
|
@@ -184694,6 +186599,55 @@ function moveCaretToEnd(element) {
|
|
|
184694
186599
|
selection.removeAllRanges();
|
|
184695
186600
|
selection.addRange(range);
|
|
184696
186601
|
}
|
|
186602
|
+
function PreviewInlineTextEditor({
|
|
186603
|
+
path,
|
|
186604
|
+
plainTextPath,
|
|
186605
|
+
fallbackPlainText = "",
|
|
186606
|
+
onBlockFieldFocus,
|
|
186607
|
+
className,
|
|
186608
|
+
maxLength,
|
|
186609
|
+
placeholder = "Add heading",
|
|
186610
|
+
ariaLabel,
|
|
186611
|
+
as: Comp = "span"
|
|
186612
|
+
}) {
|
|
186613
|
+
const { isEditingMode } = useEditor();
|
|
186614
|
+
const { value, setValue } = useStoreBinding(path);
|
|
186615
|
+
const { value: plainTextValue, setValue: setPlainTextValue } = useStoreBinding(plainTextPath);
|
|
186616
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
186617
|
+
const isLinkedSidebarFocus = useEditorUiStore(
|
|
186618
|
+
(state) => path ? isLinkedSidebarField(path, state.activePreviewField) : false
|
|
186619
|
+
);
|
|
186620
|
+
const editorValue = useMemo(
|
|
186621
|
+
() => coerceInlineTextWithFallback(value, typeof plainTextValue === "string" ? plainTextValue : fallbackPlainText),
|
|
186622
|
+
[fallbackPlainText, plainTextValue, value]
|
|
186623
|
+
);
|
|
186624
|
+
const handleChange = useCallback(
|
|
186625
|
+
(nextValue, plainText) => {
|
|
186626
|
+
setValue(nextValue);
|
|
186627
|
+
setPlainTextValue(plainText);
|
|
186628
|
+
},
|
|
186629
|
+
[setPlainTextValue, setValue]
|
|
186630
|
+
);
|
|
186631
|
+
if (!isEditingMode) return null;
|
|
186632
|
+
return /* @__PURE__ */ jsx(
|
|
186633
|
+
InlineTextEditor,
|
|
186634
|
+
{
|
|
186635
|
+
value: editorValue,
|
|
186636
|
+
onChange: handleChange,
|
|
186637
|
+
as: Comp,
|
|
186638
|
+
maxLength,
|
|
186639
|
+
placeholder,
|
|
186640
|
+
ariaLabel: ariaLabel ?? placeholder,
|
|
186641
|
+
toolbarTone: "dark",
|
|
186642
|
+
className: `rounded px-1 transition-colors focus:bg-white/10 focus-visible:bg-white/10 ${isLinkedSidebarFocus || isFocused ? "bg-white/5" : ""} ${className ?? ""}`,
|
|
186643
|
+
onFocus: () => {
|
|
186644
|
+
setIsFocused(true);
|
|
186645
|
+
onBlockFieldFocus?.(path);
|
|
186646
|
+
},
|
|
186647
|
+
onBlur: () => setIsFocused(false)
|
|
186648
|
+
}
|
|
186649
|
+
);
|
|
186650
|
+
}
|
|
184697
186651
|
var PreviewRichTextEditorInner = ({
|
|
184698
186652
|
path,
|
|
184699
186653
|
linkedEntryField,
|
|
@@ -184701,7 +186655,9 @@ var PreviewRichTextEditorInner = ({
|
|
|
184701
186655
|
onBlockFieldFocus,
|
|
184702
186656
|
className = "",
|
|
184703
186657
|
doc: doc3,
|
|
184704
|
-
variant
|
|
186658
|
+
variant,
|
|
186659
|
+
placeholder = "Add description",
|
|
186660
|
+
ariaLabel
|
|
184705
186661
|
}) => {
|
|
184706
186662
|
const bindingInput = linkedEntryField?.write ?? path;
|
|
184707
186663
|
if (!bindingInput) {
|
|
@@ -184771,7 +186727,9 @@ var PreviewRichTextEditorInner = ({
|
|
|
184771
186727
|
"div",
|
|
184772
186728
|
{
|
|
184773
186729
|
"data-rb-preview-richtext-editor": true,
|
|
186730
|
+
"data-placeholder": placeholder,
|
|
184774
186731
|
"data-rb-preview-richtext-linked-focus": isLinkedSidebarFocus ? "true" : void 0,
|
|
186732
|
+
"aria-label": ariaLabel ?? placeholder,
|
|
184775
186733
|
className: `relative w-full min-w-0 ${className}`,
|
|
184776
186734
|
onMouseEnter: () => setIsHovered(true),
|
|
184777
186735
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -184803,6 +186761,7 @@ var PreviewRichTextEditorInner = ({
|
|
|
184803
186761
|
className: `relative w-full min-h-[30px] rounded border border-dashed ${showAffordance ? "border-slate-400/75 bg-white/5" : "border-transparent bg-transparent"}`,
|
|
184804
186762
|
contentClassName: "cursor-text",
|
|
184805
186763
|
placeholderClassName: "text-gray-400",
|
|
186764
|
+
placeholderText: placeholder,
|
|
184806
186765
|
toolbarAlwaysVisible: false,
|
|
184807
186766
|
toolbarTone: "dark",
|
|
184808
186767
|
toolbarPortalToChrome: false,
|
|
@@ -189569,4 +191528,4 @@ lucide-react/dist/esm/lucide-react.mjs:
|
|
|
189569
191528
|
*)
|
|
189570
191529
|
*/
|
|
189571
191530
|
|
|
189572
|
-
export { AMBIENT_BACKGROUND_ROLES2 as AMBIENT_BACKGROUND_ROLES, ArrowDown, ArrowUp, BackgroundColorField, BackgroundGradientField, Badge2 as Badge, BlockApiProvider, Box, Button, CSS2 as CSS, Callout, CalloutDescription, CalloutTitle, Card, CardContent, CardHeader, CardTitle, Check, ChevronDown, ChevronLeft, ChevronRight, Collapsible2 as Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorPicker, Combobox, CommandMultiSelect, Content, ContentFieldsForm, ContentSpinner, Copy, DEFAULT_LAUNCH_READINESS_INPUT, Dialog2 as Dialog, DialogClose2 as DialogClose, DialogContent2 as DialogContent, DialogDescription2 as DialogDescription, DialogFooter, DialogHeader, DialogTitle2 as DialogTitle, DndContext, DropdownMenu2 as DropdownMenu, DropdownMenuContent2 as DropdownMenuContent, DropdownMenuItem2 as DropdownMenuItem, DropdownMenuLabel2 as DropdownMenuLabel, DropdownMenuSeparator2 as DropdownMenuSeparator, DropdownMenuTrigger2 as DropdownMenuTrigger, EDITABLE_SURFACE_FORWARDING_PROP, EMPTY_DOC, EditableBlockProvider, EditorChrome, EditorProvider, EllipsisVertical, EmptyState2 as EmptyState, EntryControllerProvider, EyeOff, FieldFrame, FixedBottomSurface, FormRenderer, GRADIENT_PRESETS, GripVertical, Image, ImagePlus, Input, KeyboardCode, LINKED_CONTENT_ENTRY_META_KEY, Label4 as Label, List2 as List, LoaderCircle, ManifestForm, Maximize2, MediaEditor, MediaEditorProvider, MediaPickerDialog, MediaPickerMini, Monitor, PAGE_DESIGN_EDITOR_STATE_FETCH_ERROR_MESSAGE, PUBLIC_FILE_FIELD_KINDS, PageRenderer, Palette, PaletteProvider, Pencil, Plus, PointerSensor, PreviewDesignCoordinatorProvider, PreviewDesignHistoryOrderProvider, PreviewRichTextEditor, PreviewTextEditor, PreviewThemeOverlayProvider, ResizableSplitPane, ResponsiveScope, RichText2 as RichText, RichTextEditorSurface, Root2, RotateCcw, SECTION_BACKGROUND_MIN_SOURCE_HEIGHT, SECTION_BACKGROUND_MIN_SOURCE_WIDTH, SITE_CHROME_CLASS_NAMES, SITE_CHROME_VISIBLE_HEADER_SELECTOR, SUBROUTE_KINDS, ScrollableDialogContent, SdkConfigProvider, Search, Select2 as Select, SelectContent2 as SelectContent, SelectItem2 as SelectItem, SelectTrigger2 as SelectTrigger, SelectValue2 as SelectValue, Separator2 as Separator, Settings, SiteChromeCustomizeProvider, SiteDocumentLayout, Smartphone, Sparkles, Surface, Tablet, Tabs2 as Tabs, TabsContent2 as TabsContent, TabsList2 as TabsList, TabsTrigger2 as TabsTrigger, Text2 as Text, Textarea, ThemeScope, Trash2, TriangleAlert, Trigger, Upload, X, applyBackgroundOverrideContentPatch, applyCompiledRuntimeFieldsToContent, applyFeatureCardIconSuggestions, applyPageDesignEditorAction, applyResolvedSelections, asDesignBlockId, asRecord, assertNever, assertNever5 as assertNever2, attachRenderableMediaAssetFields, augmentManifestWithStyleGroups, backgroundColorTokens, backgroundOverrideEquals, beginAutosaveBatch, buildApplySiteStyleSelectionBody, buildEditorModelRuntimeFieldsByBlockId, buildSiteChromeLookModels, buildThemeRuntime, buttonPersonalities, canCycleBackgroundOverrideValue, canRedoHistory, canUndoHistory, cancelPreview, classifyHistoryShortcut, classifyKnownMimeType, clearTypographyFontOverrides, clientComponentRegistry, closestCenter, cn, confirmAutosaveBatch, createBlock, createCustomBlockRegistry, createEditorInsertBlockCommand, createEditorRemoveBlockCommand, createEditorReorderBlocksCommand, createEntrySlotBlock, createFeatureCardIconKey, createHistoryState, createManifestFormAdapter, createManifestValidation, createMicrobatcher, createOptimisticActionRunner, createRoutingHelpers, createSnapshotFromPageRecord, createStoreBackend, createStyleConfiguratorState, curatedSiteStyles, cycleSiteChromeLookId, cycleableSiteChromeOptions, decodePublicProductCategorySelectorQuery, defaultBackgroundOverrideForMode, defaultSectionTransitionVariantForFamily, deleteBlock, deleteEntrySlotBlock, deriveLaunchReadiness, deriveRouteMetadataPresentation, deriveStyleConfiguratorCapabilities, deriveTransactionCapabilities, designRuntimeRulesForTheme, dismissNotices, dismissWarnings, emitMediaCropDebug, enabledBackgroundModes, enqueueTransaction, evaluateTypographyFontSlot, evaluateVisibility, expectParsedBrandedId, findButtonPersonality, findFooterLook, findPaletteVariant, findTypographyPreset, foldSubroute, formatSiteChromeBackgroundTokenLabel, getBlockDefinition, getBlockIconSemanticFallbackId, getClientRect, getCuratedSiteStyle, getDirectImageUrlForMediaAsset, getFeatureCardIconCompletion, getFieldIntent, getFooterLayout, getGeneratedBlockIconStyleState, getHeaderLayout, getHeaderStyle, getIconComponent, getIconPickerOptionsForPreset, getLinkedContentEntryMeta, getModalConfig, getPageDesignEditorState, getRichTextImagePositionFromTarget, gradientToCss, idleEditorTransactionQueueState, imagePoolForOverride, inferLegacyOfferingsPreviewGroupOrder, insertOrReplaceRichTextImage, isHeaderField, isIconPickerPreset, isInternalResolvedLinkValue, isKeyboardEvent, isKnownIconName, isNonEmptyValue, isObjectRecord2 as isObjectRecord, isOfferingsPreviewSourceKey, isPreviewingChange, isSupportedLoaderEndpoint, isSvgMimeType, isThemeV2NormalEditorRawStyleFieldName, isThemeV2NormalEditorRawStylePath, listBlockDescriptors, listContentTypes, listEntryPageContentSlots, lucide_react_exports, markApplyFailed, markApplySaved, markApplySaving, mergeBlockDescriptorsWithRegistry, mergeManifestWithSdkOptions, mutateBlockContent, normalEditorCuratedPromotedFieldPaths, normalizeOfferingsPreviewGroupOrder, normalizePickerSearchThreshold, normalizePublicApiLoaderParams, openRow, paletteOverridesSchema, paletteVariants, parseAspectRatioValue, parseBackgroundOverrideFromContent, parseBlockIconValue, parseMediaAssetId, parseSiteIconStyleGuideVersionId, parseSiteId, planBackgroundOverride, planBackgroundTransition, planPageDesignLayoutLookCompatibility, planSiteChromeFooterLayoutSelection, planSiteChromeLookSelection, planSiteDocument, planSiteStylePreviewChange, prefetchBlockData, previewAssistantEnabled, previewButtonPersonality, previewDesignHistoryDomainForCommand, previewFooterLook, previewHeaderLayout, previewHeaderStyle, previewPaletteVariant, previewSiteStyle, previewTypographyPreset, pushHistoryEntry, rankBackgroundImagePoolItems, recoveryConflictCopy, redoHistory, rejectAutosaveBatch, renderBlock, reorderBlocks, reorderEntrySlotBlocks, requireEntriesForCuratedChoices, resolveBackgroundCapability, resolveBlockTitle, resolveContentTitle, resolveIconPickerPreset, resolveImageUrlWithContext, resolveMediaSlotContract, resolveOfferingsPreviewGroupOrderEntries, resolvePageRouteSlug, resolvePickerSelectionLabel, resolvePreviewSidebarTab, resolveStyleConfiguratorInitialSnapshot, resolveVideoSelectionIntentForMediaField, resolveVisiblePromotedFieldPathsForEditorBlock, sectionTransitionFamilies, sectionTransitionFamilyForBoundaryOptionId, sectionTransitionVariantForBoundaryOptionId, selectPreviewDesignHistoryDomain, selectionSnapshotFromApplySiteStyleSelectionResponse, setPaletteOverrides, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, shouldShowPickerSearch, siteFooterManifest, siteHeaderManifest, siteOptionSources, stableSerialize, styleConfiguratorHistoryEntryForPersistedSelection, suggestFeatureCardSemanticIcons, suggestSemanticIconForFeatureCard, surfaceResolutionContextFromTheme, syncStyleConfiguratorState, systemCustomizeFacetAppliesToLayoutVariant, systemCustomizeFacetApplyContentPatch, systemCustomizeFacetCurrentValue, systemCustomizeFacetDefinitionForBlock, systemCustomizeFacetDefinitionsForBlock, systemCustomizeFacetLabelForValue, systemCustomizeFacetNextValue, systemCustomizeFacetRollbackContentPatch, toFeatureCardIconSuggestionInputs, toRoutableLinkPayload, toggleRow, typographyPresets, undoHistory, unfinishedBlockCopy, unsafeAsEditorBlockId, unsafeAsEditorBlockValues, unsafeAsLinkedContentEntryId, useAsyncPickerOptions, useBackendWatch, useBlockContext, useCombinedRefs, useDebouncedLatestSave, useDndContext, useDraggable, useDroppable, useEditor, useEditorUiStore, useEditorUiStoreInstance, useEntryController, useEntryEditorController, useField, useIsomorphicLayoutEffect3 as useIsomorphicLayoutEffect, useMediaEditor, useMediaEditorOptional, useMultiAutosave, useOptionalEditorUiStoreInstance, usePreviewDesignCoordinator, usePreviewDesignHistoryOrder, usePreviewThemeOverlay, useRichTextEditor, useSdkConfig, useSensor, useSensors, useSiteChromeCustomizeOptional, useUISelector, useUniqueId, validateBlockManifestIssues, visibleHeaderClearancePx };
|
|
191531
|
+
export { AMBIENT_BACKGROUND_ROLES2 as AMBIENT_BACKGROUND_ROLES, ArrowDown, ArrowUp, BackgroundColorField, BackgroundGradientField, Badge2 as Badge, BlockApiProvider, Box, Button, CSS2 as CSS, Callout, CalloutDescription, CalloutTitle, Card, CardContent, CardHeader, CardTitle, Check, ChevronDown, ChevronLeft, ChevronRight, Collapsible2 as Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorPicker, Combobox, CommandMultiSelect, Content, ContentFieldsForm, ContentSpinner, Copy, DEFAULT_LAUNCH_READINESS_INPUT, Dialog2 as Dialog, DialogClose2 as DialogClose, DialogContent2 as DialogContent, DialogDescription2 as DialogDescription, DialogFooter, DialogHeader, DialogTitle2 as DialogTitle, DndContext, DropdownMenu2 as DropdownMenu, DropdownMenuContent2 as DropdownMenuContent, DropdownMenuItem2 as DropdownMenuItem, DropdownMenuLabel2 as DropdownMenuLabel, DropdownMenuSeparator2 as DropdownMenuSeparator, DropdownMenuTrigger2 as DropdownMenuTrigger, EDITABLE_SURFACE_FORWARDING_PROP, EMPTY_DOC, EditableBlockProvider, EditorChrome, EditorProvider, EllipsisVertical, EmptyState2 as EmptyState, EntryControllerProvider, EyeOff, FieldFrame, FixedBottomSurface, FormRenderer, GRADIENT_PRESETS, GripVertical, Image, ImagePlus, InlineTextEditor, Input, KeyboardCode, LINKED_CONTENT_ENTRY_META_KEY, Label4 as Label, List2 as List, LoaderCircle, ManifestForm, Maximize2, MediaEditor, MediaEditorProvider, MediaPickerDialog, MediaPickerMini, Monitor, PAGE_DESIGN_EDITOR_STATE_FETCH_ERROR_MESSAGE, PUBLIC_FILE_FIELD_KINDS, PageRenderer, Palette, PaletteProvider, Pencil, Plus, PointerSensor, PreviewDesignCoordinatorProvider, PreviewDesignHistoryOrderProvider, PreviewInlineTextEditor, PreviewRichTextEditor, PreviewTextEditor, PreviewThemeOverlayProvider, ResizableSplitPane, ResponsiveScope, RichText2 as RichText, RichTextEditorSurface, Root2, RotateCcw, SECTION_BACKGROUND_MIN_SOURCE_HEIGHT, SECTION_BACKGROUND_MIN_SOURCE_WIDTH, SITE_CHROME_CLASS_NAMES, SITE_CHROME_VISIBLE_HEADER_SELECTOR, SUBROUTE_KINDS, ScrollableDialogContent, SdkConfigProvider, Search, Select2 as Select, SelectContent2 as SelectContent, SelectItem2 as SelectItem, SelectTrigger2 as SelectTrigger, SelectValue2 as SelectValue, Separator2 as Separator, Settings, SiteChromeCustomizeProvider, SiteDocumentLayout, Smartphone, Sparkles, Surface, Tablet, Tabs2 as Tabs, TabsContent2 as TabsContent, TabsList2 as TabsList, TabsTrigger2 as TabsTrigger, Text2 as Text, Textarea, ThemeScope, Trash2, TriangleAlert, Trigger, Upload, X, applyBackgroundOverrideContentPatch, applyCompiledRuntimeFieldsToContent, applyFeatureCardIconSuggestions, applyPageDesignEditorAction, applyResolvedSelections, asDesignBlockId, asRecord, assertNever, assertNever5 as assertNever2, attachRenderableMediaAssetFields, augmentManifestWithStyleGroups, backgroundColorTokens, backgroundOverrideEquals, beginAutosaveBatch, buildApplySiteStyleSelectionBody, buildEditorModelRuntimeFieldsByBlockId, buildSiteChromeLookModels, buildThemeRuntime, buttonPersonalities, canCycleBackgroundOverrideValue, canRedoHistory, canUndoHistory, cancelPreview, classifyHistoryShortcut, classifyKnownMimeType, clearTypographyFontOverrides, clientComponentRegistry, closestCenter, cn, coerceInlineTextWithFallback, confirmAutosaveBatch, createBlock, createCustomBlockRegistry, createEditorInsertBlockCommand, createEditorRemoveBlockCommand, createEditorReorderBlocksCommand, createEntrySlotBlock, createFeatureCardIconKey, createHistoryState, createManifestFormAdapter, createManifestValidation, createMicrobatcher, createOptimisticActionRunner, createRoutingHelpers, createSnapshotFromPageRecord, createStoreBackend, createStyleConfiguratorState, curatedSiteStyles, cycleSiteChromeLookId, cycleableSiteChromeOptions, decodePublicProductCategorySelectorQuery, defaultBackgroundOverrideForMode, defaultSectionTransitionVariantForFamily, deleteBlock, deleteEntrySlotBlock, deriveLaunchReadiness, deriveRouteMetadataPresentation, deriveStyleConfiguratorCapabilities, deriveTransactionCapabilities, designRuntimeRulesForTheme, dismissNotices, dismissWarnings, emitMediaCropDebug, enabledBackgroundModes, enqueueTransaction, evaluateTypographyFontSlot, evaluateVisibility, expectParsedBrandedId, findButtonPersonality, findFooterLook, findPaletteVariant, findTypographyPreset, foldSubroute, formatSiteChromeBackgroundTokenLabel, getAtPath, getBlockDefinition, getBlockIconSemanticFallbackId, getClientRect, getCuratedSiteStyle, getDirectImageUrlForMediaAsset, getFeatureCardIconCompletion, getFieldIntent, getFooterLayout, getGeneratedBlockIconStyleState, getHeaderLayout, getHeaderStyle, getIconComponent, getIconPickerOptionsForPreset, getLinkedContentEntryMeta, getModalConfig, getPageDesignEditorState, getRichTextImagePositionFromTarget, gradientToCss, idleEditorTransactionQueueState, imagePoolForOverride, inferLegacyOfferingsPreviewGroupOrder, inlineTextToPlainText, insertOrReplaceRichTextImage, isHeaderField, isIconPickerPreset, isInlineTextEmpty, isInternalResolvedLinkValue, isKeyboardEvent, isKnownIconName, isNonEmptyValue, isObjectRecord2 as isObjectRecord, isOfferingsPreviewSourceKey, isPreviewingChange, isSupportedLoaderEndpoint, isSvgMimeType, isThemeV2NormalEditorRawStyleFieldName, isThemeV2NormalEditorRawStylePath, listBlockDescriptors, listContentTypes, listEntryPageContentSlots, lucide_react_exports, markApplyFailed, markApplySaved, markApplySaving, mergeBlockDescriptorsWithRegistry, mergeManifestWithSdkOptions, mutateBlockContent, normalEditorCuratedPromotedFieldPaths, normalizeOfferingsPreviewGroupOrder, normalizePickerSearchThreshold, normalizePublicApiLoaderParams, openRow, paletteOverridesSchema, paletteVariants, parseAspectRatioValue, parseBackgroundOverrideFromContent, parseBlockIconValue, parseMediaAssetId, parseSiteIconStyleGuideVersionId, parseSiteId, planBackgroundOverride, planBackgroundTransition, planPageDesignLayoutLookCompatibility, planSiteChromeFooterLayoutSelection, planSiteChromeLookSelection, planSiteDocument, planSiteStylePreviewChange, prefetchBlockData, previewAssistantEnabled, previewButtonPersonality, previewDesignHistoryDomainForCommand, previewFooterLook, previewHeaderLayout, previewHeaderStyle, previewPaletteVariant, previewSiteStyle, previewTypographyPreset, pushHistoryEntry, rankBackgroundImagePoolItems, recoveryConflictCopy, redoHistory, rejectAutosaveBatch, renderBlock, renderInlineText, reorderBlocks, reorderEntrySlotBlocks, requireEntriesForCuratedChoices, resolveBackgroundCapability, resolveBlockTitle, resolveContentTitle, resolveIconPickerPreset, resolveImageUrlWithContext, resolveMediaSlotContract, resolveOfferingsPreviewGroupOrderEntries, resolvePageRouteSlug, resolvePickerSelectionLabel, resolvePreviewSidebarTab, resolveStyleConfiguratorInitialSnapshot, resolveVideoSelectionIntentForMediaField, resolveVisiblePromotedFieldPathsForEditorBlock, sectionTransitionFamilies, sectionTransitionFamilyForBoundaryOptionId, sectionTransitionVariantForBoundaryOptionId, selectPreviewDesignHistoryDomain, selectionSnapshotFromApplySiteStyleSelectionResponse, setPaletteOverrides, setTypographyBodyFontOverride, setTypographyHeadingFontOverride, shouldShowPickerSearch, siblingPath, siteFooterManifest, siteHeaderManifest, siteOptionSources, stableSerialize, styleConfiguratorHistoryEntryForPersistedSelection, suggestFeatureCardSemanticIcons, suggestSemanticIconForFeatureCard, surfaceResolutionContextFromTheme, syncStyleConfiguratorState, systemCustomizeFacetAppliesToLayoutVariant, systemCustomizeFacetApplyContentPatch, systemCustomizeFacetCurrentValue, systemCustomizeFacetDefinitionForBlock, systemCustomizeFacetDefinitionsForBlock, systemCustomizeFacetLabelForValue, systemCustomizeFacetNextValue, systemCustomizeFacetRollbackContentPatch, toFeatureCardIconSuggestionInputs, toRoutableLinkPayload, toggleRow, typographyPresets, undoHistory, unfinishedBlockCopy, unsafeAsEditorBlockId, unsafeAsEditorBlockValues, unsafeAsLinkedContentEntryId, useAsyncPickerOptions, useBackendWatch, useBlockContext, useCombinedRefs, useDebouncedLatestSave, useDndContext, useDraggable, useDroppable, useEditor, useEditorUiStore, useEditorUiStoreInstance, useEntryController, useEntryEditorController, useField, useIsomorphicLayoutEffect3 as useIsomorphicLayoutEffect, useMediaEditor, useMediaEditorOptional, useMultiAutosave, useOptionalEditorUiStoreInstance, usePreviewDesignCoordinator, usePreviewDesignHistoryOrder, usePreviewThemeOverlay, useRichTextEditor, useSdkConfig, useSensor, useSensors, useSiteChromeCustomizeOptional, useUISelector, useUniqueId, validateBlockManifestIssues, visibleHeaderClearancePx };
|