@trafica/editor 1.0.37 → 1.0.38
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 +10 -15
- package/dist/index.d.ts +10 -15
- package/dist/index.js +125 -856
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +127 -858
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
type MarkType = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'link' | 'highlight' | 'font_size' | 'font_family' | 'text_color';
|
|
5
5
|
interface Mark {
|
|
@@ -386,20 +386,6 @@ 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
|
-
|
|
403
389
|
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' | '|';
|
|
404
390
|
/** Single flat array or nested arrays (nested = toolbar groups) */
|
|
405
391
|
type EditorToolbarConfig = EditorToolbarItem[] | EditorToolbarItem[][];
|
|
@@ -485,6 +471,15 @@ interface EditorProps {
|
|
|
485
471
|
onUploadImage?: (file: File) => Promise<string>;
|
|
486
472
|
}
|
|
487
473
|
|
|
474
|
+
/**
|
|
475
|
+
* Self-contained rich text editor.
|
|
476
|
+
*
|
|
477
|
+
* Manages its own EditorEngine — consumers do not need to create one.
|
|
478
|
+
* Supports controlled mode (value + onChange), uncontrolled mode (defaultValue),
|
|
479
|
+
* toolbar configuration, theme, plugins, and an imperative API via onReady / ref.
|
|
480
|
+
*/
|
|
481
|
+
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorAPI>>;
|
|
482
|
+
|
|
488
483
|
interface EditorCoreProps {
|
|
489
484
|
engine: EditorEngine;
|
|
490
485
|
placeholder?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
type MarkType = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'link' | 'highlight' | 'font_size' | 'font_family' | 'text_color';
|
|
5
5
|
interface Mark {
|
|
@@ -386,20 +386,6 @@ 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
|
-
|
|
403
389
|
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' | '|';
|
|
404
390
|
/** Single flat array or nested arrays (nested = toolbar groups) */
|
|
405
391
|
type EditorToolbarConfig = EditorToolbarItem[] | EditorToolbarItem[][];
|
|
@@ -485,6 +471,15 @@ interface EditorProps {
|
|
|
485
471
|
onUploadImage?: (file: File) => Promise<string>;
|
|
486
472
|
}
|
|
487
473
|
|
|
474
|
+
/**
|
|
475
|
+
* Self-contained rich text editor.
|
|
476
|
+
*
|
|
477
|
+
* Manages its own EditorEngine — consumers do not need to create one.
|
|
478
|
+
* Supports controlled mode (value + onChange), uncontrolled mode (defaultValue),
|
|
479
|
+
* toolbar configuration, theme, plugins, and an imperative API via onReady / ref.
|
|
480
|
+
*/
|
|
481
|
+
declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorAPI>>;
|
|
482
|
+
|
|
488
483
|
interface EditorCoreProps {
|
|
489
484
|
engine: EditorEngine;
|
|
490
485
|
placeholder?: string;
|