@riverbankcms/sdk 0.95.0 → 0.96.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 +27 -4
- package/dist/{PreviewEditorSidebar-6FQYKOSB.mjs → PreviewEditorSidebar-46VT4QVU.mjs} +2 -2
- package/dist/{PreviewEditorUI-NPO2XMFB.mjs → PreviewEditorUI-JD75GE5F.mjs} +2 -2
- package/dist/SdkPreviewModeRuntime-MJUSYUFB.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +10 -10
- 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/bindings/index.d.ts +1 -0
- package/dist/_dts/blocks/src/bindings/types.d.ts +1 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -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/faq.d.ts +2 -29677
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +2 -29655
- 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/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/runtime/nodes/basic.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/renderInlineText.d.ts +3 -0
- 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-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 +1 -0
- 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/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/scopes/commandBackedDatedOfferingScope.d.ts +2 -6
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/commands/push/verification.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +2 -1
- 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/writer.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 +21 -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/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/config/field-definitions.d.ts +8 -3
- package/dist/_dts/sdk/src/config/typed-entries.d.ts +5 -3
- package/dist/_dts/sdk/src/contracts/bindings.d.ts +1 -0
- 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 +3 -2
- package/dist/_dts/sdk/src/rendering/helpers/bindings.d.ts +1 -0
- 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-K2SJTZMX.mjs → chunk-4TLTV7OB.mjs} +1 -1
- package/dist/{chunk-4A6NWO3X.mjs → chunk-EL55VV6Q.mjs} +47 -7
- package/dist/{chunk-PJPFTVZG.mjs → chunk-VHIMXQ7Z.mjs} +105 -3
- package/dist/{chunk-VZBSD4AJ.mjs → chunk-XMATDBXO.mjs} +1633 -225
- package/dist/cli/index.mjs +2691 -772
- package/dist/cli/init-docs/content/cli-reference.md +43 -4
- package/dist/cli/init-docs/content/content-management.md +22 -0
- package/dist/client/{accordion-LGO4IO5U.mjs → accordion-GUNXIIZR.mjs} +1 -1
- package/dist/client/{bookingForm-MWLS4LGU.mjs → bookingForm-AOU4VHP5.mjs} +3 -3
- package/dist/client/{carousel-6AHNP5HA.mjs → carousel-4QSX2JPC.mjs} +1 -1
- package/dist/client/{cart-CIXGYAZB.mjs → cart-JKN6C4ZB.mjs} +4 -4
- package/dist/client/{checkout-OTX6O3DN.mjs → checkout-YY6YMITW.mjs} +4 -4
- package/dist/client/{chunk-Y2PMKCXO.mjs → chunk-6H27K6AA.mjs} +1 -1
- package/dist/client/{chunk-R3NQTBWE.mjs → chunk-A3YN7M3G.mjs} +1 -1
- package/dist/client/{chunk-TREIML53.mjs → chunk-BFCJZODD.mjs} +3 -3
- package/dist/client/{chunk-INRIT6DP.mjs → chunk-CPKMJVBD.mjs} +5 -5
- package/dist/client/{chunk-V67AT7ZW.mjs → chunk-GWCRCJLB.mjs} +6 -0
- package/dist/client/{chunk-AVBQSUIS.mjs → chunk-H7A6PUGM.mjs} +1 -1
- package/dist/client/{chunk-HOP7MKAZ.mjs → chunk-SY543WZ3.mjs} +1 -1
- package/dist/client/{chunk-MYCXAKWP.mjs → chunk-VJROUYOQ.mjs} +2 -2
- package/dist/client/client.mjs +4007 -3687
- package/dist/client/{courseRegistration-2LU6C3JL.mjs → courseRegistration-UU2KMPSQ.mjs} +3 -3
- package/dist/client/{eventCalendar-OKUSISBZ.mjs → eventCalendar-WIVNS2TM.mjs} +6 -6
- package/dist/client/{eventCombined-CMF6CD4S.mjs → eventCombined-P3G5MW4J.mjs} +6 -6
- package/dist/client/{eventDetails-XYWH7WXI.mjs → eventDetails-2VHJ2RDG.mjs} +6 -6
- package/dist/client/{eventListing-EK5DJTAH.mjs → eventListing-TGO6JI3R.mjs} +6 -6
- package/dist/client/{eventRegistration-XDOSICV6.mjs → eventRegistration-B46HEJES.mjs} +6 -6
- package/dist/client/{form-J6GOHKYG.mjs → form-VKRTFUNQ.mjs} +1 -1
- package/dist/client/{headerSection-C5SYJTRW.mjs → headerSection-XUX4ZJLO.mjs} +2 -2
- package/dist/client/hooks.mjs +20 -3
- package/dist/client/{locationMap-QSQIFVVT.mjs → locationMap-NQFI5MJO.mjs} +2 -2
- package/dist/client/{newsletterForm-47VXJRWK.mjs → newsletterForm-P2GETCQK.mjs} +1 -1
- package/dist/client/{productDetail-5U6ISCC2.mjs → productDetail-7NQ7O5IF.mjs} +4 -4
- package/dist/client/{productList-XDZUMR3P.mjs → productList-RX6ZJ7BL.mjs} +4 -4
- package/dist/client/rendering/client.mjs +3822 -3600
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +1211 -883
- package/dist/client/{shop-ZSZKIY3R.mjs → shop-BHN5AKY6.mjs} +4 -4
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/{sdk-runtime-PHNM7MRD.mjs → sdk-runtime-X2LXQ5IC.mjs} +4 -4
- package/dist/server/components.mjs +3144 -2827
- package/dist/server/config-template-validation.mjs +29 -20
- package/dist/server/config-validation.mjs +22 -4
- package/dist/server/config.mjs +22 -4
- package/dist/server/data.mjs +20 -3
- package/dist/server/index.mjs +1 -1
- package/dist/server/next.mjs +3181 -2858
- package/dist/server/page-converter.mjs +20 -3
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3153 -2837
- package/dist/server/rendering.mjs +3168 -2844
- package/dist/server/routing.mjs +21 -4
- package/dist/server/server.mjs +2299 -2188
- 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
|
@@ -3,7 +3,7 @@ import { unwrapResponse, ApiRequestError, ApiEnvelopeError, extractApiEnvelopeEr
|
|
|
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 z41, { 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';
|
|
@@ -31543,6 +31543,11 @@ var textFieldSchema = baseFieldSchema.extend({
|
|
|
31543
31543
|
var richTextFieldSchema = baseFieldSchema.extend({
|
|
31544
31544
|
type: z.literal("richText")
|
|
31545
31545
|
});
|
|
31546
|
+
var inlineTextFieldSchema = baseFieldSchema.extend({
|
|
31547
|
+
type: z.literal("inlineText"),
|
|
31548
|
+
maxLength: z.number().int().positive().optional(),
|
|
31549
|
+
plainTextField: z.string().min(1).optional()
|
|
31550
|
+
});
|
|
31546
31551
|
var mediaFieldSchema = baseFieldSchema.extend({
|
|
31547
31552
|
type: z.literal("media"),
|
|
31548
31553
|
// Keep full MEDIA_KINDS parse compatibility for pre-file-field manifests.
|
|
@@ -31865,6 +31870,7 @@ function getFieldSchemaInternal() {
|
|
|
31865
31870
|
_fieldSchemaInternal = z.discriminatedUnion("type", [
|
|
31866
31871
|
textFieldSchema,
|
|
31867
31872
|
richTextFieldSchema,
|
|
31873
|
+
inlineTextFieldSchema,
|
|
31868
31874
|
mediaFieldSchema,
|
|
31869
31875
|
fileFieldSchema,
|
|
31870
31876
|
booleanFieldSchema,
|
|
@@ -32048,6 +32054,205 @@ z.object({
|
|
|
32048
32054
|
tags: z.array(z.string()).optional(),
|
|
32049
32055
|
icon: z.string().optional()
|
|
32050
32056
|
});
|
|
32057
|
+
var inlineTextAccentTones = ["accent", "brand", "contrast"];
|
|
32058
|
+
var inlineTextHighlightTones = ["soft", "accent", "brand"];
|
|
32059
|
+
var inlineTextMarkSchema = z.discriminatedUnion("kind", [
|
|
32060
|
+
z.object({ kind: z.literal("strong") }),
|
|
32061
|
+
z.object({ kind: z.literal("emphasis") }),
|
|
32062
|
+
z.object({
|
|
32063
|
+
kind: z.literal("accent"),
|
|
32064
|
+
tone: z.enum(inlineTextAccentTones)
|
|
32065
|
+
}),
|
|
32066
|
+
z.object({
|
|
32067
|
+
kind: z.literal("highlight"),
|
|
32068
|
+
tone: z.enum(inlineTextHighlightTones)
|
|
32069
|
+
})
|
|
32070
|
+
]);
|
|
32071
|
+
var inlineTextRunSchema = z.object({
|
|
32072
|
+
text: z.string(),
|
|
32073
|
+
marks: z.array(inlineTextMarkSchema).optional()
|
|
32074
|
+
});
|
|
32075
|
+
z.array(inlineTextRunSchema);
|
|
32076
|
+
var MARK_ORDER = {
|
|
32077
|
+
strong: 0,
|
|
32078
|
+
emphasis: 1,
|
|
32079
|
+
accent: 2,
|
|
32080
|
+
highlight: 3
|
|
32081
|
+
};
|
|
32082
|
+
function plainTextToInlineText(value) {
|
|
32083
|
+
return normalizeInlineText(value.length > 0 ? [{ text: value }] : []);
|
|
32084
|
+
}
|
|
32085
|
+
function inlineTextToPlainText(value) {
|
|
32086
|
+
return value.map((run3) => run3.text).join("");
|
|
32087
|
+
}
|
|
32088
|
+
function isInlineTextEmpty(value) {
|
|
32089
|
+
return inlineTextToPlainText(value).trim().length === 0;
|
|
32090
|
+
}
|
|
32091
|
+
function coerceInlineTextWithFallback(value, fallbackPlainText) {
|
|
32092
|
+
const parsed = parseInlineTextFromUnknown(value);
|
|
32093
|
+
if (parsed.ok && !isInlineTextEmpty(parsed.value)) {
|
|
32094
|
+
return parsed.value;
|
|
32095
|
+
}
|
|
32096
|
+
if (fallbackPlainText && fallbackPlainText.length > 0) {
|
|
32097
|
+
return plainTextToInlineText(fallbackPlainText);
|
|
32098
|
+
}
|
|
32099
|
+
return parsed.ok ? parsed.value : [];
|
|
32100
|
+
}
|
|
32101
|
+
function parseInlineTextFromUnknown(value) {
|
|
32102
|
+
if (!Array.isArray(value)) {
|
|
32103
|
+
return { ok: false, error: { kind: "not-array" } };
|
|
32104
|
+
}
|
|
32105
|
+
const runs = [];
|
|
32106
|
+
for (let index2 = 0; index2 < value.length; index2 += 1) {
|
|
32107
|
+
const parsed = inlineTextRunSchema.safeParse(value[index2]);
|
|
32108
|
+
if (!parsed.success) {
|
|
32109
|
+
return { ok: false, error: { kind: "invalid-run", index: index2 } };
|
|
32110
|
+
}
|
|
32111
|
+
runs.push(parsed.data);
|
|
32112
|
+
}
|
|
32113
|
+
return { ok: true, value: normalizeInlineText(runs) };
|
|
32114
|
+
}
|
|
32115
|
+
function normalizeInlineText(value) {
|
|
32116
|
+
const normalized = [];
|
|
32117
|
+
for (const run3 of value) {
|
|
32118
|
+
if (run3.text.length === 0) continue;
|
|
32119
|
+
const marks = normalizeInlineTextMarks(run3.marks ?? []);
|
|
32120
|
+
const nextRun = marks.length > 0 ? { text: run3.text, marks } : { text: run3.text };
|
|
32121
|
+
const previous = normalized[normalized.length - 1];
|
|
32122
|
+
if (previous && inlineTextMarksEqual(previous.marks ?? [], nextRun.marks ?? [])) {
|
|
32123
|
+
normalized[normalized.length - 1] = previous.marks && previous.marks.length > 0 ? { text: previous.text + nextRun.text, marks: previous.marks } : { text: previous.text + nextRun.text };
|
|
32124
|
+
continue;
|
|
32125
|
+
}
|
|
32126
|
+
normalized.push(nextRun);
|
|
32127
|
+
}
|
|
32128
|
+
return normalized;
|
|
32129
|
+
}
|
|
32130
|
+
function normalizeInlineTextMarks(marks) {
|
|
32131
|
+
let strong = null;
|
|
32132
|
+
let emphasis = null;
|
|
32133
|
+
let accent = null;
|
|
32134
|
+
let highlight = null;
|
|
32135
|
+
for (const mark of marks) {
|
|
32136
|
+
switch (mark.kind) {
|
|
32137
|
+
case "strong":
|
|
32138
|
+
strong = { kind: "strong" };
|
|
32139
|
+
break;
|
|
32140
|
+
case "emphasis":
|
|
32141
|
+
emphasis = { kind: "emphasis" };
|
|
32142
|
+
break;
|
|
32143
|
+
case "accent":
|
|
32144
|
+
accent = { kind: "accent", tone: mark.tone };
|
|
32145
|
+
break;
|
|
32146
|
+
case "highlight":
|
|
32147
|
+
highlight = { kind: "highlight", tone: mark.tone };
|
|
32148
|
+
break;
|
|
32149
|
+
}
|
|
32150
|
+
}
|
|
32151
|
+
return [strong, emphasis, accent, highlight].filter((mark) => mark !== null).sort((left, right) => MARK_ORDER[left.kind] - MARK_ORDER[right.kind]);
|
|
32152
|
+
}
|
|
32153
|
+
function inlineTextMarksEqual(left, right) {
|
|
32154
|
+
const normalizedLeft = normalizeInlineTextMarks(left);
|
|
32155
|
+
const normalizedRight = normalizeInlineTextMarks(right);
|
|
32156
|
+
if (normalizedLeft.length !== normalizedRight.length) return false;
|
|
32157
|
+
return normalizedLeft.every((mark, index2) => inlineTextMarkEqual(mark, normalizedRight[index2]));
|
|
32158
|
+
}
|
|
32159
|
+
function inlineTextEqual(left, right) {
|
|
32160
|
+
const normalizedLeft = normalizeInlineText(left);
|
|
32161
|
+
const normalizedRight = normalizeInlineText(right);
|
|
32162
|
+
if (normalizedLeft.length !== normalizedRight.length) return false;
|
|
32163
|
+
return normalizedLeft.every((leftRun, index2) => {
|
|
32164
|
+
const rightRun = normalizedRight[index2];
|
|
32165
|
+
return rightRun !== void 0 && leftRun.text === rightRun.text && inlineTextMarksEqual(leftRun.marks ?? [], rightRun.marks ?? []);
|
|
32166
|
+
});
|
|
32167
|
+
}
|
|
32168
|
+
function inlineTextMarkEqual(left, right) {
|
|
32169
|
+
if (!right || left.kind !== right.kind) return false;
|
|
32170
|
+
switch (left.kind) {
|
|
32171
|
+
case "strong":
|
|
32172
|
+
case "emphasis":
|
|
32173
|
+
return true;
|
|
32174
|
+
case "accent":
|
|
32175
|
+
return right.kind === "accent" && left.tone === right.tone;
|
|
32176
|
+
case "highlight":
|
|
32177
|
+
return right.kind === "highlight" && left.tone === right.tone;
|
|
32178
|
+
}
|
|
32179
|
+
}
|
|
32180
|
+
function applyInlineTextMarkToRange(value, range, mark) {
|
|
32181
|
+
return mapInlineTextRange(value, range, (marks) => normalizeInlineTextMarks([...marks, mark]));
|
|
32182
|
+
}
|
|
32183
|
+
function removeInlineTextMarkFromRange(value, range, kind) {
|
|
32184
|
+
return mapInlineTextRange(value, range, (marks) => marks.filter((mark) => mark.kind !== kind));
|
|
32185
|
+
}
|
|
32186
|
+
function replaceInlineTextRange(value, range, replacement) {
|
|
32187
|
+
const textLength = inlineTextToPlainText(value).length;
|
|
32188
|
+
const start = Math.max(0, Math.min(range.start, range.end, textLength));
|
|
32189
|
+
const end = Math.max(0, Math.min(Math.max(range.start, range.end), textLength));
|
|
32190
|
+
return normalizeInlineText([
|
|
32191
|
+
...sliceInlineText(value, 0, start),
|
|
32192
|
+
...normalizeInlineText(replacement),
|
|
32193
|
+
...sliceInlineText(value, end, textLength)
|
|
32194
|
+
]);
|
|
32195
|
+
}
|
|
32196
|
+
function truncateInlineText(value, maxLength) {
|
|
32197
|
+
if (typeof maxLength !== "number" || !Number.isFinite(maxLength) || maxLength < 0) {
|
|
32198
|
+
return normalizeInlineText(value);
|
|
32199
|
+
}
|
|
32200
|
+
const next = [];
|
|
32201
|
+
let remaining = maxLength;
|
|
32202
|
+
for (const run3 of normalizeInlineText(value)) {
|
|
32203
|
+
if (remaining <= 0) break;
|
|
32204
|
+
const text2 = run3.text.slice(0, remaining);
|
|
32205
|
+
next.push(withMarks(text2, run3.marks ?? []));
|
|
32206
|
+
remaining -= text2.length;
|
|
32207
|
+
}
|
|
32208
|
+
return normalizeInlineText(next);
|
|
32209
|
+
}
|
|
32210
|
+
function sliceInlineText(value, start, end) {
|
|
32211
|
+
if (start >= end) return [];
|
|
32212
|
+
const next = [];
|
|
32213
|
+
let offset4 = 0;
|
|
32214
|
+
for (const run3 of normalizeInlineText(value)) {
|
|
32215
|
+
const runStart = offset4;
|
|
32216
|
+
const runEnd = offset4 + run3.text.length;
|
|
32217
|
+
offset4 = runEnd;
|
|
32218
|
+
if (runEnd <= start || runStart >= end) continue;
|
|
32219
|
+
const localStart = Math.max(0, start - runStart);
|
|
32220
|
+
const localEnd = Math.min(run3.text.length, end - runStart);
|
|
32221
|
+
next.push(withMarks(run3.text.slice(localStart, localEnd), run3.marks ?? []));
|
|
32222
|
+
}
|
|
32223
|
+
return normalizeInlineText(next);
|
|
32224
|
+
}
|
|
32225
|
+
function mapInlineTextRange(value, range, mapMarks) {
|
|
32226
|
+
const start = Math.max(0, Math.min(range.start, range.end));
|
|
32227
|
+
const end = Math.max(0, Math.max(range.start, range.end));
|
|
32228
|
+
if (start === end) return normalizeInlineText(value);
|
|
32229
|
+
const next = [];
|
|
32230
|
+
let offset4 = 0;
|
|
32231
|
+
for (const run3 of normalizeInlineText(value)) {
|
|
32232
|
+
const runStart = offset4;
|
|
32233
|
+
const runEnd = offset4 + run3.text.length;
|
|
32234
|
+
offset4 = runEnd;
|
|
32235
|
+
if (runEnd <= start || runStart >= end) {
|
|
32236
|
+
next.push(run3);
|
|
32237
|
+
continue;
|
|
32238
|
+
}
|
|
32239
|
+
const localStart = Math.max(0, start - runStart);
|
|
32240
|
+
const localEnd = Math.min(run3.text.length, end - runStart);
|
|
32241
|
+
const marks = run3.marks ?? [];
|
|
32242
|
+
if (localStart > 0) {
|
|
32243
|
+
next.push(withMarks(run3.text.slice(0, localStart), marks));
|
|
32244
|
+
}
|
|
32245
|
+
next.push(withMarks(run3.text.slice(localStart, localEnd), mapMarks(marks)));
|
|
32246
|
+
if (localEnd < run3.text.length) {
|
|
32247
|
+
next.push(withMarks(run3.text.slice(localEnd), marks));
|
|
32248
|
+
}
|
|
32249
|
+
}
|
|
32250
|
+
return normalizeInlineText(next);
|
|
32251
|
+
}
|
|
32252
|
+
function withMarks(text2, marks) {
|
|
32253
|
+
const normalized = normalizeInlineTextMarks(marks);
|
|
32254
|
+
return normalized.length > 0 ? { text: text2, marks: normalized } : { text: text2 };
|
|
32255
|
+
}
|
|
32051
32256
|
|
|
32052
32257
|
// ../blocks/src/system/icons/ids.ts
|
|
32053
32258
|
var GENERATED_ICON_SET_ID_PATTERN = /^generated-icon-set:[a-z0-9][a-z0-9:_-]{0,107}$/u;
|
|
@@ -32875,6 +33080,13 @@ function formatFieldPath(path) {
|
|
|
32875
33080
|
function toZodIssuePath(path) {
|
|
32876
33081
|
return [...path];
|
|
32877
33082
|
}
|
|
33083
|
+
function parseFieldPathKey(key) {
|
|
33084
|
+
if (!key) return [];
|
|
33085
|
+
return key.split(".").map((segment) => {
|
|
33086
|
+
const numeric2 = Number(segment);
|
|
33087
|
+
return Number.isInteger(numeric2) && String(numeric2) === segment ? numeric2 : segment;
|
|
33088
|
+
});
|
|
33089
|
+
}
|
|
32878
33090
|
function fieldIssueToMessage(issue2) {
|
|
32879
33091
|
switch (issue2.kind) {
|
|
32880
33092
|
case "required":
|
|
@@ -32913,6 +33125,8 @@ function fieldIssueToMessage(issue2) {
|
|
|
32913
33125
|
return `${issue2.label} must have at most ${issue2.maximum} ${pluralize(issue2.itemLabel, issue2.maximum)}`;
|
|
32914
33126
|
case "invalidRichText":
|
|
32915
33127
|
return `${issue2.label} must be valid rich text`;
|
|
33128
|
+
case "invalidInlineText":
|
|
33129
|
+
return `${issue2.label} must be valid styled text`;
|
|
32916
33130
|
case "invalidMedia":
|
|
32917
33131
|
return `${issue2.label} must be a valid media item`;
|
|
32918
33132
|
case "invalidLink":
|
|
@@ -33001,6 +33215,16 @@ function deriveFieldValidationPlan(field, path = [field.id]) {
|
|
|
33001
33215
|
);
|
|
33002
33216
|
case "richText":
|
|
33003
33217
|
return makePlan("richText", "object", field, path, required, commonConstraints(required, { kind: "richTextDoc" }));
|
|
33218
|
+
case "inlineText": {
|
|
33219
|
+
const constraints = commonConstraints(required, { kind: "inlineText" });
|
|
33220
|
+
if (typeof field.maxLength === "number") {
|
|
33221
|
+
constraints.push({ kind: "maxPlainTextLength", maximum: field.maxLength });
|
|
33222
|
+
}
|
|
33223
|
+
return {
|
|
33224
|
+
...makePlan("inlineText", "array", field, path, required, constraints),
|
|
33225
|
+
...field.plainTextField ? { plainTextFallbackPath: parseFieldPathKey(field.plainTextField) } : {}
|
|
33226
|
+
};
|
|
33227
|
+
}
|
|
33004
33228
|
case "media":
|
|
33005
33229
|
case "file":
|
|
33006
33230
|
return {
|
|
@@ -33125,6 +33349,7 @@ function normalizeStoredContentValues(plans, content, options = {}) {
|
|
|
33125
33349
|
const plan = planMap.get(key);
|
|
33126
33350
|
normalized[key] = plan ? normalizeStoredFieldValueWithContext(plan, value, ctx) : value;
|
|
33127
33351
|
}
|
|
33352
|
+
normalizeInlineTextFallbacks(plans, normalized, ctx);
|
|
33128
33353
|
return normalized;
|
|
33129
33354
|
}
|
|
33130
33355
|
function normalizeStoredFieldValueWithContext(plan, value, ctx) {
|
|
@@ -33140,6 +33365,7 @@ function normalizeStoredFieldValueWithContext(plan, value, ctx) {
|
|
|
33140
33365
|
case "number":
|
|
33141
33366
|
case "boolean":
|
|
33142
33367
|
case "richText":
|
|
33368
|
+
case "inlineText":
|
|
33143
33369
|
case "media":
|
|
33144
33370
|
case "link":
|
|
33145
33371
|
case "select":
|
|
@@ -33155,12 +33381,9 @@ function normalizeStoredObjectChildren(children, value, ctx) {
|
|
|
33155
33381
|
}
|
|
33156
33382
|
const normalized = { ...value };
|
|
33157
33383
|
for (const child of children) {
|
|
33158
|
-
normalized[child.fieldId] = normalizeStoredFieldValueWithContext(
|
|
33159
|
-
child,
|
|
33160
|
-
normalized[child.fieldId],
|
|
33161
|
-
ctx
|
|
33162
|
-
);
|
|
33384
|
+
normalized[child.fieldId] = normalizeStoredFieldValueWithContext(child, normalized[child.fieldId], ctx);
|
|
33163
33385
|
}
|
|
33386
|
+
normalizeInlineTextFallbacks(children, normalized, ctx);
|
|
33164
33387
|
return normalized;
|
|
33165
33388
|
}
|
|
33166
33389
|
function normalizeStoredRepeaterItems(plan, value, ctx) {
|
|
@@ -33191,6 +33414,7 @@ function normalizeFieldValue(plan, value, ctx) {
|
|
|
33191
33414
|
return normalizeRepeaterItems(plan, value, ctx);
|
|
33192
33415
|
case "boolean":
|
|
33193
33416
|
case "richText":
|
|
33417
|
+
case "inlineText":
|
|
33194
33418
|
case "link":
|
|
33195
33419
|
case "select":
|
|
33196
33420
|
case "passthrough":
|
|
@@ -33216,8 +33440,24 @@ function normalizeObjectChildren(children, value, ctx) {
|
|
|
33216
33440
|
for (const child of children) {
|
|
33217
33441
|
normalized[child.fieldId] = normalizeFieldValue(child, normalized[child.fieldId], ctx);
|
|
33218
33442
|
}
|
|
33443
|
+
normalizeInlineTextFallbacks(children, normalized, ctx);
|
|
33219
33444
|
return normalized;
|
|
33220
33445
|
}
|
|
33446
|
+
function normalizeInlineTextFallbacks(plans, values, ctx) {
|
|
33447
|
+
for (const plan of plans) {
|
|
33448
|
+
if (plan.kind !== "inlineText" || !plan.plainTextFallbackPath) continue;
|
|
33449
|
+
if (!isMissingForPlan(plan, values[plan.fieldId])) continue;
|
|
33450
|
+
const fallback2 = getAtFieldPath(values, plan.plainTextFallbackPath);
|
|
33451
|
+
if (typeof fallback2 !== "string" || fallback2.trim().length === 0) continue;
|
|
33452
|
+
values[plan.fieldId] = normalizeFieldValue(plan, plainTextToInlineText(fallback2), ctx);
|
|
33453
|
+
}
|
|
33454
|
+
}
|
|
33455
|
+
function getAtFieldPath(source, path) {
|
|
33456
|
+
return path.reduce((current, segment) => {
|
|
33457
|
+
if (!current || typeof current !== "object" || Array.isArray(current)) return void 0;
|
|
33458
|
+
return current[String(segment)];
|
|
33459
|
+
}, source);
|
|
33460
|
+
}
|
|
33221
33461
|
function normalizeRepeaterItems(plan, value, ctx) {
|
|
33222
33462
|
if (!isUnknownArray(value)) return value;
|
|
33223
33463
|
return value.map((item) => {
|
|
@@ -33255,6 +33495,8 @@ function validateNormalizedFieldValue(plan, value, ctx) {
|
|
|
33255
33495
|
return validateSelectPlan(plan, value);
|
|
33256
33496
|
case "richText":
|
|
33257
33497
|
return isValidRichTextDoc(value) ? [] : [issue(plan, "invalidRichText")];
|
|
33498
|
+
case "inlineText":
|
|
33499
|
+
return validateInlineTextPlan(plan, value);
|
|
33258
33500
|
case "media":
|
|
33259
33501
|
return isPlainObject(value) ? [] : [issue(plan, "invalidMedia")];
|
|
33260
33502
|
case "link":
|
|
@@ -33428,6 +33670,7 @@ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
|
|
|
33428
33670
|
case "number":
|
|
33429
33671
|
case "boolean":
|
|
33430
33672
|
case "richText":
|
|
33673
|
+
case "inlineText":
|
|
33431
33674
|
case "media":
|
|
33432
33675
|
case "link":
|
|
33433
33676
|
case "select":
|
|
@@ -33440,6 +33683,18 @@ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
|
|
|
33440
33683
|
return assertNever4(plan);
|
|
33441
33684
|
}
|
|
33442
33685
|
}
|
|
33686
|
+
function validateInlineTextPlan(plan, value) {
|
|
33687
|
+
const parsed = parseInlineTextFromUnknown(value);
|
|
33688
|
+
if (!parsed.ok) return [issue(plan, "invalidInlineText")];
|
|
33689
|
+
const text2 = inlineTextToPlainText(parsed.value);
|
|
33690
|
+
const lengthIssue = plan.constraints.find(
|
|
33691
|
+
(constraint) => constraint.kind === "maxPlainTextLength"
|
|
33692
|
+
);
|
|
33693
|
+
if (lengthIssue && text2.length > lengthIssue.maximum) {
|
|
33694
|
+
return [issue(plan, "tooLong", { maximum: lengthIssue.maximum })];
|
|
33695
|
+
}
|
|
33696
|
+
return [];
|
|
33697
|
+
}
|
|
33443
33698
|
function rebaseFieldPath(path, fromPrefix, toPrefix) {
|
|
33444
33699
|
if (!startsWithFieldPath(path, fromPrefix)) {
|
|
33445
33700
|
throw new Error(`Cannot rebase field path ${formatFieldPath(path)} from ${formatFieldPath(fromPrefix)}`);
|
|
@@ -33533,6 +33788,7 @@ function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
|
|
|
33533
33788
|
case "tooFewItems":
|
|
33534
33789
|
case "tooManyItems":
|
|
33535
33790
|
case "invalidRichText":
|
|
33791
|
+
case "invalidInlineText":
|
|
33536
33792
|
case "invalidMedia":
|
|
33537
33793
|
case "invalidLink":
|
|
33538
33794
|
case "invalidReference":
|
|
@@ -33580,6 +33836,7 @@ function findNestedFieldValidationPlan(plan, path) {
|
|
|
33580
33836
|
case "number":
|
|
33581
33837
|
case "boolean":
|
|
33582
33838
|
case "richText":
|
|
33839
|
+
case "inlineText":
|
|
33583
33840
|
case "media":
|
|
33584
33841
|
case "link":
|
|
33585
33842
|
case "select":
|
|
@@ -36709,44 +36966,44 @@ var styleTagsSchema = z.object({
|
|
|
36709
36966
|
motion: z.enum(STYLE_AXIS_VALUES.motion).optional(),
|
|
36710
36967
|
era: z.enum(STYLE_AXIS_VALUES.era).optional()
|
|
36711
36968
|
});
|
|
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:
|
|
36969
|
+
var hotspotSchema = z41.object({
|
|
36970
|
+
x: z41.number().min(0).max(1),
|
|
36971
|
+
y: z41.number().min(0).max(1),
|
|
36972
|
+
radius: z41.number().optional()
|
|
36973
|
+
});
|
|
36974
|
+
var rotationSchema = z41.union([z41.literal(0), z41.literal(90), z41.literal(180), z41.literal(270)]);
|
|
36975
|
+
var rectSchema = z41.tuple([z41.number(), z41.number(), z41.number(), z41.number()]);
|
|
36976
|
+
var aspectCropSchema = z41.object({
|
|
36977
|
+
aspect: z41.preprocess((value) => value == null ? void 0 : value, z41.string().optional()),
|
|
36978
|
+
rect: z41.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
36979
|
+
hotspot: z41.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
36980
|
+
rotation: z41.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
36981
|
+
});
|
|
36982
|
+
var transformSchema = z41.object({
|
|
36983
|
+
aspectCrops: z41.preprocess((value) => {
|
|
36727
36984
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
36728
36985
|
return void 0;
|
|
36729
36986
|
}
|
|
36730
36987
|
return value;
|
|
36731
|
-
},
|
|
36988
|
+
}, z41.record(z41.string(), aspectCropSchema.catch({}))).optional(),
|
|
36732
36989
|
rect: rectSchema.optional(),
|
|
36733
36990
|
hotspot: hotspotSchema.optional(),
|
|
36734
36991
|
rotation: rotationSchema.optional()
|
|
36735
36992
|
});
|
|
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:
|
|
36993
|
+
var mediaSchema = z41.object({
|
|
36994
|
+
type: z41.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
|
|
36995
|
+
purpose: z41.string().optional(),
|
|
36996
|
+
placeholder: z41.boolean().default(true).optional(),
|
|
36997
|
+
assetId: z41.string().optional(),
|
|
36998
|
+
identifier: z41.string().optional(),
|
|
36999
|
+
src: z41.string().optional(),
|
|
37000
|
+
alt: z41.string().optional(),
|
|
37001
|
+
filename: z41.string().optional(),
|
|
37002
|
+
mimeType: z41.string().optional(),
|
|
37003
|
+
width: z41.number().optional(),
|
|
37004
|
+
height: z41.number().optional(),
|
|
37005
|
+
storageBucket: z41.string().optional(),
|
|
37006
|
+
storagePath: z41.string().optional(),
|
|
36750
37007
|
transform: transformSchema.optional()
|
|
36751
37008
|
});
|
|
36752
37009
|
|
|
@@ -52057,8 +52314,16 @@ var heroCopyFragment = defineFragment({
|
|
|
52057
52314
|
id: "headline",
|
|
52058
52315
|
type: "text",
|
|
52059
52316
|
label: "Headline",
|
|
52317
|
+
maxLength: 120,
|
|
52318
|
+
ui: { hidden: true }
|
|
52319
|
+
},
|
|
52320
|
+
{
|
|
52321
|
+
id: "headlineInline",
|
|
52322
|
+
type: "inlineText",
|
|
52323
|
+
label: "Headline",
|
|
52060
52324
|
required: true,
|
|
52061
|
-
maxLength: 120
|
|
52325
|
+
maxLength: 120,
|
|
52326
|
+
plainTextField: "headline"
|
|
52062
52327
|
},
|
|
52063
52328
|
{
|
|
52064
52329
|
id: "subheadline",
|
|
@@ -52083,9 +52348,12 @@ var heroCopyFragment = defineFragment({
|
|
|
52083
52348
|
as: "h1",
|
|
52084
52349
|
// heading-display: uses fluid typography from theme (--fs-h1-display-fluid)
|
|
52085
52350
|
// Color in blocks-static/index.css (.hero-headline)
|
|
52086
|
-
className: "hero-headline heading-display"
|
|
52351
|
+
className: "hero-headline heading-display",
|
|
52352
|
+
// Resolved against top-level block content; keep this beside the sibling headline field.
|
|
52353
|
+
inlineTextFallbackPath: "headline",
|
|
52354
|
+
maxLength: 120
|
|
52087
52355
|
},
|
|
52088
|
-
bind("content.
|
|
52356
|
+
bind("content.headlineInline")
|
|
52089
52357
|
),
|
|
52090
52358
|
text(
|
|
52091
52359
|
{
|
|
@@ -59950,66 +60218,66 @@ var PUBLIC_DOWNLOAD_MEDIA_TYPES = [
|
|
|
59950
60218
|
"archive",
|
|
59951
60219
|
"audio"
|
|
59952
60220
|
];
|
|
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:
|
|
60221
|
+
var hotspotSchema2 = z41.object({
|
|
60222
|
+
x: z41.number().min(0).max(1),
|
|
60223
|
+
y: z41.number().min(0).max(1),
|
|
60224
|
+
radius: z41.number().optional()
|
|
60225
|
+
});
|
|
60226
|
+
var rotationSchema2 = z41.union([z41.literal(0), z41.literal(90), z41.literal(180), z41.literal(270)]);
|
|
60227
|
+
var rectSchema2 = z41.tuple([z41.number(), z41.number(), z41.number(), z41.number()]);
|
|
60228
|
+
var aspectCropSchema2 = z41.object({
|
|
60229
|
+
aspect: z41.preprocess((value) => value == null ? void 0 : value, z41.string().optional()),
|
|
60230
|
+
rect: z41.preprocess((value) => value == null ? void 0 : value, rectSchema2.optional()),
|
|
60231
|
+
hotspot: z41.preprocess((value) => value == null ? void 0 : value, hotspotSchema2.optional()),
|
|
60232
|
+
rotation: z41.preprocess((value) => value == null ? void 0 : value, rotationSchema2.optional())
|
|
60233
|
+
});
|
|
60234
|
+
var transformSchema2 = z41.object({
|
|
60235
|
+
aspectCrops: z41.preprocess((value) => {
|
|
59968
60236
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
59969
60237
|
return void 0;
|
|
59970
60238
|
}
|
|
59971
60239
|
return value;
|
|
59972
|
-
},
|
|
60240
|
+
}, z41.record(z41.string(), aspectCropSchema2.catch({}))).optional(),
|
|
59973
60241
|
rect: rectSchema2.optional(),
|
|
59974
60242
|
hotspot: hotspotSchema2.optional(),
|
|
59975
60243
|
rotation: rotationSchema2.optional()
|
|
59976
60244
|
});
|
|
59977
|
-
var mediaPosterSchema =
|
|
59978
|
-
|
|
59979
|
-
tag:
|
|
59980
|
-
assetId:
|
|
59981
|
-
storageBucket:
|
|
59982
|
-
storagePath:
|
|
60245
|
+
var mediaPosterSchema = z41.discriminatedUnion("tag", [
|
|
60246
|
+
z41.object({
|
|
60247
|
+
tag: z41.literal("storage"),
|
|
60248
|
+
assetId: z41.string().optional(),
|
|
60249
|
+
storageBucket: z41.string().min(1),
|
|
60250
|
+
storagePath: z41.string().min(1)
|
|
59983
60251
|
}),
|
|
59984
|
-
|
|
59985
|
-
tag:
|
|
59986
|
-
assetId:
|
|
59987
|
-
src:
|
|
60252
|
+
z41.object({
|
|
60253
|
+
tag: z41.literal("external-src"),
|
|
60254
|
+
assetId: z41.string().optional(),
|
|
60255
|
+
src: z41.string().url()
|
|
59988
60256
|
})
|
|
59989
60257
|
]);
|
|
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:
|
|
60258
|
+
var mediaBaseSchema = z41.object({
|
|
60259
|
+
purpose: z41.string().optional(),
|
|
60260
|
+
placeholder: z41.boolean().default(true).optional(),
|
|
60261
|
+
assetId: z41.string().optional(),
|
|
60262
|
+
identifier: z41.string().optional(),
|
|
60263
|
+
src: z41.string().optional(),
|
|
60264
|
+
alt: z41.string().optional(),
|
|
60265
|
+
filename: z41.string().optional(),
|
|
60266
|
+
mimeType: z41.string().optional(),
|
|
60267
|
+
width: z41.number().optional(),
|
|
60268
|
+
height: z41.number().optional(),
|
|
60269
|
+
storageBucket: z41.string().optional(),
|
|
60270
|
+
storagePath: z41.string().optional(),
|
|
60003
60271
|
poster: mediaPosterSchema.optional(),
|
|
60004
60272
|
transform: transformSchema2.optional()
|
|
60005
60273
|
});
|
|
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 =
|
|
60274
|
+
var imageMediaSchema = mediaBaseSchema.extend({ type: z41.literal("image") });
|
|
60275
|
+
var videoMediaSchema = mediaBaseSchema.extend({ type: z41.literal("video") });
|
|
60276
|
+
var audioMediaSchema = mediaBaseSchema.extend({ type: z41.literal("audio") });
|
|
60277
|
+
var documentMediaSchema = mediaBaseSchema.extend({ type: z41.literal("document") });
|
|
60278
|
+
var spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z41.literal("spreadsheet") });
|
|
60279
|
+
var archiveMediaSchema = mediaBaseSchema.extend({ type: z41.literal("archive") });
|
|
60280
|
+
var mediaSchema2 = z41.discriminatedUnion("type", [
|
|
60013
60281
|
imageMediaSchema,
|
|
60014
60282
|
videoMediaSchema,
|
|
60015
60283
|
audioMediaSchema,
|
|
@@ -72608,6 +72876,123 @@ var FigureNode = ({
|
|
|
72608
72876
|
...props2
|
|
72609
72877
|
}) => /* @__PURE__ */ jsx("figure", { ...props2 });
|
|
72610
72878
|
|
|
72879
|
+
// ../path-utils/src/index.ts
|
|
72880
|
+
var PATH_SEPARATOR_REGEX = /\./g;
|
|
72881
|
+
var BRACKET_ACCESS_REGEX = /\[([^\]]+)\]/g;
|
|
72882
|
+
function isRecord12(value) {
|
|
72883
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72884
|
+
}
|
|
72885
|
+
function isPathContainer(value) {
|
|
72886
|
+
return Array.isArray(value) || isRecord12(value);
|
|
72887
|
+
}
|
|
72888
|
+
function createPathContainer(nextIsIndex) {
|
|
72889
|
+
return nextIsIndex ? [] : {};
|
|
72890
|
+
}
|
|
72891
|
+
function getContainerValue(container, segment) {
|
|
72892
|
+
if (typeof segment === "number") {
|
|
72893
|
+
return Array.isArray(container) ? container[segment] : void 0;
|
|
72894
|
+
}
|
|
72895
|
+
if (segment in container) {
|
|
72896
|
+
return Reflect.get(container, segment);
|
|
72897
|
+
}
|
|
72898
|
+
return void 0;
|
|
72899
|
+
}
|
|
72900
|
+
function ensureContainerProperty(container, key, nextIsIndex) {
|
|
72901
|
+
const existing = Reflect.get(container, key);
|
|
72902
|
+
if (isPathContainer(existing)) {
|
|
72903
|
+
return existing;
|
|
72904
|
+
}
|
|
72905
|
+
const nextContainer = createPathContainer(nextIsIndex);
|
|
72906
|
+
Reflect.set(container, key, nextContainer);
|
|
72907
|
+
return nextContainer;
|
|
72908
|
+
}
|
|
72909
|
+
function parsePath(path) {
|
|
72910
|
+
if (Array.isArray(path)) return path;
|
|
72911
|
+
const segments = [];
|
|
72912
|
+
const parts = path.split(PATH_SEPARATOR_REGEX);
|
|
72913
|
+
for (const raw of parts) {
|
|
72914
|
+
if (!raw) continue;
|
|
72915
|
+
const baseMatch = raw.match(/^[^\[]+/);
|
|
72916
|
+
if (baseMatch !== null) {
|
|
72917
|
+
const base2 = baseMatch[1] ?? baseMatch[0];
|
|
72918
|
+
if (/^\d+$/.test(base2)) {
|
|
72919
|
+
segments.push(Number(base2));
|
|
72920
|
+
} else {
|
|
72921
|
+
segments.push(base2);
|
|
72922
|
+
}
|
|
72923
|
+
}
|
|
72924
|
+
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX);
|
|
72925
|
+
for (const match2 of bracketMatches) {
|
|
72926
|
+
const token = match2[1] ?? "";
|
|
72927
|
+
if (token.startsWith('"') || token.startsWith("'")) {
|
|
72928
|
+
segments.push(token.slice(1, -1));
|
|
72929
|
+
} else if (/^\d+$/.test(token)) {
|
|
72930
|
+
segments.push(Number(token));
|
|
72931
|
+
} else {
|
|
72932
|
+
segments.push(token);
|
|
72933
|
+
}
|
|
72934
|
+
}
|
|
72935
|
+
if (baseMatch === null && !raw.includes("[")) {
|
|
72936
|
+
segments.push(raw);
|
|
72937
|
+
}
|
|
72938
|
+
}
|
|
72939
|
+
return segments;
|
|
72940
|
+
}
|
|
72941
|
+
function segmentsToPath(segments) {
|
|
72942
|
+
if (!segments.length) return void 0;
|
|
72943
|
+
return segments.map((s2) => String(s2)).join(".");
|
|
72944
|
+
}
|
|
72945
|
+
function siblingPath(path, siblingFieldPath) {
|
|
72946
|
+
const segments = parsePath(path);
|
|
72947
|
+
const siblingSegments = parsePath(siblingFieldPath);
|
|
72948
|
+
const parentSegments = segments.slice(0, -1);
|
|
72949
|
+
return segmentsToPath([...parentSegments, ...siblingSegments]) ?? siblingFieldPath;
|
|
72950
|
+
}
|
|
72951
|
+
function getAtPath(source, path) {
|
|
72952
|
+
const segments = parsePath(path);
|
|
72953
|
+
return segments.reduce((current, segment) => {
|
|
72954
|
+
if (current === void 0 || current === null) return void 0;
|
|
72955
|
+
if (!isPathContainer(current)) return void 0;
|
|
72956
|
+
return getContainerValue(current, segment);
|
|
72957
|
+
}, source);
|
|
72958
|
+
}
|
|
72959
|
+
function setAtPath(target, path, value) {
|
|
72960
|
+
const segments = parsePath(path);
|
|
72961
|
+
let current = target;
|
|
72962
|
+
for (let index2 = 0; index2 < segments.length; index2 += 1) {
|
|
72963
|
+
const segment = segments[index2];
|
|
72964
|
+
if (segment === void 0) continue;
|
|
72965
|
+
const isLast = index2 === segments.length - 1;
|
|
72966
|
+
const nextIsIndex = typeof segments[index2 + 1] === "number";
|
|
72967
|
+
if (isLast) {
|
|
72968
|
+
if (typeof segment === "number") {
|
|
72969
|
+
if (Array.isArray(current)) {
|
|
72970
|
+
current[segment] = value;
|
|
72971
|
+
}
|
|
72972
|
+
} else {
|
|
72973
|
+
Reflect.set(current, segment, value);
|
|
72974
|
+
}
|
|
72975
|
+
return;
|
|
72976
|
+
}
|
|
72977
|
+
if (typeof segment === "number") {
|
|
72978
|
+
if (Array.isArray(current)) {
|
|
72979
|
+
const existing = current[segment];
|
|
72980
|
+
if (isPathContainer(existing)) {
|
|
72981
|
+
current = existing;
|
|
72982
|
+
} else {
|
|
72983
|
+
const nextContainer = createPathContainer(nextIsIndex);
|
|
72984
|
+
current[segment] = nextContainer;
|
|
72985
|
+
current = nextContainer;
|
|
72986
|
+
}
|
|
72987
|
+
continue;
|
|
72988
|
+
}
|
|
72989
|
+
current = ensureContainerProperty(current, String(segment), nextIsIndex);
|
|
72990
|
+
continue;
|
|
72991
|
+
}
|
|
72992
|
+
current = ensureContainerProperty(current, segment, nextIsIndex);
|
|
72993
|
+
}
|
|
72994
|
+
}
|
|
72995
|
+
|
|
72611
72996
|
// ../blocks/src/primitives/content/utils/sanitizeHref.ts
|
|
72612
72997
|
var SAFE_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
72613
72998
|
var CONTROL_CHARS_PATTERN = /[\u0000-\u001F\u007F]+/g;
|
|
@@ -72783,9 +73168,44 @@ function coerceRichTextDoc(value) {
|
|
|
72783
73168
|
}
|
|
72784
73169
|
return null;
|
|
72785
73170
|
}
|
|
72786
|
-
|
|
72787
|
-
return
|
|
73171
|
+
function renderInlineText(value) {
|
|
73172
|
+
return value.map((run3, index2) => renderRun(run3, index2));
|
|
73173
|
+
}
|
|
73174
|
+
function renderRun(run3, key) {
|
|
73175
|
+
return (run3.marks ?? []).reduceRight(
|
|
73176
|
+
(child, mark, index2) => renderMark(mark, `${String(key)}-${index2}`, child),
|
|
73177
|
+
run3.text
|
|
73178
|
+
);
|
|
73179
|
+
}
|
|
73180
|
+
function renderMark(mark, key, child) {
|
|
73181
|
+
switch (mark.kind) {
|
|
73182
|
+
case "strong":
|
|
73183
|
+
return /* @__PURE__ */ jsx("strong", { children: child }, key);
|
|
73184
|
+
case "emphasis":
|
|
73185
|
+
return /* @__PURE__ */ jsx("em", { children: child }, key);
|
|
73186
|
+
case "accent":
|
|
73187
|
+
return /* @__PURE__ */ jsx("span", { className: `rb-inline-text-accent rb-inline-text-accent-${mark.tone}`, children: child }, key);
|
|
73188
|
+
case "highlight":
|
|
73189
|
+
return /* @__PURE__ */ jsx("span", { className: `rb-inline-text-highlight rb-inline-text-highlight-${mark.tone}`, children: child }, key);
|
|
73190
|
+
}
|
|
73191
|
+
}
|
|
73192
|
+
var TextNode = ({ value, children, blockId: _blockId, blockKind: _blockKind, blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, inlineTextFallbackPath, ...rest }) => {
|
|
73193
|
+
const inlineText = parseInlineTextFromUnknown(value);
|
|
73194
|
+
if (inlineText.ok && !isInlineTextEmpty(inlineText.value)) {
|
|
73195
|
+
return /* @__PURE__ */ jsx(Text, { ...rest, children: renderInlineText(inlineText.value) });
|
|
73196
|
+
}
|
|
73197
|
+
const fallbackValue = inlineTextFallbackPath ? readStringPath(blockContent, inlineTextFallbackPath) : null;
|
|
73198
|
+
return /* @__PURE__ */ jsx(Text, { ...rest, children: fallbackValue ?? textNodeContent(value) ?? children });
|
|
72788
73199
|
};
|
|
73200
|
+
function textNodeContent(value) {
|
|
73201
|
+
if (value === null || value === void 0) return null;
|
|
73202
|
+
if (typeof value === "string" || typeof value === "number") return value;
|
|
73203
|
+
return null;
|
|
73204
|
+
}
|
|
73205
|
+
function readStringPath(source, path) {
|
|
73206
|
+
const value = getAtPath(source, path);
|
|
73207
|
+
return typeof value === "string" ? value : null;
|
|
73208
|
+
}
|
|
72789
73209
|
var RichTextNode = ({ value, blockId: _blockId, blockKind: _blockKind, blockContent: _blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, ...rest }) => {
|
|
72790
73210
|
const doc3 = coerceRichTextDoc(value);
|
|
72791
73211
|
return /* @__PURE__ */ jsx(RichText, { doc: doc3 ?? void 0, ...rest });
|
|
@@ -74012,12 +74432,12 @@ function resolveBookingSiteId(siteId, form2) {
|
|
|
74012
74432
|
return siteId || form2?.siteId || "";
|
|
74013
74433
|
}
|
|
74014
74434
|
function normalizeBookingFormConfig(form2) {
|
|
74015
|
-
if (!
|
|
74435
|
+
if (!isRecord13(form2)) return null;
|
|
74016
74436
|
const id = readNonEmptyString(form2.id);
|
|
74017
74437
|
const name = readNonEmptyString(form2.name);
|
|
74018
74438
|
if (!id || !name) return null;
|
|
74019
|
-
const schemaSource =
|
|
74020
|
-
const settingsSource =
|
|
74439
|
+
const schemaSource = isRecord13(form2.schema) ? form2.schema : isRecord13(form2.schemaJson) ? form2.schemaJson : null;
|
|
74440
|
+
const settingsSource = isRecord13(form2.settings) ? form2.settings : isRecord13(form2.settingsJson) ? form2.settingsJson : null;
|
|
74021
74441
|
return {
|
|
74022
74442
|
id,
|
|
74023
74443
|
name,
|
|
@@ -74041,10 +74461,10 @@ function normalizeBookingServices(services) {
|
|
|
74041
74461
|
if (Array.isArray(services)) {
|
|
74042
74462
|
return services.filter(isBookingFormService).map(normalizeService);
|
|
74043
74463
|
}
|
|
74044
|
-
if (
|
|
74464
|
+
if (isRecord13(services) && "services" in services) {
|
|
74045
74465
|
return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
74046
74466
|
}
|
|
74047
|
-
return
|
|
74467
|
+
return isRecord13(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
74048
74468
|
}
|
|
74049
74469
|
function normalizeBookingSchema(value) {
|
|
74050
74470
|
if (!value) return void 0;
|
|
@@ -74056,7 +74476,7 @@ function normalizeBookingSchema(value) {
|
|
|
74056
74476
|
};
|
|
74057
74477
|
}
|
|
74058
74478
|
function readBookingFormField(value) {
|
|
74059
|
-
if (!
|
|
74479
|
+
if (!isRecord13(value)) return null;
|
|
74060
74480
|
const id = readNonEmptyString(value.id);
|
|
74061
74481
|
const label = readNonEmptyString(value.label);
|
|
74062
74482
|
const type = readBookingFieldType(value.type);
|
|
@@ -74102,7 +74522,7 @@ function readBookingFieldOptions(value) {
|
|
|
74102
74522
|
return options.length > 0 ? options : void 0;
|
|
74103
74523
|
}
|
|
74104
74524
|
function readBookingFieldOption(value) {
|
|
74105
|
-
if (!
|
|
74525
|
+
if (!isRecord13(value)) return null;
|
|
74106
74526
|
const optionValue = readNonEmptyString(value.value);
|
|
74107
74527
|
const label = readNonEmptyString(value.label);
|
|
74108
74528
|
return optionValue && label ? { value: optionValue, label } : null;
|
|
@@ -74119,7 +74539,7 @@ function normalizeBookingSettings(value) {
|
|
|
74119
74539
|
};
|
|
74120
74540
|
}
|
|
74121
74541
|
function isBookingFormService(value) {
|
|
74122
|
-
return
|
|
74542
|
+
return isRecord13(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
74123
74543
|
}
|
|
74124
74544
|
function collectBookingCustomFields(data) {
|
|
74125
74545
|
const customFields = {};
|
|
@@ -74175,7 +74595,7 @@ function readStringArray(value) {
|
|
|
74175
74595
|
const strings = value.filter((item) => typeof item === "string");
|
|
74176
74596
|
return strings.length > 0 ? strings : void 0;
|
|
74177
74597
|
}
|
|
74178
|
-
function
|
|
74598
|
+
function isRecord13(value) {
|
|
74179
74599
|
return typeof value === "object" && value !== null;
|
|
74180
74600
|
}
|
|
74181
74601
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -77802,14 +78222,14 @@ function isDecoratedHeadingBlockKind(blockKind) {
|
|
|
77802
78222
|
return blockKind === "block.intro" || blockKind === "block.feature-cards" || blockKind === "block.testimonials" || blockKind === "block.faq";
|
|
77803
78223
|
}
|
|
77804
78224
|
function readVariant(blockContent) {
|
|
77805
|
-
if (!
|
|
78225
|
+
if (!isRecord14(blockContent)) return void 0;
|
|
77806
78226
|
const variant = blockContent.variant;
|
|
77807
78227
|
return typeof variant === "string" ? variant : void 0;
|
|
77808
78228
|
}
|
|
77809
78229
|
function isFaqDecoratedVariant(variant) {
|
|
77810
78230
|
return variant === "default" || variant === "question-columns";
|
|
77811
78231
|
}
|
|
77812
|
-
function
|
|
78232
|
+
function isRecord14(value) {
|
|
77813
78233
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
77814
78234
|
}
|
|
77815
78235
|
function buildHeadingDecorationWrapperClassName(className) {
|
|
@@ -77834,8 +78254,8 @@ var META_PATH_TO_STORE_KEY = {
|
|
|
77834
78254
|
function mapMetaPathToStoreKey(path) {
|
|
77835
78255
|
return META_PATH_TO_STORE_KEY[path] ?? path;
|
|
77836
78256
|
}
|
|
77837
|
-
var
|
|
77838
|
-
var
|
|
78257
|
+
var PATH_SEPARATOR_REGEX2 = /\./g;
|
|
78258
|
+
var BRACKET_ACCESS_REGEX2 = /\[([^\]]+)\]/g;
|
|
77839
78259
|
function parseBracketToken(token) {
|
|
77840
78260
|
if (token.startsWith('"') || token.startsWith("'")) {
|
|
77841
78261
|
return token.slice(1, -1);
|
|
@@ -77852,7 +78272,7 @@ function extractSegmentsFromPart(part) {
|
|
|
77852
78272
|
if (baseMatch && baseMatch[1]) {
|
|
77853
78273
|
segments.push(baseMatch[1]);
|
|
77854
78274
|
}
|
|
77855
|
-
const bracketMatches = Array.from(part.matchAll(
|
|
78275
|
+
const bracketMatches = Array.from(part.matchAll(BRACKET_ACCESS_REGEX2));
|
|
77856
78276
|
const bracketSegments = bracketMatches.map((match2) => match2[1] ?? "").filter((token) => token.length > 0).map(parseBracketToken);
|
|
77857
78277
|
segments.push(...bracketSegments);
|
|
77858
78278
|
if (!baseMatch && !part.includes("[")) {
|
|
@@ -77861,9 +78281,9 @@ function extractSegmentsFromPart(part) {
|
|
|
77861
78281
|
return segments;
|
|
77862
78282
|
}
|
|
77863
78283
|
function splitPath(path) {
|
|
77864
|
-
return path.split(
|
|
78284
|
+
return path.split(PATH_SEPARATOR_REGEX2).flatMap(extractSegmentsFromPart).filter((segment) => segment !== "");
|
|
77865
78285
|
}
|
|
77866
|
-
function
|
|
78286
|
+
function segmentsToPath2(segments) {
|
|
77867
78287
|
if (!segments.length) return void 0;
|
|
77868
78288
|
return segments.map((s2) => String(s2)).join(".");
|
|
77869
78289
|
}
|
|
@@ -77896,7 +78316,7 @@ function derivePreviewLinkedEntryFieldBinding(node, parsedBinding, context) {
|
|
|
77896
78316
|
if (displaySegments.length === 0) return null;
|
|
77897
78317
|
const scoped = [...context.scopes].reverse().find((entry) => entry.name === scopeName);
|
|
77898
78318
|
if (!scoped) return null;
|
|
77899
|
-
const displayPath =
|
|
78319
|
+
const displayPath = segmentsToPath2(displaySegments);
|
|
77900
78320
|
if (!displayPath) return null;
|
|
77901
78321
|
const eligibility = resolveLinkedEntryInlineFieldEligibility({
|
|
77902
78322
|
entry: scoped.value,
|
|
@@ -78293,7 +78713,7 @@ function resolveBindingToEditorPath(fieldName, bindings, editableRouteMetadataFi
|
|
|
78293
78713
|
function derivePreviewTextEditableTarget(parsedBinding, context) {
|
|
78294
78714
|
if (!parsedBinding) return { kind: "read-only", reason: "missing-binding" };
|
|
78295
78715
|
const abs = getAbsoluteSegments(parsedBinding.from, context);
|
|
78296
|
-
const absolutePath = abs ?
|
|
78716
|
+
const absolutePath = abs ? segmentsToPath2(abs) : void 0;
|
|
78297
78717
|
if (!absolutePath) return { kind: "read-only", reason: "unresolved-binding" };
|
|
78298
78718
|
if (absolutePath !== "content" && !absolutePath.startsWith("content.")) {
|
|
78299
78719
|
return { kind: "read-only", reason: "non-content-binding" };
|
|
@@ -78347,7 +78767,7 @@ function injectMediaSlotPath(props2, node, parsedBinding, context) {
|
|
|
78347
78767
|
if (!parsedBinding) return props2;
|
|
78348
78768
|
if (node.type !== "media") return props2;
|
|
78349
78769
|
const abs = getAbsoluteSegments(parsedBinding.from, context);
|
|
78350
|
-
const absolutePath = abs ?
|
|
78770
|
+
const absolutePath = abs ? segmentsToPath2(abs) : void 0;
|
|
78351
78771
|
if (!absolutePath) return props2;
|
|
78352
78772
|
if (absolutePath !== "content" && !absolutePath.startsWith("content.")) {
|
|
78353
78773
|
return props2;
|
|
@@ -78765,6 +79185,7 @@ function collectNestedPreviewFieldConstraintEntries(field, path) {
|
|
|
78765
79185
|
case "datetime":
|
|
78766
79186
|
case "entryPicker":
|
|
78767
79187
|
case "file":
|
|
79188
|
+
case "inlineText":
|
|
78768
79189
|
case "link":
|
|
78769
79190
|
case "media":
|
|
78770
79191
|
case "number":
|
|
@@ -90233,6 +90654,49 @@ var containerResponsiveThemeCss = `/*
|
|
|
90233
90654
|
margin-top: 0.5rem;
|
|
90234
90655
|
}
|
|
90235
90656
|
|
|
90657
|
+
/* =============================================================================
|
|
90658
|
+
* Shared: Inline Text Marks
|
|
90659
|
+
* =============================================================================
|
|
90660
|
+
*/
|
|
90661
|
+
|
|
90662
|
+
:where(.theme-scope) .rb-inline-text-accent,
|
|
90663
|
+
:where(.theme-scope) .rb-inline-text-highlight {
|
|
90664
|
+
font: inherit;
|
|
90665
|
+
letter-spacing: inherit;
|
|
90666
|
+
text-transform: inherit;
|
|
90667
|
+
}
|
|
90668
|
+
|
|
90669
|
+
:where(.theme-scope) .rb-inline-text-accent-accent {
|
|
90670
|
+
color: rgb(var(--tb-accent));
|
|
90671
|
+
}
|
|
90672
|
+
|
|
90673
|
+
:where(.theme-scope) .rb-inline-text-accent-brand {
|
|
90674
|
+
color: rgb(var(--tb-primary));
|
|
90675
|
+
}
|
|
90676
|
+
|
|
90677
|
+
:where(.theme-scope) .rb-inline-text-accent-contrast {
|
|
90678
|
+
color: var(--section-text-color, rgb(var(--tb-text)));
|
|
90679
|
+
}
|
|
90680
|
+
|
|
90681
|
+
:where(.theme-scope) .rb-inline-text-highlight {
|
|
90682
|
+
border-radius: 0.22em;
|
|
90683
|
+
box-decoration-break: clone;
|
|
90684
|
+
-webkit-box-decoration-break: clone;
|
|
90685
|
+
padding: 0.02em 0.12em;
|
|
90686
|
+
}
|
|
90687
|
+
|
|
90688
|
+
:where(.theme-scope) .rb-inline-text-highlight-soft {
|
|
90689
|
+
background: color-mix(in oklab, var(--section-text-color, rgb(var(--tb-text))) 14%, transparent);
|
|
90690
|
+
}
|
|
90691
|
+
|
|
90692
|
+
:where(.theme-scope) .rb-inline-text-highlight-accent {
|
|
90693
|
+
background: color-mix(in oklab, rgb(var(--tb-accent)) 28%, transparent);
|
|
90694
|
+
}
|
|
90695
|
+
|
|
90696
|
+
:where(.theme-scope) .rb-inline-text-highlight-brand {
|
|
90697
|
+
background: color-mix(in oklab, rgb(var(--tb-primary)) 24%, transparent);
|
|
90698
|
+
}
|
|
90699
|
+
|
|
90236
90700
|
/* =============================================================================
|
|
90237
90701
|
* Block: Hero (Phase 2)
|
|
90238
90702
|
* Uses theme palette vars directly (no Tier 3 vars needed)
|
|
@@ -95521,14 +95985,14 @@ function backgroundCapabilityFromModes(modeCapabilities) {
|
|
|
95521
95985
|
};
|
|
95522
95986
|
}
|
|
95523
95987
|
function parseBackgroundOverrideFromContent(content) {
|
|
95524
|
-
const sectionStyles =
|
|
95988
|
+
const sectionStyles = isRecord15(content._sectionStyles) ? content._sectionStyles : null;
|
|
95525
95989
|
return parseBackgroundOverride(sectionStyles?.background);
|
|
95526
95990
|
}
|
|
95527
95991
|
function parseBackgroundOverride(value) {
|
|
95528
95992
|
if (value === null || value === void 0) {
|
|
95529
95993
|
return { kind: "supported", override: DEFAULT_BACKGROUND_OVERRIDE };
|
|
95530
95994
|
}
|
|
95531
|
-
if (!
|
|
95995
|
+
if (!isRecord15(value)) {
|
|
95532
95996
|
return { kind: "legacy", reason: "unsupported-shape", background: {} };
|
|
95533
95997
|
}
|
|
95534
95998
|
if (Object.keys(value).length === 0) {
|
|
@@ -95609,7 +96073,7 @@ function serializeBackgroundOverride(override) {
|
|
|
95609
96073
|
}
|
|
95610
96074
|
}
|
|
95611
96075
|
function applyBackgroundOverrideContentPatch(content, override) {
|
|
95612
|
-
const sectionStyles =
|
|
96076
|
+
const sectionStyles = isRecord15(content._sectionStyles) ? content._sectionStyles : {};
|
|
95613
96077
|
const serialized = serializeBackgroundOverride(override);
|
|
95614
96078
|
if (serialized === null) {
|
|
95615
96079
|
const nextSectionStyles = omitRecordKey2(sectionStyles, "background");
|
|
@@ -95811,7 +96275,7 @@ function imageAllowed(mediaId, pool) {
|
|
|
95811
96275
|
return pool?.some((item) => item.mediaId === mediaId) ?? false;
|
|
95812
96276
|
}
|
|
95813
96277
|
function parseImageMediaAssetId(value) {
|
|
95814
|
-
if (!
|
|
96278
|
+
if (!isRecord15(value)) return { kind: "missing" };
|
|
95815
96279
|
if (value.type !== void 0 && value.type !== "image") return { kind: "missing" };
|
|
95816
96280
|
const parsed = parseMediaAssetId(value.assetId);
|
|
95817
96281
|
if (!parsed.ok) {
|
|
@@ -95859,116 +96323,9 @@ function omitRecordKey2(content, key) {
|
|
|
95859
96323
|
Object.entries(content).filter(([entryKey]) => entryKey !== key)
|
|
95860
96324
|
);
|
|
95861
96325
|
}
|
|
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
96326
|
function isRecord15(value) {
|
|
95870
96327
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95871
96328
|
}
|
|
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
96329
|
|
|
95973
96330
|
// ../content-editor/src/linkedEntries/domain.ts
|
|
95974
96331
|
function unsafeAsLinkedContentEntryId(value) {
|
|
@@ -124307,6 +124664,7 @@ function toManifestFieldInput(field) {
|
|
|
124307
124664
|
case "button":
|
|
124308
124665
|
throw new Error("Button fields do not have canonical content validation");
|
|
124309
124666
|
case "text":
|
|
124667
|
+
case "inlineText":
|
|
124310
124668
|
case "richText":
|
|
124311
124669
|
case "media":
|
|
124312
124670
|
case "file":
|
|
@@ -124661,6 +125019,17 @@ function getRichTextFieldDefaultValue(_config) {
|
|
|
124661
125019
|
return EMPTY_RICH_TEXT_DOC;
|
|
124662
125020
|
}
|
|
124663
125021
|
|
|
125022
|
+
// ../block-form/src/widgets/InlineTextField/inlineTextFieldSchema.ts
|
|
125023
|
+
function buildInlineTextFieldSchema(field) {
|
|
125024
|
+
return buildCanonicalFieldSchema(field);
|
|
125025
|
+
}
|
|
125026
|
+
|
|
125027
|
+
// ../block-form/src/widgets/InlineTextField/inlineTextFieldDefaults.ts
|
|
125028
|
+
function getInlineTextFieldDefaultValue(field) {
|
|
125029
|
+
if (field.defaultValue !== void 0) return field.defaultValue;
|
|
125030
|
+
return field.required ? plainTextToInlineText(field.label) : [];
|
|
125031
|
+
}
|
|
125032
|
+
|
|
124664
125033
|
// ../block-form/src/widgets/MediaField/mediaFieldSchema.ts
|
|
124665
125034
|
function buildMediaFieldSchema(config) {
|
|
124666
125035
|
return buildCanonicalFieldSchema(config);
|
|
@@ -124771,6 +125140,7 @@ var SCHEMA_BUILDERS = {
|
|
|
124771
125140
|
slug: buildSlugFieldSchema,
|
|
124772
125141
|
link: buildLinkFieldSchema,
|
|
124773
125142
|
richText: buildRichTextFieldSchema,
|
|
125143
|
+
inlineText: buildInlineTextFieldSchema,
|
|
124774
125144
|
media: buildMediaFieldSchema,
|
|
124775
125145
|
file: buildMediaFieldSchema,
|
|
124776
125146
|
tabGroup: buildTabGroupFieldSchema,
|
|
@@ -124794,6 +125164,7 @@ var DEFAULT_VALUE_BUILDERS = {
|
|
|
124794
125164
|
slug: getSlugFieldDefault,
|
|
124795
125165
|
link: getLinkFieldDefault,
|
|
124796
125166
|
richText: getRichTextFieldDefaultValue,
|
|
125167
|
+
inlineText: getInlineTextFieldDefaultValue,
|
|
124797
125168
|
media: getMediaFieldDefaultValue,
|
|
124798
125169
|
file: getMediaFieldDefaultValue,
|
|
124799
125170
|
tabGroup: getTabGroupFieldDefault,
|
|
@@ -124933,6 +125304,7 @@ function shouldUseCanonicalSchema(field) {
|
|
|
124933
125304
|
case "media":
|
|
124934
125305
|
case "file":
|
|
124935
125306
|
case "reference":
|
|
125307
|
+
case "inlineText":
|
|
124936
125308
|
return true;
|
|
124937
125309
|
case "group":
|
|
124938
125310
|
return getGroupChildFields(field).every(shouldUseCanonicalSchema);
|
|
@@ -161428,10 +161800,92 @@ function SliderField({ path, backend, config }) {
|
|
|
161428
161800
|
}
|
|
161429
161801
|
);
|
|
161430
161802
|
}
|
|
161803
|
+
function InlineTextField({
|
|
161804
|
+
path,
|
|
161805
|
+
backend,
|
|
161806
|
+
config
|
|
161807
|
+
}) {
|
|
161808
|
+
const plainTextPath = config.plainTextField ? siblingPath(path, config.plainTextField) : null;
|
|
161809
|
+
return plainTextPath ? /* @__PURE__ */ jsx(LinkedInlineTextField, { path, backend, config, plainTextPath }) : /* @__PURE__ */ jsx(StandaloneInlineTextField, { path, backend, config });
|
|
161810
|
+
}
|
|
161811
|
+
function StandaloneInlineTextField({
|
|
161812
|
+
path,
|
|
161813
|
+
backend,
|
|
161814
|
+
config
|
|
161815
|
+
}) {
|
|
161816
|
+
const { value, error, setValue } = useField(path, backend);
|
|
161817
|
+
const inlineValue = useMemo(
|
|
161818
|
+
() => coerceInlineTextWithFallback(value, void 0),
|
|
161819
|
+
[value]
|
|
161820
|
+
);
|
|
161821
|
+
const plainText = inlineTextToPlainText(inlineValue);
|
|
161822
|
+
return /* @__PURE__ */ jsx(
|
|
161823
|
+
FieldFrame,
|
|
161824
|
+
{
|
|
161825
|
+
fieldPath: path,
|
|
161826
|
+
label: config.label,
|
|
161827
|
+
required: config.required,
|
|
161828
|
+
description: config.description,
|
|
161829
|
+
error: error?.message,
|
|
161830
|
+
children: ({ id }) => /* @__PURE__ */ jsx(
|
|
161831
|
+
Textarea,
|
|
161832
|
+
{
|
|
161833
|
+
id,
|
|
161834
|
+
value: plainText,
|
|
161835
|
+
maxLength: config.maxLength,
|
|
161836
|
+
rows: 2,
|
|
161837
|
+
onChange: (event) => {
|
|
161838
|
+
const nextPlainText = event.target.value;
|
|
161839
|
+
setValue(plainTextToInlineText(nextPlainText));
|
|
161840
|
+
}
|
|
161841
|
+
}
|
|
161842
|
+
)
|
|
161843
|
+
}
|
|
161844
|
+
);
|
|
161845
|
+
}
|
|
161846
|
+
function LinkedInlineTextField({
|
|
161847
|
+
path,
|
|
161848
|
+
backend,
|
|
161849
|
+
config,
|
|
161850
|
+
plainTextPath
|
|
161851
|
+
}) {
|
|
161852
|
+
const { value, error, setValue } = useField(path, backend);
|
|
161853
|
+
const plainTextField = useField(plainTextPath, backend);
|
|
161854
|
+
const inlineValue = useMemo(
|
|
161855
|
+
() => coerceInlineTextWithFallback(value, plainTextField.value),
|
|
161856
|
+
[plainTextField.value, value]
|
|
161857
|
+
);
|
|
161858
|
+
const plainText = inlineTextToPlainText(inlineValue);
|
|
161859
|
+
return /* @__PURE__ */ jsx(
|
|
161860
|
+
FieldFrame,
|
|
161861
|
+
{
|
|
161862
|
+
fieldPath: path,
|
|
161863
|
+
label: config.label,
|
|
161864
|
+
required: config.required,
|
|
161865
|
+
description: config.description,
|
|
161866
|
+
error: error?.message,
|
|
161867
|
+
children: ({ id }) => /* @__PURE__ */ jsx(
|
|
161868
|
+
Textarea,
|
|
161869
|
+
{
|
|
161870
|
+
id,
|
|
161871
|
+
value: plainText,
|
|
161872
|
+
maxLength: config.maxLength,
|
|
161873
|
+
rows: 2,
|
|
161874
|
+
onChange: (event) => {
|
|
161875
|
+
const nextPlainText = event.target.value;
|
|
161876
|
+
setValue(plainTextToInlineText(nextPlainText));
|
|
161877
|
+
plainTextField.setValue(nextPlainText);
|
|
161878
|
+
}
|
|
161879
|
+
}
|
|
161880
|
+
)
|
|
161881
|
+
}
|
|
161882
|
+
);
|
|
161883
|
+
}
|
|
161431
161884
|
|
|
161432
161885
|
// ../block-form/src/registry/widgets.ts
|
|
161433
161886
|
var WIDGET_COMPONENTS = {
|
|
161434
161887
|
text: TextField,
|
|
161888
|
+
inlineText: InlineTextField,
|
|
161435
161889
|
number: NumberField,
|
|
161436
161890
|
select: SelectField,
|
|
161437
161891
|
sdkSelect: SdkSelectField,
|
|
@@ -162733,6 +163187,914 @@ function EditorChrome({
|
|
|
162733
163187
|
] });
|
|
162734
163188
|
}
|
|
162735
163189
|
|
|
163190
|
+
// ../editor/src/inline/domParse.ts
|
|
163191
|
+
function parseEditableInlineText(root) {
|
|
163192
|
+
const runs = [];
|
|
163193
|
+
for (const child of Array.from(root.childNodes)) {
|
|
163194
|
+
collectInlineTextRuns(child, [], runs);
|
|
163195
|
+
}
|
|
163196
|
+
return normalizeInlineText(runs);
|
|
163197
|
+
}
|
|
163198
|
+
function inlineTextToEditableHtml(value) {
|
|
163199
|
+
return normalizeInlineText(value).map(runToHtml).join("");
|
|
163200
|
+
}
|
|
163201
|
+
function collectInlineTextRuns(node, inheritedMarks, runs) {
|
|
163202
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
163203
|
+
const text2 = node.textContent ?? "";
|
|
163204
|
+
if (text2.length === 0) return;
|
|
163205
|
+
const marks = normalizeInlineTextMarks(inheritedMarks);
|
|
163206
|
+
runs.push(marks.length > 0 ? { text: text2, marks } : { text: text2 });
|
|
163207
|
+
return;
|
|
163208
|
+
}
|
|
163209
|
+
if (!(node instanceof HTMLElement)) return;
|
|
163210
|
+
const nextMarks = normalizeInlineTextMarks([...inheritedMarks, ...marksForElement(node)]);
|
|
163211
|
+
for (const child of Array.from(node.childNodes)) {
|
|
163212
|
+
collectInlineTextRuns(child, nextMarks, runs);
|
|
163213
|
+
}
|
|
163214
|
+
}
|
|
163215
|
+
function marksForElement(element) {
|
|
163216
|
+
const tagName = element.tagName.toLowerCase();
|
|
163217
|
+
const marks = [];
|
|
163218
|
+
if (tagName === "strong" || tagName === "b") marks.push({ kind: "strong" });
|
|
163219
|
+
if (tagName === "em" || tagName === "i") marks.push({ kind: "emphasis" });
|
|
163220
|
+
for (const tone of inlineTextAccentTones) {
|
|
163221
|
+
if (element.classList.contains(`rb-inline-text-accent-${tone}`)) {
|
|
163222
|
+
marks.push({ kind: "accent", tone });
|
|
163223
|
+
}
|
|
163224
|
+
}
|
|
163225
|
+
for (const tone of inlineTextHighlightTones) {
|
|
163226
|
+
if (element.classList.contains(`rb-inline-text-highlight-${tone}`)) {
|
|
163227
|
+
marks.push({ kind: "highlight", tone });
|
|
163228
|
+
}
|
|
163229
|
+
}
|
|
163230
|
+
return marks;
|
|
163231
|
+
}
|
|
163232
|
+
function runToHtml(run3) {
|
|
163233
|
+
return normalizeInlineTextMarks(run3.marks ?? []).reduceRight(
|
|
163234
|
+
(html, mark) => wrapHtmlWithMark(html, mark),
|
|
163235
|
+
escapeHtml(run3.text)
|
|
163236
|
+
);
|
|
163237
|
+
}
|
|
163238
|
+
function wrapHtmlWithMark(html, mark) {
|
|
163239
|
+
switch (mark.kind) {
|
|
163240
|
+
case "strong":
|
|
163241
|
+
return `<strong>${html}</strong>`;
|
|
163242
|
+
case "emphasis":
|
|
163243
|
+
return `<em>${html}</em>`;
|
|
163244
|
+
case "accent":
|
|
163245
|
+
return `<span class="rb-inline-text-accent rb-inline-text-accent-${accentClass(mark.tone)}">${html}</span>`;
|
|
163246
|
+
case "highlight":
|
|
163247
|
+
return `<span class="rb-inline-text-highlight rb-inline-text-highlight-${highlightClass(mark.tone)}">${html}</span>`;
|
|
163248
|
+
}
|
|
163249
|
+
}
|
|
163250
|
+
function accentClass(tone) {
|
|
163251
|
+
return tone;
|
|
163252
|
+
}
|
|
163253
|
+
function highlightClass(tone) {
|
|
163254
|
+
return tone;
|
|
163255
|
+
}
|
|
163256
|
+
function escapeHtml(value) {
|
|
163257
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
163258
|
+
}
|
|
163259
|
+
|
|
163260
|
+
// ../editor/src/inline/presentation.ts
|
|
163261
|
+
var DARK_TOOLBAR_SURFACE = { r: 15, g: 23, b: 42, a: 1 };
|
|
163262
|
+
var LIGHT_TOOLBAR_SURFACE = { r: 255, g: 255, b: 255, a: 1 };
|
|
163263
|
+
var DARK_TEXT = { r: 15, g: 23, b: 42, a: 1 };
|
|
163264
|
+
var LIGHT_TEXT = { r: 255, g: 255, b: 255, a: 1 };
|
|
163265
|
+
var UNKNOWN_SURFACE_CANDIDATES = [
|
|
163266
|
+
LIGHT_TOOLBAR_SURFACE,
|
|
163267
|
+
DARK_TOOLBAR_SURFACE
|
|
163268
|
+
];
|
|
163269
|
+
var MIN_SAMPLE_CONTRAST = 3;
|
|
163270
|
+
function defaultInlineTextPresentationContext(tone) {
|
|
163271
|
+
const surface = fallbackSurfaceForToolbarTone(tone);
|
|
163272
|
+
const selectedTextRgba = tone === "dark" ? LIGHT_TEXT : DARK_TEXT;
|
|
163273
|
+
return {
|
|
163274
|
+
surface,
|
|
163275
|
+
selectedTextColor: colorToCss(selectedTextRgba),
|
|
163276
|
+
selectedTextRgba,
|
|
163277
|
+
accentTextRgbaByTone: defaultAccentTextRgbaByTone(selectedTextRgba),
|
|
163278
|
+
typography: {}
|
|
163279
|
+
};
|
|
163280
|
+
}
|
|
163281
|
+
function readInlineTextPresentationContext(editable, toolbarTone) {
|
|
163282
|
+
const computed = window.getComputedStyle(editable);
|
|
163283
|
+
const selectedTextRgba = parseCssColor(computed.color) ?? fallbackTextColorForTone(toolbarTone);
|
|
163284
|
+
return {
|
|
163285
|
+
surface: readInlineTextSurface(editable, toolbarTone),
|
|
163286
|
+
selectedTextColor: colorToCss(selectedTextRgba),
|
|
163287
|
+
selectedTextRgba,
|
|
163288
|
+
accentTextRgbaByTone: readAccentTextRgbaByTone(editable, selectedTextRgba),
|
|
163289
|
+
typography: {
|
|
163290
|
+
fontFamily: computed.fontFamily,
|
|
163291
|
+
fontSize: computed.fontSize,
|
|
163292
|
+
fontStyle: computed.fontStyle,
|
|
163293
|
+
fontWeight: computed.fontWeight,
|
|
163294
|
+
letterSpacing: computed.letterSpacing,
|
|
163295
|
+
lineHeight: computed.lineHeight,
|
|
163296
|
+
textTransform: computed.textTransform
|
|
163297
|
+
}
|
|
163298
|
+
};
|
|
163299
|
+
}
|
|
163300
|
+
function buildAccentTonePreview(tone, context) {
|
|
163301
|
+
const textColor = accentColorValue(tone);
|
|
163302
|
+
const textRgba = context.accentTextRgbaByTone[tone] ?? context.selectedTextRgba;
|
|
163303
|
+
return buildPreview({ color: textColor }, textRgba, context);
|
|
163304
|
+
}
|
|
163305
|
+
function buildHighlightTonePreview(tone, context) {
|
|
163306
|
+
const background = highlightBackgroundValue(tone);
|
|
163307
|
+
return buildPreview(
|
|
163308
|
+
{ color: context.selectedTextColor, background },
|
|
163309
|
+
context.selectedTextRgba,
|
|
163310
|
+
context
|
|
163311
|
+
);
|
|
163312
|
+
}
|
|
163313
|
+
function buildPlainTonePreview(context) {
|
|
163314
|
+
return buildPreview(
|
|
163315
|
+
{ color: context.selectedTextColor },
|
|
163316
|
+
context.selectedTextRgba,
|
|
163317
|
+
context
|
|
163318
|
+
);
|
|
163319
|
+
}
|
|
163320
|
+
function buildPreview(markStyle, textRgba, context) {
|
|
163321
|
+
const surface = previewSurfaceForText(textRgba, context.surface);
|
|
163322
|
+
const textOnSurface = contrastRatio2(textRgba, surface.rgba);
|
|
163323
|
+
const lowContrast = textOnSurface < MIN_SAMPLE_CONTRAST;
|
|
163324
|
+
return {
|
|
163325
|
+
lowContrast,
|
|
163326
|
+
surfaceStyle: {
|
|
163327
|
+
backgroundColor: surface.color
|
|
163328
|
+
},
|
|
163329
|
+
surfaceRgba: surface.rgba,
|
|
163330
|
+
textRgba,
|
|
163331
|
+
textStyle: {
|
|
163332
|
+
...previewTypography(context.typography),
|
|
163333
|
+
...markStyle
|
|
163334
|
+
}
|
|
163335
|
+
};
|
|
163336
|
+
}
|
|
163337
|
+
function inlineTextTonePreviewLooksSame(left, right) {
|
|
163338
|
+
return sameRgba(left.surfaceRgba, right.surfaceRgba) && sameRgba(left.textRgba, right.textRgba) && left.textStyle.background === right.textStyle.background && left.textStyle.backgroundColor === right.textStyle.backgroundColor;
|
|
163339
|
+
}
|
|
163340
|
+
function previewTypography(typography) {
|
|
163341
|
+
const fontSize = parseCssPixelValue(typography.fontSize);
|
|
163342
|
+
if (fontSize === null || fontSize <= 22) {
|
|
163343
|
+
return typography;
|
|
163344
|
+
}
|
|
163345
|
+
return {
|
|
163346
|
+
...typography,
|
|
163347
|
+
fontSize: "18px",
|
|
163348
|
+
lineHeight: "1.15"
|
|
163349
|
+
};
|
|
163350
|
+
}
|
|
163351
|
+
function previewSurfaceForText(textRgba, surface) {
|
|
163352
|
+
if (surface.kind === "block-solid" || surface.kind === "image-overlay") {
|
|
163353
|
+
return surface;
|
|
163354
|
+
}
|
|
163355
|
+
const currentContrast = contrastRatio2(textRgba, surface.rgba);
|
|
163356
|
+
if (currentContrast >= MIN_SAMPLE_CONTRAST) {
|
|
163357
|
+
return surface;
|
|
163358
|
+
}
|
|
163359
|
+
return [surface.rgba, ...UNKNOWN_SURFACE_CANDIDATES].map((candidate) => ({
|
|
163360
|
+
color: colorToCss(candidate),
|
|
163361
|
+
rgba: candidate,
|
|
163362
|
+
contrast: contrastRatio2(textRgba, candidate)
|
|
163363
|
+
})).reduce((best, candidate) => candidate.contrast > best.contrast ? candidate : best);
|
|
163364
|
+
}
|
|
163365
|
+
function defaultAccentTextRgbaByTone(fallback2) {
|
|
163366
|
+
return Object.fromEntries(
|
|
163367
|
+
inlineTextAccentTones.map((tone) => [tone, fallback2])
|
|
163368
|
+
);
|
|
163369
|
+
}
|
|
163370
|
+
function readAccentTextRgbaByTone(editable, fallback2) {
|
|
163371
|
+
return Object.fromEntries(
|
|
163372
|
+
inlineTextAccentTones.map((tone) => [
|
|
163373
|
+
tone,
|
|
163374
|
+
resolveCssColor(editable, accentColorValue(tone), "color") ?? fallback2
|
|
163375
|
+
])
|
|
163376
|
+
);
|
|
163377
|
+
}
|
|
163378
|
+
function readInlineTextSurface(editable, toolbarTone) {
|
|
163379
|
+
const fallback2 = readThemeFallbackSurface(editable) ?? fallbackSurfaceForToolbarTone(toolbarTone);
|
|
163380
|
+
const block = editable.closest("[data-block]") ?? editable.closest(".rb-section");
|
|
163381
|
+
if (!block) return fallback2;
|
|
163382
|
+
const styleLayer = block.querySelector(".background-style");
|
|
163383
|
+
const overlay = block.querySelector(".background-overlay");
|
|
163384
|
+
const hasImage = Boolean(block.querySelector(".background-image"));
|
|
163385
|
+
const overlayColor = overlay ? readVisibleBackgroundColor(overlay) : null;
|
|
163386
|
+
if (hasImage && overlay && overlayColor) {
|
|
163387
|
+
const opacity = readOpacity(overlay);
|
|
163388
|
+
const composited = opacity < 1 || overlayColor.a < 1 ? compositeColors(overlayColor, fallback2.rgba, opacity) : overlayColor;
|
|
163389
|
+
return {
|
|
163390
|
+
kind: "image-overlay",
|
|
163391
|
+
color: colorToCss(composited),
|
|
163392
|
+
rgba: composited
|
|
163393
|
+
};
|
|
163394
|
+
}
|
|
163395
|
+
if (!hasImage && styleLayer) {
|
|
163396
|
+
const styleLayerColor = readVisibleBackgroundColor(styleLayer, { includeElementOpacity: true });
|
|
163397
|
+
if (styleLayerColor) {
|
|
163398
|
+
return {
|
|
163399
|
+
kind: "block-solid",
|
|
163400
|
+
color: colorToCss(styleLayerColor),
|
|
163401
|
+
rgba: styleLayerColor
|
|
163402
|
+
};
|
|
163403
|
+
}
|
|
163404
|
+
}
|
|
163405
|
+
if (!hasImage) {
|
|
163406
|
+
const blockColor = readVisibleBackgroundColor(block, { includeElementOpacity: true });
|
|
163407
|
+
if (blockColor) {
|
|
163408
|
+
return {
|
|
163409
|
+
kind: "block-solid",
|
|
163410
|
+
color: colorToCss(blockColor),
|
|
163411
|
+
rgba: blockColor
|
|
163412
|
+
};
|
|
163413
|
+
}
|
|
163414
|
+
}
|
|
163415
|
+
return fallback2;
|
|
163416
|
+
}
|
|
163417
|
+
function readThemeFallbackSurface(root) {
|
|
163418
|
+
const themeScope = root.closest(".theme-scope") ?? root;
|
|
163419
|
+
const computed = window.getComputedStyle(themeScope);
|
|
163420
|
+
const color = readRgbTripletCustomProperty(computed, "--section-bg-color") ?? readRgbTripletCustomProperty(computed, "--tb-background") ?? readRgbTripletCustomProperty(computed, "--tb-surface");
|
|
163421
|
+
return color ? {
|
|
163422
|
+
kind: "theme-fallback",
|
|
163423
|
+
color: colorToCss(color),
|
|
163424
|
+
rgba: color
|
|
163425
|
+
} : null;
|
|
163426
|
+
}
|
|
163427
|
+
function fallbackSurfaceForToolbarTone(tone) {
|
|
163428
|
+
const rgba = tone === "dark" ? DARK_TOOLBAR_SURFACE : LIGHT_TOOLBAR_SURFACE;
|
|
163429
|
+
return {
|
|
163430
|
+
kind: "toolbar-fallback",
|
|
163431
|
+
color: colorToCss(rgba),
|
|
163432
|
+
rgba
|
|
163433
|
+
};
|
|
163434
|
+
}
|
|
163435
|
+
function fallbackTextColorForTone(tone) {
|
|
163436
|
+
return tone === "dark" ? LIGHT_TEXT : DARK_TEXT;
|
|
163437
|
+
}
|
|
163438
|
+
function readVisibleBackgroundColor(element, options = {}) {
|
|
163439
|
+
const computed = window.getComputedStyle(element);
|
|
163440
|
+
if (computed.display === "none" || computed.visibility === "hidden") return null;
|
|
163441
|
+
const color = parseCssColor(computed.backgroundColor);
|
|
163442
|
+
if (!color || color.a === 0) return null;
|
|
163443
|
+
if (!options.includeElementOpacity) return color;
|
|
163444
|
+
const opacity = readOpacity(element);
|
|
163445
|
+
return opacity < 1 ? { ...color, a: color.a * opacity } : color;
|
|
163446
|
+
}
|
|
163447
|
+
function readOpacity(element) {
|
|
163448
|
+
const opacity = Number.parseFloat(window.getComputedStyle(element).opacity);
|
|
163449
|
+
if (!Number.isFinite(opacity)) return 1;
|
|
163450
|
+
return Math.max(0, Math.min(1, opacity));
|
|
163451
|
+
}
|
|
163452
|
+
function accentColorValue(tone) {
|
|
163453
|
+
switch (tone) {
|
|
163454
|
+
case "accent":
|
|
163455
|
+
return "rgb(var(--tb-accent))";
|
|
163456
|
+
case "brand":
|
|
163457
|
+
return "rgb(var(--tb-primary))";
|
|
163458
|
+
case "contrast":
|
|
163459
|
+
return "var(--section-text-color, rgb(var(--tb-text)))";
|
|
163460
|
+
}
|
|
163461
|
+
}
|
|
163462
|
+
function highlightBackgroundValue(tone) {
|
|
163463
|
+
switch (tone) {
|
|
163464
|
+
case "soft":
|
|
163465
|
+
return "color-mix(in oklab, var(--section-text-color, rgb(var(--tb-text))) 14%, transparent)";
|
|
163466
|
+
case "accent":
|
|
163467
|
+
return "color-mix(in oklab, rgb(var(--tb-accent)) 28%, transparent)";
|
|
163468
|
+
case "brand":
|
|
163469
|
+
return "color-mix(in oklab, rgb(var(--tb-primary)) 24%, transparent)";
|
|
163470
|
+
}
|
|
163471
|
+
}
|
|
163472
|
+
function resolveCssColor(referenceElement, value, property) {
|
|
163473
|
+
if (!referenceElement) return parseCssColor(value);
|
|
163474
|
+
const probe = document.createElement("span");
|
|
163475
|
+
probe.textContent = "";
|
|
163476
|
+
probe.style.position = "absolute";
|
|
163477
|
+
probe.style.pointerEvents = "none";
|
|
163478
|
+
probe.style.visibility = "hidden";
|
|
163479
|
+
probe.style[property] = value;
|
|
163480
|
+
referenceElement.appendChild(probe);
|
|
163481
|
+
const resolved = window.getComputedStyle(probe)[property];
|
|
163482
|
+
probe.remove();
|
|
163483
|
+
return parseCssColor(resolved);
|
|
163484
|
+
}
|
|
163485
|
+
function readRgbTripletCustomProperty(computed, propertyName) {
|
|
163486
|
+
const value = computed.getPropertyValue(propertyName).trim();
|
|
163487
|
+
const parts = value.split(/\s+/).map((part) => Number.parseFloat(part));
|
|
163488
|
+
const [r4, g2, b2] = parts;
|
|
163489
|
+
if (!isValidRgbChannel(r4) || !isValidRgbChannel(g2) || !isValidRgbChannel(b2)) {
|
|
163490
|
+
return null;
|
|
163491
|
+
}
|
|
163492
|
+
return { r: r4, g: g2, b: b2, a: 1 };
|
|
163493
|
+
}
|
|
163494
|
+
function parseCssColor(value) {
|
|
163495
|
+
const trimmed = value.trim().toLowerCase();
|
|
163496
|
+
if (!trimmed || trimmed === "transparent") {
|
|
163497
|
+
return { r: 0, g: 0, b: 0, a: 0 };
|
|
163498
|
+
}
|
|
163499
|
+
const hex = parseHexColor(trimmed);
|
|
163500
|
+
if (hex) return hex;
|
|
163501
|
+
const rgbMatch = trimmed.match(/^rgba?\(([^)]+)\)$/);
|
|
163502
|
+
if (!rgbMatch?.[1]) return null;
|
|
163503
|
+
const normalized = rgbMatch[1].replace(/\s*\/\s*/, ", ");
|
|
163504
|
+
const parts = normalized.split(/[,\s]+/).filter(Boolean);
|
|
163505
|
+
const [rawR, rawG, rawB, rawAlpha] = parts;
|
|
163506
|
+
const r4 = parseRgbChannel(rawR);
|
|
163507
|
+
const g2 = parseRgbChannel(rawG);
|
|
163508
|
+
const b2 = parseRgbChannel(rawB);
|
|
163509
|
+
const alpha2 = rawAlpha === void 0 ? 1 : parseAlphaChannel(rawAlpha);
|
|
163510
|
+
if (!isValidRgbChannel(r4) || !isValidRgbChannel(g2) || !isValidRgbChannel(b2)) {
|
|
163511
|
+
return null;
|
|
163512
|
+
}
|
|
163513
|
+
return {
|
|
163514
|
+
r: r4,
|
|
163515
|
+
g: g2,
|
|
163516
|
+
b: b2,
|
|
163517
|
+
a: isValidAlpha(alpha2) ? alpha2 : 1
|
|
163518
|
+
};
|
|
163519
|
+
}
|
|
163520
|
+
function parseRgbChannel(value) {
|
|
163521
|
+
if (!value) return void 0;
|
|
163522
|
+
return value.endsWith("%") ? Number.parseFloat(value) / 100 * 255 : Number.parseFloat(value);
|
|
163523
|
+
}
|
|
163524
|
+
function parseAlphaChannel(value) {
|
|
163525
|
+
return value.endsWith("%") ? Number.parseFloat(value) / 100 : Number.parseFloat(value);
|
|
163526
|
+
}
|
|
163527
|
+
function parseHexColor(value) {
|
|
163528
|
+
const hex = value.startsWith("#") ? value.slice(1) : value;
|
|
163529
|
+
if (!/^[0-9a-f]{3}([0-9a-f]{3})?$/i.test(hex)) return null;
|
|
163530
|
+
const normalized = hex.length === 3 ? hex.split("").map((part) => `${part}${part}`).join("") : hex;
|
|
163531
|
+
return {
|
|
163532
|
+
r: Number.parseInt(normalized.slice(0, 2), 16),
|
|
163533
|
+
g: Number.parseInt(normalized.slice(2, 4), 16),
|
|
163534
|
+
b: Number.parseInt(normalized.slice(4, 6), 16),
|
|
163535
|
+
a: 1
|
|
163536
|
+
};
|
|
163537
|
+
}
|
|
163538
|
+
function isValidRgbChannel(value) {
|
|
163539
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 255;
|
|
163540
|
+
}
|
|
163541
|
+
function isValidAlpha(value) {
|
|
163542
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 1;
|
|
163543
|
+
}
|
|
163544
|
+
function parseCssPixelValue(value) {
|
|
163545
|
+
if (typeof value !== "string") return null;
|
|
163546
|
+
const match2 = value.trim().match(/^(\d+(?:\.\d+)?)px$/);
|
|
163547
|
+
return match2?.[1] ? Number.parseFloat(match2[1]) : null;
|
|
163548
|
+
}
|
|
163549
|
+
function sameRgba(left, right) {
|
|
163550
|
+
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;
|
|
163551
|
+
}
|
|
163552
|
+
function colorToCss(color) {
|
|
163553
|
+
const r4 = Math.round(color.r);
|
|
163554
|
+
const g2 = Math.round(color.g);
|
|
163555
|
+
const b2 = Math.round(color.b);
|
|
163556
|
+
return color.a < 1 ? `rgba(${r4}, ${g2}, ${b2}, ${color.a})` : `rgb(${r4}, ${g2}, ${b2})`;
|
|
163557
|
+
}
|
|
163558
|
+
function compositeColors(foreground, background, opacity) {
|
|
163559
|
+
const alpha2 = Math.max(0, Math.min(1, foreground.a * opacity));
|
|
163560
|
+
return {
|
|
163561
|
+
r: foreground.r * alpha2 + background.r * (1 - alpha2),
|
|
163562
|
+
g: foreground.g * alpha2 + background.g * (1 - alpha2),
|
|
163563
|
+
b: foreground.b * alpha2 + background.b * (1 - alpha2),
|
|
163564
|
+
a: 1
|
|
163565
|
+
};
|
|
163566
|
+
}
|
|
163567
|
+
function contrastRatio2(foreground, background) {
|
|
163568
|
+
const fg = foreground.a < 1 ? compositeColors(foreground, background, 1) : foreground;
|
|
163569
|
+
const bg = background.a < 1 ? compositeColors(background, LIGHT_TOOLBAR_SURFACE, 1) : background;
|
|
163570
|
+
const lighter = Math.max(relativeLuminance2(fg), relativeLuminance2(bg));
|
|
163571
|
+
const darker = Math.min(relativeLuminance2(fg), relativeLuminance2(bg));
|
|
163572
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
163573
|
+
}
|
|
163574
|
+
function relativeLuminance2(color) {
|
|
163575
|
+
const r4 = srgbToLinear2(color.r);
|
|
163576
|
+
const g2 = srgbToLinear2(color.g);
|
|
163577
|
+
const b2 = srgbToLinear2(color.b);
|
|
163578
|
+
return 0.2126 * r4 + 0.7152 * g2 + 0.0722 * b2;
|
|
163579
|
+
}
|
|
163580
|
+
function srgbToLinear2(channel) {
|
|
163581
|
+
const normalized = channel / 255;
|
|
163582
|
+
return normalized <= 0.03928 ? normalized / 12.92 : Math.pow((normalized + 0.055) / 1.055, 2.4);
|
|
163583
|
+
}
|
|
163584
|
+
function FloatingToolbar({
|
|
163585
|
+
selection,
|
|
163586
|
+
selectedText,
|
|
163587
|
+
tone,
|
|
163588
|
+
presentationContext,
|
|
163589
|
+
openMenu,
|
|
163590
|
+
setOpenMenu,
|
|
163591
|
+
onToggleStrong,
|
|
163592
|
+
onToggleEmphasis,
|
|
163593
|
+
onApplyAccent,
|
|
163594
|
+
onRemoveAccent,
|
|
163595
|
+
onApplyHighlight,
|
|
163596
|
+
onRemoveHighlight
|
|
163597
|
+
}) {
|
|
163598
|
+
const { style: style2, placement } = toolbarPlacement(selection.rect, openMenu !== null);
|
|
163599
|
+
const clampedSelectedText = selectedText.trim().length > 0 ? selectedText.trim() : "Selected text";
|
|
163600
|
+
const plainPreview = buildPlainTonePreview(presentationContext);
|
|
163601
|
+
const accentPreviews = inlineTextAccentTones.map((toneOption) => ({
|
|
163602
|
+
toneOption,
|
|
163603
|
+
preview: buildAccentTonePreview(toneOption, presentationContext)
|
|
163604
|
+
})).filter(({ preview }) => !inlineTextTonePreviewLooksSame(preview, plainPreview));
|
|
163605
|
+
return /* @__PURE__ */ jsxs(
|
|
163606
|
+
"div",
|
|
163607
|
+
{
|
|
163608
|
+
"data-rb-inline-text-toolbar": true,
|
|
163609
|
+
"data-tone": tone,
|
|
163610
|
+
"data-placement": placement,
|
|
163611
|
+
className: "rb-inline-text-toolbar",
|
|
163612
|
+
style: style2,
|
|
163613
|
+
onMouseDown: (event) => {
|
|
163614
|
+
event.preventDefault();
|
|
163615
|
+
},
|
|
163616
|
+
children: [
|
|
163617
|
+
/* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Bold", title: "Bold", onClick: onToggleStrong, children: /* @__PURE__ */ jsx(Bold, { "aria-hidden": true, size: 16 }) }),
|
|
163618
|
+
/* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Italic", title: "Italic", onClick: onToggleEmphasis, children: /* @__PURE__ */ jsx(Italic, { "aria-hidden": true, size: 16 }) }),
|
|
163619
|
+
/* @__PURE__ */ jsx(
|
|
163620
|
+
"button",
|
|
163621
|
+
{
|
|
163622
|
+
type: "button",
|
|
163623
|
+
"aria-label": "Accent color",
|
|
163624
|
+
title: "Accent color",
|
|
163625
|
+
"data-open": openMenu === "accent" ? "true" : void 0,
|
|
163626
|
+
onClick: () => setOpenMenu(openMenu === "accent" ? null : "accent"),
|
|
163627
|
+
children: /* @__PURE__ */ jsx(Palette, { "aria-hidden": true, size: 16 })
|
|
163628
|
+
}
|
|
163629
|
+
),
|
|
163630
|
+
/* @__PURE__ */ jsx(
|
|
163631
|
+
"button",
|
|
163632
|
+
{
|
|
163633
|
+
type: "button",
|
|
163634
|
+
"aria-label": "Highlight background",
|
|
163635
|
+
title: "Highlight background",
|
|
163636
|
+
"data-open": openMenu === "highlight" ? "true" : void 0,
|
|
163637
|
+
onClick: () => setOpenMenu(openMenu === "highlight" ? null : "highlight"),
|
|
163638
|
+
children: /* @__PURE__ */ jsx(Highlighter, { "aria-hidden": true, size: 16 })
|
|
163639
|
+
}
|
|
163640
|
+
),
|
|
163641
|
+
openMenu === "accent" ? /* @__PURE__ */ jsxs(ToneMenu, { label: "Accent color", children: [
|
|
163642
|
+
accentPreviews.map(({ toneOption, preview }) => /* @__PURE__ */ jsx(
|
|
163643
|
+
"button",
|
|
163644
|
+
{
|
|
163645
|
+
type: "button",
|
|
163646
|
+
"aria-label": `Apply ${toneOption} accent color`,
|
|
163647
|
+
title: `Apply ${toneOption} accent color`,
|
|
163648
|
+
onClick: () => onApplyAccent(toneOption),
|
|
163649
|
+
children: /* @__PURE__ */ jsx(
|
|
163650
|
+
TonePreview,
|
|
163651
|
+
{
|
|
163652
|
+
preview,
|
|
163653
|
+
selectedText: clampedSelectedText
|
|
163654
|
+
}
|
|
163655
|
+
)
|
|
163656
|
+
},
|
|
163657
|
+
toneOption
|
|
163658
|
+
)),
|
|
163659
|
+
/* @__PURE__ */ jsx(
|
|
163660
|
+
"button",
|
|
163661
|
+
{
|
|
163662
|
+
type: "button",
|
|
163663
|
+
"aria-label": "Use plain text color",
|
|
163664
|
+
title: "Use plain text color",
|
|
163665
|
+
onClick: onRemoveAccent,
|
|
163666
|
+
children: /* @__PURE__ */ jsx(
|
|
163667
|
+
TonePreview,
|
|
163668
|
+
{
|
|
163669
|
+
preview: plainPreview,
|
|
163670
|
+
selectedText: clampedSelectedText
|
|
163671
|
+
}
|
|
163672
|
+
)
|
|
163673
|
+
}
|
|
163674
|
+
)
|
|
163675
|
+
] }) : null,
|
|
163676
|
+
openMenu === "highlight" ? /* @__PURE__ */ jsxs(ToneMenu, { label: "Highlight background", children: [
|
|
163677
|
+
inlineTextHighlightTones.map((toneOption) => /* @__PURE__ */ jsx(
|
|
163678
|
+
"button",
|
|
163679
|
+
{
|
|
163680
|
+
type: "button",
|
|
163681
|
+
"aria-label": `Apply ${toneOption} highlight background`,
|
|
163682
|
+
title: `Apply ${toneOption} highlight background`,
|
|
163683
|
+
onClick: () => onApplyHighlight(toneOption),
|
|
163684
|
+
children: /* @__PURE__ */ jsx(
|
|
163685
|
+
TonePreview,
|
|
163686
|
+
{
|
|
163687
|
+
preview: buildHighlightTonePreview(toneOption, presentationContext),
|
|
163688
|
+
selectedText: clampedSelectedText
|
|
163689
|
+
}
|
|
163690
|
+
)
|
|
163691
|
+
},
|
|
163692
|
+
toneOption
|
|
163693
|
+
)),
|
|
163694
|
+
/* @__PURE__ */ jsx(
|
|
163695
|
+
"button",
|
|
163696
|
+
{
|
|
163697
|
+
type: "button",
|
|
163698
|
+
"aria-label": "Remove highlight background",
|
|
163699
|
+
title: "Remove highlight background",
|
|
163700
|
+
onClick: onRemoveHighlight,
|
|
163701
|
+
children: /* @__PURE__ */ jsx(
|
|
163702
|
+
TonePreview,
|
|
163703
|
+
{
|
|
163704
|
+
preview: plainPreview,
|
|
163705
|
+
selectedText: clampedSelectedText
|
|
163706
|
+
}
|
|
163707
|
+
)
|
|
163708
|
+
}
|
|
163709
|
+
)
|
|
163710
|
+
] }) : null
|
|
163711
|
+
]
|
|
163712
|
+
}
|
|
163713
|
+
);
|
|
163714
|
+
}
|
|
163715
|
+
function TonePreview({
|
|
163716
|
+
preview,
|
|
163717
|
+
selectedText
|
|
163718
|
+
}) {
|
|
163719
|
+
return /* @__PURE__ */ jsx(
|
|
163720
|
+
"span",
|
|
163721
|
+
{
|
|
163722
|
+
className: "rb-inline-text-toolbar-preview",
|
|
163723
|
+
"data-low-contrast": preview.lowContrast ? "true" : void 0,
|
|
163724
|
+
style: preview.surfaceStyle,
|
|
163725
|
+
children: /* @__PURE__ */ jsx("span", { className: "rb-inline-text-toolbar-preview-text", style: preview.textStyle, children: selectedText })
|
|
163726
|
+
}
|
|
163727
|
+
);
|
|
163728
|
+
}
|
|
163729
|
+
function ToneMenu({ label, children }) {
|
|
163730
|
+
return /* @__PURE__ */ jsx("div", { className: "rb-inline-text-toolbar-menu", role: "menu", "aria-label": label, children });
|
|
163731
|
+
}
|
|
163732
|
+
function toolbarPlacement(rect, hasOpenMenu) {
|
|
163733
|
+
const toolbarWidth = hasOpenMenu ? 340 : 188;
|
|
163734
|
+
const left = Math.min(
|
|
163735
|
+
Math.max(12, rect.left + rect.width / 2 - toolbarWidth / 2),
|
|
163736
|
+
Math.max(12, window.innerWidth - toolbarWidth - 12)
|
|
163737
|
+
);
|
|
163738
|
+
const aboveTop = rect.top - 48;
|
|
163739
|
+
if (aboveTop < 12) {
|
|
163740
|
+
return {
|
|
163741
|
+
placement: "below",
|
|
163742
|
+
style: { left, top: rect.bottom + 10, width: toolbarWidth }
|
|
163743
|
+
};
|
|
163744
|
+
}
|
|
163745
|
+
return {
|
|
163746
|
+
placement: "above",
|
|
163747
|
+
style: { left, top: aboveTop, width: toolbarWidth }
|
|
163748
|
+
};
|
|
163749
|
+
}
|
|
163750
|
+
function InlineTextEditorStyles() {
|
|
163751
|
+
return /* @__PURE__ */ jsx("style", { children: `
|
|
163752
|
+
[data-rb-inline-text-editor] {
|
|
163753
|
+
min-width: 1ch;
|
|
163754
|
+
outline: 1px dashed transparent;
|
|
163755
|
+
outline-offset: 3px;
|
|
163756
|
+
}
|
|
163757
|
+
|
|
163758
|
+
[data-rb-inline-text-editor]:hover,
|
|
163759
|
+
[data-rb-inline-text-editor]:focus-visible {
|
|
163760
|
+
outline-color: rgba(148, 163, 184, 0.76);
|
|
163761
|
+
}
|
|
163762
|
+
|
|
163763
|
+
[data-rb-inline-text-editor][data-rb-inline-text-empty="true"]::before {
|
|
163764
|
+
content: attr(data-placeholder);
|
|
163765
|
+
color: rgba(148, 163, 184, 0.82);
|
|
163766
|
+
}
|
|
163767
|
+
|
|
163768
|
+
[data-rb-inline-text-editor] .rb-inline-text-accent,
|
|
163769
|
+
[data-rb-inline-text-editor] .rb-inline-text-highlight {
|
|
163770
|
+
font: inherit;
|
|
163771
|
+
letter-spacing: inherit;
|
|
163772
|
+
text-transform: inherit;
|
|
163773
|
+
}
|
|
163774
|
+
|
|
163775
|
+
.rb-inline-text-toolbar {
|
|
163776
|
+
align-items: center;
|
|
163777
|
+
background: rgba(15, 23, 42, 0.94);
|
|
163778
|
+
border: 1px solid rgba(255, 255, 255, 0.14);
|
|
163779
|
+
border-radius: 8px;
|
|
163780
|
+
box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
|
|
163781
|
+
color: white;
|
|
163782
|
+
display: flex;
|
|
163783
|
+
gap: 3px;
|
|
163784
|
+
justify-content: center;
|
|
163785
|
+
padding: 5px;
|
|
163786
|
+
position: fixed;
|
|
163787
|
+
z-index: 80;
|
|
163788
|
+
}
|
|
163789
|
+
|
|
163790
|
+
.rb-inline-text-toolbar[data-tone="light"] {
|
|
163791
|
+
background: rgba(255, 255, 255, 0.98);
|
|
163792
|
+
border-color: rgba(15, 23, 42, 0.14);
|
|
163793
|
+
color: rgb(15, 23, 42);
|
|
163794
|
+
}
|
|
163795
|
+
|
|
163796
|
+
.rb-inline-text-toolbar > button,
|
|
163797
|
+
.rb-inline-text-toolbar-menu > button {
|
|
163798
|
+
align-items: center;
|
|
163799
|
+
background: transparent;
|
|
163800
|
+
border: 0;
|
|
163801
|
+
border-radius: 6px;
|
|
163802
|
+
color: inherit;
|
|
163803
|
+
cursor: pointer;
|
|
163804
|
+
display: inline-flex;
|
|
163805
|
+
font: inherit;
|
|
163806
|
+
justify-content: center;
|
|
163807
|
+
min-height: 30px;
|
|
163808
|
+
min-width: 30px;
|
|
163809
|
+
padding: 5px 7px;
|
|
163810
|
+
}
|
|
163811
|
+
|
|
163812
|
+
.rb-inline-text-toolbar > button:hover,
|
|
163813
|
+
.rb-inline-text-toolbar > button[data-open="true"],
|
|
163814
|
+
.rb-inline-text-toolbar-menu > button:hover {
|
|
163815
|
+
background: rgba(148, 163, 184, 0.22);
|
|
163816
|
+
}
|
|
163817
|
+
|
|
163818
|
+
.rb-inline-text-toolbar-menu {
|
|
163819
|
+
background: inherit;
|
|
163820
|
+
border: inherit;
|
|
163821
|
+
border-radius: 8px;
|
|
163822
|
+
box-shadow: inherit;
|
|
163823
|
+
display: grid;
|
|
163824
|
+
gap: 2px;
|
|
163825
|
+
left: 0;
|
|
163826
|
+
min-width: 100%;
|
|
163827
|
+
padding: 5px;
|
|
163828
|
+
position: absolute;
|
|
163829
|
+
top: calc(100% + 6px);
|
|
163830
|
+
}
|
|
163831
|
+
|
|
163832
|
+
.rb-inline-text-toolbar[data-placement="below"] .rb-inline-text-toolbar-menu {
|
|
163833
|
+
bottom: calc(100% + 6px);
|
|
163834
|
+
top: auto;
|
|
163835
|
+
}
|
|
163836
|
+
|
|
163837
|
+
.rb-inline-text-toolbar-menu > button {
|
|
163838
|
+
justify-content: flex-start;
|
|
163839
|
+
width: 100%;
|
|
163840
|
+
overflow: hidden;
|
|
163841
|
+
text-align: left;
|
|
163842
|
+
white-space: nowrap;
|
|
163843
|
+
}
|
|
163844
|
+
|
|
163845
|
+
.rb-inline-text-toolbar-preview {
|
|
163846
|
+
align-items: center;
|
|
163847
|
+
border: 1px solid rgba(148, 163, 184, 0.32);
|
|
163848
|
+
border-radius: 5px;
|
|
163849
|
+
display: inline-flex;
|
|
163850
|
+
max-width: 100%;
|
|
163851
|
+
width: 100%;
|
|
163852
|
+
min-height: 28px;
|
|
163853
|
+
overflow: hidden;
|
|
163854
|
+
padding: 3px 7px;
|
|
163855
|
+
}
|
|
163856
|
+
|
|
163857
|
+
.rb-inline-text-toolbar-preview[data-low-contrast="true"] {
|
|
163858
|
+
box-shadow:
|
|
163859
|
+
inset 0 0 0 1px rgba(255, 255, 255, 0.52),
|
|
163860
|
+
0 0 0 1px rgba(15, 23, 42, 0.26);
|
|
163861
|
+
}
|
|
163862
|
+
|
|
163863
|
+
.rb-inline-text-toolbar-preview-text {
|
|
163864
|
+
display: inline;
|
|
163865
|
+
max-width: 100%;
|
|
163866
|
+
overflow: hidden;
|
|
163867
|
+
text-overflow: ellipsis;
|
|
163868
|
+
white-space: nowrap;
|
|
163869
|
+
}
|
|
163870
|
+
` });
|
|
163871
|
+
}
|
|
163872
|
+
|
|
163873
|
+
// ../editor/src/inline/selection.ts
|
|
163874
|
+
function readSelection(root) {
|
|
163875
|
+
const range = readSelectionRange(root);
|
|
163876
|
+
if (!range || range.start === range.end) return null;
|
|
163877
|
+
return range;
|
|
163878
|
+
}
|
|
163879
|
+
function readSelectionRange(root) {
|
|
163880
|
+
if (!root) return null;
|
|
163881
|
+
const selection = window.getSelection();
|
|
163882
|
+
if (!selection || selection.rangeCount === 0) return null;
|
|
163883
|
+
const range = selection.getRangeAt(0);
|
|
163884
|
+
if (!root.contains(range.commonAncestorContainer)) return null;
|
|
163885
|
+
const startProbe = document.createRange();
|
|
163886
|
+
startProbe.selectNodeContents(root);
|
|
163887
|
+
startProbe.setEnd(range.startContainer, range.startOffset);
|
|
163888
|
+
const start = startProbe.toString().length;
|
|
163889
|
+
const end = start + range.toString().length;
|
|
163890
|
+
return {
|
|
163891
|
+
start: Math.min(start, end),
|
|
163892
|
+
end: Math.max(start, end),
|
|
163893
|
+
rect: range.getBoundingClientRect()
|
|
163894
|
+
};
|
|
163895
|
+
}
|
|
163896
|
+
function rangeHasMark(value, range, kind) {
|
|
163897
|
+
const start = Math.min(range.start, range.end);
|
|
163898
|
+
const end = Math.max(range.start, range.end);
|
|
163899
|
+
if (start === end) return false;
|
|
163900
|
+
let offset4 = 0;
|
|
163901
|
+
let sawText = false;
|
|
163902
|
+
for (const run3 of normalizeInlineText(value)) {
|
|
163903
|
+
const runStart = offset4;
|
|
163904
|
+
const runEnd = offset4 + run3.text.length;
|
|
163905
|
+
offset4 = runEnd;
|
|
163906
|
+
if (runEnd <= start || runStart >= end) continue;
|
|
163907
|
+
sawText = true;
|
|
163908
|
+
if (!(run3.marks ?? []).some((mark) => mark.kind === kind)) {
|
|
163909
|
+
return false;
|
|
163910
|
+
}
|
|
163911
|
+
}
|
|
163912
|
+
return sawText;
|
|
163913
|
+
}
|
|
163914
|
+
function InlineTextEditor({
|
|
163915
|
+
value,
|
|
163916
|
+
onChange,
|
|
163917
|
+
as: Comp = "span",
|
|
163918
|
+
id,
|
|
163919
|
+
className,
|
|
163920
|
+
placeholder,
|
|
163921
|
+
maxLength,
|
|
163922
|
+
ariaLabel,
|
|
163923
|
+
ariaDescribedBy,
|
|
163924
|
+
toolbarTone = "dark",
|
|
163925
|
+
onFocus,
|
|
163926
|
+
onBlur
|
|
163927
|
+
}) {
|
|
163928
|
+
const editableRef = useRef(null);
|
|
163929
|
+
const initialValue = useMemo(() => truncateInlineText(value, maxLength), [maxLength, value]);
|
|
163930
|
+
const currentValueRef = useRef(initialValue);
|
|
163931
|
+
const [plainText, setPlainText] = useState(() => inlineTextToPlainText(initialValue));
|
|
163932
|
+
const [selection, setSelection] = useState(null);
|
|
163933
|
+
const [presentationContext, setPresentationContext] = useState(() => defaultInlineTextPresentationContext(toolbarTone));
|
|
163934
|
+
const [openMenu, setOpenMenu] = useState(null);
|
|
163935
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
163936
|
+
const syncEditableDom = useCallback((nextValue) => {
|
|
163937
|
+
if (!editableRef.current) return;
|
|
163938
|
+
editableRef.current.innerHTML = inlineTextToEditableHtml(nextValue);
|
|
163939
|
+
}, []);
|
|
163940
|
+
const setEditableRef = useCallback((node) => {
|
|
163941
|
+
if (node && editableRef.current !== node) {
|
|
163942
|
+
node.innerHTML = inlineTextToEditableHtml(currentValueRef.current);
|
|
163943
|
+
}
|
|
163944
|
+
editableRef.current = node;
|
|
163945
|
+
}, []);
|
|
163946
|
+
useEffect(() => {
|
|
163947
|
+
const nextValue = truncateInlineText(value, maxLength);
|
|
163948
|
+
if (inlineTextEqual(nextValue, currentValueRef.current)) return;
|
|
163949
|
+
if (isFocused) return;
|
|
163950
|
+
currentValueRef.current = nextValue;
|
|
163951
|
+
setPlainText(inlineTextToPlainText(nextValue));
|
|
163952
|
+
syncEditableDom(nextValue);
|
|
163953
|
+
}, [isFocused, maxLength, syncEditableDom, value]);
|
|
163954
|
+
const commitValue = useCallback(
|
|
163955
|
+
(nextValue, options = {}) => {
|
|
163956
|
+
const normalized = normalizeInlineText(nextValue);
|
|
163957
|
+
const limited = truncateInlineText(normalized, maxLength);
|
|
163958
|
+
const shouldSyncDom = Boolean(options.syncDom) || !inlineTextEqual(normalized, limited) || limited.length === 0 && (editableRef.current?.innerHTML ?? "").length > 0;
|
|
163959
|
+
const nextPlainText = inlineTextToPlainText(limited);
|
|
163960
|
+
currentValueRef.current = limited;
|
|
163961
|
+
setPlainText((previous) => previous === nextPlainText ? previous : nextPlainText);
|
|
163962
|
+
if (shouldSyncDom) {
|
|
163963
|
+
syncEditableDom(limited);
|
|
163964
|
+
}
|
|
163965
|
+
onChange(limited, nextPlainText);
|
|
163966
|
+
},
|
|
163967
|
+
[maxLength, onChange, syncEditableDom]
|
|
163968
|
+
);
|
|
163969
|
+
const updateSelectionFromDom = useCallback(() => {
|
|
163970
|
+
const editable = editableRef.current;
|
|
163971
|
+
const nextSelection = readSelection(editable);
|
|
163972
|
+
setSelection(nextSelection);
|
|
163973
|
+
if (editable && nextSelection) {
|
|
163974
|
+
setPresentationContext(readInlineTextPresentationContext(editable, toolbarTone));
|
|
163975
|
+
}
|
|
163976
|
+
if (!nextSelection) {
|
|
163977
|
+
setOpenMenu(null);
|
|
163978
|
+
}
|
|
163979
|
+
}, [toolbarTone]);
|
|
163980
|
+
const clearSelectionUi = useCallback(() => {
|
|
163981
|
+
setSelection(null);
|
|
163982
|
+
setOpenMenu(null);
|
|
163983
|
+
}, []);
|
|
163984
|
+
const applyMark = useCallback(
|
|
163985
|
+
(mark) => {
|
|
163986
|
+
if (!selection) return;
|
|
163987
|
+
const nextValue = applyInlineTextMarkToRange(currentValueRef.current, selection, mark);
|
|
163988
|
+
commitValue(nextValue, { syncDom: true });
|
|
163989
|
+
clearSelectionUi();
|
|
163990
|
+
},
|
|
163991
|
+
[clearSelectionUi, commitValue, selection]
|
|
163992
|
+
);
|
|
163993
|
+
const removeMark2 = useCallback(
|
|
163994
|
+
(kind) => {
|
|
163995
|
+
if (!selection) return;
|
|
163996
|
+
const nextValue = removeInlineTextMarkFromRange(currentValueRef.current, selection, kind);
|
|
163997
|
+
commitValue(nextValue, { syncDom: true });
|
|
163998
|
+
clearSelectionUi();
|
|
163999
|
+
},
|
|
164000
|
+
[clearSelectionUi, commitValue, selection]
|
|
164001
|
+
);
|
|
164002
|
+
const toggleMark2 = useCallback(
|
|
164003
|
+
(kind) => {
|
|
164004
|
+
if (!selection) return;
|
|
164005
|
+
if (rangeHasMark(currentValueRef.current, selection, kind)) {
|
|
164006
|
+
removeMark2(kind);
|
|
164007
|
+
return;
|
|
164008
|
+
}
|
|
164009
|
+
applyMark({ kind });
|
|
164010
|
+
},
|
|
164011
|
+
[applyMark, removeMark2, selection]
|
|
164012
|
+
);
|
|
164013
|
+
return /* @__PURE__ */ jsxs("span", { className: "rb-inline-text-editor-root", children: [
|
|
164014
|
+
/* @__PURE__ */ jsx(InlineTextEditorStyles, {}),
|
|
164015
|
+
/* @__PURE__ */ jsx(
|
|
164016
|
+
Comp,
|
|
164017
|
+
{
|
|
164018
|
+
id,
|
|
164019
|
+
ref: setEditableRef,
|
|
164020
|
+
"data-rb-inline-text-editor": true,
|
|
164021
|
+
"data-rb-inline-text-empty": plainText.length === 0 ? "true" : void 0,
|
|
164022
|
+
"data-placeholder": placeholder,
|
|
164023
|
+
contentEditable: true,
|
|
164024
|
+
suppressContentEditableWarning: true,
|
|
164025
|
+
spellCheck: true,
|
|
164026
|
+
role: "textbox",
|
|
164027
|
+
"aria-multiline": "false",
|
|
164028
|
+
"aria-label": ariaLabel,
|
|
164029
|
+
"aria-describedby": ariaDescribedBy,
|
|
164030
|
+
className,
|
|
164031
|
+
onInput: (event) => {
|
|
164032
|
+
commitValue(parseEditableInlineText(event.currentTarget));
|
|
164033
|
+
updateSelectionFromDom();
|
|
164034
|
+
},
|
|
164035
|
+
onKeyDown: (event) => {
|
|
164036
|
+
if (event.key === "Enter") {
|
|
164037
|
+
event.preventDefault();
|
|
164038
|
+
}
|
|
164039
|
+
},
|
|
164040
|
+
onPaste: (event) => {
|
|
164041
|
+
event.preventDefault();
|
|
164042
|
+
const range = readSelectionRange(editableRef.current) ?? selection;
|
|
164043
|
+
const text2 = event.clipboardData.getData("text/plain").replace(/\s+/g, " ");
|
|
164044
|
+
if (!range) {
|
|
164045
|
+
commitValue(plainTextToInlineText(plainText + text2), { syncDom: true });
|
|
164046
|
+
clearSelectionUi();
|
|
164047
|
+
return;
|
|
164048
|
+
}
|
|
164049
|
+
commitValue(
|
|
164050
|
+
replaceInlineTextRange(currentValueRef.current, range, plainTextToInlineText(text2)),
|
|
164051
|
+
{ syncDom: true }
|
|
164052
|
+
);
|
|
164053
|
+
clearSelectionUi();
|
|
164054
|
+
},
|
|
164055
|
+
onMouseUp: () => updateSelectionFromDom(),
|
|
164056
|
+
onKeyUp: (event) => {
|
|
164057
|
+
if (event.key === "Escape") {
|
|
164058
|
+
clearSelectionUi();
|
|
164059
|
+
return;
|
|
164060
|
+
}
|
|
164061
|
+
updateSelectionFromDom();
|
|
164062
|
+
},
|
|
164063
|
+
onFocus: () => {
|
|
164064
|
+
setIsFocused(true);
|
|
164065
|
+
onFocus?.();
|
|
164066
|
+
},
|
|
164067
|
+
onBlur: () => {
|
|
164068
|
+
window.setTimeout(() => {
|
|
164069
|
+
const activeElement = document.activeElement;
|
|
164070
|
+
if (activeElement?.closest("[data-rb-inline-text-toolbar]")) return;
|
|
164071
|
+
setIsFocused(false);
|
|
164072
|
+
clearSelectionUi();
|
|
164073
|
+
onBlur?.();
|
|
164074
|
+
}, 0);
|
|
164075
|
+
}
|
|
164076
|
+
}
|
|
164077
|
+
),
|
|
164078
|
+
selection ? /* @__PURE__ */ jsx(
|
|
164079
|
+
FloatingToolbar,
|
|
164080
|
+
{
|
|
164081
|
+
selection,
|
|
164082
|
+
selectedText: plainText.slice(selection.start, selection.end),
|
|
164083
|
+
tone: toolbarTone,
|
|
164084
|
+
presentationContext,
|
|
164085
|
+
openMenu,
|
|
164086
|
+
setOpenMenu,
|
|
164087
|
+
onToggleStrong: () => toggleMark2("strong"),
|
|
164088
|
+
onToggleEmphasis: () => toggleMark2("emphasis"),
|
|
164089
|
+
onApplyAccent: (tone) => applyMark({ kind: "accent", tone }),
|
|
164090
|
+
onRemoveAccent: () => removeMark2("accent"),
|
|
164091
|
+
onApplyHighlight: (tone) => applyMark({ kind: "highlight", tone }),
|
|
164092
|
+
onRemoveHighlight: () => removeMark2("highlight")
|
|
164093
|
+
}
|
|
164094
|
+
) : null
|
|
164095
|
+
] });
|
|
164096
|
+
}
|
|
164097
|
+
|
|
162736
164098
|
// ../../node_modules/.pnpm/orderedmap@2.1.1/node_modules/orderedmap/dist/index.js
|
|
162737
164099
|
function OrderedMap(content) {
|
|
162738
164100
|
this.content = content;
|
|
@@ -183340,7 +184702,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
183340
184702
|
return x === y2 && (x !== 0 || 1 / x === 1 / y2) || x !== x && y2 !== y2;
|
|
183341
184703
|
}
|
|
183342
184704
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
183343
|
-
var
|
|
184705
|
+
var useState97 = React$1.useState, useEffect102 = React$1.useEffect, useLayoutEffect11 = React$1.useLayoutEffect, useDebugValue2 = React$1.useDebugValue;
|
|
183344
184706
|
var didWarnOld18Alpha = false;
|
|
183345
184707
|
var didWarnUncachedGetSnapshot = false;
|
|
183346
184708
|
function useSyncExternalStore7(subscribe, getSnapshot, getServerSnapshot) {
|
|
@@ -183362,7 +184724,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
183362
184724
|
}
|
|
183363
184725
|
}
|
|
183364
184726
|
}
|
|
183365
|
-
var _useState =
|
|
184727
|
+
var _useState = useState97({
|
|
183366
184728
|
inst: {
|
|
183367
184729
|
value,
|
|
183368
184730
|
getSnapshot
|
|
@@ -183377,7 +184739,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
183377
184739
|
});
|
|
183378
184740
|
}
|
|
183379
184741
|
}, [subscribe, value, getSnapshot]);
|
|
183380
|
-
|
|
184742
|
+
useEffect102(function() {
|
|
183381
184743
|
if (checkIfSnapshotChanged(inst)) {
|
|
183382
184744
|
forceUpdate({
|
|
183383
184745
|
inst
|
|
@@ -183642,9 +185004,9 @@ function requireWithSelector_development() {
|
|
|
183642
185004
|
}
|
|
183643
185005
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
183644
185006
|
var useSyncExternalStore7 = shim2.useSyncExternalStore;
|
|
183645
|
-
var
|
|
185007
|
+
var useRef84 = React$1.useRef, useEffect102 = React$1.useEffect, useMemo95 = React$1.useMemo, useDebugValue2 = React$1.useDebugValue;
|
|
183646
185008
|
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
183647
|
-
var instRef =
|
|
185009
|
+
var instRef = useRef84(null);
|
|
183648
185010
|
var inst;
|
|
183649
185011
|
if (instRef.current === null) {
|
|
183650
185012
|
inst = {
|
|
@@ -183655,7 +185017,7 @@ function requireWithSelector_development() {
|
|
|
183655
185017
|
} else {
|
|
183656
185018
|
inst = instRef.current;
|
|
183657
185019
|
}
|
|
183658
|
-
var _useMemo =
|
|
185020
|
+
var _useMemo = useMemo95(function() {
|
|
183659
185021
|
var hasMemo = false;
|
|
183660
185022
|
var memoizedSnapshot;
|
|
183661
185023
|
var memoizedSelection;
|
|
@@ -183699,7 +185061,7 @@ function requireWithSelector_development() {
|
|
|
183699
185061
|
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
183700
185062
|
}, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection2 = _useMemo[0], getServerSelection = _useMemo[1];
|
|
183701
185063
|
var value = useSyncExternalStore7(subscribe, getSelection2, getServerSelection);
|
|
183702
|
-
|
|
185064
|
+
useEffect102(function() {
|
|
183703
185065
|
inst.hasValue = true;
|
|
183704
185066
|
inst.value = value;
|
|
183705
185067
|
}, [value]);
|
|
@@ -184694,6 +186056,52 @@ function moveCaretToEnd(element) {
|
|
|
184694
186056
|
selection.removeAllRanges();
|
|
184695
186057
|
selection.addRange(range);
|
|
184696
186058
|
}
|
|
186059
|
+
function PreviewInlineTextEditor({
|
|
186060
|
+
path,
|
|
186061
|
+
plainTextPath,
|
|
186062
|
+
fallbackPlainText = "",
|
|
186063
|
+
onBlockFieldFocus,
|
|
186064
|
+
className,
|
|
186065
|
+
maxLength,
|
|
186066
|
+
as: Comp = "span"
|
|
186067
|
+
}) {
|
|
186068
|
+
const { isEditingMode } = useEditor();
|
|
186069
|
+
const { value, setValue } = useStoreBinding(path);
|
|
186070
|
+
const { value: plainTextValue, setValue: setPlainTextValue } = useStoreBinding(plainTextPath);
|
|
186071
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
186072
|
+
const isLinkedSidebarFocus = useEditorUiStore(
|
|
186073
|
+
(state) => path ? isLinkedSidebarField(path, state.activePreviewField) : false
|
|
186074
|
+
);
|
|
186075
|
+
const editorValue = useMemo(
|
|
186076
|
+
() => coerceInlineTextWithFallback(value, typeof plainTextValue === "string" ? plainTextValue : fallbackPlainText),
|
|
186077
|
+
[fallbackPlainText, plainTextValue, value]
|
|
186078
|
+
);
|
|
186079
|
+
const handleChange = useCallback(
|
|
186080
|
+
(nextValue, plainText) => {
|
|
186081
|
+
setValue(nextValue);
|
|
186082
|
+
setPlainTextValue(plainText);
|
|
186083
|
+
},
|
|
186084
|
+
[setPlainTextValue, setValue]
|
|
186085
|
+
);
|
|
186086
|
+
if (!isEditingMode) return null;
|
|
186087
|
+
return /* @__PURE__ */ jsx(
|
|
186088
|
+
InlineTextEditor,
|
|
186089
|
+
{
|
|
186090
|
+
value: editorValue,
|
|
186091
|
+
onChange: handleChange,
|
|
186092
|
+
as: Comp,
|
|
186093
|
+
maxLength,
|
|
186094
|
+
placeholder: "Add a headline",
|
|
186095
|
+
toolbarTone: "dark",
|
|
186096
|
+
className: `rounded px-1 transition-colors focus:bg-white/10 focus-visible:bg-white/10 ${isLinkedSidebarFocus || isFocused ? "bg-white/5" : ""} ${className ?? ""}`,
|
|
186097
|
+
onFocus: () => {
|
|
186098
|
+
setIsFocused(true);
|
|
186099
|
+
onBlockFieldFocus?.(path);
|
|
186100
|
+
},
|
|
186101
|
+
onBlur: () => setIsFocused(false)
|
|
186102
|
+
}
|
|
186103
|
+
);
|
|
186104
|
+
}
|
|
184697
186105
|
var PreviewRichTextEditorInner = ({
|
|
184698
186106
|
path,
|
|
184699
186107
|
linkedEntryField,
|
|
@@ -189569,4 +190977,4 @@ lucide-react/dist/esm/lucide-react.mjs:
|
|
|
189569
190977
|
*)
|
|
189570
190978
|
*/
|
|
189571
190979
|
|
|
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 };
|
|
190980
|
+
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 };
|