@contentstack/studio-registry 1.4.1 → 1.6.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 +159 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/component-registry/registry-options-processor.js +36 -0
- package/dist/esm/component-registry/registry-options-processor.js.map +1 -1
- package/dist/esm/component-registry/registry.constant.js +1 -0
- package/dist/esm/component-registry/registry.constant.js.map +1 -1
- package/dist/esm/data-binder/retrieve-data.js +115 -2
- package/dist/esm/data-binder/retrieve-data.js.map +1 -1
- package/dist/esm/data-binder/retrieve-data.util.js +7 -1
- package/dist/esm/data-binder/retrieve-data.util.js.map +1 -1
- package/dist/esm/index.d.ts +94 -4
- package/dist/esm/index.js +1 -1
- package/package.json +7 -7
|
@@ -14,6 +14,7 @@ function getDefaultComponentSchemaInput(options) {
|
|
|
14
14
|
hideFromComponentList: false,
|
|
15
15
|
registry: "user-defined",
|
|
16
16
|
icon: "",
|
|
17
|
+
layerIcon: "",
|
|
17
18
|
metadata: {},
|
|
18
19
|
styles: {
|
|
19
20
|
default: {
|
|
@@ -76,6 +77,16 @@ function processRegistryOptions(userConfig, options) {
|
|
|
76
77
|
if ("icon" in userConfig && userConfig.icon) {
|
|
77
78
|
defaultOptions.icon = userConfig.icon;
|
|
78
79
|
}
|
|
80
|
+
if (userConfig.layerIcon) {
|
|
81
|
+
if (isValidLayerIcon(userConfig.layerIcon)) {
|
|
82
|
+
defaultOptions.layerIcon = userConfig.layerIcon;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// Don't break registration over a bad icon — drop it and fall back to the default glyph.
|
|
86
|
+
console.warn(`[studio] Ignoring invalid \`layerIcon\` for component "${userConfig.type}". ` +
|
|
87
|
+
`Expected an inline SVG string, an absolute http(s)/data:image URL, or a servable relative path.`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
79
90
|
if (userConfig.metadata) {
|
|
80
91
|
defaultOptions.metadata = userConfig.metadata;
|
|
81
92
|
}
|
|
@@ -84,6 +95,31 @@ function processRegistryOptions(userConfig, options) {
|
|
|
84
95
|
propValidators,
|
|
85
96
|
};
|
|
86
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Light, render-agnostic check that a `layerIcon` value is plausibly an inline SVG,
|
|
100
|
+
* an image URL, or a servable path. This is developer feedback only — the Studio
|
|
101
|
+
* builder still sanitizes/validates authoritatively at render time, since the value
|
|
102
|
+
* crosses the postMessage boundary untrusted.
|
|
103
|
+
*/
|
|
104
|
+
function isValidLayerIcon(value) {
|
|
105
|
+
if (typeof value !== "string")
|
|
106
|
+
return false;
|
|
107
|
+
const v = value.trim();
|
|
108
|
+
if (!v)
|
|
109
|
+
return false;
|
|
110
|
+
// Inline SVG markup (with or without an xml prolog).
|
|
111
|
+
if (v.startsWith("<"))
|
|
112
|
+
return v.includes("<svg");
|
|
113
|
+
// Absolute http(s) URL.
|
|
114
|
+
if (/^https?:\/\//i.test(v))
|
|
115
|
+
return true;
|
|
116
|
+
// A data URI must be an image.
|
|
117
|
+
if (/^data:/i.test(v))
|
|
118
|
+
return /^data:image\//i.test(v);
|
|
119
|
+
// A relative/root-relative asset path. Must be explicitly path-shaped — a bare token
|
|
120
|
+
// (e.g. a built-in icon NAME like "ComponentBox") is NOT a valid layerIcon.
|
|
121
|
+
return v.startsWith("/") || v.startsWith("./") || v.startsWith("../");
|
|
122
|
+
}
|
|
87
123
|
function processStylesOptionsStyleSections(styleSections, defaultStyleSections) {
|
|
88
124
|
if (typeof styleSections === "undefined" || styleSections === "all") {
|
|
89
125
|
return defaultStyleSections;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-options-processor.js","sources":["../../../src/component-registry/registry-options-processor.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAuBA,SAAS,8BAA8B,CAAI,OAG1C,EAAA;IACC,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,IAAI,EAA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IACvC;
|
|
1
|
+
{"version":3,"file":"registry-options-processor.js","sources":["../../../src/component-registry/registry-options-processor.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAuBA,SAAS,8BAA8B,CAAI,OAG1C,EAAA;IACC,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,QAAA,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,OAAO,CAAC,IAAI;AACzB,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,uBAAuB,EAAE,KAAK;AAC9B,QAAA,qBAAqB,EAAE,KAAK;AAC5B,QAAA,QAAQ,EAAE,cAAc;AACxB,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,SAAS,EAAE,EAAE;AACb,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,MAAM,EAAE;AACN,YAAA,OAAO,EAAE;AACP,gBAAA,cAAc,EAAE,EAAE;AAClB,gBAAA,aAAa,EAAE,EAAE;gBACjB,aAAa,EAAE,eAAe,EAAE;AAChC,gBAAA,WAAW,EAAE,SAAS;AACvB,aAAA;AACF,SAAA;AACD,QAAA,KAAK,EAAE,EAAE;KACV;AACH;AAEM,SAAU,sBAAsB,CACpC,UAE4C,EAC5C,OAEC,EAAA;IAKD,IAAI,cAAc,GAAG,EAAE;AAEvB,IAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AACpB,QAAA,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC;IAChD;IAEA,IAAI,UAAU,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE;AAC1D,QAAA,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC;IAC3C;IAEA,MAAM,cAAc,GAAG,8BAA8B,CAAC;QACpD,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,SAAS,EAAE,UAAU,CAAC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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.constant.js","sources":["../../../src/component-registry/registry.constant.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,mBAAmB,GAAG;AAE5B,MAAM,YAAY,GAAG;AAC1B,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,KAAK,EAAE,sBAAsB;AAC7B,IAAA,YAAY,EAAE,cAAc;;AAGvB,MAAM,2BAA2B,GAAG;AACzC,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,qBAAqB,EAAE,uBAAuB;AAC9C,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,mBAAmB,EAAE,UAAU;;AAG1B,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,2BAA2B;AAEnE,MAAM,sBAAsB,GAAG;IACpC,OAAO;IACP,MAAM;IACN,SAAS;IACT,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,YAAY;IACZ,WAAW;IACX,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,YAAY;;AAGd;;;;AAIG;AACI,MAAM,wBAAwB,GAAG;AACtC,IAAA,KAAK,EAAE;QACL,OAAO;QACP,MAAM;QACN,SAAS;QACT,UAAU;QACV,YAAY;QACZ,QAAQ;QACR,YAAY;QACZ,QAAQ;QACR,QAAQ;QACR,UAAU;QACV,QAAQ;QACR,YAAY;AACb,KAAA;IACD,IAAI,EAAE,CAAC,YAAY,CAAC;;AAMf,MAAM,yBAAyB,GAAG;;AAEvC,IAAA,IAAI,EAAE,MAAM;;AAGZ,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,UAAU,EAAE,YAAY;;
|
|
1
|
+
{"version":3,"file":"registry.constant.js","sources":["../../../src/component-registry/registry.constant.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,mBAAmB,GAAG;AAE5B,MAAM,YAAY,GAAG;AAC1B,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,KAAK,EAAE,sBAAsB;AAC7B,IAAA,YAAY,EAAE,cAAc;;AAGvB,MAAM,2BAA2B,GAAG;AACzC,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,qBAAqB,EAAE,uBAAuB;AAC9C,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,mBAAmB,EAAE,UAAU;;AAG1B,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,2BAA2B;AAEnE,MAAM,sBAAsB,GAAG;IACpC,OAAO;IACP,MAAM;IACN,SAAS;IACT,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,YAAY;IACZ,WAAW;IACX,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR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AAM,mBAAmB,GAAG;;AAEjC,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,gBAAgB,EAAE,kBAAkB;;AAGpC,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,KAAK,EAAE,OAAO;;AAGd,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,OAAO,EAAE,QAAQ;AACjB,IAAA,IAAI,EAAE,QAAQ;;;;;"}
|
|
@@ -7,6 +7,48 @@ import { dataSourceCapabilities } from './strategies/dataSourceCapabilities.js';
|
|
|
7
7
|
import { getRegistryErrorMessage } from '../utils/registry-error-messages.js';
|
|
8
8
|
import { RegistryErrorMessageKey } from '../utils/registry-error-messages.default.js';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Prop keys (`<nodeUid>-<field>`) for which a binding-type-mismatch error has
|
|
12
|
+
* been reported to the editor and not yet retracted.
|
|
13
|
+
*
|
|
14
|
+
* The editor's "Data Mismatch Found" badge is driven entirely by the
|
|
15
|
+
* UPDATE_BINDING_ERRORS messages we send from here — it has no other source of
|
|
16
|
+
* truth. Previously we only ever SENT errors and never retracted them, so a
|
|
17
|
+
* transient mismatch (e.g. a section repeater bound to scope-root that briefly
|
|
18
|
+
* sees the whole entry OBJECT while a freshly-swapped schema re-scopes) left a
|
|
19
|
+
* sticky error that survived even after the data resolved correctly. Tracking
|
|
20
|
+
* what we've reported lets us emit a one-shot retraction the moment the data
|
|
21
|
+
* matches again, so the badge reflects the live render instead of latching.
|
|
22
|
+
*/
|
|
23
|
+
const reportedBindingErrors = new Set();
|
|
24
|
+
/**
|
|
25
|
+
* Retract every binding-mismatch error previously reported for `nodeUid`'s
|
|
26
|
+
* props and forget them.
|
|
27
|
+
*
|
|
28
|
+
* The in-render retraction in `retrievePropValue` only clears the editor badge
|
|
29
|
+
* when the SAME node re-renders with matching data — which never happens once
|
|
30
|
+
* the node disappears (e.g. a repeater item removed, or a section swapped for a
|
|
31
|
+
* different schema). Without this, such a node's badge would latch and its
|
|
32
|
+
* entry would leak in `reportedBindingErrors` forever. Call this from the
|
|
33
|
+
* node's unmount path so the badge reflects the live tree.
|
|
34
|
+
*
|
|
35
|
+
* Keys are `${nodeUid}-${field}`; the trailing `-` (and fixed-length uids)
|
|
36
|
+
* makes the prefix match exact, so one node's uid can't match another's.
|
|
37
|
+
*/
|
|
38
|
+
function clearReportedBindingErrorsForNode(nodeUid) {
|
|
39
|
+
if (reportedBindingErrors.size === 0)
|
|
40
|
+
return;
|
|
41
|
+
const prefix = `${nodeUid}-`;
|
|
42
|
+
for (const propKey of reportedBindingErrors) {
|
|
43
|
+
if (!propKey.startsWith(prefix))
|
|
44
|
+
continue;
|
|
45
|
+
reportedBindingErrors.delete(propKey);
|
|
46
|
+
composableStudioEventManager?.send(POST_MESSAGE_EVENTS.UPDATE_BINDING_ERRORS, {
|
|
47
|
+
propKey,
|
|
48
|
+
errorMessage: "",
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
10
52
|
// Responsible for resolving props to values
|
|
11
53
|
function retrievePropValue(args) {
|
|
12
54
|
const { data, componentOptions, node, cslp, placeholders = {}, getSlots, jsonRTE, isCompositionBeingEdited, } = args;
|
|
@@ -35,6 +77,11 @@ function retrievePropValue(args) {
|
|
|
35
77
|
return;
|
|
36
78
|
}
|
|
37
79
|
let resolvedData;
|
|
80
|
+
// When the value is resolved via the `dataSources.page.*` fallback below,
|
|
81
|
+
// the CSLP tag must come from the SAME page path (not the section-local
|
|
82
|
+
// binding, which missed). Holds that page path so the cslp block points the
|
|
83
|
+
// edit tag at the field the value actually came from.
|
|
84
|
+
let cslpPathOverride;
|
|
38
85
|
if (type === "slot") {
|
|
39
86
|
resolvedData = getSlotData({
|
|
40
87
|
nodeProps: nodeProps,
|
|
@@ -55,6 +102,20 @@ function retrievePropValue(args) {
|
|
|
55
102
|
const overridesForNode = data.dataSources?.section_exposed_overrides?.[node.uid];
|
|
56
103
|
if (overridesForNode && field in overridesForNode) {
|
|
57
104
|
mappedData[field] = overridesForNode[field];
|
|
105
|
+
// Carry the page-resolved CSLP tag for this exposed prop. This branch
|
|
106
|
+
// short-circuits BEFORE the cslp block (~L430), so without re-emitting
|
|
107
|
+
// here a page-overridden field (e.g. a section's root component bound via
|
|
108
|
+
// a non-repeater binding) renders with no `data-cslp` and loses its
|
|
109
|
+
// live-preview edit overlay — even though its value resolves fine. The
|
|
110
|
+
// SectionComposition wrappers stash the page node's resolved cslp object
|
|
111
|
+
// alongside the value under `$<propKey>`, so it points at the PAGE entry
|
|
112
|
+
// field (the override's source of truth). Repeater-context exposed props
|
|
113
|
+
// are never in this map (they fall through to their own binding + cslp).
|
|
114
|
+
if (cslp.appendTags) {
|
|
115
|
+
const overrideCslp = overridesForNode[`$${field}`];
|
|
116
|
+
if (overrideCslp)
|
|
117
|
+
mappedData[`$${field}`] = overrideCslp;
|
|
118
|
+
}
|
|
58
119
|
return;
|
|
59
120
|
}
|
|
60
121
|
const nodePropConfig = nodeProps[field];
|
|
@@ -146,6 +207,8 @@ function retrievePropValue(args) {
|
|
|
146
207
|
const pageResolved = get(data, pagePath, undefined);
|
|
147
208
|
if (pageResolved !== undefined && pageResolved !== null) {
|
|
148
209
|
resolvedData = pageResolved;
|
|
210
|
+
// Mirror the value's source so the cslp block tags the page field.
|
|
211
|
+
cslpPathOverride = pagePath;
|
|
149
212
|
}
|
|
150
213
|
}
|
|
151
214
|
// Handle primitive values in repeater context
|
|
@@ -252,6 +315,7 @@ function retrievePropValue(args) {
|
|
|
252
315
|
});
|
|
253
316
|
if (isCompositionBeingEdited) {
|
|
254
317
|
// In editor mode: Send to Visual Builder
|
|
318
|
+
reportedBindingErrors.add(`${node.uid}-${field}`);
|
|
255
319
|
composableStudioEventManager?.send(POST_MESSAGE_EVENTS.UPDATE_BINDING_ERRORS, {
|
|
256
320
|
propKey: `${node.uid}-${field}`,
|
|
257
321
|
errorMessage: getRegistryErrorMessage(RegistryErrorMessageKey.DATA_BINDING_TYPE_MISMATCH_EDITOR, { expectedType: type, receivedType }),
|
|
@@ -270,6 +334,21 @@ function retrievePropValue(args) {
|
|
|
270
334
|
});
|
|
271
335
|
}
|
|
272
336
|
}
|
|
337
|
+
else if (isCompositionBeingEdited) {
|
|
338
|
+
// Data now matches the prop type. If we previously reported a mismatch for
|
|
339
|
+
// this prop, retract it (empty errorMessage → the editor calls
|
|
340
|
+
// removeBindingError) so a stale "Data Mismatch Found" badge doesn't
|
|
341
|
+
// persist after the binding re-resolves — e.g. once a swapped section
|
|
342
|
+
// schema finishes re-scoping a repeater's items to its array field.
|
|
343
|
+
const propKey = `${node.uid}-${field}`;
|
|
344
|
+
if (reportedBindingErrors.has(propKey)) {
|
|
345
|
+
reportedBindingErrors.delete(propKey);
|
|
346
|
+
composableStudioEventManager?.send(POST_MESSAGE_EVENTS.UPDATE_BINDING_ERRORS, {
|
|
347
|
+
propKey,
|
|
348
|
+
errorMessage: "",
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
273
352
|
mappedData[field] = resolvedData;
|
|
274
353
|
if (type === "json_rte") {
|
|
275
354
|
mappedData["jsonConfig"] = jsonRTE;
|
|
@@ -277,7 +356,13 @@ function retrievePropValue(args) {
|
|
|
277
356
|
const isCSLPAbleType = bindedField?.type &&
|
|
278
357
|
dataSourceCapabilities[bindedField.type]?.supportsCslp;
|
|
279
358
|
if (cslp.appendTags && dataPath && isCSLPAbleType) {
|
|
280
|
-
|
|
359
|
+
// Use the page-fallback path when the value came from there (cross-section
|
|
360
|
+
// / slot-child page binding), so the edit tag points at the field that
|
|
361
|
+
// actually supplied the value; otherwise the section-local binding path.
|
|
362
|
+
const cslpValue = getCslpTag({
|
|
363
|
+
bindedField: cslpPathOverride ?? dataPath,
|
|
364
|
+
data,
|
|
365
|
+
});
|
|
281
366
|
if (cslpValue) {
|
|
282
367
|
mappedData[`$${field}`] = cslpValue;
|
|
283
368
|
}
|
|
@@ -309,9 +394,37 @@ function retrievePropValue(args) {
|
|
|
309
394
|
mappedData["symbol_props"][uid] = mappedData[field];
|
|
310
395
|
});
|
|
311
396
|
}
|
|
397
|
+
if (node.type === "section-composition") {
|
|
398
|
+
// Surface the page composer's LIVE binding type for each exposed prop so the
|
|
399
|
+
// SectionComposition renderer can tell an untouched seed from a real override.
|
|
400
|
+
// A repeater expose-time binding is only resolvable inside the section's own
|
|
401
|
+
// Repeater scope; at page level it resolves to a placeholder, not undefined —
|
|
402
|
+
// so the resolved VALUE can't distinguish "untouched" from "overridden". The
|
|
403
|
+
// live binding type can: still `repeater` (or absent) ⇒ untouched, fall
|
|
404
|
+
// through to the internal per-iteration binding; any page-resolvable type ⇒
|
|
405
|
+
// the composer rebound it and the override must win.
|
|
406
|
+
const bindingTypes = {};
|
|
407
|
+
const autoSeeded = {};
|
|
408
|
+
for (const field of Object.keys(nodeProps)) {
|
|
409
|
+
const binding = nodeProps[field]?.binding;
|
|
410
|
+
if (binding?.type)
|
|
411
|
+
bindingTypes[field] = binding.type;
|
|
412
|
+
// An auto-seeded binding means the page composer hasn't touched this exposed
|
|
413
|
+
// prop — the renderer skips its override so the section's internal binding
|
|
414
|
+
// resolves (re-scoped on schema switch / per repeater iteration).
|
|
415
|
+
if (binding?.autoSeeded)
|
|
416
|
+
autoSeeded[field] = true;
|
|
417
|
+
}
|
|
418
|
+
mappedData["section_exposed_binding_types"] = bindingTypes;
|
|
419
|
+
mappedData["section_exposed_auto_seeded"] = autoSeeded;
|
|
420
|
+
// Per-placement design/preview mode. The editor's SectionComposition uses
|
|
421
|
+
// this to derive/override the render mode of every repeater, condition-block,
|
|
422
|
+
// and section-slot inside the section. Ignored in production (renders live).
|
|
423
|
+
mappedData["mode"] = node?.metadata?.mode;
|
|
424
|
+
}
|
|
312
425
|
// TODO: Add support for useData Hook for studio
|
|
313
426
|
return mappedData;
|
|
314
427
|
}
|
|
315
428
|
|
|
316
|
-
export { retrievePropValue };
|
|
429
|
+
export { clearReportedBindingErrorsForNode, retrievePropValue };
|
|
317
430
|
//# sourceMappingURL=retrieve-data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieve-data.js","sources":["../../../src/data-binder/retrieve-data.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"retrieve-data.js","sources":["../../../src/data-binder/retrieve-data.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAuDA;;;;;;;;;;;;AAYG;AACH,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAU;AAE/C;;;;;;;;;;;;;AAaG;AACG,SAAU,iCAAiC,CAAC,OAAe,EAAA;AAC/D,IAAA,IAAI,qBAAqB,CAAC,IAAI,KAAK,CAAC;QAAE;AACtC,IAAA,MAAM,MAAM,GAAG,CAAA,EAAG,OAAO,GAAG;AAC5B,IAAA,KAAK,MAAM,OAAO,IAAI,qBAAqB,EAAE;AAC3C,QAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE;AACjC,QAAA,qBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC;AACrC,QAAA,4BAA4B,EAAE,IAAI,CAChC,mBAAmB,CAAC,qBAAqB,EACzC;YACE,OAAO;AACP,YAAA,YAAY,EAAE,EAAE;AACjB,SAAA,CACF;IACH;AACF;AA2BA;AACM,SAAU,iBAAiB,CAC/B,IAAiC,EAAA;IAEjC,MAAM,EACJ,IAAI,EACJ,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,YAAY,GAAG,EAAE,EACjB,QAAQ,EACR,OAAO,EACP,wBAAwB,GACzB,GAAG,IAAI;AAER,IAAA,MAAM,cAAc,GA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c,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC;AACrD,QAAA,CAAC,CAAC;IACJ;AACA,IAAA,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,EAAE;;;;;;;;;QASvC,MAAM,YAAY,GAA2B,EAAE;QAC/C,MAAM,UAAU,GAA4B,EAAE;QAC9C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YAC1C,MAAM,OAAO,GACX,SAAS,CAAC,KAAK,CAGhB,EAAE,OAAO;YACV,IAAI,OAAO,EAAE,IAAI;AAAE,gBAAA,YAAY,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI;;;;YAIrD,IAAI,OAAO,EAAE,UAAU;AAAE,gBAAA,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI;QACnD;AACA,QAAA,UAAU,CAAC,+BAA+B,CAAC,GAAG,YAAY;AAC1D,QAAA,UAAU,CAAC,6BAA6B,CAAC,GAAG,UAAU;;;;QAItD,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI;IAC3C;;AAEA,IAAA,OAAO,UAAU;AACnB;;;;"}
|
|
@@ -38,6 +38,7 @@ function getDefaultPropStaticValue(args) {
|
|
|
38
38
|
datestring: "",
|
|
39
39
|
any: "",
|
|
40
40
|
json_rte: {},
|
|
41
|
+
plaintext: "",
|
|
41
42
|
};
|
|
42
43
|
if (args) {
|
|
43
44
|
return defaultValues[args];
|
|
@@ -58,6 +59,7 @@ function isKnownType(type) {
|
|
|
58
59
|
datestring: true,
|
|
59
60
|
any: true,
|
|
60
61
|
json_rte: true,
|
|
62
|
+
plaintext: true,
|
|
61
63
|
};
|
|
62
64
|
return Object.keys(knownTypes).includes(type);
|
|
63
65
|
}
|
|
@@ -178,8 +180,12 @@ function isDataMatchingPropType(data, type) {
|
|
|
178
180
|
imageurl: dataType === "string",
|
|
179
181
|
datestring: dataType === "string",
|
|
180
182
|
json_rte: dataType === "object",
|
|
183
|
+
// "any" accepts all data types — no validation
|
|
184
|
+
any: true,
|
|
185
|
+
// "plaintext" accepts singleline/multiline text, number, and boolean fields
|
|
186
|
+
plaintext: dataType === "string" || dataType === "number" || dataType === "boolean",
|
|
181
187
|
};
|
|
182
|
-
return map[type];
|
|
188
|
+
return map[type] ?? false;
|
|
183
189
|
}
|
|
184
190
|
function getDataType(data) {
|
|
185
191
|
if (typeof data === "object" && data !== null && !Array.isArray(data)) {
|
|
@@ -1 +1 @@
|
|
|
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,QAAA,UAAU,EAAE,EAAE;AACd,QAAA,GAAG,EAAE,EAAE;AACP,QAAA,QAAQ,EAAE,EAAE;
|
|
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,EAA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E;AACrE,QAAA,OAAO,QAAQ;IACjB;AACA,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AACvB,QAAA,OAAO,OAAO;IAChB;IACA,OAAO,OAAO,IAAI;AACpB;;;;"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -87,9 +87,56 @@ type ObjectInput = PropBase<NodePropTypes["object"], Record<string, unknown>> &
|
|
|
87
87
|
properties?: unknown;
|
|
88
88
|
};
|
|
89
89
|
type AnyProp = PropBase<NodePropTypes["any"], any>;
|
|
90
|
+
/**
|
|
91
|
+
* Use `json_rte` for props bound to a **Contentstack JSON Rich-Text Editor field**.
|
|
92
|
+
*
|
|
93
|
+
* **Why a dedicated type:** RTE fields deliver structured content. Binding an RTE field
|
|
94
|
+
* to a plain `string` prop tries to render the structured value as text, which produces
|
|
95
|
+
* `[object Object]` or stringified JSON in the page. The `json_rte` type signals to Studio's
|
|
96
|
+
* data picker that the prop expects RTE content, and to component code that the prop value
|
|
97
|
+
* is a **JSON RTE document object** (not a string).
|
|
98
|
+
*
|
|
99
|
+
* **Runtime value shape.** The prop receives the JSON RTE field's structured value (an
|
|
100
|
+
* object — root node with `children`, `attrs`, etc.). To render it, the component must:
|
|
101
|
+
* 1. Convert the JSON RTE document to HTML via `@contentstack/json-rte-serializer`
|
|
102
|
+
* (`jsonToHtml(doc)`)
|
|
103
|
+
* 2. Sanitize the HTML (e.g. DOMPurify) — JSON RTE content is editor-supplied
|
|
104
|
+
* 3. Render with `dangerouslySetInnerHTML`
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* // register the prop
|
|
109
|
+
* registerComponent(BlogBody, {
|
|
110
|
+
* type: "blog-body",
|
|
111
|
+
* props: {
|
|
112
|
+
* body: { type: "json_rte", displayName: "Body" },
|
|
113
|
+
* },
|
|
114
|
+
* });
|
|
115
|
+
*
|
|
116
|
+
* // component serializes JSON RTE → HTML → sanitize → render
|
|
117
|
+
* import { jsonToHtml } from "@contentstack/json-rte-serializer";
|
|
118
|
+
* import DOMPurify from "isomorphic-dompurify";
|
|
119
|
+
* function BlogBody({ body }: { body: object | undefined }) {
|
|
120
|
+
* if (!body) return null;
|
|
121
|
+
* const html = jsonToHtml(body); // JSON RTE doc → HTML string
|
|
122
|
+
* const safe = DOMPurify.sanitize(html); // sanitize the HTML
|
|
123
|
+
* return <article dangerouslySetInnerHTML={{ __html: safe }} />;
|
|
124
|
+
* }
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* **Do NOT type the prop as `string`** and skip the serializer — the runtime value is
|
|
128
|
+
* an object, not a pre-serialized HTML string.
|
|
129
|
+
*
|
|
130
|
+
* See docs: `docs/20-bring-your-own-components/component-schema.md` § json_rte.
|
|
131
|
+
*/
|
|
90
132
|
type JsonRTEProp = PropBase<NodePropTypes["json_rte"], object>;
|
|
133
|
+
/** Accepts singleline and multiline text fields only; excludes HTML RTE and Markdown. */
|
|
134
|
+
type PlainTextProp = PropBase<NodePropTypes["plaintext"], string> & {
|
|
135
|
+
control?: "default" | "large";
|
|
136
|
+
placeholder?: string;
|
|
137
|
+
};
|
|
91
138
|
type PropsWithNoOptionsRequired = StringProp | BooleanProp | NumberProp | DateStringProp | HrefProp | ImageUrlProp | ObjectProp | ArrayProp | SlotProp;
|
|
92
|
-
type PropInput = StringProp | BooleanProp | NumberProp | DateStringProp | HrefProp | ImageUrlProp | ObjectProp | ArrayProp | SlotProp | ChoiceProp | AnyProp | JsonRTEProp;
|
|
139
|
+
type PropInput = StringProp | BooleanProp | NumberProp | DateStringProp | HrefProp | ImageUrlProp | ObjectProp | ArrayProp | SlotProp | ChoiceProp | AnyProp | JsonRTEProp | PlainTextProp;
|
|
93
140
|
type PropTypeOfNoOptionsRequired = PropsWithNoOptionsRequired["type"];
|
|
94
141
|
type PropType = PropInput["type"];
|
|
95
142
|
type Props = {
|
|
@@ -150,6 +197,7 @@ declare const INTERNAL_COMPONENTS_NAMES: {
|
|
|
150
197
|
readonly JSON_RTE: "json-rte";
|
|
151
198
|
readonly COLLAPSIBLE_TEXT: "collapsible-text";
|
|
152
199
|
readonly PLAIN_TEXT: "plain-text";
|
|
200
|
+
readonly RICH_TEXT: "rich-text";
|
|
153
201
|
readonly VIDEO: "video";
|
|
154
202
|
readonly EMBED: "embed";
|
|
155
203
|
readonly IMAGE: "image";
|
|
@@ -245,13 +293,34 @@ interface RegisterComponentSchemaInput<C = unknown> {
|
|
|
245
293
|
*/
|
|
246
294
|
hideFromComponentList?: boolean;
|
|
247
295
|
icon?: string;
|
|
296
|
+
/**
|
|
297
|
+
* A custom icon for this component, shown in the Studio Layers tree and other
|
|
298
|
+
* component-icon surfaces. Accepts one of:
|
|
299
|
+
* - an inline SVG string (e.g. `"<svg ...>...</svg>"`) — recommended; themeable via `currentColor`
|
|
300
|
+
* - an absolute URL (`"https://..."` or a `"data:image/..."` data URI)
|
|
301
|
+
* - a servable relative/root-relative path on your app (`"/icons/foo.svg"`, or an imported asset URL)
|
|
302
|
+
*
|
|
303
|
+
* Note: a raw source-tree path (e.g. `"./icons/foo.svg"`) will not resolve — bundlers hash and
|
|
304
|
+
* relocate assets. Put the asset in `public/` and pass a root-relative path, or import it
|
|
305
|
+
* (`import url from "./icon.svg"`) and pass the resulting URL.
|
|
306
|
+
*
|
|
307
|
+
* Invalid values are ignored (with a console warning) and fall back to the default icon.
|
|
308
|
+
*/
|
|
309
|
+
layerIcon?: LayerIcon;
|
|
248
310
|
/**
|
|
249
311
|
* This can be used to store extra metadata for components. For eg for symbols we can store uid here.
|
|
250
312
|
*/
|
|
251
313
|
metadata?: Record<string, unknown>;
|
|
252
314
|
}
|
|
253
|
-
|
|
315
|
+
/**
|
|
316
|
+
* Accepted shapes for {@link RegisterComponentSchemaInput.layerIcon}. The template-literal
|
|
317
|
+
* members are editor hints only — the trailing `string` keeps any value assignable (imported
|
|
318
|
+
* SVG vars, relative paths, xml-prolog SVGs), and the real validation happens at runtime.
|
|
319
|
+
*/
|
|
320
|
+
type LayerIcon = `<svg${string}` | `<?xml${string}` | `http://${string}` | `https://${string}` | `data:image/${string}` | `/${string}` | string;
|
|
321
|
+
interface RegisterComponentSchema<C> extends Required<Omit<RegisterComponentSchemaInput<C>, "props" | "layerIcon">> {
|
|
254
322
|
registry: Registry;
|
|
323
|
+
layerIcon?: LayerIcon;
|
|
255
324
|
sections: string[];
|
|
256
325
|
styles: {
|
|
257
326
|
[styleGroup: string]: Required<StyleGroupOptions>;
|
|
@@ -1245,6 +1314,12 @@ interface StaticValueItem<T> {
|
|
|
1245
1314
|
}
|
|
1246
1315
|
type RawStaticValue = {
|
|
1247
1316
|
text?: Array<StaticValueItem<string>>;
|
|
1317
|
+
/**
|
|
1318
|
+
* COMS-1035: text-node content props use the `plaintext` prop type and
|
|
1319
|
+
* persist their authored static value under this `plaintext` schema key
|
|
1320
|
+
* (was `text` before the migration).
|
|
1321
|
+
*/
|
|
1322
|
+
plaintext?: Array<StaticValueItem<string>>;
|
|
1248
1323
|
/**
|
|
1249
1324
|
* NOTE: We are storing the Markdown value in the html_rte field.
|
|
1250
1325
|
* Earlier we used to store the HTML Values, here we are storing the Markdown Values.
|
|
@@ -1295,6 +1370,21 @@ type PlaceHolders<T> = PartialRecord<PropType, (placeholder?: string) => T>;
|
|
|
1295
1370
|
* @throws {Error} - Throws an error if the prop type does not match the component registry or if the type is not handled.
|
|
1296
1371
|
*/
|
|
1297
1372
|
|
|
1373
|
+
/**
|
|
1374
|
+
* Retract every binding-mismatch error previously reported for `nodeUid`'s
|
|
1375
|
+
* props and forget them.
|
|
1376
|
+
*
|
|
1377
|
+
* The in-render retraction in `retrievePropValue` only clears the editor badge
|
|
1378
|
+
* when the SAME node re-renders with matching data — which never happens once
|
|
1379
|
+
* the node disappears (e.g. a repeater item removed, or a section swapped for a
|
|
1380
|
+
* different schema). Without this, such a node's badge would latch and its
|
|
1381
|
+
* entry would leak in `reportedBindingErrors` forever. Call this from the
|
|
1382
|
+
* node's unmount path so the badge reflects the live tree.
|
|
1383
|
+
*
|
|
1384
|
+
* Keys are `${nodeUid}-${field}`; the trailing `-` (and fixed-length uids)
|
|
1385
|
+
* makes the prefix match exact, so one node's uid can't match another's.
|
|
1386
|
+
*/
|
|
1387
|
+
declare function clearReportedBindingErrorsForNode(nodeUid: string): void;
|
|
1298
1388
|
type CommonNodeProps<T> = T & {
|
|
1299
1389
|
binding?: string;
|
|
1300
1390
|
placeholder?: string;
|
|
@@ -1423,5 +1513,5 @@ declare function getGlobalStudioStore(): GlobalStudioStore;
|
|
|
1423
1513
|
*/
|
|
1424
1514
|
declare function resetGlobalStudioStore(): void;
|
|
1425
1515
|
|
|
1426
|
-
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, getDesignRegistryInstance, getFlattenedData, getGlobalStudioStore, getPlaceHolderComponent, getRepeaterBinding, getRepeaterContextPath, getSectionUIDFromNode, getSlotData, getSymbolUIDFromNode, getSymbolUIDFromUID, hasComponentRegistryInstance, hasDesignRegistryInstance, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, resetComponentRegistryInstance, resetDesignRegistryInstance, resetGlobalStudioStore, resolveMetadataBindings, retrievePropValue };
|
|
1427
|
-
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, GlobalStudioStore, 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, SectionScopedDataSources, SlotProp, StaticValue, StaticValueItem, StaticValueUid, StringProp, StudioSpecData, StyleGroupOptions, StyleSectionCategoriesOptions, StyleSectionOptions, StyleSections, TemplateBindingValue };
|
|
1516
|
+
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, clearReportedBindingErrorsForNode, convertBindingPath, getBindingString, getComponentRegistryInstance, getCslpPath, getCslpTag, getDataType, getDefaultPropStaticValue, getDesignClassesNames, getDesignRegistryInstance, getFlattenedData, getGlobalStudioStore, getPlaceHolderComponent, getRepeaterBinding, getRepeaterContextPath, getSectionUIDFromNode, getSlotData, getSymbolUIDFromNode, getSymbolUIDFromUID, hasComponentRegistryInstance, hasDesignRegistryInstance, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, resetComponentRegistryInstance, resetDesignRegistryInstance, resetGlobalStudioStore, resolveMetadataBindings, retrievePropValue };
|
|
1517
|
+
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, GlobalStudioStore, HrefProp, ICSEntryReference, ImageUrlProp, InternalComponentRegistryOptions, JSONRTERegistryOptions, JsonRTEProp, LayerIcon, LengthToken, NodeProps, NumberProp, ObjectInput, ObjectProp, PlaceHolders, PlainTextProp, PreProcessedBreakpoint, PreProcessedDesignTokenInput, PropBase, PropInput, PropType, PropTypeOfNoOptionsRequired, PropValidator, Props, PropsWithNoOptionsRequired, RawStaticValue, RegisterComponentOptionsInput, RegisterComponentSchema, RegisterComponentSchemaInput, RegisterInternalComponentOptionsInput, Registry, RepeaterBindingValue, SectionDesignTokens, SectionScopedDataSources, SlotProp, StaticValue, StaticValueItem, StaticValueUid, StringProp, StudioSpecData, StyleGroupOptions, StyleSectionCategoriesOptions, StyleSectionOptions, StyleSections, TemplateBindingValue };
|
package/dist/esm/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { getDesignRegistryInstance, hasDesignRegistryInstance, resetDesignRegist
|
|
|
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
|
-
export { retrievePropValue } from './data-binder/retrieve-data.js';
|
|
9
|
+
export { clearReportedBindingErrorsForNode, retrievePropValue } from './data-binder/retrieve-data.js';
|
|
10
10
|
export { convertBindingPath, getBindingString, getDataType, getDefaultPropStaticValue, getFlattenedData, getPlaceHolderComponent, getRepeaterContextPath, getSlotData, isDataMatchingPropType, isKnownType, normalizeSingleSelectChoiceValue, resolveMetadataBindings } from './data-binder/retrieve-data.util.js';
|
|
11
11
|
export { getCslpPath, getCslpTag, getRepeaterBinding } from './data-binder/cslp.js';
|
|
12
12
|
export { BreakpointRegistry } from './breakpoint-registry/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/studio-registry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.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,8 +15,8 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@contentstack/common-config": "^1.
|
|
19
|
-
"@contentstack/studio-internal": "^1.
|
|
18
|
+
"@contentstack/common-config": "^1.2.0",
|
|
19
|
+
"@contentstack/studio-internal": "^1.3.0",
|
|
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",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"author": "Contentstack",
|
|
53
53
|
"license": "MIT",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@contentstack/json-rte-serializer": "^3.0
|
|
56
|
-
"@contentstack/studio-message-types": "^1.
|
|
57
|
-
"@contentstack/studio-messenger": "^1.
|
|
55
|
+
"@contentstack/json-rte-serializer": "^3.1.0",
|
|
56
|
+
"@contentstack/studio-message-types": "^1.3.0",
|
|
57
|
+
"@contentstack/studio-messenger": "^1.5.0",
|
|
58
58
|
"csstype": "^3.1.3",
|
|
59
59
|
"lodash-es": "^4.18.1"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "8ac2eaeeeab2403708cf075475d8553832fb7866"
|
|
62
62
|
}
|