@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.
@@ -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
- declare 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
- }
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
- export type RichTextProps = typeof __propDef.props;
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<RichTextProps, RichTextEvents, RichTextSlots> {
58
+ export default class RichText extends SvelteComponentTyped<RichTextProps_, RichTextEvents, RichTextSlots> {
15
59
  }
16
60
  export {};
@@ -1,7 +1,6 @@
1
- interface RenderOptions {
1
+ export interface RenderOptions {
2
2
  json: any;
3
3
  customExtensions?: any[];
4
4
  customNodeMapping?: any;
5
5
  }
6
6
  export declare function renderHTMLFromJSON({ json, customExtensions, customNodeMapping }: RenderOptions): string;
7
- export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="svelte" />
2
+ import type { Props } from './RichText.svelte';
3
+
4
+ declare module "*.svelte" {
5
+ interface $$Props extends Props {}
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexiui/svelte-rich-text",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "A lightweight and flexible rich text editor component for Svelte",
5
5
  "keywords": [
6
6
  "svelte",