@dovetail-v2/refine 0.2.3-alpha.0 → 0.2.3

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 jsxRuntimeExports } from "./index-49e0db41.js";
1
+ import { j as jsxRuntimeExports } from "./index-3f683ca1.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "dayjs";
@@ -1,4 +1,4 @@
1
- import { j as jsxRuntimeExports, c as cx_default, Y as YamlEditorStyle } from "./index-49e0db41.js";
1
+ import { j as jsxRuntimeExports, c as cx_default, Y as YamlEditorStyle } from "./index-3f683ca1.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { setDiagnosticsOptions } from "monaco-yaml";
4
4
  import { useRef, useEffect } from "react";
@@ -13611,7 +13611,7 @@ const PodLogTab = (i18n2) => ({
13611
13611
  ]
13612
13612
  });
13613
13613
  const NetworkPolicyRulesViewer_r6jity = "";
13614
- const MonacoYamlEditor$1 = lazy(() => import("./MonacoYamlEditor-267b3405.js"));
13614
+ const MonacoYamlEditor$1 = lazy(() => import("./MonacoYamlEditor-bac0d2aa.js"));
13615
13615
  const EditorStyle$1 = "e1cjl2b8";
13616
13616
  const NetworkPolicyRulesViewer = ({
13617
13617
  ingressOrEgress,
@@ -16794,53 +16794,45 @@ function immutableSet(obj, path2, value2) {
16794
16794
  return setWith(clone(obj), path2, value2, clone);
16795
16795
  }
16796
16796
  function usePathMap(options) {
16797
- const { pathMap, transformInitValues, transformApplyValues } = options;
16798
- return {
16799
- /**
16800
- * Transforms initial values by mapping paths from source to target structure
16801
- * @param values Initial values to transform
16802
- * @returns Transformed values with updated paths
16803
- */
16804
- transformInitValues(values) {
16805
- const initValues = values._rawYaml || values;
16806
- let result = initValues;
16807
- for (const { from, to } of pathMap || []) {
16808
- result = immutableSet(initValues, to, get$2(initValues, from));
16809
- const fromPath = [...from];
16810
- const lastKey = fromPath.pop();
16811
- if (lastKey) {
16812
- const obj = get$2(result, fromPath);
16813
- if (obj && typeof obj === "object") {
16814
- delete obj[lastKey];
16815
- }
16816
- }
16817
- }
16818
- return (transformInitValues == null ? void 0 : transformInitValues(result)) || result;
16819
- },
16820
- /**
16821
- * Transforms values back to original structure before applying/saving
16822
- * @param values Values to transform back
16823
- * @returns Transformed values in original structure
16824
- */
16825
- transformApplyValues(values) {
16826
- let result = values;
16827
- for (const { from, to } of pathMap || []) {
16828
- result = immutableSet(
16829
- values,
16830
- from,
16831
- get$2(result, to)
16832
- );
16833
- const toPath = [...to];
16834
- const lastKey = toPath.pop();
16835
- if (lastKey) {
16836
- const obj = get$2(result, toPath);
16837
- if (obj && typeof obj === "object") {
16838
- delete obj[lastKey];
16839
- }
16797
+ const { pathMap, transformInitValues: transformInitValuesFromOptions, transformApplyValues: transformApplyValuesFromOptions } = options;
16798
+ const transformInitValues = useCallback((values) => {
16799
+ const initValues = values._rawYaml || values;
16800
+ let result = initValues;
16801
+ for (const { from, to } of pathMap || []) {
16802
+ result = immutableSet(initValues, to, get$2(initValues, from));
16803
+ const fromPath = [...from];
16804
+ const lastKey = fromPath.pop();
16805
+ if (lastKey) {
16806
+ const obj = get$2(result, fromPath);
16807
+ if (obj && typeof obj === "object") {
16808
+ delete obj[lastKey];
16809
+ }
16810
+ }
16811
+ }
16812
+ return (transformInitValuesFromOptions == null ? void 0 : transformInitValuesFromOptions(result)) || result;
16813
+ }, [transformInitValuesFromOptions, pathMap]);
16814
+ const transformApplyValues = useCallback((values) => {
16815
+ let result = values;
16816
+ for (const { from, to } of pathMap || []) {
16817
+ result = immutableSet(
16818
+ values,
16819
+ from,
16820
+ get$2(result, to)
16821
+ );
16822
+ const toPath = [...to];
16823
+ const lastKey = toPath.pop();
16824
+ if (lastKey) {
16825
+ const obj = get$2(result, toPath);
16826
+ if (obj && typeof obj === "object") {
16827
+ delete obj[lastKey];
16840
16828
  }
16841
16829
  }
16842
- return (transformApplyValues == null ? void 0 : transformApplyValues(result)) || result;
16843
16830
  }
16831
+ return (transformApplyValuesFromOptions == null ? void 0 : transformApplyValuesFromOptions(result)) || result;
16832
+ }, [transformApplyValuesFromOptions, pathMap]);
16833
+ return {
16834
+ transformInitValues,
16835
+ transformApplyValues
16844
16836
  };
16845
16837
  }
16846
16838
  function useFieldsConfig(config, formConfig, resourceId) {
@@ -17704,8 +17696,8 @@ const PlainCodeStyle = "pqch97v";
17704
17696
  const ErrorMsgStyle = "eh2qjnl";
17705
17697
  const ErrorWrapperStyle = "e19q2bnp";
17706
17698
  const YamlEditorStyle = "y16u5v3w";
17707
- const MonacoYamlEditor = React__default.lazy(() => import("./MonacoYamlEditor-267b3405.js"));
17708
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-4d765c36.js"));
17699
+ const MonacoYamlEditor = React__default.lazy(() => import("./MonacoYamlEditor-bac0d2aa.js"));
17700
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-f0e8bc5c.js"));
17709
17701
  const YamlEditorComponent = forwardRef(
17710
17702
  function YamlEditorComponent2(props, ref) {
17711
17703
  const {
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bR, cH, A, a_, b0, aJ, cf, bo, a5, ct, ch, aU, X, C, m, cN, aM, bt, ag, cP, am, at, cY, aB, ci, cg, c$, aQ, bA, z, aH, bH, c_, cI, bK, D, b5, aw, bN, av, ax, a4, ce, cd, cZ, bm, aY, cK, ah, bU, cM, cL, cO, cr, aK, an, w, v, cQ, I, bx, aX, x, T, bi, bk, cj, cS, aP, bw, au, aC, aD, ac, aE, a$, aI, bI, bL, ad, d9, cs, cC, bQ, N, a6, h, aZ, aa, bT, bC, bB, cR, c4, d4, k, d3, aN, bu, cl, Q, be, bf, bs, L, bg, M, bh, G, b9, cF, F, b8, K, bc, H, ba, J, bb, O, c5, bd, cE, ae, d7, d6, P, bq, y, ai, al, c3, bn, cW, cV, b3, by, cb, ca, t, aO, bp, B, bz, b4, d8, E, cv, cJ, bO, bW, bX, db, aL, R, ak, ar, aq, bP, ao, cX, c7, ap, cG, cc, bl, bE, ay, l, V, U, bj, cy, cB, cx, cw, cz, cA, cu, cm, cp, cq, co, cn, ck, cD, bY, aR, bv, aF, p, b$, o, b1, d2, s, c0, b2, q, aW, br, n, d1, aT, aV, c9, bG, bF, c8, aS, S, bJ, d0, d5, b6, b7, bD, bM, c6, c1, c2, af, a3, cU, aj, W, cT, as, aA, az, i, aG, bZ, Z, a7, d, de, dd, dg, da, ab, dh, dc, bV, df, a9, a8, r, a, e, f, $, _, a0, g, a1, u, bS, a2, b_, b } from "./index-49e0db41.js";
1
+ import { bR, cH, A, a_, b0, aJ, cf, bo, a5, ct, ch, aU, X, C, m, cN, aM, bt, ag, cP, am, at, cY, aB, ci, cg, c$, aQ, bA, z, aH, bH, c_, cI, bK, D, b5, aw, bN, av, ax, a4, ce, cd, cZ, bm, aY, cK, ah, bU, cM, cL, cO, cr, aK, an, w, v, cQ, I, bx, aX, x, T, bi, bk, cj, cS, aP, bw, au, aC, aD, ac, aE, a$, aI, bI, bL, ad, d9, cs, cC, bQ, N, a6, h, aZ, aa, bT, bC, bB, cR, c4, d4, k, d3, aN, bu, cl, Q, be, bf, bs, L, bg, M, bh, G, b9, cF, F, b8, K, bc, H, ba, J, bb, O, c5, bd, cE, ae, d7, d6, P, bq, y, ai, al, c3, bn, cW, cV, b3, by, cb, ca, t, aO, bp, B, bz, b4, d8, E, cv, cJ, bO, bW, bX, db, aL, R, ak, ar, aq, bP, ao, cX, c7, ap, cG, cc, bl, bE, ay, l, V, U, bj, cy, cB, cx, cw, cz, cA, cu, cm, cp, cq, co, cn, ck, cD, bY, aR, bv, aF, p, b$, o, b1, d2, s, c0, b2, q, aW, br, n, d1, aT, aV, c9, bG, bF, c8, aS, S, bJ, d0, d5, b6, b7, bD, bM, c6, c1, c2, af, a3, cU, aj, W, cT, as, aA, az, i, aG, bZ, Z, a7, d, de, dd, dg, da, ab, dh, dc, bV, df, a9, a8, r, a, e, f, $, _, a0, g, a1, u, bS, a2, b_, b } from "./index-3f683ca1.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "react";
@@ -16791,53 +16791,45 @@ var __publicField = (obj, key, value) => {
16791
16791
  return lodashEs.setWith(lodashEs.clone(obj), path2, value2, lodashEs.clone);
16792
16792
  }
16793
16793
  function usePathMap(options) {
16794
- const { pathMap, transformInitValues, transformApplyValues } = options;
16795
- return {
16796
- /**
16797
- * Transforms initial values by mapping paths from source to target structure
16798
- * @param values Initial values to transform
16799
- * @returns Transformed values with updated paths
16800
- */
16801
- transformInitValues(values) {
16802
- const initValues = values._rawYaml || values;
16803
- let result = initValues;
16804
- for (const { from, to } of pathMap || []) {
16805
- result = immutableSet(initValues, to, lodashEs.get(initValues, from));
16806
- const fromPath = [...from];
16807
- const lastKey = fromPath.pop();
16808
- if (lastKey) {
16809
- const obj = lodashEs.get(result, fromPath);
16810
- if (obj && typeof obj === "object") {
16811
- delete obj[lastKey];
16812
- }
16813
- }
16814
- }
16815
- return (transformInitValues == null ? void 0 : transformInitValues(result)) || result;
16816
- },
16817
- /**
16818
- * Transforms values back to original structure before applying/saving
16819
- * @param values Values to transform back
16820
- * @returns Transformed values in original structure
16821
- */
16822
- transformApplyValues(values) {
16823
- let result = values;
16824
- for (const { from, to } of pathMap || []) {
16825
- result = immutableSet(
16826
- values,
16827
- from,
16828
- lodashEs.get(result, to)
16829
- );
16830
- const toPath = [...to];
16831
- const lastKey = toPath.pop();
16832
- if (lastKey) {
16833
- const obj = lodashEs.get(result, toPath);
16834
- if (obj && typeof obj === "object") {
16835
- delete obj[lastKey];
16836
- }
16794
+ const { pathMap, transformInitValues: transformInitValuesFromOptions, transformApplyValues: transformApplyValuesFromOptions } = options;
16795
+ const transformInitValues = React.useCallback((values) => {
16796
+ const initValues = values._rawYaml || values;
16797
+ let result = initValues;
16798
+ for (const { from, to } of pathMap || []) {
16799
+ result = immutableSet(initValues, to, lodashEs.get(initValues, from));
16800
+ const fromPath = [...from];
16801
+ const lastKey = fromPath.pop();
16802
+ if (lastKey) {
16803
+ const obj = lodashEs.get(result, fromPath);
16804
+ if (obj && typeof obj === "object") {
16805
+ delete obj[lastKey];
16806
+ }
16807
+ }
16808
+ }
16809
+ return (transformInitValuesFromOptions == null ? void 0 : transformInitValuesFromOptions(result)) || result;
16810
+ }, [transformInitValuesFromOptions, pathMap]);
16811
+ const transformApplyValues = React.useCallback((values) => {
16812
+ let result = values;
16813
+ for (const { from, to } of pathMap || []) {
16814
+ result = immutableSet(
16815
+ values,
16816
+ from,
16817
+ lodashEs.get(result, to)
16818
+ );
16819
+ const toPath = [...to];
16820
+ const lastKey = toPath.pop();
16821
+ if (lastKey) {
16822
+ const obj = lodashEs.get(result, toPath);
16823
+ if (obj && typeof obj === "object") {
16824
+ delete obj[lastKey];
16837
16825
  }
16838
16826
  }
16839
- return (transformApplyValues == null ? void 0 : transformApplyValues(result)) || result;
16840
16827
  }
16828
+ return (transformApplyValuesFromOptions == null ? void 0 : transformApplyValuesFromOptions(result)) || result;
16829
+ }, [transformApplyValuesFromOptions, pathMap]);
16830
+ return {
16831
+ transformInitValues,
16832
+ transformApplyValues
16841
16833
  };
16842
16834
  }
16843
16835
  function useFieldsConfig(config, formConfig, resourceId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.2.3-alpha.0",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -58,6 +58,7 @@
58
58
  "@playwright/test": "^1.39.0",
59
59
  "@refinedev/cli": "^2.9.0",
60
60
  "@rollup/pluginutils": "^4.2.1",
61
+ "@testing-library/react-hooks": "7",
61
62
  "@types/body-parser": "^1.19.5",
62
63
  "@types/jest": "^29",
63
64
  "@types/js-yaml": "^4.0.6",
@@ -76,6 +77,7 @@
76
77
  "eslint-plugin-react-hooks": "^4.6.0",
77
78
  "eslint-plugin-react-refresh": "^0.3.4",
78
79
  "jest": "^29",
80
+ "jest-environment-jsdom": "^30.0.0",
79
81
  "kubernetes-types": "^1.26.0",
80
82
  "sass": "1.51.0",
81
83
  "ts-jest": "^29",