@coorax/core 0.0.0-canary.3 → 0.0.0-canary.4
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/index.js +3 -1
- package/package.json +10 -10
- package/dist/base/classes/component.class.d.ts +0 -23
- package/dist/base/classes/container.class.d.ts +0 -17
- package/dist/base/classes/field.class.d.ts +0 -15
- package/dist/base/classes/tnode.class.d.ts +0 -14
- package/dist/base/index.d.ts +0 -19
- package/dist/base/types/components/components.d.ts +0 -13
- package/dist/base/types/container/container.d.ts +0 -27
- package/dist/base/types/container/division.types.d.ts +0 -3
- package/dist/base/types/container/section.types.d.ts +0 -3
- package/dist/base/types/container/ul-list.types.d.ts +0 -3
- package/dist/base/types/css.types.d.ts +0 -23
- package/dist/base/types/field/divider.types.d.ts +0 -3
- package/dist/base/types/field/field.blockquote.types.d.ts +0 -4
- package/dist/base/types/field/field.d.ts +0 -50
- package/dist/base/types/field/field.image.types.d.ts +0 -3
- package/dist/base/types/field/field.media.types.d.ts +0 -5
- package/dist/base/types/field/field.text.types.d.ts +0 -8
- package/dist/base/types/field/field.video.types.d.ts +0 -8
- package/dist/base/types/field/fields.iframe.types.d.ts +0 -7
- package/dist/base/types/field/heading.types.d.ts +0 -3
- package/dist/base/types/field/paragraph.types.d.ts +0 -3
- package/dist/base/types/global.types.d.ts +0 -26
- package/dist/base/types/node/link.types.d.ts +0 -3
- package/dist/base/types/node/node.d.ts +0 -24
- package/dist/base/types/node/span.types.d.ts +0 -3
- package/dist/base/types/tree/tree.d.ts +0 -24
- package/dist/constants/field.constants.d.ts +0 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/modules/text-editing/text-editing.utils.d.ts +0 -6
- package/dist/services/text-marks/marks.types.d.ts +0 -35
- package/dist/services/ui/default-styles.d.ts +0 -3
- package/dist/utils/components.utils.d.ts +0 -10
- package/dist/utils/container.utils.d.ts +0 -13
- package/dist/utils/fields.utils.d.ts +0 -27
- package/dist/utils/global.utils.d.ts +0 -47
- package/dist/utils/tnode.utils.d.ts +0 -9
- package/dist/utils/tree.utils.d.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -2499,7 +2499,9 @@ var InsertionModule = {
|
|
|
2499
2499
|
if (block && block.type === "caption") {
|
|
2500
2500
|
return;
|
|
2501
2501
|
}
|
|
2502
|
-
ctx.document.apply((tree) => ctx.mutations.changeField(tree, { fieldId, type }), {
|
|
2502
|
+
ctx.document.apply((tree) => ctx.mutations.changeField(tree, { fieldId, type }), {
|
|
2503
|
+
origin: isMediaType(type) || type === "link" ? "history" : "user"
|
|
2504
|
+
});
|
|
2503
2505
|
ctx.state.set("insertion", false);
|
|
2504
2506
|
ctx.events.emit("fields:change", { fieldId, type });
|
|
2505
2507
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorax/core",
|
|
3
|
-
"version": "0.0.0-canary.
|
|
3
|
+
"version": "0.0.0-canary.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -29,29 +29,29 @@
|
|
|
29
29
|
"fmt:check": "oxfmt --check",
|
|
30
30
|
"vtest": "vitest",
|
|
31
31
|
"typecheck": "tsc --noEmit",
|
|
32
|
-
"build:css": "bunx
|
|
32
|
+
"build:css": "bunx tailwindcss -i ./styles.css -o ./dist/styles.css --minify",
|
|
33
33
|
"build:types": "tsc --emitDeclarationOnly",
|
|
34
34
|
"build:js": "bun build ./src/index.ts --outdir ./dist --target browser --external lodash --external cn",
|
|
35
35
|
"build": "bun run build:types && bun run build:js && bun run build:css",
|
|
36
36
|
"prepublishOnly": "bun run build"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@coorax/schema": "
|
|
40
|
-
"@fontsource-variable/geist": "
|
|
41
|
-
"
|
|
42
|
-
"cn": "catalog:",
|
|
39
|
+
"@coorax/schema": "0.0.0-canary.3",
|
|
40
|
+
"@fontsource-variable/geist": "^5.3.0",
|
|
41
|
+
"cn": "^0.4.0",
|
|
43
42
|
"lodash": "^4.18.1"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
|
-
"@tailwindcss/
|
|
45
|
+
"@tailwindcss/cli": "^4.3.5",
|
|
46
|
+
"@tailwindcss/vite": "4.3.3",
|
|
47
47
|
"@types/lodash": "^4.17.27",
|
|
48
|
-
"csstype": "
|
|
48
|
+
"csstype": "^3.2.3",
|
|
49
49
|
"oxfmt": "^0.71.0",
|
|
50
50
|
"oxlint": "^1.86.0",
|
|
51
|
-
"tailwindcss": "
|
|
51
|
+
"tailwindcss": "4.3.3",
|
|
52
52
|
"typescript": "~6.0.2",
|
|
53
53
|
"vite": "^8.3.0",
|
|
54
|
-
"vitest": "
|
|
54
|
+
"vitest": "^5.0.3"
|
|
55
55
|
},
|
|
56
56
|
"packageManager": "bun@1.3.9"
|
|
57
57
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ContainerProps, ContainerTag, ContainerType } from "../types/container/container.ts";
|
|
2
|
-
import type { Component, ComponentId } from "../types/components/components.ts";
|
|
3
|
-
import type { BlockId, CoraxTree } from "../types/tree/tree.ts";
|
|
4
|
-
import type { OmitComponentsMethods } from "../types/global.types.ts";
|
|
5
|
-
export declare class ComponentClass<TType extends ContainerType = ContainerType, TTag extends ContainerTag = ContainerTag> implements Component<TType, TTag> {
|
|
6
|
-
id: ComponentId;
|
|
7
|
-
name: string;
|
|
8
|
-
tag: TTag;
|
|
9
|
-
type: TType;
|
|
10
|
-
props: ContainerProps<TTag>;
|
|
11
|
-
variant: "component";
|
|
12
|
-
order: Set<BlockId>;
|
|
13
|
-
instanceId?: ComponentId;
|
|
14
|
-
count: number;
|
|
15
|
-
updatedAt: number;
|
|
16
|
-
createdAt: number;
|
|
17
|
-
constructor(component: OmitComponentsMethods<Component<TType, TTag>>);
|
|
18
|
-
isInstance(): boolean;
|
|
19
|
-
getChildren(_tree: CoraxTree): Set<BlockId>;
|
|
20
|
-
appendChild(tree: CoraxTree): CoraxTree;
|
|
21
|
-
removeChild(tree: CoraxTree): CoraxTree;
|
|
22
|
-
getCurrentComponentObject(): OmitComponentsMethods<Component<TType, TTag>>;
|
|
23
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Container, ContainerId, ContainerProps, ContainerTag, ContainerType } from "../types/container/container.ts";
|
|
2
|
-
import type { OmitContainersMethods } from "../types/global.types.ts";
|
|
3
|
-
import type { BlockId, CoraxTree } from "../types/tree/tree.ts";
|
|
4
|
-
export declare class ContainerClass<TType extends ContainerType = ContainerType, TTag extends ContainerTag = ContainerTag> implements Container<TType, TTag> {
|
|
5
|
-
id: ContainerId;
|
|
6
|
-
name: string;
|
|
7
|
-
tag: TTag;
|
|
8
|
-
type: TType;
|
|
9
|
-
props: ContainerProps<TTag>;
|
|
10
|
-
variant: "container";
|
|
11
|
-
order: Set<BlockId>;
|
|
12
|
-
constructor(container: OmitContainersMethods<Container<TType, TTag>>);
|
|
13
|
-
getChildren(_tree: CoraxTree): Set<BlockId>;
|
|
14
|
-
appendChild(tree: CoraxTree): CoraxTree;
|
|
15
|
-
removeChild(tree: CoraxTree): CoraxTree;
|
|
16
|
-
getCurrentContainerObject(): OmitContainersMethods<Container<TType, TTag>>;
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Field, FieldId, FieldProps, FieldTag, FieldType } from "../types/field/field.ts";
|
|
2
|
-
import type { ContainerId } from "../types/container/container.ts";
|
|
3
|
-
import type { OmitFieldsMethods } from "../types/global.types.ts";
|
|
4
|
-
export declare class FieldClass<TType extends FieldType = FieldType, TTag extends FieldTag = FieldTag> implements Field<TType, TTag> {
|
|
5
|
-
id: FieldId;
|
|
6
|
-
name: string;
|
|
7
|
-
tag: TTag;
|
|
8
|
-
type: TType;
|
|
9
|
-
variant: "field";
|
|
10
|
-
containerId?: ContainerId;
|
|
11
|
-
props: FieldProps<TTag>;
|
|
12
|
-
constructor(field: OmitFieldsMethods<Field<TType, TTag>>);
|
|
13
|
-
isContainerized(): boolean;
|
|
14
|
-
getCurrentFieldObject(): OmitFieldsMethods<Field<TType, TTag>>;
|
|
15
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TNode, TNodeId, TNodeProps, TNodeTag, TNodeType } from "../types/node/node.ts";
|
|
2
|
-
import type { OmitTNodesMethods } from "../types/global.types.ts";
|
|
3
|
-
import type { FieldId } from "../types/field/field.ts";
|
|
4
|
-
export declare class TNodeClass<T extends TNodeType = TNodeType, A extends TNodeTag = TNodeTag> implements TNode<T, A> {
|
|
5
|
-
id: TNodeId;
|
|
6
|
-
tag: A;
|
|
7
|
-
type: T;
|
|
8
|
-
name: string;
|
|
9
|
-
variant: "tnode";
|
|
10
|
-
fieldId?: FieldId;
|
|
11
|
-
props: TNodeProps<A>;
|
|
12
|
-
constructor(tnode: OmitTNodesMethods<TNode<T, A>>);
|
|
13
|
-
getCurrentNodeObject(): OmitTNodesMethods<TNode<T, A>>;
|
|
14
|
-
}
|
package/dist/base/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./classes/component.class";
|
|
2
|
-
export * from "./classes/container.class";
|
|
3
|
-
export * from "./classes/field.class";
|
|
4
|
-
export * from "./classes/tnode.class";
|
|
5
|
-
export * from "./types/components/components";
|
|
6
|
-
export * from "./types/tree/tree";
|
|
7
|
-
export * from "./types/container/container";
|
|
8
|
-
export * from "./types/container/division.types";
|
|
9
|
-
export * from "./types/container/section.types";
|
|
10
|
-
export * from "./types/container/ul-list.types";
|
|
11
|
-
export * from "./types/field/field";
|
|
12
|
-
export * from "./types/field/field.text.types";
|
|
13
|
-
export * from "./types/field/heading.types";
|
|
14
|
-
export * from "./types/field/paragraph.types";
|
|
15
|
-
export * from "./types/node/link.types";
|
|
16
|
-
export * from "./types/node/node";
|
|
17
|
-
export * from "./types/node/span.types";
|
|
18
|
-
export * from "./types/global.types";
|
|
19
|
-
export * from "./types/css.types";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Container, ContainerTag, ContainerType } from "../container/container.ts";
|
|
2
|
-
import type { OmitComponentsMethods } from "../global.types.ts";
|
|
3
|
-
export type ComponentId = `component:${string}-${string}-${string}-${string}-${string}` | `component:${string}`;
|
|
4
|
-
export interface Component<T extends ContainerType = ContainerType, A extends ContainerTag = ContainerTag> extends Omit<Container<T, A>, "getCurrentContainerObject" | "variant" | "id"> {
|
|
5
|
-
id: ComponentId;
|
|
6
|
-
count: number;
|
|
7
|
-
updatedAt: number;
|
|
8
|
-
createdAt: number;
|
|
9
|
-
variant: "component";
|
|
10
|
-
instanceId?: ComponentId;
|
|
11
|
-
getCurrentComponentObject(): OmitComponentsMethods<Component<T, A>>;
|
|
12
|
-
isInstance(): boolean;
|
|
13
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { UlListProps } from "./ul-list.types.ts";
|
|
2
|
-
import type { SectionProps } from "./section.types.ts";
|
|
3
|
-
import type { BlockId, CoraxTree } from "../tree/tree.ts";
|
|
4
|
-
import type { OmitContainersMethods } from "../global.types.ts";
|
|
5
|
-
import type { DivisionProps } from "./division.types.ts";
|
|
6
|
-
export type ContainerType = "list" | "section" | "division";
|
|
7
|
-
export type ContainerTag = "ul" | "section" | "div";
|
|
8
|
-
export type ContainerId = `container:${string}-${string}-${string}-${string}-${string}` | `container:${string}`;
|
|
9
|
-
export type ContainerGlobalProps = {
|
|
10
|
-
ul: UlListProps;
|
|
11
|
-
section: SectionProps;
|
|
12
|
-
div: DivisionProps;
|
|
13
|
-
};
|
|
14
|
-
export type ContainerProps<A extends ContainerTag = ContainerTag> = ContainerGlobalProps[A];
|
|
15
|
-
export interface Container<T extends ContainerType = ContainerType, A extends ContainerTag = ContainerTag> {
|
|
16
|
-
id: ContainerId;
|
|
17
|
-
tag: A;
|
|
18
|
-
type: T;
|
|
19
|
-
name: string;
|
|
20
|
-
props: ContainerProps<A>;
|
|
21
|
-
variant: "container";
|
|
22
|
-
order: Set<BlockId>;
|
|
23
|
-
getChildren(tree: CoraxTree): Set<BlockId>;
|
|
24
|
-
removeChild(tree: CoraxTree): CoraxTree;
|
|
25
|
-
appendChild(tree: CoraxTree): CoraxTree;
|
|
26
|
-
getCurrentContainerObject(): OmitContainersMethods<Container<T, A>>;
|
|
27
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type * as CSS from "csstype";
|
|
2
|
-
export type CoraxCSSProperties = CSS.PropertiesFallback<number | string>;
|
|
3
|
-
export type CoraxCSSPropertiesWithMultiValues = {
|
|
4
|
-
[K in keyof CoraxCSSProperties]: CoraxCSSProperties[K] | ReadonlyArray<Extract<CoraxCSSProperties[K], string>>;
|
|
5
|
-
};
|
|
6
|
-
export type CoraxCSSPseudos = {
|
|
7
|
-
[K in CSS.Pseudos]?: CoraxCSSObject;
|
|
8
|
-
};
|
|
9
|
-
export interface ArrayCSSInterpolation extends ReadonlyArray<CoraxCSSInterpolation> {
|
|
10
|
-
}
|
|
11
|
-
export type CoraxInterpolationPrimitive = null | undefined | boolean | number | string | CoraxKeyframes | CoraxCSSObject;
|
|
12
|
-
export type CoraxCSSInterpolation = CoraxInterpolationPrimitive | ArrayCSSInterpolation;
|
|
13
|
-
export interface CoraxCSSOthersObject {
|
|
14
|
-
[propertiesName: string]: CoraxCSSInterpolation;
|
|
15
|
-
}
|
|
16
|
-
export interface CoraxCSSObject extends CoraxCSSPropertiesWithMultiValues, CoraxCSSPseudos, CoraxCSSOthersObject {
|
|
17
|
-
}
|
|
18
|
-
export type CoraxKeyframes = {
|
|
19
|
-
name: string;
|
|
20
|
-
styles: string;
|
|
21
|
-
anim: number;
|
|
22
|
-
toString: () => string;
|
|
23
|
-
} & string;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { ParagraphProps } from "./paragraph.types.ts";
|
|
2
|
-
import type { HeadingProps } from "./heading.types.ts";
|
|
3
|
-
import type { ContainerId } from "../container/container.ts";
|
|
4
|
-
import type { OmitFieldsMethods } from "../global.types.ts";
|
|
5
|
-
import type { DividerProps } from "./divider.types";
|
|
6
|
-
import type { VideoFieldProps } from "./field.video.types.js";
|
|
7
|
-
import type { ImageFieldProps } from "./field.image.types.js";
|
|
8
|
-
import type { IFrameFieldProps } from "./fields.iframe.types.js";
|
|
9
|
-
import type { BlockquoteFieldProps } from "./field.blockquote.types.js";
|
|
10
|
-
export type FieldType = keyof FieldTMap;
|
|
11
|
-
export type FieldTag = keyof FieldMap;
|
|
12
|
-
export type FieldId = `field:${string}-${string}-${string}-${string}-${string}` | `field:${string}`;
|
|
13
|
-
export interface FieldMap {
|
|
14
|
-
p: ParagraphProps;
|
|
15
|
-
h1: HeadingProps;
|
|
16
|
-
img: ImageFieldProps;
|
|
17
|
-
video: VideoFieldProps;
|
|
18
|
-
hr: DividerProps;
|
|
19
|
-
iframe: IFrameFieldProps;
|
|
20
|
-
blockquote: BlockquoteFieldProps;
|
|
21
|
-
}
|
|
22
|
-
export interface FieldTMap {
|
|
23
|
-
text: {};
|
|
24
|
-
heading: {};
|
|
25
|
-
image: {};
|
|
26
|
-
video: {};
|
|
27
|
-
divider: {};
|
|
28
|
-
iframe: {};
|
|
29
|
-
blockquote: {};
|
|
30
|
-
}
|
|
31
|
-
export type FieldPropsByTag<T extends FieldTag = FieldTag> = FieldMap[T];
|
|
32
|
-
export type FieldProps<A extends FieldTag = FieldTag> = FieldPropsByTag<A>;
|
|
33
|
-
export interface Field<T extends FieldType = FieldType, A extends FieldTag = FieldTag> {
|
|
34
|
-
id: FieldId;
|
|
35
|
-
tag: A;
|
|
36
|
-
type: T;
|
|
37
|
-
name: string;
|
|
38
|
-
variant: "field";
|
|
39
|
-
containerId?: ContainerId;
|
|
40
|
-
props: FieldProps<A>;
|
|
41
|
-
isContainerized(): boolean;
|
|
42
|
-
getCurrentFieldObject(): OmitFieldsMethods<Field<T, A>>;
|
|
43
|
-
}
|
|
44
|
-
export type TextField = Field<"heading" | "text", "h1" | "p">;
|
|
45
|
-
export type MediaField = Field<"image" | "video", "img" | "video">;
|
|
46
|
-
export type ImageField = Field<"image", "img">;
|
|
47
|
-
export type VideoField = Field<"video", "video">;
|
|
48
|
-
export type DividerField = Field<"divider", "hr">;
|
|
49
|
-
export type IFrameField = Field<"iframe", "iframe">;
|
|
50
|
-
export type BlockquoteField = Field<"blockquote", "blockquote">;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { TextContent } from "../../../services/text-marks/marks.types";
|
|
2
|
-
import type { NodeCommonProps } from "../global.types.ts";
|
|
3
|
-
export interface TextCommonProps extends NodeCommonProps {
|
|
4
|
-
children: TextContent;
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
contentEditable?: boolean;
|
|
7
|
-
"data-text-path": string;
|
|
8
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type * as CSS from "csstype";
|
|
2
|
-
import type { Container } from "./container/container";
|
|
3
|
-
import type { Field } from "./field/field";
|
|
4
|
-
import type { Component } from "./components/components";
|
|
5
|
-
import type { TNode } from "./node/node.ts";
|
|
6
|
-
import type { CoraxCSSProperties, CoraxCSSPseudos } from "./css.types";
|
|
7
|
-
export type PseudoSelectors = {
|
|
8
|
-
[P in CSS.Pseudos]?: CSS.Properties;
|
|
9
|
-
};
|
|
10
|
-
export type NodeCommonProps<T extends CoraxCSSProperties = CoraxCSSProperties> = {
|
|
11
|
-
title?: string;
|
|
12
|
-
style?: T;
|
|
13
|
-
pseudoStyle?: CoraxCSSPseudos;
|
|
14
|
-
className?: string;
|
|
15
|
-
isLoaded?: boolean;
|
|
16
|
-
isError?: boolean;
|
|
17
|
-
};
|
|
18
|
-
export type OmitContainersMethods<T extends Container> = Omit<T, "getChildren" | "appendChild" | "removeChild" | "getCurrentContainerObject">;
|
|
19
|
-
export type OmitComponentsMethods<T extends Component> = Omit<T, "getChildren" | "appendChild" | "removeChild" | "getCurrentComponentObject" | "isInstance">;
|
|
20
|
-
export type OmitFieldsMethods<T extends Field> = Omit<T, "isContainerized" | "getCurrentFieldObject">;
|
|
21
|
-
export type OmitTNodesMethods<T extends TNode> = Omit<T, "getCurrentNodeObject">;
|
|
22
|
-
export type UnionSide<T, K extends any> = K extends T ? K : never;
|
|
23
|
-
export type PathToProp<T, F, Prev extends string = ""> = {
|
|
24
|
-
[K in keyof T]: T[K] extends F ? `${Prev}${Extract<K, string>}` : T[K] extends object ? PathToProp<T[K], F, `${Prev}${Extract<K, string>}.`> : never;
|
|
25
|
-
}[keyof T];
|
|
26
|
-
export type RMUndfined<T> = T extends undefined ? never : T;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { FieldId } from "../field/field.ts";
|
|
2
|
-
import type { OmitTNodesMethods } from "../global.types.ts";
|
|
3
|
-
import type { LinkProps } from "./link.types.ts";
|
|
4
|
-
import type { SpanProps } from "./span.types.ts";
|
|
5
|
-
export type TNodeType = "link" | "sub-field";
|
|
6
|
-
export type TNodeTag = "a" | "span";
|
|
7
|
-
export type TNodeId = `tnode:${string}-${string}-${string}-${string}-${string}` | `node:${string}`;
|
|
8
|
-
export type TNodeGlobalProps = {
|
|
9
|
-
a: LinkProps;
|
|
10
|
-
span: SpanProps;
|
|
11
|
-
};
|
|
12
|
-
export type TNodeProps<A extends TNodeTag = TNodeTag> = TNodeGlobalProps[A] & {
|
|
13
|
-
text: string;
|
|
14
|
-
};
|
|
15
|
-
export interface TNode<T extends TNodeType = TNodeType, A extends TNodeTag = TNodeTag> {
|
|
16
|
-
id: TNodeId;
|
|
17
|
-
tag: A;
|
|
18
|
-
type: T;
|
|
19
|
-
name: string;
|
|
20
|
-
variant: "tnode";
|
|
21
|
-
fieldId?: FieldId;
|
|
22
|
-
props: TNodeProps<A>;
|
|
23
|
-
getCurrentNodeObject(): OmitTNodesMethods<TNode<T, A>>;
|
|
24
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Field, FieldId } from "../field/field.ts";
|
|
2
|
-
import type { Container, ContainerId } from "../container/container.ts";
|
|
3
|
-
import type { Component, ComponentId } from "../components/components.ts";
|
|
4
|
-
import type { OmitComponentsMethods, OmitContainersMethods, OmitFieldsMethods } from "../global.types.ts";
|
|
5
|
-
export type OmittedMethodsBlock = OmitFieldsMethods<Field> | OmitComponentsMethods<Component> | OmitContainersMethods<Container>;
|
|
6
|
-
export type Block = Field | Component | Container;
|
|
7
|
-
export type BlockId = Block["id"];
|
|
8
|
-
export type BlockTag = Block["tag"];
|
|
9
|
-
export type BlockType = Block["type"];
|
|
10
|
-
export type BlockVariant = Block["variant"];
|
|
11
|
-
export type CoraxTree = {
|
|
12
|
-
id: string;
|
|
13
|
-
version: `${number}.${number}.${number}`;
|
|
14
|
-
fields: Map<FieldId, Field>;
|
|
15
|
-
containers: Map<ContainerId, Container>;
|
|
16
|
-
components: Map<ComponentId, Component>;
|
|
17
|
-
order: Set<BlockId>;
|
|
18
|
-
};
|
|
19
|
-
export type JSONTree = Pick<CoraxTree, "id" | "version"> & {
|
|
20
|
-
order: BlockId[];
|
|
21
|
-
fields: Record<FieldId, OmitFieldsMethods<Field>>;
|
|
22
|
-
containers: Record<ContainerId, OmitContainersMethods<Container>>;
|
|
23
|
-
components: Record<ComponentId, OmitComponentsMethods<Component>>;
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_IMAGE_PREVIEW = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD/4QBWRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAAAAAEsAAAAAQAAASwAAAAB/+0ALFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAPHAFaAAMbJUccAQAAAgAEAP/hDW9odHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvADw/eHBhY2tldCBiZWdpbj0n77u/JyBpZD0nVzVNME1wQ2VoaUh6cmV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AgPHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD5hZG9iZTpkb2NpZDpzdG9jazoxNjc5NDQyMTk2PC94bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+CiA8L3JkZjpEZXNjcmlwdGlvbj4KPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0ndyc/Pv/bAEMAAwICAwICAwMDAwQDAwQFCAUFBAQFCgcHBggMCgwMCwoLCw0OEhANDhEOCwsQFhARExQVFRUMDxcYFhQYEhQVFP/bAEMBAwQEBQQFCQUFCRQNCw0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFP/AABEIAPACbwMBEQACEQEDEQH/xAAdAAEBAAICAwEAAAAAAAAAAAAACAYHAQUCAwQJ/8QARBABAAEDAgIDCwoFAwMFAAAAAAECAwQFBgcREiFBCBcYMVFUVmFxlLMTIjI2OEJzgZOhFBUWI5EzcrFDU2KCorLR8f/EABcBAQEBAQAAAAAAAAAAAAAAAAACAwH/xAAcEQEBAQEBAQEBAQAAAAAAAAAAARESAjFBMiH/2gAMAwEAAhEDEQA/AP1TAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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azTmHgqbB81z/AH2s05h4KmwfNc/32s05h4KmwfNc/wB9rNOY92L3LmwMa9FdWn5WREfcvZlyaZ9vKYNOY2PoG2dK2tg04WkYGPp+NH/Tx7cUxM+WfLPrlxUmOzHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//Z";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./field.constants";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { TextField } from "../../base";
|
|
2
|
-
import type { NodeCommonProps, PathToProp } from "../../base/types/global.types";
|
|
3
|
-
export interface MarkMap {
|
|
4
|
-
bold: {};
|
|
5
|
-
italic: {};
|
|
6
|
-
underline: {};
|
|
7
|
-
link: {
|
|
8
|
-
href: string;
|
|
9
|
-
};
|
|
10
|
-
code: {};
|
|
11
|
-
initial: {
|
|
12
|
-
style: NodeCommonProps["style"];
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export type MarkType = keyof MarkMap;
|
|
16
|
-
export type MarkAttrs<T extends MarkType = MarkType> = MarkMap[T];
|
|
17
|
-
export interface Mark<T extends MarkType = MarkType> {
|
|
18
|
-
type: T;
|
|
19
|
-
start: number;
|
|
20
|
-
end: number;
|
|
21
|
-
attrs?: MarkAttrs<T>;
|
|
22
|
-
}
|
|
23
|
-
export interface MarkSpec<T extends MarkType = MarkType> {
|
|
24
|
-
type: T;
|
|
25
|
-
attrs?: MarkAttrs<T>;
|
|
26
|
-
}
|
|
27
|
-
export interface MarkBehavior {
|
|
28
|
-
/** Un caractère tapé juste après la fin du mark l'étend-il ? */
|
|
29
|
-
inclusive: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface TextContent {
|
|
32
|
-
text: string;
|
|
33
|
-
marks: readonly Mark[];
|
|
34
|
-
}
|
|
35
|
-
export type FieldTextContentPath = PathToProp<TextField, TextContent>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Component } from "../base/types/components/components";
|
|
2
|
-
import type { Container, ContainerType } from "../base/types/container/container";
|
|
3
|
-
import type { OmitComponentsMethods } from "../base/types/global.types";
|
|
4
|
-
declare function NewComponent<T extends ContainerType = ContainerType>(container: Omit<Container<T>, "id" | "variant">, defaultValue?: Partial<Pick<Component, "count" | "createdAt" | "updatedAt">>): Component<T>;
|
|
5
|
-
declare function DeserializeComponent(component: OmitComponentsMethods<Component>): Component;
|
|
6
|
-
export declare const ComponentsUtils: {
|
|
7
|
-
NewComponent: typeof NewComponent;
|
|
8
|
-
DeserializeComponent: typeof DeserializeComponent;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Container, ContainerType } from "../base/types/container/container";
|
|
2
|
-
import type { OmitContainersMethods } from "../base/types/global.types";
|
|
3
|
-
declare function NewUlListContainer(defaultValue?: Partial<OmitContainersMethods<Container<"list">>>): Container<"list">;
|
|
4
|
-
declare function NewSectionContainer(defaultValue?: Partial<OmitContainersMethods<Container<"section">>>): Container<"section">;
|
|
5
|
-
declare function NewContainer<T extends ContainerType = ContainerType>(type: T, defaultValue?: Partial<OmitContainersMethods<Container<T>>>): Container;
|
|
6
|
-
declare function DeserializeContainer(container: OmitContainersMethods<Container>): Container;
|
|
7
|
-
export declare const ContainersUtils: {
|
|
8
|
-
NewContainer: typeof NewContainer;
|
|
9
|
-
DeserializeContainer: typeof DeserializeContainer;
|
|
10
|
-
NewUlListContainer: typeof NewUlListContainer;
|
|
11
|
-
NewSectionContainer: typeof NewSectionContainer;
|
|
12
|
-
};
|
|
13
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Block } from "../base";
|
|
2
|
-
import type { Field, FieldTag, FieldType } from "../base/types/field/field";
|
|
3
|
-
import type { OmitFieldsMethods } from "../base/types/global.types";
|
|
4
|
-
export declare function isEditableField<T extends Field = Field>(block: Block): block is T;
|
|
5
|
-
export declare function isEditableType<T extends FieldType = FieldType>(type: T): boolean;
|
|
6
|
-
export declare function isMediaField<T extends Field = Field>(block: Block): block is T;
|
|
7
|
-
export declare function isMediaType<T extends FieldType = FieldType>(type: T): boolean;
|
|
8
|
-
export declare function getIframeSrc(value: string): string | null;
|
|
9
|
-
declare function NewTextField(defaultValue?: Partial<OmitFieldsMethods<Field<"text", FieldTag>>>): Field<"text">;
|
|
10
|
-
declare function NewHeadingField(defaultValue?: Partial<OmitFieldsMethods<Field<"heading", FieldTag>>>): Field<"heading">;
|
|
11
|
-
declare function NewImageField(defaultValue?: Partial<OmitFieldsMethods<Field<"image", FieldTag>>>): Field<"image">;
|
|
12
|
-
declare function NewIFrameField(defaultValue?: Partial<OmitFieldsMethods<Field<"iframe", FieldTag>>>): Field<"iframe">;
|
|
13
|
-
declare function NewBlockquoteField(defaultValue?: Partial<OmitFieldsMethods<Field<"blockquote", FieldTag>>>): Field<"blockquote">;
|
|
14
|
-
declare function NewDividerField(defaultValue?: Partial<OmitFieldsMethods<Field<"divider", FieldTag>>>): Field<"divider">;
|
|
15
|
-
declare function NewField<T extends FieldType = FieldType, A extends FieldTag = FieldTag>(type: T, defaultValue?: Partial<OmitFieldsMethods<Field<T, A>>>): Field;
|
|
16
|
-
declare function DeserializeField(field: OmitFieldsMethods<Field>): Field;
|
|
17
|
-
export declare const FieldsUtils: {
|
|
18
|
-
NewField: typeof NewField;
|
|
19
|
-
DeserializeField: typeof DeserializeField;
|
|
20
|
-
NewTextField: typeof NewTextField;
|
|
21
|
-
NewHeadingField: typeof NewHeadingField;
|
|
22
|
-
NewImageField: typeof NewImageField;
|
|
23
|
-
NewDividerField: typeof NewDividerField;
|
|
24
|
-
NewIFrameField: typeof NewIFrameField;
|
|
25
|
-
NewBlockquoteField: typeof NewBlockquoteField;
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
declare function generateRandomId(): string;
|
|
2
|
-
export type CustomID<T extends string> = `${T}:${string}-${string}-${string}-${string}-${string}`;
|
|
3
|
-
declare function generateId<T extends string>(prefix: T): CustomID<T>;
|
|
4
|
-
declare function generateFieldId(): `field:${string}-${string}-${string}-${string}-${string}`;
|
|
5
|
-
declare function generateTNodeId(): `tnode:${string}-${string}-${string}-${string}-${string}`;
|
|
6
|
-
declare function generateContainerId(): `container:${string}-${string}-${string}-${string}-${string}`;
|
|
7
|
-
declare function generateComponentId(): `component:${string}-${string}-${string}-${string}-${string}`;
|
|
8
|
-
declare function generateTreeId(): `tree:${string}-${string}-${string}-${string}-${string}`;
|
|
9
|
-
declare function generateSubscriberId(): `subscriber:${string}-${string}-${string}-${string}-${string}`;
|
|
10
|
-
declare function Capitalize(value: string): string;
|
|
11
|
-
type EntriesKeyValuePair<T extends object, K extends keyof T = keyof T> = [K, T[K]][];
|
|
12
|
-
/**
|
|
13
|
-
* Because the native `Object.entries` dont infer correctly
|
|
14
|
-
* the return type, the `keys` are always string.
|
|
15
|
-
* So now if you pass a `Record<Key, Value>`, the Key type
|
|
16
|
-
* will be inferred correctly
|
|
17
|
-
*
|
|
18
|
-
* @param obj `object`
|
|
19
|
-
* @returns `EntriesKeyValuePair<T>`
|
|
20
|
-
*/
|
|
21
|
-
declare function ObjectEntries<T extends object>(obj: T): EntriesKeyValuePair<T>;
|
|
22
|
-
export declare class CustomObject<T extends object> {
|
|
23
|
-
obj: T;
|
|
24
|
-
constructor(obj: T);
|
|
25
|
-
filter(predicate: (value: T[keyof T], key: keyof T) => boolean): CustomObject<Partial<T>>;
|
|
26
|
-
pick<K extends keyof T>(...keys: K[]): CustomObject<Pick<T, K>>;
|
|
27
|
-
get size(): number;
|
|
28
|
-
has<K extends keyof T>(key: K): boolean;
|
|
29
|
-
get keys(): (keyof T)[];
|
|
30
|
-
get<K extends keyof T>(key: K): T[K];
|
|
31
|
-
baseObject(): T;
|
|
32
|
-
}
|
|
33
|
-
export declare function areObjectsTheSame(objA: object, objB: object): boolean;
|
|
34
|
-
export declare const UTILS: {
|
|
35
|
-
generateRandomId: typeof generateRandomId;
|
|
36
|
-
generateId: typeof generateId;
|
|
37
|
-
generateContainerId: typeof generateContainerId;
|
|
38
|
-
generateFieldId: typeof generateFieldId;
|
|
39
|
-
generateTreeId: typeof generateTreeId;
|
|
40
|
-
generateSubscriberId: typeof generateSubscriberId;
|
|
41
|
-
generateComponentId: typeof generateComponentId;
|
|
42
|
-
Capitalize: typeof Capitalize;
|
|
43
|
-
generateTNodeId: typeof generateTNodeId;
|
|
44
|
-
ObjectEntries: typeof ObjectEntries;
|
|
45
|
-
isPlainObject: (v: unknown) => v is Record<string, unknown>;
|
|
46
|
-
};
|
|
47
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { OmitTNodesMethods } from "../base/types/global.types";
|
|
2
|
-
import type { TNode, TNodeType } from "../base/types/node/node";
|
|
3
|
-
declare function NewTNode<T extends TNodeType = TNodeType>(type: T, defaultValue?: Partial<OmitTNodesMethods<TNode<T>>>): TNode;
|
|
4
|
-
declare function DeserializeTNode(tnode: OmitTNodesMethods<TNode>): TNode;
|
|
5
|
-
export declare const TNodesUtils: {
|
|
6
|
-
NewTNode: typeof NewTNode;
|
|
7
|
-
DeserializeTNode: typeof DeserializeTNode;
|
|
8
|
-
};
|
|
9
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { BlockId, CoraxTree, JSONTree } from "../base/types/tree/tree";
|
|
2
|
-
export declare function SerializeTree(tree: CoraxTree): JSONTree;
|
|
3
|
-
export declare function DeserializeTree(tree: JSONTree): CoraxTree;
|
|
4
|
-
export declare function GetDefaultTree(): CoraxTree;
|
|
5
|
-
export type TreeDiff = {
|
|
6
|
-
added: ReadonlySet<BlockId>;
|
|
7
|
-
removed: ReadonlySet<BlockId>;
|
|
8
|
-
changed: ReadonlySet<BlockId>;
|
|
9
|
-
orderChanged: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare function coraxTreeDiffing(prev: CoraxTree, next: CoraxTree): TreeDiff;
|