@contentstack/studio-registry 1.10.0 → 2.0.1
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 +199 -45
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/common/global-store.js +44 -8
- package/dist/esm/common/global-store.js.map +1 -1
- package/dist/esm/component-registry/registry-options-processor.js +42 -0
- package/dist/esm/component-registry/registry-options-processor.js.map +1 -1
- package/dist/esm/component-registry/registry.js +1 -1
- package/dist/esm/component-registry/registry.js.map +1 -1
- package/dist/esm/component-registry/singleton.js +40 -10
- package/dist/esm/component-registry/singleton.js.map +1 -1
- package/dist/esm/data-binder/retrieve-data.js +26 -13
- package/dist/esm/data-binder/retrieve-data.js.map +1 -1
- package/dist/esm/data-binder/retrieve-data.util.js +31 -1
- package/dist/esm/data-binder/retrieve-data.util.js.map +1 -1
- package/dist/esm/index.d.ts +94 -46
- package/dist/esm/index.js +3 -3
- package/dist/esm/state-store/function-registry.js +6 -6
- package/dist/esm/state-store/function-registry.js.map +1 -1
- package/dist/esm/state-store/public-api.js +1 -1
- package/dist/esm/state-store/public-api.js.map +1 -1
- package/dist/esm/state-store/state-store.js +8 -8
- package/dist/esm/state-store/state-store.js.map +1 -1
- package/package.json +12 -6
package/dist/esm/index.d.ts
CHANGED
|
@@ -83,6 +83,21 @@ type SlotProp = PropBase<NodePropTypes["slot"], Node[]> & {
|
|
|
83
83
|
* Used by composable-studio to create new slot children across the postMessage boundary.
|
|
84
84
|
*/
|
|
85
85
|
itemTemplate?: Node;
|
|
86
|
+
/**
|
|
87
|
+
* Declares where data this component publishes through `<Slot data>` comes from:
|
|
88
|
+
* maps a published key to the name of the prop whose bound data it forwards.
|
|
89
|
+
*
|
|
90
|
+
* `<Slot data>` reaches Studio as plain JSON, so a Loop bound to
|
|
91
|
+
* `component_props.<key>` has no CMS schema — no Content Type or Block Name
|
|
92
|
+
* conditions, and saved conditions reopen as "Invalid binding". With
|
|
93
|
+
* `dataFrom: { items: "source" }`, Studio resolves the schema for
|
|
94
|
+
* `component_props.items` from whatever `source` is bound to.
|
|
95
|
+
*
|
|
96
|
+
* Schema only: render-time data is untouched and nothing is persisted.
|
|
97
|
+
* Declare a key only when its value holds the source's elements unchanged
|
|
98
|
+
* (slice / filter / sort) — a mapped or reshaped value would get the wrong schema.
|
|
99
|
+
*/
|
|
100
|
+
dataFrom?: Record<string, string>;
|
|
86
101
|
};
|
|
87
102
|
/** Fields shared by single- and multi-select choice props. */
|
|
88
103
|
type ChoiceCommon = {
|
|
@@ -453,6 +468,14 @@ type ContentstackBindingValue = {
|
|
|
453
468
|
} & TemplateBindingValue;
|
|
454
469
|
|
|
455
470
|
type BuiltInComponentValue = (typeof BUILT_IN_COMPONENTS)[keyof typeof BUILT_IN_COMPONENTS];
|
|
471
|
+
/**
|
|
472
|
+
* True when the value is an RSC client-reference proxy — what a `"use client"`
|
|
473
|
+
* module's exports look like from the server module graph (Next.js App
|
|
474
|
+
* Router, Turbopack). Invoking one during SSR throws "Attempted to call X()
|
|
475
|
+
* from the server", so real implementations always take precedence over
|
|
476
|
+
* proxies in the registry.
|
|
477
|
+
*/
|
|
478
|
+
declare const isClientReferenceComponent: (component: unknown) => boolean;
|
|
456
479
|
interface ComponentRegistryOptions {
|
|
457
480
|
allowedBuiltInComponents?: boolean | BuiltInComponentValue[];
|
|
458
481
|
overrideDefaultComponents?: boolean;
|
|
@@ -614,6 +637,49 @@ declare class ComponentRegistry<C> {
|
|
|
614
637
|
getAllComponentTypes(): string[];
|
|
615
638
|
}
|
|
616
639
|
|
|
640
|
+
/**
|
|
641
|
+
* Which React module graph a caller belongs to.
|
|
642
|
+
*
|
|
643
|
+
* `"server"` is the RSC graph — reached only through
|
|
644
|
+
* `@contentstack/studio-react/rsc`. `"client"` is everything else: the browser,
|
|
645
|
+
* the SSR pass of client components, and non-RSC hosts. The graph is decided by
|
|
646
|
+
* which entry point you import, not by runtime sniffing, so it stays correct
|
|
647
|
+
* under every bundler.
|
|
648
|
+
*/
|
|
649
|
+
type StudioGraph = "client" | "server";
|
|
650
|
+
/**
|
|
651
|
+
* Shape of the slot we own on globalThis. Each field is lazily initialized by
|
|
652
|
+
* the corresponding `get*Instance()` helper; storing `null` keeps the slot
|
|
653
|
+
* type-stable while letting each consumer create its instance on first access.
|
|
654
|
+
*/
|
|
655
|
+
interface GlobalStudioStore {
|
|
656
|
+
componentRegistry: unknown | null;
|
|
657
|
+
designRegistry: unknown | null;
|
|
658
|
+
breakpointManager: unknown | null;
|
|
659
|
+
stateStore: unknown | null;
|
|
660
|
+
functionRegistry: unknown | null;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Returns the SDK's versioned slot on globalThis, creating it on first call.
|
|
664
|
+
* Always returns the same object reference within a single JS runtime.
|
|
665
|
+
*
|
|
666
|
+
* Type-erased on purpose: each registry singleton casts to its own type on
|
|
667
|
+
* read/write so the public API of `studio-registry` stays free of cross-
|
|
668
|
+
* package import dependencies (e.g. `BreakpointManager` lives in
|
|
669
|
+
* `studio-client`).
|
|
670
|
+
*
|
|
671
|
+
* @param graph - which slot to read. Defaults to `"client"`; only the RSC
|
|
672
|
+
* entry passes `"server"`.
|
|
673
|
+
*/
|
|
674
|
+
declare function getGlobalStudioStore(graph?: StudioGraph): GlobalStudioStore;
|
|
675
|
+
/**
|
|
676
|
+
* Clears the store. For tests only. Production code should never call this —
|
|
677
|
+
* it would orphan every existing reference to the previous instances.
|
|
678
|
+
*
|
|
679
|
+
* @param graph - clears just that graph's slot. Omit to clear both.
|
|
680
|
+
*/
|
|
681
|
+
declare function resetGlobalStudioStore(graph?: StudioGraph): void;
|
|
682
|
+
|
|
617
683
|
/**
|
|
618
684
|
* Singleton ComponentRegistry, backed by a versioned slot on `globalThis`.
|
|
619
685
|
*
|
|
@@ -627,8 +693,30 @@ declare class ComponentRegistry<C> {
|
|
|
627
693
|
* After this change, all callers of `getComponentRegistryInstance()` resolve
|
|
628
694
|
* to the same `ComponentRegistry` instance within a single JS runtime,
|
|
629
695
|
* regardless of which graph or worker they were evaluated in.
|
|
696
|
+
*
|
|
697
|
+
* One exception: the RSC renderer has its own instance — see
|
|
698
|
+
* {@link getServerComponentRegistryInstance} and the "Why there are TWO slots"
|
|
699
|
+
* note in `common/global-store.ts`.
|
|
630
700
|
*/
|
|
631
701
|
declare function getComponentRegistryInstance(): ComponentRegistry<any>;
|
|
702
|
+
/**
|
|
703
|
+
* Singleton ComponentRegistry for the RSC (server) module graph, used only by
|
|
704
|
+
* `@contentstack/studio-react/rsc`.
|
|
705
|
+
*
|
|
706
|
+
* It is a SEPARATE instance from {@link getComponentRegistryInstance} on
|
|
707
|
+
* purpose. The two renderers need different values for the same component
|
|
708
|
+
* type — a client reference for the RSC renderer, the real implementation for
|
|
709
|
+
* the client renderer — and both graphs run in one process, sharing
|
|
710
|
+
* `globalThis`. One entry per type meant the first registration to arrive
|
|
711
|
+
* decided what the other renderer got, making correctness depend on request
|
|
712
|
+
* order (a Studio canvas request before the first visitor render was enough to
|
|
713
|
+
* break every visitor render for the life of the process).
|
|
714
|
+
*
|
|
715
|
+
* Consequence for consumers: registering in the browser/SSR graph no longer
|
|
716
|
+
* populates the RSC renderer. An app using `StudioServerComponent` must
|
|
717
|
+
* register from a server module through `@contentstack/studio-react/rsc`.
|
|
718
|
+
*/
|
|
719
|
+
declare function getServerComponentRegistryInstance(): ComponentRegistry<any>;
|
|
632
720
|
/**
|
|
633
721
|
* Resets the singleton instance.
|
|
634
722
|
* Primarily useful for testing to ensure a clean state between tests.
|
|
@@ -642,13 +730,14 @@ declare function getComponentRegistryInstance(): ComponentRegistry<any>;
|
|
|
642
730
|
* });
|
|
643
731
|
* ```
|
|
644
732
|
*/
|
|
645
|
-
declare function resetComponentRegistryInstance(): void;
|
|
733
|
+
declare function resetComponentRegistryInstance(graph?: StudioGraph): void;
|
|
646
734
|
/**
|
|
647
735
|
* Checks if the singleton instance has been created.
|
|
648
736
|
*
|
|
737
|
+
* @param graph - which graph's instance to check. Defaults to `"client"`.
|
|
649
738
|
* @returns true if the instance exists, false otherwise
|
|
650
739
|
*/
|
|
651
|
-
declare function hasComponentRegistryInstance(): boolean;
|
|
740
|
+
declare function hasComponentRegistryInstance(graph?: StudioGraph): boolean;
|
|
652
741
|
|
|
653
742
|
type DesignTokensInput = Partial<SectionDesignTokens> & Partial<GlobalDesignTokens>;
|
|
654
743
|
type DesignTokensInputKeys = keyof DesignTokensInput;
|
|
@@ -1450,20 +1539,6 @@ type PlaceHolders<T> = PartialRecord<PropType, (placeholder?: string) => T>;
|
|
|
1450
1539
|
* @throws {Error} - Throws an error if the prop type does not match the component registry or if the type is not handled.
|
|
1451
1540
|
*/
|
|
1452
1541
|
|
|
1453
|
-
/**
|
|
1454
|
-
* Retract every binding-mismatch error previously reported for `nodeUid`'s
|
|
1455
|
-
* props and forget them.
|
|
1456
|
-
*
|
|
1457
|
-
* The in-render retraction in `retrievePropValue` only clears the editor badge
|
|
1458
|
-
* when the SAME node re-renders with matching data — which never happens once
|
|
1459
|
-
* the node disappears (e.g. a repeater item removed, or a section swapped for a
|
|
1460
|
-
* different schema). Without this, such a node's badge would latch and its
|
|
1461
|
-
* entry would leak in `reportedBindingErrors` forever. Call this from the
|
|
1462
|
-
* node's unmount path so the badge reflects the live tree.
|
|
1463
|
-
*
|
|
1464
|
-
* Keys are `${nodeUid}-${field}`; the trailing `-` (and fixed-length uids)
|
|
1465
|
-
* makes the prefix match exact, so one node's uid can't match another's.
|
|
1466
|
-
*/
|
|
1467
1542
|
declare function clearReportedBindingErrorsForNode(nodeUid: string): void;
|
|
1468
1543
|
type CommonNodeProps<T> = T & {
|
|
1469
1544
|
binding?: string;
|
|
@@ -1510,6 +1585,7 @@ declare const getFlattenedData: (data: any) => any;
|
|
|
1510
1585
|
* single-select stored as `string[]` must still be unwrapped here before the type-mismatch fallback.
|
|
1511
1586
|
*/
|
|
1512
1587
|
declare function normalizeSingleSelectChoiceValue(resolvedData: unknown, prop: PropInput): unknown;
|
|
1588
|
+
declare const warnOnNonCssBoundValue: (key: string, value: unknown) => void;
|
|
1513
1589
|
declare const resolveMetadataBindings: (node: Node, data: ComposableStudioData) => void;
|
|
1514
1590
|
declare const getRepeaterContextPath: (binding: RepeaterBindingValue) => string;
|
|
1515
1591
|
declare function isDataMatchingPropType(data: unknown, type: BindableNodePropType): boolean;
|
|
@@ -1961,33 +2037,5 @@ declare function resetStudioFunctions(): void;
|
|
|
1961
2037
|
*/
|
|
1962
2038
|
declare function wrapActionProps<T extends Record<string, unknown>>(componentProps: Props | undefined, resolvedProps: T): T;
|
|
1963
2039
|
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
* the corresponding `get*Instance()` helper; storing `null` keeps the slot
|
|
1967
|
-
* type-stable while letting each consumer create its instance on first access.
|
|
1968
|
-
*/
|
|
1969
|
-
interface GlobalStudioStore {
|
|
1970
|
-
componentRegistry: unknown | null;
|
|
1971
|
-
designRegistry: unknown | null;
|
|
1972
|
-
breakpointManager: unknown | null;
|
|
1973
|
-
stateStore: unknown | null;
|
|
1974
|
-
functionRegistry: unknown | null;
|
|
1975
|
-
}
|
|
1976
|
-
/**
|
|
1977
|
-
* Returns the SDK's versioned slot on globalThis, creating it on first call.
|
|
1978
|
-
* Always returns the same object reference within a single JS runtime.
|
|
1979
|
-
*
|
|
1980
|
-
* Type-erased on purpose: each registry singleton casts to its own type on
|
|
1981
|
-
* read/write so the public API of `studio-registry` stays free of cross-
|
|
1982
|
-
* package import dependencies (e.g. `BreakpointManager` lives in
|
|
1983
|
-
* `studio-client`).
|
|
1984
|
-
*/
|
|
1985
|
-
declare function getGlobalStudioStore(): GlobalStudioStore;
|
|
1986
|
-
/**
|
|
1987
|
-
* Clears the entire store. For tests only. Production code should never call
|
|
1988
|
-
* this — it would orphan every existing reference to the previous instances.
|
|
1989
|
-
*/
|
|
1990
|
-
declare function resetGlobalStudioStore(): void;
|
|
1991
|
-
|
|
1992
|
-
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, StudioStateStore, callStudioFunction, clearReportedBindingErrorsForNode, collectStateBindingKeys, convertBindingPath, getBindingString, getComponentRegistryInstance, getCslpPath, getCslpTag, getDataType, getDefaultPropStaticValue, getDesignClassesNames, getDesignRegistryInstance, getFlattenedData, getGlobalStudioStore, getNodeBoundFunctionName, getPlaceHolderComponent, getRepeaterBinding, getRepeaterContextPath, getSectionUIDFromNode, getSlotData, getStateDefaultsFor, getStateStoreInstance, getStateValuesFor, getStudioFunctionNames, getStudioStateSnapshot, hasComponentRegistryInstance, hasDesignRegistryInstance, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, registerComponentStateVariable, registerGlobalStateVariables, registerStudioFunctions, resetComponentRegistryInstance, resetDesignRegistryInstance, resetGlobalStudioStore, resetStateStoreInstance, resetStudioFunctions, resolveMetadataBindings, retrievePropValue, studioState, subscribeStudioFunctionsChanged, subscribeStudioStateVariablesChanged, wrapActionProps };
|
|
1993
|
-
export type { ActionProp, 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, GlobalStudioStore, HrefProp, ICSEntryReference, ImageUrlProp, InternalComponentRegistryOptions, JSONRTERegistryOptions, JsonRTEProp, LayerIcon, LengthToken, MultiChoiceProp, NodeProps, NumberProp, ObjectInput, ObjectProp, PlaceHolders, PlainTextProp, PreProcessedBreakpoint, PreProcessedDesignTokenInput, PropBase, PropInput, PropType, PropTypeOfNoOptionsRequired, PropValidator, Props, PropsWithNoOptionsRequired, RawStaticValue, RegisterComponentOptionsInput, RegisterComponentSchema, RegisterComponentSchemaInput, RegisterInternalComponentOptionsInput, Registry, RepeaterBindingValue, SectionDesignTokens, SectionScopedDataSources, SingleChoiceProp, SlotProp, StateUnsubscribe, StateUpdater, StateVariableDef, StateVariableTier, StateVariableType, StaticValue, StaticValueItem, StaticValueUid, StringProp, StudioFunction, StudioFunctionCtx, StudioSpecData, StudioStateConfig, StudioStateStorage, StyleGroupOptions, StyleSectionCategoriesOptions, StyleSectionOptions, StyleSections, TemplateBindingValue };
|
|
2040
|
+
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, StudioStateStore, callStudioFunction, clearReportedBindingErrorsForNode, collectStateBindingKeys, convertBindingPath, getBindingString, getComponentRegistryInstance, getCslpPath, getCslpTag, getDataType, getDefaultPropStaticValue, getDesignClassesNames, getDesignRegistryInstance, getFlattenedData, getGlobalStudioStore, getNodeBoundFunctionName, getPlaceHolderComponent, getRepeaterBinding, getRepeaterContextPath, getSectionUIDFromNode, getServerComponentRegistryInstance, getSlotData, getStateDefaultsFor, getStateStoreInstance, getStateValuesFor, getStudioFunctionNames, getStudioStateSnapshot, hasComponentRegistryInstance, hasDesignRegistryInstance, isClientReferenceComponent, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, registerComponentStateVariable, registerGlobalStateVariables, registerStudioFunctions, resetComponentRegistryInstance, resetDesignRegistryInstance, resetGlobalStudioStore, resetStateStoreInstance, resetStudioFunctions, resolveMetadataBindings, retrievePropValue, studioState, subscribeStudioFunctionsChanged, subscribeStudioStateVariablesChanged, warnOnNonCssBoundValue, wrapActionProps };
|
|
2041
|
+
export type { ActionProp, 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, GlobalStudioStore, HrefProp, ICSEntryReference, ImageUrlProp, InternalComponentRegistryOptions, JSONRTERegistryOptions, JsonRTEProp, LayerIcon, LengthToken, MultiChoiceProp, NodeProps, NumberProp, ObjectInput, ObjectProp, PlaceHolders, PlainTextProp, PreProcessedBreakpoint, PreProcessedDesignTokenInput, PropBase, PropInput, PropType, PropTypeOfNoOptionsRequired, PropValidator, Props, PropsWithNoOptionsRequired, RawStaticValue, RegisterComponentOptionsInput, RegisterComponentSchema, RegisterComponentSchemaInput, RegisterInternalComponentOptionsInput, Registry, RepeaterBindingValue, SectionDesignTokens, SectionScopedDataSources, SingleChoiceProp, SlotProp, StateUnsubscribe, StateUpdater, StateVariableDef, StateVariableTier, StateVariableType, StaticValue, StaticValueItem, StaticValueUid, StringProp, StudioFunction, StudioFunctionCtx, StudioGraph, StudioSpecData, StudioStateConfig, StudioStateStorage, StyleGroupOptions, StyleSectionCategoriesOptions, StyleSectionOptions, StyleSections, TemplateBindingValue };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { ComponentRegistry } from './component-registry/registry.js';
|
|
1
|
+
export { ComponentRegistry, isClientReferenceComponent } 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
|
+
export { getComponentRegistryInstance, getServerComponentRegistryInstance, hasComponentRegistryInstance, resetComponentRegistryInstance } from './component-registry/singleton.js';
|
|
4
4
|
export { DesignRegistry } from './design-registry/design-registry.js';
|
|
5
5
|
export { getDesignRegistryInstance, hasDesignRegistryInstance, resetDesignRegistryInstance } from './design-registry/singleton.js';
|
|
6
6
|
export { getDesignClassesNames } from './design-registry/design-classes.js';
|
|
7
7
|
export { ALLOWED_DESIGN_VALUES_LEVELS, DEFAULT_DESIGN_TOKENS } from './design-registry/constants.js';
|
|
8
8
|
export { JSONRTERegistry } from './json-rte-registry/index.js';
|
|
9
9
|
export { clearReportedBindingErrorsForNode, retrievePropValue } from './data-binder/retrieve-data.js';
|
|
10
|
-
export { convertBindingPath, getBindingString, getDataType, getDefaultPropStaticValue, getFlattenedData, getPlaceHolderComponent, getRepeaterContextPath, getSlotData, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, resolveMetadataBindings } from './data-binder/retrieve-data.util.js';
|
|
10
|
+
export { convertBindingPath, getBindingString, getDataType, getDefaultPropStaticValue, getFlattenedData, getPlaceHolderComponent, getRepeaterContextPath, getSlotData, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, resolveMetadataBindings, warnOnNonCssBoundValue } from './data-binder/retrieve-data.util.js';
|
|
11
11
|
export { getCslpPath, getCslpTag, getRepeaterBinding } from './data-binder/cslp.js';
|
|
12
12
|
export { collectStateBindingKeys, getNodeBoundFunctionName, getStateDefaultsFor, getStateValuesFor } from './data-binder/state-binding.util.js';
|
|
13
13
|
export { BreakpointRegistry } from './breakpoint-registry/index.js';
|
|
@@ -22,7 +22,7 @@ function notifyFunctionsChanged() {
|
|
|
22
22
|
listener();
|
|
23
23
|
}
|
|
24
24
|
catch (err) {
|
|
25
|
-
console.error("[
|
|
25
|
+
console.error("[Contentstack Studio] studio-functions change listener threw:", err);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -61,11 +61,11 @@ function registerStudioFunctions(functions) {
|
|
|
61
61
|
const registry = getRegistry();
|
|
62
62
|
for (const [name, fn] of Object.entries(functions ?? {})) {
|
|
63
63
|
if (typeof fn !== "function") {
|
|
64
|
-
console.warn(`[
|
|
64
|
+
console.warn(`[Contentstack Studio] registerStudioFunctions: "${name}" is not a function — skipped`);
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
67
|
if (registry.functions.has(name) && isDev()) {
|
|
68
|
-
console.warn(`[
|
|
68
|
+
console.warn(`[Contentstack Studio] studio function "${name}" re-registered (overwriting previous)`);
|
|
69
69
|
}
|
|
70
70
|
registry.functions.set(name, fn);
|
|
71
71
|
}
|
|
@@ -89,7 +89,7 @@ function getStudioFunctionNames() {
|
|
|
89
89
|
function callStudioFunction(name, ...args) {
|
|
90
90
|
const fn = getRegistry().functions.get(name);
|
|
91
91
|
if (!fn) {
|
|
92
|
-
console.warn(`[
|
|
92
|
+
console.warn(`[Contentstack Studio] studio function "${name}" is not registered. Did you call registerStudioFunctions()?`);
|
|
93
93
|
return undefined;
|
|
94
94
|
}
|
|
95
95
|
const store = getStateStoreInstance();
|
|
@@ -107,14 +107,14 @@ function callStudioFunction(name, ...args) {
|
|
|
107
107
|
typeof result.then === "function" &&
|
|
108
108
|
typeof result.catch === "function") {
|
|
109
109
|
return result.catch((err) => {
|
|
110
|
-
console.error(`[
|
|
110
|
+
console.error(`[Contentstack Studio] studio function "${name}" rejected:`, err);
|
|
111
111
|
return undefined;
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
return result;
|
|
115
115
|
}
|
|
116
116
|
catch (err) {
|
|
117
|
-
console.error(`[
|
|
117
|
+
console.error(`[Contentstack Studio] studio function "${name}" threw:`, err);
|
|
118
118
|
return undefined;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-registry.js","sources":["../../../src/state-store/function-registry.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAmCA,SAAS,WAAW,GAAA;AAClB,IAAA,MAAM,KAAK,GAAG,oBAAoB,EAEjC;AACD,IAAA,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;QAC3B,KAAK,CAAC,gBAAgB,GAAG;YACvB,SAAS,EAAE,IAAI,GAAG,EAAE;YACpB,eAAe,EAAE,IAAI,GAAG,EAAE;SAC3B;IACH;;;AAGA,IAAA,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,eAAe,EAAE;QAC3C,KAAK,CAAC,gBAAgB,CAAC,eAAe,GAAG,IAAI,GAAG,EAAE;IACpD;IACA,OAAO,KAAK,CAAC,gBAAgB;AAC/B;AAEA,SAAS,sBAAsB,GAAA;IAC7B,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,WAAW,EAAE,CAAC,eAAe,CAAC,EAAE;AACzD,QAAA,IAAI;AACF,YAAA,QAAQ,EAAE;QACZ;QAAE,OAAO,GAAG,EAAE;AACZ,YAAA,OAAO,CAAC,KAAK,CACX,
|
|
1
|
+
{"version":3,"file":"function-registry.js","sources":["../../../src/state-store/function-registry.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAmCA,SAAS,WAAW,GAAA;AAClB,IAAA,MAAM,KAAK,GAAG,oBAAoB,EAEjC;AACD,IAAA,I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C,IAAI,KAAK,UAAU;AACvD,YAAA,OAAQ,MAA2B,CAAC,KAAK,KAAK,UAAU,EACxD;AACA,YAAA,OAAQ,MAA2B,CAAC,KAAK,CAAC,CAAC,GAAG,KAAI;gBAChD,OAAO,CAAC,KAAK,CACX,CAAA,uCAAA,EAA0C,IAAI,CAAA,WAAA,CAAa,EAC3D,GAAG,CACJ;AACD,gBAAA,OAAO,SAAS;AAClB,YAAA,CAAC,CAAC;QACJ;AACA,QAAA,OAAO,MAAM;IACf;IAAE,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CACX,CAAA,uCAAA,EAA0C,IAAI,CAAA,QAAA,CAAU,EACxD,GAAG,CACJ;AACD,QAAA,OAAO,SAAS;IAClB;AACF;AAEA;SACgB,oBAAoB,GAAA;AAClC,IAAA,WAAW,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE;AAC/B,IAAA,sBAAsB,EAAE;AAC1B;;;;"}
|
|
@@ -24,7 +24,7 @@ import { getStateStoreInstance } from './singleton.js';
|
|
|
24
24
|
*/
|
|
25
25
|
function registerComponentStateVariable(key, options) {
|
|
26
26
|
if (!key || typeof key !== "string") {
|
|
27
|
-
throw new Error("[
|
|
27
|
+
throw new Error("[Contentstack Studio] registerComponentStateVariable requires a non-empty string key");
|
|
28
28
|
}
|
|
29
29
|
getStateStoreInstance().declareVariable(key, options, "component");
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sources":["../../../src/state-store/public-api.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;;;AAqBG;AACG,SAAU,8BAA8B,CAC5C,GAAW,EACX,OAAyB,EAAA;IAEzB,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AACnC,QAAA,MAAM,IAAI,KAAK,CACb,
|
|
1
|
+
{"version":3,"file":"public-api.js","sources":["../../../src/state-store/public-api.ts"],"sourcesContent":[null],"names":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AU,4BAA4B,CAC1C,SAA2C,EAAA;AAE3C,IAAA,MAAM,KAAK,GAAG,qBAAqB,EAAE;AACrC,IAAA,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE;QACxD,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC;IACzC;AACF;;;;"}
|
|
@@ -110,7 +110,7 @@ class StudioStateStore {
|
|
|
110
110
|
this.externalUnsubs.clear();
|
|
111
111
|
if (storage === "custom") {
|
|
112
112
|
if (!hasCustomFns) {
|
|
113
|
-
throw new Error('[
|
|
113
|
+
throw new Error('[Contentstack Studio] state storage "custom" requires getState and setState functions');
|
|
114
114
|
}
|
|
115
115
|
this.userConfig = {
|
|
116
116
|
getState: config.getState,
|
|
@@ -120,7 +120,7 @@ class StudioStateStore {
|
|
|
120
120
|
}
|
|
121
121
|
else {
|
|
122
122
|
if (hasCustomFns && isDev()) {
|
|
123
|
-
console.warn(`[
|
|
123
|
+
console.warn(`[Contentstack Studio] state storage "${storage}" uses the built-in store — the provided getState/setState are ignored (use storage: "custom" to keep them)`);
|
|
124
124
|
}
|
|
125
125
|
this.userConfig = createWebStorageBackend(storage, config.storageKey ?? DEFAULT_STORAGE_KEY);
|
|
126
126
|
}
|
|
@@ -172,7 +172,7 @@ class StudioStateStore {
|
|
|
172
172
|
this.externalUnsubs.set(key, typeof unsub === "function" ? unsub : () => { });
|
|
173
173
|
}
|
|
174
174
|
catch (err) {
|
|
175
|
-
console.error(`[
|
|
175
|
+
console.error(`[Contentstack Studio] state subscribe("${key}") threw:`, err);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
isConfigured() {
|
|
@@ -204,7 +204,7 @@ class StudioStateStore {
|
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
if (existing.type !== def.type && isDev()) {
|
|
207
|
-
console.warn(`[
|
|
207
|
+
console.warn(`[Contentstack Studio] state variable "${key}" already declared as "${existing.type}"; ignoring re-declaration as "${def.type}"`);
|
|
208
208
|
}
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
@@ -237,7 +237,7 @@ class StudioStateStore {
|
|
|
237
237
|
listener();
|
|
238
238
|
}
|
|
239
239
|
catch (err) {
|
|
240
|
-
console.error("[
|
|
240
|
+
console.error("[Contentstack Studio] state variables-changed listener threw:", err);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -260,7 +260,7 @@ class StudioStateStore {
|
|
|
260
260
|
return this.userConfig.getState(key);
|
|
261
261
|
}
|
|
262
262
|
catch (err) {
|
|
263
|
-
console.error(`[
|
|
263
|
+
console.error(`[Contentstack Studio] getState("${key}") threw:`, err);
|
|
264
264
|
return undefined;
|
|
265
265
|
}
|
|
266
266
|
}
|
|
@@ -277,7 +277,7 @@ class StudioStateStore {
|
|
|
277
277
|
if (isServer()) {
|
|
278
278
|
if (!this.warnedServerSet && isDev()) {
|
|
279
279
|
this.warnedServerSet = true;
|
|
280
|
-
console.warn("[
|
|
280
|
+
console.warn("[Contentstack Studio] setState is a no-op during server rendering — state writes are client-only");
|
|
281
281
|
}
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
@@ -338,7 +338,7 @@ class StudioStateStore {
|
|
|
338
338
|
listener();
|
|
339
339
|
}
|
|
340
340
|
catch (err) {
|
|
341
|
-
console.error(`[
|
|
341
|
+
console.error(`[Contentstack Studio] state listener for "${key}" threw:`, err);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-store.js","sources":["../../../src/state-store/state-store.ts"],"sourcesContent":[null],"names":[],"mappings":"AAQA,MAAM,QAAQ,GAAG,MAAM,OAAO,MAAM,KAAK,WAAW;AAEpD,MAAM,KAAK,GAAG,MACZ,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KA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EAAE;YACZ;YAAE,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,KAAK,CACX,CAAA,0CAAA,EAA6C,GAAG,CAAA,QAAA,CAAU,EAC1D,GAAG,CACJ;YACH;QACF;IACF;AAEA;;;;;;;;;;;AAWG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;AACrB,QAAA,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE;AAC5C,YAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;QAClB;QACA,IAAI,CAAC,sBAAsB,EAAE;IAC/B;AAEA;;;;AAIG;IACH,QAAQ,GAAA;QACN,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;AAAE,YAAA,KAAK,EAAE;AACzD,QAAA,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE;AAC3B,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;AACrB,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;AACtB,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;AACtB,QAAA,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;AAC1B,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI;AACtB,QAAA,IAAI,CAAC,eAAe,GAAG,KAAK;QAC5B,IAAI,CAAC,sBAAsB,EAAE;IAC/B;AACD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/studio-registry",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
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",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@contentstack/common-config": "^1.2.
|
|
22
|
-
"@contentstack/studio-internal": "^1.
|
|
21
|
+
"@contentstack/common-config": "^1.2.6",
|
|
22
|
+
"@contentstack/studio-internal": "^1.8.1",
|
|
23
23
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
24
24
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
25
25
|
"@rollup/plugin-terser": "^1.0.0",
|
|
@@ -30,7 +30,13 @@
|
|
|
30
30
|
"rollup-plugin-node-externals": "^8.0.1",
|
|
31
31
|
"rollup-plugin-preserve-directives": "^0.4.0"
|
|
32
32
|
},
|
|
33
|
-
"sideEffects":
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"./dist/esm/data-binder/retrieve-data.util.js",
|
|
35
|
+
"./dist/cjs/data-binder/retrieve-data.util.js",
|
|
36
|
+
"./dist/esm/studio-registry/src/data-binder/retrieve-data.util.js",
|
|
37
|
+
"./dist/cjs/studio-registry/src/data-binder/retrieve-data.util.js",
|
|
38
|
+
"./src/data-binder/retrieve-data.util.ts"
|
|
39
|
+
],
|
|
34
40
|
"exports": {
|
|
35
41
|
".": {
|
|
36
42
|
"import": {
|
|
@@ -56,8 +62,8 @@
|
|
|
56
62
|
"license": "MIT",
|
|
57
63
|
"dependencies": {
|
|
58
64
|
"@contentstack/json-rte-serializer": "^3.1.0",
|
|
59
|
-
"@contentstack/studio-message-types": "^1.
|
|
60
|
-
"@contentstack/studio-messenger": "^3.
|
|
65
|
+
"@contentstack/studio-message-types": "^2.1.0",
|
|
66
|
+
"@contentstack/studio-messenger": "^3.2.1",
|
|
61
67
|
"csstype": "^3.1.3",
|
|
62
68
|
"lodash-es": "^4.18.1"
|
|
63
69
|
},
|