@realiizlabs/admin 0.13.0 → 0.13.2
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/events/index.cjs +1 -1
- package/dist/events/index.cjs.map +1 -1
- package/dist/events/index.d.cts +2 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.js +1 -1
- package/dist/events/index.js.map +1 -1
- package/dist/forms/index.cjs +1 -1
- package/dist/forms/index.cjs.map +1 -1
- package/dist/forms/index.d.cts +2 -2
- package/dist/forms/index.d.ts +2 -2
- package/dist/forms/index.js +1 -1
- package/dist/forms/index.js.map +1 -1
- package/dist/forms-ui/index.d.cts +1 -1
- package/dist/forms-ui/index.d.ts +1 -1
- package/dist/media/index.cjs +33 -0
- package/dist/media/index.cjs.map +1 -1
- package/dist/media/index.d.cts +2 -0
- package/dist/media/index.d.ts +2 -0
- package/dist/media/index.js +30 -1
- package/dist/media/index.js.map +1 -1
- package/dist/shell/index.cjs +7 -1
- package/dist/shell/index.cjs.map +1 -1
- package/dist/shell/index.d.cts +2 -2
- package/dist/shell/index.d.ts +2 -2
- package/dist/shell/index.js +7 -1
- package/dist/shell/index.js.map +1 -1
- package/dist/studio/index.cjs +1 -1
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.d.cts +4 -42
- package/dist/studio/index.d.ts +4 -42
- package/dist/studio/index.js +1 -1
- package/dist/studio/index.js.map +1 -1
- package/dist/studio-ui/index.cjs +7 -1
- package/dist/studio-ui/index.cjs.map +1 -1
- package/dist/studio-ui/index.d.cts +1 -1
- package/dist/studio-ui/index.d.ts +1 -1
- package/dist/studio-ui/index.js +7 -1
- package/dist/studio-ui/index.js.map +1 -1
- package/dist/{types-D46UjOfv.d.cts → types-DeHdasdP.d.cts} +2 -0
- package/dist/{types-D46UjOfv.d.ts → types-DeHdasdP.d.ts} +2 -0
- package/dist/validate-C84Ll1cD.d.cts +41 -0
- package/dist/validate-C84Ll1cD.d.ts +41 -0
- package/package.json +1 -1
|
@@ -61,6 +61,8 @@ interface ContentTypeEntry<S extends ZodType = ZodType> {
|
|
|
61
61
|
label: string;
|
|
62
62
|
/** One item, e.g. "Blog post" — the form's section heading. Defaults to `label`. */
|
|
63
63
|
singular?: string;
|
|
64
|
+
/** Sidebar icon id (see the shell's IconName: posts, events, mic, venues, users, doc …). Defaults to `id`. */
|
|
65
|
+
icon?: string;
|
|
64
66
|
schema: S;
|
|
65
67
|
/** Folder in the repo, e.g. "content/events". */
|
|
66
68
|
folder: string;
|
|
@@ -61,6 +61,8 @@ interface ContentTypeEntry<S extends ZodType = ZodType> {
|
|
|
61
61
|
label: string;
|
|
62
62
|
/** One item, e.g. "Blog post" — the form's section heading. Defaults to `label`. */
|
|
63
63
|
singular?: string;
|
|
64
|
+
/** Sidebar icon id (see the shell's IconName: posts, events, mic, venues, users, doc …). Defaults to `id`. */
|
|
65
|
+
icon?: string;
|
|
64
66
|
schema: S;
|
|
65
67
|
/** Folder in the repo, e.g. "content/events". */
|
|
66
68
|
folder: string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side checks on the pictures a save carries. Pure.
|
|
3
|
+
*
|
|
4
|
+
* The browser already shrank them, but anyone can POST to a server action, so
|
|
5
|
+
* the path, type and size are re-checked before anything is committed: only
|
|
6
|
+
* WebP under the type's public folder, ≤ 800 KB each, ≤ 3.5 MB per save.
|
|
7
|
+
* Frontmatter paths are URL paths (/blog/x.webp); the repo file lives under public/.
|
|
8
|
+
*/
|
|
9
|
+
interface ImagePayload {
|
|
10
|
+
/** URL path as written in the frontmatter or body, e.g. /blog/my-post.webp. */
|
|
11
|
+
path: string;
|
|
12
|
+
/** Base64 of the WebP bytes. */
|
|
13
|
+
base64: string;
|
|
14
|
+
}
|
|
15
|
+
interface ImageLimits {
|
|
16
|
+
maxEach: number;
|
|
17
|
+
maxTotal: number;
|
|
18
|
+
/** URL prefix pictures must live under. */
|
|
19
|
+
prefix: string;
|
|
20
|
+
}
|
|
21
|
+
declare const IMAGE_LIMITS: ImageLimits;
|
|
22
|
+
declare const IMAGE_ERRORS: {
|
|
23
|
+
readonly path: "That image path isn’t allowed.";
|
|
24
|
+
readonly size: "That picture is too large to send — try a smaller one.";
|
|
25
|
+
};
|
|
26
|
+
type ValidatedImages = {
|
|
27
|
+
ok: true;
|
|
28
|
+
files: {
|
|
29
|
+
path: string;
|
|
30
|
+
content: string;
|
|
31
|
+
encoding: "base64";
|
|
32
|
+
}[];
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
error: string;
|
|
36
|
+
};
|
|
37
|
+
/** Bytes a base64 string decodes to, without decoding it. */
|
|
38
|
+
declare function decodedSize(b64: string): number;
|
|
39
|
+
declare function validateImages(images: ImagePayload[], limits?: ImageLimits): ValidatedImages;
|
|
40
|
+
|
|
41
|
+
export { IMAGE_ERRORS as I, type ValidatedImages as V, IMAGE_LIMITS as a, type ImageLimits as b, type ImagePayload as c, decodedSize as d, validateImages as v };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side checks on the pictures a save carries. Pure.
|
|
3
|
+
*
|
|
4
|
+
* The browser already shrank them, but anyone can POST to a server action, so
|
|
5
|
+
* the path, type and size are re-checked before anything is committed: only
|
|
6
|
+
* WebP under the type's public folder, ≤ 800 KB each, ≤ 3.5 MB per save.
|
|
7
|
+
* Frontmatter paths are URL paths (/blog/x.webp); the repo file lives under public/.
|
|
8
|
+
*/
|
|
9
|
+
interface ImagePayload {
|
|
10
|
+
/** URL path as written in the frontmatter or body, e.g. /blog/my-post.webp. */
|
|
11
|
+
path: string;
|
|
12
|
+
/** Base64 of the WebP bytes. */
|
|
13
|
+
base64: string;
|
|
14
|
+
}
|
|
15
|
+
interface ImageLimits {
|
|
16
|
+
maxEach: number;
|
|
17
|
+
maxTotal: number;
|
|
18
|
+
/** URL prefix pictures must live under. */
|
|
19
|
+
prefix: string;
|
|
20
|
+
}
|
|
21
|
+
declare const IMAGE_LIMITS: ImageLimits;
|
|
22
|
+
declare const IMAGE_ERRORS: {
|
|
23
|
+
readonly path: "That image path isn’t allowed.";
|
|
24
|
+
readonly size: "That picture is too large to send — try a smaller one.";
|
|
25
|
+
};
|
|
26
|
+
type ValidatedImages = {
|
|
27
|
+
ok: true;
|
|
28
|
+
files: {
|
|
29
|
+
path: string;
|
|
30
|
+
content: string;
|
|
31
|
+
encoding: "base64";
|
|
32
|
+
}[];
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
error: string;
|
|
36
|
+
};
|
|
37
|
+
/** Bytes a base64 string decodes to, without decoding it. */
|
|
38
|
+
declare function decodedSize(b64: string): number;
|
|
39
|
+
declare function validateImages(images: ImagePayload[], limits?: ImageLimits): ValidatedImages;
|
|
40
|
+
|
|
41
|
+
export { IMAGE_ERRORS as I, type ValidatedImages as V, IMAGE_LIMITS as a, type ImageLimits as b, type ImagePayload as c, decodedSize as d, validateImages as v };
|