@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 +2 -2
- package/lib/index.js +34 -32
- package/package.json +1 -1
- package/sdk/index.css +2 -2
- package/sdk/index.js +1700 -2988
package/lib/index.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @wibetter/json-editor v5.1.
|
|
2
|
+
* @wibetter/json-editor v5.1.27
|
|
3
3
|
* author: wibetter
|
|
4
4
|
* build tool: AKFun
|
|
5
|
-
* build time: Fri
|
|
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.
|
|
2
|
+
* @wibetter/json-editor v5.1.27
|
|
3
3
|
* author: wibetter
|
|
4
4
|
* build tool: AKFun
|
|
5
|
-
* build time: Fri
|
|
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 (!
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
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
package/sdk/index.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @wibetter/json-editor v5.1.
|
|
2
|
+
* @wibetter/json-editor v5.1.27
|
|
3
3
|
* author: wibetter
|
|
4
4
|
* build tool: AKFun
|
|
5
|
-
* build time: Fri
|
|
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
|
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|