edytor 0.0.6 → 0.0.8

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.
Files changed (107) hide show
  1. package/README.md +225 -5
  2. package/dist/block/block.svelte.d.ts +123 -0
  3. package/dist/block/block.svelte.js +430 -0
  4. package/dist/block/block.utils.d.ts +82 -0
  5. package/dist/block/block.utils.js +499 -0
  6. package/dist/block/content.svelte.d.ts +14 -0
  7. package/dist/block/content.svelte.js +40 -0
  8. package/dist/block/inlineBlock.svelte.d.ts +30 -0
  9. package/dist/block/inlineBlock.svelte.js +53 -0
  10. package/dist/components/Block.svelte +27 -0
  11. package/dist/components/Block.svelte.d.ts +7 -0
  12. package/dist/components/Content.svelte +44 -0
  13. package/dist/components/Content.svelte.d.ts +7 -0
  14. package/dist/components/Edytor.svelte +165 -0
  15. package/dist/components/Edytor.svelte.d.ts +33 -0
  16. package/dist/components/InlineBlock.svelte +17 -0
  17. package/dist/components/InlineBlock.svelte.d.ts +7 -0
  18. package/dist/components/Mark.svelte +38 -0
  19. package/dist/components/Mark.svelte.d.ts +11 -0
  20. package/dist/components/ReadonlyEditor.svelte +46 -0
  21. package/dist/components/ReadonlyEditor.svelte.d.ts +4 -0
  22. package/dist/components/Text.svelte +37 -0
  23. package/dist/components/Text.svelte.d.ts +7 -0
  24. package/dist/components/readonlyElements.svelte.d.ts +82 -0
  25. package/dist/components/readonlyElements.svelte.js +144 -0
  26. package/dist/constants.d.ts +4 -0
  27. package/dist/constants.js +4 -0
  28. package/dist/dnd.svelte.d.ts +17 -0
  29. package/dist/dnd.svelte.js +125 -0
  30. package/dist/edytor.svelte.d.ts +94 -0
  31. package/dist/edytor.svelte.js +262 -0
  32. package/dist/edytor.utils.d.ts +3 -0
  33. package/dist/edytor.utils.js +78 -0
  34. package/dist/events/onBeforeInput.d.ts +2 -2
  35. package/dist/events/onBeforeInput.js +338 -0
  36. package/dist/events/onKeyDown.d.ts +2 -69
  37. package/dist/events/onKeyDown.js +18 -0
  38. package/dist/hotkeys.d.ts +27 -0
  39. package/dist/hotkeys.js +282 -0
  40. package/dist/index.d.ts +1 -5
  41. package/dist/index.js +2 -8
  42. package/dist/localProvider.d.ts +82 -0
  43. package/dist/localProvider.js +267 -0
  44. package/dist/plugins/arrowMove/arrowMove.d.ts +2 -0
  45. package/dist/plugins/arrowMove/arrowMove.js +66 -0
  46. package/dist/plugins/code/CodePlugin.svelte +218 -0
  47. package/dist/plugins/code/CodePlugin.svelte.d.ts +23 -0
  48. package/dist/plugins/code/prism.css +141 -0
  49. package/dist/plugins/image/ImagePlugin.svelte +22 -0
  50. package/dist/plugins/image/ImagePlugin.svelte.d.ts +20 -0
  51. package/dist/plugins/mention/MentionPlugin.svelte +40 -0
  52. package/dist/plugins/mention/MentionPlugin.svelte.d.ts +20 -0
  53. package/dist/plugins/richtext/RichTextPlugin.svelte +241 -0
  54. package/dist/plugins/richtext/RichTextPlugin.svelte.d.ts +26 -0
  55. package/dist/plugins.d.ts +202 -0
  56. package/dist/plugins.js +19 -0
  57. package/dist/selection/selection.svelte.d.ts +68 -0
  58. package/dist/selection/selection.svelte.js +391 -0
  59. package/dist/selection/selection.utils.d.ts +14 -0
  60. package/dist/selection/selection.utils.js +153 -0
  61. package/dist/text/deltas.d.ts +11 -0
  62. package/dist/text/deltas.js +109 -0
  63. package/dist/text/text.svelte.d.ts +70 -0
  64. package/dist/text/text.svelte.js +119 -0
  65. package/dist/text/text.utils.d.ts +40 -0
  66. package/dist/text/text.utils.js +174 -0
  67. package/dist/utils/json.d.ts +32 -0
  68. package/dist/utils/json.js +2 -0
  69. package/dist/utils/jsx.d.ts +25 -0
  70. package/dist/utils/jsx.js +66 -0
  71. package/dist/utils/serialize.d.ts +1 -0
  72. package/dist/utils/serialize.js +1 -0
  73. package/dist/utils.d.ts +6 -0
  74. package/dist/utils.js +19 -0
  75. package/package.json +81 -33
  76. package/dist/edytor.cjs.development.js +0 -1763
  77. package/dist/edytor.cjs.development.js.map +0 -1
  78. package/dist/edytor.cjs.production.min.js +0 -2
  79. package/dist/edytor.cjs.production.min.js.map +0 -1
  80. package/dist/edytor.esm.js +0 -1692
  81. package/dist/edytor.esm.js.map +0 -1
  82. package/dist/events/index.d.ts +0 -3
  83. package/dist/events/onDrop.d.ts +0 -3
  84. package/dist/operations/deleteText.d.ts +0 -7
  85. package/dist/operations/formatText.d.ts +0 -20
  86. package/dist/operations/index.d.ts +0 -9
  87. package/dist/operations/insertText.d.ts +0 -5
  88. package/dist/operations/merge.d.ts +0 -3
  89. package/dist/operations/moveNode.d.ts +0 -12
  90. package/dist/operations/nestNode.d.ts +0 -2
  91. package/dist/operations/removeEmptyText.d.ts +0 -2
  92. package/dist/operations/splitLeaf.d.ts +0 -2
  93. package/dist/operations/splitNode.d.ts +0 -9
  94. package/dist/types.d.ts +0 -140
  95. package/dist/utils/common.d.ts +0 -17
  96. package/dist/utils/dropper.d.ts +0 -26
  97. package/dist/utils/index.d.ts +0 -6
  98. package/dist/utils/leaves.d.ts +0 -34
  99. package/dist/utils/nodes.d.ts +0 -14
  100. package/dist/utils/selection.d.ts +0 -51
  101. package/dist/utils/yClasses/EdytorDoc.d.ts +0 -16
  102. package/dist/utils/yClasses/index.d.ts +0 -3
  103. package/dist/utils/yClasses/yLeaf.d.ts +0 -7
  104. package/dist/utils/yClasses/yNode.d.ts +0 -12
  105. package/dist/yjs/index.d.ts +0 -1
  106. package/dist/yjs/wsProvider.d.ts +0 -1
  107. package/index.ts +0 -1
@@ -1,51 +0,0 @@
1
- import { Editor, Position, YLeaf } from "../types";
2
- import { YNode } from ".";
3
- export declare class EdytorSelection {
4
- editor: Editor;
5
- observers: ((selection: EdytorSelection) => void)[];
6
- container: HTMLDivElement;
7
- collaborationPosition: {
8
- node: string;
9
- leaf: string;
10
- offset: number;
11
- };
12
- start: Position;
13
- end: Position;
14
- selectedText: string;
15
- arePathsEquals: boolean;
16
- editorOffset: number;
17
- length: number;
18
- range?: Range;
19
- boundingRect?: DOMRect;
20
- edges: {
21
- startDocument: boolean;
22
- endDocument: boolean;
23
- startLeaf: boolean;
24
- startNode: boolean;
25
- endLeaf: boolean;
26
- endNode: boolean;
27
- };
28
- selection?: Selection;
29
- focused: boolean;
30
- type?: "multinodes" | "collapsed" | "singlenode" | "multileaves" | "notInDoc";
31
- constructor();
32
- init: (editor: Editor, container: any) => void;
33
- onFocus: () => void;
34
- onBlur: () => void;
35
- destroy: () => void;
36
- onSelection: (e: any) => void;
37
- observe: (observer: any) => void;
38
- unobserve: (observer: any) => void;
39
- getLeaf: (anchorNode: HTMLElement, current: "anchorNode" | "focusNode") => [YLeaf | undefined, YNode | undefined, number[], HTMLElement | undefined];
40
- getNodeBoundingRect: (node: YNode) => {
41
- nodeHtml: HTMLElement;
42
- };
43
- getRange: () => EdytorSelection;
44
- onChange: () => void;
45
- setPosition: (id: string, { offset, delta, end }: {
46
- offset?: number;
47
- delta?: number;
48
- end?: number;
49
- select?: boolean;
50
- }) => void;
51
- }
@@ -1,16 +0,0 @@
1
- import { Doc } from "yjs";
2
- import { YNode } from ".";
3
- export interface jsonLeaf extends Record<string, any> {
4
- text: string;
5
- data?: object;
6
- }
7
- export declare type jsonNode = {
8
- type: string;
9
- content?: jsonLeaf[];
10
- data?: object;
11
- children?: jsonNode[];
12
- };
13
- export declare const getChildren: ({ type, content, children, ...props }: jsonNode) => YNode;
14
- export declare class EdytorDoc extends Doc {
15
- }
16
- export declare const DocFromJson: (value: jsonNode[], initialDoc?: Doc) => Doc;
@@ -1,3 +0,0 @@
1
- export * from "./EdytorDoc";
2
- export * from "./yNode";
3
- export * from "./yLeaf";
@@ -1,7 +0,0 @@
1
- import { Map } from "yjs";
2
- export declare type YLeafProps = {
3
- data?: any;
4
- text?: string;
5
- id?: string;
6
- };
7
- export declare const createLeaf: (props?: YLeafProps) => Map<unknown>;
@@ -1,12 +0,0 @@
1
- import { Map } from "yjs";
2
- import { YArray, YMap } from "yjs/dist/src/internals";
3
- import { YLeaf } from "../../";
4
- export declare type YNodeProps = {
5
- data?: any;
6
- content?: YLeaf[] | YArray<YLeaf>;
7
- children?: YNode[] | YArray<YNode>;
8
- id?: string;
9
- };
10
- export declare const createNode: (type: string, props?: YNodeProps) => YMap<any>;
11
- export declare class YNode extends Map<any> {
12
- }
@@ -1 +0,0 @@
1
- export * from "./wsProvider";
@@ -1 +0,0 @@
1
- export declare const createWSProvider: (room?: any) => Promise<unknown>;
package/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src";