@webiny/lexical-editor 5.40.0-beta.2 → 5.40.0-beta.3
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.js +1 -2
- package/commands/image.js.map +1 -1
- package/commands/index.js.map +1 -1
- package/commands/list.js +3 -6
- package/commands/list.js.map +1 -1
- package/commands/quote.js +1 -2
- package/commands/quote.js.map +1 -1
- package/components/Editor/HeadingEditor.d.ts +2 -2
- package/components/Editor/HeadingEditor.js +1 -2
- package/components/Editor/HeadingEditor.js.map +1 -1
- package/components/Editor/ParagraphEditor.d.ts +2 -2
- package/components/Editor/ParagraphEditor.js +1 -2
- package/components/Editor/ParagraphEditor.js.map +1 -1
- package/components/Editor/RichTextEditor.d.ts +3 -2
- package/components/Editor/RichTextEditor.js +16 -32
- package/components/Editor/RichTextEditor.js.map +1 -1
- package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +5 -5
- package/components/LexicalEditorConfig/LexicalEditorConfig.js +2 -4
- package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
- package/components/LexicalEditorConfig/components/Node.d.ts +2 -2
- package/components/LexicalEditorConfig/components/Node.js +1 -2
- package/components/LexicalEditorConfig/components/Node.js.map +1 -1
- package/components/LexicalEditorConfig/components/Plugin.d.ts +1 -1
- package/components/LexicalEditorConfig/components/Plugin.js +1 -2
- package/components/LexicalEditorConfig/components/Plugin.js.map +1 -1
- package/components/LexicalEditorConfig/components/ToolbarElement.d.ts +1 -1
- package/components/LexicalEditorConfig/components/ToolbarElement.js +1 -2
- package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -1
- package/components/LexicalHtmlRenderer.d.ts +2 -6
- package/components/LexicalHtmlRenderer.js +13 -21
- package/components/LexicalHtmlRenderer.js.map +1 -1
- package/components/Toolbar/StaticToolbar.css +1 -1
- package/components/Toolbar/StaticToolbar.d.ts +2 -2
- package/components/Toolbar/StaticToolbar.js +4 -8
- package/components/Toolbar/StaticToolbar.js.map +1 -1
- package/components/Toolbar/Toolbar.css +73 -72
- package/components/Toolbar/Toolbar.js +19 -7
- package/components/Toolbar/Toolbar.js.map +1 -1
- package/components/ToolbarActions/BoldAction.d.ts +2 -2
- package/components/ToolbarActions/BoldAction.js +4 -7
- package/components/ToolbarActions/BoldAction.js.map +1 -1
- package/components/ToolbarActions/BulletListAction.d.ts +2 -2
- package/components/ToolbarActions/BulletListAction.js +6 -10
- package/components/ToolbarActions/BulletListAction.js.map +1 -1
- package/components/ToolbarActions/CodeHighlightAction.d.ts +2 -2
- package/components/ToolbarActions/CodeHighlightAction.js +4 -7
- package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
- package/components/ToolbarActions/FontColorAction.d.ts +2 -1
- package/components/ToolbarActions/FontColorAction.js +5 -10
- package/components/ToolbarActions/FontColorAction.js.map +1 -1
- package/components/ToolbarActions/FontSizeAction.d.ts +2 -2
- package/components/ToolbarActions/FontSizeAction.js +4 -6
- package/components/ToolbarActions/FontSizeAction.js.map +1 -1
- package/components/ToolbarActions/ImageAction.d.ts +2 -2
- package/components/ToolbarActions/ImageAction.js +2 -6
- package/components/ToolbarActions/ImageAction.js.map +1 -1
- package/components/ToolbarActions/ItalicAction.d.ts +2 -2
- package/components/ToolbarActions/ItalicAction.js +4 -7
- package/components/ToolbarActions/ItalicAction.js.map +1 -1
- package/components/ToolbarActions/LinkAction.d.ts +2 -2
- package/components/ToolbarActions/LinkAction.js +4 -8
- package/components/ToolbarActions/LinkAction.js.map +1 -1
- package/components/ToolbarActions/NumberedListAction.d.ts +2 -2
- package/components/ToolbarActions/NumberedListAction.js +2 -7
- package/components/ToolbarActions/NumberedListAction.js.map +1 -1
- package/components/ToolbarActions/QuoteAction.d.ts +2 -2
- package/components/ToolbarActions/QuoteAction.js +2 -7
- package/components/ToolbarActions/QuoteAction.js.map +1 -1
- package/components/ToolbarActions/TextAlignmentAction.d.ts +2 -1
- package/components/ToolbarActions/TextAlignmentAction.js +5 -10
- package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
- package/components/ToolbarActions/TypographyAction.d.ts +2 -1
- package/components/ToolbarActions/TypographyAction.js +3 -8
- package/components/ToolbarActions/TypographyAction.js.map +1 -1
- package/components/ToolbarActions/UnderlineAction.d.ts +2 -2
- package/components/ToolbarActions/UnderlineAction.js +5 -9
- package/components/ToolbarActions/UnderlineAction.js.map +1 -1
- package/context/FontColorActionContext.js +1 -2
- package/context/FontColorActionContext.js.map +1 -1
- package/context/RichTextEditorContext.d.ts +6 -11
- package/context/RichTextEditorContext.js +13 -39
- package/context/RichTextEditorContext.js.map +1 -1
- package/context/SharedHistoryContext.js +7 -8
- package/context/SharedHistoryContext.js.map +1 -1
- package/context/TextAlignmentActionContextProps.js +1 -2
- package/context/TextAlignmentActionContextProps.js.map +1 -1
- package/context/TypographyActionContext.js +1 -2
- package/context/TypographyActionContext.js.map +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +11 -0
- package/hooks/index.js.map +1 -1
- package/hooks/useCurrentElement.js.map +1 -1
- package/hooks/useCurrentSelection.js +5 -7
- package/hooks/useCurrentSelection.js.map +1 -1
- package/hooks/useFontColorPicker.js.map +1 -1
- package/hooks/useIsMounted.js.map +1 -1
- package/hooks/useList.js.map +1 -1
- package/hooks/useQuote.js.map +1 -1
- package/hooks/useRichTextEditor.js.map +1 -1
- package/hooks/useTextAlignmentAction.js.map +1 -1
- package/hooks/useTypographyAction.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +12 -10
- package/plugins/BlurEventPlugin/BlurEventPlugin.js +4 -8
- package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +3 -6
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +58 -5
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +14 -1
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +60 -141
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +9 -0
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +118 -0
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +9 -0
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +44 -0
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.d.ts +1 -0
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js +18 -0
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.d.ts +2 -0
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js +72 -0
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js.map +1 -0
- package/plugins/FontColorPlugin/FontColorPlugin.js +4 -8
- package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
- package/plugins/ImagesPlugin/ImagesPlugin.js +4 -7
- package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
- package/plugins/LexicalUpdateStatePlugin/UpdateStatePlugin.d.ts +1 -1
- package/plugins/LexicalUpdateStatePlugin/UpdateStatePlugin.js +5 -9
- package/plugins/LexicalUpdateStatePlugin/UpdateStatePlugin.js.map +1 -1
- package/plugins/LexicalUpdateStatePlugin/index.js.map +1 -1
- package/plugins/LinkPlugin/LinkPlugin.js +4 -6
- package/plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/plugins/ListPLugin/ListPlugin.js +5 -9
- package/plugins/ListPLugin/ListPlugin.js.map +1 -1
- package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +23 -0
- package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -0
- package/plugins/TypographyPlugin/TypographyPlugin.js +4 -8
- package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
- package/types.js.map +1 -1
- package/ui/ContentEditable.js.map +1 -1
- package/ui/Divider.js.map +1 -1
- package/ui/DropDown.d.ts +1 -1
- package/ui/DropDown.js +16 -15
- package/ui/DropDown.js.map +1 -1
- package/ui/ImageResizer.js +5 -4
- package/ui/ImageResizer.js.map +1 -1
- package/ui/LinkPreview.js +3 -2
- package/ui/LinkPreview.js.map +1 -1
- package/ui/Placeholder.js.map +1 -1
- package/ui/TextInput.js.map +1 -1
- package/ui/ToolbarActionDialog.d.ts +2 -3
- package/ui/ToolbarActionDialog.js +13 -32
- package/ui/ToolbarActionDialog.js.map +1 -1
- package/utils/canUseDOM.js +1 -2
- package/utils/canUseDOM.js.map +1 -1
- package/utils/files.js +2 -4
- package/utils/files.js.map +1 -1
- package/utils/generateInitialLexicalValue.js +1 -2
- package/utils/generateInitialLexicalValue.js.map +1 -1
- package/utils/getDOMRangeRect.js.map +1 -1
- package/utils/getSelectedNode.js.map +1 -1
- package/utils/getTransparentImage.js +1 -2
- package/utils/getTransparentImage.js.map +1 -1
- package/utils/insertImage.js +1 -2
- package/utils/insertImage.js.map +1 -1
- package/utils/isAnchorLink.d.ts +1 -0
- package/utils/isAnchorLink.js +11 -0
- package/utils/isAnchorLink.js.map +1 -0
- package/utils/isChildOfFloatingToolbar.d.ts +1 -0
- package/utils/isChildOfFloatingToolbar.js +18 -0
- package/utils/isChildOfFloatingToolbar.js.map +1 -0
- package/utils/isHTMLElement.js.map +1 -1
- package/utils/isValidJSON.js +1 -2
- package/utils/isValidJSON.js.map +1 -1
- package/utils/isValidLexicalData.js +2 -4
- package/utils/isValidLexicalData.js.map +1 -1
- package/utils/point.js +2 -4
- package/utils/point.js.map +1 -1
- package/utils/rect.js +2 -4
- package/utils/rect.js.map +1 -1
- package/utils/sanitizeUrl.js +3 -4
- package/utils/sanitizeUrl.js.map +1 -1
- package/utils/setFloatingElemPosition.js.map +1 -1
- package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js +0 -26
- package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js.map +0 -1
- package/utils/isUrlLinkReference.d.ts +0 -1
- package/utils/isUrlLinkReference.js +0 -12
- package/utils/isUrlLinkReference.js.map +0 -1
- /package/plugins/{WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.d.ts → QuoteNodePlugin/QuoteNodePlugin.d.ts} +0 -0
package/commands/image.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.INSERT_IMAGE_COMMAND = void 0;
|
|
7
7
|
var _lexical = require("lexical");
|
|
8
|
-
var INSERT_IMAGE_COMMAND = (0, _lexical.createCommand)("INSERT_IMAGE_COMMAND");
|
|
9
|
-
exports.INSERT_IMAGE_COMMAND = INSERT_IMAGE_COMMAND;
|
|
8
|
+
var INSERT_IMAGE_COMMAND = exports.INSERT_IMAGE_COMMAND = (0, _lexical.createCommand)("INSERT_IMAGE_COMMAND");
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=image.js.map
|
package/commands/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lexical","require","INSERT_IMAGE_COMMAND","
|
|
1
|
+
{"version":3,"names":["_lexical","require","INSERT_IMAGE_COMMAND","exports","createCommand"],"sources":["image.ts"],"sourcesContent":["import { createCommand, LexicalCommand, NodeKey } from \"lexical\";\nimport { 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":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAOO,IAAMC,oBAAkD,GAAAC,OAAA,CAAAD,oBAAA,GAC3D,IAAAE,sBAAa,EAAC,sBAAsB,CAAC","ignoreList":[]}
|
package/commands/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_image","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_list","_quote"],"sources":["index.ts"],"sourcesContent":["export * from \"~/commands/image\";\nexport * from \"~/commands/list\";\nexport * from \"~/commands/quote\";\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,KAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,KAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,KAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,KAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_image","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_list","_quote"],"sources":["index.ts"],"sourcesContent":["export * from \"~/commands/image\";\nexport * from \"~/commands/list\";\nexport * from \"~/commands/quote\";\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,KAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,KAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,KAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,KAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/commands/list.js
CHANGED
|
@@ -5,11 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.REMOVE_LIST_COMMAND = exports.INSERT_UNORDERED_LIST_COMMAND = exports.INSERT_ORDERED_LIST_COMMAND = void 0;
|
|
7
7
|
var _lexical = require("lexical");
|
|
8
|
-
var INSERT_UNORDERED_LIST_COMMAND = (0, _lexical.createCommand)("INSERT_UNORDERED_LIST_COMMAND");
|
|
9
|
-
exports.
|
|
10
|
-
var
|
|
11
|
-
exports.INSERT_ORDERED_LIST_COMMAND = INSERT_ORDERED_LIST_COMMAND;
|
|
12
|
-
var REMOVE_LIST_COMMAND = (0, _lexical.createCommand)("REMOVE_LIST_COMMAND");
|
|
13
|
-
exports.REMOVE_LIST_COMMAND = REMOVE_LIST_COMMAND;
|
|
8
|
+
var INSERT_UNORDERED_LIST_COMMAND = exports.INSERT_UNORDERED_LIST_COMMAND = (0, _lexical.createCommand)("INSERT_UNORDERED_LIST_COMMAND");
|
|
9
|
+
var INSERT_ORDERED_LIST_COMMAND = exports.INSERT_ORDERED_LIST_COMMAND = (0, _lexical.createCommand)("INSERT_ORDERED_LIST_COMMAND");
|
|
10
|
+
var REMOVE_LIST_COMMAND = exports.REMOVE_LIST_COMMAND = (0, _lexical.createCommand)("REMOVE_LIST_COMMAND");
|
|
14
11
|
|
|
15
12
|
//# sourceMappingURL=list.js.map
|
package/commands/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lexical","require","INSERT_UNORDERED_LIST_COMMAND","
|
|
1
|
+
{"version":3,"names":["_lexical","require","INSERT_UNORDERED_LIST_COMMAND","exports","createCommand","INSERT_ORDERED_LIST_COMMAND","REMOVE_LIST_COMMAND"],"sources":["list.ts"],"sourcesContent":["import { createCommand, LexicalCommand } 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":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAMO,IAAMC,6BAAiE,GAAAC,OAAA,CAAAD,6BAAA,GAAG,IAAAE,sBAAa,EAC1F,+BACJ,CAAC;AAEM,IAAMC,2BAA+D,GAAAF,OAAA,CAAAE,2BAAA,GAAG,IAAAD,sBAAa,EACxF,6BACJ,CAAC;AAEM,IAAME,mBAAyC,GAAAH,OAAA,CAAAG,mBAAA,GAAG,IAAAF,sBAAa,EAAC,qBAAqB,CAAC","ignoreList":[]}
|
package/commands/quote.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.INSERT_QUOTE_COMMAND = void 0;
|
|
7
7
|
var _lexical = require("lexical");
|
|
8
|
-
var INSERT_QUOTE_COMMAND = (0, _lexical.createCommand)("INSERT_QUOTE_COMMAND");
|
|
9
|
-
exports.INSERT_QUOTE_COMMAND = INSERT_QUOTE_COMMAND;
|
|
8
|
+
var INSERT_QUOTE_COMMAND = exports.INSERT_QUOTE_COMMAND = (0, _lexical.createCommand)("INSERT_QUOTE_COMMAND");
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=quote.js.map
|
package/commands/quote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lexical","require","INSERT_QUOTE_COMMAND","
|
|
1
|
+
{"version":3,"names":["_lexical","require","INSERT_QUOTE_COMMAND","exports","createCommand"],"sources":["quote.ts"],"sourcesContent":["import { createCommand, LexicalCommand } 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":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAMO,IAAMC,oBAAyD,GAAAC,OAAA,CAAAD,oBAAA,GAClE,IAAAE,sBAAa,EAAC,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { 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: ({ tag, placeholder, ...rest }: HeadingEditorProps) => JSX.Element;
|
|
6
|
+
export declare const HeadingEditor: ({ tag, placeholder, ...rest }: HeadingEditorProps) => React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -13,7 +13,7 @@ var _excluded = ["tag", "placeholder"];
|
|
|
13
13
|
var styles = {
|
|
14
14
|
padding: 5
|
|
15
15
|
};
|
|
16
|
-
var HeadingEditor = function HeadingEditor(_ref) {
|
|
16
|
+
var HeadingEditor = exports.HeadingEditor = function HeadingEditor(_ref) {
|
|
17
17
|
var tag = _ref.tag,
|
|
18
18
|
placeholder = _ref.placeholder,
|
|
19
19
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -25,6 +25,5 @@ var HeadingEditor = function HeadingEditor(_ref) {
|
|
|
25
25
|
styles: styles
|
|
26
26
|
}), rest?.children);
|
|
27
27
|
};
|
|
28
|
-
exports.HeadingEditor = HeadingEditor;
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=HeadingEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_RichTextEditor","_Toolbar","_excluded","styles","padding","HeadingEditor","_ref","tag","placeholder","rest","_objectWithoutProperties2","default","createElement","RichTextEditor","Object","assign","toolbar","Toolbar","children"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_RichTextEditor","_Toolbar","_excluded","styles","padding","HeadingEditor","exports","_ref","tag","placeholder","rest","_objectWithoutProperties2","default","createElement","RichTextEditor","Object","assign","toolbar","Toolbar","children"],"sources":["HeadingEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { RichTextEditor, RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\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 {rest?.children}\n </RichTextEditor>\n );\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAuD,IAAAG,SAAA;AAMvD,IAAMC,MAAM,GAAG;EAAEC,OAAO,EAAE;AAAE,CAAC;AAEtB,IAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAAhBA,aAAaA,CAAAE,IAAA,EAA0D;EAAA,IAApDC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAEC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAKC,IAAI,OAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,EAAAL,SAAA;EACrD,oBACIL,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACb,eAAA,CAAAc,cAAc,EAAAC,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEpB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACZ,QAAA,CAAAiB,OAAO,MAAE,CAAE;IACrBV,GAAG,EAAEA,GAAG,IAAI,IAAK;IACjBC,WAAW,EAAEA,WAAW,IAAI;EAAkC,GAC1DC,IAAI;IACRP,MAAM,EAAEA;EAAO,IAEdO,IAAI,EAAES,QACK,CAAC;AAEzB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { RichTextEditorProps } from "./RichTextEditor";
|
|
3
3
|
interface ParagraphLexicalEditorProps extends RichTextEditorProps {
|
|
4
4
|
tag?: "p";
|
|
5
5
|
}
|
|
6
|
-
declare const ParagraphEditor: ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => JSX.Element;
|
|
6
|
+
declare const ParagraphEditor: ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => React.JSX.Element;
|
|
7
7
|
export { ParagraphEditor };
|
|
@@ -13,7 +13,7 @@ var _excluded = ["placeholder", "tag"];
|
|
|
13
13
|
var styles = {
|
|
14
14
|
padding: 5
|
|
15
15
|
};
|
|
16
|
-
var ParagraphEditor = function ParagraphEditor(_ref) {
|
|
16
|
+
var ParagraphEditor = exports.ParagraphEditor = function ParagraphEditor(_ref) {
|
|
17
17
|
var placeholder = _ref.placeholder,
|
|
18
18
|
tag = _ref.tag,
|
|
19
19
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -25,6 +25,5 @@ var ParagraphEditor = function ParagraphEditor(_ref) {
|
|
|
25
25
|
styles: styles
|
|
26
26
|
}), rest?.children);
|
|
27
27
|
};
|
|
28
|
-
exports.ParagraphEditor = ParagraphEditor;
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=ParagraphEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_RichTextEditor","_Toolbar","_excluded","styles","padding","ParagraphEditor","_ref","placeholder","tag","rest","_objectWithoutProperties2","default","createElement","RichTextEditor","Object","assign","toolbar","Toolbar","children"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_RichTextEditor","_Toolbar","_excluded","styles","padding","ParagraphEditor","exports","_ref","placeholder","tag","rest","_objectWithoutProperties2","default","createElement","RichTextEditor","Object","assign","toolbar","Toolbar","children"],"sources":["ParagraphEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { RichTextEditor, RichTextEditorProps } 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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAuD,IAAAG,SAAA;AAMvD,IAAMC,MAAM,GAAG;EAAEC,OAAO,EAAE;AAAE,CAAC;AAE7B,IAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAAE,IAAA,EAAmE;EAAA,IAA7DC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IAAKC,IAAI,OAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,EAAAL,SAAA;EAChD,oBACIL,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACb,eAAA,CAAAc,cAAc,EAAAC,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEpB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACZ,QAAA,CAAAiB,OAAO,MAAE,CAAE;IACrBT,GAAG,EAAEA,GAAG,IAAI,GAAI;IAChBD,WAAW,EAAEA,WAAW,IAAI;EAA0B,GAClDE,IAAI;IACRP,MAAM,EAAEA;EAAO,IAEdO,IAAI,EAAES,QACK,CAAC;AAEzB,CAAC","ignoreList":[]}
|
|
@@ -19,9 +19,9 @@ export interface RichTextEditorProps {
|
|
|
19
19
|
tag?: string;
|
|
20
20
|
theme: WebinyTheme;
|
|
21
21
|
themeEmotionMap?: ThemeEmotionMap;
|
|
22
|
+
toolbarActionPlugins?: ToolbarActionPlugin[];
|
|
22
23
|
themeStylesTransformer?: (cssObject: Record<string, any>) => CSSObject;
|
|
23
24
|
toolbar?: React.ReactNode;
|
|
24
|
-
toolbarActionPlugins?: ToolbarActionPlugin[];
|
|
25
25
|
value: LexicalValue | null;
|
|
26
26
|
width?: number | string;
|
|
27
27
|
}
|
|
@@ -31,6 +31,7 @@ export interface RichTextEditorProps {
|
|
|
31
31
|
export declare const RichTextEditor: import("@webiny/react-composition").GenericComponent<RichTextEditorProps> & {
|
|
32
32
|
original: import("@webiny/react-composition").GenericComponent<RichTextEditorProps>;
|
|
33
33
|
originalName: string;
|
|
34
|
+
displayName: string;
|
|
34
35
|
} & {
|
|
35
|
-
createDecorator: (decorator: import("@webiny/react-composition").Decorator<(props: RichTextEditorProps) => JSX.Element | null>) => (props: unknown) => JSX.Element;
|
|
36
|
+
createDecorator: (decorator: import("@webiny/react-composition").Decorator<(props: RichTextEditorProps) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
|
|
36
37
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
@@ -9,8 +9,9 @@ exports.RichTextEditor = void 0;
|
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var
|
|
14
|
+
var _emotion = require("emotion");
|
|
14
15
|
var _LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
15
16
|
var _LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
16
17
|
var _LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlugin");
|
|
@@ -29,8 +30,8 @@ var _generateInitialLexicalValue = require("../../utils/generateInitialLexicalVa
|
|
|
29
30
|
var _lexicalTheme = require("@webiny/lexical-theme");
|
|
30
31
|
var _lexicalNodes = require("@webiny/lexical-nodes");
|
|
31
32
|
var _SharedHistoryContext = require("../../context/SharedHistoryContext");
|
|
32
|
-
var _useRichTextEditor2 = require("../../hooks/useRichTextEditor");
|
|
33
33
|
var _LexicalEditorConfig = require("../LexicalEditorConfig/LexicalEditorConfig");
|
|
34
|
+
var _excluded = ["toolbar", "staticToolbar", "onChange", "value", "nodes", "placeholder", "children", "onBlur", "focus", "styles", "width", "height", "contentEditableStyles", "placeholderStyles"];
|
|
34
35
|
var BaseRichTextEditor = function BaseRichTextEditor(_ref) {
|
|
35
36
|
var toolbar = _ref.toolbar,
|
|
36
37
|
staticToolbar = _ref.staticToolbar,
|
|
@@ -44,11 +45,10 @@ var BaseRichTextEditor = function BaseRichTextEditor(_ref) {
|
|
|
44
45
|
styles = _ref.styles,
|
|
45
46
|
width = _ref.width,
|
|
46
47
|
height = _ref.height,
|
|
47
|
-
theme = _ref.theme,
|
|
48
|
-
themeEmotionMap = _ref.themeEmotionMap,
|
|
49
|
-
toolbarActionPlugins = _ref.toolbarActionPlugins,
|
|
50
48
|
contentEditableStyles = _ref.contentEditableStyles,
|
|
51
|
-
placeholderStyles = _ref.placeholderStyles
|
|
49
|
+
placeholderStyles = _ref.placeholderStyles,
|
|
50
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
51
|
+
var themeEmotionMap = props.themeEmotionMap ?? (0, _lexicalTheme.toTypographyEmotionMap)(_emotion.css, props.theme, props.themeStylesTransformer);
|
|
52
52
|
var editorTheme = (0, _react.useRef)((0, _lexicalTheme.createTheme)());
|
|
53
53
|
var config = (0, _LexicalEditorConfig.useLexicalEditorConfig)();
|
|
54
54
|
var _useSharedHistoryCont = (0, _SharedHistoryContext.useSharedHistoryContext)(),
|
|
@@ -61,19 +61,6 @@ var BaseRichTextEditor = function BaseRichTextEditor(_ref) {
|
|
|
61
61
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
62
62
|
floatingAnchorElem = _useState2[0],
|
|
63
63
|
setFloatingAnchorElem = _useState2[1];
|
|
64
|
-
var _useRichTextEditor = (0, _useRichTextEditor2.useRichTextEditor)(),
|
|
65
|
-
setTheme = _useRichTextEditor.setTheme,
|
|
66
|
-
setThemeEmotionMap = _useRichTextEditor.setThemeEmotionMap,
|
|
67
|
-
setToolbarActionPlugins = _useRichTextEditor.setToolbarActionPlugins;
|
|
68
|
-
(0, _react.useEffect)(function () {
|
|
69
|
-
setTheme(theme);
|
|
70
|
-
setThemeEmotionMap(themeEmotionMap);
|
|
71
|
-
}, [themeEmotionMap, theme]);
|
|
72
|
-
(0, _react.useEffect)(function () {
|
|
73
|
-
if (toolbarActionPlugins) {
|
|
74
|
-
setToolbarActionPlugins(toolbarActionPlugins || []);
|
|
75
|
-
}
|
|
76
|
-
}, [toolbarActionPlugins]);
|
|
77
64
|
var onRef = function onRef(_floatingAnchorElem) {
|
|
78
65
|
if (_floatingAnchorElem !== null) {
|
|
79
66
|
setFloatingAnchorElem(_floatingAnchorElem);
|
|
@@ -122,10 +109,14 @@ var BaseRichTextEditor = function BaseRichTextEditor(_ref) {
|
|
|
122
109
|
*
|
|
123
110
|
* To bypass this issue, we generate a naive `key` based on the number of Nodes.
|
|
124
111
|
*/
|
|
125
|
-
_react.default.createElement(_LexicalComposer.LexicalComposer, {
|
|
112
|
+
_react.default.createElement(_SharedHistoryContext.SharedHistoryContext, null, /*#__PURE__*/_react.default.createElement(_LexicalComposer.LexicalComposer, {
|
|
126
113
|
initialConfig: initialConfig,
|
|
127
114
|
key: initialConfig.nodes.length
|
|
128
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_RichTextEditorContext.RichTextEditorProvider, {
|
|
116
|
+
theme: props.theme,
|
|
117
|
+
themeEmotionMap: themeEmotionMap,
|
|
118
|
+
toolbarActionPlugins: props.toolbarActionPlugins
|
|
119
|
+
}, staticToolbar && staticToolbar, /*#__PURE__*/_react.default.createElement("div", {
|
|
129
120
|
/* This className is necessary for targeting of editor container from CSS files. */
|
|
130
121
|
className: "editor-shell",
|
|
131
122
|
ref: scrollRef,
|
|
@@ -155,22 +146,15 @@ var BaseRichTextEditor = function BaseRichTextEditor(_ref) {
|
|
|
155
146
|
}))),
|
|
156
147
|
placeholder: placeholderElem,
|
|
157
148
|
ErrorBoundary: _LexicalErrorBoundary.default
|
|
158
|
-
}), floatingAnchorElem && toolbar)))
|
|
149
|
+
}), floatingAnchorElem && toolbar))))
|
|
159
150
|
);
|
|
160
151
|
};
|
|
161
152
|
|
|
162
153
|
/**
|
|
163
154
|
* @description Main editor container
|
|
164
155
|
*/
|
|
165
|
-
var RichTextEditor = (0, _reactComposition.makeDecoratable)("RichTextEditor", function (props) {
|
|
166
|
-
return /*#__PURE__*/_react.default.createElement(_LexicalEditorConfig.LexicalEditorWithConfig, null, /*#__PURE__*/_react.default.createElement(
|
|
167
|
-
var css = _ref2.css;
|
|
168
|
-
var themeEmotionMap = props?.themeEmotionMap ?? (0, _lexicalTheme.toTypographyEmotionMap)(css, props.theme, props.themeStylesTransformer);
|
|
169
|
-
return /*#__PURE__*/_react.default.createElement(_SharedHistoryContext.SharedHistoryContext, null, /*#__PURE__*/_react.default.createElement(BaseRichTextEditor, Object.assign({}, props, {
|
|
170
|
-
themeEmotionMap: themeEmotionMap
|
|
171
|
-
})));
|
|
172
|
-
})));
|
|
156
|
+
var RichTextEditor = exports.RichTextEditor = (0, _reactComposition.makeDecoratable)("RichTextEditor", function (props) {
|
|
157
|
+
return /*#__PURE__*/_react.default.createElement(_LexicalEditorConfig.LexicalEditorWithConfig, null, /*#__PURE__*/_react.default.createElement(BaseRichTextEditor, props));
|
|
173
158
|
});
|
|
174
|
-
exports.RichTextEditor = RichTextEditor;
|
|
175
159
|
|
|
176
160
|
//# sourceMappingURL=RichTextEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_react2","_LexicalComposer","_LexicalOnChangePlugin","_LexicalAutoFocusPlugin","_LexicalClearEditorPlugin","_LexicalRichTextPlugin","_LexicalErrorBoundary","_interopRequireDefault","_reactComposition","_LexicalHistoryPlugin","_LexicalContentEditable","_RichTextEditorContext","_isValidLexicalData","_LexicalUpdateStatePlugin","_BlurEventPlugin","_Placeholder","_generateInitialLexicalValue","_lexicalTheme","_lexicalNodes","_SharedHistoryContext","_useRichTextEditor2","_LexicalEditorConfig","BaseRichTextEditor","_ref","toolbar","staticToolbar","onChange","value","nodes","placeholder","children","onBlur","focus","styles","width","height","theme","themeEmotionMap","toolbarActionPlugins","contentEditableStyles","placeholderStyles","editorTheme","useRef","createTheme","config","useLexicalEditorConfig","_useSharedHistoryCont","useSharedHistoryContext","historyState","placeholderElem","default","createElement","Placeholder","scrollRef","_useState","useState","undefined","_useState2","_slicedToArray2","floatingAnchorElem","setFloatingAnchorElem","_useRichTextEditor","useRichTextEditor","setTheme","setThemeEmotionMap","setToolbarActionPlugins","useEffect","onRef","_floatingAnchorElem","sizeStyle","configNodes","map","node","configPlugins","plugins","plugin","Fragment","key","name","element","editorValue","isValidLexicalData","generateInitialLexicalValue","initialConfig","editorState","namespace","onError","concat","_toConsumableArray2","allNodes","_objectSpread2","current","emotionMap","handleOnChange","editor","read","getEditorState","JSON","stringify","toJSON","LexicalComposer","length","className","ref","style","overflow","position","OnChangePlugin","UpdateStatePlugin","ClearEditorPlugin","HistoryPlugin","externalHistoryState","BlurEventPlugin","AutoFocusPlugin","RichTextPlugin","contentEditable","ContentEditable","outline","ErrorBoundary","LexicalErrorBoundary","RichTextEditor","makeDecoratable","props","LexicalEditorWithConfig","RichTextEditorProvider","ClassNames","_ref2","css","toTypographyEmotionMap","themeStylesTransformer","SharedHistoryContext","Object","assign","exports"],"sources":["RichTextEditor.tsx"],"sourcesContent":["import React, { Fragment, useEffect, useRef, useState } from \"react\";\nimport { ClassNames, CSSObject } from \"@emotion/react\";\nimport { Klass, LexicalEditor, LexicalNode } from \"lexical\";\nimport { EditorState } from \"lexical/LexicalEditorState\";\nimport { LexicalComposer } from \"@lexical/react/LexicalComposer\";\nimport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\nimport { AutoFocusPlugin } from \"@lexical/react/LexicalAutoFocusPlugin\";\nimport { ClearEditorPlugin } from \"@lexical/react/LexicalClearEditorPlugin\";\nimport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\nimport LexicalErrorBoundary from \"@lexical/react/LexicalErrorBoundary\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { HistoryPlugin } from \"@lexical/react/LexicalHistoryPlugin\";\nimport { ContentEditable } from \"@lexical/react/LexicalContentEditable\";\nimport { RichTextEditorProvider } from \"~/context/RichTextEditorContext\";\nimport { isValidLexicalData } from \"~/utils/isValidLexicalData\";\nimport { UpdateStatePlugin } from \"~/plugins/LexicalUpdateStatePlugin\";\nimport { BlurEventPlugin } from \"~/plugins/BlurEventPlugin/BlurEventPlugin\";\nimport { LexicalValue, ToolbarActionPlugin } from \"~/types\";\nimport { Placeholder } from \"~/ui/Placeholder\";\nimport { generateInitialLexicalValue } from \"~/utils/generateInitialLexicalValue\";\nimport {\n createTheme,\n WebinyTheme,\n ThemeEmotionMap,\n toTypographyEmotionMap\n} from \"@webiny/lexical-theme\";\nimport { allNodes } from \"@webiny/lexical-nodes\";\nimport { SharedHistoryContext, useSharedHistoryContext } from \"~/context/SharedHistoryContext\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nimport {\n LexicalEditorWithConfig,\n useLexicalEditorConfig\n} from \"~/components/LexicalEditorConfig/LexicalEditorConfig\";\n\nexport interface RichTextEditorProps {\n children?: React.ReactNode | React.ReactNode[];\n classes?: string;\n contentEditableStyles?: React.CSSProperties;\n focus?: boolean;\n height?: number | string;\n nodes?: Klass<LexicalNode>[];\n onBlur?: (editorState: LexicalValue) => void;\n onChange?: (json: LexicalValue) => void;\n placeholder?: string;\n placeholderStyles?: React.CSSProperties;\n staticToolbar?: React.ReactNode;\n styles?: React.CSSProperties;\n tag?: string;\n theme: WebinyTheme;\n themeEmotionMap?: ThemeEmotionMap;\n themeStylesTransformer?: (cssObject: Record<string, any>) => CSSObject;\n toolbar?: React.ReactNode;\n toolbarActionPlugins?: ToolbarActionPlugin[];\n value: LexicalValue | null;\n width?: number | string;\n}\n\nconst BaseRichTextEditor = ({\n toolbar,\n staticToolbar,\n onChange,\n value,\n nodes,\n placeholder,\n children,\n onBlur,\n focus,\n styles,\n width,\n height,\n theme,\n themeEmotionMap,\n toolbarActionPlugins,\n contentEditableStyles,\n placeholderStyles\n}: RichTextEditorProps) => {\n const editorTheme = useRef(createTheme());\n const config = useLexicalEditorConfig();\n const { historyState } = useSharedHistoryContext();\n const placeholderElem = (\n <Placeholder styles={placeholderStyles}>{placeholder || \"Enter text...\"}</Placeholder>\n );\n const scrollRef = useRef(null);\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLElement | undefined>(\n undefined\n );\n const { setTheme, setThemeEmotionMap, setToolbarActionPlugins } = useRichTextEditor();\n\n useEffect(() => {\n setTheme(theme);\n setThemeEmotionMap(themeEmotionMap);\n }, [themeEmotionMap, theme]);\n\n useEffect(() => {\n if (toolbarActionPlugins) {\n setToolbarActionPlugins(toolbarActionPlugins || []);\n }\n }, [toolbarActionPlugins]);\n\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem);\n }\n };\n\n const sizeStyle = {\n height: height || \"\",\n width: width || \"\"\n };\n\n const configNodes = config.nodes.map(node => node.node);\n const configPlugins = config.plugins.map(plugin => (\n <Fragment key={plugin.name}>{plugin.element}</Fragment>\n ));\n\n const editorValue = isValidLexicalData(value) ? value : generateInitialLexicalValue();\n\n const initialConfig = {\n // We update the state via the `<LexicalUpdateStatePlugin/>`.\n editorState: null,\n namespace: \"webiny\",\n onError: () => {\n // Ignore errors. We don't want to break the app because of errors caused by config/value updates.\n // These are usually resolved in the next component render cycle.\n },\n nodes: [...allNodes, ...configNodes, ...(nodes || [])],\n theme: { ...editorTheme.current, emotionMap: themeEmotionMap }\n };\n\n function handleOnChange(editorState: EditorState, editor: LexicalEditor) {\n editorState.read(() => {\n if (typeof onChange === \"function\") {\n const editorState = editor.getEditorState();\n onChange(JSON.stringify(editorState.toJSON()));\n }\n });\n }\n\n return (\n /**\n * Once the LexicalComposer is mounted, it caches the `initialConfig` internally, and all future\n * updates to the config will be ignored. This is a problem because we pull in Nodes from our config,\n * and initially, there can be multiple re-renders, while the config object is settled.\n *\n * To bypass this issue, we generate a naive `key` based on the number of Nodes.\n */\n <LexicalComposer initialConfig={initialConfig} key={initialConfig.nodes.length}>\n <>\n {staticToolbar && staticToolbar}\n <div\n /* This className is necessary for targeting of editor container from CSS files. */\n className={\"editor-shell\"}\n ref={scrollRef}\n style={{ ...styles, ...sizeStyle, overflow: \"auto\", position: \"relative\" }}\n >\n {/* data */}\n <OnChangePlugin onChange={handleOnChange} />\n <UpdateStatePlugin value={editorValue} />\n <ClearEditorPlugin />\n <HistoryPlugin externalHistoryState={historyState} />\n {/* Events */}\n {onBlur && <BlurEventPlugin onBlur={onBlur} />}\n {focus && <AutoFocusPlugin />}\n {/* External plugins and components */}\n {configPlugins}\n {children}\n <RichTextPlugin\n contentEditable={\n <div className=\"editor-scroller\" style={{ ...sizeStyle }}>\n <div className=\"editor\" ref={onRef}>\n <ContentEditable\n style={{ outline: 0, ...contentEditableStyles }}\n />\n </div>\n </div>\n }\n placeholder={placeholderElem}\n ErrorBoundary={LexicalErrorBoundary}\n />\n {/* Toolbar */}\n {floatingAnchorElem && toolbar}\n </div>\n </>\n </LexicalComposer>\n );\n};\n\n/**\n * @description Main editor container\n */\nexport const RichTextEditor = makeDecoratable(\"RichTextEditor\", (props: RichTextEditorProps) => {\n return (\n <LexicalEditorWithConfig>\n <RichTextEditorProvider>\n <ClassNames>\n {({ css }) => {\n const themeEmotionMap =\n props?.themeEmotionMap ??\n toTypographyEmotionMap(css, props.theme, props.themeStylesTransformer);\n return (\n <SharedHistoryContext>\n <BaseRichTextEditor {...props} themeEmotionMap={themeEmotionMap} />\n </SharedHistoryContext>\n );\n }}\n </ClassNames>\n </RichTextEditorProvider>\n </LexicalEditorWithConfig>\n );\n});\n"],"mappings":";;;;;;;;;;;AA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7H,MAAA,CAAAqD,OAAA,CAAAC,aAAA,CAAC9B,oBAAA,CAAAsG,uBAAuB,qBACpB9H,MAAA,CAAAqD,OAAA,CAAAC,aAAA,CAACxC,sBAAA,CAAAiH,sBAAsB,qBACnB/H,MAAA,CAAAqD,OAAA,CAAAC,aAAA,CAACnD,OAAA,CAAA6H,UAAU,QACN,UAAAC,KAAA,EAAa;IAAA,IAAVC,GAAG,GAAAD,KAAA,CAAHC,GAAG;IACH,IAAM1F,eAAe,GACjBqF,KAAK,EAAErF,eAAe,IACtB,IAAA2F,oCAAsB,EAACD,GAAG,EAAEL,KAAK,CAACtF,KAAK,EAAEsF,KAAK,CAACO,sBAAsB,CAAC;IAC1E,oBACIpI,MAAA,CAAAqD,OAAA,CAAAC,aAAA,CAAChC,qBAAA,CAAA+G,oBAAoB,qBACjBrI,MAAA,CAAAqD,OAAA,CAAAC,aAAA,CAAC7B,kBAAkB,EAAA6G,MAAA,CAAAC,MAAA,KAAKV,KAAK;MAAErF,eAAe,EAAEA;IAAgB,EAAE,CAChD,CAAC;EAE/B,CACQ,CACQ,CACH,CAAC;AAElC,CAAC,CAAC;AAACgG,OAAA,CAAAb,cAAA,GAAAA,cAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_emotion","_LexicalComposer","_LexicalOnChangePlugin","_LexicalAutoFocusPlugin","_LexicalClearEditorPlugin","_LexicalRichTextPlugin","_LexicalErrorBoundary","_interopRequireDefault","_reactComposition","_LexicalHistoryPlugin","_LexicalContentEditable","_RichTextEditorContext","_isValidLexicalData","_LexicalUpdateStatePlugin","_BlurEventPlugin","_Placeholder","_generateInitialLexicalValue","_lexicalTheme","_lexicalNodes","_SharedHistoryContext","_LexicalEditorConfig","_excluded","BaseRichTextEditor","_ref","toolbar","staticToolbar","onChange","value","nodes","placeholder","children","onBlur","focus","styles","width","height","contentEditableStyles","placeholderStyles","props","_objectWithoutProperties2","default","themeEmotionMap","toTypographyEmotionMap","css","theme","themeStylesTransformer","editorTheme","useRef","createTheme","config","useLexicalEditorConfig","_useSharedHistoryCont","useSharedHistoryContext","historyState","placeholderElem","createElement","Placeholder","scrollRef","_useState","useState","undefined","_useState2","_slicedToArray2","floatingAnchorElem","setFloatingAnchorElem","onRef","_floatingAnchorElem","sizeStyle","configNodes","map","node","configPlugins","plugins","plugin","Fragment","key","name","element","editorValue","isValidLexicalData","generateInitialLexicalValue","initialConfig","editorState","namespace","onError","concat","_toConsumableArray2","allNodes","_objectSpread2","current","emotionMap","handleOnChange","editor","read","getEditorState","JSON","stringify","toJSON","SharedHistoryContext","LexicalComposer","length","RichTextEditorProvider","toolbarActionPlugins","className","ref","style","overflow","position","OnChangePlugin","UpdateStatePlugin","ClearEditorPlugin","HistoryPlugin","externalHistoryState","BlurEventPlugin","AutoFocusPlugin","RichTextPlugin","contentEditable","ContentEditable","outline","ErrorBoundary","LexicalErrorBoundary","RichTextEditor","exports","makeDecoratable","LexicalEditorWithConfig"],"sources":["RichTextEditor.tsx"],"sourcesContent":["import React, { Fragment, useRef, useState } from \"react\";\nimport { css } from \"emotion\";\nimport { CSSObject } from \"@emotion/react\";\nimport { Klass, LexicalEditor, LexicalNode } from \"lexical\";\nimport { EditorState } from \"lexical/LexicalEditorState\";\nimport { LexicalComposer } from \"@lexical/react/LexicalComposer\";\nimport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\nimport { AutoFocusPlugin } from \"@lexical/react/LexicalAutoFocusPlugin\";\nimport { ClearEditorPlugin } from \"@lexical/react/LexicalClearEditorPlugin\";\nimport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\nimport LexicalErrorBoundary from \"@lexical/react/LexicalErrorBoundary\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { HistoryPlugin } from \"@lexical/react/LexicalHistoryPlugin\";\nimport { ContentEditable } from \"@lexical/react/LexicalContentEditable\";\nimport { RichTextEditorProvider } from \"~/context/RichTextEditorContext\";\nimport { isValidLexicalData } from \"~/utils/isValidLexicalData\";\nimport { UpdateStatePlugin } from \"~/plugins/LexicalUpdateStatePlugin\";\nimport { BlurEventPlugin } from \"~/plugins/BlurEventPlugin/BlurEventPlugin\";\nimport { LexicalValue, ToolbarActionPlugin } from \"~/types\";\nimport { Placeholder } from \"~/ui/Placeholder\";\nimport { generateInitialLexicalValue } from \"~/utils/generateInitialLexicalValue\";\nimport {\n createTheme,\n WebinyTheme,\n ThemeEmotionMap,\n toTypographyEmotionMap\n} from \"@webiny/lexical-theme\";\nimport { allNodes } from \"@webiny/lexical-nodes\";\nimport { SharedHistoryContext, useSharedHistoryContext } from \"~/context/SharedHistoryContext\";\nimport {\n LexicalEditorWithConfig,\n useLexicalEditorConfig\n} from \"~/components/LexicalEditorConfig/LexicalEditorConfig\";\n\nexport interface RichTextEditorProps {\n children?: React.ReactNode | React.ReactNode[];\n classes?: string;\n contentEditableStyles?: React.CSSProperties;\n focus?: boolean;\n height?: number | string;\n nodes?: Klass<LexicalNode>[];\n onBlur?: (editorState: LexicalValue) => void;\n onChange?: (json: LexicalValue) => void;\n placeholder?: string;\n placeholderStyles?: React.CSSProperties;\n staticToolbar?: React.ReactNode;\n styles?: React.CSSProperties;\n tag?: string;\n theme: WebinyTheme;\n themeEmotionMap?: ThemeEmotionMap;\n toolbarActionPlugins?: ToolbarActionPlugin[];\n themeStylesTransformer?: (cssObject: Record<string, any>) => CSSObject;\n toolbar?: React.ReactNode;\n value: LexicalValue | null;\n width?: number | string;\n}\n\nconst BaseRichTextEditor = ({\n toolbar,\n staticToolbar,\n onChange,\n value,\n nodes,\n placeholder,\n children,\n onBlur,\n focus,\n styles,\n width,\n height,\n contentEditableStyles,\n placeholderStyles,\n ...props\n}: RichTextEditorProps) => {\n const themeEmotionMap =\n props.themeEmotionMap ??\n toTypographyEmotionMap(css, props.theme, props.themeStylesTransformer);\n\n const editorTheme = useRef(createTheme());\n const config = useLexicalEditorConfig();\n const { historyState } = useSharedHistoryContext();\n const placeholderElem = (\n <Placeholder styles={placeholderStyles}>{placeholder || \"Enter text...\"}</Placeholder>\n );\n const scrollRef = useRef(null);\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLElement | undefined>(\n undefined\n );\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem);\n }\n };\n\n const sizeStyle = {\n height: height || \"\",\n width: width || \"\"\n };\n\n const configNodes = config.nodes.map(node => node.node);\n const configPlugins = config.plugins.map(plugin => (\n <Fragment key={plugin.name}>{plugin.element}</Fragment>\n ));\n\n const editorValue = isValidLexicalData(value) ? value : generateInitialLexicalValue();\n\n const initialConfig = {\n // We update the state via the `<LexicalUpdateStatePlugin/>`.\n editorState: null,\n namespace: \"webiny\",\n onError: () => {\n // Ignore errors. We don't want to break the app because of errors caused by config/value updates.\n // These are usually resolved in the next component render cycle.\n },\n nodes: [...allNodes, ...configNodes, ...(nodes || [])],\n theme: { ...editorTheme.current, emotionMap: themeEmotionMap }\n };\n\n function handleOnChange(editorState: EditorState, editor: LexicalEditor) {\n editorState.read(() => {\n if (typeof onChange === \"function\") {\n const editorState = editor.getEditorState();\n onChange(JSON.stringify(editorState.toJSON()));\n }\n });\n }\n\n return (\n /**\n * Once the LexicalComposer is mounted, it caches the `initialConfig` internally, and all future\n * updates to the config will be ignored. This is a problem because we pull in Nodes from our config,\n * and initially, there can be multiple re-renders, while the config object is settled.\n *\n * To bypass this issue, we generate a naive `key` based on the number of Nodes.\n */\n <SharedHistoryContext>\n <LexicalComposer initialConfig={initialConfig} key={initialConfig.nodes.length}>\n <RichTextEditorProvider\n theme={props.theme}\n themeEmotionMap={themeEmotionMap}\n toolbarActionPlugins={props.toolbarActionPlugins}\n >\n {staticToolbar && staticToolbar}\n <div\n /* This className is necessary for targeting of editor container from CSS files. */\n className={\"editor-shell\"}\n ref={scrollRef}\n style={{ ...styles, ...sizeStyle, overflow: \"auto\", position: \"relative\" }}\n >\n {/* State plugins. */}\n <OnChangePlugin onChange={handleOnChange} />\n <UpdateStatePlugin value={editorValue} />\n <ClearEditorPlugin />\n <HistoryPlugin externalHistoryState={historyState} />\n {/* Event plugins. */}\n {onBlur && <BlurEventPlugin onBlur={onBlur} />}\n {focus && <AutoFocusPlugin />}\n {/* External plugins and components. */}\n {configPlugins}\n {children}\n <RichTextPlugin\n contentEditable={\n <div className=\"editor-scroller\" style={{ ...sizeStyle }}>\n <div className=\"editor\" ref={onRef}>\n <ContentEditable\n style={{ outline: 0, ...contentEditableStyles }}\n />\n </div>\n </div>\n }\n placeholder={placeholderElem}\n ErrorBoundary={LexicalErrorBoundary}\n />\n {/* Toolbar. */}\n {floatingAnchorElem && toolbar}\n </div>\n </RichTextEditorProvider>\n </LexicalComposer>\n </SharedHistoryContext>\n );\n};\n\n/**\n * @description Main editor container\n */\nexport const RichTextEditor = makeDecoratable(\"RichTextEditor\", (props: RichTextEditorProps) => {\n return (\n <LexicalEditorWithConfig>\n <BaseRichTextEditor {...props} />\n </LexicalEditorWithConfig>\n );\n});\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAIA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,uBAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,qBAAA,GAAAV,OAAA;AACA,IAAAW,uBAAA,GAAAX,OAAA;AACA,IAAAY,sBAAA,GAAAZ,OAAA;AACA,IAAAa,mBAAA,GAAAb,OAAA;AACA,IAAAc,yBAAA,GAAAd,OAAA;AACA,IAAAe,gBAAA,GAAAf,OAAA;AAEA,IAAAgB,YAAA,GAAAhB,OAAA;AACA,IAAAiB,4BAAA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CAAAe,aAAA,CAAC7C,uBAAA,CAAA2G,eAAe;QACZZ,KAAK,MAAAjB,cAAA,CAAAhD,OAAA;UAAI8E,OAAO,EAAE;QAAC,GAAKlF,qBAAqB;MAAG,CACnD,CACA,CACJ,CACR;MACDP,WAAW,EAAEyB,eAAgB;MAC7BiE,aAAa,EAAEC;IAAqB,CACvC,CAAC,EAEDzD,kBAAkB,IAAIvC,OACtB,CACe,CACX,CACC;EAAC;AAE/B,CAAC;;AAED;AACA;AACA;AACO,IAAMiG,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,iCAAe,EAAC,gBAAgB,EAAE,UAACrF,KAA0B,EAAK;EAC5F,oBACIzC,MAAA,CAAA2C,OAAA,CAAAe,aAAA,CAACnC,oBAAA,CAAAwG,uBAAuB,qBACpB/H,MAAA,CAAA2C,OAAA,CAAAe,aAAA,CAACjC,kBAAkB,EAAKgB,KAAQ,CACX,CAAC;AAElC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,14 +5,14 @@ import { NodeConfig } from "./components/Node";
|
|
|
5
5
|
export declare const LexicalEditorConfig: {
|
|
6
6
|
({ children }: {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
}): JSX.Element;
|
|
9
|
-
ToolbarElement: ({ name, element, after, before, remove }: import("./components/ToolbarElement").ToolbarElementProps) => JSX.Element;
|
|
10
|
-
Plugin: ({ name, element, after, before, remove }: import("./components/Plugin").PluginProps) => JSX.Element;
|
|
11
|
-
Node: ({ name, node, after, before, remove }: import("./components/Node").NodeProps) => JSX.Element;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
ToolbarElement: ({ name, element, after, before, remove }: import("./components/ToolbarElement").ToolbarElementProps) => React.JSX.Element;
|
|
10
|
+
Plugin: ({ name, element, after, before, remove }: import("./components/Plugin").PluginProps) => React.JSX.Element;
|
|
11
|
+
Node: ({ name, node, after, before, remove }: import("./components/Node").NodeProps) => React.JSX.Element;
|
|
12
12
|
};
|
|
13
13
|
export declare const LexicalEditorWithConfig: ({ children }: {
|
|
14
14
|
children: React.ReactNode;
|
|
15
|
-
}) => JSX.Element;
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
16
|
export declare function useLexicalEditorConfig(): {
|
|
17
17
|
toolbarElements: ToolbarElementConfig[];
|
|
18
18
|
plugins: PluginConfig[];
|
|
@@ -26,21 +26,20 @@ var createHOC = function createHOC(newChildren) {
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
var LexicalEditorConfig = function LexicalEditorConfig(_ref3) {
|
|
29
|
+
var LexicalEditorConfig = exports.LexicalEditorConfig = function LexicalEditorConfig(_ref3) {
|
|
30
30
|
var children = _ref3.children;
|
|
31
31
|
return /*#__PURE__*/_react.default.createElement(_reactComposition.Compose, {
|
|
32
32
|
component: LexicalEditorConfigApply,
|
|
33
33
|
with: createHOC(children)
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
exports.LexicalEditorConfig = LexicalEditorConfig;
|
|
37
36
|
LexicalEditorConfig.ToolbarElement = _ToolbarElement.ToolbarElement;
|
|
38
37
|
LexicalEditorConfig.Plugin = _Plugin.Plugin;
|
|
39
38
|
LexicalEditorConfig.Node = _Node.Node;
|
|
40
39
|
var ViewContext = /*#__PURE__*/_react.default.createContext({
|
|
41
40
|
properties: []
|
|
42
41
|
});
|
|
43
|
-
var LexicalEditorWithConfig = function LexicalEditorWithConfig(_ref4) {
|
|
42
|
+
var LexicalEditorWithConfig = exports.LexicalEditorWithConfig = function LexicalEditorWithConfig(_ref4) {
|
|
44
43
|
var children = _ref4.children;
|
|
45
44
|
var _useState = (0, _react.useState)([]),
|
|
46
45
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -58,7 +57,6 @@ var LexicalEditorWithConfig = function LexicalEditorWithConfig(_ref4) {
|
|
|
58
57
|
onChange: stateUpdater
|
|
59
58
|
}, /*#__PURE__*/_react.default.createElement(LexicalEditorConfigApply, null), children));
|
|
60
59
|
};
|
|
61
|
-
exports.LexicalEditorWithConfig = LexicalEditorWithConfig;
|
|
62
60
|
function useLexicalEditorConfig() {
|
|
63
61
|
var _useContext = (0, _react.useContext)(ViewContext),
|
|
64
62
|
properties = _useContext.properties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactComposition","_reactProperties","_ToolbarElement","_Plugin","_Node","LexicalEditorConfigApply","makeDecoratable","_ref","children","default","createElement","Fragment","createHOC","newChildren","BaseComponent","ConfigHOC","_ref2","LexicalEditorConfig","_ref3","Compose","component","with","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactComposition","_reactProperties","_ToolbarElement","_Plugin","_Node","LexicalEditorConfigApply","makeDecoratable","_ref","children","default","createElement","Fragment","createHOC","newChildren","BaseComponent","ConfigHOC","_ref2","LexicalEditorConfig","exports","_ref3","Compose","component","with","ToolbarElement","Plugin","Node","ViewContext","React","createContext","properties","LexicalEditorWithConfig","_ref4","_useState","useState","_useState2","_slicedToArray2","setProperties","context","stateUpdater","Provider","value","Properties","onChange","useLexicalEditorConfig","_useContext","useContext","config","useMemo","toObject","toolbarElements","plugins","nodes"],"sources":["LexicalEditorConfig.tsx"],"sourcesContent":["import React, { useContext, useMemo, useState } from \"react\";\nimport { makeDecoratable, Compose, Decorator, GenericComponent } from \"@webiny/react-composition\";\nimport { Property, Properties, toObject } from \"@webiny/react-properties\";\nimport { ToolbarElement, ToolbarElementConfig } from \"./components/ToolbarElement\";\nimport { Plugin, PluginConfig } from \"./components/Plugin\";\nimport { Node, NodeConfig } from \"./components/Node\";\n\nconst LexicalEditorConfigApply = makeDecoratable(\"LexicalEditorConfigApply\", ({ children }) => {\n return <>{children}</>;\n});\n\nconst createHOC =\n (newChildren: React.ReactNode): Decorator<GenericComponent> =>\n BaseComponent => {\n return function ConfigHOC({ children }) {\n return (\n <BaseComponent>\n {newChildren}\n {children}\n </BaseComponent>\n );\n };\n };\n\nexport const LexicalEditorConfig = ({ children }: { children: React.ReactNode }) => {\n return <Compose component={LexicalEditorConfigApply} with={createHOC(children)} />;\n};\n\nLexicalEditorConfig.ToolbarElement = ToolbarElement;\nLexicalEditorConfig.Plugin = Plugin;\nLexicalEditorConfig.Node = Node;\n\ninterface ViewContext {\n properties: Property[];\n}\n\nconst ViewContext = React.createContext<ViewContext>({ properties: [] });\n\nexport const LexicalEditorWithConfig = ({ children }: { children: React.ReactNode }) => {\n const [properties, setProperties] = useState<Property[]>([]);\n const context = { properties };\n\n const stateUpdater = (properties: Property[]) => {\n setProperties(properties);\n };\n\n return (\n <ViewContext.Provider value={context}>\n <Properties onChange={stateUpdater}>\n <LexicalEditorConfigApply />\n {children}\n </Properties>\n </ViewContext.Provider>\n );\n};\n\ninterface LexicalEditorConfigData {\n toolbarElements: ToolbarElementConfig[];\n plugins: PluginConfig[];\n nodes: NodeConfig[];\n}\n\nexport function useLexicalEditorConfig() {\n const { properties } = useContext(ViewContext);\n\n const config = useMemo(() => {\n return toObject<LexicalEditorConfigData>(properties);\n }, [properties]);\n\n return {\n toolbarElements: config.toolbarElements || [],\n plugins: config.plugins || [],\n nodes: config.nodes || []\n };\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAEA,IAAMM,wBAAwB,GAAG,IAAAC,iCAAe,EAAC,0BAA0B,EAAE,UAAAC,IAAA,EAAkB;EAAA,IAAfC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EACpF,oBAAOX,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAAAb,MAAA,CAAAY,OAAA,CAAAE,QAAA,QAAGH,QAAW,CAAC;AAC1B,CAAC,CAAC;AAEF,IAAMI,SAAS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EAAK;IAC7CO,aAAa,CAACP,UAAU,CAAC;EAC7B,CAAC;EAED,oBACIhC,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAACgB,WAAW,CAACa,QAAQ;IAACC,KAAK,EAAEH;EAAQ,gBACjCxC,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAACT,gBAAA,CAAAwC,UAAU;IAACC,QAAQ,EAAEJ;EAAa,gBAC/BzC,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAACL,wBAAwB,MAAE,CAAC,EAC3BG,QACO,CACM,CAAC;AAE/B,CAAC;AAQM,SAASmC,sBAAsBA,CAAA,EAAG;EACrC,IAAAC,WAAA,GAAuB,IAAAC,iBAAU,EAACnB,WAAW,CAAC;IAAtCG,UAAU,GAAAe,WAAA,CAAVf,UAAU;EAElB,IAAMiB,MAAM,GAAG,IAAAC,cAAO,EAAC,YAAM;IACzB,OAAO,IAAAC,yBAAQ,EAA0BnB,UAAU,CAAC;EACxD,CAAC,EAAE,CAACA,UAAU,CAAC,CAAC;EAEhB,OAAO;IACHoB,eAAe,EAAEH,MAAM,CAACG,eAAe,IAAI,EAAE;IAC7CC,OAAO,EAAEJ,MAAM,CAACI,OAAO,IAAI,EAAE;IAC7BC,KAAK,EAAEL,MAAM,CAACK,KAAK,IAAI;EAC3B,CAAC;AACL","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Klass, LexicalNode } from "lexical";
|
|
3
3
|
export interface NodeConfig {
|
|
4
4
|
name: string;
|
|
@@ -11,4 +11,4 @@ export interface NodeProps {
|
|
|
11
11
|
before?: string;
|
|
12
12
|
after?: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const Node: ({ name, node, after, before, remove }: NodeProps) => JSX.Element;
|
|
14
|
+
export declare const Node: ({ name, node, after, before, remove }: NodeProps) => React.JSX.Element;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.Node = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactProperties = require("@webiny/react-properties");
|
|
10
|
-
var Node = function Node(_ref) {
|
|
10
|
+
var Node = exports.Node = function Node(_ref) {
|
|
11
11
|
var name = _ref.name,
|
|
12
12
|
node = _ref.node,
|
|
13
13
|
_ref$after = _ref.after,
|
|
@@ -35,6 +35,5 @@ var Node = function Node(_ref) {
|
|
|
35
35
|
value: node
|
|
36
36
|
}) : null);
|
|
37
37
|
};
|
|
38
|
-
exports.Node = Node;
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=Node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactProperties","Node","_ref","name","node","_ref$after","after","undefined","_ref$before","before","_ref$remove","remove","placeBefore","concat","placeAfter","default","createElement","Property","id","array","value"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactProperties","Node","exports","_ref","name","node","_ref$after","after","undefined","_ref$before","before","_ref$remove","remove","placeBefore","concat","placeAfter","default","createElement","Property","id","array","value"],"sources":["Node.tsx"],"sourcesContent":["import React from \"react\";\nimport { Property } from \"@webiny/react-properties\";\nimport { Klass, LexicalNode } from \"lexical\";\n\nexport interface NodeConfig {\n name: string;\n node: Klass<LexicalNode>;\n}\n\nexport interface NodeProps {\n name: string;\n node?: Klass<LexicalNode>;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nexport const Node = ({\n name,\n node,\n after = undefined,\n before = undefined,\n remove = false\n}: NodeProps) => {\n const placeBefore = before !== undefined ? `node:${before}` : undefined;\n const placeAfter = after !== undefined ? `node:${after}` : undefined;\n\n return (\n <Property\n id={`nodes:${name}`}\n name={\"nodes\"}\n array={true}\n before={placeBefore}\n after={placeAfter}\n remove={remove}\n >\n <Property id={`node:${name}:name`} name={\"name\"} value={name} />\n {node ? <Property id={`node:${name}:node`} name={\"node\"} value={node} /> : null}\n </Property>\n );\n};\n"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,EAAE,UAAAL,MAAA,CAAUV,IAAI,UAAQ;IAACA,IAAI,EAAE,MAAO;IAACiB,KAAK,EAAEhB;EAAK,CAAE,CAAC,GAAG,IACrE,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -10,4 +10,4 @@ export interface PluginProps {
|
|
|
10
10
|
before?: string;
|
|
11
11
|
after?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const Plugin: ({ name, element, after, before, remove }: PluginProps) => JSX.Element;
|
|
13
|
+
export declare const Plugin: ({ name, element, after, before, remove }: PluginProps) => React.JSX.Element;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.Plugin = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactProperties = require("@webiny/react-properties");
|
|
10
|
-
var Plugin = function Plugin(_ref) {
|
|
10
|
+
var Plugin = exports.Plugin = function Plugin(_ref) {
|
|
11
11
|
var name = _ref.name,
|
|
12
12
|
element = _ref.element,
|
|
13
13
|
_ref$after = _ref.after,
|
|
@@ -35,6 +35,5 @@ var Plugin = function Plugin(_ref) {
|
|
|
35
35
|
value: element
|
|
36
36
|
}) : null);
|
|
37
37
|
};
|
|
38
|
-
exports.Plugin = Plugin;
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=Plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactProperties","Plugin","_ref","name","element","_ref$after","after","undefined","_ref$before","before","_ref$remove","remove","placeBefore","concat","placeAfter","default","createElement","Property","id","array","value"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactProperties","Plugin","exports","_ref","name","element","_ref$after","after","undefined","_ref$before","before","_ref$remove","remove","placeBefore","concat","placeAfter","default","createElement","Property","id","array","value"],"sources":["Plugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { Property } from \"@webiny/react-properties\";\n\nexport interface PluginConfig {\n name: string;\n element: React.ReactElement;\n}\n\nexport interface PluginProps {\n name: string;\n element?: React.ReactElement<unknown>;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nexport const Plugin = ({\n name,\n element,\n after = undefined,\n before = undefined,\n remove = false\n}: PluginProps) => {\n const placeBefore = before !== undefined ? `plugin:${before}` : undefined;\n const placeAfter = after !== undefined ? `plugin:${after}` : undefined;\n\n return (\n <Property\n id={`plugins:${name}`}\n name={\"plugins\"}\n array={true}\n before={placeBefore}\n after={placeAfter}\n remove={remove}\n >\n <Property id={`plugin:${name}:name`} name={\"name\"} value={name} />\n {element ? (\n <Property id={`plugin:${name}:element`} name={\"element\"} value={element} />\n ) : null}\n </Property>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAeO,IAAME,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG,SAATA,MAAMA,CAAAE,IAAA,EAMA;EAAA,IALfC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAAC,UAAA,GAAAH,IAAA,CACPI,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAGE,SAAS,GAAAF,UAAA;IAAAG,WAAA,GAAAN,IAAA,CACjBO,MAAM;IAANA,MAAM,GAAAD,WAAA,cAAGD,SAAS,GAAAC,WAAA;IAAAE,WAAA,GAAAR,IAAA,CAClBS,MAAM;IAANA,MAAM,GAAAD,WAAA,cAAG,KAAK,GAAAA,WAAA;EAEd,IAAME,WAAW,GAAGH,MAAM,KAAKF,SAAS,aAAAM,MAAA,CAAaJ,MAAM,IAAKF,SAAS;EACzE,IAAMO,UAAU,GAAGR,KAAK,KAAKC,SAAS,aAAAM,MAAA,CAAaP,KAAK,IAAKC,SAAS;EAEtE,oBACIX,MAAA,CAAAmB,OAAA,CAAAC,aAAA,CAACjB,gBAAA,CAAAkB,QAAQ;IACLC,EAAE,aAAAL,MAAA,CAAaV,IAAI,CAAG;IACtBA,IAAI,EAAE,SAAU;IAChBgB,KAAK,EAAE,IAAK;IACZV,MAAM,EAAEG,WAAY;IACpBN,KAAK,EAAEQ,UAAW;IAClBH,MAAM,EAAEA;EAAO,gBAEff,MAAA,CAAAmB,OAAA,CAAAC,aAAA,CAACjB,gBAAA,CAAAkB,QAAQ;IAACC,EAAE,YAAAL,MAAA,CAAYV,IAAI,UAAQ;IAACA,IAAI,EAAE,MAAO;IAACiB,KAAK,EAAEjB;EAAK,CAAE,CAAC,EACjEC,OAAO,gBACJR,MAAA,CAAAmB,OAAA,CAAAC,aAAA,CAACjB,gBAAA,CAAAkB,QAAQ;IAACC,EAAE,YAAAL,MAAA,CAAYV,IAAI,aAAW;IAACA,IAAI,EAAE,SAAU;IAACiB,KAAK,EAAEhB;EAAQ,CAAE,CAAC,GAC3E,IACE,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -10,4 +10,4 @@ export interface ToolbarElementProps {
|
|
|
10
10
|
before?: string;
|
|
11
11
|
after?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const ToolbarElement: ({ name, element, after, before, remove }: ToolbarElementProps) => JSX.Element;
|
|
13
|
+
export declare const ToolbarElement: ({ name, element, after, before, remove }: ToolbarElementProps) => React.JSX.Element;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ToolbarElement = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactProperties = require("@webiny/react-properties");
|
|
10
|
-
var ToolbarElement = function ToolbarElement(_ref) {
|
|
10
|
+
var ToolbarElement = exports.ToolbarElement = function ToolbarElement(_ref) {
|
|
11
11
|
var name = _ref.name,
|
|
12
12
|
element = _ref.element,
|
|
13
13
|
_ref$after = _ref.after,
|
|
@@ -35,6 +35,5 @@ var ToolbarElement = function ToolbarElement(_ref) {
|
|
|
35
35
|
value: element
|
|
36
36
|
}) : null);
|
|
37
37
|
};
|
|
38
|
-
exports.ToolbarElement = ToolbarElement;
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=ToolbarElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactProperties","ToolbarElement","_ref","name","element","_ref$after","after","undefined","_ref$before","before","_ref$remove","remove","placeBefore","concat","placeAfter","default","createElement","Property","id","array","value"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactProperties","ToolbarElement","exports","_ref","name","element","_ref$after","after","undefined","_ref$before","before","_ref$remove","remove","placeBefore","concat","placeAfter","default","createElement","Property","id","array","value"],"sources":["ToolbarElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { Property } from \"@webiny/react-properties\";\n\nexport interface ToolbarElementConfig {\n name: string;\n element: React.ReactElement;\n}\n\nexport interface ToolbarElementProps {\n name: string;\n element?: React.ReactElement<unknown>;\n remove?: boolean;\n before?: string;\n after?: string;\n}\n\nexport const ToolbarElement = ({\n name,\n element,\n after = undefined,\n before = undefined,\n remove = false\n}: ToolbarElementProps) => {\n const placeBefore = before !== undefined ? `element:${before}` : undefined;\n const placeAfter = after !== undefined ? `element:${after}` : undefined;\n\n return (\n <Property\n id={`element:${name}`}\n name={\"toolbarElements\"}\n array={true}\n before={placeBefore}\n after={placeAfter}\n remove={remove}\n >\n <Property id={`element:${name}:name`} name={\"name\"} value={name} />\n {element ? (\n <Property id={`element:${name}:element`} name={\"element\"} value={element} />\n ) : null}\n </Property>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAeO,IAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAAE,IAAA,EAMA;EAAA,IALvBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAAC,UA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/react";
|
|
4
4
|
import { WebinyTheme, ThemeEmotionMap } from "@webiny/lexical-theme";
|
|
@@ -10,9 +10,5 @@ interface LexicalHtmlRendererProps {
|
|
|
10
10
|
themeEmotionMap?: ThemeEmotionMap;
|
|
11
11
|
themeStylesTransformer?: (cssObject: Record<string, any>) => CSSObject;
|
|
12
12
|
}
|
|
13
|
-
export declare const
|
|
14
|
-
/**
|
|
15
|
-
* @description Main editor container
|
|
16
|
-
*/
|
|
17
|
-
export declare const LexicalHtmlRenderer: (props: LexicalHtmlRendererProps) => JSX.Element;
|
|
13
|
+
export declare const LexicalHtmlRenderer: ({ nodes, value, theme, ...props }: LexicalHtmlRendererProps) => React.JSX.Element;
|
|
18
14
|
export {};
|