@valbuild/shared 0.49.0 → 0.51.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/README.md +1 -1
- package/dist/declarations/src/internal/IValStore.d.ts +5 -0
- package/dist/declarations/src/internal/index.d.ts +1 -0
- package/dist/declarations/src/internal/richtext/conversion/index.d.ts +3 -2
- package/dist/declarations/src/internal/richtext/conversion/remirrorToRichTextSource.d.ts +5 -0
- package/dist/declarations/src/internal/richtext/conversion/remirrorTypes.d.ts +1889 -0
- package/dist/declarations/src/internal/richtext/conversion/richTextToRemirror.d.ts +3 -0
- package/dist/declarations/src/internal/server/types.d.ts +1 -1
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +531 -350
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +531 -350
- package/internal/dist/valbuild-shared-internal.esm.js +519 -345
- package/package.json +4 -4
- package/dist/declarations/src/internal/richtext/conversion/lexicalToRichTextSource.d.ts +0 -12
- package/dist/declarations/src/internal/richtext/conversion/richTextSourceToLexical.d.ts +0 -68
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@valbuild/shared",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.51.0",
|
4
4
|
"private": false,
|
5
5
|
"description": "Val shared types and utilities",
|
6
6
|
"scripts": {
|
@@ -28,10 +28,10 @@
|
|
28
28
|
],
|
29
29
|
"exports": true
|
30
30
|
},
|
31
|
-
"devDependencies": {},
|
32
31
|
"dependencies": {
|
33
|
-
"@valbuild/core": "~0.
|
34
|
-
"marked": "^9.0.3"
|
32
|
+
"@valbuild/core": "~0.51.0",
|
33
|
+
"marked": "^9.0.3",
|
34
|
+
"zod": "^3.22.4"
|
35
35
|
},
|
36
36
|
"files": [
|
37
37
|
"dist",
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { RichTextSource, AnyRichTextOptions } from "@valbuild/core";
|
2
|
-
import { LexicalRootNode } from "./richTextSourceToLexical.js";
|
3
|
-
export declare function lexicalToRichTextSource(node: LexicalRootNode): RichTextSource<AnyRichTextOptions> & {
|
4
|
-
files: Record<string, string>;
|
5
|
-
};
|
6
|
-
declare const FORMAT_MAPPING: {
|
7
|
-
bold: number;
|
8
|
-
italic: number;
|
9
|
-
"line-through": number;
|
10
|
-
};
|
11
|
-
export declare function fromLexicalFormat(format: number): (keyof typeof FORMAT_MAPPING)[];
|
12
|
-
export {};
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { AnyRichTextOptions, RichTextNode as ValRichTextNode, RichText } from "@valbuild/core";
|
2
|
-
export type LexicalTextNode = CommonLexicalProps & {
|
3
|
-
type: "text";
|
4
|
-
text: string;
|
5
|
-
format: "" | number;
|
6
|
-
};
|
7
|
-
type InlineNode = LexicalTextNode | LexicalLinkNode;
|
8
|
-
export type LexicalParagraphNode = CommonLexicalProps & {
|
9
|
-
type: "paragraph";
|
10
|
-
children: (InlineNode | LexicalLineBreakNode)[];
|
11
|
-
};
|
12
|
-
export type LexicalHeadingNode = CommonLexicalProps & {
|
13
|
-
type: "heading";
|
14
|
-
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
15
|
-
children: InlineNode[];
|
16
|
-
};
|
17
|
-
export type LexicalListItemNode = CommonLexicalProps & {
|
18
|
-
type: "listitem";
|
19
|
-
children: (InlineNode | LexicalListNode | LexicalLineBreakNode)[];
|
20
|
-
};
|
21
|
-
export type LexicalListNode = CommonLexicalProps & {
|
22
|
-
type: "list";
|
23
|
-
listType: "bullet" | "number" | "checked";
|
24
|
-
direction: "ltr" | "rtl" | null;
|
25
|
-
children: LexicalListItemNode[];
|
26
|
-
};
|
27
|
-
export type LexicalImagePayload = {
|
28
|
-
src: string;
|
29
|
-
altText?: string;
|
30
|
-
height?: number;
|
31
|
-
width?: number;
|
32
|
-
mimeType?: string;
|
33
|
-
};
|
34
|
-
export type LexicalImageNode = CommonLexicalProps & {
|
35
|
-
type: "image";
|
36
|
-
} & LexicalImagePayload;
|
37
|
-
export type LexicalLinkNode = CommonLexicalProps & {
|
38
|
-
type: "link";
|
39
|
-
url: string;
|
40
|
-
children: LexicalTextNode[];
|
41
|
-
};
|
42
|
-
export type LexicalLineBreakNode = CommonLexicalProps & {
|
43
|
-
type: "linebreak";
|
44
|
-
};
|
45
|
-
export type LexicalNode = LexicalTextNode | LexicalParagraphNode | LexicalHeadingNode | LexicalListItemNode | LexicalListNode | LexicalImageNode | LexicalLineBreakNode | LexicalLinkNode;
|
46
|
-
export type LexicalRootNode = {
|
47
|
-
type: "root";
|
48
|
-
children: (LexicalHeadingNode | LexicalParagraphNode | LexicalListNode)[];
|
49
|
-
version: 1;
|
50
|
-
format: "left" | "start" | "center" | "right" | "end" | "justify" | "";
|
51
|
-
direction: null | "ltr" | "rtl";
|
52
|
-
} & CommonLexicalProps;
|
53
|
-
export declare const COMMON_LEXICAL_PROPS: {
|
54
|
-
readonly version: 1;
|
55
|
-
readonly format: number | "";
|
56
|
-
readonly indent: 0;
|
57
|
-
readonly direction: "ltr" | "rtl" | null;
|
58
|
-
};
|
59
|
-
type CommonLexicalProps = typeof COMMON_LEXICAL_PROPS;
|
60
|
-
export declare function toLexicalNode(node: ValRichTextNode<AnyRichTextOptions>, useBreakNode?: boolean): LexicalNode;
|
61
|
-
export declare function richTextSourceToLexical(richtext: RichText<AnyRichTextOptions>): LexicalRootNode;
|
62
|
-
declare const FORMAT_MAPPING: {
|
63
|
-
bold: number;
|
64
|
-
italic: number;
|
65
|
-
"line-through": number;
|
66
|
-
};
|
67
|
-
export declare function toLexicalFormat(classes: (keyof typeof FORMAT_MAPPING)[]): number;
|
68
|
-
export {};
|