@elia-ori/editor 0.1.24 → 0.1.25

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.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { JSONContent, Node } from '@tiptap/core';
2
3
  import { NodeType } from '@tiptap/pm/model';
3
- import { Node } from '@tiptap/core';
4
4
 
5
5
  type UploadFunction = (file: File, onProgress?: (event: {
6
6
  progress: number;
@@ -56,7 +56,7 @@ declare module "@tiptap/react" {
56
56
  type ToolbarItem = 'undo-redo' | 'heading' | 'list' | 'blockquote' | 'code-block' | 'callout' | 'table' | 'format' | 'text-color' | 'highlight' | 'link' | 'superscript' | 'subscript' | 'align' | 'image';
57
57
  interface EliaEditorProps {
58
58
  content?: string;
59
- onChange?: (html: string) => void;
59
+ onChange?: (html: string, json: JSONContent) => void;
60
60
  placeholder?: string;
61
61
  toolbar?: ToolbarItem[];
62
62
  onImageUpload?: UploadFunction;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { JSONContent, Node } from '@tiptap/core';
2
3
  import { NodeType } from '@tiptap/pm/model';
3
- import { Node } from '@tiptap/core';
4
4
 
5
5
  type UploadFunction = (file: File, onProgress?: (event: {
6
6
  progress: number;
@@ -56,7 +56,7 @@ declare module "@tiptap/react" {
56
56
  type ToolbarItem = 'undo-redo' | 'heading' | 'list' | 'blockquote' | 'code-block' | 'callout' | 'table' | 'format' | 'text-color' | 'highlight' | 'link' | 'superscript' | 'subscript' | 'align' | 'image';
57
57
  interface EliaEditorProps {
58
58
  content?: string;
59
- onChange?: (html: string) => void;
59
+ onChange?: (html: string, json: JSONContent) => void;
60
60
  placeholder?: string;
61
61
  toolbar?: ToolbarItem[];
62
62
  onImageUpload?: UploadFunction;
package/dist/index.js CHANGED
@@ -6202,7 +6202,7 @@ function EliaEditor({
6202
6202
  const handleUpdate = useCallback30(
6203
6203
  ({ editor: editor2 }) => {
6204
6204
  isInternalUpdate.current = true;
6205
- onChange?.(editor2.getHTML());
6205
+ onChange?.(editor2.getHTML(), editor2.getJSON());
6206
6206
  },
6207
6207
  [onChange]
6208
6208
  );