@valbuild/core 0.102.0 → 0.103.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.
- package/dist/declarations/src/index.d.ts +11 -10
- package/dist/declarations/src/initSchema.d.ts +27 -14
- package/dist/declarations/src/initVal.d.ts +0 -6
- package/dist/declarations/src/module.d.ts +1 -4
- package/dist/declarations/src/render.d.ts +3 -5
- package/dist/declarations/src/schema/array.d.ts +1 -1
- package/dist/declarations/src/schema/file.d.ts +17 -17
- package/dist/declarations/src/schema/image.d.ts +15 -6
- package/dist/declarations/src/schema/index.d.ts +1 -1
- package/dist/declarations/src/schema/record.d.ts +3 -5
- package/dist/declarations/src/schema/remote.d.ts +0 -10
- package/dist/declarations/src/selector/SelectorProxy.d.ts +9 -2
- package/dist/declarations/src/selector/index.d.ts +3 -7
- package/dist/declarations/src/source/file.d.ts +6 -24
- package/dist/declarations/src/source/index.d.ts +3 -7
- package/dist/declarations/src/source/json.d.ts +1 -1
- package/dist/declarations/src/source/media.d.ts +98 -0
- package/dist/declarations/src/source/remote.d.ts +0 -14
- package/dist/declarations/src/source/richtext.d.ts +5 -7
- package/dist/declarations/src/val/index.d.ts +2 -5
- package/dist/{index-796fd204.esm.js → index-267a8e9c.esm.js} +847 -804
- package/dist/{index-30ecb49c.cjs.dev.js → index-2e40f2ae.cjs.dev.js} +845 -804
- package/dist/{index-ca1bbeb2.cjs.prod.js → index-3572060f.cjs.prod.js} +845 -804
- package/dist/{result-4bd63123.esm.js → result-daff1cae.esm.js} +1 -1
- package/dist/valbuild-core.cjs.dev.js +1 -3
- package/dist/valbuild-core.cjs.prod.js +1 -3
- package/dist/valbuild-core.esm.js +2 -2
- package/fp/dist/valbuild-core-fp.esm.js +1 -1
- package/package.json +1 -1
- package/patch/dist/valbuild-core-patch.cjs.dev.js +1 -1
- package/patch/dist/valbuild-core-patch.cjs.prod.js +1 -1
- package/patch/dist/valbuild-core-patch.esm.js +3 -3
- package/dist/declarations/src/selector/file.d.ts +0 -10
- package/dist/declarations/src/selector/image.d.ts +0 -3
- package/dist/declarations/src/source/image.d.ts +0 -19
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImageSchema, SerializedImageSchema } from "../schema/image.js";
|
|
2
2
|
import { RouteSchema, SerializedRouteSchema } from "../schema/route.js";
|
|
3
3
|
import { StringSchema, SerializedStringSchema } from "../schema/string.js";
|
|
4
|
-
import {
|
|
5
|
-
import { ImageSource } from "./image.js";
|
|
6
|
-
import { RemoteSource } from "./remote.js";
|
|
4
|
+
import { ImageSource } from "./media.js";
|
|
7
5
|
export type RichTextOptions = Partial<{
|
|
8
6
|
style: Partial<{
|
|
9
7
|
bold: boolean;
|
|
@@ -22,7 +20,7 @@ export type RichTextOptions = Partial<{
|
|
|
22
20
|
}>;
|
|
23
21
|
inline: Partial<{
|
|
24
22
|
a: boolean | RouteSchema<string> | StringSchema<string>;
|
|
25
|
-
img: boolean | ImageSchema<ImageSource
|
|
23
|
+
img: boolean | ImageSchema<ImageSource>;
|
|
26
24
|
}>;
|
|
27
25
|
}>;
|
|
28
26
|
export type SerializedRichTextOptions = Partial<{
|
|
@@ -92,8 +90,8 @@ export type SpanNode<O extends RichTextOptions> = {
|
|
|
92
90
|
};
|
|
93
91
|
export type ImageNode<O extends RichTextOptions> = NonNullable<O["inline"]>["img"] extends true ? {
|
|
94
92
|
tag: "img";
|
|
95
|
-
src: ImageSource
|
|
96
|
-
} : NonNullable<O["inline"]>["img"] extends ImageSchema<infer Src> ? Src extends
|
|
93
|
+
src: ImageSource;
|
|
94
|
+
} : NonNullable<O["inline"]>["img"] extends ImageSchema<infer Src> ? Src extends ImageSource ? {
|
|
97
95
|
tag: "img";
|
|
98
96
|
src: Src;
|
|
99
97
|
} : never : never;
|
|
@@ -4,16 +4,13 @@ import { Val as ArrayVal } from "./array.js";
|
|
|
4
4
|
import { Val as PrimitiveVal } from "./primitive.js";
|
|
5
5
|
import { Json, JsonArray, JsonObject, JsonPrimitive } from "../Json.js";
|
|
6
6
|
import { Path, Selector } from "../selector/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { FileSource } from "../source/file.js";
|
|
7
|
+
import { MediaSource } from "../source/media.js";
|
|
9
8
|
export type SerializedVal = {
|
|
10
9
|
val: SerializedVal | Json;
|
|
11
10
|
valPath: SourcePath | undefined;
|
|
12
11
|
};
|
|
13
12
|
export declare function isSerializedVal(val: unknown): val is SerializedVal;
|
|
14
|
-
export type JsonOfSource<T extends Source> = Json extends T ? Json : T extends
|
|
15
|
-
url: string;
|
|
16
|
-
} : T extends FileSource ? {
|
|
13
|
+
export type JsonOfSource<T extends Source> = Json extends T ? Json : T extends MediaSource ? T & {
|
|
17
14
|
url: string;
|
|
18
15
|
} : T extends SourceObject ? {
|
|
19
16
|
[key in keyof T]: JsonOfSource<T[key]>;
|