gemi 0.1.1 → 0.2.0

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.
Files changed (85) hide show
  1. package/dist/ApiRouter.d.ts +5 -0
  2. package/dist/ApiRouter.d.ts.map +1 -0
  3. package/dist/Controller.d.ts +3 -0
  4. package/dist/Controller.d.ts.map +1 -0
  5. package/dist/ViewRouter.d.ts +3 -0
  6. package/dist/ViewRouter.d.ts.map +1 -0
  7. package/dist/app/App.d.ts +93 -0
  8. package/dist/app/App.d.ts.map +1 -0
  9. package/dist/app/Plugin.d.ts +10 -0
  10. package/dist/app/Plugin.d.ts.map +1 -0
  11. package/dist/app/index.js +1697 -0
  12. package/dist/bin/gemi +0 -0
  13. package/dist/client/ClientRouter.d.ts +4 -0
  14. package/dist/client/ClientRouter.d.ts.map +1 -0
  15. package/dist/client/ClientRouterContext.d.ts +32 -0
  16. package/dist/client/ClientRouterContext.d.ts.map +1 -0
  17. package/dist/client/Form.d.ts +27 -3
  18. package/dist/client/Form.d.ts.map +1 -1
  19. package/dist/client/Image.d.ts +11 -0
  20. package/dist/client/Image.d.ts.map +1 -0
  21. package/dist/client/Mutation.d.ts +17 -0
  22. package/dist/client/Mutation.d.ts.map +1 -0
  23. package/dist/client/Root.d.ts +2 -0
  24. package/dist/client/Root.d.ts.map +1 -0
  25. package/dist/client/ServerDataProvider.d.ts +33 -0
  26. package/dist/client/ServerDataProvider.d.ts.map +1 -0
  27. package/dist/client/index.d.ts +7 -1
  28. package/dist/client/index.d.ts.map +1 -1
  29. package/dist/client/index.js +1641 -0
  30. package/dist/client/main.d.ts +2 -0
  31. package/dist/client/main.d.ts.map +1 -0
  32. package/dist/client/types.d.ts +4 -0
  33. package/dist/client/types.d.ts.map +1 -0
  34. package/dist/client/useMutation.d.ts +8 -0
  35. package/dist/client/useMutation.d.ts.map +1 -0
  36. package/dist/client/useQuery.d.ts +6 -0
  37. package/dist/client/useQuery.d.ts.map +1 -0
  38. package/dist/client/useUser.d.ts +2 -0
  39. package/dist/client/useUser.d.ts.map +1 -0
  40. package/dist/email/index.js +9098 -0
  41. package/dist/facades/index.js +71 -0
  42. package/dist/http/ApiRouter.d.ts +50 -0
  43. package/dist/http/ApiRouter.d.ts.map +1 -1
  44. package/dist/http/Controller.d.ts +2 -0
  45. package/dist/http/Controller.d.ts.map +1 -1
  46. package/dist/http/Error.d.ts +7 -0
  47. package/dist/http/Error.d.ts.map +1 -0
  48. package/dist/http/HttpRequest.d.ts +21 -0
  49. package/dist/http/HttpRequest.d.ts.map +1 -0
  50. package/dist/http/Middleware.d.ts +4 -0
  51. package/dist/http/Middleware.d.ts.map +1 -0
  52. package/dist/http/Router.d.ts +31 -0
  53. package/dist/http/Router.d.ts.map +1 -0
  54. package/dist/http/ViewRouter.d.ts +30 -0
  55. package/dist/http/ViewRouter.d.ts.map +1 -1
  56. package/dist/http/getCookies.d.ts +2 -0
  57. package/dist/http/getCookies.d.ts.map +1 -0
  58. package/dist/http/index.d.ts +4 -0
  59. package/dist/http/index.d.ts.map +1 -1
  60. package/dist/http/index.js +341 -0
  61. package/dist/http/requestContext.d.ts +4 -0
  62. package/dist/http/requestContext.d.ts.map +1 -0
  63. package/dist/index.d.ts +4 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/server/generateEtag.d.ts +2 -0
  66. package/dist/server/generateEtag.d.ts.map +1 -0
  67. package/dist/types.d.ts +4 -0
  68. package/dist/types.d.ts.map +1 -0
  69. package/dist/utils/Subject.d.ts +9 -0
  70. package/dist/utils/Subject.d.ts.map +1 -0
  71. package/dist/utils/type.d.ts +2 -0
  72. package/dist/utils/type.d.ts.map +1 -0
  73. package/package.json +21 -8
  74. package/dist/client/index.mjs +0 -3174
  75. package/dist/client/useRouter.d.ts +0 -2
  76. package/dist/client/useRouter.d.ts.map +0 -1
  77. package/dist/fsevents-X6WP4TKM.node +0 -0
  78. package/dist/http/index.mjs +0 -16
  79. package/dist/server/Server.d.ts +0 -10
  80. package/dist/server/Server.d.ts.map +0 -1
  81. package/dist/server/dev.d.ts +0 -3
  82. package/dist/server/dev.d.ts.map +0 -1
  83. package/dist/server/index.d.ts +0 -2
  84. package/dist/server/index.d.ts.map +0 -1
  85. package/dist/server/index.mjs +0 -16315
package/dist/bin/gemi ADDED
Binary file
@@ -0,0 +1,4 @@
1
+ export declare const ClientRouter: (props: {
2
+ components: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=ClientRouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientRouter.d.ts","sourceRoot":"","sources":["../../client/ClientRouter.tsx"],"names":[],"mappings":"AA4FA,eAAO,MAAM,YAAY,UAAW;IAAE,UAAU,EAAE,GAAG,CAAA;CAAE,4CAoCtD,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type History, type To, type Location } from "history";
2
+ import { type ComponentProps, type PropsWithChildren } from "react";
3
+ import { Subject } from "../utils/Subject";
4
+ interface ClientRouterContextValue {
5
+ viewEntriesSubject: Subject<string[]>;
6
+ history: History | null;
7
+ updatePageData: (pageData: Record<string, any>) => void;
8
+ getPageData: (key: string) => any;
9
+ locationSubject: Subject<Location>;
10
+ getScrollPosition: (path: string) => number;
11
+ params: Record<string, string>;
12
+ }
13
+ export declare const ClientRouterContext: import("react").Context<ClientRouterContextValue>;
14
+ interface ClientRouterProviderProps {
15
+ pathname: string;
16
+ routeManifest: Record<string, string[]>;
17
+ pageData: Record<string, any>;
18
+ currentPath: string;
19
+ params: Record<string, string>;
20
+ is404: boolean;
21
+ }
22
+ export declare const ClientRouterProvider: (props: PropsWithChildren<ClientRouterProviderProps>) => import("react/jsx-runtime").JSX.Element;
23
+ export declare function useLocation(): Location;
24
+ export declare function useParams(): Record<string, string>;
25
+ export declare function useRouter(): {
26
+ push: (to: To, state?: any) => Promise<void>;
27
+ };
28
+ export declare const Link: (props: Omit<ComponentProps<"a">, "href"> & {
29
+ href: To;
30
+ }) => import("react/jsx-runtime").JSX.Element;
31
+ export {};
32
+ //# sourceMappingURL=ClientRouterContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientRouterContext.d.ts","sourceRoot":"","sources":["../../client/ClientRouterContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,EAAE,EACP,KAAK,QAAQ,EAEd,MAAM,SAAS,CAAC;AACjB,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,UAAU,wBAAwB;IAChC,kBAAkB,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACxD,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,mBAAmB,mDAE/B,CAAC;AAEF,UAAU,yBAAyB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,oBAAoB,UACxB,kBAAkB,yBAAyB,CAAC,4CA0GpD,CAAC;AAUF,wBAAgB,WAAW,aAS1B;AAED,wBAAgB,SAAS,2BAGxB;AAED,wBAAgB,SAAS;eAGJ,EAAE,UAAU,GAAG;EAsBnC;AAED,eAAO,MAAM,IAAI,UACR,KAAK,eAAe,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,EAAE,CAAA;CAAE,4CA0BxD,CAAC"}
@@ -1,5 +1,29 @@
1
- import { ReactNode } from "react";
2
- export declare const Form: ({ children }: {
3
- children: ReactNode;
1
+ import { type ComponentProps } from "react";
2
+ import * as z from "zod";
3
+ interface FormProps<T = {}> extends Omit<ComponentProps<"form">, "onSubmit"> {
4
+ onSubmit: (e: any, formState: any) => void;
5
+ schema?: z.ZodType<T>;
6
+ }
7
+ export declare function Form<T>(props: FormProps<T>): import("react/jsx-runtime").JSX.Element;
8
+ export declare function useInputState(props: ComponentProps<typeof Input>): {
9
+ isDirty: boolean;
10
+ value: any;
11
+ error: any;
12
+ isFocused: boolean;
13
+ isTouched: boolean;
14
+ isInvalid: boolean;
15
+ };
16
+ export declare const Input: (props: ComponentProps<"input"> & {
17
+ name: string;
18
+ validate?: (value: any) => string | null;
4
19
  }) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const Checkbox: (props: ComponentProps<"input"> & {
21
+ name: string;
22
+ validate?: (value: any) => string | null;
23
+ }) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const ErrorMessage: (props: ComponentProps<"span"> & {
25
+ name: string;
26
+ render?: (error: string) => React.ReactNode;
27
+ }) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
28
+ export {};
5
29
  //# sourceMappingURL=Form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../client/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,eAAO,MAAM,IAAI,iBAAkB;IAAE,QAAQ,EAAE,SAAS,CAAA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{
3
+ src: string;
4
+ width: number;
5
+ container?: number[];
6
+ screen?: number[];
7
+ quality?: number;
8
+ }
9
+ export declare const Image: (props: ComponentProps<"img"> & ImageProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=Image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../client/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAyC5C,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,KAAK,UAAW,eAAe,KAAK,CAAC,GAAG,UAAU,4CAwB9D,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type PropsWithChildren, type ComponentProps } from "react";
2
+ interface MutationProps {
3
+ url: string;
4
+ onSuccess?: (result: any) => void;
5
+ }
6
+ export declare const Mutation: (props: PropsWithChildren<MutationProps>) => import("react/jsx-runtime").JSX.Element;
7
+ export declare function useMutationStatus(): {
8
+ isPending: boolean;
9
+ };
10
+ export declare const ValidationErrors: (props: {
11
+ name: string;
12
+ className?: string;
13
+ render?: (props: ComponentProps<"div">) => JSX.Element;
14
+ }) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const FormError: (props: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=Mutation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Mutation.d.ts","sourceRoot":"","sources":["../../client/Mutation.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAItB,KAAK,cAAc,EAGpB,MAAM,OAAO,CAAC;AAcf,UAAU,aAAa;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,eAAO,MAAM,QAAQ,UAAW,kBAAkB,aAAa,CAAC,4CAqD/D,CAAC;AAEF,wBAAgB,iBAAiB;;EAIhC;AAED,eAAO,MAAM,gBAAgB,UAAW;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,CAAC,KAAK,WAAW,CAAC;CACxD,4CAwBA,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,eAAe,KAAK,CAAC,4CAQrD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const Root: (props: any) => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=Root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../client/Root.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,UAAW,GAAG,4CAyB9B,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type PropsWithChildren } from "react";
2
+ import type { ComponentTree } from "./types";
3
+ type Data = Record<string, any>;
4
+ interface ServerDataContextValue {
5
+ routeManifest: Record<string, string[]>;
6
+ pageData: Record<string, Record<string, Data>>;
7
+ router: {
8
+ pathname: string;
9
+ params: Record<string, any>;
10
+ currentPath: string;
11
+ is404: boolean;
12
+ };
13
+ componentTree: ComponentTree;
14
+ auth: {
15
+ user: {
16
+ name: string;
17
+ email: string;
18
+ accounts: Array<{
19
+ organizationId: string;
20
+ role: string;
21
+ }>;
22
+ globalRole: string;
23
+ id: string;
24
+ };
25
+ };
26
+ }
27
+ export declare const ServerDataContext: import("react").Context<ServerDataContextValue>;
28
+ interface ServerDataProviderProps {
29
+ value?: ServerDataContextValue;
30
+ }
31
+ export declare const ServerDataProvider: (props: PropsWithChildren<ServerDataProviderProps>) => import("react/jsx-runtime").JSX.Element;
32
+ export {};
33
+ //# sourceMappingURL=ServerDataProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerDataProvider.d.ts","sourceRoot":"","sources":["../../client/ServerDataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEhC,UAAU,sBAAsB;IAC9B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC5B,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;YACd,QAAQ,EAAE,KAAK,CAAC;gBACd,cAAc,EAAE,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM,CAAC;aACd,CAAC,CAAC;YACH,UAAU,EAAE,MAAM,CAAC;YACnB,EAAE,EAAE,MAAM,CAAC;SACZ,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,iDAA8C,CAAC;AAE7E,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,sBAAsB,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,UACtB,kBAAkB,uBAAuB,CAAC,4CAelD,CAAC"}
@@ -1,3 +1,9 @@
1
- export { useRouter } from "./useRouter";
1
+ export { Main } from "./main";
2
+ export { Root } from "./Root";
3
+ export { useUser } from "./useUser";
4
+ export { useQuery } from "./useQuery";
5
+ export { useMutation } from "./useMutation";
2
6
  export { Form } from "./Form";
7
+ export { Mutation, FormError, useMutationStatus, ValidationErrors, } from "./Mutation";
8
+ export { Link, useLocation, useParams, useRouter } from "./ClientRouterContext";
3
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EACL,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC"}