@flowgram.ai/type-editor 0.1.0-alpha.12 → 0.1.0-alpha.14
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/dist/esm/index.js +9 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +17 -16
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -51,6 +51,7 @@ __export(src_exports, {
|
|
|
51
51
|
typeEditorColumnConfigs: () => columnConfigs
|
|
52
52
|
});
|
|
53
53
|
module.exports = __toCommonJS(src_exports);
|
|
54
|
+
var import_table2 = require("@douyinfe/semi-ui/lib/es/table");
|
|
54
55
|
|
|
55
56
|
// src/types/type-editor.ts
|
|
56
57
|
var TypeEditorColumnType = /* @__PURE__ */ ((TypeEditorColumnType2) => {
|
|
@@ -661,7 +662,7 @@ ShortcutsService = __decorateClass([
|
|
|
661
662
|
], ShortcutsService);
|
|
662
663
|
|
|
663
664
|
// src/services/type-operation-service.ts
|
|
664
|
-
var
|
|
665
|
+
var import_lodash_es = require("lodash-es");
|
|
665
666
|
var import_inversify4 = require("inversify");
|
|
666
667
|
var TypeEditorOperationService = class {
|
|
667
668
|
constructor() {
|
|
@@ -701,7 +702,7 @@ var TypeEditorOperationService = class {
|
|
|
701
702
|
this.redoStack = [];
|
|
702
703
|
}
|
|
703
704
|
storeState(value) {
|
|
704
|
-
if ((0,
|
|
705
|
+
if ((0, import_lodash_es.isEqual)(this.getCurrentState(), value)) {
|
|
705
706
|
return;
|
|
706
707
|
}
|
|
707
708
|
this._storeState(value);
|
|
@@ -1287,7 +1288,7 @@ var useTypeTransform = () => {
|
|
|
1287
1288
|
|
|
1288
1289
|
// src/components/type-selector/hooks/focus-item.ts
|
|
1289
1290
|
var import_react15 = require("react");
|
|
1290
|
-
var
|
|
1291
|
+
var import_lodash_es2 = require("lodash-es");
|
|
1291
1292
|
var validatePos = (pos) => pos.x >= 0 && pos.y >= 0;
|
|
1292
1293
|
var useFocusItemCascader = ({
|
|
1293
1294
|
rootTypes,
|
|
@@ -1439,8 +1440,8 @@ var useFocusItemSearch = ({
|
|
|
1439
1440
|
}
|
|
1440
1441
|
setFocusPos(newPos);
|
|
1441
1442
|
},
|
|
1442
|
-
moveFocusItemLeft:
|
|
1443
|
-
moveFocusItemRight:
|
|
1443
|
+
moveFocusItemLeft: import_lodash_es2.noop,
|
|
1444
|
+
moveFocusItemRight: import_lodash_es2.noop,
|
|
1444
1445
|
moveFocusItemUp() {
|
|
1445
1446
|
if (focusPos < 0) {
|
|
1446
1447
|
setFocusPos(0);
|
|
@@ -3737,7 +3738,7 @@ var columnConfigs = [
|
|
|
3737
3738
|
|
|
3738
3739
|
// src/components/type-editor/index.tsx
|
|
3739
3740
|
var import_react55 = __toESM(require("react"));
|
|
3740
|
-
var
|
|
3741
|
+
var import_lodash_es6 = require("lodash-es");
|
|
3741
3742
|
var import_semi_ui31 = require("@douyinfe/semi-ui");
|
|
3742
3743
|
|
|
3743
3744
|
// src/components/type-editor/type-editor.tsx
|
|
@@ -3749,7 +3750,7 @@ var import_react_dnd_html5_backend = require("react-dnd-html5-backend");
|
|
|
3749
3750
|
var import_react_dnd2 = require("react-dnd");
|
|
3750
3751
|
var import_react49 = require("react");
|
|
3751
3752
|
var import_react50 = __toESM(require("react"));
|
|
3752
|
-
var
|
|
3753
|
+
var import_lodash_es4 = require("lodash-es");
|
|
3753
3754
|
var import_classnames6 = __toESM(require("classnames"));
|
|
3754
3755
|
var import_semi_ui27 = require("@douyinfe/semi-ui");
|
|
3755
3756
|
|
|
@@ -3857,7 +3858,7 @@ var typeDefinitionConfig = {
|
|
|
3857
3858
|
};
|
|
3858
3859
|
|
|
3859
3860
|
// src/components/type-editor/mode/declare-assign.ts
|
|
3860
|
-
var
|
|
3861
|
+
var import_lodash_es3 = require("lodash-es");
|
|
3861
3862
|
var traverseIJsonSchema2 = (root, path, cb) => {
|
|
3862
3863
|
if (root) {
|
|
3863
3864
|
cb(root, path);
|
|
@@ -3875,7 +3876,7 @@ var declareAssignConfig = {
|
|
|
3875
3876
|
const newSchema = JSON.parse(JSON.stringify(val));
|
|
3876
3877
|
traverseIJsonSchema2(newSchema, [], (type, path) => {
|
|
3877
3878
|
if (type.extra?.value !== void 0) {
|
|
3878
|
-
(0,
|
|
3879
|
+
(0, import_lodash_es3.set)(data, path, type.extra?.value);
|
|
3879
3880
|
}
|
|
3880
3881
|
if (type.extra) {
|
|
3881
3882
|
delete type.extra;
|
|
@@ -3890,7 +3891,7 @@ var declareAssignConfig = {
|
|
|
3890
3891
|
const { data } = schema;
|
|
3891
3892
|
const newSchema = JSON.parse(JSON.stringify(schema.definition.schema));
|
|
3892
3893
|
traverseIJsonSchema2(newSchema, [], (type, path) => {
|
|
3893
|
-
const value = (0,
|
|
3894
|
+
const value = (0, import_lodash_es3.get)(data, path);
|
|
3894
3895
|
if (value !== void 0 && type.type !== "object") {
|
|
3895
3896
|
type.extra = { value };
|
|
3896
3897
|
}
|
|
@@ -4490,7 +4491,7 @@ var TableInner = ({
|
|
|
4490
4491
|
}, [onInit]);
|
|
4491
4492
|
const [unOpenKeys, setUnOpenKeys] = (0, import_react49.useState)({});
|
|
4492
4493
|
(0, import_react49.useEffect)(() => {
|
|
4493
|
-
if (!(0,
|
|
4494
|
+
if (!(0, import_lodash_es4.isEqual)(typeSchema, initialSchema) && typeSchema && (forceUpdate || !typeEditorUtils.isTempState(initialSchema, extraConfig?.customValidateName))) {
|
|
4494
4495
|
setInitialSchema(typeEditorUtils.clone(typeSchema));
|
|
4495
4496
|
}
|
|
4496
4497
|
}, [typeSchema, extraConfig?.customValidateName]);
|
|
@@ -4801,7 +4802,7 @@ var UndoRedo = ({
|
|
|
4801
4802
|
|
|
4802
4803
|
// src/components/type-editor/tools/create-by-data.tsx
|
|
4803
4804
|
var import_react53 = __toESM(require("react"));
|
|
4804
|
-
var
|
|
4805
|
+
var import_lodash_es5 = require("lodash-es");
|
|
4805
4806
|
var import_semi_ui29 = require("@douyinfe/semi-ui");
|
|
4806
4807
|
var import_semi_illustrations2 = require("@douyinfe/semi-illustrations");
|
|
4807
4808
|
|
|
@@ -4838,7 +4839,7 @@ var CreateByData = ({
|
|
|
4838
4839
|
handleClose();
|
|
4839
4840
|
}
|
|
4840
4841
|
}, [handleClose, typeEditorValue, editor]);
|
|
4841
|
-
const onChange = (0,
|
|
4842
|
+
const onChange = (0, import_lodash_es5.debounce)((newVal) => {
|
|
4842
4843
|
const parsedValue = typeEditorUtils.jsonParse(newVal);
|
|
4843
4844
|
const error = newVal && !(parsedValue && typeof parsedValue === "object" && !Array.isArray(parsedValue));
|
|
4844
4845
|
if (!error) {
|
|
@@ -4917,10 +4918,10 @@ var TypeEditorContainer = (props, ref) => {
|
|
|
4917
4918
|
const [instance, setInstance] = (0, import_react55.useState)();
|
|
4918
4919
|
(0, import_react55.useImperativeHandle)(ref, () => ({
|
|
4919
4920
|
getContainer: () => instance?.getContainer(),
|
|
4920
|
-
setValue: instance?.setValue ||
|
|
4921
|
+
setValue: instance?.setValue || import_lodash_es6.noop,
|
|
4921
4922
|
getService: instance?.getService || (() => void 0),
|
|
4922
|
-
undo: instance?.undo ||
|
|
4923
|
-
redo: instance?.redo ||
|
|
4923
|
+
undo: instance?.undo || import_lodash_es6.noop,
|
|
4924
|
+
redo: instance?.redo || import_lodash_es6.noop,
|
|
4924
4925
|
getValue() {
|
|
4925
4926
|
return instance?.getValue();
|
|
4926
4927
|
},
|