@dovetail-v2/refine 0.0.5 → 0.0.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.0d0d58f9.js";
1
+ import { j as jsxRuntime } from "./index.294b375a.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "@refinedev/core";
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
7
7
  import React, { useCallback, useContext, createContext, useState, useRef, useEffect, useMemo, useLayoutEffect, forwardRef, useImperativeHandle, Suspense } from "react";
8
8
  import { ResourceContext, matchResourceFromRoute, useResource, useForm as useForm$1, pickNotDeprecated, useWarnAboutChange, useDelete, useNavigation, useParsed, useGo, useList, useTable, useBreadcrumb, useUpdate, useDeleteMany, useShow, useMenu, Refine } from "@refinedev/core";
9
9
  import { parse, stringify } from "qs";
10
- import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router, Switch } from "react-router-dom";
10
+ import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Switch, Router } from "react-router-dom";
11
11
  import { useUIKit, Icon, Typo, kitContext } from "@cloudtower/eagle";
12
12
  import yaml from "js-yaml";
13
13
  import { isObject, merge, get, cloneDeep, set } from "lodash-es";
@@ -9551,7 +9551,7 @@ const Separator = () => {
9551
9551
  });
9552
9552
  };
9553
9553
  const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
9554
- const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.9693667c.js"));
9554
+ const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.8bad293e.js"));
9555
9555
  const YamlEditorComponent = forwardRef(
9556
9556
  function YamlEditorComponent2(props, ref) {
9557
9557
  const {
@@ -11614,7 +11614,7 @@ const globalStore = new GlobalStore({
11614
11614
  prefix: "default"
11615
11615
  });
11616
11616
  const Dovetail = (props) => {
11617
- const { resourcesConfig, urlPrefix, useHashUrl } = props;
11617
+ const { resourcesConfig, urlPrefix, useHashUrl, Layout: Layout2 } = props;
11618
11618
  const history = useMemo(() => {
11619
11619
  if (useHashUrl) {
11620
11620
  return createHashHistory();
@@ -11624,6 +11624,16 @@ const Dovetail = (props) => {
11624
11624
  const notCustomResources = useMemo(() => {
11625
11625
  return resourcesConfig.filter((c) => !c.isCustom);
11626
11626
  }, [resourcesConfig]);
11627
+ const content = useMemo(() => {
11628
+ const _content = /* @__PURE__ */ jsxRuntime.exports.jsxs(Switch, { children: [
11629
+ props.children,
11630
+ /* @__PURE__ */ jsxRuntime.exports.jsx(ResourceCRUD, { configs: notCustomResources, urlPrefix })
11631
+ ] });
11632
+ if (Layout2) {
11633
+ return /* @__PURE__ */ jsxRuntime.exports.jsx(Layout2, { children: _content });
11634
+ }
11635
+ return _content;
11636
+ }, [Layout2, notCustomResources, props.children, urlPrefix]);
11627
11637
  return /* @__PURE__ */ jsxRuntime.exports.jsx(Router, { history, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
11628
11638
  Refine,
11629
11639
  {
@@ -11651,10 +11661,7 @@ const Dovetail = (props) => {
11651
11661
  edit: `${urlPrefix}/${c.name}/edit`
11652
11662
  };
11653
11663
  }),
11654
- children: /* @__PURE__ */ jsxRuntime.exports.jsx(Layout, { children: /* @__PURE__ */ jsxRuntime.exports.jsxs(Switch, { children: [
11655
- props.children,
11656
- /* @__PURE__ */ jsxRuntime.exports.jsx(ResourceCRUD, { configs: notCustomResources, urlPrefix })
11657
- ] }) })
11664
+ children: content
11658
11665
  }
11659
11666
  ) });
11660
11667
  };
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { V, $, B, a1, C, x, i, l, o, s, a2, a0, z, D, G, a7, O, T, v, I, a3, J, t, K, L, Q, M, U, N, h, Z, a5, P, k, y, a8, w, R, p, a4, A, S, F, E, H, a6, _, W, m, q, Y, e, n, g, f, r, a, c, b, d, X, u } from "./index.0d0d58f9.js";
1
+ import { V, $, B, a1, C, x, i, l, o, s, a2, a0, z, D, G, a7, O, T, v, I, a3, J, t, K, L, Q, M, U, N, h, Z, a5, P, k, y, a8, w, R, p, a4, A, S, F, E, H, a6, _, W, m, q, Y, e, n, g, f, r, a, c, b, d, X, u } from "./index.294b375a.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "js-yaml";
@@ -11628,7 +11628,7 @@ var __publicField = (obj, key, value) => {
11628
11628
  prefix: "default"
11629
11629
  });
11630
11630
  const Dovetail = (props) => {
11631
- const { resourcesConfig, urlPrefix, useHashUrl } = props;
11631
+ const { resourcesConfig, urlPrefix, useHashUrl, Layout: Layout2 } = props;
11632
11632
  const history = React.useMemo(() => {
11633
11633
  if (useHashUrl) {
11634
11634
  return createHashHistory();
@@ -11638,6 +11638,16 @@ var __publicField = (obj, key, value) => {
11638
11638
  const notCustomResources = React.useMemo(() => {
11639
11639
  return resourcesConfig.filter((c) => !c.isCustom);
11640
11640
  }, [resourcesConfig]);
11641
+ const content = React.useMemo(() => {
11642
+ const _content = /* @__PURE__ */ jsxRuntime.exports.jsxs(reactRouterDom.Switch, { children: [
11643
+ props.children,
11644
+ /* @__PURE__ */ jsxRuntime.exports.jsx(ResourceCRUD, { configs: notCustomResources, urlPrefix })
11645
+ ] });
11646
+ if (Layout2) {
11647
+ return /* @__PURE__ */ jsxRuntime.exports.jsx(Layout2, { children: _content });
11648
+ }
11649
+ return _content;
11650
+ }, [Layout2, notCustomResources, props.children, urlPrefix]);
11641
11651
  return /* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Router, { history, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
11642
11652
  core.Refine,
11643
11653
  {
@@ -11665,10 +11675,7 @@ var __publicField = (obj, key, value) => {
11665
11675
  edit: `${urlPrefix}/${c.name}/edit`
11666
11676
  };
11667
11677
  }),
11668
- children: /* @__PURE__ */ jsxRuntime.exports.jsx(Layout, { children: /* @__PURE__ */ jsxRuntime.exports.jsxs(reactRouterDom.Switch, { children: [
11669
- props.children,
11670
- /* @__PURE__ */ jsxRuntime.exports.jsx(ResourceCRUD, { configs: notCustomResources, urlPrefix })
11671
- ] }) })
11678
+ children: content
11672
11679
  }
11673
11680
  ) });
11674
11681
  };
@@ -10,6 +10,7 @@ type Props = {
10
10
  useHashUrl?: boolean;
11
11
  urlPrefix: string;
12
12
  refineResources?: ResourceProps[];
13
+ Layout?: React.FC<unknown>;
13
14
  };
14
15
  export declare const Dovetail: React.FC<Props>;
15
16
  export {};
@@ -2,7 +2,7 @@ import { i18n } from 'i18next';
2
2
  import { Column } from '../../components/Table';
3
3
  import { JobModel, PodModel, ResourceModel } from '../../model';
4
4
  import { WorkloadModel } from '../../model/workload-model';
5
- export declare const CommonSorter: (dataIndex: string[]) => (a: unknown, b: unknown) => 1 | -1 | 0;
5
+ export declare const CommonSorter: (dataIndex: string[]) => (a: unknown, b: unknown) => 0 | 1 | -1;
6
6
  export declare const NameColumnRenderer: <Model extends ResourceModel>(i18n: i18n, resource?: string) => Column<Model>;
7
7
  export declare const NameSpaceColumnRenderer: <Model extends ResourceModel>(i18n: i18n) => Column<Model>;
8
8
  export declare const PhaseColumnRenderer: <Model extends ResourceModel>(i18n: i18n) => Column<Model>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",