@realiizlabs/admin 0.1.1 → 0.7.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.
- package/dist/auth/index.cjs +182 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.cts +178 -0
- package/dist/auth/index.d.ts +178 -0
- package/dist/auth/index.js +167 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth-ui/index.cjs +124 -0
- package/dist/auth-ui/index.cjs.map +1 -0
- package/dist/auth-ui/index.d.cts +40 -0
- package/dist/auth-ui/index.d.ts +40 -0
- package/dist/auth-ui/index.js +81 -0
- package/dist/auth-ui/index.js.map +1 -0
- package/dist/chunk-4OCBMOEP.js +42 -0
- package/dist/chunk-4OCBMOEP.js.map +1 -0
- package/dist/chunk-IS52OXZ2.js +252 -0
- package/dist/chunk-IS52OXZ2.js.map +1 -0
- package/dist/forms/index.cjs +256 -0
- package/dist/forms/index.cjs.map +1 -0
- package/dist/forms/index.d.cts +48 -0
- package/dist/forms/index.d.ts +48 -0
- package/dist/forms/index.js +3 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/forms-ui/index.cjs +584 -0
- package/dist/forms-ui/index.cjs.map +1 -0
- package/dist/forms-ui/index.d.cts +41 -0
- package/dist/forms-ui/index.d.ts +41 -0
- package/dist/forms-ui/index.js +336 -0
- package/dist/forms-ui/index.js.map +1 -0
- package/dist/git/index.cjs +283 -0
- package/dist/git/index.cjs.map +1 -0
- package/dist/git/index.d.cts +258 -0
- package/dist/git/index.d.ts +258 -0
- package/dist/git/index.js +269 -0
- package/dist/git/index.js.map +1 -0
- package/dist/types-DsSMscTh.d.cts +74 -0
- package/dist/types-DsSMscTh.d.ts +74 -0
- package/package.json +55 -3
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The FieldSpec contract — what walkSchema produces and ADMIN-02b renders.
|
|
5
|
+
*
|
|
6
|
+
* Pure data. No React, no zod values at runtime (types only), no env.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type InputKind = "text" | "textarea" | "date" | "number" | "boolean" | "select" | "tags" | "image" | "url";
|
|
10
|
+
type FieldRole = "field" | "body" | "image" | "hidden";
|
|
11
|
+
/** Constraints lifted from the schema's checks. All optional. */
|
|
12
|
+
interface Constraints {
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
exact?: number;
|
|
16
|
+
/** Source of a regex, without slashes or flags. */
|
|
17
|
+
pattern?: string;
|
|
18
|
+
format?: "url" | "email" | "regex" | "int";
|
|
19
|
+
/** For arrays: the item's own constraints + messages. */
|
|
20
|
+
item?: {
|
|
21
|
+
constraints: Constraints;
|
|
22
|
+
messages: Messages;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Error messages keyed by the check that produced them — `min_length`,
|
|
27
|
+
* `max_length`, `length_equals`, `regex`, `url`, `greater_than`, `less_than`,
|
|
28
|
+
* `int`, `custom`. Collected per check, never overwritten (the spike's bug).
|
|
29
|
+
*/
|
|
30
|
+
type Messages = Record<string, string>;
|
|
31
|
+
/** Either a static list or something the renderer resolves. Never called here. */
|
|
32
|
+
type OptionsSource = string[] | (() => string[] | Promise<string[]>);
|
|
33
|
+
interface FieldSpec {
|
|
34
|
+
name: string;
|
|
35
|
+
label: string;
|
|
36
|
+
input: InputKind;
|
|
37
|
+
required: boolean;
|
|
38
|
+
constraints: Constraints;
|
|
39
|
+
messages: Messages;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
order: number;
|
|
42
|
+
role: FieldRole;
|
|
43
|
+
options?: OptionsSource;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The per-site registry entry — the only per-client work. Everything the
|
|
47
|
+
* schema cannot say about itself.
|
|
48
|
+
*/
|
|
49
|
+
interface ContentTypeEntry<S extends ZodType = ZodType> {
|
|
50
|
+
/** Stable id, e.g. "posts", "events". */
|
|
51
|
+
id: string;
|
|
52
|
+
/** Human name, e.g. "Blog posts". */
|
|
53
|
+
label: string;
|
|
54
|
+
schema: S;
|
|
55
|
+
/** Folder in the repo, e.g. "content/events". */
|
|
56
|
+
folder: string;
|
|
57
|
+
/** File name for a validated frontmatter object, e.g. `${fm.date}-${slug}.mdx`. */
|
|
58
|
+
filename: (frontmatter: Record<string, unknown>) => string;
|
|
59
|
+
/** Field that holds the MDX body, or null when the type has no body field. */
|
|
60
|
+
body: string | null;
|
|
61
|
+
/** Fields that hold image paths. */
|
|
62
|
+
images?: string[];
|
|
63
|
+
/** Label overrides — used when the schema can't be edited (5degrees until transfer). */
|
|
64
|
+
labels?: Record<string, string>;
|
|
65
|
+
placeholders?: Record<string, string>;
|
|
66
|
+
/** Fields to show first, in this order. Unlisted fields follow in schema order. */
|
|
67
|
+
order?: string[];
|
|
68
|
+
/** Fields not shown but carried through unchanged. */
|
|
69
|
+
hidden?: string[];
|
|
70
|
+
/** Option sources for fields that are really references (e.g. venue → venue slugs). */
|
|
71
|
+
options?: Record<string, OptionsSource>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type { ContentTypeEntry as C, FieldSpec as F, InputKind as I, Messages as M, OptionsSource as O, Constraints as a, FieldRole as b };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realiizlabs/admin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Reusable component library for Realiiz client websites.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -12,6 +12,31 @@
|
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"import": "./dist/index.js",
|
|
14
14
|
"require": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./git": {
|
|
17
|
+
"types": "./dist/git/index.d.ts",
|
|
18
|
+
"import": "./dist/git/index.js",
|
|
19
|
+
"require": "./dist/git/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./forms": {
|
|
22
|
+
"types": "./dist/forms/index.d.ts",
|
|
23
|
+
"import": "./dist/forms/index.js",
|
|
24
|
+
"require": "./dist/forms/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./forms-ui": {
|
|
27
|
+
"types": "./dist/forms-ui/index.d.ts",
|
|
28
|
+
"import": "./dist/forms-ui/index.js",
|
|
29
|
+
"require": "./dist/forms-ui/index.cjs"
|
|
30
|
+
},
|
|
31
|
+
"./auth": {
|
|
32
|
+
"types": "./dist/auth/index.d.ts",
|
|
33
|
+
"import": "./dist/auth/index.js",
|
|
34
|
+
"require": "./dist/auth/index.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./auth-ui": {
|
|
37
|
+
"types": "./dist/auth-ui/index.d.ts",
|
|
38
|
+
"import": "./dist/auth-ui/index.js",
|
|
39
|
+
"require": "./dist/auth-ui/index.cjs"
|
|
15
40
|
}
|
|
16
41
|
},
|
|
17
42
|
"sideEffects": false,
|
|
@@ -22,23 +47,50 @@
|
|
|
22
47
|
"build": "tsup",
|
|
23
48
|
"dev": "tsup --watch",
|
|
24
49
|
"typecheck": "tsc --noEmit",
|
|
50
|
+
"lint": "eslint .",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"prepublishOnly": "npm run build && npm test",
|
|
25
53
|
"clean": "rm -rf dist"
|
|
26
54
|
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"server-only": "^0.0.1"
|
|
57
|
+
},
|
|
27
58
|
"peerDependencies": {
|
|
59
|
+
"@supabase/ssr": ">=0.5",
|
|
28
60
|
"@supabase/supabase-js": ">=2",
|
|
29
61
|
"next": ">=13",
|
|
30
62
|
"react": ">=18",
|
|
31
|
-
"react-dom": ">=18"
|
|
63
|
+
"react-dom": ">=18",
|
|
64
|
+
"zod": ">=4.4"
|
|
65
|
+
},
|
|
66
|
+
"peerDependenciesMeta": {
|
|
67
|
+
"@supabase/ssr": {
|
|
68
|
+
"optional": true
|
|
69
|
+
},
|
|
70
|
+
"zod": {
|
|
71
|
+
"optional": true
|
|
72
|
+
}
|
|
32
73
|
},
|
|
33
74
|
"devDependencies": {
|
|
75
|
+
"@eslint/js": "^9.12.0",
|
|
76
|
+
"@supabase/ssr": "^0.12.7",
|
|
34
77
|
"@supabase/supabase-js": "^2.45.0",
|
|
78
|
+
"@testing-library/dom": "^10.4.1",
|
|
79
|
+
"@testing-library/react": "^16.3.3",
|
|
80
|
+
"@testing-library/user-event": "^14.6.7",
|
|
81
|
+
"@types/node": "^22.7.0",
|
|
35
82
|
"@types/react": "^18.3.0",
|
|
36
83
|
"@types/react-dom": "^18.3.0",
|
|
84
|
+
"eslint": "^9.12.0",
|
|
85
|
+
"jsdom": "^26.1.0",
|
|
37
86
|
"next": "^14.2.0",
|
|
38
87
|
"react": "^18.3.0",
|
|
39
88
|
"react-dom": "^18.3.0",
|
|
40
89
|
"tsup": "^8.3.0",
|
|
41
|
-
"typescript": "^5.5.0"
|
|
90
|
+
"typescript": "^5.5.0",
|
|
91
|
+
"typescript-eslint": "^8.8.0",
|
|
92
|
+
"vitest": "^3.2.0",
|
|
93
|
+
"zod": "^4.5.4"
|
|
42
94
|
},
|
|
43
95
|
"publishConfig": {
|
|
44
96
|
"access": "restricted"
|