@blocklet/pages-kit 0.4.43 → 0.4.45
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import yaml from '
|
|
1
|
+
import * as yaml from 'yaml';
|
|
2
2
|
export function componentUMDName({ componentId }) {
|
|
3
3
|
return `PagesCustomComponent${componentId}`;
|
|
4
4
|
}
|
|
@@ -72,14 +72,15 @@ export function parsePropertyValue(property, value, { locale, defaultLocale }) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
if (property.type === 'array') {
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
75
|
+
if (Array.isArray(value))
|
|
76
|
+
return value;
|
|
77
|
+
return undefined;
|
|
77
78
|
}
|
|
78
79
|
if (property.type === 'yaml') {
|
|
79
80
|
if (!value)
|
|
80
81
|
return undefined;
|
|
81
82
|
try {
|
|
82
|
-
return yaml.
|
|
83
|
+
return yaml.stringify(value, { indent: 2 });
|
|
83
84
|
}
|
|
84
85
|
catch (error) {
|
|
85
86
|
console.error('parse yaml value error', error);
|