gemi 0.1.2 → 0.2.1

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 (83) hide show
  1. package/dist/app/App.d.ts +107 -0
  2. package/dist/app/App.d.ts.map +1 -0
  3. package/dist/app/Plugin.d.ts +10 -0
  4. package/dist/app/Plugin.d.ts.map +1 -0
  5. package/dist/app/flattenViewRoutes.d.ts +12 -0
  6. package/dist/app/flattenViewRoutes.d.ts.map +1 -0
  7. package/dist/app/index.js +1806 -0
  8. package/{bin → dist/bin}/gemi +0 -0
  9. package/dist/client/ClientRouter.d.ts +4 -0
  10. package/dist/client/ClientRouter.d.ts.map +1 -0
  11. package/dist/client/ClientRouterContext.d.ts +32 -0
  12. package/dist/client/ClientRouterContext.d.ts.map +1 -0
  13. package/dist/client/Form.d.ts +27 -3
  14. package/dist/client/Form.d.ts.map +1 -1
  15. package/dist/client/Image.d.ts +11 -0
  16. package/dist/client/Image.d.ts.map +1 -0
  17. package/dist/client/Mutation.d.ts +17 -0
  18. package/dist/client/Mutation.d.ts.map +1 -0
  19. package/dist/client/ServerDataProvider.d.ts +33 -0
  20. package/dist/client/ServerDataProvider.d.ts.map +1 -0
  21. package/dist/client/createRoot.d.ts +3 -0
  22. package/dist/client/createRoot.d.ts.map +1 -0
  23. package/dist/client/helpers/flattenComponentTree.d.ts +3 -0
  24. package/dist/client/helpers/flattenComponentTree.d.ts.map +1 -0
  25. package/dist/client/index-DiGoPyjN.mjs +717 -0
  26. package/dist/client/index.d.ts +7 -1
  27. package/dist/client/index.d.ts.map +1 -1
  28. package/dist/client/index.js +29477 -30
  29. package/dist/client/init.d.ts +3 -0
  30. package/dist/client/init.d.ts.map +1 -0
  31. package/dist/client/types.d.ts +4 -0
  32. package/dist/client/types.d.ts.map +1 -0
  33. package/dist/client/useMutation.d.ts +8 -0
  34. package/dist/client/useMutation.d.ts.map +1 -0
  35. package/dist/client/useQuery.d.ts +6 -0
  36. package/dist/client/useQuery.d.ts.map +1 -0
  37. package/dist/client/useUser.d.ts +2 -0
  38. package/dist/client/useUser.d.ts.map +1 -0
  39. package/dist/email/index.js +9086 -0
  40. package/dist/facades/index.js +71 -0
  41. package/dist/http/ApiRouter.d.ts +50 -0
  42. package/dist/http/ApiRouter.d.ts.map +1 -1
  43. package/dist/http/Controller.d.ts +5 -0
  44. package/dist/http/Controller.d.ts.map +1 -1
  45. package/dist/http/Error.d.ts +7 -0
  46. package/dist/http/Error.d.ts.map +1 -0
  47. package/dist/http/HttpRequest.d.ts +21 -0
  48. package/dist/http/HttpRequest.d.ts.map +1 -0
  49. package/dist/http/Middleware.d.ts +4 -0
  50. package/dist/http/Middleware.d.ts.map +1 -0
  51. package/dist/http/Router.d.ts +31 -0
  52. package/dist/http/Router.d.ts.map +1 -0
  53. package/dist/http/ViewRouter.d.ts +30 -0
  54. package/dist/http/ViewRouter.d.ts.map +1 -1
  55. package/dist/http/getCookies.d.ts +2 -0
  56. package/dist/http/getCookies.d.ts.map +1 -0
  57. package/dist/http/index.d.ts +4 -0
  58. package/dist/http/index.d.ts.map +1 -1
  59. package/dist/http/index.js +328 -16
  60. package/dist/http/requestContext.d.ts +4 -0
  61. package/dist/http/requestContext.d.ts.map +1 -0
  62. package/dist/runtime/index.js +8 -0
  63. package/dist/server/generateEtag.d.ts +2 -0
  64. package/dist/server/generateEtag.d.ts.map +1 -0
  65. package/dist/server/imageHandler.d.ts +2 -0
  66. package/dist/server/imageHandler.d.ts.map +1 -0
  67. package/dist/utils/Subject.d.ts +9 -0
  68. package/dist/utils/Subject.d.ts.map +1 -0
  69. package/dist/utils/type.d.ts +2 -0
  70. package/dist/utils/type.d.ts.map +1 -0
  71. package/dist/vite/index.js +35 -0
  72. package/package.json +19 -9
  73. package/bin/gemi.ts +0 -3
  74. package/dist/client/useRouter.d.ts +0 -2
  75. package/dist/client/useRouter.d.ts.map +0 -1
  76. package/dist/dev.js +0 -1195
  77. package/dist/server/Server.d.ts +0 -10
  78. package/dist/server/Server.d.ts.map +0 -1
  79. package/dist/server/dev.d.ts +0 -3
  80. package/dist/server/dev.d.ts.map +0 -1
  81. package/dist/server/index.d.ts +0 -2
  82. package/dist/server/index.d.ts.map +0 -1
  83. package/dist/server/index.js +0 -1195
Binary file
@@ -0,0 +1,4 @@
1
+ export declare const ClientRouter: (props: {
2
+ viewImportMap?: Record<string, 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":"AA2HA,eAAO,MAAM,YAAY,UAAW;IAClC,aAAa,CAAC,EAAE,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC,4CAwBA,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;AAE3C,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,4CA2GpD,CAAC;AAUF,wBAAgB,WAAW,aAU1B;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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"react";
2
+ interface ImageProps {
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,33 @@
1
+ import { type PropsWithChildren } from "react";
2
+ import type { ComponentTree } from "./types";
3
+ type Data = Record<string, any>;
4
+ export 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,MAAM,WAAW,sBAAsB;IACrC,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,4CAgBlD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type ComponentType } from "react";
2
+ export declare function createRoot(RootLayout: ComponentType<any>): (props: any) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=createRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRoot.d.ts","sourceRoot":"","sources":["../../client/createRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,wBAAgB,UAAU,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,WACxC,GAAG,6CAOnB"}
@@ -0,0 +1,3 @@
1
+ import type { ComponentTree } from "../types";
2
+ export declare function flattenComponentTree(componentTree: ComponentTree): any[];
3
+ //# sourceMappingURL=flattenComponentTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flattenComponentTree.d.ts","sourceRoot":"","sources":["../../../client/helpers/flattenComponentTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,aAAa,SAahE"}