gomtm 0.0.354 → 0.0.356
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/esm/curd/edit/CurdEditPanel.js +1 -1
- package/dist/esm/curd/edit/formStore.d.ts +17 -0
- package/dist/esm/curd/edit/formStore.js +92 -0
- package/dist/esm/curd/listview/CommonListView.js +1 -1
- package/dist/esm/validations/_common.d.ts +4 -4
- package/dist/esm/validations/blog.d.ts +2 -2
- package/dist/esm/validations/crawlerSchema.d.ts +5 -5
- package/dist/esm/validations/spContentModi.d.ts +8 -8
- package/dist/esm/validations/spRoute.d.ts +8 -8
- package/dist/esm/validations/user.d.ts +6 -6
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -6,7 +6,7 @@ import { useMemo } from "react";
|
|
|
6
6
|
import { useGomtmSuspenseQuery } from "../../gomtmQuery";
|
|
7
7
|
import { RenderViewByName } from "../DynViews";
|
|
8
8
|
import { useListview } from "../listview/list-store";
|
|
9
|
-
import { useGomtmForm } from "./
|
|
9
|
+
import { useGomtmForm } from "./formStore";
|
|
10
10
|
function CurdEditPanel(props) {
|
|
11
11
|
const open = useGomtmForm((x) => x.open);
|
|
12
12
|
const setOpen = useGomtmForm((x) => x.setOpen);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
interface GomtmFormProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
fullScreen?: boolean;
|
|
5
|
+
viewName: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GomtmFormState extends GomtmFormProps {
|
|
9
|
+
setOpen: (open: boolean) => void;
|
|
10
|
+
setFullScreen: (open: boolean) => void;
|
|
11
|
+
setTitle: (title: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const gomtmFormContext: import("react").Context<import("zustand").StoreApi<GomtmFormState> | null>;
|
|
14
|
+
export declare const GomtmFormProvider: (props: PropsWithChildren<GomtmFormProps>) => import("react").JSX.Element;
|
|
15
|
+
export declare function useGomtmForm<T>(selector: (state: GomtmFormState) => T): T;
|
|
16
|
+
export declare function GomtmFormDebug(): import("react").JSX.Element | null;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
34
|
+
import { createContext, useContext, useMemo, useRef } from "react";
|
|
35
|
+
import { useStore } from "zustand";
|
|
36
|
+
import { createStore } from "zustand/vanilla";
|
|
37
|
+
import { useGomtm } from "../../store/mtapp-store";
|
|
38
|
+
const createGomtmFormStore = (initProps) => {
|
|
39
|
+
const DEFAULT_PROPS = {
|
|
40
|
+
open: false,
|
|
41
|
+
viewName: ""
|
|
42
|
+
};
|
|
43
|
+
return createStore()((set, get) => __spreadProps(__spreadValues(__spreadValues({}, DEFAULT_PROPS), initProps), {
|
|
44
|
+
setOpen: (open) => set({ open }),
|
|
45
|
+
setFullScreen: (fullScreen) => set({ fullScreen }),
|
|
46
|
+
setTitle: (title) => set({ title })
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
const gomtmFormContext = createContext(null);
|
|
50
|
+
const GomtmFormProvider = (props) => {
|
|
51
|
+
const _a = props, { children } = _a, etc = __objRest(_a, ["children"]);
|
|
52
|
+
const storeRef = useRef();
|
|
53
|
+
if (!storeRef.current) {
|
|
54
|
+
storeRef.current = createGomtmFormStore(props);
|
|
55
|
+
}
|
|
56
|
+
useMemo(() => {
|
|
57
|
+
var _a2;
|
|
58
|
+
(_a2 = storeRef.current) == null ? void 0 : _a2.setState({ open: props.open });
|
|
59
|
+
}, [props.open]);
|
|
60
|
+
useMemo(() => {
|
|
61
|
+
var _a2;
|
|
62
|
+
(_a2 = storeRef.current) == null ? void 0 : _a2.setState({ viewName: props.viewName });
|
|
63
|
+
}, [props.viewName]);
|
|
64
|
+
return /* @__PURE__ */ jsxs(gomtmFormContext.Provider, { value: storeRef.current, children: [
|
|
65
|
+
children,
|
|
66
|
+
/* @__PURE__ */ jsx(GomtmFormDebug, {})
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
function useGomtmForm(selector) {
|
|
70
|
+
const store = useContext(gomtmFormContext);
|
|
71
|
+
if (!store)
|
|
72
|
+
throw new Error("useGomtmForm Missing GomtmFormProvider in the tree");
|
|
73
|
+
return useStore(store, selector);
|
|
74
|
+
}
|
|
75
|
+
function GomtmFormDebug() {
|
|
76
|
+
const open = useGomtmForm((x) => x.open);
|
|
77
|
+
const viewName = useGomtmForm((x) => x.viewName);
|
|
78
|
+
const debug = useGomtm((x) => x.debug);
|
|
79
|
+
if (!debug) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-blue-100 p-2", children: [
|
|
83
|
+
/* @__PURE__ */ jsx("h1", { children: "GomtmFormDebug" }),
|
|
84
|
+
/* @__PURE__ */ jsx("pre", { children: JSON.stringify({ open, viewName }, null, 2) })
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
GomtmFormDebug,
|
|
89
|
+
GomtmFormProvider,
|
|
90
|
+
gomtmFormContext,
|
|
91
|
+
useGomtmForm
|
|
92
|
+
};
|
|
@@ -10,10 +10,10 @@ import { Suspense, lazy, useCallback, useMemo, useState } from "react";
|
|
|
10
10
|
import { MtmErrorView } from "../../components/MtmErrorView";
|
|
11
11
|
import { useGomtmSuspenseInfiniteQuery } from "../../gomtmQuery";
|
|
12
12
|
import CurdEditPanel from "../edit/CurdEditPanel";
|
|
13
|
-
import { GomtmFormProvider } from "../edit/form-context";
|
|
14
13
|
import { CommontListResView } from "../list-item/ListViewLayoutRender";
|
|
15
14
|
import { PanelRemove } from "../remove/RemovePanel";
|
|
16
15
|
import { useListview } from "./list-store";
|
|
16
|
+
import { GomtmFormProvider } from "../edit/formStore";
|
|
17
17
|
const ALL_Layouts = [
|
|
18
18
|
"default",
|
|
19
19
|
"demo"
|
|
@@ -10,12 +10,12 @@ export declare const commonListInputSchema: z.ZodObject<{
|
|
|
10
10
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
11
11
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
cursor?: string | null | undefined;
|
|
14
13
|
limit?: number | undefined;
|
|
14
|
+
cursor?: string | null | undefined;
|
|
15
15
|
keyword?: string | undefined;
|
|
16
16
|
}, {
|
|
17
|
-
cursor?: string | null | undefined;
|
|
18
17
|
limit?: number | undefined;
|
|
18
|
+
cursor?: string | null | undefined;
|
|
19
19
|
keyword?: string | undefined;
|
|
20
20
|
}>;
|
|
21
21
|
export declare const getByIdInputSchema: z.ZodObject<{
|
|
@@ -49,9 +49,9 @@ export declare const PaginateQuery: z.ZodObject<{
|
|
|
49
49
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
50
50
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
51
|
}, "strip", z.ZodTypeAny, {
|
|
52
|
-
cursor?: string | null | undefined;
|
|
53
52
|
limit?: number | undefined;
|
|
54
|
-
}, {
|
|
55
53
|
cursor?: string | null | undefined;
|
|
54
|
+
}, {
|
|
56
55
|
limit?: number | undefined;
|
|
56
|
+
cursor?: string | null | undefined;
|
|
57
57
|
}>;
|
|
@@ -5,13 +5,13 @@ export declare const blogListQueryInputSchema: z.ZodObject<{
|
|
|
5
5
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
6
6
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
cursor?: string | null | undefined;
|
|
9
8
|
limit?: number | undefined;
|
|
9
|
+
cursor?: string | null | undefined;
|
|
10
10
|
slug?: string | undefined;
|
|
11
11
|
keyword?: string | undefined;
|
|
12
12
|
}, {
|
|
13
|
-
cursor?: string | null | undefined;
|
|
14
13
|
limit?: number | undefined;
|
|
14
|
+
cursor?: string | null | undefined;
|
|
15
15
|
slug?: string | undefined;
|
|
16
16
|
keyword?: string | undefined;
|
|
17
17
|
}>;
|
|
@@ -6,12 +6,12 @@ export declare const crawlerListQueryInputSchema: z.ZodObject<{
|
|
|
6
6
|
cursor: z.ZodOptional<z.ZodString>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
limit: number;
|
|
9
|
-
cursor?: string | undefined;
|
|
10
|
-
q?: string | undefined;
|
|
11
9
|
name?: string | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
cursor?: string | undefined;
|
|
14
|
-
limit?: number | undefined;
|
|
15
10
|
q?: string | undefined;
|
|
11
|
+
cursor?: string | undefined;
|
|
12
|
+
}, {
|
|
16
13
|
name?: string | undefined;
|
|
14
|
+
q?: string | undefined;
|
|
15
|
+
limit?: number | undefined;
|
|
16
|
+
cursor?: string | undefined;
|
|
17
17
|
}>;
|
|
@@ -21,17 +21,17 @@ export declare const spContentModiCreateInput: z.ZodObject<{
|
|
|
21
21
|
action: z.ZodString;
|
|
22
22
|
value: z.ZodString;
|
|
23
23
|
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
value: string;
|
|
25
24
|
action: string;
|
|
26
|
-
|
|
25
|
+
value: string;
|
|
27
26
|
spRouteId: string;
|
|
27
|
+
sel: string;
|
|
28
28
|
matchContentType: string;
|
|
29
29
|
title?: string | undefined;
|
|
30
30
|
}, {
|
|
31
|
-
value: string;
|
|
32
31
|
action: string;
|
|
33
|
-
|
|
32
|
+
value: string;
|
|
34
33
|
spRouteId: string;
|
|
34
|
+
sel: string;
|
|
35
35
|
matchContentType: string;
|
|
36
36
|
title?: string | undefined;
|
|
37
37
|
}>;
|
|
@@ -44,19 +44,19 @@ export declare const spContentModiSaveInput: z.ZodObject<{
|
|
|
44
44
|
action: z.ZodString;
|
|
45
45
|
value: z.ZodString;
|
|
46
46
|
}, "strip", z.ZodTypeAny, {
|
|
47
|
-
value: string;
|
|
48
47
|
id: string;
|
|
49
48
|
action: string;
|
|
50
|
-
|
|
49
|
+
value: string;
|
|
51
50
|
spRouteId: string;
|
|
51
|
+
sel: string;
|
|
52
52
|
matchContentType: string;
|
|
53
53
|
title?: string | undefined;
|
|
54
54
|
}, {
|
|
55
|
-
value: string;
|
|
56
55
|
id: string;
|
|
57
56
|
action: string;
|
|
58
|
-
|
|
57
|
+
value: string;
|
|
59
58
|
spRouteId: string;
|
|
59
|
+
sel: string;
|
|
60
60
|
matchContentType: string;
|
|
61
61
|
title?: string | undefined;
|
|
62
62
|
}>;
|
|
@@ -20,17 +20,17 @@ export declare const spRouteCreateInput: z.ZodObject<{
|
|
|
20
20
|
pathPattern: z.ZodString;
|
|
21
21
|
value: z.ZodString;
|
|
22
22
|
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
value: string;
|
|
24
23
|
title: string;
|
|
25
|
-
|
|
24
|
+
value: string;
|
|
26
25
|
hostPattern: string;
|
|
27
26
|
pathPattern: string;
|
|
27
|
+
spProjectId: string;
|
|
28
28
|
}, {
|
|
29
|
-
value: string;
|
|
30
29
|
title: string;
|
|
31
|
-
|
|
30
|
+
value: string;
|
|
32
31
|
hostPattern: string;
|
|
33
32
|
pathPattern: string;
|
|
33
|
+
spProjectId: string;
|
|
34
34
|
}>;
|
|
35
35
|
export type SpRouteSaveInput = z.infer<typeof SpRouteSaveInput>;
|
|
36
36
|
export declare const SpRouteSaveInput: z.ZodObject<{
|
|
@@ -41,17 +41,17 @@ export declare const SpRouteSaveInput: z.ZodObject<{
|
|
|
41
41
|
pathPattern: z.ZodString;
|
|
42
42
|
value: z.ZodString;
|
|
43
43
|
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
value: string;
|
|
45
44
|
id: string;
|
|
46
45
|
title: string;
|
|
47
|
-
|
|
46
|
+
value: string;
|
|
48
47
|
hostPattern: string;
|
|
49
48
|
pathPattern: string;
|
|
49
|
+
spProjectId: string;
|
|
50
50
|
}, {
|
|
51
|
-
value: string;
|
|
52
51
|
id: string;
|
|
53
52
|
title: string;
|
|
54
|
-
|
|
53
|
+
value: string;
|
|
55
54
|
hostPattern: string;
|
|
56
55
|
pathPattern: string;
|
|
56
|
+
spProjectId: string;
|
|
57
57
|
}>;
|
|
@@ -27,11 +27,11 @@ export declare const createUserSchema: z.ZodObject<{
|
|
|
27
27
|
name: z.ZodString;
|
|
28
28
|
email: z.ZodString;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
email: string;
|
|
31
30
|
name: string;
|
|
32
|
-
}, {
|
|
33
31
|
email: string;
|
|
32
|
+
}, {
|
|
34
33
|
name: string;
|
|
34
|
+
email: string;
|
|
35
35
|
}>;
|
|
36
36
|
export type ICreateUser = z.infer<typeof createUserSchema>;
|
|
37
37
|
export declare const Oauth2LoginResponseSchema: z.ZodObject<{
|
|
@@ -42,23 +42,23 @@ export declare const Oauth2LoginResponseSchema: z.ZodObject<{
|
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
43
|
accessToken: string;
|
|
44
44
|
id: string;
|
|
45
|
-
userName: string;
|
|
46
45
|
roles: string[];
|
|
46
|
+
userName: string;
|
|
47
47
|
}, {
|
|
48
48
|
accessToken: string;
|
|
49
49
|
id: string;
|
|
50
|
-
userName: string;
|
|
51
50
|
roles: string[];
|
|
51
|
+
userName: string;
|
|
52
52
|
}>;
|
|
53
53
|
export type Oauth2LoginResponse = z.infer<typeof Oauth2LoginResponseSchema>;
|
|
54
54
|
export declare const MeResponseSchema: z.ZodObject<{
|
|
55
55
|
userName: z.ZodString;
|
|
56
56
|
roles: z.ZodArray<z.ZodString, "many">;
|
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
userName: string;
|
|
59
58
|
roles: string[];
|
|
60
|
-
}, {
|
|
61
59
|
userName: string;
|
|
60
|
+
}, {
|
|
62
61
|
roles: string[];
|
|
62
|
+
userName: string;
|
|
63
63
|
}>;
|
|
64
64
|
export type MeResponse = z.infer<typeof MeResponseSchema>;
|