@trafica/editor 1.0.32 → 1.0.33
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.mts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +865 -159
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +867 -161
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
|
|
4
4
|
type MarkType = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'link' | 'highlight' | 'font_size' | 'font_family' | 'text_color';
|
|
5
5
|
interface Mark {
|
|
@@ -386,6 +386,20 @@ declare function getTextNodesBetween(doc: Document, from: NodePosition, to: Node
|
|
|
386
386
|
node: TextNode;
|
|
387
387
|
}>;
|
|
388
388
|
|
|
389
|
+
interface EditorProps$1 {
|
|
390
|
+
engine: EditorEngine;
|
|
391
|
+
placeholder?: string;
|
|
392
|
+
className?: string;
|
|
393
|
+
readOnly?: boolean;
|
|
394
|
+
onHTMLChange?: (html: string) => void;
|
|
395
|
+
onJSONChange?: (json: string) => void;
|
|
396
|
+
/** Called when Ctrl/Cmd+K is pressed — parent opens the link popup */
|
|
397
|
+
onOpenLinkPopup?: () => void;
|
|
398
|
+
/** Custom upload handler. Receives a File, returns the final URL. If omitted, blob URLs are used. */
|
|
399
|
+
onUploadImage?: (file: File) => Promise<string>;
|
|
400
|
+
}
|
|
401
|
+
declare function Editor({ engine, placeholder, className, readOnly, onHTMLChange, onJSONChange, onOpenLinkPopup, onUploadImage: _onUploadImage, }: EditorProps$1): react_jsx_runtime.JSX.Element;
|
|
402
|
+
|
|
389
403
|
type EditorToolbarItem = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'link' | 'highlight' | 'text-color' | 'background-color' | 'font-family' | 'font-size' | 'align' | 'heading' | 'blockquote' | 'bullet-list' | 'ordered-list' | 'check-list' | 'code-block' | 'horizontal-rule' | 'image' | 'table' | 'undo' | 'redo' | 'find-replace' | 'source' | 'special-chars' | '|';
|
|
390
404
|
/** Single flat array or nested arrays (nested = toolbar groups) */
|
|
391
405
|
type EditorToolbarConfig = EditorToolbarItem[] | EditorToolbarItem[][];
|
|
@@ -471,8 +485,6 @@ interface EditorProps {
|
|
|
471
485
|
onUploadImage?: (file: File) => Promise<string>;
|
|
472
486
|
}
|
|
473
487
|
|
|
474
|
-
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorAPI>>;
|
|
475
|
-
|
|
476
488
|
interface EditorCoreProps {
|
|
477
489
|
engine: EditorEngine;
|
|
478
490
|
placeholder?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
|
|
4
4
|
type MarkType = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'link' | 'highlight' | 'font_size' | 'font_family' | 'text_color';
|
|
5
5
|
interface Mark {
|
|
@@ -386,6 +386,20 @@ declare function getTextNodesBetween(doc: Document, from: NodePosition, to: Node
|
|
|
386
386
|
node: TextNode;
|
|
387
387
|
}>;
|
|
388
388
|
|
|
389
|
+
interface EditorProps$1 {
|
|
390
|
+
engine: EditorEngine;
|
|
391
|
+
placeholder?: string;
|
|
392
|
+
className?: string;
|
|
393
|
+
readOnly?: boolean;
|
|
394
|
+
onHTMLChange?: (html: string) => void;
|
|
395
|
+
onJSONChange?: (json: string) => void;
|
|
396
|
+
/** Called when Ctrl/Cmd+K is pressed — parent opens the link popup */
|
|
397
|
+
onOpenLinkPopup?: () => void;
|
|
398
|
+
/** Custom upload handler. Receives a File, returns the final URL. If omitted, blob URLs are used. */
|
|
399
|
+
onUploadImage?: (file: File) => Promise<string>;
|
|
400
|
+
}
|
|
401
|
+
declare function Editor({ engine, placeholder, className, readOnly, onHTMLChange, onJSONChange, onOpenLinkPopup, onUploadImage: _onUploadImage, }: EditorProps$1): react_jsx_runtime.JSX.Element;
|
|
402
|
+
|
|
389
403
|
type EditorToolbarItem = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'link' | 'highlight' | 'text-color' | 'background-color' | 'font-family' | 'font-size' | 'align' | 'heading' | 'blockquote' | 'bullet-list' | 'ordered-list' | 'check-list' | 'code-block' | 'horizontal-rule' | 'image' | 'table' | 'undo' | 'redo' | 'find-replace' | 'source' | 'special-chars' | '|';
|
|
390
404
|
/** Single flat array or nested arrays (nested = toolbar groups) */
|
|
391
405
|
type EditorToolbarConfig = EditorToolbarItem[] | EditorToolbarItem[][];
|
|
@@ -471,8 +485,6 @@ interface EditorProps {
|
|
|
471
485
|
onUploadImage?: (file: File) => Promise<string>;
|
|
472
486
|
}
|
|
473
487
|
|
|
474
|
-
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorAPI>>;
|
|
475
|
-
|
|
476
488
|
interface EditorCoreProps {
|
|
477
489
|
engine: EditorEngine;
|
|
478
490
|
placeholder?: string;
|