@wibetter/json-editor 5.1.26 → 5.1.28

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/lib/index.css CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.1.25
2
+ * @wibetter/json-editor v5.1.27
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Fri Jan 24 2025 22:59:49 GMT+0800 (中国标准时间)
5
+ * build time: Fri Feb 14 2025 21:37:10 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
package/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.1.25
2
+ * @wibetter/json-editor v5.1.27
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Fri Jan 24 2025 22:59:49 GMT+0800 (中国标准时间)
5
+ * build time: Fri Feb 14 2025 21:37:10 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -362,6 +362,7 @@ var JSONDataEditor = /*#__PURE__*/function (_React$PureComponent) {
362
362
  schemaStore: schemaStore,
363
363
  jsonStore: jsonStore
364
364
  }))), !isEmpty && jsonView && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement($components_JsonView_index__WEBPACK_IMPORTED_MODULE_6__["default"], {
365
+ key: lastUpdateTime + "-" + jsonLastUpdateTime + "-jsonView",
365
366
  jsonData: JSONEditorObj,
366
367
  readOnly: jsonViewReadOnly != null ? jsonViewReadOnly : true,
367
368
  onChange: jsonChange
@@ -7452,6 +7453,7 @@ var JSONEditorStore = (_dec = mobx__WEBPACK_IMPORTED_MODULE_4__.action.bound, _d
7452
7453
  this.updateLastTime();
7453
7454
  }
7454
7455
  }
7456
+ console.info('[json-editor]initJSONData:', this.jsonData);
7455
7457
  }
7456
7458
 
7457
7459
  /** 初始化jsonData */;
@@ -7807,41 +7809,41 @@ var JSONSchemaStore = (_dec = mobx__WEBPACK_IMPORTED_MODULE_4__.action.bound, _d
7807
7809
  this.jsonSchema = newJSONSchema;
7808
7810
  }
7809
7811
  }
7812
+ console.info('[json-editor]initJSONSchemaData:', this.jsonSchema);
7810
7813
  }
7811
7814
 
7812
7815
  /** 根据索引路径获取对应的json数据[非联动式数据获取] */;
7813
7816
  _proto.JSONSchemaChange = function JSONSchemaChange(jsonSchemaData) {
7814
- if (!(0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.isEqual)(jsonSchemaData, this.JSONSchemaObj)) {
7815
- if (!jsonSchemaData || JSON.stringify(jsonSchemaData) === '{}') {
7816
- // 使用默认的jsonschema数据进行初始化
7817
- this.jsonSchema = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(_initJSONSchemaData);
7818
- } else if (jsonSchemaData && (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.isNewSchemaData)(jsonSchemaData)) {
7819
- /** 如果有lastUpdateTime则说明是新版jsonSchema数据,无需转换直接进行赋值 */
7820
- this.jsonSchema = jsonSchemaData;
7821
- } else {
7822
- // 进行一次转换,以便兼容旧版数据
7823
- var newJSONSchema = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.oldSchemaToNewSchema)(jsonSchemaData);
7824
- this.jsonSchema = newJSONSchema;
7825
- }
7826
- var JSONEditorStore = this.state.rootJSONStore.JSONEditorStore;
7827
- var curJsonData = JSONEditorStore.jsonData;
7828
- var newJsonData = {};
7829
- /** 根据jsonSchema生成对应的最新jsonData */
7830
- if (this.jsonSchema.reset) {
7831
- // schema 变动不保留旧版 jsonData 数据
7832
- newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, {});
7833
- } else {
7834
- // 默认保留旧版jsonData数据
7835
- newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, curJsonData);
7836
- }
7837
- /** 更新当前的jsonData */
7838
- this.state.rootJSONStore.JSONEditorStore.jsonData = newJsonData;
7839
- this.state.rootJSONStore.JSONEditorStore.initJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(curJsonData); // 备份此前的数据对象
7840
- /** jsonSchema变动的时候触发一次jsonDataChange
7841
- * jsonSchema变动意味着jsonData也需要进行对应的结构更新
7842
- * */
7843
- // this.state.rootJSONStore.JSONEditorStore.jsonDataChange();
7817
+ if (!jsonSchemaData || JSON.stringify(jsonSchemaData) === '{}') {
7818
+ // 使用默认的jsonschema数据进行初始化
7819
+ this.jsonSchema = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(_initJSONSchemaData);
7820
+ } else if (jsonSchemaData && (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.isNewSchemaData)(jsonSchemaData)) {
7821
+ /** 如果有lastUpdateTime则说明是新版jsonSchema数据,无需转换直接进行赋值 */
7822
+ this.jsonSchema = jsonSchemaData;
7823
+ } else {
7824
+ // 进行一次转换,以便兼容旧版数据
7825
+ var newJSONSchema = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.oldSchemaToNewSchema)(jsonSchemaData);
7826
+ this.jsonSchema = newJSONSchema;
7844
7827
  }
7828
+ var JSONEditorStore = this.state.rootJSONStore.JSONEditorStore;
7829
+ var curJsonData = JSONEditorStore.jsonData;
7830
+ var newJsonData = {};
7831
+ /** 根据jsonSchema生成对应的最新jsonData */
7832
+ if (this.jsonSchema.reset) {
7833
+ // schema 变动不保留旧版 jsonData 数据
7834
+ newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, {});
7835
+ } else {
7836
+ // 默认保留旧版jsonData数据
7837
+ newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, curJsonData);
7838
+ }
7839
+ /** 更新当前的jsonData */
7840
+ this.state.rootJSONStore.JSONEditorStore.jsonData = newJsonData;
7841
+ this.state.rootJSONStore.JSONEditorStore.initJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(curJsonData); // 备份此前的数据对象
7842
+ /** jsonSchema变动的时候触发一次jsonDataChange
7843
+ * jsonSchema变动意味着jsonData也需要进行对应的结构更新
7844
+ * */
7845
+ // this.state.rootJSONStore.JSONEditorStore.jsonDataChange();
7846
+ console.info('[json-editor]JSONSchemaChange:', this.jsonSchema);
7845
7847
  };
7846
7848
  /** 根据索引路径获取对应的key值路径 */
7847
7849
  _proto.indexRoute2keyRoute = function indexRoute2keyRoute(indexRoute) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wibetter/json-editor",
3
- "version": "5.1.26",
3
+ "version": "5.1.28",
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.1.25
2
+ * @wibetter/json-editor v5.1.27
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Fri Jan 24 2025 23:00:05 GMT+0800 (中国标准时间)
5
+ * build time: Fri Feb 14 2025 21:38:33 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\