@blocklet/pages-kit 0.4.43 → 0.4.44

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,6 +1,26 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.RenderNestedComponent = void 0;
@@ -9,7 +29,7 @@ exports.mergeComponent = mergeComponent;
9
29
  exports.safeJSONParse = safeJSONParse;
10
30
  exports.parsePropertyValue = parsePropertyValue;
11
31
  exports.assignNullableFields = assignNullableFields;
12
- const js_yaml_1 = __importDefault(require("js-yaml"));
32
+ const yaml = __importStar(require("yaml"));
13
33
  function componentUMDName({ componentId }) {
14
34
  return `PagesCustomComponent${componentId}`;
15
35
  }
@@ -83,14 +103,15 @@ function parsePropertyValue(property, value, { locale, defaultLocale }) {
83
103
  }
84
104
  }
85
105
  if (property.type === 'array') {
86
- if (!value)
87
- return [];
106
+ if (Array.isArray(value))
107
+ return value;
108
+ return undefined;
88
109
  }
89
110
  if (property.type === 'yaml') {
90
111
  if (!value)
91
112
  return undefined;
92
113
  try {
93
- return js_yaml_1.default.load(value);
114
+ return yaml.stringify(value, { indent: 2 });
94
115
  }
95
116
  catch (error) {
96
117
  console.error('parse yaml value error', error);