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