@lexical/rich-text 0.11.0 → 0.11.2
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/LexicalRichText.dev.js +21 -13
- package/LexicalRichText.prod.js +24 -25
- package/index.d.ts +3 -3
- package/package.json +5 -5
package/LexicalRichText.dev.js
CHANGED
|
@@ -346,12 +346,16 @@ function isGoogleDocsTitle(domNode) {
|
|
|
346
346
|
return false;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
function convertHeadingElement(
|
|
350
|
-
const nodeName =
|
|
349
|
+
function convertHeadingElement(element) {
|
|
350
|
+
const nodeName = element.nodeName.toLowerCase();
|
|
351
351
|
let node = null;
|
|
352
352
|
|
|
353
353
|
if (nodeName === 'h1' || nodeName === 'h2' || nodeName === 'h3' || nodeName === 'h4' || nodeName === 'h5' || nodeName === 'h6') {
|
|
354
354
|
node = $createHeadingNode(nodeName);
|
|
355
|
+
|
|
356
|
+
if (element.style !== null) {
|
|
357
|
+
node.setFormat(element.style.textAlign);
|
|
358
|
+
}
|
|
355
359
|
}
|
|
356
360
|
|
|
357
361
|
return {
|
|
@@ -359,8 +363,13 @@ function convertHeadingElement(domNode) {
|
|
|
359
363
|
};
|
|
360
364
|
}
|
|
361
365
|
|
|
362
|
-
function convertBlockquoteElement() {
|
|
366
|
+
function convertBlockquoteElement(element) {
|
|
363
367
|
const node = $createQuoteNode();
|
|
368
|
+
|
|
369
|
+
if (element.style !== null) {
|
|
370
|
+
node.setFormat(element.style.textAlign);
|
|
371
|
+
}
|
|
372
|
+
|
|
364
373
|
return {
|
|
365
374
|
node
|
|
366
375
|
};
|
|
@@ -388,7 +397,7 @@ function onPasteForRichText(event, editor) {
|
|
|
388
397
|
}
|
|
389
398
|
|
|
390
399
|
async function onCutForRichText(event, editor) {
|
|
391
|
-
await clipboard.copyToClipboard(editor, event
|
|
400
|
+
await clipboard.copyToClipboard(editor, utils.objectKlassEquals(event, ClipboardEvent) ? event : null);
|
|
392
401
|
editor.update(() => {
|
|
393
402
|
const selection = lexical.$getSelection();
|
|
394
403
|
|
|
@@ -555,8 +564,11 @@ function registerRichText(editor) {
|
|
|
555
564
|
const nodes = selection.getNodes();
|
|
556
565
|
|
|
557
566
|
for (const node of nodes) {
|
|
558
|
-
const element = utils.$
|
|
559
|
-
|
|
567
|
+
const element = utils.$findMatchingParent(node, parentNode => lexical.$isElementNode(parentNode) && !parentNode.isInline());
|
|
568
|
+
|
|
569
|
+
if (element !== null) {
|
|
570
|
+
element.setFormat(format);
|
|
571
|
+
}
|
|
560
572
|
}
|
|
561
573
|
|
|
562
574
|
return true;
|
|
@@ -609,14 +621,10 @@ function registerRichText(editor) {
|
|
|
609
621
|
} else if (lexical.$isRangeSelection(selection)) {
|
|
610
622
|
const possibleNode = lexical.$getAdjacentNode(selection.focus, true);
|
|
611
623
|
|
|
612
|
-
if (lexical.$isDecoratorNode(possibleNode) && !possibleNode.isIsolated() && !possibleNode.isInline()) {
|
|
624
|
+
if (!event.shiftKey && lexical.$isDecoratorNode(possibleNode) && !possibleNode.isIsolated() && !possibleNode.isInline()) {
|
|
613
625
|
possibleNode.selectPrevious();
|
|
614
626
|
event.preventDefault();
|
|
615
627
|
return true;
|
|
616
|
-
} else if (lexical.$isElementNode(possibleNode) && !possibleNode.isInline() && !possibleNode.canBeEmpty()) {
|
|
617
|
-
possibleNode.select();
|
|
618
|
-
event.preventDefault();
|
|
619
|
-
return true;
|
|
620
628
|
}
|
|
621
629
|
}
|
|
622
630
|
|
|
@@ -641,7 +649,7 @@ function registerRichText(editor) {
|
|
|
641
649
|
|
|
642
650
|
const possibleNode = lexical.$getAdjacentNode(selection.focus, false);
|
|
643
651
|
|
|
644
|
-
if (lexical.$isDecoratorNode(possibleNode) && !possibleNode.isIsolated() && !possibleNode.isInline()) {
|
|
652
|
+
if (!event.shiftKey && lexical.$isDecoratorNode(possibleNode) && !possibleNode.isIsolated() && !possibleNode.isInline()) {
|
|
645
653
|
possibleNode.selectNext();
|
|
646
654
|
event.preventDefault();
|
|
647
655
|
return true;
|
|
@@ -858,7 +866,7 @@ function registerRichText(editor) {
|
|
|
858
866
|
|
|
859
867
|
return true;
|
|
860
868
|
}, lexical.COMMAND_PRIORITY_EDITOR), editor.registerCommand(lexical.COPY_COMMAND, event => {
|
|
861
|
-
clipboard.copyToClipboard(editor, event
|
|
869
|
+
clipboard.copyToClipboard(editor, utils.objectKlassEquals(event, ClipboardEvent) ? event : null);
|
|
862
870
|
return true;
|
|
863
871
|
}, lexical.COMMAND_PRIORITY_EDITOR), editor.registerCommand(lexical.CUT_COMMAND, event => {
|
|
864
872
|
onCutForRichText(event, editor);
|
package/LexicalRichText.prod.js
CHANGED
|
@@ -4,30 +4,29 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
'use strict';var c=require("@lexical/clipboard"),g=require("@lexical/selection"),h=require("@lexical/utils"),k=require("lexical");function l(a
|
|
7
|
+
'use strict';var c=require("@lexical/clipboard"),g=require("@lexical/selection"),h=require("@lexical/utils"),k=require("lexical");function l(b,a){return"undefined"!==typeof document.caretRangeFromPoint?(b=document.caretRangeFromPoint(b,a),null===b?null:{node:b.startContainer,offset:b.startOffset}):"undefined"!==document.caretPositionFromPoint?(b=document.caretPositionFromPoint(b,a),null===b?null:{node:b.offsetNode,offset:b.offset}):null}
|
|
8
8
|
let n="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,p=n&&"documentMode"in document?document.documentMode:null;n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);n&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
|
|
9
9
|
let q=n&&"InputEvent"in window&&!p?"getTargetRanges"in new window.InputEvent("input"):!1,r=n&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),t=n&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,u=n&&/^(?=.*Chrome).*/i.test(navigator.userAgent),v=n&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!u,w=k.createCommand("DRAG_DROP_PASTE_FILE");
|
|
10
|
-
class x extends k.ElementNode{static getType(){return"quote"}static clone(
|
|
11
|
-
|
|
12
|
-
class B extends k.ElementNode{static getType(){return"heading"}static clone(
|
|
13
|
-
priority:0}),h6:()=>({conversion:C,priority:0}),p:
|
|
14
|
-
return
|
|
15
|
-
function D(
|
|
16
|
-
function F(a
|
|
17
|
-
function
|
|
18
|
-
function I(
|
|
19
|
-
exports.$isQuoteNode=function(
|
|
20
|
-
exports.registerRichText=function(
|
|
21
|
-
|
|
22
|
-
(
|
|
23
|
-
d=d.getNodes();for(const e of d)h.$
|
|
24
|
-
()=>{k.$insertNodes([k.$createTabNode()]);return!0},k.COMMAND_PRIORITY_EDITOR),
|
|
25
|
-
k.$getAdjacentNode(d.focus,!0)
|
|
26
|
-
|
|
27
|
-
b.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
a
|
|
31
|
-
k.$
|
|
32
|
-
b.
|
|
33
|
-
(F(b,a),!0):!1},k.COMMAND_PRIORITY_EDITOR))}
|
|
10
|
+
class x extends k.ElementNode{static getType(){return"quote"}static clone(b){return new x(b.__key)}constructor(b){super(b)}createDOM(b){let a=document.createElement("blockquote");h.addClassNamesToElement(a,b.theme.quote);return a}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:y,priority:0})}}exportDOM(b){({element:b}=super.exportDOM(b));b&&this.isEmpty()&&b.append(document.createElement("br"));if(b){var a=this.getFormatType();b.style.textAlign=a;if(a=this.getDirection())b.dir=
|
|
11
|
+
a}return{element:b}}static importJSON(b){let a=z();a.setFormat(b.format);a.setIndent(b.indent);a.setDirection(b.direction);return a}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(b,a){b=k.$createParagraphNode();let d=this.getDirection();b.setDirection(d);this.insertAfter(b,a);return b}collapseAtStart(){let b=k.$createParagraphNode();this.getChildren().forEach(a=>b.append(a));this.replace(b);return!0}}function z(){return k.$applyNodeReplacement(new x)}
|
|
12
|
+
class B extends k.ElementNode{static getType(){return"heading"}static clone(b){return new B(b.__tag,b.__key)}constructor(b,a){super(a);this.__tag=b}getTag(){return this.__tag}createDOM(b){let a=this.__tag,d=document.createElement(a);b=b.theme.heading;void 0!==b&&h.addClassNamesToElement(d,b[a]);return d}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:C,priority:0}),h2:()=>({conversion:C,priority:0}),h3:()=>({conversion:C,priority:0}),h4:()=>({conversion:C,priority:0}),h5:()=>({conversion:C,
|
|
13
|
+
priority:0}),h6:()=>({conversion:C,priority:0}),p:b=>{b=b.firstChild;return null!==b&&D(b)?{conversion:()=>({node:null}),priority:3}:null},span:b=>D(b)?{conversion:()=>({node:E("h1")}),priority:3}:null}}exportDOM(b){({element:b}=super.exportDOM(b));b&&this.isEmpty()&&b.append(document.createElement("br"));if(b){var a=this.getFormatType();b.style.textAlign=a;if(a=this.getDirection())b.dir=a}return{element:b}}static importJSON(b){let a=E(b.tag);a.setFormat(b.format);a.setIndent(b.indent);a.setDirection(b.direction);
|
|
14
|
+
return a}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(b,a=!0){b=b?b.anchor.offset:0;b=0<b&&b<this.getTextContentSize()?E(this.getTag()):k.$createParagraphNode();let d=this.getDirection();b.setDirection(d);this.insertAfter(b,a);return b}collapseAtStart(){let b=this.isEmpty()?k.$createParagraphNode():E(this.getTag());this.getChildren().forEach(a=>b.append(a));this.replace(b);return!0}extractWithChild(){return!0}}
|
|
15
|
+
function D(b){return"span"===b.nodeName.toLowerCase()?"26pt"===b.style.fontSize:!1}function C(b){let a=b.nodeName.toLowerCase(),d=null;if("h1"===a||"h2"===a||"h3"===a||"h4"===a||"h5"===a||"h6"===a)d=E(a),null!==b.style&&d.setFormat(b.style.textAlign);return{node:d}}function y(b){let a=z();null!==b.style&&a.setFormat(b.style.textAlign);return{node:a}}function E(b){return k.$applyNodeReplacement(new B(b))}
|
|
16
|
+
function F(b,a){b.preventDefault();a.update(()=>{let d=k.$getSelection(),e=b instanceof InputEvent||b instanceof KeyboardEvent?null:b.clipboardData;null!=e&&(k.$isRangeSelection(d)||k.DEPRECATED_$isGridSelection(d))&&c.$insertDataTransferForRichText(e,d,a)},{tag:"paste"})}
|
|
17
|
+
async function G(b,a){await c.copyToClipboard(a,h.objectKlassEquals(b,ClipboardEvent)?b:null);a.update(()=>{let d=k.$getSelection();k.$isRangeSelection(d)?d.removeText():k.$isNodeSelection(d)&&d.getNodes().forEach(e=>e.remove())})}function H(b){let a=null;b instanceof DragEvent?a=b.dataTransfer:b instanceof ClipboardEvent&&(a=b.clipboardData);if(null===a)return[!1,[],!1];var d=a.types;b=d.includes("Files");d=d.includes("text/html")||d.includes("text/plain");return[b,Array.from(a.files),d]}
|
|
18
|
+
function I(b){var a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;let d=new Set;a=a.getNodes();for(let m=0;m<a.length;m++){var e=a[m],f=e.getKey();d.has(f)||(e=h.$getNearestBlockElementAncestorOrThrow(e),f=e.getKey(),e.canIndent()&&!d.has(f)&&(d.add(f),b(e)))}return 0<d.size}function J(b){b=k.$getNearestNodeFromDOMNode(b);return k.$isDecoratorNode(b)}exports.$createHeadingNode=E;exports.$createQuoteNode=z;exports.$isHeadingNode=function(b){return b instanceof B};
|
|
19
|
+
exports.$isQuoteNode=function(b){return b instanceof x};exports.DRAG_DROP_PASTE=w;exports.HeadingNode=B;exports.QuoteNode=x;exports.eventFiles=H;
|
|
20
|
+
exports.registerRichText=function(b){return h.mergeRegister(b.registerCommand(k.CLICK_COMMAND,()=>{const a=k.$getSelection();return k.$isNodeSelection(a)?(a.clear(),!0):!1},0),b.registerCommand(k.DELETE_CHARACTER_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteCharacter(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DELETE_WORD_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteWord(a);return!0},k.COMMAND_PRIORITY_EDITOR),
|
|
21
|
+
b.registerCommand(k.DELETE_LINE_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteLine(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CONTROLLED_TEXT_INSERTION_COMMAND,a=>{const d=k.$getSelection();if("string"===typeof a)k.$isRangeSelection(d)?d.insertText(a):k.DEPRECATED_$isGridSelection(d);else{if(!k.$isRangeSelection(d)&&!k.DEPRECATED_$isGridSelection(d))return!1;const e=a.dataTransfer;null!=e?c.$insertDataTransferForRichText(e,d,b):k.$isRangeSelection(d)&&
|
|
22
|
+
(a=a.data)&&d.insertText(a)}return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.REMOVE_TEXT_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;a.removeText();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.FORMAT_TEXT_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.formatText(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.FORMAT_ELEMENT_COMMAND,a=>{var d=k.$getSelection();if(!k.$isRangeSelection(d)&&!k.$isNodeSelection(d))return!1;
|
|
23
|
+
d=d.getNodes();for(const e of d)d=h.$findMatchingParent(e,f=>k.$isElementNode(f)&&!f.isInline()),null!==d&&d.setFormat(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_LINE_BREAK_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.insertLineBreak(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_PARAGRAPH_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;a.insertParagraph();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_TAB_COMMAND,
|
|
24
|
+
()=>{k.$insertNodes([k.$createTabNode()]);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INDENT_CONTENT_COMMAND,()=>I(a=>{const d=a.getIndent();a.setIndent(d+1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.OUTDENT_CONTENT_COMMAND,()=>I(a=>{const d=a.getIndent();0<d&&a.setIndent(d-1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ARROW_UP_COMMAND,a=>{var d=k.$getSelection();if(k.$isNodeSelection(d)&&!J(a.target)){if(a=d.getNodes(),0<a.length)return a[0].selectPrevious(),!0}else if(k.$isRangeSelection(d)&&
|
|
25
|
+
(d=k.$getAdjacentNode(d.focus,!0),!a.shiftKey&&k.$isDecoratorNode(d)&&!d.isIsolated()&&!d.isInline()))return d.selectPrevious(),a.preventDefault(),!0;return!1},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ARROW_DOWN_COMMAND,a=>{var d=k.$getSelection();if(k.$isNodeSelection(d)){if(a=d.getNodes(),0<a.length)return a[0].selectNext(0,0),!0}else if(k.$isRangeSelection(d)){let e=d.focus;if("root"===e.key&&e.offset===k.$getRoot().getChildrenSize())return a.preventDefault(),!0;d=k.$getAdjacentNode(d.focus,
|
|
26
|
+
!1);if(!a.shiftKey&&k.$isDecoratorNode(d)&&!d.isIsolated()&&!d.isInline())return d.selectNext(),a.preventDefault(),!0}return!1},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ARROW_LEFT_COMMAND,a=>{const d=k.$getSelection();if(k.$isNodeSelection(d)){var e=d.getNodes();if(0<e.length)return a.preventDefault(),e[0].selectPrevious(),!0}return k.$isRangeSelection(d)?g.$shouldOverrideDefaultCharacterSelection(d,!0)?(e=a.shiftKey,a.preventDefault(),g.$moveCharacter(d,e,!0),!0):!1:!1},k.COMMAND_PRIORITY_EDITOR),
|
|
27
|
+
b.registerCommand(k.KEY_ARROW_RIGHT_COMMAND,a=>{const d=k.$getSelection();if(k.$isNodeSelection(d)&&!J(a.target)){var e=d.getNodes();if(0<e.length)return a.preventDefault(),e[0].selectNext(0,0),!0}if(!k.$isRangeSelection(d))return!1;e=a.shiftKey;return g.$shouldOverrideDefaultCharacterSelection(d,!1)?(a.preventDefault(),g.$moveCharacter(d,e,!1),!0):!1},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_BACKSPACE_COMMAND,a=>{if(J(a.target))return!1;const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;
|
|
28
|
+
a.preventDefault();({anchor:a}=d);const e=a.getNode();return d.isCollapsed()&&0===a.offset&&!k.$isRootNode(e)&&0<h.$getNearestBlockElementAncestorOrThrow(e).getIndent()?b.dispatchCommand(k.OUTDENT_CONTENT_COMMAND,void 0):b.dispatchCommand(k.DELETE_CHARACTER_COMMAND,!0)},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_DELETE_COMMAND,a=>{if(J(a.target))return!1;const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;a.preventDefault();return b.dispatchCommand(k.DELETE_CHARACTER_COMMAND,!1)},
|
|
29
|
+
k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ENTER_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;if(null!==a){if((t||r||v)&&q)return!1;a.preventDefault();if(a.shiftKey)return b.dispatchCommand(k.INSERT_LINE_BREAK_COMMAND,!1)}return b.dispatchCommand(k.INSERT_PARAGRAPH_COMMAND,void 0)},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ESCAPE_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;b.blur();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DROP_COMMAND,
|
|
30
|
+
a=>{const [,d]=H(a);if(0<d.length){var e=l(a.clientX,a.clientY);if(null!==e){const {offset:m,node:K}=e;var f=k.$getNearestNodeFromDOMNode(K);if(null!==f){e=k.$createRangeSelection();if(k.$isTextNode(f))e.anchor.set(f.getKey(),m,"text"),e.focus.set(f.getKey(),m,"text");else{const A=f.getParentOrThrow().getKey();f=f.getIndexWithinParent()+1;e.anchor.set(A,f,"element");e.focus.set(A,f,"element")}e=k.$normalizeSelection__EXPERIMENTAL(e);k.$setSelection(e)}b.dispatchCommand(w,d)}a.preventDefault();return!0}a=
|
|
31
|
+
k.$getSelection();return k.$isRangeSelection(a)?!0:!1},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DRAGSTART_COMMAND,a=>{[a]=H(a);const d=k.$getSelection();return a&&!k.$isRangeSelection(d)?!1:!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DRAGOVER_COMMAND,a=>{var [d]=H(a);const e=k.$getSelection();if(d&&!k.$isRangeSelection(e))return!1;d=l(a.clientX,a.clientY);null!==d&&(d=k.$getNearestNodeFromDOMNode(d.node),k.$isDecoratorNode(d)&&a.preventDefault());return!0},k.COMMAND_PRIORITY_EDITOR),
|
|
32
|
+
b.registerCommand(k.COPY_COMMAND,a=>{c.copyToClipboard(b,h.objectKlassEquals(a,ClipboardEvent)?a:null);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CUT_COMMAND,a=>{G(a,b);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.PASTE_COMMAND,a=>{const [,d,e]=H(a);if(0<d.length&&!e)return b.dispatchCommand(w,d),!0;if(k.isSelectionCapturedInDecoratorInput(a.target))return!1;const f=k.$getSelection();return k.$isRangeSelection(f)||k.DEPRECATED_$isGridSelection(f)?(F(a,b),!0):!1},k.COMMAND_PRIORITY_EDITOR))}
|
package/index.d.ts
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { DOMConversionMap, DOMExportOutput, EditorConfig, LexicalCommand, LexicalEditor, LexicalNode, NodeKey, ParagraphNode, PasteCommandType, RangeSelection, SerializedElementNode, Spread } from 'lexical';
|
|
10
10
|
import { ElementNode } from 'lexical';
|
|
11
|
-
export
|
|
11
|
+
export type SerializedHeadingNode = Spread<{
|
|
12
12
|
tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
13
13
|
}, SerializedElementNode>;
|
|
14
14
|
export declare const DRAG_DROP_PASTE: LexicalCommand<Array<File>>;
|
|
15
|
-
export
|
|
15
|
+
export type SerializedQuoteNode = SerializedElementNode;
|
|
16
16
|
/** @noInheritDoc */
|
|
17
17
|
export declare class QuoteNode extends ElementNode {
|
|
18
18
|
static getType(): string;
|
|
@@ -29,7 +29,7 @@ export declare class QuoteNode extends ElementNode {
|
|
|
29
29
|
}
|
|
30
30
|
export declare function $createQuoteNode(): QuoteNode;
|
|
31
31
|
export declare function $isQuoteNode(node: LexicalNode | null | undefined): node is QuoteNode;
|
|
32
|
-
export
|
|
32
|
+
export type HeadingTagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
33
33
|
/** @noInheritDoc */
|
|
34
34
|
export declare class HeadingNode extends ElementNode {
|
|
35
35
|
/** @internal */
|
package/package.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"rich-text"
|
|
8
8
|
],
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"version": "0.11.
|
|
10
|
+
"version": "0.11.2",
|
|
11
11
|
"main": "LexicalRichText.js",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"lexical": "0.11.
|
|
14
|
-
"@lexical/selection": "0.11.
|
|
15
|
-
"@lexical/clipboard": "0.11.
|
|
16
|
-
"@lexical/utils": "0.11.
|
|
13
|
+
"lexical": "0.11.2",
|
|
14
|
+
"@lexical/selection": "0.11.2",
|
|
15
|
+
"@lexical/clipboard": "0.11.2",
|
|
16
|
+
"@lexical/utils": "0.11.2"
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|