New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wix-rich-content-editor

Package Overview
Dependencies
Maintainers
11
Versions
1166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wix-rich-content-editor - npm Package Compare versions

Comparing version 9.6.1 to 9.6.2-patch.1

dist/cjs/ErrorToast-1b18156d.js

2

dist/es/index.js

@@ -1,2 +0,2 @@

export{default as RichContentEditor}from"./RichContentEditor/I18nRichContentEditor.js";export{default as RichContentEditorModal}from"./RichContentEditor/RichContentEditorModal.js";export{getDefaultToolbarSettings}from"./RichContentEditor/Toolbars/default-toolbar-settings.js";export{d as convertFromRaw,e as convertTableConfigToRaw,b as convertToRaw,c as createEmpty,a as createWithContent}from"./editorStateConversion-b1ea79bd.js";export{getColor,getFontSize}from"./RichContentEditor/utils/editorCommandsUtils.js";export{default as AddPluginMenu}from"./RichContentEditor/Toolbars/SideToolbar/AddPluginMenu.js";export{SECTIONS}from"./RichContentEditor/Toolbars/SideToolbar/utils.js";export{EditorState}from"wix-rich-content-editor-common";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/inheritsLoose";import"react";import"wix-rich-content-common";import"wix-rich-content-common/dist/statics/locale/messages_en.json";import"./RichContentEditor-7b525025.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/assertThisInitialized";import"./createPlugins-551b8321.js";import"./_commonjsHelpers-3f0e96f4.js";import"@wix/draft-js";import"prop-types";import"immutable";import"@wix/draft-js/lib/DraftOffsetKey";import"./RichContentEditor/Decorators/Resize/index.js";import"./RichContentEditor/Decorators/Resize/createDecorator.js";import"react-dom";import"classnames";import"./style-inject.es-a0e1a0ba.js";import"./RichContentEditor/handleDrop.js";import"./RichContentEditor/externalToolbarPlugin.js";import"ricos-content";import"lodash";import"react-measure";import"./RichContentEditor/Toolbars/createEditorToolbars.js";import"./RichContentEditor/Toolbars/utils.js";import"./RichContentEditor/Toolbars/buttons/index.js";import"./RichContentEditor/Toolbars/buttons/TextAlignmentButton.js";import"./RichContentEditor/Toolbars/buttons/TextButtons.js";import"./RichContentEditor/Icons/BlockQuoteIcon.js";import"./RichContentEditor/Icons/BoldIcon.js";import"./RichContentEditor/Icons/ItalicIcon.js";import"./RichContentEditor/Icons/OrderedListIcon.js";import"./RichContentEditor/Icons/TitleIcon.js";import"./RichContentEditor/Icons/TitleOneIcon.js";import"./RichContentEditor/Icons/TitleTwoIcon.js";import"./RichContentEditor/Icons/UnderlineIcon.js";import"./RichContentEditor/Icons/UnorderedListIcon.js";import"./RichContentEditor/Toolbars/buttons/utils/createTextInlineStyleButton.js";import"./RichContentEditor/Toolbars/buttons/TextButton.js";import"./RichContentEditor/Toolbars/buttons/utils/createTextBlockStyleButton.js";import"@babel/runtime/helpers/createClass";import"./RichContentEditor/Toolbars/buttons/utils/createTextAlignmentButton.js";import"./RichContentEditor/Toolbars/buttons/utils/createTextDropdownButton.js";import"./index-06b546cb.js";import"./RichContentEditor/Toolbars/buttons/AddPluginButton.js";import"./RichContentEditor/Icons/PlusIcon.js";import"wix-rich-content-ui-components";import"./RichContentEditor/Toolbars/buttons/utils/reducePluginTextButtons.js";import"./RichContentEditor/EditorCommands.js";import"ricos-content/libs/draftConsts";import"./RichContentEditor/keyBindings.js";import"./RichContentEditor/handleKeyCommand.js";import"./RichContentEditor/handleBackspaceCommand.js";import"./RichContentEditor/atomicBlockRemovalUtil.js";import"./RichContentEditor/handleDeleteCommand.js";import"./RichContentEditor/handleTabCommand.js";import"./RichContentEditor/handleReturnCommand.js";import"./RichContentEditor/handlePastedText.js";import"./RichContentEditor/utils/draftConvertFromHtml.js";import"./RichContentEditor/utils/pasting/pastedContentUtil.js";import"./RichContentEditor/utils/pasting/rgbToHex.js";import"./RichContentEditor/utils/pasting/htmlToBlock.js";import"./RichContentEditor/utils/pasting/colorNameToHex.js";import"./RichContentEditor/utils/pasting/normalizeHTML.js";import"./blockStyleFn-a3b3e1cd.js";import"./RichContentEditor/utils/consts.js";import"./RichContentEditor/combineStyleFns.js";import"./RichContentEditor/Toolbars/toolbar-id.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./RichContentEditor/InnerModal.js";import"./RichContentEditor/utils/onCutAndCopy.js";import"@wix/draft-js/lib/getContentStateFragment";import"@wix/draft-js/lib/getDraftEditorSelection";import"@wix/draft-js/lib/editOnCopy";import"@wix/draft-js/lib/editOnCut";import"./RichContentEditor/preventWixFocusRingAccessibility.js";import"./RichContentEditor/Components/RCEErrorToast.js";import"./RichContentEditor/utils/biUtils.js";import"./RichContentEditor/Toolbars/BlockLinkModal.js";import"./RichContentEditor/Toolbars/TextLinkModal.js";import"./RichContentEditor/Toolbars/SideToolbar/createSideToolbar.js";import"./RichContentEditor/Toolbars/SideToolbar/SideToolbar.js";import"./RichContentEditor/Toolbars/SideToolbar/AddPluginFloatingToolbar.js";import"./RichContentEditor/Icons/PlusIconSmall.js";import"./RichContentEditor/Toolbars/SideToolbar/PopupOffsetnHoc.js";import"./StaticToolbar-f83248f3.js";import"./RichContentEditor/Toolbars/StaticToolbar/MoreButton.js";import"./RichContentEditor/Icons/ShortcutIcon.js";import"./RichContentEditor/Toolbars/StaticToolbar/createStaticTextToolbar.js";import"./RichContentEditor/Toolbars/StaticToolbar/createStaticToolbar.js";import"./RichContentEditor/Toolbars/buttons/utils/getTextButtonsFromList.js";import"./RichContentEditor/Toolbars/buttons/utils/createThemedSeparator.js";import"./RichContentEditor/Toolbars/StaticToolbar/createMobileToolbar.js";import"./RichContentEditor/Toolbars/StaticToolbar/createFooterToolbar.js";import"./RichContentEditor/Toolbars/InlineToolbar/InlineToolbar.js";import"./RichContentEditor/Toolbars/InlineToolbar/createInlineTextToolbar.js";import"./RichContentEditor/Toolbars/InlineToolbar/createInlineToolbar.js";import"./RichContentEditor/Toolbars/createExternalToolbarButtonProps.js";import"./RichContentEditor/Toolbars/buttons/utils/createButtonProps.js";import"./RichContentEditor/Toolbars/buttons/TextButtonProps.js";import"./RichContentEditor/Toolbars/buttons/utils/generateTextToolbarButtonProps.js";import"./RichContentEditor/Toolbars/buttons/consts.js";import"uuid";import"./PluginMenuPluginsSection-7be8accc.js";import"./RichContentEditor/pluginsSearchTags.js";
export{default as RichContentEditor}from"./RichContentEditor/I18nRichContentEditor.js";export{default as RichContentEditorModal}from"./RichContentEditor/RichContentEditorModal.js";export{getDefaultToolbarSettings}from"./RichContentEditor/Toolbars/default-toolbar-settings.js";export{d as convertFromRaw,e as convertTableConfigToRaw,b as convertToRaw,c as createEmpty,a as createWithContent}from"./editorStateConversion-9845f7d3.js";export{getColor,getFontSize}from"./RichContentEditor/utils/editorCommandsUtils.js";export{default as AddPluginMenu}from"./RichContentEditor/Toolbars/SideToolbar/AddPluginMenu.js";export{SECTIONS}from"./RichContentEditor/Toolbars/SideToolbar/utils.js";export{EditorState}from"wix-rich-content-editor-common";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/inheritsLoose";import"react";import"wix-rich-content-common";import"wix-rich-content-common/dist/statics/locale/messages_en.json";import"./RichContentEditor-1ea83119.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/assertThisInitialized";import"./createPlugins-551b8321.js";import"./_commonjsHelpers-3f0e96f4.js";import"@wix/draft-js";import"prop-types";import"immutable";import"@wix/draft-js/lib/DraftOffsetKey";import"./RichContentEditor/Decorators/Resize/index.js";import"./RichContentEditor/Decorators/Resize/createDecorator.js";import"react-dom";import"classnames";import"./style-inject.es-a0e1a0ba.js";import"./RichContentEditor/handleDrop.js";import"./RichContentEditor/externalToolbarPlugin.js";import"ricos-content";import"lodash";import"react-measure";import"./RichContentEditor/Toolbars/createEditorToolbars.js";import"./RichContentEditor/Toolbars/utils.js";import"./RichContentEditor/Toolbars/buttons/index.js";import"./RichContentEditor/Toolbars/buttons/TextAlignmentButton.js";import"./RichContentEditor/Toolbars/buttons/TextButtons.js";import"./RichContentEditor/Icons/BlockQuoteIcon.js";import"./RichContentEditor/Icons/BoldIcon.js";import"./RichContentEditor/Icons/ItalicIcon.js";import"./RichContentEditor/Icons/OrderedListIcon.js";import"./RichContentEditor/Icons/TitleIcon.js";import"./RichContentEditor/Icons/TitleOneIcon.js";import"./RichContentEditor/Icons/TitleTwoIcon.js";import"./RichContentEditor/Icons/UnderlineIcon.js";import"./RichContentEditor/Icons/UnorderedListIcon.js";import"./RichContentEditor/Toolbars/buttons/utils/createTextInlineStyleButton.js";import"./RichContentEditor/Toolbars/buttons/TextButton.js";import"./RichContentEditor/Toolbars/buttons/utils/createTextBlockStyleButton.js";import"@babel/runtime/helpers/createClass";import"./RichContentEditor/Toolbars/buttons/utils/createTextAlignmentButton.js";import"./RichContentEditor/Toolbars/buttons/utils/createTextDropdownButton.js";import"./index-06b546cb.js";import"./RichContentEditor/Toolbars/buttons/AddPluginButton.js";import"./RichContentEditor/Icons/PlusIcon.js";import"wix-rich-content-ui-components";import"./RichContentEditor/Toolbars/buttons/utils/reducePluginTextButtons.js";import"./RichContentEditor/EditorCommands.js";import"ricos-content/libs/draftConsts";import"./RichContentEditor/keyBindings.js";import"./RichContentEditor/handleKeyCommand.js";import"./RichContentEditor/handleBackspaceCommand.js";import"./RichContentEditor/atomicBlockRemovalUtil.js";import"./RichContentEditor/handleDeleteCommand.js";import"./RichContentEditor/handleTabCommand.js";import"./RichContentEditor/handleReturnCommand.js";import"./RichContentEditor/handlePastedText.js";import"./RichContentEditor/utils/draftConvertFromHtml.js";import"./RichContentEditor/utils/pasting/pastedContentUtil.js";import"./RichContentEditor/utils/pasting/rgbToHex.js";import"./RichContentEditor/utils/pasting/htmlToBlock.js";import"./RichContentEditor/utils/pasting/colorNameToHex.js";import"./RichContentEditor/utils/pasting/normalizeHTML.js";import"./blockStyleFn-a3b3e1cd.js";import"./RichContentEditor/utils/consts.js";import"./RichContentEditor/combineStyleFns.js";import"./RichContentEditor/Toolbars/toolbar-id.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./RichContentEditor/InnerModal.js";import"./RichContentEditor/utils/onCutAndCopy.js";import"@wix/draft-js/lib/getContentStateFragment";import"@wix/draft-js/lib/getDraftEditorSelection";import"@wix/draft-js/lib/editOnCopy";import"@wix/draft-js/lib/editOnCut";import"./RichContentEditor/preventWixFocusRingAccessibility.js";import"./RichContentEditor/Components/RCEErrorToast.js";import"./RichContentEditor/utils/biUtils.js";import"./RichContentEditor/Toolbars/BlockLinkModal.js";import"./RichContentEditor/Toolbars/TextLinkModal.js";import"./RichContentEditor/Toolbars/SideToolbar/createSideToolbar.js";import"./RichContentEditor/Toolbars/SideToolbar/SideToolbar.js";import"./RichContentEditor/Toolbars/SideToolbar/AddPluginFloatingToolbar.js";import"./RichContentEditor/Icons/PlusIconSmall.js";import"./RichContentEditor/Toolbars/SideToolbar/PopupOffsetnHoc.js";import"./StaticToolbar-f83248f3.js";import"./RichContentEditor/Toolbars/StaticToolbar/MoreButton.js";import"./RichContentEditor/Icons/ShortcutIcon.js";import"./RichContentEditor/Toolbars/StaticToolbar/createStaticTextToolbar.js";import"./RichContentEditor/Toolbars/StaticToolbar/createStaticToolbar.js";import"./RichContentEditor/Toolbars/buttons/utils/getTextButtonsFromList.js";import"./RichContentEditor/Toolbars/buttons/utils/createThemedSeparator.js";import"./RichContentEditor/Toolbars/StaticToolbar/createMobileToolbar.js";import"./RichContentEditor/Toolbars/StaticToolbar/createFooterToolbar.js";import"./RichContentEditor/Toolbars/InlineToolbar/InlineToolbar.js";import"./RichContentEditor/Toolbars/InlineToolbar/createInlineTextToolbar.js";import"./RichContentEditor/Toolbars/InlineToolbar/createInlineToolbar.js";import"./RichContentEditor/Toolbars/createExternalToolbarButtonProps.js";import"./RichContentEditor/Toolbars/buttons/utils/createButtonProps.js";import"./RichContentEditor/Toolbars/buttons/TextButtonProps.js";import"./RichContentEditor/Toolbars/buttons/utils/generateTextToolbarButtonProps.js";import"./RichContentEditor/Toolbars/buttons/consts.js";import"uuid";import"./PluginMenuPluginsSection-7be8accc.js";import"./RichContentEditor/pluginsSearchTags.js";
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import{createEntity,Modifier,EditorState,ContentState,SelectionState}from"wix-rich-content-editor-common";import exportedConvertFromHTML from"./utils/draftConvertFromHtml.js";import{pastedContentConfig,clearUnnecessaryInlineStyles}from"./utils/pasting/pastedContentUtil.js";import normalizeHTML from"./utils/pasting/normalizeHTML.js";import{d as convertFromRaw}from"../editorStateConversion-b1ea79bd.js";import{COLLAPSIBLE_LIST_TYPE,isListType}from"ricos-content";import"immutable";import"@wix/draft-js";import"./utils/pasting/rgbToHex.js";import"./utils/pasting/htmlToBlock.js";import"lodash";import"./utils/pasting/colorNameToHex.js";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"uuid";var replaceWithFragment=function(contentState,selection,fragment){var contentWithFragment=Modifier.replaceWithFragment(contentState,selection,fragment),startBlockKey=selection.getStartKey(),isEmptyBlock=""===contentState.getBlockMap().get(startBlockKey).getText(),startBlockType=contentState.getBlockMap().get(startBlockKey).getType();if(1===fragment.size&&isEmptyBlock&&!isListType(startBlockType)){var pastedBlockType=fragment.values().next().value.getType();contentWithFragment=Modifier.setBlockType(contentWithFragment,contentWithFragment.getSelectionAfter(),pastedBlockType)}return contentWithFragment},applyPasteOnContentState=function(editorState,contentToPaste){var contentState=function(editorState){var contentState=editorState.getCurrentContent(),blockKey=editorState.getSelection().getStartKey();if("atomic"===contentState.getBlockForKey(blockKey).getType()){var blockSelection=SelectionState.createEmpty(blockKey);contentState=Modifier.removeRange(contentState,blockSelection,"backward"),contentState=Modifier.setBlockType(contentState,blockSelection,"unstyled")}return contentState}(editorState);return replaceWithFragment(contentState,editorState.getSelection(),contentToPaste.getBlockMap())},exceedsMaxTextLimit=function(_ref){var contentFragment=_ref.contentFragment,editorState=_ref.editorState,maxTextLength=_ref.maxTextLength,getSelectedText=_ref.getSelectedText;if(!maxTextLength)return!1;var fragmentTextLength=contentFragment.getPlainText("").length;return editorState.getCurrentContent().getPlainText("").length-getSelectedText(editorState).length+fragmentTextLength>maxTextLength},removeUnsupportedPlugins=function(rawContent,isPluginInstalled){var blocks=rawContent.blocks,entityMap=rawContent.entityMap,newContent={blocks:[],entityMap:{}};return blocks.forEach((function(block){var shouldAddBlock=!1,entityRanges=block.entityRanges;Object.entries(entityRanges).forEach((function(_ref2){var value=_ref2[1],entity=entityMap[value.key];isPluginInstalled(entity.type)&&(newContent.entityMap[value.key]=entity,shouldAddBlock=!0)})),(shouldAddBlock||"atomic"!==block.type)&&newContent.blocks.push(block)})),newContent},getContent=function(html){try{var fragmentElt=(new DOMParser).parseFromString(html,"text/html").querySelector("[data-draftjs-conductor-fragment]");if(fragmentElt){var fragmentAttr=fragmentElt.getAttribute("data-draftjs-conductor-fragment"),rawContent=JSON.parse(fragmentAttr);return convertParsedEditorStateObjectToRawData(rawContent)}}catch(error){return!1}return!1},getCurrentContent=function(editorState){return{blocks:Object.values(editorState._immutable.currentContent.blockMap),entityMap:editorState._immutable.currentContent.entityMap}},convertParsedEditorStateObjectToRawData=function(rawContent){return Object.keys(rawContent.entityMap).forEach((function(entityKey){var currentEntity=rawContent.entityMap[entityKey];if(currentEntity.type===COLLAPSIBLE_LIST_TYPE){var pairs=currentEntity.data.pairs;currentEntity.data.pairs=pairs.map((function(pair){return{key:pair.key,title:pair.title._immutable?getCurrentContent(pair.title):pair.title,content:pair.content._immutable?getCurrentContent(pair.content):pair.content}}))}})),rawContent},handlePastedText=function(_ref5){var isPluginInstalled=_ref5.isPluginInstalled,text=_ref5.text,html=_ref5.html,editorState=_ref5.editorState,pasteWithoutAtomic=_ref5.pasteWithoutAtomic,customHeadings=_ref5.customHeadings,maxTextLength=_ref5.maxTextLength,getSelectedText=_ref5.getSelectedText;return function(html){return html&&!!getContent(html)}(html)&&!pasteWithoutAtomic?function(isPluginInstalled,html,editorState,maxTextLength,getSelectedText){var rawContent=removeUnsupportedPlugins(getContent(html),isPluginInstalled),contentFragment=convertFromRaw(rawContent);if(exceedsMaxTextLimit({contentFragment:contentFragment,editorState:editorState,maxTextLength:maxTextLength,getSelectedText:getSelectedText}))return console.debug("paste canceled due to maxTextLength exceeded ("+maxTextLength+")"),editorState;var fragment=contentFragment.getBlockMap(),selection=editorState.getSelection(),currentContentState=editorState.getCurrentContent();Object.entries(rawContent.entityMap).forEach((function(_ref3){var value=_ref3[1],oldContentState=currentContentState,type=value.type,data=value.data,entityKey=createEntity(editorState,{type:type,data:data});currentContentState=Modifier.applyEntity(oldContentState,selection,entityKey)}));var content=replaceWithFragment(currentContentState,selection,fragment);return EditorState.push(editorState,content,"insert-fragment")}(isPluginInstalled,html,editorState,maxTextLength,getSelectedText):function(_ref4){var text=_ref4.text,html=_ref4.html,editorState=_ref4.editorState,customHeadings=_ref4.customHeadings,maxTextLength=_ref4.maxTextLength,getSelectedText=_ref4.getSelectedText,contentFragment=html?exportedConvertFromHTML(pastedContentConfig(customHeadings))(html):ContentState.createFromText(text);if(exceedsMaxTextLimit({contentFragment:contentFragment,editorState:editorState,maxTextLength:maxTextLength,getSelectedText:getSelectedText}))return console.debug("paste canceled due to maxTextLength exceeded ("+maxTextLength+")"),editorState;var contentWithPaste=applyPasteOnContentState(editorState,contentFragment),newContentState=clearUnnecessaryInlineStyles(contentWithPaste);return EditorState.forceSelection(EditorState.push(editorState,newContentState,"pasted-text"),contentWithPaste.getSelectionAfter())}({text:text,html:normalizeHTML(html),editorState:editorState,customHeadings:customHeadings,maxTextLength:maxTextLength,getSelectedText:getSelectedText})};export{convertParsedEditorStateObjectToRawData,handlePastedText as default,removeUnsupportedPlugins};
import{createEntity,Modifier,EditorState,ContentState,SelectionState}from"wix-rich-content-editor-common";import exportedConvertFromHTML from"./utils/draftConvertFromHtml.js";import{pastedContentConfig,clearUnnecessaryInlineStyles}from"./utils/pasting/pastedContentUtil.js";import normalizeHTML from"./utils/pasting/normalizeHTML.js";import{d as convertFromRaw}from"../editorStateConversion-9845f7d3.js";import{COLLAPSIBLE_LIST_TYPE,isListType}from"ricos-content";import"immutable";import"@wix/draft-js";import"./utils/pasting/rgbToHex.js";import"./utils/pasting/htmlToBlock.js";import"lodash";import"./utils/pasting/colorNameToHex.js";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"uuid";var replaceWithFragment=function(contentState,selection,fragment){var contentWithFragment=Modifier.replaceWithFragment(contentState,selection,fragment),startBlockKey=selection.getStartKey(),isEmptyBlock=""===contentState.getBlockMap().get(startBlockKey).getText(),startBlockType=contentState.getBlockMap().get(startBlockKey).getType();if(1===fragment.size&&isEmptyBlock&&!isListType(startBlockType)){var pastedBlockType=fragment.values().next().value.getType();contentWithFragment=Modifier.setBlockType(contentWithFragment,contentWithFragment.getSelectionAfter(),pastedBlockType)}return contentWithFragment},applyPasteOnContentState=function(editorState,contentToPaste){var contentState=function(editorState){var contentState=editorState.getCurrentContent(),blockKey=editorState.getSelection().getStartKey();if("atomic"===contentState.getBlockForKey(blockKey).getType()){var blockSelection=SelectionState.createEmpty(blockKey);contentState=Modifier.removeRange(contentState,blockSelection,"backward"),contentState=Modifier.setBlockType(contentState,blockSelection,"unstyled")}return contentState}(editorState);return replaceWithFragment(contentState,editorState.getSelection(),contentToPaste.getBlockMap())},exceedsMaxTextLimit=function(_ref){var contentFragment=_ref.contentFragment,editorState=_ref.editorState,maxTextLength=_ref.maxTextLength,getSelectedText=_ref.getSelectedText;if(!maxTextLength)return!1;var fragmentTextLength=contentFragment.getPlainText("").length;return editorState.getCurrentContent().getPlainText("").length-getSelectedText(editorState).length+fragmentTextLength>maxTextLength},removeUnsupportedPlugins=function(rawContent,isPluginInstalled){var blocks=rawContent.blocks,entityMap=rawContent.entityMap,newContent={blocks:[],entityMap:{}};return blocks.forEach((function(block){var shouldAddBlock=!1,entityRanges=block.entityRanges;Object.entries(entityRanges).forEach((function(_ref2){var value=_ref2[1],entity=entityMap[value.key];isPluginInstalled(entity.type)&&(newContent.entityMap[value.key]=entity,shouldAddBlock=!0)})),(shouldAddBlock||"atomic"!==block.type)&&newContent.blocks.push(block)})),newContent},getContent=function(html){try{var fragmentElt=(new DOMParser).parseFromString(html,"text/html").querySelector("[data-draftjs-conductor-fragment]");if(fragmentElt){var fragmentAttr=fragmentElt.getAttribute("data-draftjs-conductor-fragment"),rawContent=JSON.parse(fragmentAttr);return convertParsedEditorStateObjectToRawData(rawContent)}}catch(error){return!1}return!1},getCurrentContent=function(editorState){return{blocks:Object.values(editorState._immutable.currentContent.blockMap),entityMap:editorState._immutable.currentContent.entityMap}},convertParsedEditorStateObjectToRawData=function(rawContent){return Object.keys(rawContent.entityMap).forEach((function(entityKey){var currentEntity=rawContent.entityMap[entityKey];if(currentEntity.type===COLLAPSIBLE_LIST_TYPE){var pairs=currentEntity.data.pairs;currentEntity.data.pairs=pairs.map((function(pair){return{key:pair.key,title:pair.title._immutable?getCurrentContent(pair.title):pair.title,content:pair.content._immutable?getCurrentContent(pair.content):pair.content}}))}})),rawContent},handlePastedText=function(_ref5){var isPluginInstalled=_ref5.isPluginInstalled,text=_ref5.text,html=_ref5.html,editorState=_ref5.editorState,pasteWithoutAtomic=_ref5.pasteWithoutAtomic,customHeadings=_ref5.customHeadings,maxTextLength=_ref5.maxTextLength,getSelectedText=_ref5.getSelectedText;return function(html){return html&&!!getContent(html)}(html)&&!pasteWithoutAtomic?function(isPluginInstalled,html,editorState,maxTextLength,getSelectedText){var rawContent=removeUnsupportedPlugins(getContent(html),isPluginInstalled),contentFragment=convertFromRaw(rawContent);if(exceedsMaxTextLimit({contentFragment:contentFragment,editorState:editorState,maxTextLength:maxTextLength,getSelectedText:getSelectedText}))return console.debug("paste canceled due to maxTextLength exceeded ("+maxTextLength+")"),editorState;var fragment=contentFragment.getBlockMap(),selection=editorState.getSelection(),currentContentState=editorState.getCurrentContent();Object.entries(rawContent.entityMap).forEach((function(_ref3){var value=_ref3[1],oldContentState=currentContentState,type=value.type,data=value.data,entityKey=createEntity(editorState,{type:type,data:data});currentContentState=Modifier.applyEntity(oldContentState,selection,entityKey)}));var content=replaceWithFragment(currentContentState,selection,fragment);return EditorState.push(editorState,content,"insert-fragment")}(isPluginInstalled,html,editorState,maxTextLength,getSelectedText):function(_ref4){var text=_ref4.text,html=_ref4.html,editorState=_ref4.editorState,customHeadings=_ref4.customHeadings,maxTextLength=_ref4.maxTextLength,getSelectedText=_ref4.getSelectedText,contentFragment=html?exportedConvertFromHTML(pastedContentConfig(customHeadings))(html):ContentState.createFromText(text);if(exceedsMaxTextLimit({contentFragment:contentFragment,editorState:editorState,maxTextLength:maxTextLength,getSelectedText:getSelectedText}))return console.debug("paste canceled due to maxTextLength exceeded ("+maxTextLength+")"),editorState;var contentWithPaste=applyPasteOnContentState(editorState,contentFragment),newContentState=clearUnnecessaryInlineStyles(contentWithPaste);return EditorState.forceSelection(EditorState.push(editorState,newContentState,"pasted-text"),contentWithPaste.getSelectionAfter())}({text:text,html:normalizeHTML(html),editorState:editorState,customHeadings:customHeadings,maxTextLength:maxTextLength,getSelectedText:getSelectedText})};export{convertParsedEditorStateObjectToRawData,handlePastedText as default,removeUnsupportedPlugins};
//# sourceMappingURL=handlePastedText.js.map

@@ -1,2 +0,2 @@

import _extends from"@babel/runtime/helpers/extends";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component}from"react";import{withI18n}from"wix-rich-content-common";import englishResources from"wix-rich-content-common/dist/statics/locale/messages_en.json";import{R as RichContentEditor}from"../RichContentEditor-7b525025.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/assertThisInitialized";import"../createPlugins-551b8321.js";import"../_commonjsHelpers-3f0e96f4.js";import"@wix/draft-js";import"prop-types";import"immutable";import"@wix/draft-js/lib/DraftOffsetKey";import"./Decorators/Resize/index.js";import"./Decorators/Resize/createDecorator.js";import"react-dom";import"classnames";import"../style-inject.es-a0e1a0ba.js";import"./handleDrop.js";import"./externalToolbarPlugin.js";import"ricos-content";import"lodash";import"react-measure";import"./Toolbars/createEditorToolbars.js";import"wix-rich-content-editor-common";import"./Toolbars/utils.js";import"./Toolbars/default-toolbar-settings.js";import"./Toolbars/SideToolbar/createSideToolbar.js";import"./Toolbars/SideToolbar/SideToolbar.js";import"./Toolbars/SideToolbar/AddPluginFloatingToolbar.js";import"wix-rich-content-ui-components";import"./Icons/PlusIconSmall.js";import"./Icons/PlusIcon.js";import"./Toolbars/SideToolbar/AddPluginMenu.js";import"../PluginMenuPluginsSection-7be8accc.js";import"./pluginsSearchTags.js";import"./Toolbars/SideToolbar/utils.js";import"./Toolbars/SideToolbar/PopupOffsetnHoc.js";import"../StaticToolbar-f83248f3.js";import"./Toolbars/StaticToolbar/MoreButton.js";import"./Icons/ShortcutIcon.js";import"../index-06b546cb.js";import"./Toolbars/StaticToolbar/createStaticTextToolbar.js";import"./Toolbars/StaticToolbar/createStaticToolbar.js";import"./Toolbars/buttons/TextButton.js";import"@babel/runtime/helpers/createClass";import"./Toolbars/buttons/utils/createTextDropdownButton.js";import"./Toolbars/buttons/utils/getTextButtonsFromList.js";import"./Toolbars/buttons/index.js";import"./Toolbars/buttons/TextAlignmentButton.js";import"./Toolbars/buttons/TextButtons.js";import"./Icons/BlockQuoteIcon.js";import"./Icons/BoldIcon.js";import"./Icons/ItalicIcon.js";import"./Icons/OrderedListIcon.js";import"./Icons/TitleIcon.js";import"./Icons/TitleOneIcon.js";import"./Icons/TitleTwoIcon.js";import"./Icons/UnderlineIcon.js";import"./Icons/UnorderedListIcon.js";import"./Toolbars/buttons/utils/createTextInlineStyleButton.js";import"./Toolbars/buttons/utils/createTextBlockStyleButton.js";import"./Toolbars/buttons/utils/createTextAlignmentButton.js";import"./Toolbars/buttons/AddPluginButton.js";import"./Toolbars/buttons/utils/createThemedSeparator.js";import"./Toolbars/toolbar-id.js";import"./Toolbars/StaticToolbar/createMobileToolbar.js";import"./Toolbars/StaticToolbar/createFooterToolbar.js";import"./Toolbars/InlineToolbar/InlineToolbar.js";import"./Toolbars/InlineToolbar/createInlineTextToolbar.js";import"./Toolbars/InlineToolbar/createInlineToolbar.js";import"./Toolbars/createExternalToolbarButtonProps.js";import"./Toolbars/buttons/utils/createButtonProps.js";import"./Toolbars/buttons/TextButtonProps.js";import"./Toolbars/buttons/utils/generateTextToolbarButtonProps.js";import"./Toolbars/buttons/consts.js";import"./Toolbars/buttons/utils/reducePluginTextButtons.js";import"./EditorCommands.js";import"./utils/editorCommandsUtils.js";import"./utils/consts.js";import"ricos-content/libs/draftConsts";import"./keyBindings.js";import"./handleKeyCommand.js";import"./handleBackspaceCommand.js";import"./atomicBlockRemovalUtil.js";import"./handleDeleteCommand.js";import"./handleTabCommand.js";import"./handleReturnCommand.js";import"./handlePastedText.js";import"./utils/draftConvertFromHtml.js";import"./utils/pasting/pastedContentUtil.js";import"./utils/pasting/rgbToHex.js";import"./utils/pasting/htmlToBlock.js";import"./utils/pasting/colorNameToHex.js";import"./utils/pasting/normalizeHTML.js";import"../editorStateConversion-b1ea79bd.js";import"uuid";import"../blockStyleFn-a3b3e1cd.js";import"./combineStyleFns.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./InnerModal.js";import"./RichContentEditorModal.js";import"./Toolbars/BlockLinkModal.js";import"./Toolbars/TextLinkModal.js";import"./utils/onCutAndCopy.js";import"@wix/draft-js/lib/getContentStateFragment";import"@wix/draft-js/lib/getDraftEditorSelection";import"@wix/draft-js/lib/editOnCopy";import"@wix/draft-js/lib/editOnCut";import"./preventWixFocusRingAccessibility.js";import"./Components/RCEErrorToast.js";import"./utils/biUtils.js";var WrappedEditor=withI18n(RichContentEditor,englishResources),I18nRichContentEditor=function(_Component){function I18nRichContentEditor(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).editor=void 0,_this.setEditorRef=function(editor){return _this.editor=editor?editor.getWrappedInstance():void 0},_this.getToolbars=function(){return _this.editor.getToolbars()},_this.getToolbarProps=function(type){return _this.editor.getToolbarProps(type)},_this.getT=function(){return _this.editor.getT()},_this.getContainer=function(){var _this$editor;return null===(_this$editor=_this.editor)||void 0===_this$editor?void 0:_this$editor.getContainer()},_this.getPlugins=function(){return _this.editor.getPlugins()},_this.focus=function(){return _this.editor.focus()},_this.blur=function(){return _this.editor.blur()},_this.getEditorCommands=function(){return _this.editor.EditorCommands},_this.isInnerRCERenderedInTable=function(){return _this.editor.isInnerRCERenderedInTable()},_this.setEditorState=function(editorState){var _this$editor2;return null===(_this$editor2=_this.editor)||void 0===_this$editor2?void 0:_this$editor2.updateEditorState(editorState)},_this}return _inheritsLoose(I18nRichContentEditor,_Component),I18nRichContentEditor.prototype.render=function(){return React.createElement(WrappedEditor,_extends({},this.props,{ref:this.setEditorRef}))},I18nRichContentEditor}(Component);I18nRichContentEditor.displayName="RichContentEditor";export{I18nRichContentEditor as default};
import _extends from"@babel/runtime/helpers/extends";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component}from"react";import{withI18n}from"wix-rich-content-common";import englishResources from"wix-rich-content-common/dist/statics/locale/messages_en.json";import{R as RichContentEditor}from"../RichContentEditor-1ea83119.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/assertThisInitialized";import"../createPlugins-551b8321.js";import"../_commonjsHelpers-3f0e96f4.js";import"@wix/draft-js";import"prop-types";import"immutable";import"@wix/draft-js/lib/DraftOffsetKey";import"./Decorators/Resize/index.js";import"./Decorators/Resize/createDecorator.js";import"react-dom";import"classnames";import"../style-inject.es-a0e1a0ba.js";import"./handleDrop.js";import"./externalToolbarPlugin.js";import"ricos-content";import"lodash";import"react-measure";import"./Toolbars/createEditorToolbars.js";import"wix-rich-content-editor-common";import"./Toolbars/utils.js";import"./Toolbars/default-toolbar-settings.js";import"./Toolbars/SideToolbar/createSideToolbar.js";import"./Toolbars/SideToolbar/SideToolbar.js";import"./Toolbars/SideToolbar/AddPluginFloatingToolbar.js";import"wix-rich-content-ui-components";import"./Icons/PlusIconSmall.js";import"./Icons/PlusIcon.js";import"./Toolbars/SideToolbar/AddPluginMenu.js";import"../PluginMenuPluginsSection-7be8accc.js";import"./pluginsSearchTags.js";import"./Toolbars/SideToolbar/utils.js";import"./Toolbars/SideToolbar/PopupOffsetnHoc.js";import"../StaticToolbar-f83248f3.js";import"./Toolbars/StaticToolbar/MoreButton.js";import"./Icons/ShortcutIcon.js";import"../index-06b546cb.js";import"./Toolbars/StaticToolbar/createStaticTextToolbar.js";import"./Toolbars/StaticToolbar/createStaticToolbar.js";import"./Toolbars/buttons/TextButton.js";import"@babel/runtime/helpers/createClass";import"./Toolbars/buttons/utils/createTextDropdownButton.js";import"./Toolbars/buttons/utils/getTextButtonsFromList.js";import"./Toolbars/buttons/index.js";import"./Toolbars/buttons/TextAlignmentButton.js";import"./Toolbars/buttons/TextButtons.js";import"./Icons/BlockQuoteIcon.js";import"./Icons/BoldIcon.js";import"./Icons/ItalicIcon.js";import"./Icons/OrderedListIcon.js";import"./Icons/TitleIcon.js";import"./Icons/TitleOneIcon.js";import"./Icons/TitleTwoIcon.js";import"./Icons/UnderlineIcon.js";import"./Icons/UnorderedListIcon.js";import"./Toolbars/buttons/utils/createTextInlineStyleButton.js";import"./Toolbars/buttons/utils/createTextBlockStyleButton.js";import"./Toolbars/buttons/utils/createTextAlignmentButton.js";import"./Toolbars/buttons/AddPluginButton.js";import"./Toolbars/buttons/utils/createThemedSeparator.js";import"./Toolbars/toolbar-id.js";import"./Toolbars/StaticToolbar/createMobileToolbar.js";import"./Toolbars/StaticToolbar/createFooterToolbar.js";import"./Toolbars/InlineToolbar/InlineToolbar.js";import"./Toolbars/InlineToolbar/createInlineTextToolbar.js";import"./Toolbars/InlineToolbar/createInlineToolbar.js";import"./Toolbars/createExternalToolbarButtonProps.js";import"./Toolbars/buttons/utils/createButtonProps.js";import"./Toolbars/buttons/TextButtonProps.js";import"./Toolbars/buttons/utils/generateTextToolbarButtonProps.js";import"./Toolbars/buttons/consts.js";import"./Toolbars/buttons/utils/reducePluginTextButtons.js";import"./EditorCommands.js";import"./utils/editorCommandsUtils.js";import"./utils/consts.js";import"ricos-content/libs/draftConsts";import"./keyBindings.js";import"./handleKeyCommand.js";import"./handleBackspaceCommand.js";import"./atomicBlockRemovalUtil.js";import"./handleDeleteCommand.js";import"./handleTabCommand.js";import"./handleReturnCommand.js";import"./handlePastedText.js";import"./utils/draftConvertFromHtml.js";import"./utils/pasting/pastedContentUtil.js";import"./utils/pasting/rgbToHex.js";import"./utils/pasting/htmlToBlock.js";import"./utils/pasting/colorNameToHex.js";import"./utils/pasting/normalizeHTML.js";import"../editorStateConversion-9845f7d3.js";import"uuid";import"../blockStyleFn-a3b3e1cd.js";import"./combineStyleFns.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./InnerModal.js";import"./RichContentEditorModal.js";import"./Toolbars/BlockLinkModal.js";import"./Toolbars/TextLinkModal.js";import"./utils/onCutAndCopy.js";import"@wix/draft-js/lib/getContentStateFragment";import"@wix/draft-js/lib/getDraftEditorSelection";import"@wix/draft-js/lib/editOnCopy";import"@wix/draft-js/lib/editOnCut";import"./preventWixFocusRingAccessibility.js";import"./Components/RCEErrorToast.js";import"./utils/biUtils.js";var WrappedEditor=withI18n(RichContentEditor,englishResources),I18nRichContentEditor=function(_Component){function I18nRichContentEditor(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).editor=void 0,_this.setEditorRef=function(editor){return _this.editor=editor?editor.getWrappedInstance():void 0},_this.getToolbars=function(){return _this.editor.getToolbars()},_this.getToolbarProps=function(type){return _this.editor.getToolbarProps(type)},_this.getT=function(){return _this.editor.getT()},_this.getContainer=function(){var _this$editor;return null===(_this$editor=_this.editor)||void 0===_this$editor?void 0:_this$editor.getContainer()},_this.getPlugins=function(){return _this.editor.getPlugins()},_this.focus=function(){return _this.editor.focus()},_this.blur=function(){return _this.editor.blur()},_this.getEditorCommands=function(){return _this.editor.EditorCommands},_this.isInnerRCERenderedInTable=function(){return _this.editor.isInnerRCERenderedInTable()},_this.setEditorState=function(editorState){var _this$editor2;return null===(_this$editor2=_this.editor)||void 0===_this$editor2?void 0:_this$editor2.updateEditorState(editorState)},_this}return _inheritsLoose(I18nRichContentEditor,_Component),I18nRichContentEditor.prototype.render=function(){return React.createElement(WrappedEditor,_extends({},this.props,{ref:this.setEditorRef}))},I18nRichContentEditor}(Component);I18nRichContentEditor.displayName="RichContentEditor";export{I18nRichContentEditor as default};
//# sourceMappingURL=I18nRichContentEditor.js.map

@@ -1,2 +0,2 @@

import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/inheritsLoose";import"react";import"classnames";export{I as default}from"../RichContentEditor-7b525025.js";import"../blockStyleFn-a3b3e1cd.js";import"wix-rich-content-common";import"lodash";import"wix-rich-content-editor-common";import"../index-06b546cb.js";import"@babel/runtime/helpers/assertThisInitialized";import"../createPlugins-551b8321.js";import"../_commonjsHelpers-3f0e96f4.js";import"@wix/draft-js";import"prop-types";import"immutable";import"@wix/draft-js/lib/DraftOffsetKey";import"./Decorators/Resize/index.js";import"./Decorators/Resize/createDecorator.js";import"react-dom";import"../style-inject.es-a0e1a0ba.js";import"./handleDrop.js";import"./externalToolbarPlugin.js";import"ricos-content";import"react-measure";import"./Toolbars/createEditorToolbars.js";import"./Toolbars/utils.js";import"./Toolbars/default-toolbar-settings.js";import"./Toolbars/SideToolbar/createSideToolbar.js";import"./Toolbars/SideToolbar/SideToolbar.js";import"./Toolbars/SideToolbar/AddPluginFloatingToolbar.js";import"wix-rich-content-ui-components";import"./Icons/PlusIconSmall.js";import"./Icons/PlusIcon.js";import"./Toolbars/SideToolbar/AddPluginMenu.js";import"../PluginMenuPluginsSection-7be8accc.js";import"./pluginsSearchTags.js";import"./Toolbars/SideToolbar/utils.js";import"./Toolbars/SideToolbar/PopupOffsetnHoc.js";import"../StaticToolbar-f83248f3.js";import"./Toolbars/StaticToolbar/MoreButton.js";import"./Icons/ShortcutIcon.js";import"./Toolbars/StaticToolbar/createStaticTextToolbar.js";import"./Toolbars/StaticToolbar/createStaticToolbar.js";import"./Toolbars/buttons/TextButton.js";import"@babel/runtime/helpers/createClass";import"./Toolbars/buttons/utils/createTextDropdownButton.js";import"./Toolbars/buttons/utils/getTextButtonsFromList.js";import"./Toolbars/buttons/index.js";import"./Toolbars/buttons/TextAlignmentButton.js";import"./Toolbars/buttons/TextButtons.js";import"./Icons/BlockQuoteIcon.js";import"./Icons/BoldIcon.js";import"./Icons/ItalicIcon.js";import"./Icons/OrderedListIcon.js";import"./Icons/TitleIcon.js";import"./Icons/TitleOneIcon.js";import"./Icons/TitleTwoIcon.js";import"./Icons/UnderlineIcon.js";import"./Icons/UnorderedListIcon.js";import"./Toolbars/buttons/utils/createTextInlineStyleButton.js";import"./Toolbars/buttons/utils/createTextBlockStyleButton.js";import"./Toolbars/buttons/utils/createTextAlignmentButton.js";import"./Toolbars/buttons/AddPluginButton.js";import"./Toolbars/buttons/utils/createThemedSeparator.js";import"./Toolbars/toolbar-id.js";import"./Toolbars/StaticToolbar/createMobileToolbar.js";import"./Toolbars/StaticToolbar/createFooterToolbar.js";import"./Toolbars/InlineToolbar/InlineToolbar.js";import"./Toolbars/InlineToolbar/createInlineTextToolbar.js";import"./Toolbars/InlineToolbar/createInlineToolbar.js";import"./Toolbars/createExternalToolbarButtonProps.js";import"./Toolbars/buttons/utils/createButtonProps.js";import"./Toolbars/buttons/TextButtonProps.js";import"./Toolbars/buttons/utils/generateTextToolbarButtonProps.js";import"./Toolbars/buttons/consts.js";import"./Toolbars/buttons/utils/reducePluginTextButtons.js";import"./EditorCommands.js";import"./utils/editorCommandsUtils.js";import"./utils/consts.js";import"ricos-content/libs/draftConsts";import"./keyBindings.js";import"./handleKeyCommand.js";import"./handleBackspaceCommand.js";import"./atomicBlockRemovalUtil.js";import"./handleDeleteCommand.js";import"./handleTabCommand.js";import"./handleReturnCommand.js";import"./handlePastedText.js";import"./utils/draftConvertFromHtml.js";import"./utils/pasting/pastedContentUtil.js";import"./utils/pasting/rgbToHex.js";import"./utils/pasting/htmlToBlock.js";import"./utils/pasting/colorNameToHex.js";import"./utils/pasting/normalizeHTML.js";import"../editorStateConversion-b1ea79bd.js";import"uuid";import"./combineStyleFns.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./InnerModal.js";import"./RichContentEditorModal.js";import"./Toolbars/BlockLinkModal.js";import"./Toolbars/TextLinkModal.js";import"./utils/onCutAndCopy.js";import"@wix/draft-js/lib/getContentStateFragment";import"@wix/draft-js/lib/getDraftEditorSelection";import"@wix/draft-js/lib/editOnCopy";import"@wix/draft-js/lib/editOnCut";import"./preventWixFocusRingAccessibility.js";import"./Components/RCEErrorToast.js";import"./utils/biUtils.js";
import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/inheritsLoose";import"react";import"classnames";export{I as default}from"../RichContentEditor-1ea83119.js";import"../blockStyleFn-a3b3e1cd.js";import"wix-rich-content-common";import"lodash";import"wix-rich-content-editor-common";import"../index-06b546cb.js";import"@babel/runtime/helpers/assertThisInitialized";import"../createPlugins-551b8321.js";import"../_commonjsHelpers-3f0e96f4.js";import"@wix/draft-js";import"prop-types";import"immutable";import"@wix/draft-js/lib/DraftOffsetKey";import"./Decorators/Resize/index.js";import"./Decorators/Resize/createDecorator.js";import"react-dom";import"../style-inject.es-a0e1a0ba.js";import"./handleDrop.js";import"./externalToolbarPlugin.js";import"ricos-content";import"react-measure";import"./Toolbars/createEditorToolbars.js";import"./Toolbars/utils.js";import"./Toolbars/default-toolbar-settings.js";import"./Toolbars/SideToolbar/createSideToolbar.js";import"./Toolbars/SideToolbar/SideToolbar.js";import"./Toolbars/SideToolbar/AddPluginFloatingToolbar.js";import"wix-rich-content-ui-components";import"./Icons/PlusIconSmall.js";import"./Icons/PlusIcon.js";import"./Toolbars/SideToolbar/AddPluginMenu.js";import"../PluginMenuPluginsSection-7be8accc.js";import"./pluginsSearchTags.js";import"./Toolbars/SideToolbar/utils.js";import"./Toolbars/SideToolbar/PopupOffsetnHoc.js";import"../StaticToolbar-f83248f3.js";import"./Toolbars/StaticToolbar/MoreButton.js";import"./Icons/ShortcutIcon.js";import"./Toolbars/StaticToolbar/createStaticTextToolbar.js";import"./Toolbars/StaticToolbar/createStaticToolbar.js";import"./Toolbars/buttons/TextButton.js";import"@babel/runtime/helpers/createClass";import"./Toolbars/buttons/utils/createTextDropdownButton.js";import"./Toolbars/buttons/utils/getTextButtonsFromList.js";import"./Toolbars/buttons/index.js";import"./Toolbars/buttons/TextAlignmentButton.js";import"./Toolbars/buttons/TextButtons.js";import"./Icons/BlockQuoteIcon.js";import"./Icons/BoldIcon.js";import"./Icons/ItalicIcon.js";import"./Icons/OrderedListIcon.js";import"./Icons/TitleIcon.js";import"./Icons/TitleOneIcon.js";import"./Icons/TitleTwoIcon.js";import"./Icons/UnderlineIcon.js";import"./Icons/UnorderedListIcon.js";import"./Toolbars/buttons/utils/createTextInlineStyleButton.js";import"./Toolbars/buttons/utils/createTextBlockStyleButton.js";import"./Toolbars/buttons/utils/createTextAlignmentButton.js";import"./Toolbars/buttons/AddPluginButton.js";import"./Toolbars/buttons/utils/createThemedSeparator.js";import"./Toolbars/toolbar-id.js";import"./Toolbars/StaticToolbar/createMobileToolbar.js";import"./Toolbars/StaticToolbar/createFooterToolbar.js";import"./Toolbars/InlineToolbar/InlineToolbar.js";import"./Toolbars/InlineToolbar/createInlineTextToolbar.js";import"./Toolbars/InlineToolbar/createInlineToolbar.js";import"./Toolbars/createExternalToolbarButtonProps.js";import"./Toolbars/buttons/utils/createButtonProps.js";import"./Toolbars/buttons/TextButtonProps.js";import"./Toolbars/buttons/utils/generateTextToolbarButtonProps.js";import"./Toolbars/buttons/consts.js";import"./Toolbars/buttons/utils/reducePluginTextButtons.js";import"./EditorCommands.js";import"./utils/editorCommandsUtils.js";import"./utils/consts.js";import"ricos-content/libs/draftConsts";import"./keyBindings.js";import"./handleKeyCommand.js";import"./handleBackspaceCommand.js";import"./atomicBlockRemovalUtil.js";import"./handleDeleteCommand.js";import"./handleTabCommand.js";import"./handleReturnCommand.js";import"./handlePastedText.js";import"./utils/draftConvertFromHtml.js";import"./utils/pasting/pastedContentUtil.js";import"./utils/pasting/rgbToHex.js";import"./utils/pasting/htmlToBlock.js";import"./utils/pasting/colorNameToHex.js";import"./utils/pasting/normalizeHTML.js";import"../editorStateConversion-9845f7d3.js";import"uuid";import"./combineStyleFns.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./InnerModal.js";import"./RichContentEditorModal.js";import"./Toolbars/BlockLinkModal.js";import"./Toolbars/TextLinkModal.js";import"./utils/onCutAndCopy.js";import"@wix/draft-js/lib/getContentStateFragment";import"@wix/draft-js/lib/getDraftEditorSelection";import"@wix/draft-js/lib/editOnCopy";import"@wix/draft-js/lib/editOnCut";import"./preventWixFocusRingAccessibility.js";import"./Components/RCEErrorToast.js";import"./utils/biUtils.js";
//# sourceMappingURL=InnerRCE.js.map

@@ -1,2 +0,2 @@

import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inheritsLoose";import"react";import"../createPlugins-551b8321.js";import"lodash";import"react-measure";import"./Toolbars/createEditorToolbars.js";import"./EditorCommands.js";import"./keyBindings.js";import"./handleKeyCommand.js";import"./handleReturnCommand.js";import"./handlePastedText.js";import"../blockStyleFn-a3b3e1cd.js";import"./combineStyleFns.js";import"./Toolbars/toolbar-id.js";import"wix-rich-content-editor-common";import"../editorStateConversion-b1ea79bd.js";import"ricos-content";import"wix-rich-content-common";export{R as default}from"../RichContentEditor-7b525025.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./InnerModal.js";import"./utils/onCutAndCopy.js";import"./preventWixFocusRingAccessibility.js";import"./Components/RCEErrorToast.js";import"./utils/biUtils.js";import"./utils/consts.js";import"classnames";import"../_commonjsHelpers-3f0e96f4.js";import"@wix/draft-js";import"prop-types";import"immutable";import"@wix/draft-js/lib/DraftOffsetKey";import"./Decorators/Resize/index.js";import"./Decorators/Resize/createDecorator.js";import"react-dom";import"../style-inject.es-a0e1a0ba.js";import"./handleDrop.js";import"./externalToolbarPlugin.js";import"./Toolbars/utils.js";import"./Toolbars/default-toolbar-settings.js";import"./Toolbars/SideToolbar/createSideToolbar.js";import"./Toolbars/SideToolbar/SideToolbar.js";import"./Toolbars/SideToolbar/AddPluginFloatingToolbar.js";import"wix-rich-content-ui-components";import"./Icons/PlusIconSmall.js";import"./Icons/PlusIcon.js";import"./Toolbars/SideToolbar/AddPluginMenu.js";import"../PluginMenuPluginsSection-7be8accc.js";import"./pluginsSearchTags.js";import"./Toolbars/SideToolbar/utils.js";import"./Toolbars/SideToolbar/PopupOffsetnHoc.js";import"../StaticToolbar-f83248f3.js";import"./Toolbars/StaticToolbar/MoreButton.js";import"./Icons/ShortcutIcon.js";import"../index-06b546cb.js";import"./Toolbars/StaticToolbar/createStaticTextToolbar.js";import"./Toolbars/StaticToolbar/createStaticToolbar.js";import"./Toolbars/buttons/TextButton.js";import"@babel/runtime/helpers/createClass";import"./Toolbars/buttons/utils/createTextDropdownButton.js";import"./Toolbars/buttons/utils/getTextButtonsFromList.js";import"./Toolbars/buttons/index.js";import"./Toolbars/buttons/TextAlignmentButton.js";import"./Toolbars/buttons/TextButtons.js";import"./Icons/BlockQuoteIcon.js";import"./Icons/BoldIcon.js";import"./Icons/ItalicIcon.js";import"./Icons/OrderedListIcon.js";import"./Icons/TitleIcon.js";import"./Icons/TitleOneIcon.js";import"./Icons/TitleTwoIcon.js";import"./Icons/UnderlineIcon.js";import"./Icons/UnorderedListIcon.js";import"./Toolbars/buttons/utils/createTextInlineStyleButton.js";import"./Toolbars/buttons/utils/createTextBlockStyleButton.js";import"./Toolbars/buttons/utils/createTextAlignmentButton.js";import"./Toolbars/buttons/AddPluginButton.js";import"./Toolbars/buttons/utils/createThemedSeparator.js";import"./Toolbars/StaticToolbar/createMobileToolbar.js";import"./Toolbars/StaticToolbar/createFooterToolbar.js";import"./Toolbars/InlineToolbar/InlineToolbar.js";import"./Toolbars/InlineToolbar/createInlineTextToolbar.js";import"./Toolbars/InlineToolbar/createInlineToolbar.js";import"./Toolbars/createExternalToolbarButtonProps.js";import"./Toolbars/buttons/utils/createButtonProps.js";import"./Toolbars/buttons/TextButtonProps.js";import"./Toolbars/buttons/utils/generateTextToolbarButtonProps.js";import"./Toolbars/buttons/consts.js";import"./Toolbars/buttons/utils/reducePluginTextButtons.js";import"./utils/editorCommandsUtils.js";import"ricos-content/libs/draftConsts";import"./handleBackspaceCommand.js";import"./atomicBlockRemovalUtil.js";import"./handleDeleteCommand.js";import"./handleTabCommand.js";import"./utils/draftConvertFromHtml.js";import"./utils/pasting/pastedContentUtil.js";import"./utils/pasting/rgbToHex.js";import"./utils/pasting/htmlToBlock.js";import"./utils/pasting/colorNameToHex.js";import"./utils/pasting/normalizeHTML.js";import"uuid";import"./RichContentEditorModal.js";import"./Toolbars/BlockLinkModal.js";import"./Toolbars/TextLinkModal.js";import"@wix/draft-js/lib/getContentStateFragment";import"@wix/draft-js/lib/getDraftEditorSelection";import"@wix/draft-js/lib/editOnCopy";import"@wix/draft-js/lib/editOnCut";
import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inheritsLoose";import"react";import"../createPlugins-551b8321.js";import"lodash";import"react-measure";import"./Toolbars/createEditorToolbars.js";import"./EditorCommands.js";import"./keyBindings.js";import"./handleKeyCommand.js";import"./handleReturnCommand.js";import"./handlePastedText.js";import"../blockStyleFn-a3b3e1cd.js";import"./combineStyleFns.js";import"./Toolbars/toolbar-id.js";import"wix-rich-content-editor-common";import"../editorStateConversion-9845f7d3.js";import"ricos-content";import"wix-rich-content-common";export{R as default}from"../RichContentEditor-1ea83119.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./InnerModal.js";import"./utils/onCutAndCopy.js";import"./preventWixFocusRingAccessibility.js";import"./Components/RCEErrorToast.js";import"./utils/biUtils.js";import"./utils/consts.js";import"classnames";import"../_commonjsHelpers-3f0e96f4.js";import"@wix/draft-js";import"prop-types";import"immutable";import"@wix/draft-js/lib/DraftOffsetKey";import"./Decorators/Resize/index.js";import"./Decorators/Resize/createDecorator.js";import"react-dom";import"../style-inject.es-a0e1a0ba.js";import"./handleDrop.js";import"./externalToolbarPlugin.js";import"./Toolbars/utils.js";import"./Toolbars/default-toolbar-settings.js";import"./Toolbars/SideToolbar/createSideToolbar.js";import"./Toolbars/SideToolbar/SideToolbar.js";import"./Toolbars/SideToolbar/AddPluginFloatingToolbar.js";import"wix-rich-content-ui-components";import"./Icons/PlusIconSmall.js";import"./Icons/PlusIcon.js";import"./Toolbars/SideToolbar/AddPluginMenu.js";import"../PluginMenuPluginsSection-7be8accc.js";import"./pluginsSearchTags.js";import"./Toolbars/SideToolbar/utils.js";import"./Toolbars/SideToolbar/PopupOffsetnHoc.js";import"../StaticToolbar-f83248f3.js";import"./Toolbars/StaticToolbar/MoreButton.js";import"./Icons/ShortcutIcon.js";import"../index-06b546cb.js";import"./Toolbars/StaticToolbar/createStaticTextToolbar.js";import"./Toolbars/StaticToolbar/createStaticToolbar.js";import"./Toolbars/buttons/TextButton.js";import"@babel/runtime/helpers/createClass";import"./Toolbars/buttons/utils/createTextDropdownButton.js";import"./Toolbars/buttons/utils/getTextButtonsFromList.js";import"./Toolbars/buttons/index.js";import"./Toolbars/buttons/TextAlignmentButton.js";import"./Toolbars/buttons/TextButtons.js";import"./Icons/BlockQuoteIcon.js";import"./Icons/BoldIcon.js";import"./Icons/ItalicIcon.js";import"./Icons/OrderedListIcon.js";import"./Icons/TitleIcon.js";import"./Icons/TitleOneIcon.js";import"./Icons/TitleTwoIcon.js";import"./Icons/UnderlineIcon.js";import"./Icons/UnorderedListIcon.js";import"./Toolbars/buttons/utils/createTextInlineStyleButton.js";import"./Toolbars/buttons/utils/createTextBlockStyleButton.js";import"./Toolbars/buttons/utils/createTextAlignmentButton.js";import"./Toolbars/buttons/AddPluginButton.js";import"./Toolbars/buttons/utils/createThemedSeparator.js";import"./Toolbars/StaticToolbar/createMobileToolbar.js";import"./Toolbars/StaticToolbar/createFooterToolbar.js";import"./Toolbars/InlineToolbar/InlineToolbar.js";import"./Toolbars/InlineToolbar/createInlineTextToolbar.js";import"./Toolbars/InlineToolbar/createInlineToolbar.js";import"./Toolbars/createExternalToolbarButtonProps.js";import"./Toolbars/buttons/utils/createButtonProps.js";import"./Toolbars/buttons/TextButtonProps.js";import"./Toolbars/buttons/utils/generateTextToolbarButtonProps.js";import"./Toolbars/buttons/consts.js";import"./Toolbars/buttons/utils/reducePluginTextButtons.js";import"./utils/editorCommandsUtils.js";import"ricos-content/libs/draftConsts";import"./handleBackspaceCommand.js";import"./atomicBlockRemovalUtil.js";import"./handleDeleteCommand.js";import"./handleTabCommand.js";import"./utils/draftConvertFromHtml.js";import"./utils/pasting/pastedContentUtil.js";import"./utils/pasting/rgbToHex.js";import"./utils/pasting/htmlToBlock.js";import"./utils/pasting/colorNameToHex.js";import"./utils/pasting/normalizeHTML.js";import"uuid";import"./RichContentEditorModal.js";import"./Toolbars/BlockLinkModal.js";import"./Toolbars/TextLinkModal.js";import"@wix/draft-js/lib/getContentStateFragment";import"@wix/draft-js/lib/getDraftEditorSelection";import"@wix/draft-js/lib/editOnCopy";import"@wix/draft-js/lib/editOnCut";
//# sourceMappingURL=RichContentEditor.js.map

@@ -1,2 +0,2 @@

import{ContentState}from"wix-rich-content-editor-common";import{b as convertToRaw}from"../../editorStateConversion-b1ea79bd.js";import getContentStateFragment from"@wix/draft-js/lib/getContentStateFragment";import getDraftEditorSelection from"@wix/draft-js/lib/getDraftEditorSelection";import editOnCopy from"@wix/draft-js/lib/editOnCopy";import editOnCut from"@wix/draft-js/lib/editOnCut";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@wix/draft-js";import"ricos-content";import"uuid";var DRAFT_DECORATOR='[data-contents="true"] [contenteditable="false"]',onCutAndCopy=function(ref,e){var selection=window.getSelection();if(selection&&e.clipboardData&&0!==(null==selection?void 0:selection.rangeCount)&&!function(selection){var _ref=selection||{},anchorNode=_ref.anchorNode,focusNode=_ref.focusNode;if(!anchorNode||!focusNode)return!1;var anchor=anchorNode instanceof Element?anchorNode:anchorNode.parentElement,focus=focusNode instanceof Element?focusNode:focusNode.parentElement,anchorDecorator=anchor&&anchor.closest(DRAFT_DECORATOR),focusDecorator=focus&&focus.closest(DRAFT_DECORATOR);return anchorDecorator&&focusDecorator&&(anchorDecorator.contains(focusDecorator)||focusDecorator.contains(anchorDecorator))}(selection)){var fragment=function(editorState,editorRoot){var selectionState=getDraftEditorSelection(editorState,editorRoot).selectionState,fragment=getContentStateFragment(editorState.getCurrentContent(),selectionState);return fragment.every((function(block){return 0===block.getText().length}))?null:fragment}(ref._latestEditorState,ref.editor);if(fragment){var content=ContentState.createFromBlockArray(fragment.toArray()),serialisedContent=JSON.stringify(convertToRaw(content)),fragmentElt=document.createElement("div");fragmentElt.appendChild(selection.getRangeAt(0).cloneContents()),fragmentElt.setAttribute("data-draftjs-conductor-fragment",serialisedContent),fragmentElt.setAttribute("style","white-space: pre-wrap;"),e.clipboardData.setData("text/plain",selection.toString()),e.clipboardData.setData("text/html",fragmentElt.outerHTML),e.preventDefault()}}},onCopy=function(ref,e){onCutAndCopy(ref,e),editOnCopy(ref,e)},onCut=function(ref,e){onCutAndCopy(ref,e),editOnCut(ref,e)};export{onCopy,onCut};
import{ContentState}from"wix-rich-content-editor-common";import{b as convertToRaw}from"../../editorStateConversion-9845f7d3.js";import getContentStateFragment from"@wix/draft-js/lib/getContentStateFragment";import getDraftEditorSelection from"@wix/draft-js/lib/getDraftEditorSelection";import editOnCopy from"@wix/draft-js/lib/editOnCopy";import editOnCut from"@wix/draft-js/lib/editOnCut";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@wix/draft-js";import"ricos-content";import"uuid";var DRAFT_DECORATOR='[data-contents="true"] [contenteditable="false"]',onCutAndCopy=function(ref,e){var selection=window.getSelection();if(selection&&e.clipboardData&&0!==(null==selection?void 0:selection.rangeCount)&&!function(selection){var _ref=selection||{},anchorNode=_ref.anchorNode,focusNode=_ref.focusNode;if(!anchorNode||!focusNode)return!1;var anchor=anchorNode instanceof Element?anchorNode:anchorNode.parentElement,focus=focusNode instanceof Element?focusNode:focusNode.parentElement,anchorDecorator=anchor&&anchor.closest(DRAFT_DECORATOR),focusDecorator=focus&&focus.closest(DRAFT_DECORATOR);return anchorDecorator&&focusDecorator&&(anchorDecorator.contains(focusDecorator)||focusDecorator.contains(anchorDecorator))}(selection)){var fragment=function(editorState,editorRoot){var selectionState=getDraftEditorSelection(editorState,editorRoot).selectionState,fragment=getContentStateFragment(editorState.getCurrentContent(),selectionState);return fragment.every((function(block){return 0===block.getText().length}))?null:fragment}(ref._latestEditorState,ref.editor);if(fragment){var content=ContentState.createFromBlockArray(fragment.toArray()),serialisedContent=JSON.stringify(convertToRaw(content)),fragmentElt=document.createElement("div");fragmentElt.appendChild(selection.getRangeAt(0).cloneContents()),fragmentElt.setAttribute("data-draftjs-conductor-fragment",serialisedContent),fragmentElt.setAttribute("style","white-space: pre-wrap;"),e.clipboardData.setData("text/plain",selection.toString()),e.clipboardData.setData("text/html",fragmentElt.outerHTML),e.preventDefault()}}},onCopy=function(ref,e){onCutAndCopy(ref,e),editOnCopy(ref,e)},onCut=function(ref,e){onCutAndCopy(ref,e),editOnCut(ref,e)};export{onCopy,onCut};
//# sourceMappingURL=onCutAndCopy.js.map

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),draftJs=require("@wix/draft-js"),ricosContent=require("ricos-content"),uuid=require("uuid");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),_excluded=["link"],_excluded2=["rows"],addMetadata=function(obj,version,id){var newObj=function(obj,version){obj.VERSION=version}(obj,version);return newObj=function(obj,id){return obj.ID=id,obj}(obj,id),newObj},isCollapsibleList=function(entity){return entity.type===ricosContent.COLLAPSIBLE_LIST_TYPE},isTable=function(entity){return entity.type===ricosContent.TABLE_TYPE},entityMapDataFixer=function(rawContentState,entityFixers){var updatedRaw=wixRichContentEditorCommon.cloneDeepWithoutEditorState(rawContentState);return Object.values(updatedRaw.entityMap).forEach((function(entity){entityFixers.forEach((function(_ref){var predicate=_ref.predicate,entityFixer=_ref.entityFixer;predicate(entity)&&entityFixer(entity)}))})),updatedRaw},entityFixersToRaw=[{predicate:function(entity){var _entity$data,_entity$data$config,_entity$data$config$l;return"wix-draft-plugin-image"===entity.type&&!(null===(_entity$data=entity.data)||void 0===_entity$data||null===(_entity$data$config=_entity$data.config)||void 0===_entity$data$config||null===(_entity$data$config$l=_entity$data$config.link)||void 0===_entity$data$config$l||!_entity$data$config$l.anchor)},entityFixer:function(entity){var _entity$data$config2=entity.data.config,link=_entity$data$config2.link,rest=_objectWithoutPropertiesLoose__default.default(_entity$data$config2,_excluded);entity.data.config=_extends__default.default({anchor:link.anchor},rest)}},{predicate:function(entity){return"LINK"===entity.type&&!!entity.data.anchor},entityFixer:function(entity){entity.type="ANCHOR"}},{predicate:isCollapsibleList,entityFixer:function(entity){var pairs=entity.data.pairs;entity.data.pairs=pairs.map((function(pair){var _pair$title,_pair$content,title=(null===(_pair$title=pair.title)||void 0===_pair$title?void 0:_pair$title.getCurrentContent())||createEmptyContent(),content=(null===(_pair$content=pair.content)||void 0===_pair$content?void 0:_pair$content.getCurrentContent())||createEmptyContent();return{key:pair.key,title:draftJs.convertToRaw(title),content:draftJs.convertToRaw(content)}}))}},{predicate:isTable,entityFixer:function(entity){entity.data.config=convertTableConfigToRaw(entity.data.config)}}],convertTableConfigToRaw=function(config){var rows=config.rows,rest=_objectWithoutPropertiesLoose__default.default(config,_excluded2),newRows={};return Object.entries(rows).forEach((function(_ref2){var rowIndex=_ref2[0],row=_ref2[1];newRows[rowIndex]={},Object.entries(row.columns).forEach((function(_ref3){var _cell$content,_extends2,cellIndex=_ref3[0],cell=_ref3[1],contentState=(null===(_cell$content=cell.content)||void 0===_cell$content?void 0:_cell$content.getCurrentContent())||createEmptyContent(),content=draftJs.convertToRaw(contentState);newRows[rowIndex].columns=_extends__default.default({},newRows[rowIndex].columns,((_extends2={})[cellIndex]=_extends__default.default({},cell,{content:content}),_extends2))}))})),_extends__default.default({rows:newRows},rest)},entityFixersFromRaw=[{predicate:isCollapsibleList,entityFixer:function(entity){var pairs=entity.data.pairs;entity.data.pairs=pairs.map((function(pair){return{key:pair.key,title:wixRichContentEditorCommon.EditorState.createWithContent(convertFromRaw(pair.title)),content:wixRichContentEditorCommon.EditorState.createWithContent(convertFromRaw(pair.content))}}))}},{predicate:isTable,entityFixer:function(entity){var rows=entity.data.config.rows;Object.entries(rows).forEach((function(_ref4){var row=_ref4[1];Object.entries(row.columns).forEach((function(_ref5){var column=_ref5[1];column.content=wixRichContentEditorCommon.EditorState.createWithContent(convertFromRaw(column.content))}))}))}},{predicate:function(entity){return entity.type===ricosContent.SOUND_CLOUD_TYPE},entityFixer:function(entity){entity.type=ricosContent.VIDEO_TYPE,entity.data.type="soundCloud"}}],addDocumentStyle=function(obj,documentStyle){return documentStyle&&(obj.documentStyle=documentStyle),obj},convertFromRaw=function(rawState){return addMetadata(addDocumentStyle(draftJs.convertFromRaw(entityMapDataFixer(rawState,entityFixersFromRaw)),rawState.documentStyle),rawState.VERSION,rawState.ID)},createEmpty=function(){return addMetadata(wixRichContentEditorCommon.EditorState.createEmpty(),"9.6.1",uuid.v4())},createEmptyContent=function(){return createEmpty().getCurrentContent()};Object.defineProperty(exports,"EditorState",{enumerable:!0,get:function(){return wixRichContentEditorCommon.EditorState}}),exports.convertFromRaw=convertFromRaw,exports.convertTableConfigToRaw=convertTableConfigToRaw,exports.convertToRaw=function(ContentState){return addMetadata(addDocumentStyle(((contentState=entityMapDataFixer(draftJs.convertToRaw(ContentState),entityFixersToRaw)).blocks.forEach((function(block){return Object.keys(block.data).forEach((function(key){var value=block.data[key];value.toObject&&(block.data[key]=value.toObject())}))})),contentState),ContentState.documentStyle),"9.6.1",ContentState.ID);var contentState},exports.createEmpty=createEmpty,exports.createWithContent=function(contentState){return addMetadata(addDocumentStyle(wixRichContentEditorCommon.EditorState.createWithContent(contentState),contentState.documentStyle),contentState.VERSION,contentState.ID)};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),draftJs=require("@wix/draft-js"),ricosContent=require("ricos-content"),uuid=require("uuid");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),_excluded=["link"],_excluded2=["rows"],addMetadata=function(obj,version,id){var newObj=function(obj,version){obj.VERSION=version}(obj,version);return newObj=function(obj,id){return obj.ID=id,obj}(obj,id),newObj},isCollapsibleList=function(entity){return entity.type===ricosContent.COLLAPSIBLE_LIST_TYPE},isTable=function(entity){return entity.type===ricosContent.TABLE_TYPE},entityMapDataFixer=function(rawContentState,entityFixers){var updatedRaw=wixRichContentEditorCommon.cloneDeepWithoutEditorState(rawContentState);return Object.values(updatedRaw.entityMap).forEach((function(entity){entityFixers.forEach((function(_ref){var predicate=_ref.predicate,entityFixer=_ref.entityFixer;predicate(entity)&&entityFixer(entity)}))})),updatedRaw},entityFixersToRaw=[{predicate:function(entity){var _entity$data,_entity$data$config,_entity$data$config$l;return"wix-draft-plugin-image"===entity.type&&!(null===(_entity$data=entity.data)||void 0===_entity$data||null===(_entity$data$config=_entity$data.config)||void 0===_entity$data$config||null===(_entity$data$config$l=_entity$data$config.link)||void 0===_entity$data$config$l||!_entity$data$config$l.anchor)},entityFixer:function(entity){var _entity$data$config2=entity.data.config,link=_entity$data$config2.link,rest=_objectWithoutPropertiesLoose__default.default(_entity$data$config2,_excluded);entity.data.config=_extends__default.default({anchor:link.anchor},rest)}},{predicate:function(entity){return"LINK"===entity.type&&!!entity.data.anchor},entityFixer:function(entity){entity.type="ANCHOR"}},{predicate:isCollapsibleList,entityFixer:function(entity){var pairs=entity.data.pairs;entity.data.pairs=pairs.map((function(pair){var _pair$title,_pair$content,title=(null===(_pair$title=pair.title)||void 0===_pair$title?void 0:_pair$title.getCurrentContent())||createEmptyContent(),content=(null===(_pair$content=pair.content)||void 0===_pair$content?void 0:_pair$content.getCurrentContent())||createEmptyContent();return{key:pair.key,title:draftJs.convertToRaw(title),content:draftJs.convertToRaw(content)}}))}},{predicate:isTable,entityFixer:function(entity){entity.data.config=convertTableConfigToRaw(entity.data.config)}}],convertTableConfigToRaw=function(config){var rows=config.rows,rest=_objectWithoutPropertiesLoose__default.default(config,_excluded2),newRows={};return Object.entries(rows).forEach((function(_ref2){var rowIndex=_ref2[0],row=_ref2[1];newRows[rowIndex]={},Object.entries(row.columns).forEach((function(_ref3){var _cell$content,_extends2,cellIndex=_ref3[0],cell=_ref3[1],contentState=(null===(_cell$content=cell.content)||void 0===_cell$content?void 0:_cell$content.getCurrentContent())||createEmptyContent(),content=draftJs.convertToRaw(contentState);newRows[rowIndex].columns=_extends__default.default({},newRows[rowIndex].columns,((_extends2={})[cellIndex]=_extends__default.default({},cell,{content:content}),_extends2))}))})),_extends__default.default({rows:newRows},rest)},entityFixersFromRaw=[{predicate:isCollapsibleList,entityFixer:function(entity){var pairs=entity.data.pairs;entity.data.pairs=pairs.map((function(pair){return{key:pair.key,title:wixRichContentEditorCommon.EditorState.createWithContent(convertFromRaw(pair.title)),content:wixRichContentEditorCommon.EditorState.createWithContent(convertFromRaw(pair.content))}}))}},{predicate:isTable,entityFixer:function(entity){var rows=entity.data.config.rows;Object.entries(rows).forEach((function(_ref4){var row=_ref4[1];Object.entries(row.columns).forEach((function(_ref5){var column=_ref5[1];column.content=wixRichContentEditorCommon.EditorState.createWithContent(convertFromRaw(column.content))}))}))}},{predicate:function(entity){return entity.type===ricosContent.SOUND_CLOUD_TYPE},entityFixer:function(entity){entity.type=ricosContent.VIDEO_TYPE,entity.data.type="soundCloud"}}],addDocumentStyle=function(obj,documentStyle){return documentStyle&&(obj.documentStyle=documentStyle),obj},convertFromRaw=function(rawState){return addMetadata(addDocumentStyle(draftJs.convertFromRaw(entityMapDataFixer(rawState,entityFixersFromRaw)),rawState.documentStyle),rawState.VERSION,rawState.ID)},createEmpty=function(){return addMetadata(wixRichContentEditorCommon.EditorState.createEmpty(),"9.6.2-patch.1",uuid.v4())},createEmptyContent=function(){return createEmpty().getCurrentContent()};Object.defineProperty(exports,"EditorState",{enumerable:!0,get:function(){return wixRichContentEditorCommon.EditorState}}),exports.convertFromRaw=convertFromRaw,exports.convertTableConfigToRaw=convertTableConfigToRaw,exports.convertToRaw=function(ContentState){return addMetadata(addDocumentStyle(((contentState=entityMapDataFixer(draftJs.convertToRaw(ContentState),entityFixersToRaw)).blocks.forEach((function(block){return Object.keys(block.data).forEach((function(key){var value=block.data[key];value.toObject&&(block.data[key]=value.toObject())}))})),contentState),ContentState.documentStyle),"9.6.2-patch.1",ContentState.ID);var contentState},exports.createEmpty=createEmpty,exports.createWithContent=function(contentState){return addMetadata(addDocumentStyle(wixRichContentEditorCommon.EditorState.createWithContent(contentState),contentState.documentStyle),contentState.VERSION,contentState.ID)};

@@ -1,1 +0,1 @@

import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{EditorState,cloneDeepWithoutEditorState}from"wix-rich-content-editor-common";export{EditorState}from"wix-rich-content-editor-common";import{convertToRaw as convertToRaw$1,convertFromRaw as convertFromRaw$1}from"@wix/draft-js";import{VIDEO_TYPE,COLLAPSIBLE_LIST_TYPE,TABLE_TYPE,SOUND_CLOUD_TYPE}from"ricos-content";import{v4}from"uuid";var _excluded=["link"],_excluded2=["rows"],addMetadata=function(obj,version,id){var newObj=function(obj,version){obj.VERSION=version}(obj,version);return newObj=function(obj,id){return obj.ID=id,obj}(obj,id),newObj},isCollapsibleList=function(entity){return entity.type===COLLAPSIBLE_LIST_TYPE},isTable=function(entity){return entity.type===TABLE_TYPE},entityMapDataFixer=function(rawContentState,entityFixers){var updatedRaw=cloneDeepWithoutEditorState(rawContentState);return Object.values(updatedRaw.entityMap).forEach((function(entity){entityFixers.forEach((function(_ref){var predicate=_ref.predicate,entityFixer=_ref.entityFixer;predicate(entity)&&entityFixer(entity)}))})),updatedRaw},entityFixersToRaw=[{predicate:function(entity){var _entity$data,_entity$data$config,_entity$data$config$l;return"wix-draft-plugin-image"===entity.type&&!(null===(_entity$data=entity.data)||void 0===_entity$data||null===(_entity$data$config=_entity$data.config)||void 0===_entity$data$config||null===(_entity$data$config$l=_entity$data$config.link)||void 0===_entity$data$config$l||!_entity$data$config$l.anchor)},entityFixer:function(entity){var _entity$data$config2=entity.data.config,link=_entity$data$config2.link,rest=_objectWithoutPropertiesLoose(_entity$data$config2,_excluded);entity.data.config=_extends({anchor:link.anchor},rest)}},{predicate:function(entity){return"LINK"===entity.type&&!!entity.data.anchor},entityFixer:function(entity){entity.type="ANCHOR"}},{predicate:isCollapsibleList,entityFixer:function(entity){var pairs=entity.data.pairs;entity.data.pairs=pairs.map((function(pair){var _pair$title,_pair$content,title=(null===(_pair$title=pair.title)||void 0===_pair$title?void 0:_pair$title.getCurrentContent())||createEmptyContent(),content=(null===(_pair$content=pair.content)||void 0===_pair$content?void 0:_pair$content.getCurrentContent())||createEmptyContent();return{key:pair.key,title:convertToRaw$1(title),content:convertToRaw$1(content)}}))}},{predicate:isTable,entityFixer:function(entity){entity.data.config=convertTableConfigToRaw(entity.data.config)}}],convertTableConfigToRaw=function(config){var rows=config.rows,rest=_objectWithoutPropertiesLoose(config,_excluded2),newRows={};return Object.entries(rows).forEach((function(_ref2){var rowIndex=_ref2[0],row=_ref2[1];newRows[rowIndex]={},Object.entries(row.columns).forEach((function(_ref3){var _cell$content,_extends2,cellIndex=_ref3[0],cell=_ref3[1],contentState=(null===(_cell$content=cell.content)||void 0===_cell$content?void 0:_cell$content.getCurrentContent())||createEmptyContent(),content=convertToRaw$1(contentState);newRows[rowIndex].columns=_extends({},newRows[rowIndex].columns,((_extends2={})[cellIndex]=_extends({},cell,{content:content}),_extends2))}))})),_extends({rows:newRows},rest)},entityFixersFromRaw=[{predicate:isCollapsibleList,entityFixer:function(entity){var pairs=entity.data.pairs;entity.data.pairs=pairs.map((function(pair){return{key:pair.key,title:EditorState.createWithContent(convertFromRaw(pair.title)),content:EditorState.createWithContent(convertFromRaw(pair.content))}}))}},{predicate:isTable,entityFixer:function(entity){var rows=entity.data.config.rows;Object.entries(rows).forEach((function(_ref4){var row=_ref4[1];Object.entries(row.columns).forEach((function(_ref5){var column=_ref5[1];column.content=EditorState.createWithContent(convertFromRaw(column.content))}))}))}},{predicate:function(entity){return entity.type===SOUND_CLOUD_TYPE},entityFixer:function(entity){entity.type=VIDEO_TYPE,entity.data.type="soundCloud"}}],addDocumentStyle=function(obj,documentStyle){return documentStyle&&(obj.documentStyle=documentStyle),obj},convertToRaw=function(ContentState){return addMetadata(addDocumentStyle(((contentState=entityMapDataFixer(convertToRaw$1(ContentState),entityFixersToRaw)).blocks.forEach((function(block){return Object.keys(block.data).forEach((function(key){var value=block.data[key];value.toObject&&(block.data[key]=value.toObject())}))})),contentState),ContentState.documentStyle),"9.6.1",ContentState.ID);var contentState},convertFromRaw=function(rawState){return addMetadata(addDocumentStyle(convertFromRaw$1(entityMapDataFixer(rawState,entityFixersFromRaw)),rawState.documentStyle),rawState.VERSION,rawState.ID)},createEmpty=function(){return addMetadata(EditorState.createEmpty(),"9.6.1",v4())},createEmptyContent=function(){return createEmpty().getCurrentContent()},createWithContent=function(contentState){return addMetadata(addDocumentStyle(EditorState.createWithContent(contentState),contentState.documentStyle),contentState.VERSION,contentState.ID)};export{convertFromRaw,convertTableConfigToRaw,convertToRaw,createEmpty,createWithContent};
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{EditorState,cloneDeepWithoutEditorState}from"wix-rich-content-editor-common";export{EditorState}from"wix-rich-content-editor-common";import{convertToRaw as convertToRaw$1,convertFromRaw as convertFromRaw$1}from"@wix/draft-js";import{VIDEO_TYPE,COLLAPSIBLE_LIST_TYPE,TABLE_TYPE,SOUND_CLOUD_TYPE}from"ricos-content";import{v4}from"uuid";var _excluded=["link"],_excluded2=["rows"],addMetadata=function(obj,version,id){var newObj=function(obj,version){obj.VERSION=version}(obj,version);return newObj=function(obj,id){return obj.ID=id,obj}(obj,id),newObj},isCollapsibleList=function(entity){return entity.type===COLLAPSIBLE_LIST_TYPE},isTable=function(entity){return entity.type===TABLE_TYPE},entityMapDataFixer=function(rawContentState,entityFixers){var updatedRaw=cloneDeepWithoutEditorState(rawContentState);return Object.values(updatedRaw.entityMap).forEach((function(entity){entityFixers.forEach((function(_ref){var predicate=_ref.predicate,entityFixer=_ref.entityFixer;predicate(entity)&&entityFixer(entity)}))})),updatedRaw},entityFixersToRaw=[{predicate:function(entity){var _entity$data,_entity$data$config,_entity$data$config$l;return"wix-draft-plugin-image"===entity.type&&!(null===(_entity$data=entity.data)||void 0===_entity$data||null===(_entity$data$config=_entity$data.config)||void 0===_entity$data$config||null===(_entity$data$config$l=_entity$data$config.link)||void 0===_entity$data$config$l||!_entity$data$config$l.anchor)},entityFixer:function(entity){var _entity$data$config2=entity.data.config,link=_entity$data$config2.link,rest=_objectWithoutPropertiesLoose(_entity$data$config2,_excluded);entity.data.config=_extends({anchor:link.anchor},rest)}},{predicate:function(entity){return"LINK"===entity.type&&!!entity.data.anchor},entityFixer:function(entity){entity.type="ANCHOR"}},{predicate:isCollapsibleList,entityFixer:function(entity){var pairs=entity.data.pairs;entity.data.pairs=pairs.map((function(pair){var _pair$title,_pair$content,title=(null===(_pair$title=pair.title)||void 0===_pair$title?void 0:_pair$title.getCurrentContent())||createEmptyContent(),content=(null===(_pair$content=pair.content)||void 0===_pair$content?void 0:_pair$content.getCurrentContent())||createEmptyContent();return{key:pair.key,title:convertToRaw$1(title),content:convertToRaw$1(content)}}))}},{predicate:isTable,entityFixer:function(entity){entity.data.config=convertTableConfigToRaw(entity.data.config)}}],convertTableConfigToRaw=function(config){var rows=config.rows,rest=_objectWithoutPropertiesLoose(config,_excluded2),newRows={};return Object.entries(rows).forEach((function(_ref2){var rowIndex=_ref2[0],row=_ref2[1];newRows[rowIndex]={},Object.entries(row.columns).forEach((function(_ref3){var _cell$content,_extends2,cellIndex=_ref3[0],cell=_ref3[1],contentState=(null===(_cell$content=cell.content)||void 0===_cell$content?void 0:_cell$content.getCurrentContent())||createEmptyContent(),content=convertToRaw$1(contentState);newRows[rowIndex].columns=_extends({},newRows[rowIndex].columns,((_extends2={})[cellIndex]=_extends({},cell,{content:content}),_extends2))}))})),_extends({rows:newRows},rest)},entityFixersFromRaw=[{predicate:isCollapsibleList,entityFixer:function(entity){var pairs=entity.data.pairs;entity.data.pairs=pairs.map((function(pair){return{key:pair.key,title:EditorState.createWithContent(convertFromRaw(pair.title)),content:EditorState.createWithContent(convertFromRaw(pair.content))}}))}},{predicate:isTable,entityFixer:function(entity){var rows=entity.data.config.rows;Object.entries(rows).forEach((function(_ref4){var row=_ref4[1];Object.entries(row.columns).forEach((function(_ref5){var column=_ref5[1];column.content=EditorState.createWithContent(convertFromRaw(column.content))}))}))}},{predicate:function(entity){return entity.type===SOUND_CLOUD_TYPE},entityFixer:function(entity){entity.type=VIDEO_TYPE,entity.data.type="soundCloud"}}],addDocumentStyle=function(obj,documentStyle){return documentStyle&&(obj.documentStyle=documentStyle),obj},convertToRaw=function(ContentState){return addMetadata(addDocumentStyle(((contentState=entityMapDataFixer(convertToRaw$1(ContentState),entityFixersToRaw)).blocks.forEach((function(block){return Object.keys(block.data).forEach((function(key){var value=block.data[key];value.toObject&&(block.data[key]=value.toObject())}))})),contentState),ContentState.documentStyle),"9.6.2-patch.1",ContentState.ID);var contentState},convertFromRaw=function(rawState){return addMetadata(addDocumentStyle(convertFromRaw$1(entityMapDataFixer(rawState,entityFixersFromRaw)),rawState.documentStyle),rawState.VERSION,rawState.ID)},createEmpty=function(){return addMetadata(EditorState.createEmpty(),"9.6.2-patch.1",v4())},createEmptyContent=function(){return createEmpty().getCurrentContent()},createWithContent=function(contentState){return addMetadata(addDocumentStyle(EditorState.createWithContent(contentState),contentState.documentStyle),contentState.VERSION,contentState.ID)};export{convertFromRaw,convertTableConfigToRaw,convertToRaw,createEmpty,createWithContent};
{
"name": "wix-rich-content-editor",
"version": "9.6.1",
"version": "9.6.2-patch.1",
"author": {

@@ -55,6 +55,6 @@ "name": "Jonathan Bachman",

"uuid": "^3.4.0",
"wix-rich-content-common": "9.6.1",
"wix-rich-content-editor-common": "9.6.1",
"wix-rich-content-plugin-commons": "9.6.1",
"wix-rich-content-ui-components": "9.6.1"
"wix-rich-content-common": "9.6.2-patch.1",
"wix-rich-content-editor-common": "9.6.2-patch.1",
"wix-rich-content-plugin-commons": "9.6.2-patch.1",
"wix-rich-content-ui-components": "9.6.2-patch.1"
},

@@ -61,0 +61,0 @@ "peerDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc