@contentstack/studio-registry 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -0
- package/dist/cjs/index.cjs +5625 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/breakpoint-registry/index.js +68 -0
- package/dist/esm/breakpoint-registry/index.js.map +1 -0
- package/dist/esm/component-registry/registry-options-processor.js +195 -0
- package/dist/esm/component-registry/registry-options-processor.js.map +1 -0
- package/dist/esm/component-registry/registry.constant.js +119 -0
- package/dist/esm/component-registry/registry.constant.js.map +1 -0
- package/dist/esm/component-registry/registry.js +245 -0
- package/dist/esm/component-registry/registry.js.map +1 -0
- package/dist/esm/data-binder/cslp.js +31 -0
- package/dist/esm/data-binder/cslp.js.map +1 -0
- package/dist/esm/data-binder/handle-binding-map.util.js +103 -0
- package/dist/esm/data-binder/handle-binding-map.util.js.map +1 -0
- package/dist/esm/data-binder/retrieve-data.js +146 -0
- package/dist/esm/data-binder/retrieve-data.js.map +1 -0
- package/dist/esm/data-binder/retrieve-data.util.js +177 -0
- package/dist/esm/data-binder/retrieve-data.util.js.map +1 -0
- package/dist/esm/design-registry/constants.js +386 -0
- package/dist/esm/design-registry/constants.js.map +1 -0
- package/dist/esm/design-registry/design-classes.js +36 -0
- package/dist/esm/design-registry/design-classes.js.map +1 -0
- package/dist/esm/design-registry/design-registry.js +87 -0
- package/dist/esm/design-registry/design-registry.js.map +1 -0
- package/dist/esm/design-registry/design-token.js +332 -0
- package/dist/esm/design-registry/design-token.js.map +1 -0
- package/dist/esm/index.d.ts +1196 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/json-rte-registry/index.js +18 -0
- package/dist/esm/json-rte-registry/index.js.map +1 -0
- package/dist/esm/utils/symbols.js +12 -0
- package/dist/esm/utils/symbols.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { flattenDeep, get } from 'lodash-es';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Gets the CSLP path of a binding. The CSLP path is the path of the binding with the $ sign in between the path.
|
|
5
|
+
* @param binding The path to where the data is stored.
|
|
6
|
+
* @returns The path of the CSLP path.
|
|
7
|
+
*/
|
|
8
|
+
function getCslpPath(binding) {
|
|
9
|
+
const bindingParts = binding.split(".");
|
|
10
|
+
const lastPart = bindingParts.pop();
|
|
11
|
+
const cslpPath = bindingParts.join(".") + ".$." + lastPart;
|
|
12
|
+
return cslpPath;
|
|
13
|
+
}
|
|
14
|
+
//TODO: Move it to more appropriate place
|
|
15
|
+
const getRepeaterBinding = (node) => {
|
|
16
|
+
const allSlots = node?.slots || {};
|
|
17
|
+
const values = flattenDeep(Object.values(allSlots)).filter((slot) => slot.type === "repeater");
|
|
18
|
+
if (!values.length) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
//@ts-expect-error: This is valid props
|
|
22
|
+
return values[0]?.props?.items?.binding;
|
|
23
|
+
};
|
|
24
|
+
const getCslpTag = ({ bindedField, data, }) => {
|
|
25
|
+
const cslpBinding = getCslpPath(bindedField);
|
|
26
|
+
const cslpValue = get(data, cslpBinding);
|
|
27
|
+
return cslpValue || {};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { getCslpPath, getCslpTag, getRepeaterBinding };
|
|
31
|
+
//# sourceMappingURL=cslp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cslp.js","sources":["../../../src/data-binder/cslp.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;AAIG;AACG,SAAU,WAAW,CAAC,OAAe,EAAA;IACzC,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;AACvC,IAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,EAAE;AACnC,IAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,QAAQ;AAE1D,IAAA,OAAO,QAAQ;AACjB;AACA;AACO,MAAM,kBAAkB,GAAG,CAAC,IAAU,KAAI;AAC/C,IAAA,MAAM,QAAQ,GAAG,IAAI,EAAE,KAAK,IAAI,EAAE;IAClC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CACxD,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,UAAU,CACnC;AAED,IAAA,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;QAClB;IACF;;IAEA,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO;AACzC;AACO,MAAM,UAAU,GAAG,CAAC,EACzB,WAAW,EACX,IAAI,GAIL,KAAI;AACH,IAAA,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAC5C,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC;IACxC,OAAO,SAAS,IAAI,EAAE;AACxB;;;;"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { get } from 'lodash-es';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This transforms the provided data into the format defined by the schema.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} schema - The current schema node (object or array).
|
|
7
|
+
* @param {object} data - The data object or sub-object to transform.
|
|
8
|
+
* @param {object} bindingMap - The binding map containing paths for properties.
|
|
9
|
+
* @returns The transformed data, matching the schema format.
|
|
10
|
+
*/
|
|
11
|
+
function getDataInSchemaFormat(schema, data, bindingMap = {}, propPath = "") {
|
|
12
|
+
if (schema.type === "array") {
|
|
13
|
+
const arrayData = getArrayData(schema, data, bindingMap, propPath);
|
|
14
|
+
return arrayData;
|
|
15
|
+
}
|
|
16
|
+
if (schema.type === "object") {
|
|
17
|
+
return getObjectData(schema, data, bindingMap, propPath);
|
|
18
|
+
}
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get data for an array schema
|
|
23
|
+
*
|
|
24
|
+
* @param {object} schema - The array schema definition.
|
|
25
|
+
* @param {object} data - The data object.
|
|
26
|
+
* @param {object} bindingMap - The binding map.
|
|
27
|
+
* @returns {Array} An array of transformed items according to the inner schema.
|
|
28
|
+
*/
|
|
29
|
+
function getArrayData(schema, data, bindingMap, propPath) {
|
|
30
|
+
if (Object.keys(bindingMap).length === 0)
|
|
31
|
+
return data;
|
|
32
|
+
const arrayItemSchema = schema.items;
|
|
33
|
+
return data.map((item) => getDataInSchemaFormat(arrayItemSchema, item, bindingMap, propPath));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* get data for an object schema
|
|
37
|
+
*
|
|
38
|
+
* @param {object} schema - The object schema definition.
|
|
39
|
+
* @param {object} data - The data object.
|
|
40
|
+
* @param {object} bindingMap - The binding map.
|
|
41
|
+
* @returns {object} A transformed object with keys matching the schema properties.
|
|
42
|
+
*/
|
|
43
|
+
function getObjectData(schema, data, bindingMap, propPath) {
|
|
44
|
+
const result = {};
|
|
45
|
+
Object.entries(schema.properties).forEach(([propKey, propSchema]) => {
|
|
46
|
+
const propConfig = propSchema;
|
|
47
|
+
const newPropPath = propPath ? `${propPath}.${propKey}` : propKey;
|
|
48
|
+
const nestedBindingMap = reCalculateBindingMap(bindingMap, newPropPath);
|
|
49
|
+
const bindingPath = bindingMap[newPropPath]?.replace("context.", "") || propKey;
|
|
50
|
+
result[propKey] = getDataInSchemaFormat(propConfig, get(data, bindingPath), nestedBindingMap, newPropPath);
|
|
51
|
+
});
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Re-calculates the binding map to remove the current binding key from the entries.
|
|
56
|
+
*
|
|
57
|
+
* This function filters the entries of the provided binding map to include only those
|
|
58
|
+
* whose keys start with the specified current binding key. It then processes these entries
|
|
59
|
+
* to remove the current binding key from each entry.
|
|
60
|
+
*
|
|
61
|
+
* e.g. for the currentBindingKey 'users' and the following binding map:
|
|
62
|
+
* {
|
|
63
|
+
* 'users': 'context.users',
|
|
64
|
+
* 'users.name': 'context.users.name',
|
|
65
|
+
* 'users.age': 'context.users.age',
|
|
66
|
+
* }
|
|
67
|
+
* it will return:
|
|
68
|
+
* {
|
|
69
|
+
* 'users.name': 'context.name',
|
|
70
|
+
* 'users.age': 'context.age',
|
|
71
|
+
* }
|
|
72
|
+
*
|
|
73
|
+
* @param {BindingMap} bindingMap - The original binding map from which to extract the nested map.
|
|
74
|
+
* @param {string} currentBindingKey - The key used to filter and process the entries of the binding map.
|
|
75
|
+
* @returns {BindingMap} A new binding map containing only the entries that match the current binding key.
|
|
76
|
+
*/
|
|
77
|
+
function reCalculateBindingMap(bindingMap, currentBindingKey) {
|
|
78
|
+
return Object.fromEntries(Object.entries(bindingMap)
|
|
79
|
+
.filter(([key]) => startsWithBindingKey(key, currentBindingKey))
|
|
80
|
+
.map((entry) => removeCurrentBindingKey(entry, bindingMap, currentBindingKey))
|
|
81
|
+
.filter(Boolean));
|
|
82
|
+
}
|
|
83
|
+
function startsWithBindingKey(key, bindingKey) {
|
|
84
|
+
return key.startsWith(`${bindingKey}.`);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Removes the current binding key from the value of the given entry if the key matches the current binding key.
|
|
88
|
+
* The value is then prefixed with "context." to maintain the consistency.
|
|
89
|
+
*
|
|
90
|
+
* @param entry - A tuple containing the key and value.
|
|
91
|
+
* @param bindingMap - An object representing the binding map.
|
|
92
|
+
* @param currentBindingKey - The key that needs to be removed from the value.
|
|
93
|
+
* @returns A new tuple with the key and the updated value.
|
|
94
|
+
*/
|
|
95
|
+
function removeCurrentBindingKey(entry, bindingMap, currentBindingKey) {
|
|
96
|
+
const [key, value] = entry;
|
|
97
|
+
let newValue = value.replace(`${bindingMap[currentBindingKey]}.`, "");
|
|
98
|
+
newValue = `context.${newValue}`;
|
|
99
|
+
return [key, newValue];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { getDataInSchemaFormat };
|
|
103
|
+
//# sourceMappingURL=handle-binding-map.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-binding-map.util.js","sources":["../../../src/data-binder/handle-binding-map.util.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAQA;;;;;;;AAOG;AACG,SAAU,qBAAqB,CACnC,MAAiB,EACjB,IAAS,EACT,UAAA,GAAyB,EAAE,EAC3B,QAAA,GAAmB,EAAE,EAAA;AAErB,IAAA,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;AAC3B,QAAA,MAAM,SAAS,GAAG,YAAY,CAC5B,MAAmB,EACnB,IAAI,EACJ,UAAU,EACV,QAAQ,CACT;AACD,QAAA,OAAO,SAAS;IAClB;AACA,IAAA,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,aAAa,CAAC,MAAoB,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC;IACxE;AACA,IAAA,OAAO,IAAI;AACb;AAEA;;;;;;;AAOG;AACH,SAAS,YAAY,CACnB,MAAiB,EACjB,IAAW,EACX,UAAsB,EACtB,QAAgB,EAAA;IAEhB,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AACrD,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,KAAmB;IAClD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,KACnB,qBAAqB,CAAC,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CACnE;AACH;AAEA;;;;;;;AAOG;AACH,SAAS,aAAa,CACpB,MAAkB,EAClB,IAAyB,EACzB,UAAsB,EACtB,QAAgB,EAAA;IAEhB,MAAM,MAAM,GAAG,EAAE;AAEjB,IAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,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C1B,IAAA,IAAI,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,CAAA,EAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA,CAAA,CAAG,EAAE,EAAE,CAAC;AACrE,IAAA,QAAQ,GAAG,CAAA,QAAA,EAAW,QAAQ,CAAA,CAAE;AAChC,IAAA,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;AACxB;;;;"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { composableStudioEventManager, POST_MESSAGE_EVENTS } from '@contentstack/studio-messenger';
|
|
2
|
+
import { get } from 'lodash-es';
|
|
3
|
+
import { DATA_SOURCES } from '../component-registry/registry.constant.js';
|
|
4
|
+
import { getCslpTag } from './cslp.js';
|
|
5
|
+
import { getDataInSchemaFormat } from './handle-binding-map.util.js';
|
|
6
|
+
import { isKnownType, getSlotData, getPlaceHolderComponent, getBindingString, isDataMatchingPropType, getDataType } from './retrieve-data.util.js';
|
|
7
|
+
|
|
8
|
+
// Responsible for resolving props to values
|
|
9
|
+
function retrievePropValue(args) {
|
|
10
|
+
const { data, componentOptions, node, cslp, placeholders = {}, getSlots, jsonRTE, isCompositionBeingEdited, } = args;
|
|
11
|
+
const componentProps = (function getComponentProps() {
|
|
12
|
+
// Only resolve props when in editing mode
|
|
13
|
+
if (node.type === "symbol" && node.metadata.editing) {
|
|
14
|
+
const props = {
|
|
15
|
+
...componentOptions.props,
|
|
16
|
+
};
|
|
17
|
+
const symbolProps = node.metadata.symbolProps || [];
|
|
18
|
+
for (const symbolProp of symbolProps) {
|
|
19
|
+
const { uid } = symbolProp;
|
|
20
|
+
props[uid] = symbolProp;
|
|
21
|
+
}
|
|
22
|
+
return props;
|
|
23
|
+
}
|
|
24
|
+
return componentOptions.props;
|
|
25
|
+
})();
|
|
26
|
+
const nodeProps = node.props;
|
|
27
|
+
if (!componentProps || !nodeProps)
|
|
28
|
+
return {};
|
|
29
|
+
const mappedData = {};
|
|
30
|
+
Object.entries(componentProps).forEach(([field, prop]) => {
|
|
31
|
+
const { type, defaultValue } = prop;
|
|
32
|
+
if (!isKnownType(type)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let resolvedData;
|
|
36
|
+
if (type === "slot") {
|
|
37
|
+
resolvedData = getSlotData({
|
|
38
|
+
nodeProps: nodeProps,
|
|
39
|
+
field,
|
|
40
|
+
node,
|
|
41
|
+
getSlots,
|
|
42
|
+
});
|
|
43
|
+
mappedData[field] = resolvedData;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const nodePropConfig = nodeProps[field];
|
|
47
|
+
const { binding: bindedField } = nodePropConfig || {};
|
|
48
|
+
//TODO: Get proper data for design
|
|
49
|
+
const placeholderComponent = getPlaceHolderComponent(placeholders, prop, type);
|
|
50
|
+
const fallbackValue = defaultValue ?? placeholderComponent;
|
|
51
|
+
const dataPath = bindedField && getBindingString(bindedField);
|
|
52
|
+
if ((type === "array" || type === "object") && dataPath) {
|
|
53
|
+
const bindedData = get(data, dataPath);
|
|
54
|
+
const bindingMap = nodePropConfig.bindingMap;
|
|
55
|
+
const isBindingMapEmpty = Object.keys(bindingMap || {}).length === 0;
|
|
56
|
+
const transformedData = !isBindingMapEmpty
|
|
57
|
+
? getDataInSchemaFormat(prop, bindedData, bindingMap)
|
|
58
|
+
: bindedData;
|
|
59
|
+
resolvedData = transformedData ?? fallbackValue;
|
|
60
|
+
if (type === "array") {
|
|
61
|
+
const cslpObj = getCslpTag({ bindedField: dataPath, data });
|
|
62
|
+
if (cslpObj["data-cslp"]) {
|
|
63
|
+
mappedData[`$${field}Items`] = transformedData.map((_, idx) => {
|
|
64
|
+
return { "data-cslp": `${cslpObj["data-cslp"]}.$${idx}` };
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (dataPath) {
|
|
70
|
+
resolvedData = get(data, dataPath, fallbackValue);
|
|
71
|
+
if (type === "choice") {
|
|
72
|
+
if (!prop.multiSelect) {
|
|
73
|
+
// we are explicitly checking for single select choice type to ensure we don't have a mismatch in the data type.
|
|
74
|
+
if (Array.isArray(resolvedData)) {
|
|
75
|
+
resolvedData = resolvedData[0];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
resolvedData = fallbackValue;
|
|
82
|
+
// TODO: THIS IS A TEMPORARY FIX TO HANDLE THE CASE WHERE THE DATA TYPE IS NOT MATCHING THE PROP TYPE. WE WILL REMOVE THIS ELSE BLOCK.
|
|
83
|
+
if (type === "choice") {
|
|
84
|
+
if (!prop.multiSelect) {
|
|
85
|
+
// we are explicitly checking for single select choice type to ensure we don't have a mismatch in the data type.
|
|
86
|
+
if (Array.isArray(resolvedData)) {
|
|
87
|
+
resolvedData = resolvedData[0];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// TODO: @ravencolevol: In case of the missing string value, we are providing a placeholder component, failing this check. We have to revisit the placeholder component logic.
|
|
93
|
+
//NOTE: This is the error message that is sent to the parent on the render is it a good idea to send the error message here?
|
|
94
|
+
//or it should happen in the data tab section. might require a revisit.
|
|
95
|
+
if (!isDataMatchingPropType(resolvedData, type) &&
|
|
96
|
+
isCompositionBeingEdited) {
|
|
97
|
+
composableStudioEventManager?.send(POST_MESSAGE_EVENTS.UPDATE_BINDING_ERRORS, {
|
|
98
|
+
propKey: `${node.uid}-${field}`,
|
|
99
|
+
errorMessage: `Expected prop type ${type} but received ${getDataType(resolvedData)} in the component registry. Remove the binding and bind with correct data.`,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
mappedData[field] = resolvedData;
|
|
103
|
+
if (type === "json_rte") {
|
|
104
|
+
mappedData["jsonConfig"] = jsonRTE;
|
|
105
|
+
}
|
|
106
|
+
const cslpAbleTypes = [
|
|
107
|
+
DATA_SOURCES.CONTENTSTACK,
|
|
108
|
+
DATA_SOURCES.COMPONENT_PROPS,
|
|
109
|
+
DATA_SOURCES.TEMPLATE,
|
|
110
|
+
DATA_SOURCES.REPEATER,
|
|
111
|
+
];
|
|
112
|
+
const isCSLPAbleType = bindedField?.type && cslpAbleTypes.includes(bindedField.type);
|
|
113
|
+
if (cslp.appendTags && dataPath && isCSLPAbleType) {
|
|
114
|
+
const cslpValue = getCslpTag({ bindedField: dataPath, data });
|
|
115
|
+
if (cslpValue) {
|
|
116
|
+
mappedData[`$${field}`] = cslpValue;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
if (node.type === "repeater") {
|
|
121
|
+
mappedData["_uid"] = node.uid;
|
|
122
|
+
mappedData["mode"] = node?.metadata?.mode;
|
|
123
|
+
}
|
|
124
|
+
if (node.type === "condition-block") {
|
|
125
|
+
mappedData["condition"] = node?.metadata?.condition;
|
|
126
|
+
mappedData["mode"] = node?.metadata?.mode;
|
|
127
|
+
}
|
|
128
|
+
if (node.type === "symbol") {
|
|
129
|
+
mappedData["symbol_internal_props"] = {
|
|
130
|
+
isEditing: node.metadata.editing,
|
|
131
|
+
};
|
|
132
|
+
mappedData["symbol_props"] = {};
|
|
133
|
+
Object.entries(componentProps).forEach(([field]) => {
|
|
134
|
+
const uid = componentProps[field]["uid"];
|
|
135
|
+
if (!uid) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
mappedData["symbol_props"][uid] = mappedData[field];
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
// TODO: Add support for useData Hook for studio
|
|
142
|
+
return mappedData;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { retrievePropValue };
|
|
146
|
+
//# sourceMappingURL=retrieve-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieve-data.js","sources":["../../../src/data-binder/retrieve-data.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAyEA;AACM,SAAU,iBAAiB,CAC/B,IAAiC,EAAA;IAEjC,MAAM,EACJ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,GAAG,EAAE;gBACR;YACF;YACA,UAAU,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC;AACrD,QAAA,CAAC,CAAC;IACJ;;AAEA,IAAA,OAAO,UAAU;AACnB;;;;"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { DATA_SOURCES, DATA_SOURCES_PREFIX } from '../component-registry/registry.constant.js';
|
|
2
|
+
import { get, set } from 'lodash-es';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the default static value for a given property type.
|
|
6
|
+
*
|
|
7
|
+
* @template K - The type of the bindable node property.
|
|
8
|
+
* @param {K} [args] - The property type for which to get the default value.
|
|
9
|
+
* @returns {NodePropStaticValueTypes[K] | NodePropStaticValueTypes} The default static value for the specified property type.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* The function returns default values for various property types such as string, boolean, number, object, array, choice, href, imageurl, and datestring.
|
|
13
|
+
* If no property type is provided, it returns an object containing all default values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const defaultStringValue = getDefaultPropStaticValue('string'); // returns ""
|
|
18
|
+
* const defaultBooleanValue = getDefaultPropStaticValue('boolean'); // returns false
|
|
19
|
+
* const defaultValues = getDefaultPropStaticValue(); // returns the entire defaultValues object
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function getDefaultPropStaticValue(args) {
|
|
23
|
+
const defaultValues = {
|
|
24
|
+
string: "",
|
|
25
|
+
boolean: false,
|
|
26
|
+
number: 0,
|
|
27
|
+
// TODO: update the object and array default values. propPath is the key.
|
|
28
|
+
object: {},
|
|
29
|
+
array: [],
|
|
30
|
+
choice: "",
|
|
31
|
+
href: "",
|
|
32
|
+
imageurl: "",
|
|
33
|
+
datestring: "",
|
|
34
|
+
any: "",
|
|
35
|
+
json_rte: {},
|
|
36
|
+
};
|
|
37
|
+
if (args) {
|
|
38
|
+
return defaultValues[args];
|
|
39
|
+
}
|
|
40
|
+
return defaultValues;
|
|
41
|
+
}
|
|
42
|
+
function isKnownType(type) {
|
|
43
|
+
const knownTypes = {
|
|
44
|
+
string: true,
|
|
45
|
+
boolean: true,
|
|
46
|
+
number: true,
|
|
47
|
+
object: true,
|
|
48
|
+
array: true,
|
|
49
|
+
choice: true,
|
|
50
|
+
slot: true,
|
|
51
|
+
href: true,
|
|
52
|
+
imageurl: true,
|
|
53
|
+
datestring: true,
|
|
54
|
+
any: true,
|
|
55
|
+
json_rte: true,
|
|
56
|
+
};
|
|
57
|
+
return Object.keys(knownTypes).includes(type);
|
|
58
|
+
}
|
|
59
|
+
function getSlotData({ nodeProps, field, node, getSlots, }) {
|
|
60
|
+
const currentNodeProp = nodeProps[field];
|
|
61
|
+
const slotUid = currentNodeProp?.slot;
|
|
62
|
+
if (!slotUid) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const slots = node.slots?.[slotUid] ?? [];
|
|
66
|
+
return getSlots({ slots, parent: node, slotUid });
|
|
67
|
+
}
|
|
68
|
+
function getPlaceHolderComponent(placeholders, prop, type) {
|
|
69
|
+
// TODO: this is poorly handled, if all prop types are allowed to have placeholders, then it should be in all types, else handle the specific cases for placeholders separately.
|
|
70
|
+
const placeholder = "placeholder" in prop ? prop?.placeholder : undefined;
|
|
71
|
+
const placeholderComponent = placeholders[type] && placeholder
|
|
72
|
+
? placeholders[type](placeholder)
|
|
73
|
+
: getDefaultPropStaticValue(type);
|
|
74
|
+
return placeholderComponent;
|
|
75
|
+
}
|
|
76
|
+
const getBindingStringForCS = (binding) => {
|
|
77
|
+
//TODO: fix this types and data source uid
|
|
78
|
+
const path = binding.value.path;
|
|
79
|
+
const flattenPath = (path) => {
|
|
80
|
+
if (Object.keys(path).length === 0)
|
|
81
|
+
return "";
|
|
82
|
+
const key = Object.keys(path)[0];
|
|
83
|
+
const value = path[key];
|
|
84
|
+
const flattenValue = flattenPath(value);
|
|
85
|
+
return flattenValue ? `${key}.${flattenValue}` : key;
|
|
86
|
+
};
|
|
87
|
+
return flattenPath(path);
|
|
88
|
+
};
|
|
89
|
+
const getBindingString = (binding) => {
|
|
90
|
+
if (binding.type === DATA_SOURCES.TEMPLATE) {
|
|
91
|
+
// STORED AT dataSources.template.<bindingString>
|
|
92
|
+
return [
|
|
93
|
+
DATA_SOURCES_PREFIX,
|
|
94
|
+
DATA_SOURCES.TEMPLATE,
|
|
95
|
+
getBindingStringForCS(binding),
|
|
96
|
+
].join(".");
|
|
97
|
+
}
|
|
98
|
+
if (binding.type === DATA_SOURCES.CONTENTSTACK) {
|
|
99
|
+
// STORED AT dataSources.contentstack.ct_uid:euid.<bindingString>
|
|
100
|
+
const { _content_type_uid, uid } = binding.value;
|
|
101
|
+
const entryKey = `${_content_type_uid}:${uid}`;
|
|
102
|
+
return [
|
|
103
|
+
DATA_SOURCES_PREFIX,
|
|
104
|
+
DATA_SOURCES.CONTENTSTACK,
|
|
105
|
+
entryKey,
|
|
106
|
+
getBindingStringForCS(binding),
|
|
107
|
+
].join(".");
|
|
108
|
+
}
|
|
109
|
+
if (binding.type === DATA_SOURCES.REPEATER) {
|
|
110
|
+
const { repeaterUID } = binding.value;
|
|
111
|
+
return [
|
|
112
|
+
DATA_SOURCES_PREFIX,
|
|
113
|
+
DATA_SOURCES.REPEATER,
|
|
114
|
+
repeaterUID,
|
|
115
|
+
"context",
|
|
116
|
+
getBindingStringForCS(binding),
|
|
117
|
+
].join(".");
|
|
118
|
+
}
|
|
119
|
+
if (binding.type === DATA_SOURCES.COMPONENT_PROPS) {
|
|
120
|
+
return [DATA_SOURCES.COMPONENT_PROPS, binding.value].join(".");
|
|
121
|
+
}
|
|
122
|
+
if (binding.type === DATA_SOURCES.STATIC_VALUE) {
|
|
123
|
+
return [DATA_SOURCES.STATIC_VALUE, binding.value].join(".");
|
|
124
|
+
}
|
|
125
|
+
if (binding.type === DATA_SOURCES.SYMBOL_PROPS) {
|
|
126
|
+
return [DATA_SOURCES.SYMBOL_PROPS, binding.value].join(".");
|
|
127
|
+
}
|
|
128
|
+
return binding.value;
|
|
129
|
+
};
|
|
130
|
+
const resolveMetadataBindings = (node, data) => {
|
|
131
|
+
if (!node.metadata?.bindings)
|
|
132
|
+
return;
|
|
133
|
+
const { bindings } = node.metadata;
|
|
134
|
+
for (const key in bindings) {
|
|
135
|
+
const binding = bindings[key];
|
|
136
|
+
const dataPath = binding && getBindingString(binding);
|
|
137
|
+
const getBinding = get(data, dataPath);
|
|
138
|
+
set(node, key, getBinding);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const getRepeaterContextPath = (binding) => {
|
|
142
|
+
const { repeaterUID } = binding;
|
|
143
|
+
return [
|
|
144
|
+
DATA_SOURCES_PREFIX,
|
|
145
|
+
DATA_SOURCES.REPEATER,
|
|
146
|
+
repeaterUID,
|
|
147
|
+
"context",
|
|
148
|
+
].join(".");
|
|
149
|
+
};
|
|
150
|
+
function isDataMatchingPropType(data, type) {
|
|
151
|
+
const dataType = getDataType(data);
|
|
152
|
+
const map = {
|
|
153
|
+
string: dataType === "string",
|
|
154
|
+
boolean: dataType === "boolean",
|
|
155
|
+
number: dataType === "number",
|
|
156
|
+
object: dataType === "object",
|
|
157
|
+
array: dataType === "array",
|
|
158
|
+
choice: dataType === "string",
|
|
159
|
+
href: dataType === "string",
|
|
160
|
+
imageurl: dataType === "string",
|
|
161
|
+
datestring: dataType === "string",
|
|
162
|
+
json_rte: dataType === "json",
|
|
163
|
+
};
|
|
164
|
+
return map[type];
|
|
165
|
+
}
|
|
166
|
+
function getDataType(data) {
|
|
167
|
+
if (typeof data === "object" && data !== null && !Array.isArray(data)) {
|
|
168
|
+
return "object";
|
|
169
|
+
}
|
|
170
|
+
if (Array.isArray(data)) {
|
|
171
|
+
return "array";
|
|
172
|
+
}
|
|
173
|
+
return typeof data;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export { getBindingString, getDataType, getDefaultPropStaticValue, getPlaceHolderComponent, getRepeaterContextPath, getSlotData, isDataMatchingPropType, isKnownType, resolveMetadataBindings };
|
|
177
|
+
//# sourceMappingURL=retrieve-data.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieve-data.util.js","sources":["../../../src/data-binder/retrieve-data.util.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAiCA;;;;;;;;;;;;;;;;;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;KACb;IAED,IAAI,IAAI,EAAE;AACR,QAAA,OAAO,aAAa,CAAC,IAAI,CAAC;IAC5B;AAEA,IAAA,OAAO,aAAa;AACtB;AAEM,SAAU,WAAW,CAAC,IAAY,EAAA;AACtC,IAAA,MAAM,UAAU,GAAmC;AACjD,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,GAAG,EAAE,IAAI;AACT,QAAA,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAA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