@webiny/website-builder-sdk 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e
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/BindingsApi.js +29 -36
- package/BindingsApi.js.map +1 -1
- package/BindingsProcessor.js +34 -43
- package/BindingsProcessor.js.map +1 -1
- package/BindingsProcessor.test.js +82 -77
- package/BindingsProcessor.test.js.map +1 -1
- package/BindingsResolver.d.ts +5 -2
- package/BindingsResolver.js +99 -122
- package/BindingsResolver.js.map +1 -1
- package/BindingsResolver.test.js +399 -362
- package/BindingsResolver.test.js.map +1 -1
- package/ComponentInputTraverser.js +32 -49
- package/ComponentInputTraverser.js.map +1 -1
- package/ComponentManifestToAstConverter.js +20 -21
- package/ComponentManifestToAstConverter.js.map +1 -1
- package/ComponentRegistry.d.ts +9 -0
- package/ComponentRegistry.js +38 -22
- package/ComponentRegistry.js.map +1 -1
- package/ComponentResolver.d.ts +3 -2
- package/ComponentResolver.js +39 -29
- package/ComponentResolver.js.map +1 -1
- package/ComponentResolver.test.d.ts +1 -0
- package/ComponentResolver.test.js +81 -0
- package/ComponentResolver.test.js.map +1 -0
- package/ConstraintEvaluator.d.ts +36 -0
- package/ConstraintEvaluator.js +288 -0
- package/ConstraintEvaluator.js.map +1 -0
- package/ConstraintEvaluator.test.d.ts +1 -0
- package/ConstraintEvaluator.test.js +1634 -0
- package/ConstraintEvaluator.test.js.map +1 -0
- package/ContentSdk.d.ts +17 -3
- package/ContentSdk.js +113 -90
- package/ContentSdk.js.map +1 -1
- package/DocumentStore.d.ts +1 -1
- package/DocumentStore.js +47 -59
- package/DocumentStore.js.map +1 -1
- package/DocumentStoreManager.js +17 -16
- package/DocumentStoreManager.js.map +1 -1
- package/EditingSdk.d.ts +2 -2
- package/EditingSdk.js +92 -124
- package/EditingSdk.js.map +1 -1
- package/ElementFactory.d.ts +2 -3
- package/ElementFactory.js +164 -163
- package/ElementFactory.js.map +1 -1
- package/ElementFactory.objectListDefaults.test.d.ts +1 -0
- package/ElementFactory.objectListDefaults.test.js +423 -0
- package/ElementFactory.objectListDefaults.test.js.map +1 -0
- package/ElementFactory.test.d.ts +1 -0
- package/ElementFactory.test.js +353 -0
- package/ElementFactory.test.js.map +1 -0
- package/Environment.js +18 -19
- package/Environment.js.map +1 -1
- package/FunctionConverter.js +8 -7
- package/FunctionConverter.js.map +1 -1
- package/HashObject.js +11 -12
- package/HashObject.js.map +1 -1
- package/HotkeyManager.js +41 -48
- package/HotkeyManager.js.map +1 -1
- package/IBindingsUpdater.js +0 -3
- package/IRedirects.js +0 -3
- package/InheritanceProcessor.d.ts +2 -2
- package/InheritanceProcessor.js +99 -139
- package/InheritanceProcessor.js.map +1 -1
- package/InheritanceProcessor.test.js +178 -178
- package/InheritanceProcessor.test.js.map +1 -1
- package/InheritedValueResolver.d.ts +18 -1
- package/InheritedValueResolver.js +18 -20
- package/InheritedValueResolver.js.map +1 -1
- package/InputBindingsProcessor.d.ts +23 -2
- package/InputBindingsProcessor.js +200 -289
- package/InputBindingsProcessor.js.map +1 -1
- package/InputBindingsProcessorTokens.test.d.ts +1 -0
- package/InputBindingsProcessorTokens.test.js +400 -0
- package/InputBindingsProcessorTokens.test.js.map +1 -0
- package/InputsBindingsProcessor.test.js +334 -313
- package/InputsBindingsProcessor.test.js.map +1 -1
- package/InputsUpdater.d.ts +1 -1
- package/InputsUpdater.js +23 -26
- package/InputsUpdater.js.map +1 -1
- package/LiveSdk.d.ts +2 -2
- package/LiveSdk.js +12 -13
- package/LiveSdk.js.map +1 -1
- package/Logger.d.ts +2 -1
- package/Logger.js +9 -8
- package/Logger.js.map +1 -1
- package/MouseTracker.js +77 -83
- package/MouseTracker.js.map +1 -1
- package/NullSdk.d.ts +4 -3
- package/NullSdk.js +22 -14
- package/NullSdk.js.map +1 -1
- package/PreviewDocument.d.ts +1 -0
- package/PreviewDocument.js +30 -30
- package/PreviewDocument.js.map +1 -1
- package/PreviewSdk.d.ts +4 -3
- package/PreviewSdk.js +19 -17
- package/PreviewSdk.js.map +1 -1
- package/PreviewViewport.d.ts +0 -1
- package/PreviewViewport.js +50 -82
- package/PreviewViewport.js.map +1 -1
- package/README.md +10 -2
- package/ResizeObserver.js +24 -31
- package/ResizeObserver.js.map +1 -1
- package/StylesBindingsProcessor.d.ts +12 -2
- package/StylesBindingsProcessor.js +62 -79
- package/StylesBindingsProcessor.js.map +1 -1
- package/StylesUpdater.d.ts +1 -1
- package/StylesUpdater.js +20 -25
- package/StylesUpdater.js.map +1 -1
- package/Theme.js +30 -32
- package/Theme.js.map +1 -1
- package/ViewportManager.d.ts +2 -0
- package/ViewportManager.js +89 -97
- package/ViewportManager.js.map +1 -1
- package/assertBindingShapes.d.ts +31 -0
- package/assertBindingShapes.js +64 -0
- package/assertBindingShapes.js.map +1 -0
- package/assertBindingShapes.test.d.ts +1 -0
- package/assertBindingShapes.test.js +131 -0
- package/assertBindingShapes.test.js.map +1 -0
- package/asset/deliveryUrl.d.ts +41 -0
- package/asset/deliveryUrl.js +34 -0
- package/asset/deliveryUrl.js.map +1 -0
- package/asset/deliveryUrl.test.d.ts +1 -0
- package/asset/deliveryUrl.test.js +127 -0
- package/asset/deliveryUrl.test.js.map +1 -0
- package/asset/geometry.d.ts +7 -0
- package/asset/geometry.js +10 -0
- package/asset/geometry.js.map +1 -0
- package/asset/imageSrcSet.d.ts +63 -0
- package/asset/imageSrcSet.js +98 -0
- package/asset/imageSrcSet.js.map +1 -0
- package/asset/imageSrcSet.test.d.ts +1 -0
- package/asset/imageSrcSet.test.js +103 -0
- package/asset/imageSrcSet.test.js.map +1 -0
- package/asset/index.d.ts +5 -0
- package/asset/index.js +5 -0
- package/asset/normalize.d.ts +24 -0
- package/asset/normalize.js +106 -0
- package/asset/normalize.js.map +1 -0
- package/asset/normalize.test.d.ts +1 -0
- package/asset/normalize.test.js +263 -0
- package/asset/normalize.test.js.map +1 -0
- package/asset/types.d.ts +2 -0
- package/asset/types.js +0 -0
- package/constants.d.ts +1 -0
- package/constants.js +7 -5
- package/constants.js.map +1 -1
- package/contentEntry/ContentEntryBindingsResolver.d.ts +30 -0
- package/contentEntry/ContentEntryBindingsResolver.js +45 -0
- package/contentEntry/ContentEntryBindingsResolver.js.map +1 -0
- package/contentEntry/ContentEntryCache.d.ts +46 -0
- package/contentEntry/ContentEntryCache.js +50 -0
- package/contentEntry/ContentEntryCache.js.map +1 -0
- package/contentEntry/resolveContentEntry.d.ts +74 -0
- package/contentEntry/resolveContentEntry.js +53 -0
- package/contentEntry/resolveContentEntry.js.map +1 -0
- package/contentEntry/resolveContentEntry.test.d.ts +1 -0
- package/contentEntry/resolveContentEntry.test.js +213 -0
- package/contentEntry/resolveContentEntry.test.js.map +1 -0
- package/createComponent.d.ts +5 -0
- package/createComponent.js +32 -0
- package/createComponent.js.map +1 -0
- package/createElement.js +5 -6
- package/createElement.js.map +1 -1
- package/createInput.d.ts +132 -16
- package/createInput.js +92 -111
- package/createInput.js.map +1 -1
- package/createTheme.js +2 -3
- package/createTheme.js.map +1 -1
- package/dataProviders/ApiClient.d.ts +10 -5
- package/dataProviders/ApiClient.js +40 -49
- package/dataProviders/ApiClient.js.map +1 -1
- package/dataProviders/DefaultDataProvider.d.ts +7 -3
- package/dataProviders/DefaultDataProvider.js +91 -45
- package/dataProviders/DefaultDataProvider.js.map +1 -1
- package/dataProviders/GET_EXPERIMENT_PAUSED.d.ts +1 -0
- package/dataProviders/GET_EXPERIMENT_PAUSED.js +17 -0
- package/dataProviders/GET_EXPERIMENT_PAUSED.js.map +1 -0
- package/dataProviders/GET_PAGE_BY_ID.d.ts +1 -1
- package/dataProviders/GET_PAGE_BY_ID.js +4 -1
- package/dataProviders/GET_PAGE_BY_ID.js.map +1 -1
- package/dataProviders/GET_PAGE_BY_PATH.d.ts +1 -1
- package/dataProviders/GET_PAGE_BY_PATH.js +4 -1
- package/dataProviders/GET_PAGE_BY_PATH.js.map +1 -1
- package/dataProviders/GET_PAGE_EXPERIMENT.d.ts +1 -0
- package/dataProviders/GET_PAGE_EXPERIMENT.js +32 -0
- package/dataProviders/GET_PAGE_EXPERIMENT.js.map +1 -0
- package/dataProviders/GET_VARIANT_CONTENT.d.ts +1 -0
- package/dataProviders/GET_VARIANT_CONTENT.js +24 -0
- package/dataProviders/GET_VARIANT_CONTENT.js.map +1 -0
- package/dataProviders/LIST_PUBLISHED_PAGES.d.ts +1 -1
- package/dataProviders/LIST_PUBLISHED_PAGES.js +17 -5
- package/dataProviders/LIST_PUBLISHED_PAGES.js.map +1 -1
- package/dataProviders/NullDataProvider.d.ts +16 -4
- package/dataProviders/NullDataProvider.js +30 -13
- package/dataProviders/NullDataProvider.js.map +1 -1
- package/dataProviders/RedirectsProvider.js +24 -27
- package/dataProviders/RedirectsProvider.js.map +1 -1
- package/defaultBreakpoints.js +43 -22
- package/defaultBreakpoints.js.map +1 -1
- package/documentOperations/$addElementReferenceToParent.d.ts +1 -1
- package/documentOperations/$addElementReferenceToParent.js +30 -26
- package/documentOperations/$addElementReferenceToParent.js.map +1 -1
- package/documentOperations/AddElement.js +8 -7
- package/documentOperations/AddElement.js.map +1 -1
- package/documentOperations/AddToParent.d.ts +2 -2
- package/documentOperations/AddToParent.js +14 -13
- package/documentOperations/AddToParent.js.map +1 -1
- package/documentOperations/IDocumentOperation.js +0 -3
- package/documentOperations/RemoveElement.js +10 -7
- package/documentOperations/RemoveElement.js.map +1 -1
- package/documentOperations/SetGlobalInputBinding.js +23 -22
- package/documentOperations/SetGlobalInputBinding.js.map +1 -1
- package/documentOperations/SetGlobalStyleBinding.js +23 -23
- package/documentOperations/SetGlobalStyleBinding.js.map +1 -1
- package/documentOperations/SetInputBindingOverride.js +30 -29
- package/documentOperations/SetInputBindingOverride.js.map +1 -1
- package/documentOperations/SetStyleBindingOverride.js +30 -31
- package/documentOperations/SetStyleBindingOverride.js.map +1 -1
- package/documentOperations/index.js +9 -8
- package/documentOperations/index.js.map +1 -1
- package/experiments/PostHogAnalyticsProvider.d.ts +31 -0
- package/experiments/PostHogAnalyticsProvider.js +28 -0
- package/experiments/PostHogAnalyticsProvider.js.map +1 -0
- package/experiments/analyticsProvider.d.ts +4 -0
- package/experiments/analyticsProvider.js +11 -0
- package/experiments/analyticsProvider.js.map +1 -0
- package/experiments/bucketing.d.ts +27 -0
- package/experiments/bucketing.js +91 -0
- package/experiments/bucketing.js.map +1 -0
- package/experiments/bucketing.test.d.ts +1 -0
- package/experiments/bucketing.test.js +183 -0
- package/experiments/bucketing.test.js.map +1 -0
- package/experiments/index.d.ts +5 -0
- package/experiments/index.js +5 -0
- package/experiments/render.d.ts +79 -0
- package/experiments/render.js +149 -0
- package/experiments/render.js.map +1 -0
- package/experiments/types.d.ts +108 -0
- package/experiments/types.js +4 -0
- package/experiments/types.js.map +1 -0
- package/findMatchingAstNode.js +11 -13
- package/findMatchingAstNode.js.map +1 -1
- package/generateElementId.d.ts +1 -1
- package/generateElementId.js +2 -2
- package/generateElementId.js.map +1 -1
- package/headersProvider.js +4 -3
- package/headersProvider.js.map +1 -1
- package/image/geometry.d.ts +54 -0
- package/image/geometry.js +112 -0
- package/image/geometry.js.map +1 -0
- package/image/geometry.test.d.ts +1 -0
- package/image/geometry.test.js +190 -0
- package/image/geometry.test.js.map +1 -0
- package/image/index.d.ts +3 -0
- package/image/index.js +3 -0
- package/image/presets.d.ts +6 -0
- package/image/presets.js +20 -0
- package/image/presets.js.map +1 -0
- package/image/types.d.ts +10 -0
- package/image/types.js +0 -0
- package/index.d.ts +12 -1
- package/index.js +11 -3
- package/jsonPatch.d.ts +1 -1
- package/jsonPatch.js +5 -9
- package/jsonPatch.js.map +1 -1
- package/messages.js +12 -11
- package/messages.js.map +1 -1
- package/messenger/MessageOrigin.js +12 -11
- package/messenger/MessageOrigin.js.map +1 -1
- package/messenger/Messenger.js +59 -70
- package/messenger/Messenger.js.map +1 -1
- package/messenger/index.js +0 -2
- package/package.json +19 -22
- package/registerComponentGroup.js +5 -6
- package/registerComponentGroup.js.map +1 -1
- package/tokenBinding.d.ts +26 -0
- package/tokenBinding.js +15 -0
- package/tokenBinding.js.map +1 -0
- package/tokenBinding.test.d.ts +1 -0
- package/tokenBinding.test.js +165 -0
- package/tokenBinding.test.js.map +1 -0
- package/types/ShorthandCssProperties.js +0 -3
- package/types/WebsiteBuilderTheme.d.ts +54 -45
- package/types/WebsiteBuilderTheme.js +0 -3
- package/types.d.ts +294 -13
- package/types.js +0 -3
- package/IBindingsUpdater.js.map +0 -1
- package/IRedirects.js.map +0 -1
- package/documentOperations/IDocumentOperation.js.map +0 -1
- package/index.js.map +0 -1
- package/lexical/createDefaultLexicalTheme.d.ts +0 -2
- package/lexical/createDefaultLexicalTheme.js +0 -84
- package/lexical/createDefaultLexicalTheme.js.map +0 -1
- package/lexical/createLexicalTheme.d.ts +0 -2
- package/lexical/createLexicalTheme.js +0 -7
- package/lexical/createLexicalTheme.js.map +0 -1
- package/lexical/deepMerge.d.ts +0 -1
- package/lexical/deepMerge.js +0 -23
- package/lexical/deepMerge.js.map +0 -1
- package/messenger/index.js.map +0 -1
- package/types/LexicalEditorTheme.d.ts +0 -2
- package/types/LexicalEditorTheme.js +0 -3
- package/types/LexicalEditorTheme.js.map +0 -1
- package/types/ShorthandCssProperties.js.map +0 -1
- package/types/WebsiteBuilderTheme.js.map +0 -1
- package/types.js.map +0 -1
package/types.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type * as CSS from "csstype";
|
|
2
2
|
import type { BindingsApi } from "./BindingsApi.js";
|
|
3
3
|
import type { ShorthandCssProperties } from "./types/ShorthandCssProperties.js";
|
|
4
|
+
import type { InputFactory } from "./createInput.js";
|
|
5
|
+
import type { Breakpoint } from "./types/WebsiteBuilderTheme.js";
|
|
6
|
+
import type { ActiveExperiment, VariantContent } from "./experiments/types.js";
|
|
4
7
|
export type { WebsiteBuilderTheme, Breakpoint } from "./types/WebsiteBuilderTheme.js";
|
|
5
|
-
|
|
6
|
-
}
|
|
8
|
+
type CSSProperties = CSS.Properties<string | number>;
|
|
7
9
|
export type ElementMap = Record<string, DocumentElement>;
|
|
8
10
|
export type DocumentState = Record<string, any>;
|
|
11
|
+
export type DocumentMetadata = Record<string, any>;
|
|
9
12
|
export type InputValueBinding<T = any> = ValueBinding<T> & {
|
|
10
13
|
id: string;
|
|
11
14
|
type: string;
|
|
@@ -13,9 +16,30 @@ export type InputValueBinding<T = any> = ValueBinding<T> & {
|
|
|
13
16
|
list?: boolean;
|
|
14
17
|
};
|
|
15
18
|
export type StyleValueBinding<T = any> = ValueBinding<T>;
|
|
19
|
+
/**
|
|
20
|
+
* A reference to a design token, stored in place of a literal value.
|
|
21
|
+
*
|
|
22
|
+
* `path` is a dot-path into the theme's token document (`color.action.primary.background`). The
|
|
23
|
+
* CSS variable name is derived from it at render time — see `tokenBinding.ts` for why the variable
|
|
24
|
+
* string itself is deliberately not stored.
|
|
25
|
+
*/
|
|
26
|
+
export type TokenReference = {
|
|
27
|
+
path: string;
|
|
28
|
+
/**
|
|
29
|
+
* The value the token resolved to when it was picked, emitted as the `var()` fallback so
|
|
30
|
+
* content keeps rendering if the theme is later deactivated.
|
|
31
|
+
*/
|
|
32
|
+
fallback?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A bound value. Exactly one of these is meaningful at a time, and all three must be able to
|
|
36
|
+
* coexist in the same field across a document indefinitely: a project can hold literals authored
|
|
37
|
+
* before it adopted a theme and token references authored after, with no migration between them.
|
|
38
|
+
*/
|
|
16
39
|
export type ValueBinding<T = any> = {
|
|
17
40
|
static?: T;
|
|
18
41
|
expression?: string;
|
|
42
|
+
token?: TokenReference;
|
|
19
43
|
};
|
|
20
44
|
export type RepeatValueBinding = {
|
|
21
45
|
expression: string;
|
|
@@ -57,6 +81,10 @@ export type Component = {
|
|
|
57
81
|
component: any;
|
|
58
82
|
manifest: ComponentManifest;
|
|
59
83
|
};
|
|
84
|
+
export type ComponentBlueprint<TComponent = any, TManifest = any> = {
|
|
85
|
+
component: TComponent;
|
|
86
|
+
manifest: TManifest;
|
|
87
|
+
};
|
|
60
88
|
export type ComponentGroupItem = {
|
|
61
89
|
name: string;
|
|
62
90
|
item?: DocumentElementTemplate;
|
|
@@ -71,24 +99,133 @@ export type ComponentGroup = {
|
|
|
71
99
|
name: string;
|
|
72
100
|
label: string;
|
|
73
101
|
description?: string;
|
|
102
|
+
icon?: string;
|
|
74
103
|
filter?: (component: ComponentManifest, context: ComponentGroupFilterContext) => boolean;
|
|
75
104
|
};
|
|
76
105
|
export type ResponsiveStyles = {
|
|
77
106
|
[key: string]: SerializableCSSStyleDeclaration;
|
|
78
107
|
};
|
|
108
|
+
export type ConstraintElementContext = {
|
|
109
|
+
/** Component name (e.g., "FunnelBuilder/Step") */
|
|
110
|
+
name: string;
|
|
111
|
+
/** Component tags */
|
|
112
|
+
tags: string[];
|
|
113
|
+
/** Get the parent element context. undefined for root. */
|
|
114
|
+
getParent(): ConstraintElementContext | undefined;
|
|
115
|
+
/** Index of this element among siblings in the same parent slot. -1 if not in a list slot. */
|
|
116
|
+
childIndex(): number;
|
|
117
|
+
/** Total siblings in the same parent slot. -1 if not in a list slot. */
|
|
118
|
+
childCount(): number;
|
|
119
|
+
/** True if this element is the last among siblings in its parent slot. */
|
|
120
|
+
isLastChild(): boolean;
|
|
121
|
+
/** True if this element is the first among siblings in its parent slot. */
|
|
122
|
+
isFirstChild(): boolean;
|
|
123
|
+
};
|
|
124
|
+
export type ConstraintContext = {
|
|
125
|
+
/** The component/element this constraint is about */
|
|
126
|
+
component: ConstraintElementContext;
|
|
127
|
+
/** The direct parent element at the drop target */
|
|
128
|
+
parent: ConstraintElementContext;
|
|
129
|
+
/** The target slot name (e.g., "children", "leftColumn", "rightColumn") */
|
|
130
|
+
slot: string;
|
|
131
|
+
/** True if the direct parent is the given component */
|
|
132
|
+
isChildOf: (componentName: string) => boolean;
|
|
133
|
+
/** True if any ancestor (including parent) is the given component */
|
|
134
|
+
isDescendantOf: (componentName: string) => boolean;
|
|
135
|
+
/** Find the nearest ancestor matching a component name */
|
|
136
|
+
getAncestor: (componentName: string) => ConstraintElementContext | undefined;
|
|
137
|
+
/** True if the component being placed has the given tag */
|
|
138
|
+
hasTag: (tag: string) => boolean;
|
|
139
|
+
/** Number of items currently in the target slot */
|
|
140
|
+
slotChildCount: () => number;
|
|
141
|
+
/** Count instances of a component type in the entire document */
|
|
142
|
+
countInstances: (componentName: string) => number;
|
|
143
|
+
/** True if the component has any descendant element carrying the given tag */
|
|
144
|
+
hasDescendantWithTag: (tag: string) => boolean;
|
|
145
|
+
/** Returns the resolved inputs of the nearest ancestor matching componentName, or undefined */
|
|
146
|
+
getAncestorInputs: (componentName: string) => Record<string, any> | undefined;
|
|
147
|
+
/** Returns the resolved inputs of the element this constraint is evaluating */
|
|
148
|
+
getElementInputs: () => Record<string, any>;
|
|
149
|
+
/** Debug logger — safe to call inside serialized constraints */
|
|
150
|
+
log: (...args: any[]) => void;
|
|
151
|
+
/** Block placement with an error message shown to the user */
|
|
152
|
+
block: (message: string) => never;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* A constraint function. Call `ctx.block("message")` to block placement.
|
|
156
|
+
* Returning without blocking means the constraint passes.
|
|
157
|
+
*/
|
|
158
|
+
export type ComponentConstraint = (ctx: ConstraintContext) => void;
|
|
159
|
+
export type Stop = symbol;
|
|
160
|
+
export type Continue = symbol;
|
|
161
|
+
export type HandlerResult = void | Stop | Continue;
|
|
162
|
+
export type OnChangeAction = "create" | "update" | "delete";
|
|
163
|
+
export type OnChangeElementContext = {
|
|
164
|
+
id: string;
|
|
165
|
+
component: ComponentManifest;
|
|
166
|
+
inputs: Record<string, any>;
|
|
167
|
+
};
|
|
168
|
+
export type ManifestAncestorContext = {
|
|
169
|
+
id: string;
|
|
170
|
+
component: ComponentManifest;
|
|
171
|
+
inputs: Record<string, any>;
|
|
172
|
+
updateInputs: (cb: (inputs: Record<string, any>) => void) => void;
|
|
173
|
+
getElement: (id: string) => OnChangeElementContext | undefined;
|
|
174
|
+
};
|
|
175
|
+
export type ComponentChangeContext<TInputs = Record<string, any>> = {
|
|
176
|
+
action: OnChangeAction;
|
|
177
|
+
id: string;
|
|
178
|
+
component: ComponentManifest;
|
|
179
|
+
inputs: TInputs;
|
|
180
|
+
styles: Record<string, any>;
|
|
181
|
+
getAncestor: (componentName: string) => ManifestAncestorContext | undefined;
|
|
182
|
+
getElement: (id: string) => OnChangeElementContext | undefined;
|
|
183
|
+
createElement: (params: any) => any;
|
|
184
|
+
executeCommand: <T = unknown>(command: string, payload?: T) => void;
|
|
185
|
+
breakpoint: string;
|
|
186
|
+
log: (...args: any[]) => void;
|
|
187
|
+
stop: () => Stop;
|
|
188
|
+
continue: () => Continue;
|
|
189
|
+
};
|
|
190
|
+
export type DescendantChangeContext<TInputs = Record<string, any>, TDescendantInputs = Record<string, any>> = {
|
|
191
|
+
action: OnChangeAction;
|
|
192
|
+
descendant: {
|
|
193
|
+
component: ComponentManifest;
|
|
194
|
+
id: string;
|
|
195
|
+
inputs: TDescendantInputs;
|
|
196
|
+
updateInputs: (cb: (inputs: TDescendantInputs) => void) => void;
|
|
197
|
+
};
|
|
198
|
+
inputs: TInputs;
|
|
199
|
+
updateInputs: (cb: (inputs: TInputs) => void) => void;
|
|
200
|
+
getElement: (id: string) => OnChangeElementContext | undefined;
|
|
201
|
+
executeCommand: <T = unknown>(command: string, payload?: T) => void;
|
|
202
|
+
breakpoint: string;
|
|
203
|
+
log: (...args: any[]) => void;
|
|
204
|
+
stop: () => Stop;
|
|
205
|
+
continue: () => Continue;
|
|
206
|
+
};
|
|
207
|
+
export type ComponentChangeHandler<TInputs = Record<string, any>> = (ctx: ComponentChangeContext<TInputs>) => HandlerResult;
|
|
208
|
+
export type DescendantChangeHandler<TInputs = Record<string, any>, TDescendantInputs = Record<string, any>> = (ctx: DescendantChangeContext<TInputs, TDescendantInputs>) => HandlerResult;
|
|
79
209
|
export type ComponentManifest = {
|
|
80
210
|
name: string;
|
|
81
211
|
group?: string;
|
|
82
212
|
label?: string;
|
|
213
|
+
aiContext?: string;
|
|
214
|
+
useInAiContentGeneration?: boolean;
|
|
83
215
|
image?: string;
|
|
84
|
-
inputs
|
|
216
|
+
inputs: ComponentInput[];
|
|
85
217
|
canDrag?: boolean;
|
|
86
|
-
canDelete?: boolean;
|
|
218
|
+
canDelete?: boolean | ComponentConstraint;
|
|
87
219
|
acceptsChildren?: boolean;
|
|
88
220
|
hideFromToolbar?: boolean;
|
|
89
221
|
hideStyleSettings?: string[];
|
|
90
222
|
autoApplyStyles?: boolean;
|
|
91
|
-
|
|
223
|
+
applyDefaultStyles?: boolean;
|
|
224
|
+
tags: string[];
|
|
225
|
+
constraints?: ComponentConstraint[];
|
|
226
|
+
descendantConstraints?: ComponentConstraint[];
|
|
227
|
+
onChange?: ComponentChangeHandler | ComponentChangeHandler[];
|
|
228
|
+
onDescendantChange?: DescendantChangeHandler | DescendantChangeHandler[];
|
|
92
229
|
defaults?: {
|
|
93
230
|
inputs?: Record<string, any>;
|
|
94
231
|
styles?: SerializableCSSStyleDeclaration;
|
|
@@ -117,15 +254,21 @@ export type DocumentElement = {
|
|
|
117
254
|
export type SerializableCSSStyleDeclaration = {
|
|
118
255
|
[K in keyof CssProperties]?: CssProperties[K];
|
|
119
256
|
};
|
|
257
|
+
export type DocumentCache = Record<string, unknown>;
|
|
120
258
|
export type Document = {
|
|
121
259
|
id: string;
|
|
122
260
|
state: DocumentState;
|
|
123
261
|
version: number;
|
|
124
262
|
properties: Record<string, any>;
|
|
263
|
+
extensions: Record<string, any>;
|
|
264
|
+
metadata: DocumentMetadata;
|
|
125
265
|
bindings: DocumentBindings;
|
|
126
266
|
elements: ElementMap;
|
|
267
|
+
__cache?: DocumentCache;
|
|
268
|
+
};
|
|
269
|
+
export type PublicPage = Pick<Page, "id" | "version" | "properties" | "bindings" | "elements" | "extensions" | "metadata" | "state"> & {
|
|
270
|
+
languagePaths: Record<string, string>;
|
|
127
271
|
};
|
|
128
|
-
export type PublicPage = Pick<Page, "id" | "version" | "properties" | "bindings" | "elements" | "state">;
|
|
129
272
|
export type PublicRedirect = {
|
|
130
273
|
id: string;
|
|
131
274
|
from: string;
|
|
@@ -133,9 +276,10 @@ export type PublicRedirect = {
|
|
|
133
276
|
permanent: boolean;
|
|
134
277
|
};
|
|
135
278
|
export type EditorPage = EditorDocument & Pick<Page, "properties" | "status" | "location">;
|
|
136
|
-
export
|
|
137
|
-
|
|
138
|
-
}
|
|
279
|
+
export interface EditorOptions {
|
|
280
|
+
isReadOnly?: boolean;
|
|
281
|
+
}
|
|
282
|
+
export type EditorDocument = Document;
|
|
139
283
|
export type Page = Document & {
|
|
140
284
|
id: string;
|
|
141
285
|
status: string;
|
|
@@ -146,7 +290,18 @@ export type Page = Document & {
|
|
|
146
290
|
properties: {
|
|
147
291
|
title: string;
|
|
148
292
|
snippet: string;
|
|
293
|
+
image: {
|
|
294
|
+
id: string;
|
|
295
|
+
name: string;
|
|
296
|
+
size: number;
|
|
297
|
+
mimeType: string;
|
|
298
|
+
src: string;
|
|
299
|
+
width: number;
|
|
300
|
+
height: number;
|
|
301
|
+
};
|
|
149
302
|
path: string;
|
|
303
|
+
language?: string;
|
|
304
|
+
sourcePage?: string;
|
|
150
305
|
tags: string[];
|
|
151
306
|
seo: {
|
|
152
307
|
title: string;
|
|
@@ -155,16 +310,31 @@ export type Page = Document & {
|
|
|
155
310
|
name: string;
|
|
156
311
|
content: string;
|
|
157
312
|
}>;
|
|
313
|
+
canonicalUrl: string;
|
|
314
|
+
noIndex: boolean;
|
|
315
|
+
noFollow: boolean;
|
|
316
|
+
structuredSchema: string;
|
|
158
317
|
};
|
|
159
318
|
social: {
|
|
160
319
|
title: string;
|
|
161
320
|
description: string;
|
|
321
|
+
image: {
|
|
322
|
+
id: string;
|
|
323
|
+
name: string;
|
|
324
|
+
size: number;
|
|
325
|
+
mimeType: string;
|
|
326
|
+
src: string;
|
|
327
|
+
width: number;
|
|
328
|
+
height: number;
|
|
329
|
+
};
|
|
162
330
|
metaTags: Array<{
|
|
163
331
|
property: string;
|
|
164
332
|
content: string;
|
|
165
333
|
}>;
|
|
166
334
|
};
|
|
167
335
|
};
|
|
336
|
+
extensions: Record<string, any>;
|
|
337
|
+
metadata: DocumentMetadata;
|
|
168
338
|
};
|
|
169
339
|
export type Box = {
|
|
170
340
|
depth: number;
|
|
@@ -186,10 +356,14 @@ export type BoxData = ElementBoxData | ElementSlotBoxData;
|
|
|
186
356
|
export type EditorViewportInfo = PreviewViewportInfo & {
|
|
187
357
|
top: number;
|
|
188
358
|
left: number;
|
|
359
|
+
breakpoint: string;
|
|
360
|
+
breakpoints: Breakpoint[];
|
|
189
361
|
};
|
|
190
362
|
export type PreviewViewportInfo = {
|
|
191
363
|
width: number;
|
|
192
364
|
height: number;
|
|
365
|
+
scrollWidth: number;
|
|
366
|
+
scrollHeight: number;
|
|
193
367
|
scrollX: number;
|
|
194
368
|
scrollY: number;
|
|
195
369
|
};
|
|
@@ -204,11 +378,29 @@ export type PreviewViewportData = {
|
|
|
204
378
|
};
|
|
205
379
|
export type ApiOptions = Record<string, any>;
|
|
206
380
|
export type GetPageOptions = ApiOptions;
|
|
207
|
-
export
|
|
381
|
+
export interface ListPagesOptions {
|
|
382
|
+
where?: Record<string, any>;
|
|
383
|
+
limit?: number;
|
|
384
|
+
after?: string;
|
|
385
|
+
sort?: string[];
|
|
386
|
+
search?: string;
|
|
387
|
+
}
|
|
388
|
+
export interface ListPagesMeta {
|
|
389
|
+
hasMoreItems: boolean;
|
|
390
|
+
totalCount: number;
|
|
391
|
+
cursor: string | null;
|
|
392
|
+
}
|
|
393
|
+
export interface ListPagesResult {
|
|
394
|
+
data: Array<Omit<PublicPage, "elements" | "bindings">>;
|
|
395
|
+
meta: ListPagesMeta;
|
|
396
|
+
}
|
|
208
397
|
export interface IDataProvider {
|
|
209
398
|
getPageByPath(path: string, options?: GetPageOptions): Promise<PublicPage | null>;
|
|
210
399
|
getPageById(id: string, options?: GetPageOptions): Promise<PublicPage | null>;
|
|
211
|
-
listPages(options?: ListPagesOptions): Promise<
|
|
400
|
+
listPages(options?: ListPagesOptions): Promise<ListPagesResult>;
|
|
401
|
+
getPageExperiment(path: string): Promise<ActiveExperiment | null>;
|
|
402
|
+
getVariantContent(variantId: string): Promise<VariantContent | null>;
|
|
403
|
+
getExperimentPaused(experimentId: string): Promise<boolean>;
|
|
212
404
|
}
|
|
213
405
|
export interface IEnvironment {
|
|
214
406
|
isClient(): boolean;
|
|
@@ -217,7 +409,7 @@ export interface IEnvironment {
|
|
|
217
409
|
}
|
|
218
410
|
export interface IContentSdk {
|
|
219
411
|
getPage(path: string): Promise<PublicPage | null>;
|
|
220
|
-
listPages(options?: ListPagesOptions): Promise<
|
|
412
|
+
listPages(options?: ListPagesOptions): Promise<ListPagesResult>;
|
|
221
413
|
}
|
|
222
414
|
export type BaseInput<T = any> = {
|
|
223
415
|
name: string;
|
|
@@ -284,6 +476,72 @@ export type RadioInput = BaseInput<string> & {
|
|
|
284
476
|
value: string;
|
|
285
477
|
}[];
|
|
286
478
|
};
|
|
479
|
+
export interface ContentEntryReference {
|
|
480
|
+
id: string;
|
|
481
|
+
modelId: string;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Query-mode configuration, declared by the component author. The editor then
|
|
485
|
+
* builds a query within these bounds (see `ContentEntryQueryValue`).
|
|
486
|
+
*/
|
|
487
|
+
/**
|
|
488
|
+
* A field the editor may sort by: a bare read-API sort key, or a key paired with
|
|
489
|
+
* a display label shown in the editor.
|
|
490
|
+
*/
|
|
491
|
+
export type ContentEntrySortField = string | {
|
|
492
|
+
field: string;
|
|
493
|
+
label?: string;
|
|
494
|
+
};
|
|
495
|
+
export interface ContentEntryQueryConfig {
|
|
496
|
+
/**
|
|
497
|
+
* Fields the editor may sort by (one at a time). Each `field` is a CMS read-API
|
|
498
|
+
* sort key — value fields as `values_<fieldId>` (e.g. `values_title`), meta
|
|
499
|
+
* fields bare (e.g. `createdOn`). Provide a `label` for a friendlier UI; a bare
|
|
500
|
+
* string uses the key as its label.
|
|
501
|
+
*/
|
|
502
|
+
sort?: {
|
|
503
|
+
fields: ContentEntrySortField[];
|
|
504
|
+
};
|
|
505
|
+
/** Editor-configurable result limit, with an optional default and hard cap. */
|
|
506
|
+
limit?: {
|
|
507
|
+
default?: number;
|
|
508
|
+
max?: number;
|
|
509
|
+
};
|
|
510
|
+
/** Show a free-text search box (matches fullTextSearch-enabled fields). */
|
|
511
|
+
search?: boolean;
|
|
512
|
+
/** Enable "load more" pagination in the rendered component. */
|
|
513
|
+
pagination?: boolean;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* The value stored for a query-mode input: the editor's chosen query.
|
|
517
|
+
* `modelId` identifies the CMS model so the frontend SDK can resolve the
|
|
518
|
+
* query without component manifests.
|
|
519
|
+
*/
|
|
520
|
+
export interface ContentEntryQueryValue {
|
|
521
|
+
modelId: string;
|
|
522
|
+
sort?: {
|
|
523
|
+
field: string;
|
|
524
|
+
order: "asc" | "desc";
|
|
525
|
+
};
|
|
526
|
+
limit?: number;
|
|
527
|
+
search?: string;
|
|
528
|
+
}
|
|
529
|
+
export type ContentEntryInput = BaseInput<ContentEntryReference | ContentEntryReference[] | ContentEntryQueryValue> & {
|
|
530
|
+
type: "contentEntry";
|
|
531
|
+
/**
|
|
532
|
+
* The content model(s) the editor may pick entries from. Author-fixed.
|
|
533
|
+
*/
|
|
534
|
+
models: string[];
|
|
535
|
+
/**
|
|
536
|
+
* "manual" (default): the editor hand-picks entries (stored as references).
|
|
537
|
+
* "query": the editor configures a dynamic query on the fixed model.
|
|
538
|
+
*/
|
|
539
|
+
mode?: "manual" | "query";
|
|
540
|
+
/**
|
|
541
|
+
* Query-mode configuration. Only used when `mode` is "query".
|
|
542
|
+
*/
|
|
543
|
+
query?: ContentEntryQueryConfig;
|
|
544
|
+
};
|
|
287
545
|
export type ObjectInput = BaseInput<Record<string, any>> & {
|
|
288
546
|
type: "object";
|
|
289
547
|
fields: ComponentInput[];
|
|
@@ -292,4 +550,27 @@ export type CustomInput = BaseInput<any> & {
|
|
|
292
550
|
type: string;
|
|
293
551
|
fields: ComponentInput[];
|
|
294
552
|
};
|
|
295
|
-
export type ComponentInput = TextInput | LongTextInput | NumberInput | BooleanInput | ColorInput | FileInput | DateTimeInput | LexicalInput | SelectInput | RadioInput | TagsInput | ObjectInput | SlotInput | CustomInput;
|
|
553
|
+
export type ComponentInput = TextInput | LongTextInput | NumberInput | BooleanInput | ColorInput | FileInput | DateTimeInput | LexicalInput | SelectInput | RadioInput | TagsInput | ObjectInput | SlotInput | ContentEntryInput | CustomInput;
|
|
554
|
+
export type ManifestInputsArray<TInputs, TAllowChildren extends boolean> = TAllowChildren extends true ? {
|
|
555
|
+
[K in Exclude<keyof TInputs, "children">]: InputFactory<K & string>;
|
|
556
|
+
}[Exclude<keyof TInputs, "children">][] : {
|
|
557
|
+
[K in keyof TInputs]: InputFactory<K & string>;
|
|
558
|
+
}[keyof TInputs][];
|
|
559
|
+
export type ManifestInputsObject<TInputs, TAllowChildren extends boolean> = TAllowChildren extends true ? {
|
|
560
|
+
[K in Exclude<keyof TInputs, "children">]: InputFactory<K & string>;
|
|
561
|
+
} : {
|
|
562
|
+
[K in keyof TInputs]: InputFactory<K & string>;
|
|
563
|
+
};
|
|
564
|
+
export type ComponentManifestInput<TInputs> = (Omit<ComponentManifest, "inputs" | "acceptsChildren" | "tags" | "onChange" | "onDescendantChange"> & {
|
|
565
|
+
acceptsChildren: true;
|
|
566
|
+
tags?: string[];
|
|
567
|
+
inputs?: ManifestInputsArray<TInputs, true> | ManifestInputsObject<TInputs, true>;
|
|
568
|
+
onChange?: ComponentChangeHandler<TInputs> | ComponentChangeHandler<TInputs>[];
|
|
569
|
+
onDescendantChange?: DescendantChangeHandler<TInputs> | DescendantChangeHandler<TInputs>[];
|
|
570
|
+
}) | (Omit<ComponentManifest, "inputs" | "acceptsChildren" | "tags" | "onChange" | "onDescendantChange"> & {
|
|
571
|
+
acceptsChildren?: false;
|
|
572
|
+
tags?: string[];
|
|
573
|
+
inputs: ManifestInputsArray<TInputs, false> | ManifestInputsObject<TInputs, false>;
|
|
574
|
+
onChange?: ComponentChangeHandler<TInputs> | ComponentChangeHandler<TInputs>[];
|
|
575
|
+
onDescendantChange?: DescendantChangeHandler<TInputs> | DescendantChangeHandler<TInputs>[];
|
|
576
|
+
});
|
package/types.js
CHANGED
package/IBindingsUpdater.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["IBindingsUpdater.ts"],"sourcesContent":["import type { JsonPatchOperation } from \"~/jsonPatch.js\";\nimport type { Document, DocumentElementBindings } from \"~/types.js\";\n\nexport interface IBindingsUpdater {\n applyToDocument(document: Document): void;\n createJsonPatch(bindings: DocumentElementBindings): JsonPatchOperation[];\n}\n"],"mappings":"","ignoreList":[]}
|
package/IRedirects.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["IRedirects.ts"],"sourcesContent":["import type { PublicRedirect } from \"~/types.js\";\n\nexport interface IRedirects {\n getAllRedirects(): Promise<Map<string, PublicRedirect>>;\n getRedirectByPath(path: string): Promise<PublicRedirect | undefined>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["IDocumentOperation.ts"],"sourcesContent":["import type { Document } from \"~/types.js\";\n\nexport interface IDocumentOperation {\n apply(document: Document): void;\n}\n"],"mappings":"","ignoreList":[]}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSettings"],"sources":["index.ts"],"sourcesContent":["export * from \"./createTheme.js\";\nexport * from \"./EditingSdk.js\";\nexport * from \"./LiveSdk.js\";\nexport * from \"./NullSdk.js\";\nexport * from \"./ContentSdk.js\";\nexport * from \"./Environment.js\";\nexport * from \"./DocumentStore.js\";\nexport * from \"./Logger.js\";\nexport * from \"./FunctionConverter.js\";\nexport * from \"./createInput.js\";\nexport * from \"./MouseTracker.js\";\nexport * from \"./ViewportManager.js\";\nexport * from \"./messenger/Messenger.js\";\nexport * from \"./messenger/MessageOrigin.js\";\nexport * from \"./types.js\";\nexport * from \"./DocumentStoreManager.js\";\nexport * from \"./BindingsProcessor.js\";\nexport * from \"./ResizeObserver.js\";\nexport * from \"./BindingsResolver.js\";\nexport * from \"./createElement.js\";\nexport * from \"./registerComponentGroup.js\";\nexport * from \"./jsonPatch.js\";\nexport * from \"./headersProvider.js\";\nexport * from \"./ComponentManifestToAstConverter.js\";\nexport * from \"./findMatchingAstNode.js\";\nexport * from \"./InheritanceProcessor.js\";\nexport * from \"./InputBindingsProcessor.js\";\nexport * from \"./StylesBindingsProcessor.js\";\nexport * from \"./ElementFactory.js\";\nexport { StyleSettings } from \"./constants.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa","ignoreList":[]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
export const createDefaultLexicalTheme = () => {
|
|
2
|
-
return {
|
|
3
|
-
characterLimit: "wb-lx-characterLimit",
|
|
4
|
-
code: "wb-lx-code",
|
|
5
|
-
codeHighlight: {
|
|
6
|
-
atrule: "wb-lx-tokenAttr",
|
|
7
|
-
attr: "wb-lx-tokenAttr",
|
|
8
|
-
boolean: "wb-lx-tokenProperty",
|
|
9
|
-
builtin: "wb-lx-tokenSelector",
|
|
10
|
-
cdata: "wb-lx-tokenComment",
|
|
11
|
-
char: "wb-lx-tokenSelector",
|
|
12
|
-
class: "wb-lx-tokenFunction",
|
|
13
|
-
"class-name": "wb-lx-tokenFunction",
|
|
14
|
-
comment: "wb-lx-tokenComment",
|
|
15
|
-
constant: "wb-lx-tokenProperty",
|
|
16
|
-
deleted: "wb-lx-tokenProperty",
|
|
17
|
-
doctype: "wb-lx-tokenComment",
|
|
18
|
-
entity: "wb-lx-tokenOperator",
|
|
19
|
-
function: "wb-lx-tokenFunction",
|
|
20
|
-
important: "wb-lx-tokenVariable",
|
|
21
|
-
inserted: "wb-lx-tokenSelector",
|
|
22
|
-
keyword: "wb-lx-tokenAttr",
|
|
23
|
-
namespace: "wb-lx-tokenVariable",
|
|
24
|
-
number: "wb-lx-tokenProperty",
|
|
25
|
-
operator: "wb-lx-tokenOperator",
|
|
26
|
-
prolog: "wb-lx-tokenComment",
|
|
27
|
-
property: "wb-lx-tokenProperty",
|
|
28
|
-
punctuation: "wb-lx-tokenPunctuation",
|
|
29
|
-
regex: "wb-lx-tokenVariable",
|
|
30
|
-
selector: "wb-lx-tokenSelector",
|
|
31
|
-
string: "wb-lx-tokenSelector",
|
|
32
|
-
symbol: "wb-lx-tokenProperty",
|
|
33
|
-
tag: "wb-lx-tokenProperty",
|
|
34
|
-
url: "wb-lx-tokenOperator",
|
|
35
|
-
variable: "wb-lx-tokenVariable"
|
|
36
|
-
},
|
|
37
|
-
embedBlock: {
|
|
38
|
-
base: "wb-lx-embedBlock",
|
|
39
|
-
focus: "wb-lx-embedBlockFocus"
|
|
40
|
-
},
|
|
41
|
-
hashtag: "wb-lx-hashtag",
|
|
42
|
-
heading: {
|
|
43
|
-
h1: "wb-lx-h1",
|
|
44
|
-
h2: "wb-lx-h2",
|
|
45
|
-
h3: "wb-lx-h3",
|
|
46
|
-
h4: "wb-lx-h4",
|
|
47
|
-
h5: "wb-lx-h5",
|
|
48
|
-
h6: "wb-lx-h6"
|
|
49
|
-
},
|
|
50
|
-
link: "wb-lx-link",
|
|
51
|
-
list: {
|
|
52
|
-
listitem: "wb-lx-listItem",
|
|
53
|
-
listitemChecked: "wb-lx-listItemChecked",
|
|
54
|
-
listitemUnchecked: "wb-lx-listItemUnchecked",
|
|
55
|
-
nested: {
|
|
56
|
-
listitem: "wb-lx-nestedListItem"
|
|
57
|
-
},
|
|
58
|
-
olDepth: ["wb-lx-ol1", "wb-lx-ol2", "wb-lx-ol3", "wb-lx-ol4", "wb-lx-ol5"],
|
|
59
|
-
ul: "wb-lx-ul"
|
|
60
|
-
},
|
|
61
|
-
ltr: "wb-lx-ltr",
|
|
62
|
-
mark: "wb-lx-mark",
|
|
63
|
-
markOverlap: "wb-lx-markOverlap",
|
|
64
|
-
paragraph: "wb-lx-paragraph",
|
|
65
|
-
quote: "wb-lx-quote",
|
|
66
|
-
rtl: "wb-lx-rtl",
|
|
67
|
-
text: {
|
|
68
|
-
bold: "wb-lx-textBold",
|
|
69
|
-
code: "wb-lx-textCode",
|
|
70
|
-
italic: "wb-lx-textItalic",
|
|
71
|
-
strikethrough: "wb-lx-textStrikethrough",
|
|
72
|
-
subscript: "wb-lx-textSubscript",
|
|
73
|
-
superscript: "wb-lx-textSuperscript",
|
|
74
|
-
underline: "wb-lx-textUnderline",
|
|
75
|
-
underlineStrikethrough: "wb-lx-textUnderlineStrikethrough"
|
|
76
|
-
},
|
|
77
|
-
fontColorText: "wb-lx-fontColorText",
|
|
78
|
-
image: "wb-lx-image",
|
|
79
|
-
indent: "wb-lx-indent",
|
|
80
|
-
inlineImage: "wb-lx-inline-image"
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
//# sourceMappingURL=createDefaultLexicalTheme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createDefaultLexicalTheme","characterLimit","code","codeHighlight","atrule","attr","boolean","builtin","cdata","char","class","comment","constant","deleted","doctype","entity","function","important","inserted","keyword","namespace","number","operator","prolog","property","punctuation","regex","selector","string","symbol","tag","url","variable","embedBlock","base","focus","hashtag","heading","h1","h2","h3","h4","h5","h6","link","list","listitem","listitemChecked","listitemUnchecked","nested","olDepth","ul","ltr","mark","markOverlap","paragraph","quote","rtl","text","bold","italic","strikethrough","subscript","superscript","underline","underlineStrikethrough","fontColorText","image","indent","inlineImage"],"sources":["createDefaultLexicalTheme.ts"],"sourcesContent":["import type { LexicalEditorTheme } from \"~/types/LexicalEditorTheme.js\";\n\nexport const createDefaultLexicalTheme = (): LexicalEditorTheme => {\n return {\n characterLimit: \"wb-lx-characterLimit\",\n code: \"wb-lx-code\",\n codeHighlight: {\n atrule: \"wb-lx-tokenAttr\",\n attr: \"wb-lx-tokenAttr\",\n boolean: \"wb-lx-tokenProperty\",\n builtin: \"wb-lx-tokenSelector\",\n cdata: \"wb-lx-tokenComment\",\n char: \"wb-lx-tokenSelector\",\n class: \"wb-lx-tokenFunction\",\n \"class-name\": \"wb-lx-tokenFunction\",\n comment: \"wb-lx-tokenComment\",\n constant: \"wb-lx-tokenProperty\",\n deleted: \"wb-lx-tokenProperty\",\n doctype: \"wb-lx-tokenComment\",\n entity: \"wb-lx-tokenOperator\",\n function: \"wb-lx-tokenFunction\",\n important: \"wb-lx-tokenVariable\",\n inserted: \"wb-lx-tokenSelector\",\n keyword: \"wb-lx-tokenAttr\",\n namespace: \"wb-lx-tokenVariable\",\n number: \"wb-lx-tokenProperty\",\n operator: \"wb-lx-tokenOperator\",\n prolog: \"wb-lx-tokenComment\",\n property: \"wb-lx-tokenProperty\",\n punctuation: \"wb-lx-tokenPunctuation\",\n regex: \"wb-lx-tokenVariable\",\n selector: \"wb-lx-tokenSelector\",\n string: \"wb-lx-tokenSelector\",\n symbol: \"wb-lx-tokenProperty\",\n tag: \"wb-lx-tokenProperty\",\n url: \"wb-lx-tokenOperator\",\n variable: \"wb-lx-tokenVariable\"\n },\n embedBlock: {\n base: \"wb-lx-embedBlock\",\n focus: \"wb-lx-embedBlockFocus\"\n },\n hashtag: \"wb-lx-hashtag\",\n heading: {\n h1: \"wb-lx-h1\",\n h2: \"wb-lx-h2\",\n h3: \"wb-lx-h3\",\n h4: \"wb-lx-h4\",\n h5: \"wb-lx-h5\",\n h6: \"wb-lx-h6\"\n },\n link: \"wb-lx-link\",\n list: {\n listitem: \"wb-lx-listItem\",\n listitemChecked: \"wb-lx-listItemChecked\",\n listitemUnchecked: \"wb-lx-listItemUnchecked\",\n nested: {\n listitem: \"wb-lx-nestedListItem\"\n },\n olDepth: [\"wb-lx-ol1\", \"wb-lx-ol2\", \"wb-lx-ol3\", \"wb-lx-ol4\", \"wb-lx-ol5\"],\n ul: \"wb-lx-ul\"\n },\n ltr: \"wb-lx-ltr\",\n mark: \"wb-lx-mark\",\n markOverlap: \"wb-lx-markOverlap\",\n paragraph: \"wb-lx-paragraph\",\n quote: \"wb-lx-quote\",\n rtl: \"wb-lx-rtl\",\n text: {\n bold: \"wb-lx-textBold\",\n code: \"wb-lx-textCode\",\n italic: \"wb-lx-textItalic\",\n strikethrough: \"wb-lx-textStrikethrough\",\n subscript: \"wb-lx-textSubscript\",\n superscript: \"wb-lx-textSuperscript\",\n underline: \"wb-lx-textUnderline\",\n underlineStrikethrough: \"wb-lx-textUnderlineStrikethrough\"\n },\n fontColorText: \"wb-lx-fontColorText\",\n image: \"wb-lx-image\",\n indent: \"wb-lx-indent\",\n inlineImage: \"wb-lx-inline-image\"\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,yBAAyB,GAAGA,CAAA,KAA0B;EAC/D,OAAO;IACHC,cAAc,EAAE,sBAAsB;IACtCC,IAAI,EAAE,YAAY;IAClBC,aAAa,EAAE;MACXC,MAAM,EAAE,iBAAiB;MACzBC,IAAI,EAAE,iBAAiB;MACvBC,OAAO,EAAE,qBAAqB;MAC9BC,OAAO,EAAE,qBAAqB;MAC9BC,KAAK,EAAE,oBAAoB;MAC3BC,IAAI,EAAE,qBAAqB;MAC3BC,KAAK,EAAE,qBAAqB;MAC5B,YAAY,EAAE,qBAAqB;MACnCC,OAAO,EAAE,oBAAoB;MAC7BC,QAAQ,EAAE,qBAAqB;MAC/BC,OAAO,EAAE,qBAAqB;MAC9BC,OAAO,EAAE,oBAAoB;MAC7BC,MAAM,EAAE,qBAAqB;MAC7BC,QAAQ,EAAE,qBAAqB;MAC/BC,SAAS,EAAE,qBAAqB;MAChCC,QAAQ,EAAE,qBAAqB;MAC/BC,OAAO,EAAE,iBAAiB;MAC1BC,SAAS,EAAE,qBAAqB;MAChCC,MAAM,EAAE,qBAAqB;MAC7BC,QAAQ,EAAE,qBAAqB;MAC/BC,MAAM,EAAE,oBAAoB;MAC5BC,QAAQ,EAAE,qBAAqB;MAC/BC,WAAW,EAAE,wBAAwB;MACrCC,KAAK,EAAE,qBAAqB;MAC5BC,QAAQ,EAAE,qBAAqB;MAC/BC,MAAM,EAAE,qBAAqB;MAC7BC,MAAM,EAAE,qBAAqB;MAC7BC,GAAG,EAAE,qBAAqB;MAC1BC,GAAG,EAAE,qBAAqB;MAC1BC,QAAQ,EAAE;IACd,CAAC;IACDC,UAAU,EAAE;MACRC,IAAI,EAAE,kBAAkB;MACxBC,KAAK,EAAE;IACX,CAAC;IACDC,OAAO,EAAE,eAAe;IACxBC,OAAO,EAAE;MACLC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE;IACR,CAAC;IACDC,IAAI,EAAE,YAAY;IAClBC,IAAI,EAAE;MACFC,QAAQ,EAAE,gBAAgB;MAC1BC,eAAe,EAAE,uBAAuB;MACxCC,iBAAiB,EAAE,yBAAyB;MAC5CC,MAAM,EAAE;QACJH,QAAQ,EAAE;MACd,CAAC;MACDI,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC;MAC1EC,EAAE,EAAE;IACR,CAAC;IACDC,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAE,YAAY;IAClBC,WAAW,EAAE,mBAAmB;IAChCC,SAAS,EAAE,iBAAiB;IAC5BC,KAAK,EAAE,aAAa;IACpBC,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAE;MACFC,IAAI,EAAE,gBAAgB;MACtBzD,IAAI,EAAE,gBAAgB;MACtB0D,MAAM,EAAE,kBAAkB;MAC1BC,aAAa,EAAE,yBAAyB;MACxCC,SAAS,EAAE,qBAAqB;MAChCC,WAAW,EAAE,uBAAuB;MACpCC,SAAS,EAAE,qBAAqB;MAChCC,sBAAsB,EAAE;IAC5B,CAAC;IACDC,aAAa,EAAE,qBAAqB;IACpCC,KAAK,EAAE,aAAa;IACpBC,MAAM,EAAE,cAAc;IACtBC,WAAW,EAAE;EACjB,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createDefaultLexicalTheme } from "./createDefaultLexicalTheme.js";
|
|
2
|
-
import { deepMerge } from "./deepMerge.js";
|
|
3
|
-
export const createLexicalTheme = (theme = {}) => {
|
|
4
|
-
return deepMerge(createDefaultLexicalTheme(), theme);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=createLexicalTheme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createDefaultLexicalTheme","deepMerge","createLexicalTheme","theme"],"sources":["createLexicalTheme.ts"],"sourcesContent":["import type { LexicalEditorTheme } from \"~/types/LexicalEditorTheme.js\";\nimport { createDefaultLexicalTheme } from \"./createDefaultLexicalTheme.js\";\nimport { deepMerge } from \"./deepMerge.js\";\n\nexport const createLexicalTheme = (theme: LexicalEditorTheme = {}): LexicalEditorTheme => {\n return deepMerge(createDefaultLexicalTheme(), theme);\n};\n"],"mappings":"AACA,SAASA,yBAAyB;AAClC,SAASC,SAAS;AAElB,OAAO,MAAMC,kBAAkB,GAAGA,CAACC,KAAyB,GAAG,CAAC,CAAC,KAAyB;EACtF,OAAOF,SAAS,CAACD,yBAAyB,CAAC,CAAC,EAAEG,KAAK,CAAC;AACxD,CAAC","ignoreList":[]}
|
package/lexical/deepMerge.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
package/lexical/deepMerge.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
function isObject(value) {
|
|
2
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
3
|
-
}
|
|
4
|
-
function mergeObjects(target, source) {
|
|
5
|
-
const output = {
|
|
6
|
-
...target
|
|
7
|
-
};
|
|
8
|
-
for (const key in source) {
|
|
9
|
-
const sourceValue = source[key];
|
|
10
|
-
const targetValue = target[key];
|
|
11
|
-
if (isObject(sourceValue) && isObject(targetValue)) {
|
|
12
|
-
output[key] = mergeObjects(targetValue, sourceValue);
|
|
13
|
-
} else {
|
|
14
|
-
output[key] = sourceValue;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return output;
|
|
18
|
-
}
|
|
19
|
-
export function deepMerge(target, source) {
|
|
20
|
-
return mergeObjects(target, source);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=deepMerge.js.map
|
package/lexical/deepMerge.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isObject","value","Array","isArray","mergeObjects","target","source","output","key","sourceValue","targetValue","deepMerge"],"sources":["deepMerge.ts"],"sourcesContent":["function isObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction mergeObjects(\n target: Record<string, unknown>,\n source: Record<string, unknown>\n): Record<string, unknown> {\n const output: Record<string, unknown> = { ...target };\n\n for (const key in source) {\n const sourceValue = source[key];\n const targetValue = target[key];\n\n if (isObject(sourceValue) && isObject(targetValue)) {\n output[key] = mergeObjects(targetValue, sourceValue);\n } else {\n output[key] = sourceValue;\n }\n }\n\n return output;\n}\n\nexport function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T {\n return mergeObjects(target, source as Record<string, unknown>) as T;\n}\n"],"mappings":"AAAA,SAASA,QAAQA,CAACC,KAAc,EAAoC;EAChE,OAAOA,KAAK,KAAK,IAAI,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAC/E;AAEA,SAASG,YAAYA,CACjBC,MAA+B,EAC/BC,MAA+B,EACR;EACvB,MAAMC,MAA+B,GAAG;IAAE,GAAGF;EAAO,CAAC;EAErD,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACtB,MAAMG,WAAW,GAAGH,MAAM,CAACE,GAAG,CAAC;IAC/B,MAAME,WAAW,GAAGL,MAAM,CAACG,GAAG,CAAC;IAE/B,IAAIR,QAAQ,CAACS,WAAW,CAAC,IAAIT,QAAQ,CAACU,WAAW,CAAC,EAAE;MAChDH,MAAM,CAACC,GAAG,CAAC,GAAGJ,YAAY,CAACM,WAAW,EAAED,WAAW,CAAC;IACxD,CAAC,MAAM;MACHF,MAAM,CAACC,GAAG,CAAC,GAAGC,WAAW;IAC7B;EACJ;EAEA,OAAOF,MAAM;AACjB;AAEA,OAAO,SAASI,SAASA,CAAoCN,MAAS,EAAEC,MAAkB,EAAK;EAC3F,OAAOF,YAAY,CAACC,MAAM,EAAEC,MAAiC,CAAC;AAClE","ignoreList":[]}
|
package/messenger/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./MessageOrigin.js\";\nexport * from \"./Messenger.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["LexicalEditorTheme.ts"],"sourcesContent":["import type { EditorThemeClasses } from \"lexical\";\n\nexport type LexicalEditorTheme = EditorThemeClasses;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["ShorthandCssProperties.ts"],"sourcesContent":["export type ShorthandCssProperties =\n | \"margin\"\n | \"padding\"\n | \"border\"\n | \"borderWidth\"\n | \"borderStyle\"\n | \"borderColor\"\n | \"borderRadius\"\n | \"outline\"\n | \"outlineOffset\"\n | \"inset\"\n | \"background\"\n | \"borderBlock\"\n | \"borderBlockColor\"\n | \"borderBlockStyle\"\n | \"borderBlockWidth\"\n | \"borderInline\"\n | \"borderInlineColor\"\n | \"borderInlineStyle\"\n | \"borderInlineWidth\"\n | \"borderStartEndRadius\"\n | \"borderStartStartRadius\"\n | \"borderEndEndRadius\"\n | \"borderEndStartRadius\"\n | \"font\"\n | \"fontVariant\"\n | \"textDecoration\"\n | \"textEmphasis\"\n | \"textEmphasisStyle\"\n | \"textEmphasisColor\"\n | \"flex\"\n | \"flexFlow\"\n | \"gap\"\n | \"placeContent\"\n | \"placeItems\"\n | \"placeSelf\"\n | \"grid\"\n | \"listStyle\"\n | \"marker\"\n | \"columns\"\n | \"columnRule\"\n | \"animation\"\n | \"transition\"\n | \"boxShadow\"\n | \"textShadow\"\n | \"scrollMargin\"\n | \"scrollPadding\"\n | \"size\"\n | \"aspectRatio\";\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["WebsiteBuilderTheme.ts"],"sourcesContent":["import type { LexicalEditorTheme } from \"./LexicalEditorTheme.js\";\n\nexport type Breakpoint = {\n name: string;\n title: string;\n description: string;\n icon: string;\n minWidth: number;\n maxWidth: number;\n};\n\nexport type WebsiteBuilderTheme = {\n css?: string;\n cssVariables?: Record<string, string>;\n fonts?: string[];\n breakpoints: Breakpoint[];\n styles: {\n colors: Record<string, any>;\n typography: Typography;\n };\n lexical: LexicalEditorTheme;\n};\ntype KnownKeys = \"desktop\" | \"tablet\" | \"mobile\";\n\ntype BreakpointBase = Omit<Breakpoint, \"name\">;\n\ntype KnownBreakpoints = Partial<Record<KnownKeys, Partial<BreakpointBase>>>;\n\n// This merges both, while avoiding overlap issues\ntype Breakpoints = KnownBreakpoints & {\n custom?: {\n [K in string as K extends KnownKeys ? never : K]: BreakpointBase;\n };\n};\n\n// We want to allow custom strings as well, thus the (string & {}).\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type TypographyType = \"headings\" | \"paragraphs\" | \"quotes\" | \"lists\" | (string & {});\n\nexport type TypographyStyle = {\n id: string;\n name: string;\n tag: string;\n className: string;\n};\n\nexport type Typography = Partial<Record<TypographyType, TypographyStyle[]>>;\n\nexport type WebsiteBuilderThemeInput = {\n /**\n * CSS to include in the editor.\n */\n css?: string;\n /**\n * CSS variables to define in the editor.\n */\n cssVariables?: Record<string, string>;\n /**\n * Fonts to load when the editor loads.\n */\n fonts?: string[];\n /**\n * {\n * title: \"Desktop\",\n * description: `Desktop styles apply at all breakpoints, unless they're edited at a lower breakpoint. Start your styling here.`,\n * icon: \"Inline SVG or a link to an SVG.\",\n * minWidth: 0,\n * maxWidth: 4000\n * }\n */\n breakpoints?: Breakpoints;\n lexical?: LexicalEditorTheme;\n styles?: {\n /**\n * color1: \"#fa5723\",\n * color2: \"#00ccb0\",\n */\n colors?: Record<string, any>;\n /**\n * headings: [\n * {\n * id: \"heading1\",\n * name: \"Heading 1\",\n * tag: \"h1\"\n * },\n * ],\n * paragraphs: [\n * {\n * id: \"paragraph1\",\n * name: \"Paragraph 1\",\n * tag: \"p\",\n * ],\n * quotes: [\n * {\n * id: \"quote\",\n * name: \"Quote\",\n * tag: \"blockquote\"\n * }\n * ]\n */\n typography?: Typography;\n };\n};\n"],"mappings":"","ignoreList":[]}
|