@dovetail-v2/refine 0.0.14-beta.5 → 0.0.14-beta.6

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.6a36859b.js";
1
+ import { j as jsxRuntime } from "./index.e6025e49.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "@refinedev/core";
@@ -10,7 +10,7 @@ import { parse, stringify } from "qs";
10
10
  import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router } from "react-router-dom";
11
11
  import { useUIKit, Typo, Icon, kitContext } from "@cloudtower/eagle";
12
12
  import yaml from "js-yaml";
13
- import { isObject, get, merge } from "lodash-es";
13
+ import { isObject, get, merge, omit as omit$1 } from "lodash-es";
14
14
  import { useForm } from "sunflower-antd";
15
15
  import i18n from "i18next";
16
16
  import { EditPen16PrimaryIcon, TrashBinDelete16Icon, Download16GradientBlueIcon, MoreEllipsis316BoldBlueIcon, CheckmarkDoneSuccessCorrect16BoldGreenIcon, XmarkFailed16BoldRedIcon, DynamicResourceSchedule16BlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, Retry16GradientBlueIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, VmResume16Icon, SuspendedPause16GradientGrayIcon, Resume24Icon, SuspendedPause24GradientOrangeIcon } from "@cloudtower/icons-react";
@@ -9266,12 +9266,13 @@ const ShowContent = (props) => {
9266
9266
  const {
9267
9267
  resource
9268
9268
  } = useResource();
9269
+ const [mode, setMode] = useState("detail");
9269
9270
  const {
9270
9271
  queryResult
9271
9272
  } = useShow({
9272
- id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id
9273
+ id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id,
9274
+ liveMode: mode === "yaml" ? "off" : "auto"
9273
9275
  });
9274
- const [mode, setMode] = useState("detail");
9275
9276
  const {
9276
9277
  t
9277
9278
  } = useTranslation();
@@ -9281,6 +9282,11 @@ const ShowContent = (props) => {
9281
9282
  const {
9282
9283
  data: data2
9283
9284
  } = queryResult;
9285
+ const schema = useMemo(() => ({}), []);
9286
+ const defaultEditorValue = useMemo(() => (data2 == null ? void 0 : data2.data) ? yaml.dump(omit$1(globalStore == null ? void 0 : globalStore.restoreItem(data2.data), "id")) : "", [globalStore, data2]);
9287
+ const onEditorCreate = useCallback((editor) => {
9288
+ fold(editor);
9289
+ }, [fold]);
9284
9290
  if (!(data2 == null ? void 0 : data2.data)) {
9285
9291
  return null;
9286
9292
  }
@@ -9410,11 +9416,9 @@ const ShowContent = (props) => {
9410
9416
  }),
9411
9417
  ["yaml"]: /* @__PURE__ */ jsxRuntime.exports.jsx(MonacoYamlEditor$1, {
9412
9418
  className: EditorStyle$1,
9413
- defaultValue: yaml.dump(globalStore == null ? void 0 : globalStore.restoreItem(model)),
9414
- schema: {},
9415
- onEditorCreate: (editor) => {
9416
- fold(editor);
9417
- },
9419
+ defaultValue: defaultEditorValue,
9420
+ schema,
9421
+ onEditorCreate,
9418
9422
  readOnly: true
9419
9423
  })
9420
9424
  };
@@ -9591,7 +9595,7 @@ function ListPage(props) {
9591
9595
  selectedKeys
9592
9596
  }), /* @__PURE__ */ jsxRuntime.exports.jsx(Table$1, {
9593
9597
  ...tableProps,
9594
- className: TableStyle,
9598
+ className: cx_default(tableProps.className, TableStyle),
9595
9599
  scroll: {
9596
9600
  y: "calc(100% - 48px)"
9597
9601
  }
@@ -9675,7 +9679,7 @@ const Separator = () => {
9675
9679
  });
9676
9680
  };
9677
9681
  const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
9678
- const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.8f3588cd.js"));
9682
+ const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.c03fa0ab.js"));
9679
9683
  const YamlEditorComponent = forwardRef(
9680
9684
  function YamlEditorComponent2(props, ref) {
9681
9685
  const {
@@ -16617,9 +16621,9 @@ class RelationPlugin {
16617
16621
  const items = await Promise.all(
16618
16622
  res.items.map(
16619
16623
  (item) => this.processItem({
16620
- ...item,
16621
16624
  kind: kind.replace(/List$/g, ""),
16622
- apiVersion
16625
+ apiVersion,
16626
+ ...lodash.exports.omit(item, ["apiVersion", "kind"])
16623
16627
  })
16624
16628
  )
16625
16629
  );
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ai, A, an, B, ap, a6, g, C, f, ay, $, v, y, J, aG, Q, aq, ao, a2, V, ab, aw, ae, D, ag, aH, az, Z, I, ar, aA, a1, T, K, X, ac, af, M, ah, N, m, b, q, ak, d, at, t, P, w, am, aE, aD, a0, aI, ax, _, R, G, F, z, aF, E, L, e, au, as, aa, a3, U, a8, S, a5, a7, a9, a4, ad, av, al, aC, x, W, aB, H, O, c, Y, n, s, p, o, r, a, i, h, k, l, aj, u } from "./index.6a36859b.js";
1
+ import { ai, A, an, B, ap, a6, g, C, f, ay, $, v, y, J, aG, Q, aq, ao, a2, V, ab, aw, ae, D, ag, aH, az, Z, I, ar, aA, a1, T, K, X, ac, af, M, ah, N, m, b, q, ak, d, at, t, P, w, am, aE, aD, a0, aI, ax, _, R, G, F, z, aF, E, L, e, au, as, aa, a3, U, a8, S, a5, a7, a9, a4, ad, av, al, aC, x, W, aB, H, O, c, Y, n, s, p, o, r, a, i, h, k, l, aj, u } from "./index.e6025e49.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "js-yaml";
@@ -9279,12 +9279,13 @@ var __publicField = (obj, key, value) => {
9279
9279
  const {
9280
9280
  resource
9281
9281
  } = core.useResource();
9282
+ const [mode, setMode] = React.useState("detail");
9282
9283
  const {
9283
9284
  queryResult
9284
9285
  } = core.useShow({
9285
- id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id
9286
+ id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id,
9287
+ liveMode: mode === "yaml" ? "off" : "auto"
9286
9288
  });
9287
- const [mode, setMode] = React.useState("detail");
9288
9289
  const {
9289
9290
  t
9290
9291
  } = useTranslation();
@@ -9294,6 +9295,11 @@ var __publicField = (obj, key, value) => {
9294
9295
  const {
9295
9296
  data: data2
9296
9297
  } = queryResult;
9298
+ const schema = React.useMemo(() => ({}), []);
9299
+ const defaultEditorValue = React.useMemo(() => (data2 == null ? void 0 : data2.data) ? yaml__default.default.dump(lodashEs.omit(globalStore == null ? void 0 : globalStore.restoreItem(data2.data), "id")) : "", [globalStore, data2]);
9300
+ const onEditorCreate = React.useCallback((editor) => {
9301
+ fold(editor);
9302
+ }, [fold]);
9297
9303
  if (!(data2 == null ? void 0 : data2.data)) {
9298
9304
  return null;
9299
9305
  }
@@ -9423,11 +9429,9 @@ var __publicField = (obj, key, value) => {
9423
9429
  }),
9424
9430
  ["yaml"]: /* @__PURE__ */ jsxRuntime.exports.jsx(MonacoYamlEditor$1, {
9425
9431
  className: EditorStyle$1,
9426
- defaultValue: yaml__default.default.dump(globalStore == null ? void 0 : globalStore.restoreItem(model)),
9427
- schema: {},
9428
- onEditorCreate: (editor) => {
9429
- fold(editor);
9430
- },
9432
+ defaultValue: defaultEditorValue,
9433
+ schema,
9434
+ onEditorCreate,
9431
9435
  readOnly: true
9432
9436
  })
9433
9437
  };
@@ -9604,7 +9608,7 @@ var __publicField = (obj, key, value) => {
9604
9608
  selectedKeys
9605
9609
  }), /* @__PURE__ */ jsxRuntime.exports.jsx(Table$1, {
9606
9610
  ...tableProps,
9607
- className: TableStyle,
9611
+ className: cx_default(tableProps.className, TableStyle),
9608
9612
  scroll: {
9609
9613
  y: "calc(100% - 48px)"
9610
9614
  }
@@ -16630,9 +16634,9 @@ var __publicField = (obj, key, value) => {
16630
16634
  const items = await Promise.all(
16631
16635
  res.items.map(
16632
16636
  (item) => this.processItem({
16633
- ...item,
16634
16637
  kind: kind.replace(/List$/g, ""),
16635
- apiVersion
16638
+ apiVersion,
16639
+ ...lodash.exports.omit(item, ["apiVersion", "kind"])
16636
16640
  })
16637
16641
  )
16638
16642
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.0.14-beta.5",
3
+ "version": "0.0.14-beta.6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -20,7 +20,7 @@
20
20
  "dayjs": "^1.11.10",
21
21
  "i18next": "^23.2.3",
22
22
  "js-yaml": "^4.1.0",
23
- "k8s-api-provider": "0.0.15-beta.4",
23
+ "k8s-api-provider": "0.0.15-beta.6",
24
24
  "ky": "^0.33.3",
25
25
  "lodash-es": "^4.17.21",
26
26
  "mitt": "^3.0.1",