@rulecms/widget-svelte 0.1.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 +107 -0
- package/dist/index.cjs +18 -0
- package/dist/index.d.ts +1323 -0
- package/dist/index.js +4337 -0
- package/package.json +70 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1323 @@
|
|
|
1
|
+
import { Component } from 'svelte';
|
|
2
|
+
import { SvelteComponent } from 'svelte';
|
|
3
|
+
|
|
4
|
+
/** Column flex layout — matches row Align Content options. */
|
|
5
|
+
export declare const alignContentAllowlist: readonly ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly", "stretch"];
|
|
6
|
+
|
|
7
|
+
export declare const AlignContentTypes: {
|
|
8
|
+
FlexStart: AlignContentValues;
|
|
9
|
+
FlexEnd: AlignContentValues;
|
|
10
|
+
Center: AlignContentValues;
|
|
11
|
+
SpaceBetween: AlignContentValues;
|
|
12
|
+
SpaceAround: AlignContentValues;
|
|
13
|
+
SpaceEvenly: AlignContentValues;
|
|
14
|
+
Stretch: AlignContentValues;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export declare type AlignContentValues = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch';
|
|
18
|
+
|
|
19
|
+
/** Column flex layout — matches row Vertical Alignment options. */
|
|
20
|
+
export declare const alignItemsAllowlist: readonly ["flex-start", "flex-end", "center", "baseline", "stretch"];
|
|
21
|
+
|
|
22
|
+
export declare type AlignItemsValues = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
|
|
23
|
+
|
|
24
|
+
export declare type AttributeEditModeConfig = {
|
|
25
|
+
name: string;
|
|
26
|
+
heading?: string;
|
|
27
|
+
subHeading?: string;
|
|
28
|
+
defaultValues?: DeviceTypeBasedAttributeValues;
|
|
29
|
+
hiddenToUser?: boolean;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export declare type AttributeListForComponentTypes = {
|
|
33
|
+
[key: string]: string[];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Stored background image leaf.
|
|
38
|
+
*
|
|
39
|
+
* `cloudinary` is what the composer's media picker writes — a public id, the
|
|
40
|
+
* same thing every other image attribute stores, so the asset stays resolvable
|
|
41
|
+
* if delivery URLs ever change. `url` covers an image hosted elsewhere. `none`
|
|
42
|
+
* explicitly clears a background that a component default supplied, which an
|
|
43
|
+
* absent attribute cannot express.
|
|
44
|
+
*/
|
|
45
|
+
export declare type BackgroundImageLiteralValue = {
|
|
46
|
+
source: 'cloudinary';
|
|
47
|
+
publicId: string;
|
|
48
|
+
cloudName?: string;
|
|
49
|
+
transformations?: string;
|
|
50
|
+
} | {
|
|
51
|
+
source: 'url';
|
|
52
|
+
url: string;
|
|
53
|
+
} | {
|
|
54
|
+
source: 'none';
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export declare type BackgroundImageValue = (BackgroundImageLiteralValue & CssVariableCarrier) | CssVariableValue;
|
|
58
|
+
|
|
59
|
+
export declare const backgroundPositionAllowlist: readonly ["center center", "center top", "center bottom", "left center", "left top", "left bottom", "right center", "right top", "right bottom"];
|
|
60
|
+
|
|
61
|
+
export declare const backgroundRepeatAllowlist: readonly ["no-repeat", "repeat", "repeat-x", "repeat-y", "space", "round"];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Background painting, set alongside background-image. Keyword-only: a
|
|
65
|
+
* background without `cover`/`center` usually reads as broken, and these are the
|
|
66
|
+
* choices that fix it. Lengths and percentages are deliberately out of scope so
|
|
67
|
+
* the editor stays a picker.
|
|
68
|
+
*/
|
|
69
|
+
export declare const backgroundSizeAllowlist: readonly ["cover", "contain", "auto"];
|
|
70
|
+
|
|
71
|
+
export declare type BorderStyleKeyword = 'none' | 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset';
|
|
72
|
+
|
|
73
|
+
export declare const borderStyleKeywords: BorderStyleKeyword[];
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Uniform border leaf. Emit longhands only (borderWidth/Style/Color) — never
|
|
77
|
+
* the `border` shorthand — so React does not warn when styles are merged
|
|
78
|
+
* (see rulecms PATTERN_CSS_BORDER_STYLE_PROPERTIES.md). The one exception is a
|
|
79
|
+
* leaf-level `cssVariable`: design systems ship whole-border tokens like
|
|
80
|
+
* `--border-hairline: 1px solid #ddd`, which cannot be split into longhands, so
|
|
81
|
+
* that case emits the `border` shorthand and nothing else.
|
|
82
|
+
*/
|
|
83
|
+
export declare type BorderValue = {
|
|
84
|
+
width?: SpacingSideValue;
|
|
85
|
+
style?: BorderStyleKeyword | CssVariableValue;
|
|
86
|
+
color?: CssColorValue;
|
|
87
|
+
cssVariable?: CssVariableName;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* One box-shadow leaf. Missing lengths render as 0px so a partially filled
|
|
92
|
+
* value still produces a shadow. `inset` flips the shadow inside the box. A
|
|
93
|
+
* leaf-level `cssVariable` names a whole-shadow design token (the usual way
|
|
94
|
+
* shadows are tokenised) and wins over every part.
|
|
95
|
+
*/
|
|
96
|
+
export declare type BoxShadowValue = {
|
|
97
|
+
offsetX?: SpacingSideValue;
|
|
98
|
+
offsetY?: SpacingSideValue;
|
|
99
|
+
blur?: SpacingSideValue;
|
|
100
|
+
spread?: SpacingSideValue;
|
|
101
|
+
color?: CssColorValue;
|
|
102
|
+
inset?: boolean;
|
|
103
|
+
cssVariable?: CssVariableName;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export declare const boxSpacingSideKeys: readonly ["allSides", "top", "right", "bottom", "left"];
|
|
107
|
+
|
|
108
|
+
export declare const boxSpacingStyleAttributeEntries: {
|
|
109
|
+
[attributeName: string]: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export declare type BoxSpacingValue = {
|
|
113
|
+
allSides?: SpacingSideValue;
|
|
114
|
+
top?: SpacingSideValue;
|
|
115
|
+
right?: SpacingSideValue;
|
|
116
|
+
bottom?: SpacingSideValue;
|
|
117
|
+
left?: SpacingSideValue;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export declare const buildCloudinaryBackgroundUrl: ({ publicId, cloudName, transformations, width, }: {
|
|
121
|
+
publicId: string;
|
|
122
|
+
cloudName?: string;
|
|
123
|
+
transformations?: CloudinaryTransformations | string;
|
|
124
|
+
width?: number;
|
|
125
|
+
}) => string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Builds the widget fetch URL. Development tokens (`dev.…`) hit the uncached
|
|
129
|
+
* draft endpoint with `widgetKey`; everything else uses the published API.
|
|
130
|
+
*/
|
|
131
|
+
export declare function buildWidgetFetchUrl({ publishedKey, token, endpoint, }: BuildWidgetFetchUrlParams): string;
|
|
132
|
+
|
|
133
|
+
export declare interface BuildWidgetFetchUrlParams {
|
|
134
|
+
/**
|
|
135
|
+
* For published mode this is the published key (`envId---widget-...`).
|
|
136
|
+
* For Development (`dev.` token) this is the live widget key (`widget-...`).
|
|
137
|
+
*/
|
|
138
|
+
publishedKey: string;
|
|
139
|
+
token: string;
|
|
140
|
+
/** Optional override. Defaults by token: rulecms.com (dev) or widget-cache (published). */
|
|
141
|
+
endpoint?: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export declare interface ChildCollection {
|
|
145
|
+
publishedKey: string;
|
|
146
|
+
name: string;
|
|
147
|
+
version: string;
|
|
148
|
+
environmentName: string;
|
|
149
|
+
itemList: string;
|
|
150
|
+
tagName?: string;
|
|
151
|
+
tagDescription?: string;
|
|
152
|
+
lastPublishedAt: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* A Cloudinary transformation component as an object, e.g.
|
|
157
|
+
* `{ c: 'fill', g: 'auto' }` serializes to `c_fill,g_auto`.
|
|
158
|
+
*/
|
|
159
|
+
export declare type CloudinaryTransformations = {
|
|
160
|
+
[key: string]: string | number;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Every component instance in a config, as the `/`-joined column-id path that
|
|
165
|
+
* `componentProps` keys are matched against. Collections contribute their
|
|
166
|
+
* holding column to the path rather than a path of their own.
|
|
167
|
+
*
|
|
168
|
+
* Only used to tell a host that a key it supplied addresses nothing; the
|
|
169
|
+
* render path resolves props directly and never needs this list.
|
|
170
|
+
*/
|
|
171
|
+
export declare function collectComponentInstancePaths({ displayItemList, widgetCollections, }: {
|
|
172
|
+
displayItemList: Items | undefined;
|
|
173
|
+
widgetCollections: {
|
|
174
|
+
[key: string]: WidgetCollection;
|
|
175
|
+
} | undefined;
|
|
176
|
+
}): string[];
|
|
177
|
+
|
|
178
|
+
export declare const COLLECTION_TYPE_PREFIX: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Scans a widget config (display item list + all collections, including
|
|
182
|
+
* embedded ones) and returns the set of library ids it references.
|
|
183
|
+
*
|
|
184
|
+
* CRITICAL scaling property: resolution is config-scoped — only the libraries
|
|
185
|
+
* returned here are ever loaded, never the consumer's whole registration map.
|
|
186
|
+
*
|
|
187
|
+
* Prefixed types (collections / drag items) are not components and never
|
|
188
|
+
* contribute a library reference; a component column with no libraryId (or
|
|
189
|
+
* the reserved "default" id) references the default library.
|
|
190
|
+
*/
|
|
191
|
+
export declare function collectReferencedLibraryIds({ displayItemList, widgetCollections, }: {
|
|
192
|
+
displayItemList: Items | undefined;
|
|
193
|
+
widgetCollections: {
|
|
194
|
+
[key: string]: WidgetCollection;
|
|
195
|
+
} | undefined;
|
|
196
|
+
}): ReferencedLibraries;
|
|
197
|
+
|
|
198
|
+
export declare const COMPONENT_PROPS_PATH_SEPARATOR = "/";
|
|
199
|
+
|
|
200
|
+
export declare interface ComponentLibraryEditorSurface {
|
|
201
|
+
previewComponents: Record<string, EditorPreviewEntry>;
|
|
202
|
+
previewCardGroups: LibraryCardGroup[];
|
|
203
|
+
componentMetadata: ComponentMetadataForEditing;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export declare interface ComponentLibraryManifest {
|
|
207
|
+
id: string;
|
|
208
|
+
version: string;
|
|
209
|
+
/**
|
|
210
|
+
* The Svelte version range the library was built against. Libraries MUST
|
|
211
|
+
* externalize `svelte` (peer dependency).
|
|
212
|
+
*/
|
|
213
|
+
sveltePeerRange: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export declare interface ComponentLibraryModule {
|
|
217
|
+
manifest: ComponentLibraryManifest;
|
|
218
|
+
components: Record<string, LibraryComponentEntry>;
|
|
219
|
+
editor?: ComponentLibraryEditorSurface;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare type ComponentLibraryModuleResolvable = ComponentLibraryModule | {
|
|
223
|
+
default: ComponentLibraryModule;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export declare interface ComponentLibraryRegistry {
|
|
227
|
+
resolveSync(params: ResolveLibrariesParams): SourceComponentsPlugin | null;
|
|
228
|
+
resolve(params: ResolveLibrariesParams): Promise<SourceComponentsPlugin>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare type ComponentMetadata = {
|
|
232
|
+
defaultAttributeValues: DefaultAttributeValue[];
|
|
233
|
+
attributeEditModeConfigs: AttributeEditModeConfig[];
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export declare type ComponentMetadataForEditing = {
|
|
237
|
+
attributeListForComponentTypes: AttributeListForComponentTypes;
|
|
238
|
+
componentNameToModifyAttribute: ComponentNameToModifyAttribute;
|
|
239
|
+
componentMetadata: Record<string, ComponentMetadata>;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export declare type ComponentNameToModifyAttribute = {
|
|
243
|
+
[key: string]: string;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Host-supplied per-instance props, keyed by the column id of the component
|
|
248
|
+
* instance they are meant for. Column ids are the UUIDs persisted in the
|
|
249
|
+
* widget config; the composer's Modify drawer shows the selected one.
|
|
250
|
+
*
|
|
251
|
+
* A key may be a single column id or a `/`-separated path of column ids
|
|
252
|
+
* ending at the target, where the leading segments are the columns holding
|
|
253
|
+
* the enclosing collections:
|
|
254
|
+
*
|
|
255
|
+
* ```ts
|
|
256
|
+
* {
|
|
257
|
+
* 'b721c4e2-…': { onClick: handleCta }, // any column with this id
|
|
258
|
+
* 'a3f9d180-…/b721c4e2-…': { onClick: handleCta }, // …only inside that collection column
|
|
259
|
+
* }
|
|
260
|
+
* ```
|
|
261
|
+
*
|
|
262
|
+
* A key matches when its segments are the tail of the instance's own path, so
|
|
263
|
+
* a bare column id applies to every copy of a collection embedded more than
|
|
264
|
+
* once, and adding parent segments narrows it. When several keys match, the
|
|
265
|
+
* one with the most segments wins.
|
|
266
|
+
*/
|
|
267
|
+
export declare type ComponentPropsMap = {
|
|
268
|
+
[key: string]: WidgetInstanceProps;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Composes loaded library modules into the single plugin the render pipeline
|
|
273
|
+
* consumes. Default library entries keep bare keys; all other libraries are
|
|
274
|
+
* namespaced "libraryId/type" (see resolve-key.ts).
|
|
275
|
+
*/
|
|
276
|
+
export declare function composeSourceComponentsPlugin(modules: Map<string, ComponentLibraryModule>): SourceComponentsPlugin;
|
|
277
|
+
|
|
278
|
+
export declare type ConfigLibrariesMap = Record<string, ConfigLibraryDescriptor>;
|
|
279
|
+
|
|
280
|
+
export declare type ConfigLibraryDescriptor = {
|
|
281
|
+
version: string;
|
|
282
|
+
trust?: 'trusted' | 'untrusted';
|
|
283
|
+
url?: string;
|
|
284
|
+
integrity?: string;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Creates a per-provider/per-widget registry instance.
|
|
289
|
+
*
|
|
290
|
+
* Cache semantics: loads are keyed by libraryId for the instance's lifetime —
|
|
291
|
+
* the first successful load wins, so re-renders with structurally identical
|
|
292
|
+
* inline registration maps perform zero new loads (registration thunks are
|
|
293
|
+
* invoked at most once per id per instance).
|
|
294
|
+
*/
|
|
295
|
+
export declare function createComponentLibraryRegistry(): ComponentLibraryRegistry;
|
|
296
|
+
|
|
297
|
+
export declare const CSS_CLASSES_ATTRIBUTE_NAME = "css-classes-3-resolutions";
|
|
298
|
+
|
|
299
|
+
export declare const CSS_VARIABLE_NAME_MAX_LENGTH = 200;
|
|
300
|
+
|
|
301
|
+
export declare const CSS_VARIABLE_NAME_PATTERN: RegExp;
|
|
302
|
+
|
|
303
|
+
export declare const cssAttrArrayKey = "cssAttrArray";
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Stored color leaf for style attributes. Prefer structured keywords so the
|
|
307
|
+
* editor can pick them; allow a validated CSS color string for hex/rgb/hsl, or
|
|
308
|
+
* a design token from the embedding application.
|
|
309
|
+
*/
|
|
310
|
+
export declare type CssColorLiteralValue = {
|
|
311
|
+
unit: 'keyword';
|
|
312
|
+
keyword: SpacingKeyword | 'transparent' | 'currentColor';
|
|
313
|
+
} | {
|
|
314
|
+
unit: 'color';
|
|
315
|
+
value: string;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
export declare type CssColorValue = (CssColorLiteralValue & CssVariableCarrier) | CssVariableValue;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Enum-style leaf: a value from the attribute's allowlist, a CSS-wide keyword,
|
|
322
|
+
* or a design token from the embedding application. Allowlist values stay plain
|
|
323
|
+
* strings for picker-friendly editors; a token has no string form to share with
|
|
324
|
+
* them, so it arrives as `{ cssVariable }`.
|
|
325
|
+
*/
|
|
326
|
+
export declare type CssEnumValue = string | CssVariableValue;
|
|
327
|
+
|
|
328
|
+
/** Mix-in for leaves that also carry a literal value. */
|
|
329
|
+
export declare type CssVariableCarrier = {
|
|
330
|
+
cssVariable?: CssVariableName;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
/** A bare custom property name, e.g. `--brand-space-md`. */
|
|
334
|
+
export declare type CssVariableName = string;
|
|
335
|
+
|
|
336
|
+
/** Leaf that is only a token — nothing literal has been entered yet. */
|
|
337
|
+
export declare type CssVariableValue = {
|
|
338
|
+
cssVariable: CssVariableName;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
/** The cloud that hosts both team uploads and the shared RuleCMS library. */
|
|
342
|
+
export declare const DEFAULT_CLOUDINARY_CLOUD_NAME = "rulecms";
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* The reserved id for the default component library. Configs that carry no
|
|
346
|
+
* libraryId on a component resolve to it, preserving backward compatibility.
|
|
347
|
+
*/
|
|
348
|
+
export declare const DEFAULT_LIBRARY_ID = "default";
|
|
349
|
+
|
|
350
|
+
export declare const DEFAULT_ROW_GAP = "var(--sl-spacing-x-small)";
|
|
351
|
+
|
|
352
|
+
export declare type DefaultAttributeValue = {
|
|
353
|
+
name: string;
|
|
354
|
+
defaultValues: DeviceTypeBasedAttributeValues;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export declare const defaultPageWidth = "1200px";
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* When a column has any flex-layout style (justify-content, align-items,
|
|
361
|
+
* flex-wrap, align-content, flex-direction), ensure `display: flex` so those
|
|
362
|
+
* properties take effect. Gap alone does not force flex.
|
|
363
|
+
*
|
|
364
|
+
* Pure / non-mutating: returns a new object when display is added.
|
|
365
|
+
*/
|
|
366
|
+
export declare const deriveDisplayFlexIfNeeded: (styles: {
|
|
367
|
+
[key: string]: unknown;
|
|
368
|
+
} | undefined) => {
|
|
369
|
+
[key: string]: unknown;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
export declare const desktopModeWidth = "1200px";
|
|
373
|
+
|
|
374
|
+
/** Prefix on RulesCMS client tokens for Development / non-publishable environments. */
|
|
375
|
+
export declare const DEV_CLIENT_TOKEN_PREFIX = "dev.";
|
|
376
|
+
|
|
377
|
+
/** Live draft client API path — no cache; reads the widget table directly. */
|
|
378
|
+
export declare const DEV_WIDGET_API_PATH = "/api/v1/c/dev/widget/get";
|
|
379
|
+
|
|
380
|
+
export declare type DeviceDisplayType = 'phone' | 'tablet' | 'desktop';
|
|
381
|
+
|
|
382
|
+
export declare const DeviceDisplayTypes: {
|
|
383
|
+
Phone: DeviceDisplayType;
|
|
384
|
+
Tablet: DeviceDisplayType;
|
|
385
|
+
Desktop: DeviceDisplayType;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Contract types for RuleCMS component libraries.
|
|
390
|
+
*
|
|
391
|
+
* `@rulecms/widget-svelte` OWNS this contract; every component library
|
|
392
|
+
* (including `@rulecms/source-components-svelte`, the default library)
|
|
393
|
+
* conforms to it — structurally, with no dependency on this package.
|
|
394
|
+
*
|
|
395
|
+
* CRITICAL: widget-svelte must never import a concrete component library.
|
|
396
|
+
* Libraries are registered by the consumer application (see
|
|
397
|
+
* `LibraryRegistrationMap`).
|
|
398
|
+
*/
|
|
399
|
+
export declare type DeviceTypeBasedAttributeValues = {
|
|
400
|
+
phone?: any;
|
|
401
|
+
tablet?: any;
|
|
402
|
+
desktop?: any;
|
|
403
|
+
all?: any;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
export declare type DisplayItemColumn = {
|
|
407
|
+
id: string;
|
|
408
|
+
type: DisplayItemType;
|
|
409
|
+
/**
|
|
410
|
+
* The component library providing this component's type. Absent (or
|
|
411
|
+
* "default") resolves to the default library — existing configs unchanged.
|
|
412
|
+
* Never set for collection types.
|
|
413
|
+
*/
|
|
414
|
+
libraryId?: string;
|
|
415
|
+
/**
|
|
416
|
+
* Per-column attribute values as persisted in published payloads written
|
|
417
|
+
* after the persisted-key migration. Readers must check this key first
|
|
418
|
+
* (see getColumnAttributes).
|
|
419
|
+
*/
|
|
420
|
+
componentAttributes?: {
|
|
421
|
+
[key: string]: any;
|
|
422
|
+
};
|
|
423
|
+
/** @deprecated Legacy persisted field name. Newer payloads use componentAttributes; readers must check componentAttributes first. */
|
|
424
|
+
widgetAttributes?: {
|
|
425
|
+
[key: string]: any;
|
|
426
|
+
};
|
|
427
|
+
collection?: WidgetCollection;
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
export declare type DisplayItemRow = {
|
|
431
|
+
id: string;
|
|
432
|
+
horizontalAlignment?: JustifyContentValues;
|
|
433
|
+
verticalAlignment?: AlignItemsValues;
|
|
434
|
+
/** CSS gap between columns. When unset, the renderer keeps its default spacing. */
|
|
435
|
+
gap?: string;
|
|
436
|
+
/**
|
|
437
|
+
* How wrapped lines of columns pack along the cross axis. Only visible when
|
|
438
|
+
* flex-wrap is on and the row has more than one line (often also needs a
|
|
439
|
+
* taller row than its content).
|
|
440
|
+
*/
|
|
441
|
+
alignContent?: AlignContentValues;
|
|
442
|
+
columns: DisplayItemColumn[];
|
|
443
|
+
flexWrap?: 'wrap' | 'nowrap';
|
|
444
|
+
/**
|
|
445
|
+
* Per-row style/layout attributes (same `*-3-resolutions` shape as column
|
|
446
|
+
* `componentAttributes`). Preferred over the legacy first-class layout
|
|
447
|
+
* fields above when both are present; see resolveRowStyles.
|
|
448
|
+
*/
|
|
449
|
+
rowAttributes?: {
|
|
450
|
+
[key: string]: any;
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
export declare type DisplayItemType = 'droppable-box' | string;
|
|
455
|
+
|
|
456
|
+
export declare const DisplayItemTypes: {
|
|
457
|
+
DroppableBox: DisplayItemType;
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
export declare type DragItemAndPrefix = {
|
|
461
|
+
prefix: DragItemIdPrefixes;
|
|
462
|
+
id: string;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
export declare type DragItemIdPrefixes = 'ComposerWidget' | 'Collection' | 'MoveWidgetHandle';
|
|
466
|
+
|
|
467
|
+
export declare const DragItemIdPrefixTypes: {
|
|
468
|
+
ComposerComponent: DragItemIdPrefixes;
|
|
469
|
+
Collection: DragItemIdPrefixes;
|
|
470
|
+
MoveComponentHandle: DragItemIdPrefixes;
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
export declare type EditorPreviewEntry = {
|
|
474
|
+
id: string;
|
|
475
|
+
/** Compact glyph for the palette card: an emoji or short text label. */
|
|
476
|
+
icon: string;
|
|
477
|
+
label: string;
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
declare interface EditPlugin {
|
|
481
|
+
RenderDroppableBox: unknown;
|
|
482
|
+
ComponentWrapperForComposableMode: unknown;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Character used to separate embedded published key from its parent
|
|
487
|
+
*/
|
|
488
|
+
export declare const EMBEDDED_KEY_SEPARATOR = "___";
|
|
489
|
+
|
|
490
|
+
/** Fetch widget JSON on the server (or at build time) and return render-ready data. */
|
|
491
|
+
export declare function fetchRuleCMSWidget(params: FetchRuleCMSWidgetParams): Promise<RuleCMSWidgetData>;
|
|
492
|
+
|
|
493
|
+
export declare class FetchRuleCMSWidgetError extends Error {
|
|
494
|
+
readonly status?: number;
|
|
495
|
+
constructor(message: string, status?: number);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export declare interface FetchRuleCMSWidgetParams {
|
|
499
|
+
/**
|
|
500
|
+
* Published key for staging/production tokens, or the live widget key when
|
|
501
|
+
* using a `dev.`-prefixed Development token.
|
|
502
|
+
*/
|
|
503
|
+
publishedKey: string;
|
|
504
|
+
token: string;
|
|
505
|
+
/**
|
|
506
|
+
* Optional API origin override. Omit in apps — defaults to rulecms.com for
|
|
507
|
+
* `dev.` tokens and widget-cache for published tokens.
|
|
508
|
+
*/
|
|
509
|
+
endpoint?: string;
|
|
510
|
+
fetchOptions?: RequestInit;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Names the `componentProps` keys that address no component in this config.
|
|
515
|
+
*
|
|
516
|
+
* A key that matches nothing is silent at render time — the props are simply
|
|
517
|
+
* never handed to anything — and the usual causes are a typo, a column that
|
|
518
|
+
* was deleted and re-added with a fresh id, or a path whose parent segment is
|
|
519
|
+
* wrong. Returns the offending keys so the caller decides how to report them.
|
|
520
|
+
*/
|
|
521
|
+
export declare function findUnmatchedComponentPropsKeys({ componentProps, displayItemList, widgetCollections, }: {
|
|
522
|
+
componentProps: ComponentPropsMap | undefined;
|
|
523
|
+
displayItemList: Items | undefined;
|
|
524
|
+
widgetCollections: {
|
|
525
|
+
[key: string]: WidgetCollection;
|
|
526
|
+
} | undefined;
|
|
527
|
+
}): string[];
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Style keys that, when present on the flattened column styles, cause
|
|
531
|
+
* `display: flex` to be derived at render time. Gap alone is intentionally
|
|
532
|
+
* excluded — it does not force flex.
|
|
533
|
+
*/
|
|
534
|
+
export declare const FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY: readonly ["justifyContent", "alignItems", "flexWrap", "alignContent", "flexDirection"];
|
|
535
|
+
|
|
536
|
+
export declare const flexDirectionAllowlist: readonly ["row", "row-reverse", "column", "column-reverse"];
|
|
537
|
+
|
|
538
|
+
export declare const flexWrapAllowlist: readonly ["wrap", "nowrap"];
|
|
539
|
+
|
|
540
|
+
export declare const fontFamilyAllowlist: readonly ["system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif", "Georgia, \"Times New Roman\", Times, serif", "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", "Arial, Helvetica, sans-serif", "\"Helvetica Neue\", Helvetica, Arial, sans-serif", "Verdana, Geneva, sans-serif"];
|
|
541
|
+
|
|
542
|
+
export declare const fontStyleAllowlist: readonly ["normal", "italic", "oblique"];
|
|
543
|
+
|
|
544
|
+
export declare const fontWeightAllowlist: readonly ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"];
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* One validated background image leaf into a `backgroundImage` style entry.
|
|
548
|
+
* Returns {} for anything malformed so an old or hand-edited payload drops the
|
|
549
|
+
* property rather than throwing inside a customer's app.
|
|
550
|
+
*
|
|
551
|
+
* The guard has already rejected anything that could close the `url()` call or
|
|
552
|
+
* its quotes, so the value is safe to interpolate.
|
|
553
|
+
*/
|
|
554
|
+
export declare const formatBackgroundImageStyles: (value: unknown) => {
|
|
555
|
+
[styleKey: string]: string;
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Border object → longhand React style keys only. Malformed values return {}.
|
|
560
|
+
* A whole-border design token is the sole shorthand case: it emits `border`
|
|
561
|
+
* alone, so shorthand and longhands never land in the same style object.
|
|
562
|
+
*/
|
|
563
|
+
export declare const formatBorderStyles: (value: unknown) => {
|
|
564
|
+
[styleKey: string]: string;
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Box-shadow object → the boxShadow style key. Missing lengths default to
|
|
569
|
+
* 0px so a partially filled leaf still renders. Malformed values return {}.
|
|
570
|
+
*/
|
|
571
|
+
export declare const formatBoxShadowStyles: (value: unknown) => {
|
|
572
|
+
[styleKey: string]: string;
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Converts a stored box-spacing object into React style entries for the given
|
|
577
|
+
* CSS property, e.g. formatBoxSpacingStyles(value, 'margin') returns
|
|
578
|
+
* { margin } (when allSides is set) or { marginTop, marginRight, ... } for the
|
|
579
|
+
* sides that are defined. Invalid/malformed values return {} so old or
|
|
580
|
+
* corrupted payloads degrade gracefully instead of crashing the renderer.
|
|
581
|
+
*/
|
|
582
|
+
export declare const formatBoxSpacingStyles: (value: unknown, cssProperty: string) => {
|
|
583
|
+
[styleKey: string]: string;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Color leaf → one React style entry (backgroundColor, color, ...).
|
|
588
|
+
* Malformed values return {}.
|
|
589
|
+
*/
|
|
590
|
+
export declare const formatCssColorStyles: (value: unknown, cssProperty: string) => {
|
|
591
|
+
[styleKey: string]: string;
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
export declare const formatCssColorValue: (value: CssColorValue) => string;
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Enum / keyword leaf → one React style entry. Malformed values return {}.
|
|
598
|
+
*/
|
|
599
|
+
export declare const formatCssEnumStyles: (value: unknown, cssProperty: string, allowedValues: readonly string[]) => {
|
|
600
|
+
[styleKey: string]: string;
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Single length/keyword leaf → one React style entry
|
|
605
|
+
* (width, height, gap, borderRadius, ...). Malformed values return {}.
|
|
606
|
+
*/
|
|
607
|
+
export declare const formatCssLengthStyles: (value: unknown, cssProperty: string, capabilities?: SpacingCapabilities) => {
|
|
608
|
+
[styleKey: string]: string;
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
/** `--brand-space-md` → `var(--brand-space-md)` */
|
|
612
|
+
export declare const formatCssVariable: (name: CssVariableName) => string;
|
|
613
|
+
|
|
614
|
+
/** One React style entry from a leaf's token, or undefined when it has none. */
|
|
615
|
+
export declare const formatCssVariableStyles: (leaf: unknown, cssProperty: string) => {
|
|
616
|
+
[styleKey: string]: string;
|
|
617
|
+
} | undefined;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Line-height leaf → React `lineHeight` (number for unitless, string for lengths
|
|
621
|
+
* and design tokens).
|
|
622
|
+
*/
|
|
623
|
+
export declare const formatLineHeightStyles: (value: unknown) => {
|
|
624
|
+
[styleKey: string]: string | number;
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Formats a flattened leaf for a registered object-style attribute into React
|
|
629
|
+
* style entries. Returns {} when the attribute is unknown or the leaf is
|
|
630
|
+
* malformed (graceful degradation).
|
|
631
|
+
*/
|
|
632
|
+
export declare const formatObjectStyleAttribute: (attributeName: string, leaf: unknown) => {
|
|
633
|
+
[styleKey: string]: string | number;
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Opacity leaf is a finite number in [0, 1] or a design token.
|
|
638
|
+
* Malformed values return {}.
|
|
639
|
+
*/
|
|
640
|
+
export declare const formatOpacityStyles: (value: unknown) => {
|
|
641
|
+
[styleKey: string]: string | number;
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
/** Formats one validated SpacingSideValue into a CSS length/keyword string. */
|
|
645
|
+
export declare const formatSpacingSideValue: (side: SpacingSideValue) => string;
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Generates a published key using the format: {environmentId}---{originalKey}
|
|
649
|
+
* @param environmentId - The environment ID
|
|
650
|
+
* @param originalKey - The original resource key
|
|
651
|
+
* @returns The generated published key
|
|
652
|
+
*/
|
|
653
|
+
export declare function generatePublishedKey(environmentId: string, originalKey: string): string;
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Generates a published key for embedded resources using the format: {environmentId}---{originalKey}___{instanceId}
|
|
657
|
+
* @param environmentId - The environment ID
|
|
658
|
+
* @param originalKey - The original resource key
|
|
659
|
+
* @param instanceId - The instance ID of the unpublished collection
|
|
660
|
+
* @returns The generated published key for embedded resource
|
|
661
|
+
*/
|
|
662
|
+
export declare function generatePublishedKeyForEmbedded(environmentId: string, originalKey: string, instanceId: string): string;
|
|
663
|
+
|
|
664
|
+
export declare const getCollectionIdForCollectionType: (componentType: string) => string | undefined;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Reads a column's persisted attribute map during the persisted-key
|
|
668
|
+
* migration from `widgetAttributes` to `componentAttributes`.
|
|
669
|
+
*
|
|
670
|
+
* Published payloads historically stored per-column attributes under
|
|
671
|
+
* `widgetAttributes`; the composer now writes `componentAttributes` for
|
|
672
|
+
* new/edited content while old payloads keep `widgetAttributes` forever.
|
|
673
|
+
* Every read of the persisted field must go through this helper so both
|
|
674
|
+
* generations of payloads render.
|
|
675
|
+
*
|
|
676
|
+
* Precedence is per-column and wholesale: when `componentAttributes` is
|
|
677
|
+
* present it wins outright — values from a stale `widgetAttributes` on the
|
|
678
|
+
* same column must NOT leak through, so there is no key-by-key merging.
|
|
679
|
+
*/
|
|
680
|
+
export declare function getColumnAttributes(col: {
|
|
681
|
+
componentAttributes?: {
|
|
682
|
+
[key: string]: any;
|
|
683
|
+
};
|
|
684
|
+
/** @deprecated Legacy persisted field name; read as fallback only. */
|
|
685
|
+
widgetAttributes?: {
|
|
686
|
+
[key: string]: any;
|
|
687
|
+
};
|
|
688
|
+
}): {
|
|
689
|
+
[key: string]: any;
|
|
690
|
+
} | undefined;
|
|
691
|
+
|
|
692
|
+
export declare function getComponentAttributesAndStyles({ col, deviceDisplayType, isComposeMode, sourceComponentsPlugin, }: GetComponentAttributesAndStylesParams): GetComponentAttributesAndStylesResult;
|
|
693
|
+
|
|
694
|
+
declare interface GetComponentAttributesAndStylesParams {
|
|
695
|
+
col: {
|
|
696
|
+
componentAttributes?: any;
|
|
697
|
+
/** @deprecated Legacy persisted field name; componentAttributes wins when both are set. */
|
|
698
|
+
widgetAttributes?: any;
|
|
699
|
+
type: string;
|
|
700
|
+
libraryId?: string;
|
|
701
|
+
};
|
|
702
|
+
deviceDisplayType: keyof typeof DeviceDisplayTypes;
|
|
703
|
+
isComposeMode: boolean;
|
|
704
|
+
sourceComponentsPlugin: SourceComponentsPlugin;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
declare interface GetComponentAttributesAndStylesResult {
|
|
708
|
+
componentAttributesBasedOnDevice: any;
|
|
709
|
+
componentStyles: {
|
|
710
|
+
[key: string]: any;
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Extracts the (already composed) source components plugin from the plugins
|
|
716
|
+
* object the pipeline receives. Throws if it is missing or malformed.
|
|
717
|
+
*
|
|
718
|
+
* Named to avoid confusion with component-library factories: this does not
|
|
719
|
+
* build a plugin, it validates and returns the one that was injected.
|
|
720
|
+
*/
|
|
721
|
+
export declare function getComponentsPluginFromPlugins(plugins: RenderComponentPlugins | undefined): SourceComponentsPlugin;
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Reads the token off any leaf shape. Returns undefined when the leaf carries
|
|
725
|
+
* no token; `null` counts as absent the same way it does elsewhere in this
|
|
726
|
+
* pipeline.
|
|
727
|
+
*/
|
|
728
|
+
export declare const getCssVariableFromLeaf: (leaf: unknown) => CssVariableName | undefined;
|
|
729
|
+
|
|
730
|
+
export declare const getDefaultDimensionAttributes: ({ dbEntryType, libraryId, sourceComponentsPlugin, }: {
|
|
731
|
+
dbEntryType: string | undefined;
|
|
732
|
+
libraryId?: string;
|
|
733
|
+
sourceComponentsPlugin: SourceComponentsPlugin;
|
|
734
|
+
}) => {
|
|
735
|
+
[x: string]: any;
|
|
736
|
+
} | undefined;
|
|
737
|
+
|
|
738
|
+
export declare const getDeviceTypeBasedAttributes: ({ deviceDisplayType, componentAttributes, }: {
|
|
739
|
+
deviceDisplayType: keyof typeof DeviceDisplayTypes;
|
|
740
|
+
componentAttributes: {
|
|
741
|
+
[key: string]: any;
|
|
742
|
+
} | undefined;
|
|
743
|
+
}) => {
|
|
744
|
+
[key: string]: any;
|
|
745
|
+
} | undefined;
|
|
746
|
+
|
|
747
|
+
export declare const getDragItemId: ({ id, prefix }: DragItemAndPrefix) => string;
|
|
748
|
+
|
|
749
|
+
export declare const getDragItemPrefixAndId: (combinedVal?: string) => DragItemAndPrefix | undefined;
|
|
750
|
+
|
|
751
|
+
export declare const getIdAndPrefix: (combinedVal: string) => {
|
|
752
|
+
prefix: DragItemIdPrefixes;
|
|
753
|
+
id: string;
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
export declare const getMergedAttributes: ({ defaultAttributes, userModifiedAttributes, }: {
|
|
757
|
+
defaultAttributes: {
|
|
758
|
+
[key: string]: any;
|
|
759
|
+
} | undefined;
|
|
760
|
+
userModifiedAttributes: {
|
|
761
|
+
[key: string]: any;
|
|
762
|
+
} | undefined;
|
|
763
|
+
}) => {
|
|
764
|
+
[key: string]: any;
|
|
765
|
+
} | undefined;
|
|
766
|
+
|
|
767
|
+
export declare const getNameAndInstanceIdFromWidgetKey: (widgetKey: string) => {
|
|
768
|
+
name: string;
|
|
769
|
+
instanceId?: string;
|
|
770
|
+
parentId?: string;
|
|
771
|
+
} | undefined;
|
|
772
|
+
|
|
773
|
+
export declare const getNameFromWidgetKey: (widgetKey: string) => {
|
|
774
|
+
name?: string;
|
|
775
|
+
errorMessage?: string;
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
export declare interface GetRuleCMSWidgetResponse {
|
|
779
|
+
success: boolean;
|
|
780
|
+
data: {
|
|
781
|
+
widget: WidgetData;
|
|
782
|
+
childCollections: {
|
|
783
|
+
[key: string]: ChildCollection;
|
|
784
|
+
};
|
|
785
|
+
libraries?: ConfigLibrariesMap;
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export declare type GetWidgetKeyForCollection = {
|
|
790
|
+
error?: string;
|
|
791
|
+
data?: string;
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
export declare const getWidgetKeyForCollection: (collection: WidgetCollectionForKey) => GetWidgetKeyForCollection;
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Returns a key in the format of collectionId or Collection_collectionName$collectionId@parentId or Collection_collectionName$collectionId
|
|
798
|
+
* @param collection - The collection to get the key for
|
|
799
|
+
* @returns The key in the format of collectionId or collectionId@parentId
|
|
800
|
+
*/
|
|
801
|
+
export declare const getWidgetKeyForCollectionWithPrefix: (collection: WidgetCollectionForKey) => string;
|
|
802
|
+
|
|
803
|
+
export declare const getWidgetKeyForPublishedCollection: (collection: PublishedWidgetCollectionForKey) => GetWidgetKeyForCollection;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Returns a key for published collections in the format of PublishedCollection_collectionName$publishedKey@parentId or PublishedCollection_collectionName$publishedKey
|
|
807
|
+
* @param collection - The published collection to get the key for
|
|
808
|
+
* @returns The key in the format of PublishedCollection_collectionName$publishedKey or PublishedCollection_collectionName$publishedKey@parentId
|
|
809
|
+
*/
|
|
810
|
+
export declare const getWidgetKeyForPublishedCollectionWithPrefix: (collection: PublishedWidgetCollectionForKey) => string;
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* A leaf renders a shadow only when at least one length or the color is set;
|
|
814
|
+
* `inset` alone describes nothing visible.
|
|
815
|
+
*/
|
|
816
|
+
export declare const hasBoxShadowLeaf: (value?: BoxShadowValue) => boolean;
|
|
817
|
+
|
|
818
|
+
/** True when any component attribute varies by phone/tablet/desktop. */
|
|
819
|
+
export declare function hasDeviceDivergentValues(displayItemList: Items, widgetCollections: {
|
|
820
|
+
[key: string]: WidgetCollection;
|
|
821
|
+
}): boolean;
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* True when a leaf declares a `cssVariable` that fails validation. Such leaves
|
|
825
|
+
* are rejected outright instead of silently falling back to the literal value:
|
|
826
|
+
* a typo in a token should drop the property, not resurrect a number the user
|
|
827
|
+
* thought they had replaced.
|
|
828
|
+
*/
|
|
829
|
+
export declare const hasInvalidCssVariable: (leaf: unknown) => boolean;
|
|
830
|
+
|
|
831
|
+
export declare const hasItems: (items: Items | undefined) => boolean | undefined;
|
|
832
|
+
|
|
833
|
+
export declare const HIDE_WIDGET_ATTRIBUTE_NAME = "hide-component-3-resolutions";
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Increments a semantic version string by incrementing the patch number
|
|
837
|
+
* @param currentVersion - Current version string (e.g., "1.0.0")
|
|
838
|
+
* @returns Incremented version string (e.g., "1.0.1")
|
|
839
|
+
*/
|
|
840
|
+
export declare function incrementVersion(currentVersion: string): string;
|
|
841
|
+
|
|
842
|
+
export declare const isBackgroundImageValue: (value: unknown) => value is BackgroundImageValue;
|
|
843
|
+
|
|
844
|
+
export declare const isBorderStyleValue: (value: unknown) => boolean;
|
|
845
|
+
|
|
846
|
+
export declare const isBorderValue: (value: unknown) => value is BorderValue;
|
|
847
|
+
|
|
848
|
+
export declare const isBoxShadowValue: (value: unknown) => value is BoxShadowValue;
|
|
849
|
+
|
|
850
|
+
export declare const isBoxSpacingValue: (value: unknown, capabilities?: SpacingCapabilities) => value is BoxSpacingValue;
|
|
851
|
+
|
|
852
|
+
export declare const isCloudinaryCloudName: (value: unknown) => value is string;
|
|
853
|
+
|
|
854
|
+
export declare const isCloudinaryPublicId: (value: unknown) => value is string;
|
|
855
|
+
|
|
856
|
+
export declare const isCloudinaryTransformationString: (value: unknown) => value is string;
|
|
857
|
+
|
|
858
|
+
export declare const isCssColorValue: (value: unknown) => value is CssColorValue;
|
|
859
|
+
|
|
860
|
+
export declare const isCssEnumValue: (value: unknown, allowedValues: readonly string[]) => value is CssEnumValue;
|
|
861
|
+
|
|
862
|
+
export declare const isCssVariableName: (value: unknown) => value is CssVariableName;
|
|
863
|
+
|
|
864
|
+
export declare function isDevClientToken(token: string | null | undefined): boolean;
|
|
865
|
+
|
|
866
|
+
export declare const isLineHeightValue: (value: unknown) => value is LineHeightValue;
|
|
867
|
+
|
|
868
|
+
export declare const isOpacityValue: (value: unknown) => value is OpacityValue;
|
|
869
|
+
|
|
870
|
+
export declare function isRowHiddenForDevice({ row, deviceDisplayType, }: {
|
|
871
|
+
row: DisplayItemRow;
|
|
872
|
+
deviceDisplayType: keyof typeof DeviceDisplayTypes;
|
|
873
|
+
}): boolean;
|
|
874
|
+
|
|
875
|
+
export declare const isSafeImageUrl: (value: unknown) => value is string;
|
|
876
|
+
|
|
877
|
+
export declare const isSpacingSideValue: (value: unknown, capabilities?: SpacingCapabilities) => value is SpacingSideValue;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* True when the author asked for the whole widget to be hidden at this device
|
|
881
|
+
* width. Callers must skip this in compose mode — see
|
|
882
|
+
* WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE.
|
|
883
|
+
*/
|
|
884
|
+
export declare function isWidgetHiddenForDevice({ containerAttributes, deviceDisplayType, }: {
|
|
885
|
+
containerAttributes: {
|
|
886
|
+
[key: string]: any;
|
|
887
|
+
} | undefined;
|
|
888
|
+
deviceDisplayType: keyof typeof DeviceDisplayTypes;
|
|
889
|
+
}): boolean;
|
|
890
|
+
|
|
891
|
+
export declare type Items = {
|
|
892
|
+
rows: DisplayItemRow[];
|
|
893
|
+
containerAttributes?: {
|
|
894
|
+
[key: string]: any;
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
/** Column flex layout — matches row Horizontal Alignment options. */
|
|
899
|
+
export declare const justifyContentAllowlist: readonly ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly"];
|
|
900
|
+
|
|
901
|
+
export declare const JustifyContentTypes: {
|
|
902
|
+
FlexStart: JustifyContentValues;
|
|
903
|
+
FlexEnd: JustifyContentValues;
|
|
904
|
+
Center: JustifyContentValues;
|
|
905
|
+
SpaceBetween: JustifyContentValues;
|
|
906
|
+
SpaceAround: JustifyContentValues;
|
|
907
|
+
SpaceEvenly: JustifyContentValues;
|
|
908
|
+
};
|
|
909
|
+
|
|
910
|
+
export declare type JustifyContentValues = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
911
|
+
|
|
912
|
+
export declare type LibraryCard = {
|
|
913
|
+
title: string;
|
|
914
|
+
entries: EditorPreviewEntry[];
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
export declare type LibraryCardComponent = Component;
|
|
918
|
+
|
|
919
|
+
export declare type LibraryCardGroup = {
|
|
920
|
+
title: string;
|
|
921
|
+
cards: LibraryCard[];
|
|
922
|
+
showInitially?: boolean;
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Props every library card component must accept. The renderer instantiates
|
|
927
|
+
* the Svelte component via `<svelte:component>` and binds these as props.
|
|
928
|
+
*/
|
|
929
|
+
export declare interface LibraryCardInputs {
|
|
930
|
+
componentAttributes?: {
|
|
931
|
+
[key: string]: any;
|
|
932
|
+
};
|
|
933
|
+
pageViewType?: PageViewType;
|
|
934
|
+
styleProps?: {
|
|
935
|
+
[key: string]: any;
|
|
936
|
+
};
|
|
937
|
+
className?: string;
|
|
938
|
+
widgetInstanceProps?: WidgetInstanceProps;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
export declare type LibraryComponentEntry = {
|
|
942
|
+
id: string;
|
|
943
|
+
/** Svelte component that renders this type. */
|
|
944
|
+
card: LibraryCardComponent;
|
|
945
|
+
defaultAttributeValues: DefaultAttributeValue[];
|
|
946
|
+
resolveNoContainer?: ResolveNoContainer;
|
|
947
|
+
noContainer?: boolean;
|
|
948
|
+
resolveRendersOwnElement?: ResolveRendersOwnElement;
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
export declare type LibraryRegistration = ComponentLibraryModule | (() => Promise<ComponentLibraryModuleResolvable>);
|
|
952
|
+
|
|
953
|
+
export declare type LibraryRegistrationMap = Record<string, LibraryRegistration>;
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* line-height accepts a unitless multiplier (e.g. 1.5), a length/keyword, or a
|
|
957
|
+
* design token from the embedding application.
|
|
958
|
+
*/
|
|
959
|
+
export declare type LineHeightValue = ({
|
|
960
|
+
unit: 'number';
|
|
961
|
+
value: number;
|
|
962
|
+
} & CssVariableCarrier) | SpacingSideValue;
|
|
963
|
+
|
|
964
|
+
export declare type NoContainerResolverContext = {
|
|
965
|
+
componentAttributes?: {
|
|
966
|
+
[key: string]: any;
|
|
967
|
+
};
|
|
968
|
+
styleProps?: {
|
|
969
|
+
[key: string]: any;
|
|
970
|
+
} | undefined;
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Untrusted leaf from a persisted payload -> a safe class string, or undefined.
|
|
975
|
+
*
|
|
976
|
+
* This is a passthrough, not a validator: RuleCMS forms no opinion about what a
|
|
977
|
+
* host app's class names look like, so tokens are never checked against a
|
|
978
|
+
* pattern. The only work done here is hygiene — whitespace, de-duplication,
|
|
979
|
+
* and a length cap — so the same string can be trusted to sit in a `className`
|
|
980
|
+
* attribute. Never throws and never logs; anything that isn't a non-empty
|
|
981
|
+
* string after normalization becomes `undefined`.
|
|
982
|
+
*/
|
|
983
|
+
export declare const normalizeCssClasses: (value: unknown) => string | undefined;
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Unified registry for object-valued (and other non-legacy) style attributes.
|
|
987
|
+
* Adding a new style attribute is usually: one entry here + the matching
|
|
988
|
+
* keys in DIMENSION_STYLE_KEYS (noContainer wrapper allowlist). Composer UI can
|
|
989
|
+
* land later without another widget-react release.
|
|
990
|
+
*/
|
|
991
|
+
export declare type ObjectStyleAttributeEntry = {
|
|
992
|
+
kind: 'boxSpacing';
|
|
993
|
+
cssProperty: string;
|
|
994
|
+
} | {
|
|
995
|
+
kind: 'length';
|
|
996
|
+
cssProperty: string;
|
|
997
|
+
capabilities?: SpacingCapabilities;
|
|
998
|
+
} | {
|
|
999
|
+
kind: 'border';
|
|
1000
|
+
} | {
|
|
1001
|
+
kind: 'boxShadow';
|
|
1002
|
+
} | {
|
|
1003
|
+
kind: 'color';
|
|
1004
|
+
cssProperty: string;
|
|
1005
|
+
} | {
|
|
1006
|
+
kind: 'opacity';
|
|
1007
|
+
} | {
|
|
1008
|
+
kind: 'enum';
|
|
1009
|
+
cssProperty: string;
|
|
1010
|
+
allowedValues: readonly string[];
|
|
1011
|
+
} | {
|
|
1012
|
+
kind: 'lineHeight';
|
|
1013
|
+
} | {
|
|
1014
|
+
kind: 'backgroundImage';
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
export declare const objectStyleAttributeRegistry: {
|
|
1018
|
+
[attributeName: string]: ObjectStyleAttributeEntry;
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Opacity leaf: a finite number in [0, 1], or a design token from the
|
|
1023
|
+
* embedding application. Like enums, a bare number has nowhere to hang the
|
|
1024
|
+
* token, so a tokenised opacity arrives as `{ cssVariable }`.
|
|
1025
|
+
*/
|
|
1026
|
+
export declare type OpacityValue = number | CssVariableValue;
|
|
1027
|
+
|
|
1028
|
+
/** Shared by overflow / overflow-x / overflow-y. */
|
|
1029
|
+
export declare const overflowAllowlist: readonly ["visible", "hidden", "scroll", "auto", "clip"];
|
|
1030
|
+
|
|
1031
|
+
export declare type PageViewType = 'Preview' | 'Compose' | 'RenderedPage';
|
|
1032
|
+
|
|
1033
|
+
export declare const PageViewTypes: {
|
|
1034
|
+
Preview: PageViewType;
|
|
1035
|
+
Compose: PageViewType;
|
|
1036
|
+
RenderedPage: PageViewType;
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1039
|
+
export declare const phoneModeWidth = "500px";
|
|
1040
|
+
|
|
1041
|
+
/** Transform raw widget API data into render-ready displayItemList + collections. */
|
|
1042
|
+
export declare function prepareRuleCMSWidgetData(raw: RuleCMSWidgetRawData): RuleCMSWidgetData;
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* Character used to join environmentId and resource key when generating published keys
|
|
1046
|
+
*/
|
|
1047
|
+
export declare const PUBLISHED_KEY_SEPARATOR = "---";
|
|
1048
|
+
|
|
1049
|
+
/** Published (cached) client API path. */
|
|
1050
|
+
export declare const PUBLISHED_WIDGET_API_PATH = "/api/v1/c/widget/get";
|
|
1051
|
+
|
|
1052
|
+
export declare type PublishedWidgetCollectionForKey = {
|
|
1053
|
+
publishedKey: string;
|
|
1054
|
+
name: string;
|
|
1055
|
+
parentId?: string | null;
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
export declare interface ReferencedLibraries {
|
|
1059
|
+
libraryIds: string[];
|
|
1060
|
+
usesDefaultLibrary: boolean;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
export declare interface RenderComponentPlugins {
|
|
1064
|
+
edit?: EditPlugin;
|
|
1065
|
+
sourceComponents?: SourceComponentsPlugin;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* Maps a component's (libraryId, type) pair to its key in the composed
|
|
1070
|
+
* components map. The default library keeps bare (unnamespaced) keys so
|
|
1071
|
+
* existing configs resolve unchanged; every other library is namespaced as
|
|
1072
|
+
* "libraryId/type" so identical local types across tenants never collide.
|
|
1073
|
+
*
|
|
1074
|
+
* Never apply this to collection types — collections are not components and
|
|
1075
|
+
* are not namespaced.
|
|
1076
|
+
*/
|
|
1077
|
+
export declare function resolveKey(libraryId: string | undefined, type: string): string;
|
|
1078
|
+
|
|
1079
|
+
export declare interface ResolveLibrariesParams {
|
|
1080
|
+
registrations: LibraryRegistrationMap | undefined;
|
|
1081
|
+
referenced: ReferencedLibraries;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
export declare type ResolveNoContainer = (context: NoContainerResolverContext) => boolean;
|
|
1085
|
+
|
|
1086
|
+
export declare type ResolveRendersOwnElement = (context: NoContainerResolverContext) => boolean;
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Flatten rowAttributes for the device, then overlay layout defaults with
|
|
1090
|
+
* fallback to legacy first-class fields on DisplayItemRow.
|
|
1091
|
+
*/
|
|
1092
|
+
export declare function resolveRowStyles({ row, deviceDisplayType, isComposeMode, }: {
|
|
1093
|
+
row: DisplayItemRow;
|
|
1094
|
+
deviceDisplayType: keyof typeof DeviceDisplayTypes;
|
|
1095
|
+
isComposeMode: boolean;
|
|
1096
|
+
}): {
|
|
1097
|
+
[key: string]: any;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Resolves the API origin. Consumers should not need to set `endpoint` —
|
|
1102
|
+
* Development tokens hit RulesCMS; published tokens hit widget-cache.
|
|
1103
|
+
* An explicit `endpoint` is only an override (e.g. tests).
|
|
1104
|
+
*/
|
|
1105
|
+
export declare function resolveWidgetApiOrigin(token: string, endpoint?: string): string;
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Flatten the widget's own containerAttributes for the device into inline
|
|
1109
|
+
* styles plus author CSS classes, dropping the settings the canvas cannot
|
|
1110
|
+
* honour while in compose mode.
|
|
1111
|
+
*
|
|
1112
|
+
* The legacy raw `cssAttrArray` container CSS is untouched by this: it is not a
|
|
1113
|
+
* `*-3-resolutions` key, so it never reaches here and keeps being emitted as a
|
|
1114
|
+
* scoped style tag by EmbedInVerticalContainerIfRequired.
|
|
1115
|
+
*/
|
|
1116
|
+
export declare function resolveWidgetContainerStyles({ containerAttributes, deviceDisplayType, isComposeMode, }: {
|
|
1117
|
+
containerAttributes: {
|
|
1118
|
+
[key: string]: any;
|
|
1119
|
+
} | undefined;
|
|
1120
|
+
deviceDisplayType: keyof typeof DeviceDisplayTypes;
|
|
1121
|
+
isComposeMode: boolean;
|
|
1122
|
+
}): WidgetContainerStyles;
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Picks the host-supplied props for one component instance out of the
|
|
1126
|
+
* `componentProps` map.
|
|
1127
|
+
*
|
|
1128
|
+
* `ancestorColumnIds` are the columns holding the enclosing collections,
|
|
1129
|
+
* outermost first; `columnId` is the instance's own column. A key matches when
|
|
1130
|
+
* its segments are the tail of that path, which is what lets a bare column id
|
|
1131
|
+
* address every copy of a repeated collection while a longer path narrows to
|
|
1132
|
+
* one. Longest match wins, so a specific path always beats a bare id.
|
|
1133
|
+
*/
|
|
1134
|
+
export declare function resolveWidgetInstanceProps({ componentProps, ancestorColumnIds, columnId, }: {
|
|
1135
|
+
componentProps?: ComponentPropsMap;
|
|
1136
|
+
ancestorColumnIds?: string[];
|
|
1137
|
+
columnId: string;
|
|
1138
|
+
}): WidgetInstanceProps | undefined;
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* Server-side resolve helper: loads only the component libraries the given
|
|
1142
|
+
* widget config references and returns the composed plugin.
|
|
1143
|
+
*
|
|
1144
|
+
* The result contains Angular component classes and must not be serialized
|
|
1145
|
+
* across a process boundary. For pre-fetched SSR pages, register eagerly
|
|
1146
|
+
* imported modules via `RuleCMSWidgetProvider` / inputs instead.
|
|
1147
|
+
*/
|
|
1148
|
+
export declare function resolveWidgetLibraries(params: ResolveWidgetLibrariesParams): Promise<SourceComponentsPlugin>;
|
|
1149
|
+
|
|
1150
|
+
export declare interface ResolveWidgetLibrariesParams {
|
|
1151
|
+
data: RuleCMSWidgetData;
|
|
1152
|
+
libraries: LibraryRegistrationMap;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* True when the row should mount a real flex wrapper so styles have a DOM
|
|
1157
|
+
* target — matching the column idea that assigned attributes imply a container.
|
|
1158
|
+
*/
|
|
1159
|
+
export declare function rowBasedPropertiesAreAssigned(row: DisplayItemRow): boolean;
|
|
1160
|
+
|
|
1161
|
+
/** Live draft API host — RulesCMS production (never relative / local). */
|
|
1162
|
+
export declare const RULECMS_API_ORIGIN = "https://rulecms.com";
|
|
1163
|
+
|
|
1164
|
+
export declare const RULECMS_PUBLISHED_KEY_ATTRIBUTE = "data-rulecms-published-key";
|
|
1165
|
+
|
|
1166
|
+
export declare const RULECMS_WIDGET_CONTEXT_KEY: unique symbol;
|
|
1167
|
+
|
|
1168
|
+
export declare interface RuleCMSWidgetContext {
|
|
1169
|
+
token: string;
|
|
1170
|
+
endpoint?: string;
|
|
1171
|
+
libraries?: LibraryRegistrationMap;
|
|
1172
|
+
libraryRegistry: ComponentLibraryRegistry;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
export declare interface RuleCMSWidgetData {
|
|
1176
|
+
displayItemList: Items;
|
|
1177
|
+
widgetCollections: {
|
|
1178
|
+
[key: string]: WidgetCollection;
|
|
1179
|
+
};
|
|
1180
|
+
libraries?: ConfigLibrariesMap;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
export declare interface RuleCMSWidgetRawData {
|
|
1184
|
+
widget: WidgetData;
|
|
1185
|
+
childCollections: {
|
|
1186
|
+
[key: string]: ChildCollection;
|
|
1187
|
+
};
|
|
1188
|
+
libraries?: ConfigLibrariesMap;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
export declare interface SourceComponentsPlugin {
|
|
1192
|
+
components: Record<string, LibraryComponentEntry>;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
export declare type SpacingCapabilities = {
|
|
1196
|
+
allowAuto?: boolean;
|
|
1197
|
+
allowKeywords?: boolean;
|
|
1198
|
+
allowNegative?: boolean;
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
export declare type SpacingKeyword = 'inherit' | 'unset';
|
|
1202
|
+
|
|
1203
|
+
export declare const spacingKeywords: SpacingKeyword[];
|
|
1204
|
+
|
|
1205
|
+
export declare type SpacingLengthUnit = 'px' | '%' | 'em' | 'rem' | 'vh' | 'vw';
|
|
1206
|
+
|
|
1207
|
+
export declare const spacingLengthUnits: SpacingLengthUnit[];
|
|
1208
|
+
|
|
1209
|
+
export declare type SpacingSideLiteralValue = {
|
|
1210
|
+
unit: 'auto';
|
|
1211
|
+
} | {
|
|
1212
|
+
unit: 'keyword';
|
|
1213
|
+
keyword: SpacingKeyword;
|
|
1214
|
+
} | {
|
|
1215
|
+
unit: SpacingLengthUnit;
|
|
1216
|
+
value: number;
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
export declare type SpacingSideValue = (SpacingSideLiteralValue & CssVariableCarrier) | CssVariableValue;
|
|
1220
|
+
|
|
1221
|
+
export { SvelteComponent as BreakpointVariantRender }
|
|
1222
|
+
export { SvelteComponent as DisplayComponent }
|
|
1223
|
+
export { SvelteComponent as RenderComponents }
|
|
1224
|
+
export { SvelteComponent as RenderComponentsForDevice }
|
|
1225
|
+
export { SvelteComponent as RenderComponentsInner }
|
|
1226
|
+
export { SvelteComponent as RuleCMSWidget }
|
|
1227
|
+
export { SvelteComponent as RuleCMSWidgetProvider }
|
|
1228
|
+
|
|
1229
|
+
export declare const tabletModeWidth = "820px";
|
|
1230
|
+
|
|
1231
|
+
export declare const textAlignAllowlist: readonly ["left", "center", "right", "justify", "start", "end"];
|
|
1232
|
+
|
|
1233
|
+
export declare const textDecorationAllowlist: readonly ["none", "underline", "line-through", "overline"];
|
|
1234
|
+
|
|
1235
|
+
export declare const textTransformAllowlist: readonly ["none", "uppercase", "lowercase", "capitalize"];
|
|
1236
|
+
|
|
1237
|
+
/** Svelte 5 types `style` as a CSS string, not a style object. */
|
|
1238
|
+
export declare function toStyleAttr(style?: Record<string, unknown> | null): string | undefined;
|
|
1239
|
+
|
|
1240
|
+
export declare const typeHasPrefix: (type: string) => boolean;
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* Development-only console warning for `componentProps` keys that address
|
|
1244
|
+
* nothing. Silent in production: a stale key is a wiring mistake to catch
|
|
1245
|
+
* while building, not noise on a customer's page.
|
|
1246
|
+
*/
|
|
1247
|
+
export declare function warnUnmatchedComponentProps({ componentProps, displayItemList, widgetCollections, publishedKey, }: {
|
|
1248
|
+
componentProps: ComponentPropsMap | undefined;
|
|
1249
|
+
displayItemList: Items | undefined;
|
|
1250
|
+
widgetCollections: {
|
|
1251
|
+
[key: string]: WidgetCollection;
|
|
1252
|
+
} | undefined;
|
|
1253
|
+
publishedKey: string;
|
|
1254
|
+
}): void;
|
|
1255
|
+
|
|
1256
|
+
/**
|
|
1257
|
+
* Widget-level settings the editing canvas must not apply.
|
|
1258
|
+
*
|
|
1259
|
+
* The canvas is a drag-and-drop surface, not a scaled preview. A widget pinned
|
|
1260
|
+
* to 400px, inset by margin, or clipped by overflow leaves the author with
|
|
1261
|
+
* nowhere to drop the next component, and a hidden widget leaves nothing to
|
|
1262
|
+
* edit at all. Preview and consuming apps apply every one of these.
|
|
1263
|
+
*
|
|
1264
|
+
* Flex layout, gap, colors, typography, opacity and CSS classes are absent
|
|
1265
|
+
* deliberately: they change how the canvas looks without taking away the room
|
|
1266
|
+
* or the affordances the author needs to keep working.
|
|
1267
|
+
*/
|
|
1268
|
+
export declare const WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE: readonly ["width-3-resolutions", "min-width-3-resolutions", "max-width-3-resolutions", "height-3-resolutions", "min-height-3-resolutions", "max-height-3-resolutions", "margin-3-resolutions", "padding-3-resolutions", "border-3-resolutions", "border-radius-3-resolutions", "box-shadow-3-resolutions", "overflow-3-resolutions", "overflow-x-3-resolutions", "overflow-y-3-resolutions", "hide-component-3-resolutions"];
|
|
1269
|
+
|
|
1270
|
+
/** Published (cached) API host. */
|
|
1271
|
+
export declare const WIDGET_CACHE_API_ORIGIN = "https://widget-cache.rulecms.com";
|
|
1272
|
+
|
|
1273
|
+
/**
|
|
1274
|
+
* True when the widget carries settings that need a real DOM element to land
|
|
1275
|
+
* on, so the vertical container has to be emitted even where it would
|
|
1276
|
+
* otherwise collapse away. Mirrors rowBasedPropertiesAreAssigned.
|
|
1277
|
+
*/
|
|
1278
|
+
export declare function widgetBasedPropertiesAreAssigned(widgetContainerStyles: WidgetContainerStyles): boolean;
|
|
1279
|
+
|
|
1280
|
+
export declare type WidgetCollection = {
|
|
1281
|
+
id: string;
|
|
1282
|
+
name: string;
|
|
1283
|
+
userFriendlyName?: string;
|
|
1284
|
+
parentId?: string;
|
|
1285
|
+
collectionRows: Items;
|
|
1286
|
+
notAvailableToAdd?: boolean;
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
export declare type WidgetCollectionForKey = {
|
|
1290
|
+
id: string;
|
|
1291
|
+
name: string;
|
|
1292
|
+
parentId?: string | null;
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
export declare type WidgetContainerStyles = {
|
|
1296
|
+
styles: {
|
|
1297
|
+
[key: string]: any;
|
|
1298
|
+
};
|
|
1299
|
+
cssClasses?: string;
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
export declare interface WidgetData {
|
|
1303
|
+
publishedKey: string;
|
|
1304
|
+
name: string;
|
|
1305
|
+
version: string;
|
|
1306
|
+
environmentName: string;
|
|
1307
|
+
itemList: string;
|
|
1308
|
+
tagName?: string;
|
|
1309
|
+
tagDescription?: string;
|
|
1310
|
+
lastPublishedAt: string;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* Extra props a host application supplies for one component instance, handed
|
|
1315
|
+
* to the component as `widgetInstanceProps`. Opaque to widget-react: it
|
|
1316
|
+
* forwards the bag and never inspects it, so whether a key means anything is
|
|
1317
|
+
* entirely up to the component that receives it.
|
|
1318
|
+
*/
|
|
1319
|
+
export declare type WidgetInstanceProps = {
|
|
1320
|
+
[key: string]: any;
|
|
1321
|
+
};
|
|
1322
|
+
|
|
1323
|
+
export { }
|