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