@blocklet/pages-kit 0.5.18 → 0.5.19
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.
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.initDynamicParsePropertyValueHandlers = exports.RenderNestedComponent = void 0;
|
|
29
|
+
exports.initDynamicParsePropertyValueHandlers = exports.RenderNestedComponent = exports.sanitize = void 0;
|
|
30
30
|
exports.componentUMDName = componentUMDName;
|
|
31
31
|
exports.mergeComponent = mergeComponent;
|
|
32
32
|
exports.safeJSONParse = safeJSONParse;
|
|
@@ -34,9 +34,11 @@ exports.safeYamlParse = safeYamlParse;
|
|
|
34
34
|
exports.parsePropertyValue = parsePropertyValue;
|
|
35
35
|
exports.assignNullableFields = assignNullableFields;
|
|
36
36
|
exports.getComponentDependencies = getComponentDependencies;
|
|
37
|
+
const xss_1 = require("@blocklet/xss");
|
|
37
38
|
const snakeCase_1 = __importDefault(require("lodash/snakeCase"));
|
|
38
39
|
const yaml = __importStar(require("yaml"));
|
|
39
40
|
const common_1 = require("./common");
|
|
41
|
+
exports.sanitize = (0, xss_1.initSanitize)();
|
|
40
42
|
function componentUMDName({ componentId }) {
|
|
41
43
|
return `PagesCustomComponent${(0, snakeCase_1.default)(componentId)}`;
|
|
42
44
|
}
|
|
@@ -129,12 +131,13 @@ const initDynamicParsePropertyValueHandlers = () => {
|
|
|
129
131
|
};
|
|
130
132
|
exports.initDynamicParsePropertyValueHandlers = initDynamicParsePropertyValueHandlers;
|
|
131
133
|
(0, exports.initDynamicParsePropertyValueHandlers)();
|
|
132
|
-
function parsePropertyValue(property,
|
|
134
|
+
function parsePropertyValue(property, inputValue, { locale, defaultLocale, propertyHandlers, }) {
|
|
133
135
|
// 混合动态和自定义的属性处理函数,这个需要放在最前面,因为有可能存在覆盖下面的处理
|
|
134
136
|
const mixedPropertyHandlers = {
|
|
135
137
|
...(dynamicPropertyHandlers ?? {}),
|
|
136
138
|
...(propertyHandlers ?? {}),
|
|
137
139
|
};
|
|
140
|
+
const value = inputValue;
|
|
138
141
|
if (mixedPropertyHandlers && property.type && typeof mixedPropertyHandlers[property.type] === 'function') {
|
|
139
142
|
try {
|
|
140
143
|
const handler = mixedPropertyHandlers[property.type];
|