@wibetter/json-editor 5.0.6 → 5.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wibetter/json-editor",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "description": "JSON数据可视化/JSONEditor, 可视化界面编辑json数据",
5
5
  "keywords": [
6
6
  "json",
package/sdk/index.css CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.0.6
2
+ * @wibetter/json-editor v5.0.7
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Fri Dec 20 2024 23:31:07 GMT+0800 (中国标准时间)
5
+ * build time: Mon Dec 23 2024 18:08:06 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
package/sdk/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.0.6
2
+ * @wibetter/json-editor v5.0.7
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Fri Dec 20 2024 23:31:07 GMT+0800 (中国标准时间)
5
+ * build time: Mon Dec 23 2024 18:08:06 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -68879,8 +68879,15 @@ var JSONSchemaStore = (_dec = mobx__WEBPACK_IMPORTED_MODULE_4__.action.bound, _d
68879
68879
  this.jsonSchema = newJSONSchema;
68880
68880
  }
68881
68881
  var curJsonData = this.state.rootJSONStore.JSONEditorStore.jsonData;
68882
+ var newJsonData = {};
68882
68883
  /** 根据jsonSchema生成对应的最新jsonData */
68883
- var newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, curJsonData);
68884
+ if (this.jsonSchema.reset) {
68885
+ // schema 变动不保留旧版 jsonData 数据
68886
+ newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, {});
68887
+ } else {
68888
+ // 默认保留旧版jsonData数据
68889
+ newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, curJsonData);
68890
+ }
68884
68891
  /** 更新当前的jsonData */
68885
68892
  this.state.rootJSONStore.JSONEditorStore.jsonData = newJsonData;
68886
68893
  this.state.rootJSONStore.JSONEditorStore.initJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(curJsonData); // 备份此前的数据对象
@@ -262154,7 +262161,7 @@ function baseSchema2JsonData(jsonSchema, jsonData) {
262154
262161
  curJsonData = hasProperties(curValue) ? curValue : false;
262155
262162
  break;
262156
262163
  case 'number':
262157
- curJsonData = hasProperties(curValue) ? curValue : 1;
262164
+ curJsonData = hasProperties(curValue) ? curValue : undefined;
262158
262165
  break;
262159
262166
  case 'json':
262160
262167
  /* 转成json类型进行特殊处理,需要保证json类型的数值是json对象 */
@@ -262184,7 +262191,7 @@ function baseSchema2JsonData(jsonSchema, jsonData) {
262184
262191
  // 兼容处理:解决box-style默认值丢失问题
262185
262192
  curJsonData = curValue ? curValue : jsonSchema.default;
262186
262193
  } else {
262187
- curJsonData = hasProperties(curValue) ? curValue : '';
262194
+ curJsonData = hasProperties(curValue) ? curValue : undefined;
262188
262195
  }
262189
262196
  }
262190
262197
  return curJsonData;