@contentstack/studio-registry 1.4.0 → 1.5.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/dist/cjs/index.cjs +341 -46
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/component-registry/registry-options-processor.js +27 -0
- package/dist/esm/component-registry/registry-options-processor.js.map +1 -1
- package/dist/esm/component-registry/registry.constant.js +2 -0
- package/dist/esm/component-registry/registry.constant.js.map +1 -1
- package/dist/esm/component-registry/registry.js +171 -4
- package/dist/esm/component-registry/registry.js.map +1 -1
- package/dist/esm/component-registry/singleton.js +59 -0
- package/dist/esm/component-registry/singleton.js.map +1 -0
- package/dist/esm/data-binder/retrieve-data.js +38 -17
- package/dist/esm/data-binder/retrieve-data.js.map +1 -1
- package/dist/esm/data-binder/retrieve-data.util.js +23 -4
- package/dist/esm/data-binder/retrieve-data.util.js.map +1 -1
- package/dist/esm/index.d.ts +128 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +12 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieve-data.util.js","sources":["../../../src/data-binder/retrieve-data.util.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"retrieve-data.util.js","sources":["../../../src/data-binder/retrieve-data.util.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AA6BA;;;;;;;;;;;;;;;;;AAiBG;AACG,SAAU,yBAAyB,CACvC,IAAQ,EAAA;AAER,IAAA,MAAM,aAAa,GAAG;AACpB,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,MAAM,EAAE,CAAC;;AAET,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,QAAQ,EAAE,EAAE;AACZ,Q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ropBase<NodePropTypes["object"], Record<string, unknown>> & {
|
|
51
51
|
properties: Props;
|
|
52
52
|
};
|
|
53
|
-
type SlotProp = PropBase<NodePropTypes["slot"], Node[]
|
|
53
|
+
type SlotProp = PropBase<NodePropTypes["slot"], Node[]> & {
|
|
54
|
+
/**
|
|
55
|
+
* References a `NumberProp` by name that controls how many children this slot holds.
|
|
56
|
+
* When the linked number prop value changes, slot children are automatically
|
|
57
|
+
* added or removed to match the count.
|
|
58
|
+
*/
|
|
59
|
+
countProp?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Factory function that creates a new child node when the slot needs to grow.
|
|
62
|
+
* Required when `countProp` is specified.
|
|
63
|
+
*/
|
|
64
|
+
itemFactory?: () => Node;
|
|
65
|
+
/**
|
|
66
|
+
* Pre-computed serializable node template, generated from `itemFactory` during registration.
|
|
67
|
+
* Used by composable-studio to create new slot children across the postMessage boundary.
|
|
68
|
+
*/
|
|
69
|
+
itemTemplate?: Node;
|
|
70
|
+
};
|
|
54
71
|
type ChoiceProp = PropBase<NodePropTypes["choice"], string[]> & {
|
|
55
72
|
options: string[] | {
|
|
56
73
|
value: string | number | boolean;
|
|
@@ -127,6 +144,7 @@ declare const INTERNAL_COMPONENTS_NAMES: {
|
|
|
127
144
|
readonly LINK: "link";
|
|
128
145
|
readonly LINK_CONTAINER: "link-container";
|
|
129
146
|
readonly TEXT: "text";
|
|
147
|
+
readonly NUMBER: "number";
|
|
130
148
|
readonly BUTTON: "button";
|
|
131
149
|
readonly JSON_RTE: "json-rte";
|
|
132
150
|
readonly COLLAPSIBLE_TEXT: "collapsible-text";
|
|
@@ -159,6 +177,7 @@ declare const BUILT_IN_COMPONENTS: {
|
|
|
159
177
|
readonly LINK: "link";
|
|
160
178
|
readonly LINK_CONTAINER: "link-container";
|
|
161
179
|
readonly TEXT: "text";
|
|
180
|
+
readonly NUMBER: "number";
|
|
162
181
|
readonly BUTTON: "button";
|
|
163
182
|
readonly JSON_RTE: "json-rte";
|
|
164
183
|
readonly COLLAPSIBLE_TEXT: "collapsible-text";
|
|
@@ -290,6 +309,9 @@ declare class ComponentRegistry<C> {
|
|
|
290
309
|
private componentRegistry;
|
|
291
310
|
private propValidatorRegistry;
|
|
292
311
|
private config;
|
|
312
|
+
private componentLoaders;
|
|
313
|
+
private loadedComponents;
|
|
314
|
+
private loadingPromises;
|
|
293
315
|
constructor(config?: ComponentRegistryOptions);
|
|
294
316
|
setConfig(config?: Partial<ComponentRegistryOptions>): void;
|
|
295
317
|
/**
|
|
@@ -355,8 +377,105 @@ declare class ComponentRegistry<C> {
|
|
|
355
377
|
unregisterComponent(node: Node | string): void;
|
|
356
378
|
validateProp<V>(componentName: string, propName: string, value: V): ReturnType<PropValidator<V>>;
|
|
357
379
|
getComponentName(node: Node): string;
|
|
380
|
+
/**
|
|
381
|
+
* Registers a lazy-loadable component with a loader function.
|
|
382
|
+
* The component will be loaded on-demand when needed.
|
|
383
|
+
*
|
|
384
|
+
* @param config - Component configuration without the component itself
|
|
385
|
+
* @param loader - Function that returns a Promise resolving to the component
|
|
386
|
+
* @param registryType - Type of registry (internal or user-defined), defaults to user-defined
|
|
387
|
+
*/
|
|
388
|
+
registerLazyComponent(config: Omit<RegisterComponentOptionsInput<C>, "component">, loader: () => Promise<C>, registryType?: Registry): void;
|
|
389
|
+
/**
|
|
390
|
+
* Loads a single component if it's registered as lazy and not yet loaded.
|
|
391
|
+
* Returns immediately if already loaded or not a lazy component.
|
|
392
|
+
*
|
|
393
|
+
* @param componentType - The type of component to load
|
|
394
|
+
* @returns Promise that resolves when the component is loaded
|
|
395
|
+
*/
|
|
396
|
+
loadComponent(componentType: string): Promise<void>;
|
|
397
|
+
/**
|
|
398
|
+
* Loads multiple components in parallel.
|
|
399
|
+
* Deduplicates requests and uses caching.
|
|
400
|
+
*
|
|
401
|
+
* @param componentTypes - Array of component types to load
|
|
402
|
+
* @returns Promise that resolves when all components are loaded
|
|
403
|
+
*/
|
|
404
|
+
loadComponents(componentTypes: string[]): Promise<void>;
|
|
405
|
+
/**
|
|
406
|
+
* Checks if a component is registered as lazy-loadable.
|
|
407
|
+
*
|
|
408
|
+
* @param componentType - The type of component to check
|
|
409
|
+
* @returns true if the component is lazy-loadable
|
|
410
|
+
*/
|
|
411
|
+
isLazyComponent(componentType: string): boolean;
|
|
412
|
+
/**
|
|
413
|
+
* Checks if a lazy component has been loaded.
|
|
414
|
+
*
|
|
415
|
+
* @param componentType - The type of component to check
|
|
416
|
+
* @returns true if the component has been loaded
|
|
417
|
+
*/
|
|
418
|
+
isComponentLoaded(componentType: string): boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Checks if a component has a loader registered (lazy) or is already registered (eager).
|
|
421
|
+
* This is useful for SSR validation to ensure components are available before rendering.
|
|
422
|
+
*
|
|
423
|
+
* @param componentType - The type of component to check
|
|
424
|
+
* @returns true if the component has a loader or is registered
|
|
425
|
+
*/
|
|
426
|
+
hasComponentLoader(componentType: string): boolean;
|
|
427
|
+
/**
|
|
428
|
+
* Gets all component types that have loaders registered (lazy components).
|
|
429
|
+
* Useful for debugging and SSR setup validation.
|
|
430
|
+
*
|
|
431
|
+
* @returns Array of component types with lazy loaders
|
|
432
|
+
*/
|
|
433
|
+
getLazyComponentTypes(): string[];
|
|
434
|
+
/**
|
|
435
|
+
* Gets all registered component types (both lazy and eager).
|
|
436
|
+
* Useful for debugging and validation.
|
|
437
|
+
*
|
|
438
|
+
* @returns Array of all registered component types
|
|
439
|
+
*/
|
|
440
|
+
getAllComponentTypes(): string[];
|
|
358
441
|
}
|
|
359
442
|
|
|
443
|
+
/**
|
|
444
|
+
* Gets the singleton ComponentRegistry instance.
|
|
445
|
+
* Creates it if it doesn't exist yet.
|
|
446
|
+
*
|
|
447
|
+
* @returns The singleton ComponentRegistry instance
|
|
448
|
+
*
|
|
449
|
+
* @example
|
|
450
|
+
* ```typescript
|
|
451
|
+
* import { getComponentRegistryInstance } from '@contentstack/studio-registry';
|
|
452
|
+
*
|
|
453
|
+
* const registry = getComponentRegistryInstance();
|
|
454
|
+
* await registry.loadComponent('my-component');
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
declare function getComponentRegistryInstance(): ComponentRegistry<any>;
|
|
458
|
+
/**
|
|
459
|
+
* Resets the singleton instance.
|
|
460
|
+
* Primarily useful for testing to ensure a clean state between tests.
|
|
461
|
+
*
|
|
462
|
+
* @example
|
|
463
|
+
* ```typescript
|
|
464
|
+
* import { resetComponentRegistryInstance } from '@contentstack/studio-registry';
|
|
465
|
+
*
|
|
466
|
+
* beforeEach(() => {
|
|
467
|
+
* resetComponentRegistryInstance();
|
|
468
|
+
* });
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
471
|
+
declare function resetComponentRegistryInstance(): void;
|
|
472
|
+
/**
|
|
473
|
+
* Checks if the singleton instance has been created.
|
|
474
|
+
*
|
|
475
|
+
* @returns true if the instance exists, false otherwise
|
|
476
|
+
*/
|
|
477
|
+
declare function hasComponentRegistryInstance(): boolean;
|
|
478
|
+
|
|
360
479
|
type DesignTokensInput = Partial<SectionDesignTokens> & Partial<GlobalDesignTokens>;
|
|
361
480
|
type DesignTokensInputKeys = keyof DesignTokensInput;
|
|
362
481
|
type GlobalDesignTokens = {
|
|
@@ -1145,9 +1264,16 @@ declare function getDefaultPropStaticValue<K extends BindableNodePropType>(args:
|
|
|
1145
1264
|
declare function isKnownType(type: string): type is PropType;
|
|
1146
1265
|
declare function getSlotData<T>({ nodeProps, field, node, getSlots, }: GetSlotDataArgs<T>): T | null;
|
|
1147
1266
|
declare function getPlaceHolderComponent<T>(placeholders: PlaceHolders<T>, prop: PropInput, type: BindableNodePropType): any;
|
|
1267
|
+
|
|
1148
1268
|
declare const getBindingString: (binding: BindingType) => string;
|
|
1149
1269
|
declare const convertBindingPath: (bindingType: string, path: string) => string | string[];
|
|
1150
1270
|
declare const getFlattenedData: (data: any) => any;
|
|
1271
|
+
/**
|
|
1272
|
+
* Composition/static data often stores single-select choice as `string[]` (one element).
|
|
1273
|
+
* `isDataMatchingPropType` treats `choice` as a `string` or `string[]` (multi-select);
|
|
1274
|
+
* single-select stored as `string[]` must still be unwrapped here before the type-mismatch fallback.
|
|
1275
|
+
*/
|
|
1276
|
+
declare function normalizeSingleSelectChoiceValue(resolvedData: unknown, prop: PropInput): unknown;
|
|
1151
1277
|
declare const resolveMetadataBindings: (node: Node, data: ComposableStudioData) => void;
|
|
1152
1278
|
declare const getRepeaterContextPath: (binding: RepeaterBindingValue) => string;
|
|
1153
1279
|
declare function isDataMatchingPropType(data: unknown, type: BindableNodePropType): boolean;
|
|
@@ -1196,5 +1322,5 @@ declare class BreakpointRegistry {
|
|
|
1196
1322
|
declare const getSymbolUIDFromNode: (symbol: Node) => string;
|
|
1197
1323
|
declare const getSymbolUIDFromUID: (uid: string) => string;
|
|
1198
1324
|
|
|
1199
|
-
export { ALLOWED_DESIGN_VALUES_LEVELS, BUILT_IN_COMPONENTS, BreakpointRegistry, ComponentRegistry, DATA_SOURCES, DATA_SOURCES_PREFIX, DEFAULT_DESIGN_TOKENS, DesignRegistry, INTERNAL_COMPONENTS_NAMES, INTERNAL_COMPONENT_SECTIONS, INTERNAL_SECTIONS, JSONRTERegistry, STYLE_SECTIONS_OPTIONS, STYLE_SECTION_CATEGORIES, SYSTEM_COMPONENTS, convertBindingPath, getBindingString, getCslpPath, getCslpTag, getDataType, getDefaultPropStaticValue, getDesignClassesNames, getFlattenedData, getPlaceHolderComponent, getRepeaterBinding, getRepeaterContextPath, getSlotData, getSymbolUIDFromNode, getSymbolUIDFromUID, isDataMatchingPropType, isKnownType, resolveMetadataBindings, retrievePropValue };
|
|
1325
|
+
export { ALLOWED_DESIGN_VALUES_LEVELS, BUILT_IN_COMPONENTS, BreakpointRegistry, ComponentRegistry, DATA_SOURCES, DATA_SOURCES_PREFIX, DEFAULT_DESIGN_TOKENS, DesignRegistry, INTERNAL_COMPONENTS_NAMES, INTERNAL_COMPONENT_SECTIONS, INTERNAL_SECTIONS, JSONRTERegistry, STYLE_SECTIONS_OPTIONS, STYLE_SECTION_CATEGORIES, SYSTEM_COMPONENTS, convertBindingPath, getBindingString, getComponentRegistryInstance, getCslpPath, getCslpTag, getDataType, getDefaultPropStaticValue, getDesignClassesNames, getFlattenedData, getPlaceHolderComponent, getRepeaterBinding, getRepeaterContextPath, getSlotData, getSymbolUIDFromNode, getSymbolUIDFromUID, hasComponentRegistryInstance, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, resetComponentRegistryInstance, resolveMetadataBindings, retrievePropValue };
|
|
1200
1326
|
export type { AllowedDesignValues, AllowedDesignValuesLevel, AnyProp, ArrayProp, BooleanProp, Breakpoint, BreakpointInput, CSBindingPath, CSDataSources, ChoiceProp, ComponentRegistryOptions, ComponentType, ComposableStudioData, ContentstackBindingValue, CssVariablesToDesignTokens, CssVariablesToValue, DataSourceItem, DataSources, DateStringProp, DefaultBreakpoint, DesignClassValue, DesignClasses, DesignClassesInput, DesignClassesNames, DesignTokenCssVariable, DesignTokens, DesignTokensInput, DesignTokensInputKeys, DesignTokensOptions, DesignTokensOptionsInput, GetSlots, GetSlotsParams, GlobalDesignTokens, HrefProp, ICSEntryReference, ImageUrlProp, InternalComponentRegistryOptions, JSONRTERegistryOptions, JsonRTEProp, LengthToken, NodeProps, NumberProp, ObjectInput, ObjectProp, PlaceHolders, PreProcessedBreakpoint, PreProcessedDesignTokenInput, PropBase, PropInput, PropType, PropTypeOfNoOptionsRequired, PropValidator, Props, PropsWithNoOptionsRequired, RawStaticValue, RegisterComponentOptionsInput, RegisterComponentSchema, RegisterComponentSchemaInput, RegisterInternalComponentOptionsInput, Registry, RepeaterBindingValue, SectionDesignTokens, SlotProp, StaticValue, StaticValueItem, StaticValueUid, StringProp, StudioSpecData, StyleGroupOptions, StyleSectionCategoriesOptions, StyleSectionOptions, StyleSections, TemplateBindingValue };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { ComponentRegistry } from './component-registry/registry.js';
|
|
2
2
|
export { BUILT_IN_COMPONENTS, DATA_SOURCES, DATA_SOURCES_PREFIX, INTERNAL_COMPONENTS_NAMES, INTERNAL_COMPONENT_SECTIONS, INTERNAL_SECTIONS, STYLE_SECTIONS_OPTIONS, STYLE_SECTION_CATEGORIES, SYSTEM_COMPONENTS } from './component-registry/registry.constant.js';
|
|
3
|
+
export { getComponentRegistryInstance, hasComponentRegistryInstance, resetComponentRegistryInstance } from './component-registry/singleton.js';
|
|
3
4
|
export { DesignRegistry } from './design-registry/design-registry.js';
|
|
4
5
|
export { getDesignClassesNames } from './design-registry/design-classes.js';
|
|
5
6
|
export { ALLOWED_DESIGN_VALUES_LEVELS, DEFAULT_DESIGN_TOKENS } from './design-registry/constants.js';
|
|
6
7
|
export { JSONRTERegistry } from './json-rte-registry/index.js';
|
|
7
8
|
export { retrievePropValue } from './data-binder/retrieve-data.js';
|
|
8
|
-
export { convertBindingPath, getBindingString, getDataType, getDefaultPropStaticValue, getFlattenedData, getPlaceHolderComponent, getRepeaterContextPath, getSlotData, isDataMatchingPropType, isKnownType, resolveMetadataBindings } from './data-binder/retrieve-data.util.js';
|
|
9
|
+
export { convertBindingPath, getBindingString, getDataType, getDefaultPropStaticValue, getFlattenedData, getPlaceHolderComponent, getRepeaterContextPath, getSlotData, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, resolveMetadataBindings } from './data-binder/retrieve-data.util.js';
|
|
9
10
|
export { getCslpPath, getCslpTag, getRepeaterBinding } from './data-binder/cslp.js';
|
|
10
11
|
export { BreakpointRegistry } from './breakpoint-registry/index.js';
|
|
11
12
|
export { getSymbolUIDFromNode, getSymbolUIDFromUID } from './utils/symbols.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/studio-registry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "This package houses all the registry related to the visual builder",
|
|
5
5
|
"main": "dist/cjs/index.cjs",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@contentstack/common-config": "^1.1.
|
|
19
|
-
"@contentstack/studio-internal": "^1.2.
|
|
18
|
+
"@contentstack/common-config": "^1.1.8",
|
|
19
|
+
"@contentstack/studio-internal": "^1.2.2",
|
|
20
20
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
21
21
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
22
22
|
"@rollup/plugin-terser": "^1.0.0",
|
|
23
23
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
24
|
-
"happy-dom": "^20.
|
|
24
|
+
"happy-dom": "^20.8.9",
|
|
25
25
|
"rollup": "^4.46.2",
|
|
26
26
|
"rollup-plugin-dts": "^6.2.1",
|
|
27
27
|
"rollup-plugin-node-externals": "^8.0.1",
|
|
@@ -52,11 +52,14 @@
|
|
|
52
52
|
"author": "Contentstack",
|
|
53
53
|
"license": "MIT",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@contentstack/json-rte-serializer": "^3.0.
|
|
56
|
-
"@contentstack/studio-message-types": "^1.2.
|
|
57
|
-
"@contentstack/studio-messenger": "^1.
|
|
55
|
+
"@contentstack/json-rte-serializer": "^3.0.5",
|
|
56
|
+
"@contentstack/studio-message-types": "^1.2.2",
|
|
57
|
+
"@contentstack/studio-messenger": "^1.4.0",
|
|
58
58
|
"csstype": "^3.1.3",
|
|
59
|
-
"lodash-es": "^4.
|
|
59
|
+
"lodash-es": "^4.18.1"
|
|
60
60
|
},
|
|
61
|
-
"
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
},
|
|
64
|
+
"gitHead": "1877b45f4a73ffb0c570ea06c197ba95504c014a"
|
|
62
65
|
}
|