@dovetail-v2/refine 0.0.14-beta.0 → 0.0.14-beta.1

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.
@@ -1,4 +1,4 @@
1
- import { j as jsxRuntime } from "./index.0c2122ef.js";
1
+ import { j as jsxRuntime } from "./index.e31fb37e.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "@refinedev/core";
@@ -6857,18 +6857,14 @@ const useEagleForm = ({
6857
6857
  const warnWhenUnsavedChanges = warnWhenUnsavedChangesProp != null ? warnWhenUnsavedChangesProp : warnWhenUnsavedChangesRefine;
6858
6858
  React.useEffect(() => {
6859
6859
  var _a2;
6860
- form.resetFields();
6861
6860
  if (editor.current) {
6862
- const editorValue = yaml.dump(form.getFieldsValue(true));
6863
6861
  const editorInstance = editor.current.getEditorInstance();
6864
- editor.current.setEditorValue(editorValue);
6865
- editor.current.setValue(editorValue);
6866
6862
  if (((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) && editorInstance && !isFoldRef.current) {
6867
6863
  fold(editorInstance);
6868
6864
  isFoldRef.current = true;
6869
6865
  }
6870
6866
  }
6871
- }, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, form, fold]);
6867
+ }, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, fold]);
6872
6868
  React.useEffect(() => {
6873
6869
  var _a2, _b2;
6874
6870
  const response = (_a2 = useFormCoreResult.mutationResult.error) == null ? void 0 : _a2.response;
@@ -7787,7 +7783,7 @@ const DurationColumnRenderer = () => {
7787
7783
  };
7788
7784
  };
7789
7785
  const ServiceTypeColumnRenderer = () => {
7790
- const dataIndex = ["rawYaml", "spec", "type"];
7786
+ const dataIndex = ["spec", "type"];
7791
7787
  return {
7792
7788
  key: "type",
7793
7789
  title: i18n.t("dovetail.type"),
@@ -8927,7 +8923,7 @@ const DataField = () => {
8927
8923
  return {
8928
8924
  key: "data",
8929
8925
  title: i18n.t("dovetail.data"),
8930
- path: ["rawYaml", "data"],
8926
+ path: ["data"],
8931
8927
  render: (val) => {
8932
8928
  return /* @__PURE__ */ jsxRuntime.exports.jsx(KeyValue, { value: val });
8933
8929
  }
@@ -8937,7 +8933,7 @@ const SecretDataField = () => {
8937
8933
  return {
8938
8934
  key: "data",
8939
8935
  title: i18n.t("dovetail.data"),
8940
- path: ["rawYaml", "data"],
8936
+ path: ["data"],
8941
8937
  render: (val) => {
8942
8938
  const decodeVal = {};
8943
8939
  for (const key in val) {
@@ -8961,21 +8957,21 @@ const ServiceTypeField = () => {
8961
8957
  return {
8962
8958
  key: "type",
8963
8959
  title: i18n.t("dovetail.type"),
8964
- path: ["rawYaml", "spec", "type"]
8960
+ path: ["spec", "type"]
8965
8961
  };
8966
8962
  };
8967
8963
  const ClusterIpField = () => {
8968
8964
  return {
8969
8965
  key: "clusterIp",
8970
8966
  title: i18n.t("dovetail.clusterIp"),
8971
- path: ["rawYaml", "spec", "clusterIP"]
8967
+ path: ["spec", "clusterIP"]
8972
8968
  };
8973
8969
  };
8974
8970
  const SessionAffinityField = () => {
8975
8971
  return {
8976
8972
  key: "clusterIp",
8977
8973
  title: i18n.t("dovetail.sessionAffinity"),
8978
- path: ["rawYaml", "spec", "sessionAffinity"]
8974
+ path: ["spec", "sessionAffinity"]
8979
8975
  };
8980
8976
  };
8981
8977
  const ServicePodsField = () => {
@@ -9171,34 +9167,34 @@ const EventsTable = ({}) => {
9171
9167
  {
9172
9168
  key: "type",
9173
9169
  display: true,
9174
- dataIndex: ["rawYaml", "type"],
9170
+ dataIndex: ["type"],
9175
9171
  title: i18n2.t("dovetail.type"),
9176
9172
  sortable: true,
9177
- sorter: CommonSorter(["rawYaml", "type"])
9173
+ sorter: CommonSorter(["type"])
9178
9174
  },
9179
9175
  {
9180
9176
  key: "reason",
9181
9177
  display: true,
9182
- dataIndex: ["rawYaml", "reason"],
9178
+ dataIndex: ["reason"],
9183
9179
  title: i18n2.t("dovetail.reason"),
9184
9180
  sortable: true,
9185
- sorter: CommonSorter(["rawYaml", "reason"])
9181
+ sorter: CommonSorter(["reason"])
9186
9182
  },
9187
9183
  {
9188
9184
  key: "object",
9189
9185
  display: true,
9190
- dataIndex: ["rawYaml", "regarding", "name"],
9186
+ dataIndex: ["regarding", "name"],
9191
9187
  title: i18n2.t("dovetail.object"),
9192
9188
  sortable: true,
9193
- sorter: CommonSorter(["rawYaml", "regarding", "name"])
9189
+ sorter: CommonSorter(["regarding", "name"])
9194
9190
  },
9195
9191
  {
9196
9192
  key: "note",
9197
9193
  display: true,
9198
- dataIndex: ["rawYaml", "note"],
9194
+ dataIndex: ["note"],
9199
9195
  title: i18n2.t("dovetail.note"),
9200
9196
  sortable: true,
9201
- sorter: CommonSorter(["rawYaml", "note"])
9197
+ sorter: CommonSorter(["note"])
9202
9198
  },
9203
9199
  AgeColumnRenderer()
9204
9200
  ],
@@ -9676,7 +9672,7 @@ const Separator = () => {
9676
9672
  });
9677
9673
  };
9678
9674
  const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
9679
- const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.8847f437.js"));
9675
+ const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.e0df5a1b.js"));
9680
9676
  const YamlEditorComponent = forwardRef(
9681
9677
  function YamlEditorComponent2(props, ref) {
9682
9678
  const {
@@ -10172,6 +10168,9 @@ function YamlForm(props) {
10172
10168
  i18n: i18n2
10173
10169
  } = useTranslation();
10174
10170
  const responseErrors = errorResponseBody ? getCommonErrors(errorResponseBody, i18n2) : [];
10171
+ const schema = useMemo(() => {
10172
+ return editorProps.schema || {};
10173
+ }, [editorProps.schema]);
10175
10174
  return /* @__PURE__ */ jsxRuntime.exports.jsx(FormLayout, {
10176
10175
  children: /* @__PURE__ */ jsxRuntime.exports.jsx(kit.form, {
10177
10176
  ...formProps,
@@ -10190,7 +10189,7 @@ function YamlForm(props) {
10190
10189
  children: /* @__PURE__ */ jsxRuntime.exports.jsx(YamlEditorComponent, {
10191
10190
  ...editorProps,
10192
10191
  className: EditorStyle,
10193
- schema: editorProps.schema || {},
10192
+ schema,
10194
10193
  collapsable: false
10195
10194
  })
10196
10195
  }), /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.form.Item, {
@@ -16679,7 +16678,6 @@ var RESOURCE_GROUP = /* @__PURE__ */ ((RESOURCE_GROUP2) => {
16679
16678
  RESOURCE_GROUP2["CLUSTER"] = "CLUSTER";
16680
16679
  return RESOURCE_GROUP2;
16681
16680
  })(RESOURCE_GROUP || {});
16682
- console.log("betaversion");
16683
16681
  export {
16684
16682
  ConditionsField as $,
16685
16683
  AgeColumnRenderer as A,
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ai, A, an, B, ap, a6, g, C, f, ay, $, v, y, J, aF, Q, aq, ao, a2, V, ab, aw, ae, D, ag, Z, I, ar, az, a1, T, K, X, ac, af, M, ah, N, m, b, q, ak, d, at, t, P, w, am, aD, aC, a0, ax, _, R, G, F, z, aE, E, L, e, au, as, aa, a3, U, a8, S, a5, a7, a9, a4, ad, av, al, aB, x, W, aA, H, O, c, Y, n, s, p, o, r, a, i, h, k, l, aj, u } from "./index.0c2122ef.js";
1
+ import { ai, A, an, B, ap, a6, g, C, f, ay, $, v, y, J, aF, Q, aq, ao, a2, V, ab, aw, ae, D, ag, Z, I, ar, az, a1, T, K, X, ac, af, M, ah, N, m, b, q, ak, d, at, t, P, w, am, aD, aC, a0, ax, _, R, G, F, z, aE, E, L, e, au, as, aa, a3, U, a8, S, a5, a7, a9, a4, ad, av, al, aB, x, W, aA, H, O, c, Y, n, s, p, o, r, a, i, h, k, l, aj, u } from "./index.e31fb37e.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "js-yaml";
@@ -6870,18 +6870,14 @@ var __publicField = (obj, key, value) => {
6870
6870
  const warnWhenUnsavedChanges = warnWhenUnsavedChangesProp != null ? warnWhenUnsavedChangesProp : warnWhenUnsavedChangesRefine;
6871
6871
  React__default.default.useEffect(() => {
6872
6872
  var _a2;
6873
- form.resetFields();
6874
6873
  if (editor.current) {
6875
- const editorValue = yaml__default.default.dump(form.getFieldsValue(true));
6876
6874
  const editorInstance = editor.current.getEditorInstance();
6877
- editor.current.setEditorValue(editorValue);
6878
- editor.current.setValue(editorValue);
6879
6875
  if (((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) && editorInstance && !isFoldRef.current) {
6880
6876
  fold(editorInstance);
6881
6877
  isFoldRef.current = true;
6882
6878
  }
6883
6879
  }
6884
- }, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, form, fold]);
6880
+ }, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, fold]);
6885
6881
  React__default.default.useEffect(() => {
6886
6882
  var _a2, _b2;
6887
6883
  const response = (_a2 = useFormCoreResult.mutationResult.error) == null ? void 0 : _a2.response;
@@ -7800,7 +7796,7 @@ var __publicField = (obj, key, value) => {
7800
7796
  };
7801
7797
  };
7802
7798
  const ServiceTypeColumnRenderer = () => {
7803
- const dataIndex = ["rawYaml", "spec", "type"];
7799
+ const dataIndex = ["spec", "type"];
7804
7800
  return {
7805
7801
  key: "type",
7806
7802
  title: i18n__default.default.t("dovetail.type"),
@@ -8940,7 +8936,7 @@ var __publicField = (obj, key, value) => {
8940
8936
  return {
8941
8937
  key: "data",
8942
8938
  title: i18n__default.default.t("dovetail.data"),
8943
- path: ["rawYaml", "data"],
8939
+ path: ["data"],
8944
8940
  render: (val) => {
8945
8941
  return /* @__PURE__ */ jsxRuntime.exports.jsx(KeyValue, { value: val });
8946
8942
  }
@@ -8950,7 +8946,7 @@ var __publicField = (obj, key, value) => {
8950
8946
  return {
8951
8947
  key: "data",
8952
8948
  title: i18n__default.default.t("dovetail.data"),
8953
- path: ["rawYaml", "data"],
8949
+ path: ["data"],
8954
8950
  render: (val) => {
8955
8951
  const decodeVal = {};
8956
8952
  for (const key in val) {
@@ -8974,21 +8970,21 @@ var __publicField = (obj, key, value) => {
8974
8970
  return {
8975
8971
  key: "type",
8976
8972
  title: i18n__default.default.t("dovetail.type"),
8977
- path: ["rawYaml", "spec", "type"]
8973
+ path: ["spec", "type"]
8978
8974
  };
8979
8975
  };
8980
8976
  const ClusterIpField = () => {
8981
8977
  return {
8982
8978
  key: "clusterIp",
8983
8979
  title: i18n__default.default.t("dovetail.clusterIp"),
8984
- path: ["rawYaml", "spec", "clusterIP"]
8980
+ path: ["spec", "clusterIP"]
8985
8981
  };
8986
8982
  };
8987
8983
  const SessionAffinityField = () => {
8988
8984
  return {
8989
8985
  key: "clusterIp",
8990
8986
  title: i18n__default.default.t("dovetail.sessionAffinity"),
8991
- path: ["rawYaml", "spec", "sessionAffinity"]
8987
+ path: ["spec", "sessionAffinity"]
8992
8988
  };
8993
8989
  };
8994
8990
  const ServicePodsField = () => {
@@ -9184,34 +9180,34 @@ var __publicField = (obj, key, value) => {
9184
9180
  {
9185
9181
  key: "type",
9186
9182
  display: true,
9187
- dataIndex: ["rawYaml", "type"],
9183
+ dataIndex: ["type"],
9188
9184
  title: i18n2.t("dovetail.type"),
9189
9185
  sortable: true,
9190
- sorter: CommonSorter(["rawYaml", "type"])
9186
+ sorter: CommonSorter(["type"])
9191
9187
  },
9192
9188
  {
9193
9189
  key: "reason",
9194
9190
  display: true,
9195
- dataIndex: ["rawYaml", "reason"],
9191
+ dataIndex: ["reason"],
9196
9192
  title: i18n2.t("dovetail.reason"),
9197
9193
  sortable: true,
9198
- sorter: CommonSorter(["rawYaml", "reason"])
9194
+ sorter: CommonSorter(["reason"])
9199
9195
  },
9200
9196
  {
9201
9197
  key: "object",
9202
9198
  display: true,
9203
- dataIndex: ["rawYaml", "regarding", "name"],
9199
+ dataIndex: ["regarding", "name"],
9204
9200
  title: i18n2.t("dovetail.object"),
9205
9201
  sortable: true,
9206
- sorter: CommonSorter(["rawYaml", "regarding", "name"])
9202
+ sorter: CommonSorter(["regarding", "name"])
9207
9203
  },
9208
9204
  {
9209
9205
  key: "note",
9210
9206
  display: true,
9211
- dataIndex: ["rawYaml", "note"],
9207
+ dataIndex: ["note"],
9212
9208
  title: i18n2.t("dovetail.note"),
9213
9209
  sortable: true,
9214
- sorter: CommonSorter(["rawYaml", "note"])
9210
+ sorter: CommonSorter(["note"])
9215
9211
  },
9216
9212
  AgeColumnRenderer()
9217
9213
  ],
@@ -10185,6 +10181,9 @@ var __publicField = (obj, key, value) => {
10185
10181
  i18n: i18n2
10186
10182
  } = useTranslation();
10187
10183
  const responseErrors = errorResponseBody ? getCommonErrors(errorResponseBody, i18n2) : [];
10184
+ const schema = React.useMemo(() => {
10185
+ return editorProps.schema || {};
10186
+ }, [editorProps.schema]);
10188
10187
  return /* @__PURE__ */ jsxRuntime.exports.jsx(FormLayout, {
10189
10188
  children: /* @__PURE__ */ jsxRuntime.exports.jsx(kit.form, {
10190
10189
  ...formProps,
@@ -10203,7 +10202,7 @@ var __publicField = (obj, key, value) => {
10203
10202
  children: /* @__PURE__ */ jsxRuntime.exports.jsx(YamlEditorComponent, {
10204
10203
  ...editorProps,
10205
10204
  className: EditorStyle,
10206
- schema: editorProps.schema || {},
10205
+ schema,
10207
10206
  collapsable: false
10208
10207
  })
10209
10208
  }), /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.form.Item, {
@@ -16692,7 +16691,6 @@ var __publicField = (obj, key, value) => {
16692
16691
  RESOURCE_GROUP2["CLUSTER"] = "CLUSTER";
16693
16692
  return RESOURCE_GROUP2;
16694
16693
  })(RESOURCE_GROUP || {});
16695
- console.log("betaversion");
16696
16694
  const MonacoYamlDiffEditor = (props) => {
16697
16695
  const ref = React.useRef(null);
16698
16696
  const { origin, modified, id, height } = props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.0.14-beta.0",
3
+ "version": "0.0.14-beta.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",