@phosart/common 0.4.39 → 0.4.41
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/server/models/Gallery.d.ts +5 -0
- package/dist/server/models/Gallery.d.ts.map +1 -1
- package/dist/server/models/Gallery.js +1 -0
- package/dist/server/theme/schema.d.ts +9 -1
- package/dist/server/theme/schema.d.ts.map +1 -1
- package/dist/server/theme/schema.js +5 -2
- package/package.json +1 -1
- package/src/lib/server/models/Gallery.ts +1 -0
- package/src/lib/server/theme/schema.ts +8 -3
|
@@ -31,6 +31,7 @@ export declare const BaseGallery: z.ZodObject<{
|
|
|
31
31
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
32
32
|
alt: z.ZodString;
|
|
33
33
|
description: z.ZodOptional<z.ZodString>;
|
|
34
|
+
alts_display: z.ZodOptional<z.ZodLiteral<"alternatives" | "comic_panels">>;
|
|
34
35
|
alts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
35
36
|
name: z.ZodString;
|
|
36
37
|
image: z.ZodString;
|
|
@@ -75,6 +76,7 @@ export declare const RawGallery: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
75
76
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
76
77
|
alt: z.ZodString;
|
|
77
78
|
description: z.ZodOptional<z.ZodString>;
|
|
79
|
+
alts_display: z.ZodOptional<z.ZodLiteral<"alternatives" | "comic_panels">>;
|
|
78
80
|
alts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
79
81
|
name: z.ZodString;
|
|
80
82
|
image: z.ZodString;
|
|
@@ -155,6 +157,7 @@ export declare const FullGallery: z.ZodObject<{
|
|
|
155
157
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
156
158
|
alt: z.ZodString;
|
|
157
159
|
description: z.ZodOptional<z.ZodString>;
|
|
160
|
+
alts_display: z.ZodOptional<z.ZodLiteral<"alternatives" | "comic_panels">>;
|
|
158
161
|
alts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
159
162
|
name: z.ZodString;
|
|
160
163
|
image: z.ZodObject<{
|
|
@@ -234,6 +237,7 @@ export declare const BaseArtPiece: z.ZodObject<{
|
|
|
234
237
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
235
238
|
alt: z.ZodString;
|
|
236
239
|
description: z.ZodOptional<z.ZodString>;
|
|
240
|
+
alts_display: z.ZodOptional<z.ZodLiteral<"alternatives" | "comic_panels">>;
|
|
237
241
|
alts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
238
242
|
name: z.ZodString;
|
|
239
243
|
image: z.ZodString;
|
|
@@ -312,6 +316,7 @@ export declare const FullArtPiece: z.ZodObject<{
|
|
|
312
316
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
313
317
|
alt: z.ZodString;
|
|
314
318
|
description: z.ZodOptional<z.ZodString>;
|
|
319
|
+
alts_display: z.ZodOptional<z.ZodLiteral<"alternatives" | "comic_panels">>;
|
|
315
320
|
alts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
316
321
|
name: z.ZodString;
|
|
317
322
|
image: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gallery.d.ts","sourceRoot":"","sources":["../../../src/lib/server/models/Gallery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;iBAE1B,CAAC;AAEH,eAAO,MAAM,KAAK;;;iBAGhB,CAAC;AAEH,eAAO,MAAM,UAAU;;;mBAGrB,CAAC;
|
|
1
|
+
{"version":3,"file":"Gallery.d.ts","sourceRoot":"","sources":["../../../src/lib/server/models/Gallery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;iBAE1B,CAAC;AAEH,eAAO,MAAM,KAAK;;;iBAGhB,CAAC;AAEH,eAAO,MAAM,UAAU;;;mBAGrB,CAAC;AAmDH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsB,CAAC;AAC/C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAA0C,CAAC;AAClE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAmB,CAAC;AAC5C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAuB,CAAC;AACjD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAoB,CAAC"}
|
|
@@ -15,6 +15,9 @@ declare const ZMultiSelectionOption: z.ZodObject<{
|
|
|
15
15
|
declare const ZStringOption: z.ZodObject<{
|
|
16
16
|
type: z.ZodLiteral<"string">;
|
|
17
17
|
}, z.z.core.$strip>;
|
|
18
|
+
declare const ZBoolOption: z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"boolean">;
|
|
20
|
+
}, z.z.core.$strip>;
|
|
18
21
|
declare const ZTagsOption: z.ZodObject<{
|
|
19
22
|
type: z.ZodLiteral<"tag-list">;
|
|
20
23
|
}, z.z.core.$strip>;
|
|
@@ -37,6 +40,8 @@ export declare const ZThemeSettingsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<r
|
|
|
37
40
|
type: z.ZodLiteral<"string-list">;
|
|
38
41
|
}, z.z.core.$strip>, z.ZodObject<{
|
|
39
42
|
type: z.ZodLiteral<"string">;
|
|
43
|
+
}, z.z.core.$strip>, z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"boolean">;
|
|
40
45
|
}, z.z.core.$strip>]>>;
|
|
41
46
|
export type ThemeSettingsSchema = z.infer<typeof ZThemeSettingsSchema>;
|
|
42
47
|
export declare const builtinSettings: {
|
|
@@ -47,9 +52,12 @@ export declare const builtinSettings: {
|
|
|
47
52
|
readonly type: "selection";
|
|
48
53
|
readonly options: ["static", "vercel"];
|
|
49
54
|
};
|
|
55
|
+
readonly supportsComics: {
|
|
56
|
+
readonly type: "boolean";
|
|
57
|
+
};
|
|
50
58
|
};
|
|
51
59
|
export type BuiltinSettings = typeof builtinSettings;
|
|
52
|
-
type MaterializedOptionFor<T extends ThemeSettingsSchema[string]> = T extends z.infer<typeof ZColorOption> ? `#${string}` : T extends z.infer<typeof ZSelectionOption> ? [...T['options']] : T extends z.infer<typeof ZMultiSelectionOption> ? Array<[...T['options']]> : T extends z.infer<typeof ZStringList> ? Array<string> : T extends z.infer<typeof ZTagsOption> ? Array<string> : T extends z.infer<typeof ZStringOption> ? string : never;
|
|
60
|
+
type MaterializedOptionFor<T extends ThemeSettingsSchema[string]> = T extends z.infer<typeof ZColorOption> ? `#${string}` : T extends z.infer<typeof ZSelectionOption> ? [...T['options']] : T extends z.infer<typeof ZMultiSelectionOption> ? Array<[...T['options']]> : T extends z.infer<typeof ZStringList> ? Array<string> : T extends z.infer<typeof ZTagsOption> ? Array<string> : T extends z.infer<typeof ZStringOption> ? string : T extends z.infer<typeof ZBoolOption> ? boolean | undefined : never;
|
|
53
61
|
export type SettingsFor<T extends ThemeSettingsSchema> = {
|
|
54
62
|
[K in keyof T]: MaterializedOptionFor<T[K]>;
|
|
55
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/lib/server/theme/schema.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,KAAK,CAAC;AAcpB,QAAA,MAAM,YAAY;;mBA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('string') });
|
|
28
|
+
const ZBoolOption = z.object({ type: z.literal('boolean') });
|
|
28
29
|
const ZTagsOption = z.object({ type: z.literal('tag-list') });
|
|
29
30
|
const ZStringList = z.object({ type: z.literal('string-list') });
|
|
30
31
|
export const ZThemeSettingsSchema = z.record(z.string(), z.union([
|
|
@@ -33,11 +34,13 @@ export const ZThemeSettingsSchema = z.record(z.string(), z.union([
|
|
|
33
34
|
ZMultiSelectionOption,
|
|
34
35
|
ZTagsOption,
|
|
35
36
|
ZStringList,
|
|
36
|
-
ZStringOption
|
|
37
|
+
ZStringOption,
|
|
38
|
+
ZBoolOption
|
|
37
39
|
]));
|
|
38
40
|
export const builtinSettings = {
|
|
39
41
|
defaultArtist: { type: 'string' },
|
|
40
|
-
websiteMode: { type: 'selection', options: ['static', 'vercel'] }
|
|
42
|
+
websiteMode: { type: 'selection', options: ['static', 'vercel'] },
|
|
43
|
+
supportsComics: { type: 'boolean' }
|
|
41
44
|
};
|
|
42
45
|
export async function readThemeSchema() {
|
|
43
46
|
let text;
|
package/package.json
CHANGED
|
@@ -37,6 +37,7 @@ function ArtPiece<T extends z.ZodTypeAny>(imageType: T) {
|
|
|
37
37
|
tags: z.array(z.string()).default([]),
|
|
38
38
|
alt: z.string(),
|
|
39
39
|
description: z.string().optional(),
|
|
40
|
+
alts_display: z.literal(['alternatives', 'comic_panels']).optional(),
|
|
40
41
|
alts: z
|
|
41
42
|
.array(
|
|
42
43
|
z.object({
|
|
@@ -27,6 +27,7 @@ const ZMultiSelectionOption = z.object({
|
|
|
27
27
|
multi: z.literal(true)
|
|
28
28
|
});
|
|
29
29
|
const ZStringOption = z.object({ type: z.literal('string') });
|
|
30
|
+
const ZBoolOption = z.object({ type: z.literal('boolean') });
|
|
30
31
|
const ZTagsOption = z.object({ type: z.literal('tag-list') });
|
|
31
32
|
const ZStringList = z.object({ type: z.literal('string-list') });
|
|
32
33
|
export const ZThemeSettingsSchema = z.record(
|
|
@@ -37,7 +38,8 @@ export const ZThemeSettingsSchema = z.record(
|
|
|
37
38
|
ZMultiSelectionOption,
|
|
38
39
|
ZTagsOption,
|
|
39
40
|
ZStringList,
|
|
40
|
-
ZStringOption
|
|
41
|
+
ZStringOption,
|
|
42
|
+
ZBoolOption
|
|
41
43
|
])
|
|
42
44
|
);
|
|
43
45
|
|
|
@@ -45,7 +47,8 @@ export type ThemeSettingsSchema = z.infer<typeof ZThemeSettingsSchema>;
|
|
|
45
47
|
|
|
46
48
|
export const builtinSettings = {
|
|
47
49
|
defaultArtist: { type: 'string' },
|
|
48
|
-
websiteMode: { type: 'selection', options: ['static', 'vercel'] }
|
|
50
|
+
websiteMode: { type: 'selection', options: ['static', 'vercel'] },
|
|
51
|
+
supportsComics: { type: 'boolean' }
|
|
49
52
|
} as const satisfies ThemeSettingsSchema;
|
|
50
53
|
export type BuiltinSettings = typeof builtinSettings;
|
|
51
54
|
|
|
@@ -62,7 +65,9 @@ type MaterializedOptionFor<T extends ThemeSettingsSchema[string]> =
|
|
|
62
65
|
? Array<string>
|
|
63
66
|
: T extends z.infer<typeof ZStringOption>
|
|
64
67
|
? string
|
|
65
|
-
:
|
|
68
|
+
: T extends z.infer<typeof ZBoolOption>
|
|
69
|
+
? boolean | undefined
|
|
70
|
+
: never;
|
|
66
71
|
|
|
67
72
|
export type SettingsFor<T extends ThemeSettingsSchema> = {
|
|
68
73
|
[K in keyof T]: MaterializedOptionFor<T[K]>;
|