@webiny/lexical-editor 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.9bd236cf5e
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/commands/image.d.ts +6 -0
- package/commands/image.js +4 -0
- package/commands/image.js.map +1 -0
- package/commands/index.d.ts +5 -0
- package/commands/index.js +7 -0
- package/commands/index.js.map +1 -0
- package/commands/list.d.ts +7 -0
- package/commands/list.js +6 -0
- package/commands/list.js.map +1 -0
- package/commands/quote.d.ts +5 -0
- package/commands/quote.js +4 -0
- package/commands/quote.js.map +1 -0
- package/commands/toolbar.d.ts +1 -0
- package/commands/toolbar.js +4 -0
- package/commands/toolbar.js.map +1 -0
- package/commands/typography.d.ts +8 -0
- package/commands/typography.js +4 -0
- package/commands/typography.js.map +1 -0
- package/components/Editor/EnsureHeadingTagPlugin.d.ts +6 -0
- package/components/Editor/EnsureHeadingTagPlugin.js +20 -0
- package/components/Editor/EnsureHeadingTagPlugin.js.map +1 -0
- package/components/Editor/HeadingEditor.d.ts +2 -2
- package/components/Editor/HeadingEditor.js +20 -25
- package/components/Editor/HeadingEditor.js.map +1 -1
- package/components/Editor/ParagraphEditor.d.ts +2 -2
- package/components/Editor/ParagraphEditor.js +20 -25
- package/components/Editor/ParagraphEditor.js.map +1 -1
- package/components/Editor/RichTextEditor.d.ts +38 -21
- package/components/Editor/RichTextEditor.js +113 -139
- package/components/Editor/RichTextEditor.js.map +1 -1
- package/components/Editor/normalizeInputValue.d.ts +6 -0
- package/components/Editor/normalizeInputValue.js +16 -0
- package/components/Editor/normalizeInputValue.js.map +1 -0
- package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +8 -8
- package/components/LexicalEditorConfig/LexicalEditorConfig.js +42 -52
- package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
- package/components/LexicalEditorConfig/components/Node.d.ts +2 -2
- package/components/LexicalEditorConfig/components/Node.js +19 -27
- package/components/LexicalEditorConfig/components/Node.js.map +1 -1
- package/components/LexicalEditorConfig/components/Plugin.d.ts +1 -1
- package/components/LexicalEditorConfig/components/Plugin.js +19 -27
- package/components/LexicalEditorConfig/components/Plugin.js.map +1 -1
- package/components/LexicalEditorConfig/components/ToolbarElement.d.ts +1 -1
- package/components/LexicalEditorConfig/components/ToolbarElement.js +19 -27
- package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -1
- package/components/LexicalHtmlRenderer.d.ts +7 -9
- package/components/LexicalHtmlRenderer.js +44 -56
- package/components/LexicalHtmlRenderer.js.map +1 -1
- package/components/Toolbar/StaticToolbar.css +1 -1
- package/components/Toolbar/StaticToolbar.d.ts +3 -1
- package/components/Toolbar/StaticToolbar.js +21 -100
- package/components/Toolbar/StaticToolbar.js.map +1 -1
- package/components/Toolbar/Toolbar.css +72 -75
- package/components/Toolbar/Toolbar.d.ts +1 -2
- package/components/Toolbar/Toolbar.js +87 -142
- package/components/Toolbar/Toolbar.js.map +1 -1
- package/components/ToolbarActions/BoldAction.d.ts +2 -2
- package/components/ToolbarActions/BoldAction.js +20 -38
- package/components/ToolbarActions/BoldAction.js.map +1 -1
- package/components/ToolbarActions/BulletListAction.d.ts +2 -2
- package/components/ToolbarActions/BulletListAction.js +29 -45
- package/components/ToolbarActions/BulletListAction.js.map +1 -1
- package/components/ToolbarActions/CodeHighlightAction.d.ts +2 -2
- package/components/ToolbarActions/CodeHighlightAction.js +20 -38
- package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
- package/components/ToolbarActions/FontColorAction.d.ts +22 -4
- package/components/ToolbarActions/FontColorAction.js +40 -73
- package/components/ToolbarActions/FontColorAction.js.map +1 -1
- package/components/ToolbarActions/FontSizeAction.d.ts +14 -2
- package/components/ToolbarActions/FontSizeAction.js +70 -80
- package/components/ToolbarActions/FontSizeAction.js.map +1 -1
- package/components/ToolbarActions/ImageAction.d.ts +2 -2
- package/components/ToolbarActions/ImageAction.js +25 -41
- package/components/ToolbarActions/ImageAction.js.map +1 -1
- package/components/ToolbarActions/ItalicAction.d.ts +2 -2
- package/components/ToolbarActions/ItalicAction.js +20 -38
- package/components/ToolbarActions/ItalicAction.js.map +1 -1
- package/components/ToolbarActions/LinkAction.d.ts +2 -2
- package/components/ToolbarActions/LinkAction.js +27 -54
- package/components/ToolbarActions/LinkAction.js.map +1 -1
- package/components/ToolbarActions/NumberedListAction.d.ts +2 -2
- package/components/ToolbarActions/NumberedListAction.js +30 -52
- package/components/ToolbarActions/NumberedListAction.js.map +1 -1
- package/components/ToolbarActions/QuoteAction.d.ts +2 -2
- package/components/ToolbarActions/QuoteAction.js +25 -44
- package/components/ToolbarActions/QuoteAction.js.map +1 -1
- package/components/ToolbarActions/TextAlignmentAction.d.ts +22 -4
- package/components/ToolbarActions/TextAlignmentAction.js +44 -53
- package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
- package/components/ToolbarActions/TypographyAction.d.ts +22 -4
- package/components/ToolbarActions/TypographyAction.js +69 -106
- package/components/ToolbarActions/TypographyAction.js.map +1 -1
- package/components/ToolbarActions/UnderlineAction.d.ts +2 -2
- package/components/ToolbarActions/UnderlineAction.js +20 -39
- package/components/ToolbarActions/UnderlineAction.js.map +1 -1
- package/context/FontColorActionContext.js +3 -9
- package/context/FontColorActionContext.js.map +1 -1
- package/context/RichTextEditorContext.d.ts +9 -18
- package/context/RichTextEditorContext.js +17 -70
- package/context/RichTextEditorContext.js.map +1 -1
- package/context/SharedHistoryContext.d.ts +3 -4
- package/context/SharedHistoryContext.js +14 -21
- package/context/SharedHistoryContext.js.map +1 -1
- package/context/TextAlignmentActionContextProps.d.ts +1 -1
- package/context/TextAlignmentActionContextProps.js +3 -9
- package/context/TextAlignmentActionContextProps.js.map +1 -1
- package/context/TypographyActionContext.d.ts +3 -2
- package/context/TypographyActionContext.js +3 -9
- package/context/TypographyActionContext.js.map +1 -1
- package/hooks/index.d.ts +8 -0
- package/hooks/index.js +10 -0
- package/hooks/index.js.map +1 -0
- package/hooks/useCurrentElement.d.ts +7 -0
- package/hooks/useCurrentElement.js +27 -0
- package/hooks/useCurrentElement.js.map +1 -0
- package/hooks/useCurrentSelection.d.ts +13 -0
- package/hooks/useCurrentSelection.js +57 -0
- package/hooks/useCurrentSelection.js.map +1 -0
- package/hooks/useFontColorPicker.js +8 -12
- package/hooks/useFontColorPicker.js.map +1 -1
- package/hooks/useIsMounted.d.ts +1 -0
- package/hooks/useIsMounted.js +12 -0
- package/hooks/useIsMounted.js.map +1 -0
- package/hooks/useList.js +43 -32
- package/hooks/useList.js.map +1 -1
- package/hooks/useQuote.js +15 -18
- package/hooks/useQuote.js.map +1 -1
- package/hooks/useRichTextEditor.js +8 -12
- package/hooks/useRichTextEditor.js.map +1 -1
- package/hooks/useTextAlignmentAction.js +8 -12
- package/hooks/useTextAlignmentAction.js.map +1 -1
- package/hooks/useTypographyAction.js +8 -12
- package/hooks/useTypographyAction.js.map +1 -1
- package/index.d.ts +5 -10
- package/index.js +49 -300
- package/index.js.map +1 -1
- package/package.json +21 -23
- package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +2 -2
- package/plugins/BlurEventPlugin/BlurEventPlugin.js +18 -26
- package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +12 -18
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/index.js +2 -15
- package/plugins/CodeHighlightPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.d.ts +16 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +158 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.d.ts +8 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js +62 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +60 -6
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +4 -4
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +12 -258
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +8 -0
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +104 -0
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +9 -0
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +34 -0
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/index.js +2 -15
- package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.d.ts +1 -0
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js +12 -0
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js.map +1 -0
- package/plugins/FontColorPlugin/FontColorPlugin.d.ts +1 -2
- package/plugins/FontColorPlugin/FontColorPlugin.js +21 -33
- package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
- package/plugins/FontColorPlugin/applyColorToNode.d.ts +3 -0
- package/plugins/FontColorPlugin/applyColorToNode.js +8 -0
- package/plugins/FontColorPlugin/applyColorToNode.js.map +1 -0
- package/plugins/FontColorPlugin/applyColorToSelection.d.ts +3 -0
- package/plugins/FontColorPlugin/applyColorToSelection.js +66 -0
- package/plugins/FontColorPlugin/applyColorToSelection.js.map +1 -0
- package/plugins/ImagesPlugin/ImagesPlugin.d.ts +2 -3
- package/plugins/ImagesPlugin/ImagesPlugin.js +63 -64
- package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
- package/plugins/LinkPlugin/LinkPlugin.d.ts +5 -0
- package/plugins/LinkPlugin/LinkPlugin.js +59 -0
- package/plugins/LinkPlugin/LinkPlugin.js.map +1 -0
- package/plugins/ListPLugin/ListPlugin.js +14 -22
- package/plugins/ListPLugin/ListPlugin.js.map +1 -1
- package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +18 -0
- package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -0
- package/plugins/StateHandlingPlugin.d.ts +8 -0
- package/plugins/StateHandlingPlugin.js +75 -0
- package/plugins/StateHandlingPlugin.js.map +1 -0
- package/plugins/TypographyPlugin/TypographyPlugin.d.ts +1 -2
- package/plugins/TypographyPlugin/TypographyPlugin.js +19 -27
- package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
- package/types.d.ts +8 -67
- package/types.js +8 -38
- package/types.js.map +1 -1
- package/ui/ContentEditable.js +10 -15
- package/ui/ContentEditable.js.map +1 -1
- package/ui/Divider.js +6 -11
- package/ui/Divider.js.map +1 -1
- package/ui/DropDown.d.ts +2 -3
- package/ui/DropDown.js +64 -88
- package/ui/DropDown.js.map +1 -1
- package/ui/ImageResizer.d.ts +0 -2
- package/ui/ImageResizer.js +87 -89
- package/ui/ImageResizer.js.map +1 -1
- package/ui/LinkPreview.js +25 -29
- package/ui/LinkPreview.js.map +1 -1
- package/ui/Placeholder.d.ts +1 -1
- package/ui/Placeholder.js +13 -17
- package/ui/Placeholder.js.map +1 -1
- package/ui/TextInput.d.ts +1 -1
- package/ui/TextInput.js +14 -19
- package/ui/TextInput.js.map +1 -1
- package/ui/ToolbarActionDialog.d.ts +2 -3
- package/ui/ToolbarActionDialog.js +25 -54
- package/ui/ToolbarActionDialog.js.map +1 -1
- package/utils/canUseDOM.js +2 -7
- package/utils/canUseDOM.js.map +1 -1
- package/utils/files.d.ts +1 -2
- package/utils/files.js +6 -47
- package/utils/files.js.map +1 -1
- package/utils/getDOMRangeRect.d.ts +0 -2
- package/utils/getDOMRangeRect.js +7 -11
- package/utils/getDOMRangeRect.js.map +1 -1
- package/utils/getSelectedNode.d.ts +1 -1
- package/utils/getSelectedNode.js +12 -17
- package/utils/getSelectedNode.js.map +1 -1
- package/utils/getTransparentImage.js +3 -8
- package/utils/getTransparentImage.js.map +1 -1
- package/utils/insertImage.d.ts +2 -0
- package/utils/insertImage.js +16 -0
- package/utils/insertImage.js.map +1 -0
- package/utils/isAnchorLink.d.ts +1 -0
- package/utils/isAnchorLink.js +5 -0
- package/utils/isAnchorLink.js.map +1 -0
- package/utils/isChildOfFloatingToolbar.d.ts +1 -0
- package/utils/isChildOfFloatingToolbar.js +12 -0
- package/utils/isChildOfFloatingToolbar.js.map +1 -0
- package/utils/isHTMLElement.d.ts +0 -2
- package/utils/isHTMLElement.js +4 -8
- package/utils/isHTMLElement.js.map +1 -1
- package/utils/isValidJSON.js +5 -10
- package/utils/isValidJSON.js.map +1 -1
- package/utils/isValidLexicalData.d.ts +4 -2
- package/utils/isValidLexicalData.js +18 -18
- package/utils/isValidLexicalData.js.map +1 -1
- package/utils/point.js +38 -66
- package/utils/point.js.map +1 -1
- package/utils/rect.d.ts +2 -4
- package/utils/rect.js +117 -156
- package/utils/rect.js.map +1 -1
- package/utils/sanitizeUrl.d.ts +0 -7
- package/utils/sanitizeUrl.js +10 -12
- package/utils/sanitizeUrl.js.map +1 -1
- package/utils/setFloatingElemPosition.d.ts +1 -3
- package/utils/setFloatingElemPosition.js +29 -39
- package/utils/setFloatingElemPosition.js.map +1 -1
- package/commands/insertFiles.d.ts +0 -14
- package/commands/insertFiles.js +0 -9
- package/commands/insertFiles.js.map +0 -1
- package/commands/webiny-list.d.ts +0 -7
- package/commands/webiny-list.js +0 -13
- package/commands/webiny-list.js.map +0 -1
- package/commands/webiny-quote.d.ts +0 -5
- package/commands/webiny-quote.js +0 -9
- package/commands/webiny-quote.js.map +0 -1
- package/components/ImageComponent.d.ts +0 -23
- package/components/ImageComponent.js +0 -252
- package/components/ImageComponent.js.map +0 -1
- package/nodes/FontColorNode.d.ts +0 -43
- package/nodes/FontColorNode.js +0 -127
- package/nodes/FontColorNode.js.map +0 -1
- package/nodes/HeadingNode.d.ts +0 -34
- package/nodes/HeadingNode.js +0 -192
- package/nodes/HeadingNode.js.map +0 -1
- package/nodes/ImageNode.d.ts +0 -50
- package/nodes/ImageNode.js +0 -217
- package/nodes/ImageNode.js.map +0 -1
- package/nodes/ListItemNode.d.ts +0 -46
- package/nodes/ListItemNode.js +0 -441
- package/nodes/ListItemNode.js.map +0 -1
- package/nodes/ListNode/formatList.d.ts +0 -12
- package/nodes/ListNode/formatList.js +0 -424
- package/nodes/ListNode/formatList.js.map +0 -1
- package/nodes/ListNode.d.ts +0 -42
- package/nodes/ListNode.js +0 -294
- package/nodes/ListNode.js.map +0 -1
- package/nodes/ParagraphNode.d.ts +0 -32
- package/nodes/ParagraphNode.js +0 -218
- package/nodes/ParagraphNode.js.map +0 -1
- package/nodes/QuoteNode.d.ts +0 -34
- package/nodes/QuoteNode.js +0 -225
- package/nodes/QuoteNode.js.map +0 -1
- package/nodes/TypographyElementNode.d.ts +0 -42
- package/nodes/TypographyElementNode.js +0 -155
- package/nodes/TypographyElementNode.js.map +0 -1
- package/nodes/imageNode.css +0 -43
- package/nodes/types.d.ts +0 -15
- package/nodes/types.js +0 -5
- package/nodes/types.js.map +0 -1
- package/nodes/webinyNodes.d.ts +0 -7
- package/nodes/webinyNodes.js +0 -46
- package/nodes/webinyNodes.js.map +0 -1
- package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.d.ts +0 -8
- package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js +0 -34
- package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js.map +0 -1
- package/plugins/LexicalUpdateStatePlugin/index.d.ts +0 -1
- package/plugins/LexicalUpdateStatePlugin/index.js +0 -16
- package/plugins/LexicalUpdateStatePlugin/index.js.map +0 -1
- package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js +0 -24
- package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js.map +0 -1
- package/themes/webinyLexicalTheme.css +0 -423
- package/themes/webinyLexicalTheme.d.ts +0 -9
- package/themes/webinyLexicalTheme.js +0 -90
- package/themes/webinyLexicalTheme.js.map +0 -1
- package/utils/findTypographyStyleByHtmlTag.d.ts +0 -8
- package/utils/findTypographyStyleByHtmlTag.js +0 -16
- package/utils/findTypographyStyleByHtmlTag.js.map +0 -1
- package/utils/generateInitialLexicalValue.d.ts +0 -5
- package/utils/generateInitialLexicalValue.js +0 -30
- package/utils/generateInitialLexicalValue.js.map +0 -1
- package/utils/getLexicalTextSelectionState.d.ts +0 -5
- package/utils/getLexicalTextSelectionState.js +0 -163
- package/utils/getLexicalTextSelectionState.js.map +0 -1
- package/utils/nodes/clearNodeFormating.d.ts +0 -2
- package/utils/nodes/clearNodeFormating.js +0 -28
- package/utils/nodes/clearNodeFormating.js.map +0 -1
- package/utils/nodes/formatToHeading.d.ts +0 -3
- package/utils/nodes/formatToHeading.js +0 -25
- package/utils/nodes/formatToHeading.js.map +0 -1
- package/utils/nodes/formatToParagraph.d.ts +0 -2
- package/utils/nodes/formatToParagraph.js +0 -20
- package/utils/nodes/formatToParagraph.js.map +0 -1
- package/utils/nodes/formatToQuote.d.ts +0 -2
- package/utils/nodes/formatToQuote.js +0 -25
- package/utils/nodes/formatToQuote.js.map +0 -1
- package/utils/nodes/insertImage.d.ts +0 -2
- package/utils/nodes/insertImage.js +0 -22
- package/utils/nodes/insertImage.js.map +0 -1
- package/utils/nodes/listNode.d.ts +0 -11
- package/utils/nodes/listNode.js +0 -107
- package/utils/nodes/listNode.js.map +0 -1
- package/utils/styleObjectToString.d.ts +0 -2
- package/utils/styleObjectToString.js +0 -22
- package/utils/styleObjectToString.js.map +0 -1
- package/utils/toTypographyEmotionMap.d.ts +0 -3
- package/utils/toTypographyEmotionMap.js +0 -36
- package/utils/toTypographyEmotionMap.js.map +0 -1
- /package/plugins/{WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.d.ts → QuoteNodePlugin/QuoteNodePlugin.d.ts} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LexicalCommand, NodeKey } from "lexical";
|
|
2
|
+
import type { ImageNodeProps } from "@webiny/lexical-nodes";
|
|
3
|
+
export interface ImagePayload extends ImageNodeProps {
|
|
4
|
+
key?: NodeKey;
|
|
5
|
+
}
|
|
6
|
+
export declare const INSERT_IMAGE_COMMAND: LexicalCommand<ImagePayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createCommand","INSERT_IMAGE_COMMAND"],"sources":["image.ts"],"sourcesContent":["import type { LexicalCommand, NodeKey } from \"lexical\";\nimport { createCommand } from \"lexical\";\nimport type { ImageNodeProps } from \"@webiny/lexical-nodes\";\n\nexport interface ImagePayload extends ImageNodeProps {\n key?: NodeKey;\n}\n\nexport const INSERT_IMAGE_COMMAND: LexicalCommand<ImagePayload> =\n createCommand(\"INSERT_IMAGE_COMMAND\");\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,SAAS;AAOvC,OAAO,MAAMC,oBAAkD,GAC3DD,aAAa,CAAC,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"~/commands/typography\";\nexport * from \"~/commands/image\";\nexport * from \"~/commands/list\";\nexport * from \"~/commands/quote\";\nexport * from \"~/commands/toolbar\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LexicalCommand } from "lexical";
|
|
2
|
+
export type ListCommandPayload = {
|
|
3
|
+
themeStyleId?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<ListCommandPayload>;
|
|
6
|
+
export declare const INSERT_ORDERED_LIST_COMMAND: LexicalCommand<ListCommandPayload>;
|
|
7
|
+
export declare const REMOVE_LIST_COMMAND: LexicalCommand<void>;
|
package/commands/list.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createCommand } from "lexical";
|
|
2
|
+
export const INSERT_UNORDERED_LIST_COMMAND = createCommand("INSERT_UNORDERED_LIST_COMMAND");
|
|
3
|
+
export const INSERT_ORDERED_LIST_COMMAND = createCommand("INSERT_ORDERED_LIST_COMMAND");
|
|
4
|
+
export const REMOVE_LIST_COMMAND = createCommand("REMOVE_LIST_COMMAND");
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createCommand","INSERT_UNORDERED_LIST_COMMAND","INSERT_ORDERED_LIST_COMMAND","REMOVE_LIST_COMMAND"],"sources":["list.ts"],"sourcesContent":["import type { LexicalCommand } from \"lexical\";\nimport { createCommand } from \"lexical\";\n\nexport type ListCommandPayload = {\n themeStyleId?: string;\n};\n\nexport const INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<ListCommandPayload> = createCommand(\n \"INSERT_UNORDERED_LIST_COMMAND\"\n);\n\nexport const INSERT_ORDERED_LIST_COMMAND: LexicalCommand<ListCommandPayload> = createCommand(\n \"INSERT_ORDERED_LIST_COMMAND\"\n);\n\nexport const REMOVE_LIST_COMMAND: LexicalCommand<void> = createCommand(\"REMOVE_LIST_COMMAND\");\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,SAAS;AAMvC,OAAO,MAAMC,6BAAiE,GAAGD,aAAa,CAC1F,+BACJ,CAAC;AAED,OAAO,MAAME,2BAA+D,GAAGF,aAAa,CACxF,6BACJ,CAAC;AAED,OAAO,MAAMG,mBAAyC,GAAGH,aAAa,CAAC,qBAAqB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createCommand","INSERT_QUOTE_COMMAND"],"sources":["quote.ts"],"sourcesContent":["import type { LexicalCommand } from \"lexical\";\nimport { createCommand } from \"lexical\";\n\nexport type QuoteCommandPayload = {\n themeStyleId: string;\n};\n\nexport const INSERT_QUOTE_COMMAND: LexicalCommand<QuoteCommandPayload> =\n createCommand(\"INSERT_QUOTE_COMMAND\");\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,SAAS;AAMvC,OAAO,MAAMC,oBAAyD,GAClED,aAAa,CAAC,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HIDE_FLOATING_TOOLBAR: import("lexical").LexicalCommand<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createCommand","HIDE_FLOATING_TOOLBAR"],"sources":["toolbar.ts"],"sourcesContent":["import { createCommand } from \"lexical\";\n\nexport const HIDE_FLOATING_TOOLBAR = createCommand(\"HIDE_FLOATING_TOOLBAR_COMMAND\");\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,SAAS;AAEvC,OAAO,MAAMC,qBAAqB,GAAGD,aAAa,CAAC,+BAA+B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LexicalCommand, LexicalEditor, NodeKey } from "lexical";
|
|
2
|
+
import type { TypographyValue } from "@webiny/lexical-theme";
|
|
3
|
+
export declare const ADD_TYPOGRAPHY_COMMAND: LexicalCommand<TypographyPayload>;
|
|
4
|
+
export interface TypographyPayload {
|
|
5
|
+
value: TypographyValue;
|
|
6
|
+
caption?: LexicalEditor;
|
|
7
|
+
key?: NodeKey;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createCommand","ADD_TYPOGRAPHY_COMMAND"],"sources":["typography.ts"],"sourcesContent":["import type { LexicalCommand, LexicalEditor, NodeKey } from \"lexical\";\nimport { createCommand } from \"lexical\";\nimport type { TypographyValue } from \"@webiny/lexical-theme\";\n\nexport const ADD_TYPOGRAPHY_COMMAND: LexicalCommand<TypographyPayload> =\n createCommand(\"ADD_TYPOGRAPHY_COMMAND\");\n\nexport interface TypographyPayload {\n value: TypographyValue;\n caption?: LexicalEditor;\n key?: NodeKey;\n}\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,SAAS;AAGvC,OAAO,MAAMC,sBAAyD,GAClED,aAAa,CAAC,wBAAwB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In the "Heading" editor, we only want to support heading tags.
|
|
3
|
+
* However, when the editor is empty, and you start typing, Lexical automatically creates an empty "paragraph" node.
|
|
4
|
+
* This ensures that any paragraph node is automatically converted to a heading node.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EnsureHeadingTagPlugin: () => null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { ParagraphNode, $createHeadingNode } from "@webiny/lexical-nodes";
|
|
3
|
+
import { useRichTextEditor } from "../../hooks";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* In the "Heading" editor, we only want to support heading tags.
|
|
7
|
+
* However, when the editor is empty, and you start typing, Lexical automatically creates an empty "paragraph" node.
|
|
8
|
+
* This ensures that any paragraph node is automatically converted to a heading node.
|
|
9
|
+
*/
|
|
10
|
+
export const EnsureHeadingTagPlugin = () => {
|
|
11
|
+
const {
|
|
12
|
+
editor
|
|
13
|
+
} = useRichTextEditor();
|
|
14
|
+
useEffect(() => editor.registerNodeTransform(ParagraphNode, node => {
|
|
15
|
+
node.replace($createHeadingNode("h1"), true);
|
|
16
|
+
}), []);
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=EnsureHeadingTagPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","ParagraphNode","$createHeadingNode","useRichTextEditor","EnsureHeadingTagPlugin","editor","registerNodeTransform","node","replace"],"sources":["EnsureHeadingTagPlugin.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { ParagraphNode, $createHeadingNode } from \"@webiny/lexical-nodes\";\nimport { useRichTextEditor } from \"~/hooks\";\n\n/**\n * In the \"Heading\" editor, we only want to support heading tags.\n * However, when the editor is empty, and you start typing, Lexical automatically creates an empty \"paragraph\" node.\n * This ensures that any paragraph node is automatically converted to a heading node.\n */\nexport const EnsureHeadingTagPlugin = () => {\n const { editor } = useRichTextEditor();\n\n useEffect(\n () =>\n editor.registerNodeTransform(ParagraphNode, node => {\n node.replace($createHeadingNode(\"h1\"), true);\n }),\n []\n );\n return null;\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,uBAAuB;AACzE,SAASC,iBAAiB;;AAE1B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EACxC,MAAM;IAAEC;EAAO,CAAC,GAAGF,iBAAiB,CAAC,CAAC;EAEtCH,SAAS,CACL,MACIK,MAAM,CAACC,qBAAqB,CAACL,aAAa,EAAEM,IAAI,IAAI;IAChDA,IAAI,CAACC,OAAO,CAACN,kBAAkB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;EAChD,CAAC,CAAC,EACN,EACJ,CAAC;EACD,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { RichTextEditorProps } from "./RichTextEditor";
|
|
2
|
+
import type { RichTextEditorProps } from "./RichTextEditor";
|
|
3
3
|
interface HeadingEditorProps extends RichTextEditorProps {
|
|
4
4
|
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
5
|
}
|
|
6
|
-
export declare const HeadingEditor: React.
|
|
6
|
+
export declare const HeadingEditor: ({ tag, placeholder, ...rest }: HeadingEditorProps) => React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(_RichTextEditor.RichTextEditor, Object.assign({
|
|
18
|
-
toolbar: /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, null),
|
|
19
|
-
tag: tag !== null && tag !== void 0 ? tag : "h1",
|
|
20
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "Enter your heading text here..."
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { RichTextEditor } from "./RichTextEditor";
|
|
3
|
+
import { Toolbar } from "../Toolbar/Toolbar";
|
|
4
|
+
import { EnsureHeadingTagPlugin } from "./EnsureHeadingTagPlugin";
|
|
5
|
+
const styles = {
|
|
6
|
+
padding: 5
|
|
7
|
+
};
|
|
8
|
+
export const HeadingEditor = ({
|
|
9
|
+
tag,
|
|
10
|
+
placeholder,
|
|
11
|
+
...rest
|
|
12
|
+
}) => {
|
|
13
|
+
return /*#__PURE__*/React.createElement(RichTextEditor, Object.assign({
|
|
14
|
+
toolbar: /*#__PURE__*/React.createElement(Toolbar, null),
|
|
15
|
+
tag: tag ?? "h1",
|
|
16
|
+
placeholder: placeholder ?? "Enter your heading text here..."
|
|
21
17
|
}, rest, {
|
|
22
|
-
styles:
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}), rest === null || rest === void 0 ? void 0 : rest.children);
|
|
18
|
+
styles: styles
|
|
19
|
+
}), /*#__PURE__*/React.createElement(EnsureHeadingTagPlugin, null), rest?.children);
|
|
26
20
|
};
|
|
27
|
-
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=HeadingEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HeadingEditor","tag","placeholder","rest","
|
|
1
|
+
{"version":3,"names":["React","RichTextEditor","Toolbar","EnsureHeadingTagPlugin","styles","padding","HeadingEditor","tag","placeholder","rest","createElement","Object","assign","toolbar","children"],"sources":["HeadingEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport type { RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { RichTextEditor } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\nimport { EnsureHeadingTagPlugin } from \"~/components/Editor/EnsureHeadingTagPlugin\";\n\ninterface HeadingEditorProps extends RichTextEditorProps {\n tag?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n}\n\nconst styles = { padding: 5 };\n\nexport const HeadingEditor = ({ tag, placeholder, ...rest }: HeadingEditorProps) => {\n return (\n <RichTextEditor\n toolbar={<Toolbar />}\n tag={tag ?? \"h1\"}\n placeholder={placeholder ?? \"Enter your heading text here...\"}\n {...rest}\n styles={styles}\n >\n <EnsureHeadingTagPlugin />\n {rest?.children}\n </RichTextEditor>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc;AACvB,SAASC,OAAO;AAChB,SAASC,sBAAsB;AAM/B,MAAMC,MAAM,GAAG;EAAEC,OAAO,EAAE;AAAE,CAAC;AAE7B,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAAEC,GAAG;EAAEC,WAAW;EAAE,GAAGC;AAAyB,CAAC,KAAK;EAChF,oBACIT,KAAA,CAAAU,aAAA,CAACT,cAAc,EAAAU,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEb,KAAA,CAAAU,aAAA,CAACR,OAAO,MAAE,CAAE;IACrBK,GAAG,EAAEA,GAAG,IAAI,IAAK;IACjBC,WAAW,EAAEA,WAAW,IAAI;EAAkC,GAC1DC,IAAI;IACRL,MAAM,EAAEA;EAAO,iBAEfJ,KAAA,CAAAU,aAAA,CAACP,sBAAsB,MAAE,CAAC,EACzBM,IAAI,EAAEK,QACK,CAAC;AAEzB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { RichTextEditorProps } from "./RichTextEditor";
|
|
2
|
+
import type { RichTextEditorProps } from "./RichTextEditor";
|
|
3
3
|
interface ParagraphLexicalEditorProps extends RichTextEditorProps {
|
|
4
4
|
tag?: "p";
|
|
5
5
|
}
|
|
6
|
-
declare const ParagraphEditor: React.
|
|
6
|
+
declare const ParagraphEditor: ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => React.JSX.Element;
|
|
7
7
|
export { ParagraphEditor };
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(_RichTextEditor.RichTextEditor, Object.assign({
|
|
18
|
-
toolbar: /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, null),
|
|
19
|
-
tag: tag !== null && tag !== void 0 ? tag : "p",
|
|
20
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "Enter your text here..."
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { RichTextEditor } from "./RichTextEditor";
|
|
3
|
+
import { Toolbar } from "../Toolbar/Toolbar";
|
|
4
|
+
const styles = {
|
|
5
|
+
padding: 5
|
|
6
|
+
};
|
|
7
|
+
const ParagraphEditor = ({
|
|
8
|
+
placeholder,
|
|
9
|
+
tag,
|
|
10
|
+
...rest
|
|
11
|
+
}) => {
|
|
12
|
+
return /*#__PURE__*/React.createElement(RichTextEditor, Object.assign({
|
|
13
|
+
toolbar: /*#__PURE__*/React.createElement(Toolbar, null),
|
|
14
|
+
tag: tag ?? "p",
|
|
15
|
+
placeholder: placeholder ?? "Enter your text here..."
|
|
21
16
|
}, rest, {
|
|
22
|
-
styles:
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}), rest === null || rest === void 0 ? void 0 : rest.children);
|
|
17
|
+
styles: styles
|
|
18
|
+
}), rest?.children);
|
|
26
19
|
};
|
|
27
|
-
|
|
20
|
+
export { ParagraphEditor };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=ParagraphEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ParagraphEditor","placeholder","tag","rest","
|
|
1
|
+
{"version":3,"names":["React","RichTextEditor","Toolbar","styles","padding","ParagraphEditor","placeholder","tag","rest","createElement","Object","assign","toolbar","children"],"sources":["ParagraphEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport type { RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { RichTextEditor } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\n\ninterface ParagraphLexicalEditorProps extends RichTextEditorProps {\n tag?: \"p\";\n}\n\nconst styles = { padding: 5 };\n\nconst ParagraphEditor = ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => {\n return (\n <RichTextEditor\n toolbar={<Toolbar />}\n tag={tag ?? \"p\"}\n placeholder={placeholder ?? \"Enter your text here...\"}\n {...rest}\n styles={styles}\n >\n {rest?.children}\n </RichTextEditor>\n );\n};\n\nexport { ParagraphEditor };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc;AACvB,SAASC,OAAO;AAMhB,MAAMC,MAAM,GAAG;EAAEC,OAAO,EAAE;AAAE,CAAC;AAE7B,MAAMC,eAAe,GAAGA,CAAC;EAAEC,WAAW;EAAEC,GAAG;EAAE,GAAGC;AAAkC,CAAC,KAAK;EACpF,oBACIR,KAAA,CAAAS,aAAA,CAACR,cAAc,EAAAS,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEZ,KAAA,CAAAS,aAAA,CAACP,OAAO,MAAE,CAAE;IACrBK,GAAG,EAAEA,GAAG,IAAI,GAAI;IAChBD,WAAW,EAAEA,WAAW,IAAI;EAA0B,GAClDE,IAAI;IACRL,MAAM,EAAEA;EAAO,IAEdK,IAAI,EAAEK,QACK,CAAC;AAEzB,CAAC;AAED,SAASR,eAAe","ignoreList":[]}
|
|
@@ -1,32 +1,49 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { Klass, LexicalNode } from "lexical";
|
|
4
|
-
import {
|
|
2
|
+
import type { CSSObject } from "@emotion/react";
|
|
3
|
+
import type { Klass, LexicalNode } from "lexical";
|
|
4
|
+
import type { EditorTheme, ThemeEmotionMap } from "@webiny/lexical-theme";
|
|
5
|
+
import type { LexicalValue, ToolbarActionPlugin } from "../../types";
|
|
5
6
|
export interface RichTextEditorProps {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
tag?: string;
|
|
10
|
-
onChange?: (json: LexicalValue) => void;
|
|
11
|
-
value: LexicalValue | null;
|
|
7
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
8
|
+
classes?: string;
|
|
9
|
+
contentEditableStyles?: React.CSSProperties;
|
|
12
10
|
focus?: boolean;
|
|
13
|
-
|
|
11
|
+
height?: number | string;
|
|
14
12
|
nodes?: Klass<LexicalNode>[];
|
|
15
|
-
/**
|
|
16
|
-
* @description Lexical plugins
|
|
17
|
-
*/
|
|
18
|
-
children?: React.ReactNode | React.ReactNode[];
|
|
19
13
|
onBlur?: (editorState: LexicalValue) => void;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
theme: WebinyTheme;
|
|
23
|
-
themeEmotionMap?: ThemeEmotionMap;
|
|
14
|
+
onChange?: (json: LexicalValue) => void;
|
|
15
|
+
placeholder?: string;
|
|
24
16
|
placeholderStyles?: React.CSSProperties;
|
|
17
|
+
staticToolbar?: React.ReactNode;
|
|
25
18
|
styles?: React.CSSProperties;
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
tag?: string;
|
|
20
|
+
theme: EditorTheme;
|
|
21
|
+
themeEmotionMap?: ThemeEmotionMap;
|
|
22
|
+
toolbarActionPlugins?: ToolbarActionPlugin[];
|
|
23
|
+
themeStylesTransformer?: (cssObject: Record<string, any>) => CSSObject;
|
|
24
|
+
toolbar?: React.ReactNode;
|
|
25
|
+
value: LexicalValue | null | undefined;
|
|
26
|
+
width?: number | string;
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* @description Main editor container
|
|
31
30
|
*/
|
|
32
|
-
export declare const RichTextEditor:
|
|
31
|
+
export declare const RichTextEditor: ((props: RichTextEditorProps) => React.JSX.Element) & {
|
|
32
|
+
original: (props: RichTextEditorProps) => React.JSX.Element;
|
|
33
|
+
originalName: string;
|
|
34
|
+
displayName: string;
|
|
35
|
+
} & {
|
|
36
|
+
original: ((props: RichTextEditorProps) => React.JSX.Element) & {
|
|
37
|
+
original: (props: RichTextEditorProps) => React.JSX.Element;
|
|
38
|
+
originalName: string;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
originalName: string;
|
|
42
|
+
displayName: string;
|
|
43
|
+
} & {
|
|
44
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: RichTextEditorProps) => React.JSX.Element) & {
|
|
45
|
+
original: (props: RichTextEditorProps) => React.JSX.Element;
|
|
46
|
+
originalName: string;
|
|
47
|
+
displayName: string;
|
|
48
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
49
|
+
};
|