@webiny/lexical-editor 5.36.2 → 5.37.0-beta.1
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/insertFiles.d.ts +14 -0
- package/commands/insertFiles.js +9 -0
- package/commands/insertFiles.js.map +1 -0
- package/commands/webiny-list.js.map +1 -1
- package/commands/webiny-quote.js.map +1 -1
- package/components/Editor/HeadingEditor.js +7 -9
- package/components/Editor/HeadingEditor.js.map +1 -1
- package/components/Editor/ParagraphEditor.js +7 -10
- package/components/Editor/ParagraphEditor.js.map +1 -1
- package/components/Editor/RichTextEditor.d.ts +9 -1
- package/components/Editor/RichTextEditor.js +41 -20
- package/components/Editor/RichTextEditor.js.map +1 -1
- package/components/ImageComponent.d.ts +23 -0
- package/components/ImageComponent.js +252 -0
- package/components/ImageComponent.js.map +1 -0
- package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +19 -10
- package/components/LexicalEditorConfig/LexicalEditorConfig.js +63 -9
- package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
- package/components/LexicalEditorConfig/components/Node.d.ts +14 -0
- package/components/LexicalEditorConfig/components/Node.js +38 -0
- package/components/LexicalEditorConfig/components/Node.js.map +1 -0
- package/components/LexicalEditorConfig/components/Plugin.d.ts +13 -0
- package/components/LexicalEditorConfig/components/Plugin.js +38 -0
- package/components/LexicalEditorConfig/components/Plugin.js.map +1 -0
- package/components/LexicalEditorConfig/components/ToolbarElement.d.ts +13 -0
- package/components/LexicalEditorConfig/components/ToolbarElement.js +38 -0
- package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -0
- package/components/LexicalHtmlRenderer.d.ts +2 -0
- package/components/LexicalHtmlRenderer.js +1 -1
- package/components/LexicalHtmlRenderer.js.map +1 -1
- package/components/Toolbar/StaticToolbar.css +260 -0
- package/components/Toolbar/StaticToolbar.d.ts +3 -0
- package/components/Toolbar/StaticToolbar.js +101 -0
- package/components/Toolbar/StaticToolbar.js.map +1 -0
- package/components/Toolbar/Toolbar.css +215 -4
- package/components/Toolbar/Toolbar.d.ts +2 -8
- package/components/Toolbar/Toolbar.js +25 -37
- package/components/Toolbar/Toolbar.js.map +1 -1
- package/components/ToolbarActions/BoldAction.js.map +1 -1
- package/components/ToolbarActions/BulletListAction.js +2 -2
- package/components/ToolbarActions/BulletListAction.js.map +1 -1
- package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
- package/components/ToolbarActions/FontColorAction.js +1 -1
- package/components/ToolbarActions/FontColorAction.js.map +1 -1
- package/components/ToolbarActions/FontSizeAction.js.map +1 -1
- package/components/ToolbarActions/ImageAction.d.ts +2 -0
- package/components/ToolbarActions/ImageAction.js +53 -0
- package/components/ToolbarActions/ImageAction.js.map +1 -0
- package/components/ToolbarActions/ItalicAction.js.map +1 -1
- package/components/ToolbarActions/LinkAction.js.map +1 -1
- package/components/ToolbarActions/NumberedListAction.js +16 -4
- package/components/ToolbarActions/NumberedListAction.js.map +1 -1
- package/components/ToolbarActions/QuoteAction.js.map +1 -1
- package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
- package/components/ToolbarActions/TypographyAction.js +1 -1
- package/components/ToolbarActions/TypographyAction.js.map +1 -1
- package/components/ToolbarActions/UnderlineAction.js.map +1 -1
- package/context/FontColorActionContext.js.map +1 -1
- package/context/RichTextEditorContext.d.ts +3 -1
- package/context/RichTextEditorContext.js +17 -11
- package/context/RichTextEditorContext.js.map +1 -1
- package/context/SharedHistoryContext.js.map +1 -1
- package/context/TextAlignmentActionContextProps.js.map +1 -1
- package/context/TypographyActionContext.js.map +1 -1
- package/hooks/useFontColorPicker.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/images/icons/insert-image.svg +4 -0
- package/index.d.ts +9 -9
- package/index.js +50 -44
- package/index.js.map +1 -1
- package/nodes/FontColorNode.js +0 -4
- package/nodes/FontColorNode.js.map +1 -1
- package/nodes/HeadingNode.js.map +1 -1
- package/nodes/ImageNode.d.ts +50 -0
- package/nodes/ImageNode.js +206 -0
- package/nodes/ImageNode.js.map +1 -0
- package/nodes/ListItemNode.js +0 -4
- package/nodes/ListItemNode.js.map +1 -1
- package/nodes/ListNode/formatList.js.map +1 -1
- package/nodes/ListNode.js +0 -6
- package/nodes/ListNode.js.map +1 -1
- package/nodes/ParagraphNode.js.map +1 -1
- package/nodes/QuoteNode.js.map +1 -1
- package/nodes/TypographyElementNode.js +2 -6
- package/nodes/TypographyElementNode.js.map +1 -1
- package/nodes/imageNode.css +43 -0
- package/nodes/webinyNodes.js +2 -1
- package/nodes/webinyNodes.js.map +1 -1
- package/package.json +6 -5
- package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +5 -1
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +52 -14
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
- package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
- package/plugins/ImagesPlugin/ImagesPlugin.d.ts +13 -0
- package/plugins/ImagesPlugin/ImagesPlugin.js +152 -0
- package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -0
- package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js.map +1 -1
- package/plugins/LexicalUpdateStatePlugin/index.js.map +1 -1
- package/plugins/ListPLugin/ListPlugin.d.ts +1 -0
- package/plugins/{WebinyListPLugin/WebinyListPlugin.js → ListPLugin/ListPlugin.js} +3 -3
- package/plugins/ListPLugin/ListPlugin.js.map +1 -0
- package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
- package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js.map +1 -1
- package/themes/webinyLexicalTheme.css +0 -6
- package/themes/webinyLexicalTheme.js +4 -1
- package/themes/webinyLexicalTheme.js.map +1 -1
- package/types.d.ts +9 -0
- package/types.js +28 -1
- package/types.js.map +1 -1
- package/ui/ContentEditable.css +22 -0
- package/ui/ContentEditable.d.ts +12 -0
- package/ui/ContentEditable.js +24 -0
- package/ui/ContentEditable.js.map +1 -0
- package/ui/Divider.js.map +1 -1
- package/ui/DropDown.js.map +1 -1
- package/ui/ImageResizer.d.ts +26 -0
- package/ui/ImageResizer.js +213 -0
- package/ui/ImageResizer.js.map +1 -0
- package/ui/LinkPreview.js +7 -7
- package/ui/LinkPreview.js.map +1 -1
- package/ui/Placeholder.css +2 -5
- package/ui/Placeholder.d.ts +3 -1
- package/ui/Placeholder.js +5 -1
- package/ui/Placeholder.js.map +1 -1
- package/ui/TextInput.js.map +1 -1
- package/ui/ToolbarActionDialog.js.map +1 -1
- package/utils/canUseDOM.d.ts +1 -0
- package/utils/canUseDOM.js +8 -0
- package/utils/canUseDOM.js.map +1 -0
- package/utils/files.d.ts +12 -0
- package/utils/files.js +62 -0
- package/utils/files.js.map +1 -0
- package/utils/findTypographyStyleByHtmlTag.js.map +1 -1
- package/utils/generateInitialLexicalValue.js.map +1 -1
- package/utils/getDOMRangeRect.js.map +1 -1
- package/utils/getLexicalTextSelectionState.js.map +1 -1
- package/utils/getSelectedNode.js.map +1 -1
- package/utils/getTransparentImage.d.ts +1 -0
- package/utils/getTransparentImage.js +10 -0
- package/utils/getTransparentImage.js.map +1 -0
- package/{plugins/AutoLinkPlugin/AutoLinkPlugin.d.ts → utils/isHTMLElement.d.ts} +3 -4
- package/utils/isHTMLElement.js +16 -0
- package/utils/isHTMLElement.js.map +1 -0
- package/utils/isValidJSON.js.map +1 -1
- package/utils/isValidLexicalData.js.map +1 -1
- package/utils/nodes/clearNodeFormating.js.map +1 -1
- package/utils/nodes/formatToHeading.js.map +1 -1
- package/utils/nodes/formatToParagraph.js.map +1 -1
- package/utils/nodes/formatToQuote.js.map +1 -1
- package/utils/nodes/insertImage.d.ts +2 -0
- package/utils/nodes/insertImage.js +22 -0
- package/utils/nodes/insertImage.js.map +1 -0
- package/utils/nodes/listNode.js.map +1 -1
- package/utils/point.js +0 -3
- package/utils/point.js.map +1 -1
- package/utils/rect.js +0 -5
- package/utils/rect.js.map +1 -1
- package/utils/sanitizeUrl.js.map +1 -1
- package/utils/setFloatingElemPosition.js.map +1 -1
- package/utils/styleObjectToString.js.map +1 -1
- package/utils/toTypographyEmotionMap.d.ts +1 -1
- package/utils/toTypographyEmotionMap.js +7 -2
- package/utils/toTypographyEmotionMap.js.map +1 -1
- package/components/AddRichTextEditorNodeType.d.ts +0 -6
- package/components/AddRichTextEditorNodeType.js +0 -28
- package/components/AddRichTextEditorNodeType.js.map +0 -1
- package/components/AddRichTextEditorPlugin.d.ts +0 -12
- package/components/AddRichTextEditorPlugin.js +0 -33
- package/components/AddRichTextEditorPlugin.js.map +0 -1
- package/components/AddToolbarAction.d.ts +0 -7
- package/components/AddToolbarAction.js +0 -33
- package/components/AddToolbarAction.js.map +0 -1
- package/components/Toolbar/HeadingToolbar.d.ts +0 -12
- package/components/Toolbar/HeadingToolbar.js +0 -23
- package/components/Toolbar/HeadingToolbar.js.map +0 -1
- package/components/Toolbar/ParagraphToolbar.d.ts +0 -12
- package/components/Toolbar/ParagraphToolbar.js +0 -23
- package/components/Toolbar/ParagraphToolbar.js.map +0 -1
- package/components/ToolbarPresets/HeadingToolbarPreset.d.ts +0 -2
- package/components/ToolbarPresets/HeadingToolbarPreset.js +0 -56
- package/components/ToolbarPresets/HeadingToolbarPreset.js.map +0 -1
- package/components/ToolbarPresets/ParagraphToolbarPreset.d.ts +0 -2
- package/components/ToolbarPresets/ParagraphToolbarPreset.js +0 -71
- package/components/ToolbarPresets/ParagraphToolbarPreset.js.map +0 -1
- package/plugins/AutoLinkPlugin/AutoLinkPlugin.js +0 -46
- package/plugins/AutoLinkPlugin/AutoLinkPlugin.js.map +0 -1
- package/plugins/AutoLinkPlugin/index.d.ts +0 -1
- package/plugins/AutoLinkPlugin/index.js +0 -16
- package/plugins/AutoLinkPlugin/index.js.map +0 -1
- package/plugins/ClickableLinkPlugin/ClickableLinkPlugin.d.ts +0 -17
- package/plugins/ClickableLinkPlugin/ClickableLinkPlugin.js +0 -88
- package/plugins/ClickableLinkPlugin/ClickableLinkPlugin.js.map +0 -1
- package/plugins/ClickableLinkPlugin/index.d.ts +0 -1
- package/plugins/ClickableLinkPlugin/index.js +0 -16
- package/plugins/ClickableLinkPlugin/index.js.map +0 -1
- package/plugins/WebinyListPLugin/WebinyListPlugin.d.ts +0 -1
- package/plugins/WebinyListPLugin/WebinyListPlugin.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseTextAlignmentDropDown","makeComposable","useEffect","console","log","TextAlignmentActionDropDown","element","TextAlignmentAction","useRichTextEditor","activeEditor","useState","alignmentValue","setAlignmentValue","applyTextAlignment","value","dispatchCommand","FORMAT_ELEMENT_COMMAND","outdentText","OUTDENT_CONTENT_COMMAND","undefined","indentText","INDENT_CONTENT_COMMAND","TextAlignmentDropDown"],"sources":["TextAlignmentAction.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport {\n ElementFormatType,\n FORMAT_ELEMENT_COMMAND,\n INDENT_CONTENT_COMMAND,\n OUTDENT_CONTENT_COMMAND\n} from \"lexical\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nimport { Compose, makeComposable } from \"@webiny/react-composition\";\nimport { TextAlignmentActionContext } from \"~/context/TextAlignmentActionContextProps\";\n\n/*\n * Base text alignment dropdown composable component.\n * Note: To add a custom dropdown component use @see LexicalEditorConfig API.\n */\nexport const BaseTextAlignmentDropDown = makeComposable(\n \"BaseTextAlignmentDropDown\",\n (): JSX.Element | null => {\n useEffect(() => {\n console.log(\"Default BaseTextAlignmentDropDown, please add your own component\");\n }, []);\n return null;\n }\n);\n\ninterface TextAlignmentActionDropdownProps {\n element: JSX.Element;\n}\n\nconst TextAlignmentActionDropDown: React.FC<TextAlignmentActionDropdownProps> = ({\n element\n}): JSX.Element => {\n return <Compose component={BaseTextAlignmentDropDown} with={() => () => element} />;\n};\n\nexport interface TextAlignmentAction extends React.FC<unknown> {\n TextAlignmentDropDown: typeof TextAlignmentActionDropDown;\n}\n\nexport const TextAlignmentAction: TextAlignmentAction = () => {\n const { activeEditor } = useRichTextEditor();\n const [alignmentValue, setAlignmentValue] = useState<ElementFormatType>(\"\");\n const applyTextAlignment = (value: ElementFormatType) => {\n if (activeEditor) {\n activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, value);\n setAlignmentValue(value);\n }\n };\n\n const outdentText = () => {\n if (activeEditor) {\n activeEditor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);\n }\n };\n\n const indentText = () => {\n if (activeEditor) {\n activeEditor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);\n }\n };\n\n return (\n <TextAlignmentActionContext.Provider\n value={{ value: alignmentValue, applyTextAlignment, outdentText, indentText }}\n >\n <BaseTextAlignmentDropDown />\n </TextAlignmentActionContext.Provider>\n );\n};\n\nTextAlignmentAction.TextAlignmentDropDown = TextAlignmentActionDropDown;\n"],"mappings":";;;;;;;;;AAAA;AACA;AAMA;AACA;AACA;AAEA;AACA;AACA;AACA;AACO,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_lexical","_useRichTextEditor2","_reactComposition","_TextAlignmentActionContextProps","BaseTextAlignmentDropDown","makeComposable","useEffect","console","log","exports","TextAlignmentActionDropDown","_ref","element","default","createElement","Compose","component","with","_with","TextAlignmentAction","_useRichTextEditor","useRichTextEditor","activeEditor","_useState","useState","_useState2","_slicedToArray2","alignmentValue","setAlignmentValue","applyTextAlignment","value","dispatchCommand","FORMAT_ELEMENT_COMMAND","outdentText","OUTDENT_CONTENT_COMMAND","undefined","indentText","INDENT_CONTENT_COMMAND","TextAlignmentActionContext","Provider","TextAlignmentDropDown"],"sources":["TextAlignmentAction.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport {\n ElementFormatType,\n FORMAT_ELEMENT_COMMAND,\n INDENT_CONTENT_COMMAND,\n OUTDENT_CONTENT_COMMAND\n} from \"lexical\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nimport { Compose, makeComposable } from \"@webiny/react-composition\";\nimport { TextAlignmentActionContext } from \"~/context/TextAlignmentActionContextProps\";\n\n/*\n * Base text alignment dropdown composable component.\n * Note: To add a custom dropdown component use @see LexicalEditorConfig API.\n */\nexport const BaseTextAlignmentDropDown = makeComposable(\n \"BaseTextAlignmentDropDown\",\n (): JSX.Element | null => {\n useEffect(() => {\n console.log(\"Default BaseTextAlignmentDropDown, please add your own component\");\n }, []);\n return null;\n }\n);\n\ninterface TextAlignmentActionDropdownProps {\n element: JSX.Element;\n}\n\nconst TextAlignmentActionDropDown: React.FC<TextAlignmentActionDropdownProps> = ({\n element\n}): JSX.Element => {\n return <Compose component={BaseTextAlignmentDropDown} with={() => () => element} />;\n};\n\nexport interface TextAlignmentAction extends React.FC<unknown> {\n TextAlignmentDropDown: typeof TextAlignmentActionDropDown;\n}\n\nexport const TextAlignmentAction: TextAlignmentAction = () => {\n const { activeEditor } = useRichTextEditor();\n const [alignmentValue, setAlignmentValue] = useState<ElementFormatType>(\"\");\n const applyTextAlignment = (value: ElementFormatType) => {\n if (activeEditor) {\n activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, value);\n setAlignmentValue(value);\n }\n };\n\n const outdentText = () => {\n if (activeEditor) {\n activeEditor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);\n }\n };\n\n const indentText = () => {\n if (activeEditor) {\n activeEditor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);\n }\n };\n\n return (\n <TextAlignmentActionContext.Provider\n value={{ value: alignmentValue, applyTextAlignment, outdentText, indentText }}\n >\n <BaseTextAlignmentDropDown />\n </TextAlignmentActionContext.Provider>\n );\n};\n\nTextAlignmentAction.TextAlignmentDropDown = TextAlignmentActionDropDown;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,gCAAA,GAAAJ,OAAA;AAEA;AACA;AACA;AACA;AACO,IAAMK,yBAAyB,GAAG,IAAAC,gCAAc,EACnD,2BAA2B,EAC3B,YAA0B;EACtB,IAAAC,gBAAS,EAAC,YAAM;IACZC,OAAO,CAACC,GAAG,CAAC,kEAAkE,CAAC;EACnF,CAAC,EAAE,EAAE,CAAC;EACN,OAAO,IAAI;AACf,CACJ,CAAC;AAACC,OAAA,CAAAL,yBAAA,GAAAA,yBAAA;AAMF,IAAMM,2BAAuE,GAAG,SAA1EA,2BAAuEA,CAAAC,IAAA,EAE1D;EAAA,IADfC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAEP,oBAAOf,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACZ,iBAAA,CAAAa,OAAO;IAACC,SAAS,EAAEZ,yBAA0B;IAACa,IAAI,EAAE,SAAAC,MAAA;MAAA,OAAM;QAAA,OAAMN,OAAO;MAAA;IAAA;EAAC,CAAE,CAAC;AACvF,CAAC;AAMM,IAAMO,mBAAwC,GAAG,SAA3CA,mBAAwCA,CAAA,EAAS;EAC1D,IAAAC,kBAAA,GAAyB,IAAAC,qCAAiB,EAAC,CAAC;IAApCC,YAAY,GAAAF,kBAAA,CAAZE,YAAY;EACpB,IAAAC,SAAA,GAA4C,IAAAC,eAAQ,EAAoB,EAAE,CAAC;IAAAC,UAAA,OAAAC,eAAA,CAAAb,OAAA,EAAAU,SAAA;IAApEI,cAAc,GAAAF,UAAA;IAAEG,iBAAiB,GAAAH,UAAA;EACxC,IAAMI,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,KAAwB,EAAK;IACrD,IAAIR,YAAY,EAAE;MACdA,YAAY,CAACS,eAAe,CAACC,+BAAsB,EAAEF,KAAK,CAAC;MAC3DF,iBAAiB,CAACE,KAAK,CAAC;IAC5B;EACJ,CAAC;EAED,IAAMG,WAAW,GAAG,SAAdA,WAAWA,CAAA,EAAS;IACtB,IAAIX,YAAY,EAAE;MACdA,YAAY,CAACS,eAAe,CAACG,gCAAuB,EAAEC,SAAS,CAAC;IACpE;EACJ,CAAC;EAED,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAA,EAAS;IACrB,IAAId,YAAY,EAAE;MACdA,YAAY,CAACS,eAAe,CAACM,+BAAsB,EAAEF,SAAS,CAAC;IACnE;EACJ,CAAC;EAED,oBACItC,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACX,gCAAA,CAAAmC,0BAA0B,CAACC,QAAQ;IAChCT,KAAK,EAAE;MAAEA,KAAK,EAAEH,cAAc;MAAEE,kBAAkB,EAAlBA,kBAAkB;MAAEI,WAAW,EAAXA,WAAW;MAAEG,UAAU,EAAVA;IAAW;EAAE,gBAE9EvC,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACV,yBAAyB,MAAE,CACK,CAAC;AAE9C,CAAC;AAACK,OAAA,CAAAU,mBAAA,GAAAA,mBAAA;AAEFA,mBAAmB,CAACqB,qBAAqB,GAAG9B,2BAA2B"}
|
|
@@ -140,6 +140,6 @@ var TypographyAction = function TypographyAction() {
|
|
|
140
140
|
};
|
|
141
141
|
exports.TypographyAction = TypographyAction;
|
|
142
142
|
{
|
|
143
|
-
/*
|
|
143
|
+
/* Typography dropdown settings */
|
|
144
144
|
}
|
|
145
145
|
TypographyAction.TypographyDropDown = TypographyActionDropDown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseTypographyActionDropDown","makeComposable","useEffect","console","log","TypographyActionDropDown","element","TypographyAction","useLexicalComposerContext","editor","useState","typography","setTypography","useRichTextEditor","textBlockSelection","themeEmotionMap","isTypographySelected","state","isSelected","isParagraphSelected","paragraph","isHeadingSelected","heading","textType","isQuoteSelected","quote","setTypographySelect","useCallback","value","onTypographySelect","tag","includes","dispatchCommand","ADD_TYPOGRAPHY_ELEMENT_COMMAND","INSERT_ORDERED_WEBINY_LIST_COMMAND","themeStyleId","id","INSERT_UNORDERED_WEBINY_LIST_COMMAND","INSERT_WEBINY_QUOTE_COMMAND","$isTypographyElementNode","el","getTypographyValue","$isParagraphNode","$isHeadingNode","$isQuoteNode","elementWithThemeStyle","styleId","getTypographyStyleId","style","name","css","styles","getStyleId","undefined","elementStyle","applyTypography","TypographyDropDown"],"sources":["TypographyAction.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { LexicalCommand } from \"lexical\";\nimport { Compose, makeComposable } from \"@webiny/react-composition\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext\";\n\nimport { TypographyValue } from \"~/types\";\nimport {\n $isTypographyElementNode,\n ADD_TYPOGRAPHY_ELEMENT_COMMAND,\n TypographyElementNode,\n TypographyPayload\n} from \"~/nodes/TypographyElementNode\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nimport {\n INSERT_ORDERED_WEBINY_LIST_COMMAND,\n INSERT_UNORDERED_WEBINY_LIST_COMMAND,\n WebinyListCommandPayload\n} from \"~/commands/webiny-list\";\nimport { INSERT_WEBINY_QUOTE_COMMAND, WebinyQuoteCommandPayload } from \"~/commands/webiny-quote\";\nimport { $isParagraphNode } from \"~/nodes/ParagraphNode\";\nimport { $isHeadingNode } from \"~/nodes/HeadingNode\";\nimport { $isQuoteNode } from \"~/nodes/QuoteNode\";\n\n/*\n * Base composable action component that is mounted on toolbar action as a placeholder for the custom toolbar action.\n * Note: Toa add custom component access trough @see LexicalEditorConfig API\n * */\nexport const BaseTypographyActionDropDown = makeComposable(\n \"BaseTypographyActionDropDown\",\n (): JSX.Element | null => {\n useEffect(() => {\n console.log(\"Default BaseTypographyActionDropDown, please add your own component\");\n }, []);\n return null;\n }\n);\n\ninterface TypographyActionDropdownProps {\n element: JSX.Element;\n}\n\nconst TypographyActionDropDown: React.FC<TypographyActionDropdownProps> = ({\n element\n}): JSX.Element => {\n return <Compose component={BaseTypographyActionDropDown} with={() => () => element} />;\n};\n\nexport interface TypographyAction extends React.FC<unknown> {\n TypographyDropDown: typeof TypographyActionDropDown;\n}\n\nexport const TypographyAction: TypographyAction = () => {\n const [editor] = useLexicalComposerContext();\n const [typography, setTypography] = useState<TypographyValue>();\n const { textBlockSelection, themeEmotionMap } = useRichTextEditor();\n const isTypographySelected = textBlockSelection?.state?.typography.isSelected || false;\n const isParagraphSelected = textBlockSelection?.state?.paragraph.isSelected || false;\n const isHeadingSelected = textBlockSelection?.state?.heading.isSelected || false;\n const textType = textBlockSelection?.state?.textType;\n const isQuoteSelected = textBlockSelection?.state?.quote.isSelected || false;\n const setTypographySelect = useCallback(\n (value: TypographyValue) => {\n setTypography(value);\n },\n [typography]\n );\n\n const onTypographySelect = useCallback((value: TypographyValue) => {\n setTypographySelect(value);\n if (value.tag.includes(\"h\") || value.tag.includes(\"p\")) {\n editor.dispatchCommand<LexicalCommand<TypographyPayload>>(\n ADD_TYPOGRAPHY_ELEMENT_COMMAND,\n {\n value\n }\n );\n }\n\n if (value.tag === \"ol\") {\n editor.dispatchCommand<LexicalCommand<WebinyListCommandPayload>>(\n INSERT_ORDERED_WEBINY_LIST_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n }\n\n if (value.tag === \"ul\") {\n editor.dispatchCommand<LexicalCommand<WebinyListCommandPayload>>(\n INSERT_UNORDERED_WEBINY_LIST_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n }\n\n if (value.tag === \"quoteblock\") {\n editor.dispatchCommand<LexicalCommand<WebinyQuoteCommandPayload>>(\n INSERT_WEBINY_QUOTE_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n }\n }, []);\n\n useEffect(() => {\n if (textBlockSelection) {\n // header and paragraph elements inserted with typography node\n if ($isTypographyElementNode(textBlockSelection?.element)) {\n const el = textBlockSelection.element as TypographyElementNode;\n setTypography(el.getTypographyValue());\n return;\n }\n\n if (\n $isParagraphNode(textBlockSelection?.element) ||\n $isHeadingNode(textBlockSelection?.element) ||\n $isQuoteNode(textBlockSelection?.element)\n ) {\n const elementWithThemeStyle = textBlockSelection?.element;\n const styleId = elementWithThemeStyle.getTypographyStyleId();\n if (!styleId) {\n return;\n }\n\n if (!themeEmotionMap) {\n return;\n }\n\n const style = themeEmotionMap[styleId];\n if (style) {\n setTypography({\n name: style?.name,\n id: style.id,\n css: style.styles,\n tag: style.tag\n });\n }\n return;\n }\n\n // list and quote element\n if (themeEmotionMap && textBlockSelection?.element?.getStyleId) {\n const themeStyleId = textBlockSelection?.element?.getStyleId() || undefined;\n if (themeStyleId) {\n const elementStyle = themeEmotionMap[themeStyleId];\n if (elementStyle) {\n setTypography({\n id: elementStyle.id,\n css: elementStyle.styles,\n name: elementStyle.name,\n tag: elementStyle.tag\n });\n }\n }\n }\n }\n }, [isTypographySelected, textType, isQuoteSelected, isParagraphSelected, isHeadingSelected]);\n\n return (\n <TypographyActionContext.Provider\n value={{\n value: typography,\n applyTypography: onTypographySelect\n }}\n >\n <BaseTypographyActionDropDown />\n </TypographyActionContext.Provider>\n );\n};\n\n{\n /* Color action settings */\n}\nTypographyAction.TypographyDropDown = TypographyActionDropDown;\n"],"mappings":";;;;;;;;;AAAA;AACA;AAEA;AACA;AAGA;AAMA;AACA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACO,IAAMA,4BAA4B,GAAG,IAAAC,gCAAc,EACtD,8BAA8B,EAC9B,YAA0B;EACtB,IAAAC,gBAAS,EAAC,YAAM;IACZC,OAAO,CAACC,GAAG,CAAC,qEAAqE,CAAC;EACtF,CAAC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wB,EAAE,EAAEkB,YAAY,CAAClB,EAAE;cACnBc,GAAG,EAAEI,YAAY,CAACH,MAAM;cACxBF,IAAI,EAAEK,YAAY,CAACL,IAAI;cACvBnB,GAAG,EAAEwB,YAAY,CAACxB;YACtB,CAAC,CAAC;UACN;QACJ;MACJ;IACJ;EACJ,CAAC,EAAE,CAACd,oBAAoB,EAAEO,QAAQ,EAAEC,eAAe,EAAEL,mBAAmB,EAAEE,iBAAiB,CAAC,CAAC;EAE7F,oBACI,6BAAC,gDAAuB,CAAC,QAAQ;IAC7B,KAAK,EAAE;MACHO,KAAK,EAAEjB,UAAU;MACjB4C,eAAe,EAAE1B;IACrB;EAAE,gBAEF,6BAAC,4BAA4B,OAAG,CACD;AAE3C,CAAC;AAAC;AAEF;EACI;AAAA;AAEJtB,gBAAgB,CAACiD,kBAAkB,GAAGnD,wBAAwB"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_LexicalComposerContext","_reactComposition","_TypographyActionContext","_TypographyElementNode","_useRichTextEditor2","_webinyList","_webinyQuote","_ParagraphNode","_HeadingNode","_QuoteNode","BaseTypographyActionDropDown","makeComposable","useEffect","console","log","exports","TypographyActionDropDown","_ref","element","default","createElement","Compose","component","with","_with","TypographyAction","_textBlockSelection$s","_textBlockSelection$s2","_textBlockSelection$s3","_textBlockSelection$s4","_textBlockSelection$s5","_useLexicalComposerCo","useLexicalComposerContext","_useLexicalComposerCo2","_slicedToArray2","editor","_useState","useState","_useState2","typography","setTypography","_useRichTextEditor","useRichTextEditor","textBlockSelection","themeEmotionMap","isTypographySelected","state","isSelected","isParagraphSelected","paragraph","isHeadingSelected","heading","textType","isQuoteSelected","quote","setTypographySelect","useCallback","value","onTypographySelect","tag","includes","dispatchCommand","ADD_TYPOGRAPHY_ELEMENT_COMMAND","INSERT_ORDERED_WEBINY_LIST_COMMAND","themeStyleId","id","INSERT_UNORDERED_WEBINY_LIST_COMMAND","INSERT_WEBINY_QUOTE_COMMAND","_textBlockSelection$e","$isTypographyElementNode","el","getTypographyValue","$isParagraphNode","$isHeadingNode","$isQuoteNode","elementWithThemeStyle","styleId","getTypographyStyleId","style","name","css","styles","getStyleId","_textBlockSelection$e2","undefined","elementStyle","TypographyActionContext","Provider","applyTypography","TypographyDropDown"],"sources":["TypographyAction.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { LexicalCommand } from \"lexical\";\nimport { Compose, makeComposable } from \"@webiny/react-composition\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext\";\n\nimport { TypographyValue } from \"~/types\";\nimport {\n $isTypographyElementNode,\n ADD_TYPOGRAPHY_ELEMENT_COMMAND,\n TypographyElementNode,\n TypographyPayload\n} from \"~/nodes/TypographyElementNode\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nimport {\n INSERT_ORDERED_WEBINY_LIST_COMMAND,\n INSERT_UNORDERED_WEBINY_LIST_COMMAND,\n WebinyListCommandPayload\n} from \"~/commands/webiny-list\";\nimport { INSERT_WEBINY_QUOTE_COMMAND, WebinyQuoteCommandPayload } from \"~/commands/webiny-quote\";\nimport { $isParagraphNode } from \"~/nodes/ParagraphNode\";\nimport { $isHeadingNode } from \"~/nodes/HeadingNode\";\nimport { $isQuoteNode } from \"~/nodes/QuoteNode\";\n\n/*\n * Base composable action component that is mounted on toolbar action as a placeholder for the custom toolbar action.\n * Note: Toa add custom component access trough @see LexicalEditorConfig API\n * */\nexport const BaseTypographyActionDropDown = makeComposable(\n \"BaseTypographyActionDropDown\",\n (): JSX.Element | null => {\n useEffect(() => {\n console.log(\"Default BaseTypographyActionDropDown, please add your own component\");\n }, []);\n return null;\n }\n);\n\ninterface TypographyActionDropdownProps {\n element: JSX.Element;\n}\n\nconst TypographyActionDropDown: React.FC<TypographyActionDropdownProps> = ({\n element\n}): JSX.Element => {\n return <Compose component={BaseTypographyActionDropDown} with={() => () => element} />;\n};\n\nexport interface TypographyAction extends React.FC<unknown> {\n TypographyDropDown: typeof TypographyActionDropDown;\n}\n\nexport const TypographyAction: TypographyAction = () => {\n const [editor] = useLexicalComposerContext();\n const [typography, setTypography] = useState<TypographyValue>();\n const { textBlockSelection, themeEmotionMap } = useRichTextEditor();\n const isTypographySelected = textBlockSelection?.state?.typography.isSelected || false;\n const isParagraphSelected = textBlockSelection?.state?.paragraph.isSelected || false;\n const isHeadingSelected = textBlockSelection?.state?.heading.isSelected || false;\n const textType = textBlockSelection?.state?.textType;\n const isQuoteSelected = textBlockSelection?.state?.quote.isSelected || false;\n const setTypographySelect = useCallback(\n (value: TypographyValue) => {\n setTypography(value);\n },\n [typography]\n );\n\n const onTypographySelect = useCallback((value: TypographyValue) => {\n setTypographySelect(value);\n if (value.tag.includes(\"h\") || value.tag.includes(\"p\")) {\n editor.dispatchCommand<LexicalCommand<TypographyPayload>>(\n ADD_TYPOGRAPHY_ELEMENT_COMMAND,\n {\n value\n }\n );\n }\n\n if (value.tag === \"ol\") {\n editor.dispatchCommand<LexicalCommand<WebinyListCommandPayload>>(\n INSERT_ORDERED_WEBINY_LIST_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n }\n\n if (value.tag === \"ul\") {\n editor.dispatchCommand<LexicalCommand<WebinyListCommandPayload>>(\n INSERT_UNORDERED_WEBINY_LIST_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n }\n\n if (value.tag === \"quoteblock\") {\n editor.dispatchCommand<LexicalCommand<WebinyQuoteCommandPayload>>(\n INSERT_WEBINY_QUOTE_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n }\n }, []);\n\n useEffect(() => {\n if (textBlockSelection) {\n // header and paragraph elements inserted with typography node\n if ($isTypographyElementNode(textBlockSelection?.element)) {\n const el = textBlockSelection.element as TypographyElementNode;\n setTypography(el.getTypographyValue());\n return;\n }\n\n if (\n $isParagraphNode(textBlockSelection?.element) ||\n $isHeadingNode(textBlockSelection?.element) ||\n $isQuoteNode(textBlockSelection?.element)\n ) {\n const elementWithThemeStyle = textBlockSelection?.element;\n const styleId = elementWithThemeStyle.getTypographyStyleId();\n if (!styleId) {\n return;\n }\n\n if (!themeEmotionMap) {\n return;\n }\n\n const style = themeEmotionMap[styleId];\n if (style) {\n setTypography({\n name: style?.name,\n id: style.id,\n css: style.styles,\n tag: style.tag\n });\n }\n return;\n }\n\n // list and quote element\n if (themeEmotionMap && textBlockSelection?.element?.getStyleId) {\n const themeStyleId = textBlockSelection?.element?.getStyleId() || undefined;\n if (themeStyleId) {\n const elementStyle = themeEmotionMap[themeStyleId];\n if (elementStyle) {\n setTypography({\n id: elementStyle.id,\n css: elementStyle.styles,\n name: elementStyle.name,\n tag: elementStyle.tag\n });\n }\n }\n }\n }\n }, [isTypographySelected, textType, isQuoteSelected, isParagraphSelected, isHeadingSelected]);\n\n return (\n <TypographyActionContext.Provider\n value={{\n value: typography,\n applyTypography: onTypographySelect\n }}\n >\n <BaseTypographyActionDropDown />\n </TypographyActionContext.Provider>\n );\n};\n\n{\n /* Typography dropdown settings */\n}\nTypographyAction.TypographyDropDown = TypographyActionDropDown;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAH,OAAA;AAGA,IAAAI,sBAAA,GAAAJ,OAAA;AAMA,IAAAK,mBAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAKA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAEA;AACA;AACA;AACA;AACO,IAAMW,4BAA4B,GAAG,IAAAC,gCAAc,EACtD,8BAA8B,EAC9B,YAA0B;EACtB,IAAAC,gBAAS,EAAC,YAAM;IACZC,OAAO,CAACC,GAAG,CAAC,qEA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UAAU;MACjBiD,eAAe,EAAE9B;IACrB;EAAE,gBAEF7D,MAAA,CAAAsB,OAAA,CAAAC,aAAA,CAACV,4BAA4B,MAAE,CACD,CAAC;AAE3C,CAAC;AAACK,OAAA,CAAAU,gBAAA,GAAAA,gBAAA;AAEF;EACI;AAAA;AAEJA,gBAAgB,CAACgE,kBAAkB,GAAGzE,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UnderlineAction","useLexicalComposerContext","editor","useState","isUnderline","setIsUnderline","useRichTextEditor","textBlockSelection","isUnderlineSelected","state","underline","useEffect","handleClick","dispatchCommand","FORMAT_TEXT_COMMAND"],"sources":["UnderlineAction.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { FORMAT_TEXT_COMMAND } from \"lexical\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\n\nexport const UnderlineAction = () => {\n const [editor] = useLexicalComposerContext();\n const [isUnderline, setIsUnderline] = useState(false);\n const { textBlockSelection } = useRichTextEditor();\n const isUnderlineSelected = !!textBlockSelection?.state?.underline;\n\n useEffect(() => {\n setIsUnderline(isUnderlineSelected);\n }, [isUnderlineSelected]);\n\n const handleClick = () => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"underline\");\n setIsUnderline(!isUnderline);\n };\n\n return (\n <button\n onClick={() => handleClick()}\n className={\"popup-item spaced \" + (isUnderline ? \"active\" : \"\")}\n aria-label=\"Format text as italic\"\n >\n <i className=\"format underline\" />\n </button>\n );\n};\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AAEO,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_LexicalComposerContext","_lexical","_useRichTextEditor2","UnderlineAction","_textBlockSelection$s","_useLexicalComposerCo","useLexicalComposerContext","_useLexicalComposerCo2","_slicedToArray2","default","editor","_useState","useState","_useState2","isUnderline","setIsUnderline","_useRichTextEditor","useRichTextEditor","textBlockSelection","isUnderlineSelected","state","underline","useEffect","handleClick","dispatchCommand","FORMAT_TEXT_COMMAND","createElement","onClick","className","exports"],"sources":["UnderlineAction.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { FORMAT_TEXT_COMMAND } from \"lexical\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\n\nexport const UnderlineAction = () => {\n const [editor] = useLexicalComposerContext();\n const [isUnderline, setIsUnderline] = useState(false);\n const { textBlockSelection } = useRichTextEditor();\n const isUnderlineSelected = !!textBlockSelection?.state?.underline;\n\n useEffect(() => {\n setIsUnderline(isUnderlineSelected);\n }, [isUnderlineSelected]);\n\n const handleClick = () => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"underline\");\n setIsUnderline(!isUnderline);\n };\n\n return (\n <button\n onClick={() => handleClick()}\n className={\"popup-item spaced \" + (isUnderline ? \"active\" : \"\")}\n aria-label=\"Format text as italic\"\n >\n <i className=\"format underline\" />\n </button>\n );\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAEO,IAAMI,eAAe,GAAG,SAAlBA,eAAeA,CAAA,EAAS;EAAA,IAAAC,qBAAA;EACjC,IAAAC,qBAAA,GAAiB,IAAAC,iDAAyB,EAAC,CAAC;IAAAC,sBAAA,OAAAC,eAAA,CAAAC,OAAA,EAAAJ,qBAAA;IAArCK,MAAM,GAAAH,sBAAA;EACb,IAAAI,SAAA,GAAsC,IAAAC,eAAQ,EAAC,KAAK,CAAC;IAAAC,UAAA,OAAAL,eAAA,CAAAC,OAAA,EAAAE,SAAA;IAA9CG,WAAW,GAAAD,UAAA;IAAEE,cAAc,GAAAF,UAAA;EAClC,IAAAG,kBAAA,GAA+B,IAAAC,qCAAiB,EAAC,CAAC;IAA1CC,kBAAkB,GAAAF,kBAAA,CAAlBE,kBAAkB;EAC1B,IAAMC,mBAAmB,GAAG,CAAC,EAACD,kBAAkB,aAAlBA,kBAAkB,gBAAAd,qBAAA,GAAlBc,kBAAkB,CAAEE,KAAK,cAAAhB,qBAAA,eAAzBA,qBAAA,CAA2BiB,SAAS;EAElE,IAAAC,gBAAS,EAAC,YAAM;IACZP,cAAc,CAACI,mBAAmB,CAAC;EACvC,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;EAEzB,IAAMI,WAAW,GAAG,SAAdA,WAAWA,CAAA,EAAS;IACtBb,MAAM,CAACc,eAAe,CAACC,4BAAmB,EAAE,WAAW,CAAC;IACxDV,cAAc,CAAC,CAACD,WAAW,CAAC;EAChC,CAAC;EAED,oBACIjB,MAAA,CAAAY,OAAA,CAAAiB,aAAA;IACIC,OAAO,EAAE,SAAAA,QAAA;MAAA,OAAMJ,WAAW,CAAC,CAAC;IAAA,CAAC;IAC7BK,SAAS,EAAE,oBAAoB,IAAId,WAAW,GAAG,QAAQ,GAAG,EAAE,CAAE;IAChE,cAAW;EAAuB,gBAElCjB,MAAA,CAAAY,OAAA,CAAAiB,aAAA;IAAGE,SAAS,EAAC;EAAkB,CAAE,CAC7B,CAAC;AAEjB,CAAC;AAACC,OAAA,CAAA1B,eAAA,GAAAA,eAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FontColorActionContext","React","createContext","undefined"],"sources":["FontColorActionContext.tsx"],"sourcesContent":["import React from \"react\";\n\nexport interface FontColorActionContext {\n /*\n * @desc Current selected color value\n * */\n value: string;\n\n /*\n * @desc Apply color to selected text.\n * @params: value\n */\n applyColor: (value: string, themeColorName: string | undefined) => void;\n}\n\nexport const FontColorActionContext = React.createContext<FontColorActionContext | undefined>(\n undefined\n);\n"],"mappings":";;;;;;;AAAA;AAeO,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","FontColorActionContext","React","createContext","undefined","exports"],"sources":["FontColorActionContext.tsx"],"sourcesContent":["import React from \"react\";\n\nexport interface FontColorActionContext {\n /*\n * @desc Current selected color value\n * */\n value: string;\n\n /*\n * @desc Apply color to selected text.\n * @params: value\n */\n applyColor: (value: string, themeColorName: string | undefined) => void;\n}\n\nexport const FontColorActionContext = React.createContext<FontColorActionContext | undefined>(\n undefined\n);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAeO,IAAMC,sBAAsB,gBAAGC,cAAK,CAACC,aAAa,CACrDC,SACJ,CAAC;AAACC,OAAA,CAAAJ,sBAAA,GAAAA,sBAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { TextBlockSelection, ThemeEmotionMap, ToolbarType } from "../types";
|
|
2
|
+
import { TextBlockSelection, ThemeEmotionMap, ToolbarActionPlugin, ToolbarType } from "../types";
|
|
3
3
|
import { WebinyTheme } from "../themes/webinyLexicalTheme";
|
|
4
4
|
import { LexicalEditor } from "lexical";
|
|
5
5
|
export interface RichTextEditorContext {
|
|
@@ -13,6 +13,8 @@ export interface RichTextEditorContext {
|
|
|
13
13
|
setTheme: (theme: WebinyTheme) => void;
|
|
14
14
|
themeEmotionMap?: ThemeEmotionMap;
|
|
15
15
|
setThemeEmotionMap: (themeEmotionMap?: ThemeEmotionMap) => void;
|
|
16
|
+
toolbarActionPlugins: ToolbarActionPlugin[];
|
|
17
|
+
setToolbarActionPlugins: (actionPlugins: ToolbarActionPlugin[]) => void;
|
|
16
18
|
activeEditor?: LexicalEditor;
|
|
17
19
|
setActiveEditor: (editor: LexicalEditor) => void;
|
|
18
20
|
isEditable: boolean;
|
|
@@ -28,21 +28,25 @@ var RichTextEditorProvider = function RichTextEditorProvider(_ref) {
|
|
|
28
28
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
29
29
|
themeEmotionMap = _useState8[0],
|
|
30
30
|
setThemeEmotionMap = _useState8[1];
|
|
31
|
-
var _useState9 = (0, _react.useState)(),
|
|
31
|
+
var _useState9 = (0, _react.useState)([]),
|
|
32
32
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var _useState11 = (0, _react.useState)(
|
|
33
|
+
toolbarActionPlugins = _useState10[0],
|
|
34
|
+
setToolbarActionPlugins = _useState10[1];
|
|
35
|
+
var _useState11 = (0, _react.useState)(),
|
|
36
36
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
activeEditor = _useState12[0],
|
|
38
|
+
setActiveEditor = _useState12[1];
|
|
39
|
+
var _useState13 = (0, _react.useState)(false),
|
|
40
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
41
|
+
isEditable = _useState14[0],
|
|
42
|
+
setIsEditable = _useState14[1];
|
|
39
43
|
/*
|
|
40
44
|
* @desc Keeps data from current user text selection like range selection, nodes, node key...
|
|
41
45
|
*/
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
textBlockSelection =
|
|
45
|
-
setTextBlockSelection =
|
|
46
|
+
var _useState15 = (0, _react.useState)(null),
|
|
47
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
48
|
+
textBlockSelection = _useState16[0],
|
|
49
|
+
setTextBlockSelection = _useState16[1];
|
|
46
50
|
var setNodeIsText = function setNodeIsText(nodeIsText) {
|
|
47
51
|
setIsText(nodeIsText);
|
|
48
52
|
};
|
|
@@ -61,7 +65,9 @@ var RichTextEditorProvider = function RichTextEditorProvider(_ref) {
|
|
|
61
65
|
activeEditor: activeEditor,
|
|
62
66
|
setActiveEditor: setActiveEditor,
|
|
63
67
|
isEditable: isEditable,
|
|
64
|
-
setIsEditable: setIsEditable
|
|
68
|
+
setIsEditable: setIsEditable,
|
|
69
|
+
toolbarActionPlugins: toolbarActionPlugins,
|
|
70
|
+
setToolbarActionPlugins: setToolbarActionPlugins
|
|
65
71
|
}
|
|
66
72
|
}, children);
|
|
67
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RichTextEditorContext","createContext","undefined","RichTextEditorProvider","children","useState","nodeIsText","setIsText","toolbarType","setToolbarType","theme","setTheme","themeEmotionMap","setThemeEmotionMap","activeEditor","setActiveEditor","isEditable","setIsEditable","textBlockSelection","setTextBlockSelection","setNodeIsText"],"sources":["RichTextEditorContext.tsx"],"sourcesContent":["import React, { createContext, useState } from \"react\";\nimport { TextBlockSelection, ThemeEmotionMap, ToolbarType } from \"~/types\";\nimport { WebinyTheme } from \"~/themes/webinyLexicalTheme\";\nimport { LexicalEditor } from \"lexical\";\n\nexport interface RichTextEditorContext {\n nodeIsText: boolean;\n setNodeIsText: (nodeIsText: boolean) => void;\n toolbarType?: ToolbarType;\n setToolbarType: (type: ToolbarType) => void;\n textBlockSelection: TextBlockSelection | null;\n setTextBlockSelection: (textBlockSelection: TextBlockSelection) => void;\n theme?: WebinyTheme;\n setTheme: (theme: WebinyTheme) => void;\n themeEmotionMap?: ThemeEmotionMap;\n setThemeEmotionMap: (themeEmotionMap?: ThemeEmotionMap) => void;\n activeEditor?: LexicalEditor;\n setActiveEditor: (editor: LexicalEditor) => void;\n isEditable: boolean;\n setIsEditable: (isEditable: boolean) => void;\n}\n\nexport const RichTextEditorContext = createContext<RichTextEditorContext | undefined>(undefined);\n\ninterface RichTextEditorProviderProps {\n children?: React.ReactNode | React.ReactNode[];\n}\n\nexport const RichTextEditorProvider: React.FC<RichTextEditorProviderProps> = ({ children }) => {\n const [nodeIsText, setIsText] = useState<boolean>(false);\n const [toolbarType, setToolbarType] = useState<ToolbarType | undefined>();\n const [theme, setTheme] = useState<WebinyTheme | undefined>(undefined);\n const [themeEmotionMap, setThemeEmotionMap] = useState<ThemeEmotionMap | undefined>(undefined);\n const [activeEditor, setActiveEditor] = useState<LexicalEditor>();\n const [isEditable, setIsEditable] = useState<boolean>(false);\n /*\n * @desc Keeps data from current user text selection like range selection, nodes, node key...\n */\n const [textBlockSelection, setTextBlockSelection] = useState<TextBlockSelection | null>(null);\n\n const setNodeIsText = (nodeIsText: boolean) => {\n setIsText(nodeIsText);\n };\n\n return (\n <RichTextEditorContext.Provider\n value={{\n nodeIsText,\n setNodeIsText,\n toolbarType,\n setToolbarType,\n textBlockSelection,\n setTextBlockSelection,\n theme,\n setTheme,\n themeEmotionMap,\n setThemeEmotionMap,\n activeEditor,\n setActiveEditor,\n isEditable,\n setIsEditable\n }}\n >\n {children}\n </RichTextEditorContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;AAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","RichTextEditorContext","createContext","undefined","exports","RichTextEditorProvider","_ref","children","_useState","useState","_useState2","_slicedToArray2","default","nodeIsText","setIsText","_useState3","_useState4","toolbarType","setToolbarType","_useState5","_useState6","theme","setTheme","_useState7","_useState8","themeEmotionMap","setThemeEmotionMap","_useState9","_useState10","toolbarActionPlugins","setToolbarActionPlugins","_useState11","_useState12","activeEditor","setActiveEditor","_useState13","_useState14","isEditable","setIsEditable","_useState15","_useState16","textBlockSelection","setTextBlockSelection","setNodeIsText","createElement","Provider","value"],"sources":["RichTextEditorContext.tsx"],"sourcesContent":["import React, { createContext, useState } from \"react\";\nimport { TextBlockSelection, ThemeEmotionMap, ToolbarActionPlugin, ToolbarType } from \"~/types\";\nimport { WebinyTheme } from \"~/themes/webinyLexicalTheme\";\nimport { LexicalEditor } from \"lexical\";\n\nexport interface RichTextEditorContext {\n nodeIsText: boolean;\n setNodeIsText: (nodeIsText: boolean) => void;\n toolbarType?: ToolbarType;\n setToolbarType: (type: ToolbarType) => void;\n textBlockSelection: TextBlockSelection | null;\n setTextBlockSelection: (textBlockSelection: TextBlockSelection) => void;\n theme?: WebinyTheme;\n setTheme: (theme: WebinyTheme) => void;\n themeEmotionMap?: ThemeEmotionMap;\n setThemeEmotionMap: (themeEmotionMap?: ThemeEmotionMap) => void;\n toolbarActionPlugins: ToolbarActionPlugin[];\n setToolbarActionPlugins: (actionPlugins: ToolbarActionPlugin[]) => void;\n activeEditor?: LexicalEditor;\n setActiveEditor: (editor: LexicalEditor) => void;\n isEditable: boolean;\n setIsEditable: (isEditable: boolean) => void;\n}\n\nexport const RichTextEditorContext = createContext<RichTextEditorContext | undefined>(undefined);\n\ninterface RichTextEditorProviderProps {\n children?: React.ReactNode | React.ReactNode[];\n}\n\nexport const RichTextEditorProvider: React.FC<RichTextEditorProviderProps> = ({ children }) => {\n const [nodeIsText, setIsText] = useState<boolean>(false);\n const [toolbarType, setToolbarType] = useState<ToolbarType | undefined>();\n const [theme, setTheme] = useState<WebinyTheme | undefined>(undefined);\n const [themeEmotionMap, setThemeEmotionMap] = useState<ThemeEmotionMap | undefined>(undefined);\n const [toolbarActionPlugins, setToolbarActionPlugins] = useState<ToolbarActionPlugin[]>([]);\n const [activeEditor, setActiveEditor] = useState<LexicalEditor>();\n const [isEditable, setIsEditable] = useState<boolean>(false);\n /*\n * @desc Keeps data from current user text selection like range selection, nodes, node key...\n */\n const [textBlockSelection, setTextBlockSelection] = useState<TextBlockSelection | null>(null);\n\n const setNodeIsText = (nodeIsText: boolean) => {\n setIsText(nodeIsText);\n };\n\n return (\n <RichTextEditorContext.Provider\n value={{\n nodeIsText,\n setNodeIsText,\n toolbarType,\n setToolbarType,\n textBlockSelection,\n setTextBlockSelection,\n theme,\n setTheme,\n themeEmotionMap,\n setThemeEmotionMap,\n activeEditor,\n setActiveEditor,\n isEditable,\n setIsEditable,\n toolbarActionPlugins,\n setToolbarActionPlugins\n }}\n >\n {children}\n </RichTextEditorContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAwBO,IAAMC,qBAAqB,gBAAG,IAAAC,oBAAa,EAAoCC,SAAS,CAAC;AAACC,OAAA,CAAAH,qBAAA,GAAAA,q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AAA,EAAAuB,WAAA;IAArDE,UAAU,GAAAD,WAAA;IAAEE,aAAa,GAAAF,WAAA;EAChC;AACJ;AACA;EACI,IAAAG,WAAA,GAAoD,IAAA9B,eAAQ,EAA4B,IAAI,CAAC;IAAA+B,WAAA,OAAA7B,eAAA,CAAAC,OAAA,EAAA2B,WAAA;IAAtFE,kBAAkB,GAAAD,WAAA;IAAEE,qBAAqB,GAAAF,WAAA;EAEhD,IAAMG,aAAa,GAAG,SAAhBA,aAAaA,CAAI9B,UAAmB,EAAK;IAC3CC,SAAS,CAACD,UAAU,CAAC;EACzB,CAAC;EAED,oBACIf,MAAA,CAAAc,OAAA,CAAAgC,aAAA,CAAC3C,qBAAqB,CAAC4C,QAAQ;IAC3BC,KAAK,EAAE;MACHjC,UAAU,EAAVA,UAAU;MACV8B,aAAa,EAAbA,aAAa;MACb1B,WAAW,EAAXA,WAAW;MACXC,cAAc,EAAdA,cAAc;MACduB,kBAAkB,EAAlBA,kBAAkB;MAClBC,qBAAqB,EAArBA,qBAAqB;MACrBrB,KAAK,EAALA,KAAK;MACLC,QAAQ,EAARA,QAAQ;MACRG,eAAe,EAAfA,eAAe;MACfC,kBAAkB,EAAlBA,kBAAkB;MAClBO,YAAY,EAAZA,YAAY;MACZC,eAAe,EAAfA,eAAe;MACfG,UAAU,EAAVA,UAAU;MACVC,aAAa,EAAbA,aAAa;MACbT,oBAAoB,EAApBA,oBAAoB;MACpBC,uBAAuB,EAAvBA;IACJ;EAAE,GAEDvB,QAC2B,CAAC;AAEzC,CAAC;AAACH,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Context","createContext","SharedHistoryContext","children","historyContext","useMemo","historyState","createEmptyHistoryState","useSharedHistoryContext","useContext"],"sources":["SharedHistoryContext.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { createContext, ReactNode, useContext, useMemo } from \"react\";\nimport { createEmptyHistoryState, HistoryState } from \"@lexical/history\";\n\ntype ContextShape = {\n historyState?: HistoryState;\n};\n\nconst Context: React.Context<ContextShape> = createContext({});\n\nexport const SharedHistoryContext = ({ children }: { children: ReactNode }): JSX.Element => {\n const historyContext = useMemo(() => ({ historyState: createEmptyHistoryState() }), []);\n return <Context.Provider value={historyContext}>{children}</Context.Provider>;\n};\n\nexport const useSharedHistoryContext = (): ContextShape => {\n return useContext(Context);\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AAMA,
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_history","Context","createContext","SharedHistoryContext","_ref","children","historyContext","useMemo","historyState","createEmptyHistoryState","createElement","Provider","value","exports","useSharedHistoryContext","useContext"],"sources":["SharedHistoryContext.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { createContext, ReactNode, useContext, useMemo } from \"react\";\nimport { createEmptyHistoryState, HistoryState } from \"@lexical/history\";\n\ntype ContextShape = {\n historyState?: HistoryState;\n};\n\nconst Context: React.Context<ContextShape> = createContext({});\n\nexport const SharedHistoryContext = ({ children }: { children: ReactNode }): JSX.Element => {\n const historyContext = useMemo(() => ({ historyState: createEmptyHistoryState() }), []);\n return <Context.Provider value={historyContext}>{children}</Context.Provider>;\n};\n\nexport const useSharedHistoryContext = (): ContextShape => {\n return useContext(Context);\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAME,OAAoC,gBAAG,IAAAC,mBAAa,EAAC,CAAC,CAAC,CAAC;AAEvD,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAA2D;EAAA,IAArDC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EAC3C,IAAMC,cAAc,GAAG,IAAAC,aAAO,EAAC;IAAA,OAAO;MAAEC,YAAY,EAAE,IAAAC,gCAAuB,EAAC;IAAE,CAAC;EAAA,CAAC,EAAE,EAAE,CAAC;EACvF,oBAAOZ,KAAA,CAAAa,aAAA,CAACT,OAAO,CAACU,QAAQ;IAACC,KAAK,EAAEN;EAAe,GAAED,QAA2B,CAAC;AACjF,CAAC;AAACQ,OAAA,CAAAV,oBAAA,GAAAA,oBAAA;AAEK,IAAMW,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAA,EAAuB;EACvD,OAAO,IAAAC,gBAAU,EAACd,OAAO,CAAC;AAC9B,CAAC;AAACY,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextAlignmentActionContext","React","createContext","undefined"],"sources":["TextAlignmentActionContextProps.tsx"],"sourcesContent":["import React from \"react\";\nimport { ElementFormatType } from \"lexical\";\n\nexport interface TextAlignmentActionContextProps {\n /*\n * Selected text alignment value\n * */\n value: ElementFormatType;\n\n /*\n * Apply text alignment to selected text\n */\n applyTextAlignment: (value: ElementFormatType) => void;\n\n outdentText: () => void;\n\n indentText: () => void;\n}\n\nexport const TextAlignmentActionContext = React.createContext<\n TextAlignmentActionContextProps | undefined\n>(undefined);\n"],"mappings":";;;;;;;AAAA;AAmBO,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","TextAlignmentActionContext","React","createContext","undefined","exports"],"sources":["TextAlignmentActionContextProps.tsx"],"sourcesContent":["import React from \"react\";\nimport { ElementFormatType } from \"lexical\";\n\nexport interface TextAlignmentActionContextProps {\n /*\n * Selected text alignment value\n * */\n value: ElementFormatType;\n\n /*\n * Apply text alignment to selected text\n */\n applyTextAlignment: (value: ElementFormatType) => void;\n\n outdentText: () => void;\n\n indentText: () => void;\n}\n\nexport const TextAlignmentActionContext = React.createContext<\n TextAlignmentActionContextProps | undefined\n>(undefined);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAmBO,IAAMC,0BAA0B,gBAAGC,cAAK,CAACC,aAAa,CAE3DC,SAAS,CAAC;AAACC,OAAA,CAAAJ,0BAAA,GAAAA,0BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TypographyActionContext","React","createContext","undefined"],"sources":["TypographyActionContext.tsx"],"sourcesContent":["import React from \"react\";\nimport { TypographyValue } from \"~/types\";\n\nexport interface TypographyActionContextProps {\n /*\n * @desc Current selected typography\n * */\n value: TypographyValue | undefined;\n\n /*\n * @desc Apply font family to selected text.\n * @params: value\n */\n applyTypography: (value: TypographyValue) => void;\n}\n\nexport const TypographyActionContext = React.createContext<\n TypographyActionContextProps | undefined\n>(undefined);\n"],"mappings":";;;;;;;AAAA;AAgBO,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","TypographyActionContext","React","createContext","undefined","exports"],"sources":["TypographyActionContext.tsx"],"sourcesContent":["import React from \"react\";\nimport { TypographyValue } from \"~/types\";\n\nexport interface TypographyActionContextProps {\n /*\n * @desc Current selected typography\n * */\n value: TypographyValue | undefined;\n\n /*\n * @desc Apply font family to selected text.\n * @params: value\n */\n applyTypography: (value: TypographyValue) => void;\n}\n\nexport const TypographyActionContext = React.createContext<\n TypographyActionContextProps | undefined\n>(undefined);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAgBO,IAAMC,uBAAuB,gBAAGC,cAAK,CAACC,aAAa,CAExDC,SAAS,CAAC;AAACC,OAAA,CAAAJ,uBAAA,GAAAA,uBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFontColorPicker","context","useContext","FontColorActionContext","Error"],"sources":["useFontColorPicker.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { FontColorActionContext } from \"~/context/FontColorActionContext\";\n\nexport function useFontColorPicker() {\n const context = useContext(FontColorActionContext);\n if (!context) {\n throw Error(\n `Missing FontColorActionContext in the component hierarchy. Are you using \"useFontColorPicker()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA;AACA;AAEO,
|
|
1
|
+
{"version":3,"names":["_react","require","_FontColorActionContext","useFontColorPicker","context","useContext","FontColorActionContext","Error"],"sources":["useFontColorPicker.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { FontColorActionContext } from \"~/context/FontColorActionContext\";\n\nexport function useFontColorPicker() {\n const context = useContext(FontColorActionContext);\n if (!context) {\n throw Error(\n `Missing FontColorActionContext in the component hierarchy. Are you using \"useFontColorPicker()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AAEO,SAASE,kBAAkBA,CAAA,EAAG;EACjC,IAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,8CAAsB,CAAC;EAClD,IAAI,CAACF,OAAO,EAAE;IACV,MAAMG,KAAK,wHAEX,CAAC;EACL;EAEA,OAAOH,OAAO;AAClB"}
|
package/hooks/useList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useList","editor","useEffect","mergeRegister","registerCommand","INDENT_CONTENT_COMMAND","indentList","COMMAND_PRIORITY_LOW","OUTDENT_CONTENT_COMMAND","outdentList","INSERT_ORDERED_WEBINY_LIST_COMMAND","themeStyleId","insertList","INSERT_UNORDERED_WEBINY_LIST_COMMAND","REMOVE_WEBINY_LIST_COMMAND","removeList","INSERT_PARAGRAPH_COMMAND","hasHandledInsertParagraph","$handleListInsertParagraph"],"sources":["useList.ts"],"sourcesContent":["import type { LexicalEditor } from \"lexical\";\nimport { mergeRegister } from \"@lexical/utils\";\nimport {\n COMMAND_PRIORITY_LOW,\n INDENT_CONTENT_COMMAND,\n INSERT_PARAGRAPH_COMMAND,\n OUTDENT_CONTENT_COMMAND\n} from \"lexical\";\nimport { useEffect } from \"react\";\nimport {\n $handleListInsertParagraph,\n indentList,\n insertList,\n outdentList,\n removeList\n} from \"~/nodes/ListNode/formatList\";\nimport {\n INSERT_ORDERED_WEBINY_LIST_COMMAND,\n INSERT_UNORDERED_WEBINY_LIST_COMMAND,\n REMOVE_WEBINY_LIST_COMMAND\n} from \"~/commands/webiny-list\";\n\nexport function useList(editor: LexicalEditor): void {\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n INDENT_CONTENT_COMMAND,\n () => {\n indentList();\n return false;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n OUTDENT_CONTENT_COMMAND,\n () => {\n outdentList();\n return false;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n INSERT_ORDERED_WEBINY_LIST_COMMAND,\n ({ themeStyleId }) => {\n insertList(editor, \"number\", themeStyleId);\n return true;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n INSERT_UNORDERED_WEBINY_LIST_COMMAND,\n ({ themeStyleId }) => {\n insertList(editor, \"bullet\", themeStyleId);\n return true;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n REMOVE_WEBINY_LIST_COMMAND,\n () => {\n removeList(editor);\n return true;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n INSERT_PARAGRAPH_COMMAND,\n () => {\n const hasHandledInsertParagraph = $handleListInsertParagraph();\n\n if (hasHandledInsertParagraph) {\n return true;\n }\n\n return false;\n },\n COMMAND_PRIORITY_LOW\n )\n );\n }, [editor]);\n}\n"],"mappings":";;;;;;AACA;AACA;AAMA;AACA;AAOA;AAMO,
|
|
1
|
+
{"version":3,"names":["_utils","require","_lexical","_react","_formatList","_webinyList","useList","editor","useEffect","mergeRegister","registerCommand","INDENT_CONTENT_COMMAND","indentList","COMMAND_PRIORITY_LOW","OUTDENT_CONTENT_COMMAND","outdentList","INSERT_ORDERED_WEBINY_LIST_COMMAND","_ref","themeStyleId","insertList","INSERT_UNORDERED_WEBINY_LIST_COMMAND","_ref2","REMOVE_WEBINY_LIST_COMMAND","removeList","INSERT_PARAGRAPH_COMMAND","hasHandledInsertParagraph","$handleListInsertParagraph"],"sources":["useList.ts"],"sourcesContent":["import type { LexicalEditor } from \"lexical\";\nimport { mergeRegister } from \"@lexical/utils\";\nimport {\n COMMAND_PRIORITY_LOW,\n INDENT_CONTENT_COMMAND,\n INSERT_PARAGRAPH_COMMAND,\n OUTDENT_CONTENT_COMMAND\n} from \"lexical\";\nimport { useEffect } from \"react\";\nimport {\n $handleListInsertParagraph,\n indentList,\n insertList,\n outdentList,\n removeList\n} from \"~/nodes/ListNode/formatList\";\nimport {\n INSERT_ORDERED_WEBINY_LIST_COMMAND,\n INSERT_UNORDERED_WEBINY_LIST_COMMAND,\n REMOVE_WEBINY_LIST_COMMAND\n} from \"~/commands/webiny-list\";\n\nexport function useList(editor: LexicalEditor): void {\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n INDENT_CONTENT_COMMAND,\n () => {\n indentList();\n return false;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n OUTDENT_CONTENT_COMMAND,\n () => {\n outdentList();\n return false;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n INSERT_ORDERED_WEBINY_LIST_COMMAND,\n ({ themeStyleId }) => {\n insertList(editor, \"number\", themeStyleId);\n return true;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n INSERT_UNORDERED_WEBINY_LIST_COMMAND,\n ({ themeStyleId }) => {\n insertList(editor, \"bullet\", themeStyleId);\n return true;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n REMOVE_WEBINY_LIST_COMMAND,\n () => {\n removeList(editor);\n return true;\n },\n COMMAND_PRIORITY_LOW\n ),\n editor.registerCommand(\n INSERT_PARAGRAPH_COMMAND,\n () => {\n const hasHandledInsertParagraph = $handleListInsertParagraph();\n\n if (hasHandledInsertParagraph) {\n return true;\n }\n\n return false;\n },\n COMMAND_PRIORITY_LOW\n )\n );\n }, [editor]);\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,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DZ,6BACJ,CACJ,CAAC;EACL,CAAC,EAAE,CAACN,MAAM,CAAC,CAAC;AAChB"}
|
package/hooks/useQuote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useQuote","editor","useEffect","mergeRegister","registerCommand","INSERT_WEBINY_QUOTE_COMMAND","themeStyleId","formatToQuote","COMMAND_PRIORITY_LOW"],"sources":["useQuote.ts"],"sourcesContent":["import type { LexicalEditor } from \"lexical\";\nimport { mergeRegister } from \"@lexical/utils\";\nimport { COMMAND_PRIORITY_LOW } from \"lexical\";\nimport { useEffect } from \"react\";\nimport { INSERT_WEBINY_QUOTE_COMMAND } from \"~/commands/webiny-quote\";\nimport { formatToQuote } from \"~/utils/nodes/formatToQuote\";\n\nexport function useQuote(editor: LexicalEditor): void {\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n INSERT_WEBINY_QUOTE_COMMAND,\n ({ themeStyleId }) => {\n formatToQuote(editor, themeStyleId);\n return false;\n },\n COMMAND_PRIORITY_LOW\n )\n );\n }, [editor]);\n}\n"],"mappings":";;;;;;AACA;AACA;AACA;AACA;AACA;AAEO,
|
|
1
|
+
{"version":3,"names":["_utils","require","_lexical","_react","_webinyQuote","_formatToQuote","useQuote","editor","useEffect","mergeRegister","registerCommand","INSERT_WEBINY_QUOTE_COMMAND","_ref","themeStyleId","formatToQuote","COMMAND_PRIORITY_LOW"],"sources":["useQuote.ts"],"sourcesContent":["import type { LexicalEditor } from \"lexical\";\nimport { mergeRegister } from \"@lexical/utils\";\nimport { COMMAND_PRIORITY_LOW } from \"lexical\";\nimport { useEffect } from \"react\";\nimport { INSERT_WEBINY_QUOTE_COMMAND } from \"~/commands/webiny-quote\";\nimport { formatToQuote } from \"~/utils/nodes/formatToQuote\";\n\nexport function useQuote(editor: LexicalEditor): void {\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n INSERT_WEBINY_QUOTE_COMMAND,\n ({ themeStyleId }) => {\n formatToQuote(editor, themeStyleId);\n return false;\n },\n COMMAND_PRIORITY_LOW\n )\n );\n }, [editor]);\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAEO,SAASK,QAAQA,CAACC,MAAqB,EAAQ;EAClD,IAAAC,gBAAS,EAAC,YAAM;IACZ,OAAO,IAAAC,oBAAa,EAChBF,MAAM,CAACG,eAAe,CAClBC,wCAA2B,EAC3B,UAAAC,IAAA,EAAsB;MAAA,IAAnBC,YAAY,GAAAD,IAAA,CAAZC,YAAY;MACX,IAAAC,4BAAa,EAACP,MAAM,EAAEM,YAAY,CAAC;MACnC,OAAO,KAAK;IAChB,CAAC,EACDE,6BACJ,CACJ,CAAC;EACL,CAAC,EAAE,CAACR,MAAM,CAAC,CAAC;AAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRichTextEditor","context","useContext","RichTextEditorContext","Error"],"sources":["useRichTextEditor.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { RichTextEditorContext } from \"~/context/RichTextEditorContext\";\n\nexport function useRichTextEditor() {\n const context = useContext(RichTextEditorContext);\n if (!context) {\n throw Error(\n `Missing RichTextEditorContext in the component hierarchy. Are you using \"useRichTextEditor()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA;AACA;AAEO,
|
|
1
|
+
{"version":3,"names":["_react","require","_RichTextEditorContext","useRichTextEditor","context","useContext","RichTextEditorContext","Error"],"sources":["useRichTextEditor.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { RichTextEditorContext } from \"~/context/RichTextEditorContext\";\n\nexport function useRichTextEditor() {\n const context = useContext(RichTextEditorContext);\n if (!context) {\n throw Error(\n `Missing RichTextEditorContext in the component hierarchy. Are you using \"useRichTextEditor()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAEO,SAASE,iBAAiBA,CAAA,EAAG;EAChC,IAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,4CAAqB,CAAC;EACjD,IAAI,CAACF,OAAO,EAAE;IACV,MAAMG,KAAK,sHAEX,CAAC;EACL;EAEA,OAAOH,OAAO;AAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useTextAlignmentAction","context","useContext","TextAlignmentActionContext","Error"],"sources":["useTextAlignmentAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TextAlignmentActionContext } from \"~/context/TextAlignmentActionContextProps\";\n\nexport function useTextAlignmentAction() {\n const context = useContext(TextAlignmentActionContext);\n if (!context) {\n throw Error(\n `Missing TextAlignmentActionContext in the component hierarchy. Are you using \"useTextAlignmentAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA;AACA;AAEO,
|
|
1
|
+
{"version":3,"names":["_react","require","_TextAlignmentActionContextProps","useTextAlignmentAction","context","useContext","TextAlignmentActionContext","Error"],"sources":["useTextAlignmentAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TextAlignmentActionContext } from \"~/context/TextAlignmentActionContextProps\";\n\nexport function useTextAlignmentAction() {\n const context = useContext(TextAlignmentActionContext);\n if (!context) {\n throw Error(\n `Missing TextAlignmentActionContext in the component hierarchy. Are you using \"useTextAlignmentAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,gCAAA,GAAAD,OAAA;AAEO,SAASE,sBAAsBA,CAAA,EAAG;EACrC,IAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,2DAA0B,CAAC;EACtD,IAAI,CAACF,OAAO,EAAE;IACV,MAAMG,KAAK,gIAEX,CAAC;EACL;EAEA,OAAOH,OAAO;AAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useTypographyAction","context","useContext","TypographyActionContext","Error"],"sources":["useTypographyAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext\";\n\nexport function useTypographyAction() {\n const context = useContext(TypographyActionContext);\n if (!context) {\n throw Error(\n `Missing TypographyActionContext in the component hierarchy. Are you using \"useTypographyAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA;AACA;AAEO,
|
|
1
|
+
{"version":3,"names":["_react","require","_TypographyActionContext","useTypographyAction","context","useContext","TypographyActionContext","Error"],"sources":["useTypographyAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext\";\n\nexport function useTypographyAction() {\n const context = useContext(TypographyActionContext);\n if (!context) {\n throw Error(\n `Missing TypographyActionContext in the component hierarchy. Are you using \"useTypographyAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAEO,SAASE,mBAAmBA,CAAA,EAAG;EAClC,IAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,gDAAuB,CAAC;EACnD,IAAI,CAACF,OAAO,EAAE;IACV,MAAMG,KAAK,0HAEX,CAAC;EACL;EAEA,OAAOH,OAAO;AAClB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-image" viewBox="0 0 16 16">
|
|
2
|
+
<path d="M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/>
|
|
3
|
+
<path d="M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z"/>
|
|
4
|
+
</svg>
|
package/index.d.ts
CHANGED
|
@@ -18,25 +18,25 @@ export { QuoteAction } from "./components/ToolbarActions/QuoteAction";
|
|
|
18
18
|
export { UnderlineAction } from "./components/ToolbarActions/UnderlineAction";
|
|
19
19
|
export { TypographyAction } from "./components/ToolbarActions/TypographyAction";
|
|
20
20
|
export { TextAlignmentAction } from "./components/ToolbarActions/TextAlignmentAction";
|
|
21
|
-
export {
|
|
22
|
-
export { ParagraphToolbar } from "./components/Toolbar/ParagraphToolbar";
|
|
21
|
+
export { ImageAction } from "./components/ToolbarActions/ImageAction";
|
|
23
22
|
export { Toolbar } from "./components/Toolbar/Toolbar";
|
|
24
|
-
export {
|
|
25
|
-
export { HeadingToolbarPreset } from "./components/ToolbarPresets/HeadingToolbarPreset";
|
|
23
|
+
export { StaticToolbar } from "./components/Toolbar/StaticToolbar";
|
|
26
24
|
export { RichTextEditor } from "./components/Editor/RichTextEditor";
|
|
27
25
|
export { HeadingEditor } from "./components/Editor/HeadingEditor";
|
|
28
26
|
export { ParagraphEditor } from "./components/Editor/ParagraphEditor";
|
|
29
27
|
export { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
|
30
28
|
export { FloatingLinkEditorPlugin } from "./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin";
|
|
31
29
|
export { CodeHighlightPlugin } from "./plugins/CodeHighlightPlugin/CodeHighlightPlugin";
|
|
32
|
-
export { ClickableLinkPlugin } from "./plugins/ClickableLinkPlugin/ClickableLinkPlugin";
|
|
33
30
|
export { BlurEventPlugin } from "./plugins/BlurEventPlugin/BlurEventPlugin";
|
|
34
31
|
export { LexicalUpdateStatePlugin } from "./plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin";
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
32
|
+
export { FontColorPlugin } from "./plugins/FontColorPlugin/FontColorPlugin";
|
|
33
|
+
export { TypographyPlugin } from "./plugins/TypographyPlugin/TypographyPlugin";
|
|
34
|
+
export { QuotePlugin } from "./plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin";
|
|
35
|
+
export { ListPlugin } from "./plugins/ListPLugin/ListPlugin";
|
|
36
|
+
export { ImagesPlugin } from "./plugins/ImagesPlugin/ImagesPlugin";
|
|
38
37
|
export { generateInitialLexicalValue } from "./utils/generateInitialLexicalValue";
|
|
39
38
|
export { isValidLexicalData } from "./utils/isValidLexicalData";
|
|
40
39
|
export { clearNodeFormatting } from "./utils/nodes/clearNodeFormating";
|
|
40
|
+
export { INSERT_IMAGE_COMMAND } from "./commands/insertFiles";
|
|
41
41
|
export * as types from "./types";
|
|
42
|
-
export { LexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig";
|
|
42
|
+
export { LexicalEditorConfig, useLexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig";
|
package/index.js
CHANGED
|
@@ -4,24 +4,6 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
Object.defineProperty(exports, "AddRichTextEditorNodeType", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _AddRichTextEditorNodeType.AddRichTextEditorNodeType;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "AddRichTextEditorPlugin", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _AddRichTextEditorPlugin.AddRichTextEditorPlugin;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "AddToolbarAction", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _AddToolbarAction.AddToolbarAction;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
7
|
Object.defineProperty(exports, "BlurEventPlugin", {
|
|
26
8
|
enumerable: true,
|
|
27
9
|
get: function get() {
|
|
@@ -40,12 +22,6 @@ Object.defineProperty(exports, "BulletListAction", {
|
|
|
40
22
|
return _BulletListAction.BulletListAction;
|
|
41
23
|
}
|
|
42
24
|
});
|
|
43
|
-
Object.defineProperty(exports, "ClickableLinkPlugin", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function get() {
|
|
46
|
-
return _ClickableLinkPlugin.ClickableLinkPlugin;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
25
|
Object.defineProperty(exports, "CodeHighlightAction", {
|
|
50
26
|
enumerable: true,
|
|
51
27
|
get: function get() {
|
|
@@ -88,6 +64,12 @@ Object.defineProperty(exports, "FontColorAction", {
|
|
|
88
64
|
return _FontColorAction.FontColorAction;
|
|
89
65
|
}
|
|
90
66
|
});
|
|
67
|
+
Object.defineProperty(exports, "FontColorPlugin", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _FontColorPlugin.FontColorPlugin;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
91
73
|
Object.defineProperty(exports, "FontSizeAction", {
|
|
92
74
|
enumerable: true,
|
|
93
75
|
get: function get() {
|
|
@@ -100,16 +82,22 @@ Object.defineProperty(exports, "HeadingEditor", {
|
|
|
100
82
|
return _HeadingEditor.HeadingEditor;
|
|
101
83
|
}
|
|
102
84
|
});
|
|
103
|
-
Object.defineProperty(exports, "
|
|
85
|
+
Object.defineProperty(exports, "INSERT_IMAGE_COMMAND", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function get() {
|
|
88
|
+
return _insertFiles.INSERT_IMAGE_COMMAND;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(exports, "ImageAction", {
|
|
104
92
|
enumerable: true,
|
|
105
93
|
get: function get() {
|
|
106
|
-
return
|
|
94
|
+
return _ImageAction.ImageAction;
|
|
107
95
|
}
|
|
108
96
|
});
|
|
109
|
-
Object.defineProperty(exports, "
|
|
97
|
+
Object.defineProperty(exports, "ImagesPlugin", {
|
|
110
98
|
enumerable: true,
|
|
111
99
|
get: function get() {
|
|
112
|
-
return
|
|
100
|
+
return _ImagesPlugin.ImagesPlugin;
|
|
113
101
|
}
|
|
114
102
|
});
|
|
115
103
|
Object.defineProperty(exports, "ItalicAction", {
|
|
@@ -148,6 +136,12 @@ Object.defineProperty(exports, "LinkPlugin", {
|
|
|
148
136
|
return _LexicalLinkPlugin.LinkPlugin;
|
|
149
137
|
}
|
|
150
138
|
});
|
|
139
|
+
Object.defineProperty(exports, "ListPlugin", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function get() {
|
|
142
|
+
return _ListPlugin.ListPlugin;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
151
145
|
Object.defineProperty(exports, "NumberedListAction", {
|
|
152
146
|
enumerable: true,
|
|
153
147
|
get: function get() {
|
|
@@ -160,28 +154,28 @@ Object.defineProperty(exports, "ParagraphEditor", {
|
|
|
160
154
|
return _ParagraphEditor.ParagraphEditor;
|
|
161
155
|
}
|
|
162
156
|
});
|
|
163
|
-
Object.defineProperty(exports, "
|
|
157
|
+
Object.defineProperty(exports, "QuoteAction", {
|
|
164
158
|
enumerable: true,
|
|
165
159
|
get: function get() {
|
|
166
|
-
return
|
|
160
|
+
return _QuoteAction.QuoteAction;
|
|
167
161
|
}
|
|
168
162
|
});
|
|
169
|
-
Object.defineProperty(exports, "
|
|
163
|
+
Object.defineProperty(exports, "QuotePlugin", {
|
|
170
164
|
enumerable: true,
|
|
171
165
|
get: function get() {
|
|
172
|
-
return
|
|
166
|
+
return _WebinyQuoteNodePlugin.QuotePlugin;
|
|
173
167
|
}
|
|
174
168
|
});
|
|
175
|
-
Object.defineProperty(exports, "
|
|
169
|
+
Object.defineProperty(exports, "RichTextEditor", {
|
|
176
170
|
enumerable: true,
|
|
177
171
|
get: function get() {
|
|
178
|
-
return
|
|
172
|
+
return _RichTextEditor.RichTextEditor;
|
|
179
173
|
}
|
|
180
174
|
});
|
|
181
|
-
Object.defineProperty(exports, "
|
|
175
|
+
Object.defineProperty(exports, "StaticToolbar", {
|
|
182
176
|
enumerable: true,
|
|
183
177
|
get: function get() {
|
|
184
|
-
return
|
|
178
|
+
return _StaticToolbar.StaticToolbar;
|
|
185
179
|
}
|
|
186
180
|
});
|
|
187
181
|
Object.defineProperty(exports, "TextAlignmentAction", {
|
|
@@ -202,6 +196,12 @@ Object.defineProperty(exports, "TypographyAction", {
|
|
|
202
196
|
return _TypographyAction.TypographyAction;
|
|
203
197
|
}
|
|
204
198
|
});
|
|
199
|
+
Object.defineProperty(exports, "TypographyPlugin", {
|
|
200
|
+
enumerable: true,
|
|
201
|
+
get: function get() {
|
|
202
|
+
return _TypographyPlugin.TypographyPlugin;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
205
|
Object.defineProperty(exports, "UnderlineAction", {
|
|
206
206
|
enumerable: true,
|
|
207
207
|
get: function get() {
|
|
@@ -233,6 +233,12 @@ Object.defineProperty(exports, "useFontColorPicker", {
|
|
|
233
233
|
return _useFontColorPicker.useFontColorPicker;
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
|
+
Object.defineProperty(exports, "useLexicalEditorConfig", {
|
|
237
|
+
enumerable: true,
|
|
238
|
+
get: function get() {
|
|
239
|
+
return _LexicalEditorConfig.useLexicalEditorConfig;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
236
242
|
Object.defineProperty(exports, "useRichTextEditor", {
|
|
237
243
|
enumerable: true,
|
|
238
244
|
get: function get() {
|
|
@@ -270,26 +276,26 @@ var _QuoteAction = require("./components/ToolbarActions/QuoteAction");
|
|
|
270
276
|
var _UnderlineAction = require("./components/ToolbarActions/UnderlineAction");
|
|
271
277
|
var _TypographyAction = require("./components/ToolbarActions/TypographyAction");
|
|
272
278
|
var _TextAlignmentAction = require("./components/ToolbarActions/TextAlignmentAction");
|
|
273
|
-
var
|
|
274
|
-
var _ParagraphToolbar = require("./components/Toolbar/ParagraphToolbar");
|
|
279
|
+
var _ImageAction = require("./components/ToolbarActions/ImageAction");
|
|
275
280
|
var _Toolbar = require("./components/Toolbar/Toolbar");
|
|
276
|
-
var
|
|
277
|
-
var _HeadingToolbarPreset = require("./components/ToolbarPresets/HeadingToolbarPreset");
|
|
281
|
+
var _StaticToolbar = require("./components/Toolbar/StaticToolbar");
|
|
278
282
|
var _RichTextEditor = require("./components/Editor/RichTextEditor");
|
|
279
283
|
var _HeadingEditor = require("./components/Editor/HeadingEditor");
|
|
280
284
|
var _ParagraphEditor = require("./components/Editor/ParagraphEditor");
|
|
281
285
|
var _LexicalLinkPlugin = require("@lexical/react/LexicalLinkPlugin");
|
|
282
286
|
var _FloatingLinkEditorPlugin = require("./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin");
|
|
283
287
|
var _CodeHighlightPlugin = require("./plugins/CodeHighlightPlugin/CodeHighlightPlugin");
|
|
284
|
-
var _ClickableLinkPlugin = require("./plugins/ClickableLinkPlugin/ClickableLinkPlugin");
|
|
285
288
|
var _BlurEventPlugin = require("./plugins/BlurEventPlugin/BlurEventPlugin");
|
|
286
289
|
var _LexicalUpdateStatePlugin = require("./plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin");
|
|
287
|
-
var
|
|
288
|
-
var
|
|
289
|
-
var
|
|
290
|
+
var _FontColorPlugin = require("./plugins/FontColorPlugin/FontColorPlugin");
|
|
291
|
+
var _TypographyPlugin = require("./plugins/TypographyPlugin/TypographyPlugin");
|
|
292
|
+
var _WebinyQuoteNodePlugin = require("./plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin");
|
|
293
|
+
var _ListPlugin = require("./plugins/ListPLugin/ListPlugin");
|
|
294
|
+
var _ImagesPlugin = require("./plugins/ImagesPlugin/ImagesPlugin");
|
|
290
295
|
var _generateInitialLexicalValue = require("./utils/generateInitialLexicalValue");
|
|
291
296
|
var _isValidLexicalData = require("./utils/isValidLexicalData");
|
|
292
297
|
var _clearNodeFormating = require("./utils/nodes/clearNodeFormating");
|
|
298
|
+
var _insertFiles = require("./commands/insertFiles");
|
|
293
299
|
var _types = _interopRequireWildcard(require("./types"));
|
|
294
300
|
exports.types = _types;
|
|
295
301
|
var _LexicalEditorConfig = require("./components/LexicalEditorConfig/LexicalEditorConfig");
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["// render\nexport { LexicalHtmlRenderer } from \"~/components/LexicalHtmlRenderer\";\n// hooks\nexport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nexport { useFontColorPicker } from \"~/hooks/useFontColorPicker\";\nexport { useTypographyAction } from \"~/hooks/useTypographyAction\";\nexport { useTextAlignmentAction } from \"~/hooks/useTextAlignmentAction\";\n// UI elements\nexport { Divider } from \"~/ui/Divider\";\nexport { DropDownItem } from \"~/ui/DropDown\";\nexport { DropDown } from \"~/ui/DropDown\";\n// actions\nexport { BoldAction } from \"~/components/ToolbarActions/BoldAction\";\nexport { BulletListAction } from \"~/components/ToolbarActions/BulletListAction\";\nexport { CodeHighlightAction } from \"~/components/ToolbarActions/CodeHighlightAction\";\nexport { FontSizeAction } from \"~/components/ToolbarActions/FontSizeAction\";\nexport { FontColorAction } from \"~/components/ToolbarActions/FontColorAction\";\nexport { ItalicAction } from \"~/components/ToolbarActions/ItalicAction\";\nexport { LinkAction } from \"~/components/ToolbarActions/LinkAction\";\nexport { NumberedListAction } from \"~/components/ToolbarActions/NumberedListAction\";\nexport { QuoteAction } from \"~/components/ToolbarActions/QuoteAction\";\nexport { UnderlineAction } from \"~/components/ToolbarActions/UnderlineAction\";\nexport { TypographyAction } from \"~/components/ToolbarActions/TypographyAction\";\nexport { TextAlignmentAction } from \"~/components/ToolbarActions/TextAlignmentAction\";\
|
|
1
|
+
{"version":3,"names":["_LexicalHtmlRenderer","require","_useRichTextEditor","_useFontColorPicker","_useTypographyAction","_useTextAlignmentAction","_Divider","_DropDown","_BoldAction","_BulletListAction","_CodeHighlightAction","_FontSizeAction","_FontColorAction","_ItalicAction","_LinkAction","_NumberedListAction","_QuoteAction","_UnderlineAction","_TypographyAction","_TextAlignmentAction","_ImageAction","_Toolbar","_StaticToolbar","_RichTextEditor","_HeadingEditor","_ParagraphEditor","_LexicalLinkPlugin","_FloatingLinkEditorPlugin","_CodeHighlightPlugin","_BlurEventPlugin","_LexicalUpdateStatePlugin","_FontColorPlugin","_TypographyPlugin","_WebinyQuoteNodePlugin","_ListPlugin","_ImagesPlugin","_generateInitialLexicalValue","_isValidLexicalData","_clearNodeFormating","_insertFiles","_types","_interopRequireWildcard","exports","types","_LexicalEditorConfig"],"sources":["index.tsx"],"sourcesContent":["// render\nexport { LexicalHtmlRenderer } from \"~/components/LexicalHtmlRenderer\";\n// hooks\nexport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nexport { useFontColorPicker } from \"~/hooks/useFontColorPicker\";\nexport { useTypographyAction } from \"~/hooks/useTypographyAction\";\nexport { useTextAlignmentAction } from \"~/hooks/useTextAlignmentAction\";\n// UI elements\nexport { Divider } from \"~/ui/Divider\";\nexport { DropDownItem } from \"~/ui/DropDown\";\nexport { DropDown } from \"~/ui/DropDown\";\n// actions\nexport { BoldAction } from \"~/components/ToolbarActions/BoldAction\";\nexport { BulletListAction } from \"~/components/ToolbarActions/BulletListAction\";\nexport { CodeHighlightAction } from \"~/components/ToolbarActions/CodeHighlightAction\";\nexport { FontSizeAction } from \"~/components/ToolbarActions/FontSizeAction\";\nexport { FontColorAction } from \"~/components/ToolbarActions/FontColorAction\";\nexport { ItalicAction } from \"~/components/ToolbarActions/ItalicAction\";\nexport { LinkAction } from \"~/components/ToolbarActions/LinkAction\";\nexport { NumberedListAction } from \"~/components/ToolbarActions/NumberedListAction\";\nexport { QuoteAction } from \"~/components/ToolbarActions/QuoteAction\";\nexport { UnderlineAction } from \"~/components/ToolbarActions/UnderlineAction\";\nexport { TypographyAction } from \"~/components/ToolbarActions/TypographyAction\";\nexport { TextAlignmentAction } from \"~/components/ToolbarActions/TextAlignmentAction\";\nexport { ImageAction } from \"~/components/ToolbarActions/ImageAction\";\n// toolbars\nexport { Toolbar } from \"~/components/Toolbar/Toolbar\";\nexport { StaticToolbar } from \"~/components/Toolbar/StaticToolbar\";\n// editor\nexport { RichTextEditor } from \"~/components/Editor/RichTextEditor\";\nexport { HeadingEditor } from \"~/components/Editor/HeadingEditor\";\nexport { ParagraphEditor } from \"~/components/Editor/ParagraphEditor\";\n// plugins\nexport { LinkPlugin } from \"@lexical/react/LexicalLinkPlugin\";\nexport { FloatingLinkEditorPlugin } from \"~/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin\";\nexport { CodeHighlightPlugin } from \"~/plugins/CodeHighlightPlugin/CodeHighlightPlugin\";\nexport { BlurEventPlugin } from \"~/plugins/BlurEventPlugin/BlurEventPlugin\";\nexport { LexicalUpdateStatePlugin } from \"~/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin\";\nexport { FontColorPlugin } from \"~/plugins/FontColorPlugin/FontColorPlugin\";\nexport { TypographyPlugin } from \"~/plugins/TypographyPlugin/TypographyPlugin\";\nexport { QuotePlugin } from \"~/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin\";\nexport { ListPlugin } from \"~/plugins/ListPLugin/ListPlugin\";\nexport { ImagesPlugin } from \"~/plugins/ImagesPlugin/ImagesPlugin\";\n// utils\nexport { generateInitialLexicalValue } from \"~/utils/generateInitialLexicalValue\";\nexport { isValidLexicalData } from \"~/utils/isValidLexicalData\";\nexport { clearNodeFormatting } from \"~/utils/nodes/clearNodeFormating\";\n// Commands\nexport { INSERT_IMAGE_COMMAND } from \"~/commands/insertFiles\";\n// types\nexport * as types from \"./types\";\n// config\nexport {\n LexicalEditorConfig,\n useLexicalEditorConfig\n} from \"~/components/LexicalEditorConfig/LexicalEditorCon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