@flexiui/svelte-rich-text 0.0.52 → 0.0.53
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/RichText.svelte +66 -64
- package/dist/RichText.svelte.d.ts +46 -2
- package/dist/renderRichText.d.ts +1 -2
- package/dist/types.d.ts +6 -0
- package/package.json +1 -1
package/dist/RichText.svelte
CHANGED
|
@@ -1,67 +1,69 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
Mathematics,
|
|
4
|
-
migrateMathStrings,
|
|
5
|
-
} from "@tiptap/extension-mathematics";
|
|
6
|
-
|
|
7
|
-
import { HEADINGS, rgbToHex } from "./utils";
|
|
8
|
-
import "./styles.css";
|
|
9
|
-
import "katex/dist/katex.min.css";
|
|
10
|
-
|
|
11
|
-
import { onMount, onDestroy } from "svelte";
|
|
12
|
-
import type { Readable } from "svelte/store";
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
createEditor,
|
|
16
|
-
Editor,
|
|
17
|
-
EditorContent,
|
|
18
|
-
BubbleMenu,
|
|
19
|
-
} from "svelte-tiptap";
|
|
20
|
-
|
|
21
|
-
import { computePosition, offset, autoUpdate } from "@floating-ui/dom";
|
|
22
|
-
import { getRichTextExtensions } from "./getExtensions";
|
|
23
|
-
import { CellSelection } from "prosemirror-tables";
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
id?: string;
|
|
27
|
-
className?: string;
|
|
28
|
-
editable?: boolean;
|
|
29
|
-
content?: string | {type: string, content: any[]} | null;
|
|
30
|
-
customExtensions?: any[];
|
|
31
|
-
editorEvents?: {
|
|
32
|
-
onTransaction?: (params: any) => void;
|
|
33
|
-
onBeforeCreate?: (params: any) => void;
|
|
34
|
-
onCreate?: (params: any) => void;
|
|
35
|
-
onUpdate: (params: any) => void;
|
|
36
|
-
onFocus?: (params: any) => void;
|
|
37
|
-
onBlur?: (params: any) => void;
|
|
38
|
-
onDestroy?: (params: any) => void;
|
|
39
|
-
onDrop?: (params: any) => void;
|
|
40
|
-
onDelete?: (params: any) => void;
|
|
41
|
-
onContentError?: (params: any) => void;
|
|
42
|
-
onSelectionUpdate?: (params: any) => void;
|
|
43
|
-
onPaste?: (params: any) => void;
|
|
44
|
-
};
|
|
45
|
-
config?: {
|
|
46
|
-
editorAccentColor?: string;
|
|
47
|
-
editorBgColor?: string;
|
|
48
|
-
editorRadius?: string;
|
|
49
|
-
toolbarStickyPosition?: number;
|
|
50
|
-
toolbarZIndex?: number;
|
|
51
|
-
toolbarBgColor?: string;
|
|
52
|
-
toolbarTextColor?: string;
|
|
53
|
-
toolbarPadding?: string;
|
|
54
|
-
toolbarGap?: string;
|
|
55
|
-
docMaxWidth?: string;
|
|
56
|
-
docPadding?: string;
|
|
57
|
-
docBg?: string;
|
|
58
|
-
docMarginInline?: string;
|
|
59
|
-
docMarginBlock?: string;
|
|
60
|
-
docRadius?: string;
|
|
61
|
-
docTextColor?: string;
|
|
62
|
-
buttonStyle?: "accent-soft" | "accent-solid";
|
|
63
|
-
};
|
|
64
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Mathematics,
|
|
4
|
+
migrateMathStrings,
|
|
5
|
+
} from "@tiptap/extension-mathematics";
|
|
6
|
+
|
|
7
|
+
import { HEADINGS, rgbToHex } from "./utils";
|
|
8
|
+
import "./styles.css";
|
|
9
|
+
import "katex/dist/katex.min.css";
|
|
10
|
+
|
|
11
|
+
import { onMount, onDestroy } from "svelte";
|
|
12
|
+
import type { Readable } from "svelte/store";
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
createEditor,
|
|
16
|
+
Editor,
|
|
17
|
+
EditorContent,
|
|
18
|
+
BubbleMenu,
|
|
19
|
+
} from "svelte-tiptap";
|
|
20
|
+
|
|
21
|
+
import { computePosition, offset, autoUpdate } from "@floating-ui/dom";
|
|
22
|
+
import { getRichTextExtensions } from "./getExtensions";
|
|
23
|
+
import { CellSelection } from "prosemirror-tables";
|
|
24
|
+
|
|
25
|
+
export interface Props {
|
|
26
|
+
id?: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
editable?: boolean;
|
|
29
|
+
content?: string | {type: string, content: any[]} | null;
|
|
30
|
+
customExtensions?: any[];
|
|
31
|
+
editorEvents?: {
|
|
32
|
+
onTransaction?: (params: any) => void;
|
|
33
|
+
onBeforeCreate?: (params: any) => void;
|
|
34
|
+
onCreate?: (params: any) => void;
|
|
35
|
+
onUpdate: (params: any) => void;
|
|
36
|
+
onFocus?: (params: any) => void;
|
|
37
|
+
onBlur?: (params: any) => void;
|
|
38
|
+
onDestroy?: (params: any) => void;
|
|
39
|
+
onDrop?: (params: any) => void;
|
|
40
|
+
onDelete?: (params: any) => void;
|
|
41
|
+
onContentError?: (params: any) => void;
|
|
42
|
+
onSelectionUpdate?: (params: any) => void;
|
|
43
|
+
onPaste?: (params: any) => void;
|
|
44
|
+
};
|
|
45
|
+
config?: {
|
|
46
|
+
editorAccentColor?: string;
|
|
47
|
+
editorBgColor?: string;
|
|
48
|
+
editorRadius?: string;
|
|
49
|
+
toolbarStickyPosition?: number;
|
|
50
|
+
toolbarZIndex?: number;
|
|
51
|
+
toolbarBgColor?: string;
|
|
52
|
+
toolbarTextColor?: string;
|
|
53
|
+
toolbarPadding?: string;
|
|
54
|
+
toolbarGap?: string;
|
|
55
|
+
docMaxWidth?: string;
|
|
56
|
+
docPadding?: string;
|
|
57
|
+
docBg?: string;
|
|
58
|
+
docMarginInline?: string;
|
|
59
|
+
docMarginBlock?: string;
|
|
60
|
+
docRadius?: string;
|
|
61
|
+
docTextColor?: string;
|
|
62
|
+
buttonStyle?: "accent-soft" | "accent-solid";
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type RichTextProps = Props;
|
|
65
67
|
|
|
66
68
|
let {
|
|
67
69
|
id = "fl-rich-text-editor",
|
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
import "katex/dist/katex.min.css";
|
|
4
|
+
export interface Props {
|
|
5
|
+
id?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
content?: string | {
|
|
9
|
+
type: string;
|
|
10
|
+
content: any[];
|
|
11
|
+
} | null;
|
|
12
|
+
customExtensions?: any[];
|
|
13
|
+
editorEvents?: {
|
|
14
|
+
onTransaction?: (params: any) => void;
|
|
15
|
+
onBeforeCreate?: (params: any) => void;
|
|
16
|
+
onCreate?: (params: any) => void;
|
|
17
|
+
onUpdate: (params: any) => void;
|
|
18
|
+
onFocus?: (params: any) => void;
|
|
19
|
+
onBlur?: (params: any) => void;
|
|
20
|
+
onDestroy?: (params: any) => void;
|
|
21
|
+
onDrop?: (params: any) => void;
|
|
22
|
+
onDelete?: (params: any) => void;
|
|
23
|
+
onContentError?: (params: any) => void;
|
|
24
|
+
onSelectionUpdate?: (params: any) => void;
|
|
25
|
+
onPaste?: (params: any) => void;
|
|
26
|
+
};
|
|
27
|
+
config?: {
|
|
28
|
+
editorAccentColor?: string;
|
|
29
|
+
editorBgColor?: string;
|
|
30
|
+
editorRadius?: string;
|
|
31
|
+
toolbarStickyPosition?: number;
|
|
32
|
+
toolbarZIndex?: number;
|
|
33
|
+
toolbarBgColor?: string;
|
|
34
|
+
toolbarTextColor?: string;
|
|
35
|
+
toolbarPadding?: string;
|
|
36
|
+
toolbarGap?: string;
|
|
37
|
+
docMaxWidth?: string;
|
|
38
|
+
docPadding?: string;
|
|
39
|
+
docBg?: string;
|
|
40
|
+
docMarginInline?: string;
|
|
41
|
+
docMarginBlock?: string;
|
|
42
|
+
docRadius?: string;
|
|
43
|
+
docTextColor?: string;
|
|
44
|
+
buttonStyle?: "accent-soft" | "accent-solid";
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export type RichTextProps = Props;
|
|
4
48
|
declare const __propDef: {
|
|
5
49
|
props: Record<string, never>;
|
|
6
50
|
events: {
|
|
@@ -8,9 +52,9 @@ declare const __propDef: {
|
|
|
8
52
|
};
|
|
9
53
|
slots: {};
|
|
10
54
|
};
|
|
11
|
-
|
|
55
|
+
type RichTextProps_ = typeof __propDef.props;
|
|
12
56
|
export type RichTextEvents = typeof __propDef.events;
|
|
13
57
|
export type RichTextSlots = typeof __propDef.slots;
|
|
14
|
-
export default class RichText extends SvelteComponentTyped<
|
|
58
|
+
export default class RichText extends SvelteComponentTyped<RichTextProps_, RichTextEvents, RichTextSlots> {
|
|
15
59
|
}
|
|
16
60
|
export {};
|
package/dist/renderRichText.d.ts
CHANGED
package/dist/types.d.ts
ADDED