Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

richlagetest

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

richlagetest - npm Package Compare versions

Comparing version 0.0.0-c1c54508e143627c121ba7103459dabfff1b632f to 0.0.0-c3497ae916083b3348946dca8135c80bbe4d3833

dist/loadable/viewer/cjs/giphy-viewer.cjs.js

2

dist/module.cjs.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var wixRichContentCommon=require("wix-rich-content-common"),_extends=require("@babel/runtime/helpers/extends"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),wixRichContentPluginCommons=require("wix-rich-content-plugin-commons"),React=require("react"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),_assertThisInitialized=require("@babel/runtime/helpers/assertThisInitialized"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),lodash=require("lodash"),_createClass=require("@babel/runtime/helpers/createClass"),classNames=require("classnames"),Modal=require("react-modal");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _pluginSettingsByType,_extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),React__default=_interopDefaultLegacy(React),_assertThisInitialized__default=_interopDefaultLegacy(_assertThisInitialized),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),_createClass__default=_interopDefaultLegacy(_createClass),classNames__default=_interopDefaultLegacy(classNames),Modal__default=_interopDefaultLegacy(Modal),TEXT_COLOR_TYPE="wix-rich-content-text-color",TEXT_HIGHLIGHT_TYPE="wix-rich-content-text-highlight",normalizeStyle=function(style){try{return JSON.parse(style)}catch(e){return{FG:style}}},isTextDecoration=function(style,type){return!!normalizeStyle(style)[type]},getColorByType=function(style,type){return normalizeStyle(style)[type]||""},getColor=function(style){var parsed=normalizeStyle(style);return Object.values(parsed)[0]},textForegroundPredicate=function(styleSelectionPredicate){return function(style){return styleSelectionPredicate(getColorByType(style,"FG"))}},textBackgroundPredicate=function(styleSelectionPredicate){return function(style){return styleSelectionPredicate(getColorByType(style,"BG"))}},styleMapper=function(type){return type===TEXT_HIGHLIGHT_TYPE?function(color){return JSON.stringify({BG:color})}:function(color){return JSON.stringify({FG:color})}},DEFAULT_PALETTE=Object.freeze(["#ffffff","#303030","#3a54b4","#bfad80","#bf695c","#f7f7f7"]),DEFAULT_STYLE_SELECTION_PREDICATE=function(style){return wixRichContentCommon.isHexColor(style)},userColors=[],DEFAULTS={configTextColor:{editor:{onColorAdded:function(color){return userColors=[].concat(userColors,[color])},getUserColors:function(){return userColors}},viewer:{}},configTextHighlight:{editor:{onColorAdded:function(color){return userColors=[].concat(userColors,[color])},getUserColors:function(){return userColors}},viewer:{}}},schema={definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"color-scheme",type:"object",title:"color-scheme schema",required:["color","index"],properties:{color:{$id:"#/properties/color",type:"string",title:"hex color",default:"",examples:["#fff","#bada55"],pattern:"^#[0-9a-f]{3}(?:[0-9a-f]{3})?$"},index:{$id:"#/properties/index",type:"integer",title:"color index",default:0,examples:[0]}}},extractColor=function(colorScheme,style){return colorScheme&&colorScheme[style]?colorScheme[style].color:wixRichContentCommon.isHexColor(style)?style:void 0},TextColorPanel=function(_Component){function TextColorPanel(props){var _this,colorScheme;return(_this=_Component.call(this,props)||this).styleSelectionPredicate=props.predicate(props.settings.styleSelectionPredicate||DEFAULT_STYLE_SELECTION_PREDICATE),!props.settings.colorScheme||(colorScheme=props.settings.colorScheme,lodash.isObject(colorScheme)&&Object.values(colorScheme).every((function(value){return wixRichContentCommon.validate(value,schema)})))||console.error("Error: colorScheme is not valid"),_this.currentColors=wixRichContentEditorCommon.getSelectionStyles(props.editorState,_this.styleSelectionPredicate),_this.state={currentColor:_this.currentColors.length>0?extractColor(props.settings.colorScheme,getColor(_this.currentColors[0])):_this.props.defaultColor,currentSchemeColor:_this.currentColors[0]&&getColor(_this.currentColors[0]),userColors:props.settings.getUserColors()||[]},_this.setColor=_this.setColor.bind(_assertThisInitialized__default.default(_this)),_this.onColorAdded=_this.onColorAdded.bind(_assertThisInitialized__default.default(_this)),_this}_inheritsLoose__default.default(TextColorPanel,_Component);var _proto=TextColorPanel.prototype;return _proto.componentWillUnmount=function(){this.props.setKeepToolbarOpen(!1)},_proto.setColor=function(_temp){var colorName=(void 0===_temp?{}:_temp).color,_this$props=this.props,editorState=_this$props.editorState,settings=_this$props.settings,defaultColor=_this$props.defaultColor,onSelect=_this$props.onSelect,styleMapper=_this$props.styleMapper,predicate=_this$props.predicate,newColorHex=colorName&&extractColor(settings.colorScheme,colorName);editorState=getInlineColorState(colorName,editorState,settings,styleMapper,predicate),this.setState({currentColor:newColorHex||defaultColor,currentSchemeColor:colorName||this.currentColors[0]&&getColor(this.currentColors[0])}),this.props.closeModal(editorState),onSelect&&onSelect(colorName)},_proto.onColorAdded=function(_ref2){var color=_ref2.color;this.props.settings.onColorAdded(color),this.setState({userColors:this.props.settings.getUserColors()||[]})},_proto.render=function(){var _this$props2=this.props,theme=_this$props2.theme,settings=_this$props2.settings,t=_this$props2.t,setKeepToolbarOpen=_this$props2.setKeepToolbarOpen,isMobile=_this$props2.isMobile,defaultColor=_this$props2.defaultColor,colorPickerHeaderKey=_this$props2.colorPickerHeaderKey,colorScheme=settings.colorScheme,palette=function(colorScheme){return colorScheme?Object.values(colorScheme).sort((function(entry1,entry2){return entry1.index>entry2.index?1:-1})).map((function(entry){return entry.color})):DEFAULT_PALETTE}(colorScheme),schemeAttributes=function(colorScheme){return colorScheme?Object.keys(colorScheme).reduce((function(sorted,key){return!sorted.length||colorScheme[key].index>colorScheme[sorted[0]].index?sorted.push(key):sorted.unshift(key),sorted}),[]):null}(colorScheme),onCustomPickerToggle=settings.onCustomPickerToggle,onCustomColorPicked=settings.onCustomColorPicked,paletteColors=isMobile?palette.slice(0,5):palette.slice(0,6);return React__default.default.createElement(wixRichContentPluginCommons.ColorPicker,{schemeAttributes:schemeAttributes,schemeColor:this.state.currentSchemeColor,color:this.state.currentColor,defaultColor:defaultColor,palette:paletteColors,userColors:this.state.userColors.slice(0,17),onColorAdded:this.onColorAdded,onChange:this.setColor,onResetColor:this.setColor,onCustomPickerToggle:onCustomPickerToggle,onCustomColorPicked:onCustomColorPicked,theme:theme,t:t,setKeepToolbarOpen:setKeepToolbarOpen,isMobile:isMobile},(function(_ref3){var renderPalette=_ref3.renderPalette,renderUserColors=_ref3.renderUserColors,renderAddColorButton=_ref3.renderAddColorButton,renderResetColorButton=_ref3.renderResetColorButton,mergedStyles=_ref3.mergedStyles;return React__default.default.createElement(React__default.default.Fragment,null,isMobile&&React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:mergedStyles.colorPicker_header},t(colorPickerHeaderKey)),React__default.default.createElement("div",{className:mergedStyles.colorPicker_separator})),React__default.default.createElement("div",{className:mergedStyles.colorPicker_palette},React__default.default.createElement("div",{className:mergedStyles.colorPicker_buttons_container},renderPalette(),renderUserColors(),isMobile&&renderAddColorButton()),!isMobile&&React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("hr",{className:mergedStyles.colorPicker_separator}),React__default.default.createElement("div",{className:mergedStyles.colorPicker_bottom_container},renderResetColorButton(),renderAddColorButton()))))}))},TextColorPanel}(React.Component),getInlineColorState=function(color,editorState,settings,styleMapper,predicate){var styleSelectionPredicate=predicate(settings&&settings.styleSelectionPredicate||DEFAULT_STYLE_SELECTION_PREDICATE),selection=editorState.getSelection(),newEditorState=wixRichContentEditorCommon.getSelectionStyles(editorState,styleSelectionPredicate).reduce((function(nextEditorState,prevColor){var contentState=nextEditorState.getCurrentContent(),nextContentState=wixRichContentEditorCommon.Modifier.removeInlineStyle(contentState,selection,prevColor);return wixRichContentEditorCommon.EditorState.push(nextEditorState,nextContentState,"change-inline-style")}),editorState),contentState=newEditorState.getCurrentContent();return color&&(contentState=wixRichContentEditorCommon.Modifier.applyInlineStyle(contentState,selection,styleMapper(color))),wixRichContentEditorCommon.EditorState.push(newEditorState,contentState,"change-inline-style")},TextColorIcon=function(props){return props.newFormattingToolbar?React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21"},props),React__default.default.createElement("path",{width:"10",height:"10",viewBox:"0 0 10 10",fill:props.isDisabled?"graytext":"#000",id:"Icon",d:"M7.84 10l2-5h.32l2 5H7.84zm5.92 4h1.08l-4-10H9.16l-4 10h1.08l1.2-3h5.12l1.2 3z"}),React__default.default.createElement("path",{width:"12",height:"3",viewBox:"0 0 12 3",fill:props.isDisabled?"graytext":""+props.currentColor,id:"Fill",fillRule:"nonzero",d:"M4 19L16 19 16 16 4 16z"})):React__default.default.createElement("svg",Object.assign({width:19,height:19,viewBox:"0 0 19 19"},props),React__default.default.createElement("path",{fill:"currentColor",d:"M12.9406953 8.95385441C12.1642734 9.88748434 11.6208213 10.7926967 11.3103388 11.6694915L7.40037874 11.6694915 6.54305663 13.9353876C6.52834357 13.9742741 6.49110424 14 6.4495274 14L4.09790277 14C4.04267429 14 3.99790277 13.9552285 3.99790277 13.9 3.99790277 13.8868237 4.00050674 13.8737773 4.00556503 13.8616107L8.4700421 3.12322131C8.50105957 3.04861511 8.5739205 3 8.65471758 3L10.3160943 3C10.396723 3 10.4694666 3.04841524 10.5005916 3.12279406L12.9406953 8.95385441zM9.41798529 6.20056497L8.13269519 9.61864407 10.7182206 9.61864407 9.41798529 6.20056497zM12 13.4245258C12 14.8207269 13.145 16 14.5 16 15.855 16 17 14.8202416 17 13.4245258 17 12.103093 16.2894438 10.6820365 14.8683313 9.16135614L14.8683089 9.16137708C14.6797751 8.95963399 14.3633932 8.94892574 14.1616501 9.13745952 14.1536124 9.144971 14.1458247 9.15274572 14.1382999 9.16077099 12.7127666 10.6811133 12 12.1023649 12 13.4245258z"}))},TextHighlightIcon=function(props){return props.newFormattingToolbar?React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},props),React__default.default.createElement("path",{width:"11",height:"10",viewBox:"0 0 11 10",fill:props.isDisabled?"graytext":"#000",id:"Icon",d:"M10.616 3.366L6.5 7.482 4.207 5.189l4.116-4.116c.098-.098.256-.098.354 0l1.94 1.939c.097.098.097.256 0 .354zM5.293 8.689h-1.94L3 8.336v-1.94l.5-.5 2.293 2.293-.5.5zm6.03-6.384L9.384.366c-.487-.488-1.282-.488-1.768 0l-5.47 5.47c-.093.093-.146.22-.146.353v2.147L.823 9.512c-.06.062-.087.15-.066.235.02.084.082.152.164.18l1.5.5c.026.008.052.012.08.012.064 0 .128-.025.176-.073l.676-.677H5.5c.133 0 .26-.052.353-.146l5.47-5.47c.487-.487.487-1.28 0-1.768z",transform:"translate(-210.000000, -80.000000) translate(206.000000, 77.000000) translate(4.000000, 3.310800)"}),React__default.default.createElement("path",{width:"12",height:"3",viewBox:"0 0 12 3",fill:props.isDisabled?"graytext":""+props.currentColor,id:"Fill",fillRule:"nonzero",d:"M0 15.689L12 15.689 12 12.689 0 12.689z"})):React__default.default.createElement("svg",Object.assign({width:"19px",height:"19px",viewBox:"0 0 19 19"},props),React__default.default.createElement("title",null,"Fill Color"),React__default.default.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React__default.default.createElement("path",{d:"M13,15.4025547 C13,16.1865787 13.687,16.8487889 14.5,16.8487889 C15.313,16.8487889 16,16.1863062 16,15.4025547 C16,14.7033546 15.6214705,13.9544845 14.8644116,13.1559444 L14.8643729,13.1559811 C14.6744053,12.9556048 14.3579691,12.9471668 14.1575928,13.1371343 C14.1513476,13.1430551 14.1452562,13.1491362 14.1393249,13.1553715 C13.379775,13.9538457 13,14.7029067 13,15.4025547 Z",fill:"currentColor",fillRule:"nonzero"}),React__default.default.createElement("path",{d:"M3.5,6 C3.22385763,6 3,5.77614237 3,5.5 C3,5.22385763 3.22385763,5 3.5,5 L12.748729,5 C13.3010137,5 13.748729,5.44771525 13.748729,6 L13.748729,13 C13.748729,13.5522847 13.3010137,14 12.748729,14 L5.74872899,14 C5.19644424,14 4.74872899,13.5522847 4.74872899,13 L4.74872899,6 L3.5,6 Z M12.748729,6.00005457 L5.74872899,6.00005457 L5.74872899,13.0000546 L12.748729,6.00005457 Z",fill:"currentColor",fillRule:"nonzero",transform:"translate(8.374364, 9.500000) rotate(-315.000000) translate(-8.374364, -9.500000) "})))},pluginSettingsByType=((_pluginSettingsByType={})[TEXT_COLOR_TYPE]={defaultColor:"#000000",icon:TextColorIcon,predicate:textForegroundPredicate,tooltipKey:"TextColorButton_Tooltip",colorPickerHeaderKey:"Color_Picker_TextColorButton_Header"},_pluginSettingsByType[TEXT_HIGHLIGHT_TYPE]={defaultColor:"#ffffff",icon:TextHighlightIcon,predicate:textBackgroundPredicate,tooltipKey:"TextHighlightButton_Tooltip",colorPickerHeaderKey:"Color_Picker_TextHighlightButton_Header"},_pluginSettingsByType),getButtonProps=function(_ref){var config=_ref.config,type=_ref.type,getEditorState=config.getEditorState,setEditorState=config.setEditorState,t=config.t,theme=config.theme,isMobile=config.isMobile,helpers=config.helpers,uiSettings=config.uiSettings,settings=config[type],experiments=config.experiments,pluginSettings=pluginSettingsByType[type],styleMap=styleMapper(type),noop=function(){return!1},modalStylesFn=function(ref){if(null==ref||!ref.getBoundingClientRect)return{};var _ref$getBoundingClien=ref.getBoundingClientRect(),bottom=_ref$getBoundingClien.bottom,left=_ref$getBoundingClien.left;return isMobile?{content:{position:"absolute",left:"0px",right:"0px",bottom:"0",border:"none",background:"white",overflow:"auto",outline:"none",padding:"0px",width:"100%",zIndex:"6",top:"auto",transform:"translateY(0)",margin:0}}:{content:{display:"inline-table",transform:"translateY(0)",minHeight:"88px",position:"absolute",minWidth:"89px",maxWidth:"184",width:"182px",height:"86px",top:bottom,left:left-15,borderRadius:"2px",border:"1px solid #ededed",margin:"0",background:"#fff"},overlay:{background:"transparent"}}},TextColorModal=function(_ref2){var closeCustomModal=_ref2.closeCustomModal,onSelect=_ref2.onSelect;return React__default.default.createElement(TextColorPanel,{t:t,isMobile:isMobile,theme:theme,closeModal:function(args){var newEditorState,_helpers$closeModal,editorState,selection;newEditorState=args,editorState=getEditorState(),selection=editorState.getSelection(),setEditorState(wixRichContentEditorCommon.EditorState.forceSelection(newEditorState||editorState,selection)),null==helpers||null===(_helpers$closeModal=helpers.closeModal)||void 0===_helpers$closeModal||_helpers$closeModal.call(helpers),closeCustomModal&&closeCustomModal()},editorState:getEditorState(),setEditorState:setEditorState,settings:settings,uiSettings:uiSettings,styleMapper:styleMap,predicate:pluginSettings.predicate,defaultColor:pluginSettings.defaultColor,setKeepToolbarOpen:noop,onSelect:onSelect,colorPickerHeaderKey:pluginSettings.colorPickerHeaderKey})},isDisabled=function(){return getEditorState().getSelection().isCollapsed()||wixRichContentEditorCommon.isAtomicBlockFocused(getEditorState())};return{onClose:function(){},onClick:function(_ref4){return function(_ref3){var ref=_ref3.ref,render=_ref3.render;if(render)render(TextColorModal);else{var _helpers$openModal,modalStyles=wixRichContentEditorCommon.getModalStyles({customStyles:modalStylesFn(ref),fullScreen:!1,isMobile:isMobile});null==helpers||null===(_helpers$openModal=helpers.openModal)||void 0===_helpers$openModal||_helpers$openModal.call(helpers,{modalStyles:modalStyles,helpers:helpers,isMobile:isMobile,modalElement:TextColorModal,theme:theme})}}({ref:_ref4.ref,render:_ref4.render})},isDisabled:isDisabled,arrow:!1,isActive:function(){var predicate=pluginSettings.predicate((null==settings?void 0:settings.styleSelectionPredicate)||DEFAULT_STYLE_SELECTION_PREDICATE);return wixRichContentEditorCommon.getSelectionStyles(config.getEditorState(),predicate).length>0},getIcon:function(){var _settings$toolbar,_settings$toolbar$ico;return(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.InsertPluginButtonIcon)||function(){var _experiments$newForma,editorState,predicate,defaultColor,styleSelectionPredicate,currentColors;return pluginSettings.icon({newFormattingToolbar:null==experiments||null===(_experiments$newForma=experiments.newFormattingToolbar)||void 0===_experiments$newForma?void 0:_experiments$newForma.enabled,currentColor:(editorState=getEditorState(),predicate=pluginSettings.predicate,defaultColor=pluginSettings.defaultColor,styleSelectionPredicate=predicate(settings.styleSelectionPredicate||DEFAULT_STYLE_SELECTION_PREDICATE),currentColors=wixRichContentEditorCommon.getSelectionStyles(editorState,styleSelectionPredicate),currentColors.length>0?extractColor(settings.colorScheme,getColor(currentColors[0])):defaultColor),isDisabled:isDisabled()})}},tooltip:config.t(pluginSettings.tooltipKey),getLabel:function(){return""},type:wixRichContentEditorCommon.BUTTON_TYPES.DROPDOWN,dataHook:type.replace(/\s+/g,"-").toLowerCase()+"-button",modal:TextColorModal,onSelect:function(color){var editorState=getEditorState(),selection=editorState.getSelection(),coloredEditorState=getInlineColorState(color,getEditorState(),settings,styleMap,pluginSettings.predicate);setEditorState(wixRichContentEditorCommon.EditorState.forceSelection(coloredEditorState||editorState,selection))}}},styles={textColorModal:"_2L0nY",textColorModal_mobile:"_2Otbl",textColorModalOverlay:"_1J3EL",textColorModalOverlay_mobile:"_2p47r",textColorPopup_button:"IiTdz",textColorPopup:"_6IxcZ"},BaseTextColor=function(_Component){function BaseTextColor(props){var _this;return(_this=_Component.call(this,props)||this).openPanel=function(){var _this$props=_this.props,isMobile=_this$props.isMobile,setKeepOpen=_this$props.setKeepOpen,config=_this$props.config,pluginParams=_this$props.pluginParams;isMobile||setKeepOpen&&setKeepOpen(!0);var settings=config[pluginParams.type],position={};if(settings.positionPicker)position=settings.positionPicker(_this.buttonRef,216);else{var _this$buttonRef$curre=_this.buttonRef.current.getBoundingClientRect(),bottom=_this$buttonRef$curre.bottom;position={left:_this$buttonRef$curre.left-108,top:bottom}}_this.setState({isPanelOpen:!0,panelLeft:position.left,panelTop:position.top})},_this.closePanel=function(editorState){_this.setState({isPanelOpen:!1}),_this.props.setKeepOpen(!1),_this.preserveSelectionState(editorState)},_this.state={showPanel:!1},_this.styles=wixRichContentCommon.mergeStyles({styles:styles,theme:props.theme}),_this.buttonRef=props.buttonRef,_this.styleMapper=styleMapper(props.pluginParams.type),_this}_inheritsLoose__default.default(BaseTextColor,_Component),BaseTextColor.getModalParent=function(){var _document,_document$querySelect;return null===(_document=document)||void 0===_document||null===(_document$querySelect=_document.querySelector(".DraftEditor-root"))||void 0===_document$querySelect?void 0:_document$querySelect.parentNode};var _proto=BaseTextColor.prototype;return _proto.preserveSelectionState=function(newEditorState){var _this$props2=this.props,setEditorState=_this$props2.setEditorState,editorState=(0,_this$props2.getEditorState)(),selection=editorState.getSelection();setEditorState(wixRichContentEditorCommon.EditorState.forceSelection(newEditorState||editorState,selection))},_proto.render=function(){var _classNames,_classNames2,_this2=this,_this$props3=this.props,theme=_this$props3.theme,helpers=_this$props3.helpers,isMobile=_this$props3.isMobile,t=_this$props3.t,tabIndex=_this$props3.tabIndex,setEditorState=_this$props3.setEditorState,getEditorState=_this$props3.getEditorState,setKeepOpen=_this$props3.setKeepOpen,config=_this$props3.config,uiSettings=_this$props3.uiSettings,pluginParams=_this$props3.pluginParams,toolbarName=_this$props3.toolbarName,settings=config[pluginParams.type],_this$state=this.state,isPanelOpen=_this$state.isPanelOpen,panelTop=_this$state.panelTop,panelLeft=_this$state.panelLeft,tooltip=t(pluginParams.toolTip),buttonStyles={button:theme.inlineToolbarButton,buttonWrapper:theme.inlineToolbarButton_wrapper,icon:theme.inlineToolbarButton_icon,active:theme.inlineToolbarButton_active},modalStyle={content:isMobile?{top:"unset",left:0,backgroundColor:"white"}:{top:panelTop,left:panelLeft,marginTop:15,borderRadius:2,width:184}},TEXT_COLOR=wixRichContentEditorCommon.FORMATTING_BUTTONS.TEXT_COLOR,TEXT_HIGHLIGHT=wixRichContentEditorCommon.FORMATTING_BUTTONS.TEXT_HIGHLIGHT,formattingButtonName=pluginParams.type===TEXT_COLOR_TYPE?TEXT_COLOR:TEXT_HIGHLIGHT;return isMobile||"StaticTextToolbar"!==toolbarName||!settings.inlinePopups?React__default.default.createElement(wixRichContentEditorCommon.InlineToolbarButton,{onClick:this.openPanel,isActive:this.isActive,helpers:helpers,theme:_extends__default.default({},theme,buttonStyles),isMobile:isMobile,tooltipText:tooltip,dataHook:pluginParams.dataHook,formattingButtonName:formattingButtonName,tabIndex:tabIndex,icon:pluginParams.icon,forwardRef:this.buttonRef,pluginType:pluginParams.type},React__default.default.createElement(Modal__default.default,{onRequestClose:function(){return _this2.closePanel()},isOpen:isPanelOpen,parentSelector:BaseTextColor.getModalParent,className:classNames__default.default((_classNames={},_classNames[this.styles.textColorModal]=!isMobile,_classNames[this.styles.textColorModal_mobile]=isMobile,_classNames)),overlayClassName:classNames__default.default((_classNames2={},_classNames2[this.styles.textColorModalOverlay]=!isMobile,_classNames2[this.styles.textColorModalOverlay_mobile]=isMobile,_classNames2)),style:modalStyle,ariaHideApp:!1},React__default.default.createElement(TextColorPanel,{t:t,isMobile:isMobile,theme:theme,closeModal:this.closePanel,editorState:getEditorState(),setEditorState:setEditorState,settings:settings,uiSettings:uiSettings,setKeepToolbarOpen:setKeepOpen,styleMapper:this.styleMapper,predicate:pluginParams.predicate,defaultColor:pluginParams.defaultColor,colorPickerHeaderKey:pluginParams.colorPickerHeaderKey}))):React__default.default.createElement("div",{className:styles.textColorPopup_button},React__default.default.createElement(wixRichContentEditorCommon.InlineToolbarButton,{onClick:this.openPanel,isActive:this.isActive,helpers:helpers,theme:_extends__default.default({},theme,buttonStyles),isMobile:isMobile,tooltipText:tooltip,dataHook:pluginParams.dataHook,formattingButtonName:formattingButtonName,tabIndex:tabIndex,icon:pluginParams.icon,forwardRef:this.buttonRef,pluginType:pluginParams.type},isPanelOpen&&React__default.default.createElement("div",{className:styles.textColorPopup},React__default.default.createElement(wixRichContentEditorCommon.ClickOutside,{onClickOutside:function(){return _this2.closePanel()}},React__default.default.createElement(TextColorPanel,{t:t,isMobile:isMobile,theme:theme,closeModal:this.closePanel,editorState:getEditorState(),setEditorState:setEditorState,settings:settings,uiSettings:uiSettings,setKeepToolbarOpen:setKeepOpen,styleMapper:this.styleMapper,predicate:pluginParams.predicate,defaultColor:pluginParams.defaultColor,colorPickerHeaderKey:pluginParams.colorPickerHeaderKey})))))},_createClass__default.default(BaseTextColor,[{key:"isActive",get:function(){var _this$props4=this.props,config=_this$props4.config,pluginParams=_this$props4.pluginParams,getEditorState=_this$props4.getEditorState,settings=config[pluginParams.type]||{},styleSelectionPredicate=pluginParams.predicate(settings.styleSelectionPredicate||DEFAULT_STYLE_SELECTION_PREDICATE);return wixRichContentEditorCommon.getSelectionStyles(getEditorState(),styleSelectionPredicate).length>0}}]),BaseTextColor}(React.Component);BaseTextColor.defaultProps={setKeepOpen:function(){}};var TextColorButton=function(_Component){function TextColorButton(props){var _this;return(_this=_Component.call(this,props)||this).buttonRef=React__default.default.createRef(),_this}return _inheritsLoose__default.default(TextColorButton,_Component),TextColorButton.prototype.render=function(){var _settings$toolbar,_settings$toolbar$ico,settings=this.props.config[TEXT_COLOR_TYPE],pluginParams={dataHook:"TextColorButton",toolTip:"TextColorButton_Tooltip",icon:(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.InsertPluginButtonIcon)||TextColorIcon,type:TEXT_COLOR_TYPE,predicate:textForegroundPredicate,defaultColor:"#000000",colorPickerHeaderKey:"Color_Picker_TextColorButton_Header"};return React__default.default.createElement(BaseTextColor,_extends__default.default({buttonRef:this.buttonRef,pluginParams:pluginParams},this.props))},TextColorButton}(React.Component);TextColorButton.defaultProps={setKeepOpen:function(){}};var TextHighlightButton=function(_Component){function TextHighlightButton(props){var _this;return(_this=_Component.call(this,props)||this).buttonRef=React__default.default.createRef(),_this}return _inheritsLoose__default.default(TextHighlightButton,_Component),TextHighlightButton.prototype.render=function(){var _settings$toolbar,_settings$toolbar$ico,settings=this.props.config[TEXT_HIGHLIGHT_TYPE],pluginParams={dataHook:"TextHighlightButton",toolTip:"TextHighlightButton_Tooltip",icon:(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.InsertPluginButtonIcon)||TextHighlightIcon,type:TEXT_HIGHLIGHT_TYPE,predicate:textBackgroundPredicate,defaultColor:"#ffffff",colorPickerHeaderKey:"Color_Picker_TextHighlightButton_Header"};return React__default.default.createElement(BaseTextColor,_extends__default.default({buttonRef:this.buttonRef,pluginParams:pluginParams},this.props))},TextHighlightButton}(React.Component);TextHighlightButton.defaultProps={setKeepOpen:function(){}};function _toPropertyKey$1(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}var createTextColorPlugin=function(config){var type=TEXT_COLOR_TYPE,theme=config.theme,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,rest=_objectWithoutPropertiesLoose__default.default(config,["theme",type].map(_toPropertyKey$1)),toolbar=function(config){return{TextButtonMapper:function(){var _ref;return(_ref={})[wixRichContentEditorCommon.FORMATTING_BUTTONS.TEXT_COLOR]={component:TextColorButton,externalizedButtonProps:getButtonProps({config:config,type:TEXT_COLOR_TYPE})},_ref},name:"text-color"}}(config);return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({theme:theme,toolbar:toolbar,type:type,settings:settings,defaultPluginData:DEFAULTS.configTextColor.editor},rest))};function _toPropertyKey(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}createTextColorPlugin.functionName=TEXT_COLOR_TYPE;var _ModalsMap,createTextHighlightPlugin=function(config){var type=TEXT_HIGHLIGHT_TYPE,theme=config.theme,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,rest=_objectWithoutPropertiesLoose__default.default(config,["theme",type].map(_toPropertyKey)),toolbar=function(config){return{TextButtonMapper:function(){var _ref2;return(_ref2={})[wixRichContentEditorCommon.FORMATTING_BUTTONS.TEXT_HIGHLIGHT]={component:TextHighlightButton,externalizedButtonProps:getButtonProps({config:config,type:TEXT_HIGHLIGHT_TYPE})},_ref2},name:"text-highlight"}}(config);return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({theme:theme,toolbar:toolbar,type:type,settings:settings,defaultPluginData:DEFAULTS.configTextHighlight.editor},rest))};createTextHighlightPlugin.functionName=TEXT_HIGHLIGHT_TYPE;var Modals={TEXT_COLOR_PICKER:"TEXT_COLOR_PICKER"},ModalsMap=((_ModalsMap={})[Modals.TEXT_COLOR_PICKER]=TextColorPanel,_ModalsMap),textColorInlineStyleMapper=wixRichContentCommon.getDynamicInlineStyleMapper(wixRichContentCommon.RICOS_TEXT_COLOR_TYPE),textHighlightInlineStyleMapper=wixRichContentCommon.getDynamicInlineStyleMapper(wixRichContentCommon.RICOS_TEXT_HIGHLIGHT_TYPE);exports.Modals=Modals,exports.ModalsMap=ModalsMap,exports.TEXT_COLOR_TYPE=TEXT_COLOR_TYPE,exports.TEXT_HIGHLIGHT_TYPE=TEXT_HIGHLIGHT_TYPE,exports.createTextColorPlugin=createTextColorPlugin,exports.createTextHighlightPlugin=createTextHighlightPlugin,exports.getColor=getColor,exports.isTextColor=function(style){return!isTextDecoration(style,"BG")},exports.isTextHighlight=function(style){return isTextDecoration(style,"BG")},exports.pluginTextColor=function(config){return{config:_extends__default.default({},DEFAULTS.configTextColor.editor,config),type:TEXT_COLOR_TYPE,createPlugin:createTextColorPlugin,ModalsMap:ModalsMap}},exports.pluginTextHighlight=function(config){return{config:_extends__default.default({},DEFAULTS.configTextHighlight.editor,config),type:TEXT_HIGHLIGHT_TYPE,createPlugin:createTextHighlightPlugin,ModalsMap:{}}},exports.textColorInlineStyleMapper=textColorInlineStyleMapper,exports.textHighlightInlineStyleMapper=textHighlightInlineStyleMapper;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),wixRichContentPluginCommons=require("wix-rich-content-plugin-commons"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),React=require("react"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),wixRichContentCommon=require("wix-rich-content-common"),wixRichContentUiComponents=require("wix-rich-content-ui-components"),InfiniteScroll=require("react-infinite-scroller"),MDSpinner=require("react-md-spinner"),reactCustomScrollbars=require("react-custom-scrollbars"),lodash=require("lodash"),pluginGiphySchema=require("wix-rich-content-common/dist/statics/schemas/plugin-giphy.schema.json"),toDraftData=require("ricos-content/libs/toDraftData"),ricosContent=require("ricos-content");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),React__default=_interopDefaultLegacy(React),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),InfiniteScroll__default=_interopDefaultLegacy(InfiniteScroll),MDSpinner__default=_interopDefaultLegacy(MDSpinner),pluginGiphySchema__default=_interopDefaultLegacy(pluginGiphySchema),InsertPluginIcon=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:19,height:13,viewBox:"0 0 19 13"},props),React__default.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"currentColor"},React__default.default.createElement("path",{d:"M10 1v11.2M14.51 12.227V1.405h4.502M14.154 5.407h3.85M6 3.089a2.08 2.08 0 0 0-2.041-1.684h-.875a2.59 2.59 0 0 0-2.59 2.59v5.068a2.753 2.753 0 0 0 2.753 2.753h.346A2.407 2.407 0 0 0 6 9.409V8a1 1 0 0 0-1-1H2.804"})))},MediaReplaceIcon=function(props){return React__default.default.createElement("svg",Object.assign({xmlnsXlink:"http://www.w3.org/1999/xlink",width:19,height:19,viewBox:"0 0 19 19"},props),React__default.default.createElement("defs",null,React__default.default.createElement("path",{id:"giphy-replace-path",d:"M3 7.8V3.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2v2.592A6.607 6.607 0 0 1 9.412 3C13.05 3 16 5.91 16 9.5c0 .168-.006.335-.02.5h-1.016a5.51 5.51 0 0 0 .022-.5c0-3.038-2.495-5.5-5.574-5.5a5.583 5.583 0 0 0-4.967 3H7.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H3.2a.2.2 0 0 1-.2-.2zm13 3.4v4.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2v-2.592A6.607 6.607 0 0 1 9.588 16C5.95 16 3 13.09 3 9.5c0-.168.006-.335.02-.5h1.016a5.496 5.496 0 0 0-.022.5c0 3.038 2.495 5.5 5.574 5.5a5.583 5.583 0 0 0 4.967-3H11.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h4.6c.11 0 .2.09.2.2z"})),React__default.default.createElement("g",{fillRule:"evenodd"},React__default.default.createElement("mask",{id:"giphy-replace-mask"},React__default.default.createElement("use",{xlinkHref:"#giphy-replace-path"})),React__default.default.createElement("use",{fillRule:"nonzero",xlinkHref:"#giphy-replace-path"})))},CloseIcon=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},props),React__default.default.createElement("path",{fillRule:"evenodd",d:"M17.077 6l.923.923L12.923 12 18 17.077l-.923.923L12 12.923 6.923 18 6 17.077 11.076 12 6 6.923 6.923 6 12 11.077 17.077 6z"}))},PoweredByGiphy=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:79,height:9,viewBox:"0 0 53 6"},props),React__default.default.createElement("defs",null,React__default.default.createElement("path",{id:"giphy-a",d:"M.203.01h5.254V6H.203z"}),React__default.default.createElement("path",{id:"giphy-c",d:"M0 5.99h52.224V0H0z"})),React__default.default.createElement("g",{fill:"none",fillRule:"evenodd",opacity:".3"},React__default.default.createElement("g",{fill:"currentColor"},React__default.default.createElement("path",{d:"M.418 3.536h.793c.691 0 .688-1.14 0-1.14H.418v1.14zm0 .42v.875H0V1.98c.4 0 .811-.004 1.211-.004 1.248 0 1.252 1.97 0 1.979H.418z"}),React__default.default.createElement("path",{d:"M3.76 4.472c.651 0 .924-.5.924-1.046 0-.525-.277-1.07-.916-1.082-.605 0-.93.46-.93 1.082.007.505.276 1.046.923 1.046m1.338-1.054c0 .77-.43 1.474-1.338 1.474-.909 0-1.338-.72-1.338-1.47 0-.867.556-1.494 1.345-1.494.894.005 1.331.72 1.331 1.49M8.21 4.835h-.37l-.348-1.006-.287-.956-.288.96-.344 1.002h-.367l-.95-2.854h.468l.666 2.194.676-2.194h.27l.69 2.194.651-2.194h.467zM11.474 4.83H9.541V1.982h1.922v.444H9.96v.77h1.443v.422H9.96v.766h1.514zM12.432 2.397V3.43h.796c.348 0 .5-.24.5-.508 0-.257-.152-.525-.496-.525h-.8zM14.27 4.83h-.49l-.796-.985h-.553v.985h-.419V1.977c.407 0 .811.004 1.219.004.605 0 .923.452.923.933 0 .406-.195.806-.71.887l.78.948.046.082zM16.642 4.83h-1.933V1.982h1.922v.444h-1.504v.77h1.443v.422h-1.443v.766h1.515zM17.595 4.39h.576c.64 0 .908-.512.897-1.013-.011-.48-.28-.96-.897-.96h-.576V4.39zm.576-2.409c.893 0 1.3.696 1.312 1.4.015.721-.396 1.45-1.312 1.45h-.99V1.98h.99zM21.33 4.407h.786c.231 0 .553-.081.553-.395 0-.305-.31-.443-.55-.443h-.789v.838zm0-1.245h.79c.313 0 .47-.135.47-.358 0-.2-.16-.411-.474-.411h-.786v.769zm.786-1.18c.497 0 .889.248.889.813 0 .24-.116.456-.363.566.315.102.445.44.445.656 0 .622-.456.814-.971.814h-1.2V1.98h1.2zM24.404 3.24l.744-1.259h.504v.021l-1.039 1.66v1.169h-.418V3.662l-1.01-1.66v-.02h.497z"})),React__default.default.createElement("g",null,React__default.default.createElement("g",{transform:"translate(26.66)"},React__default.default.createElement("mask",{id:"giphy-b",fill:"#fff"},React__default.default.createElement("use",{xlinkHref:"#giphy-a"})),React__default.default.createElement("path",{fill:"currentColor",d:"M4.38 1.85a1.728 1.728 0 0 0-1.23-.494c-.877 0-1.447.551-1.447 1.661 0 .73.362 1.63 1.447 1.63.284 0 .73-.057 1.038-.292v-.73H2.827V2.37h2.63v2.52C5.12 5.612 4.181 6 3.142 6 1.011 6 .203 4.5.203 3.017S1.126.011 3.15.011c.746 0 1.407.162 2.115.915l-.885.924z"})),React__default.default.createElement("mask",{id:"giphy-d",fill:"#fff"},React__default.default.createElement("use",{xlinkHref:"#giphy-c"})),React__default.default.createElement("path",{fill:"currentColor",d:"M32.981 5.846h1.516V.173H32.98zM37.113 2.96h1.092c.423 0 .639-.323.639-.696 0-.373-.224-.714-.639-.714h-1.092v1.41zm0 1.354v1.532H35.59V.173h2.615c1.446 0 2.162.956 2.162 2.066 0 1.16-.724 2.059-2.162 2.075h-1.092zM44.507 5.854V3.706h-1.939v2.148h-1.523V.181h1.523v2.156h1.939V.18h1.507v5.673zM49.347 2.118L50.51.173h1.715v.073l-2.138 3.339v2.261h-1.523V3.585L46.516.237V.173h1.716z"}))))},styles$2={giphy_api_input_modal_container:"_1H5Sv",giphy_api_input_modal_navbar:"AWRFT",giphy_api_input_modal_closeButton:"_1MqKv"},DEFAULTS=Object.freeze({config:{size:"content",alignment:"center"},configViewer:{sizes:{desktop:"original",mobile:"original"}}}),DEFAULT_RESOLUTION=Object.freeze({desktop:"original",mobile:"original"}),MOBILE_FULL_SCREEN_CUSTOM_STYLE=Object.freeze({overlay:{backgroundColor:"transparent"},content:{top:0,left:0,overflow:"hidden",paddingRight:"6px"}}),commonDesktopModalStyles={width:"320px",boxSizing:"border-box",height:"364px",overflow:"visible",paddingRight:"12px",paddingLeft:"12px",display:"block",position:"absolute",zIndex:6,paddingTop:"12px"},DESKTOP_FLY_OUT_MODAL_STYLES=Object.freeze({overlay:{backgroundColor:"rgba(0, 0, 0, 0)",zIndex:5},content:_extends__default.default({},commonDesktopModalStyles,{border:"solid 1px rgba(51, 51, 51, 0.1)",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.06)"})}),EXTERNAL_POPUP_STYLES=Object.freeze({content:commonDesktopModalStyles}),styles$1={fontElementMap:"_2F-EW",giphy_selecter_container:"_1FHxh",giphy_selecter_infinite_scroll_container:"_2JQ7f",giphy_selecter_infinite_scroll:"_2gKZe",giphy_selecter_customize_scrollbar_container:"MHsyA",giphy_selecter_headerInfiniteScroll:"_39rDb",giphy_selecter_scrollbarThumb:"_2R9xz",giphy_selecter_powerdByGiphy:"JsDyy",giphy_selecter_gif_img_container:"_1HSqB",giphy_selecter_gif_img:"_327u_",giphy_selecter_spinner_more:"_1EDWs",giphy_selecter_spinner_empty_modal:"c-iaq",giphy_selecter_error_msg:"_3jFM4",giphy_empty_state:"zhAYz"},GiphyEmptyState=function(_ref){var t=_ref.t;return React__default.default.createElement("div",{className:styles$1.giphy_empty_state},React__default.default.createElement("div",null,t("GiphyPlugin_Search_EmptyState_Title")),React__default.default.createElement("div",null,t("GiphyPlugin_Search_EmptyState_Text")))},GiphySelector=function(_Component){function GiphySelector(props){var _this;(_this=_Component.call(this,props)||this).getGifs=function(searchTag,page){searchTag?_this.giphySdkCore.search("gifs",{q:searchTag,offset:25*page,limit:25}).then((function(response){page>1?_this.setState({gifs:_this.state.gifs.concat(response.data),hasMoreItems:!0,page:_this.state.page+1,didFail:!1}):_this.setState({gifs:response.data,hasMoreItems:!0,page:_this.state.page+1,didFail:!1})})).catch((function(){_this.setState({didFail:!0,hasMoreItems:!1})})):_this.giphySdkCore.trending("gifs",{limit:100}).then((function(response){searchTag||_this.setState({gifs:response.data,hasMoreItems:!1,didFail:!1})})).catch((function(){_this.setState({didFail:!0,hasMoreItems:!1})}))},_this.getMoreGifs=function(){var searchTag=_this.props.searchTag;_this.getGifs(searchTag,_this.state.page)},_this.getBoundOnClick=function(giphy){var componentData=_this.convertGiphyToComponentData(giphy);return function(){return _this.selectGif(componentData)}},_this.getBoundKeyDown=function(giphy){var componentData=_this.convertGiphyToComponentData(giphy);return function(e){var onCloseRequested=_this.props.onCloseRequested;"Escape"===e.key&&(null==onCloseRequested||onCloseRequested()),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),_this.selectGif(componentData))}};var componentData=_this.props.componentData;_this.state={url:componentData.src||"",isLoaded:!1,hasMoreItems:!0,gifs:[],page:0,didFail:!1},_this.styles=wixRichContentCommon.mergeStyles({styles:styles$1,theme:_this.props.theme});var gphApiClient=require("giphy-js-sdk-core");return _this.giphySdkCore=gphApiClient(_this.props.giphySdkApiKey),_this}_inheritsLoose__default.default(GiphySelector,_Component);var _proto=GiphySelector.prototype;return _proto.selectGif=function(gif){var _this$props=this.props,componentData=_this$props.componentData,pubsub=_this$props.pubsub,onConfirm=_this$props.onConfirm,onCloseRequested=_this$props.onCloseRequested;onConfirm?onConfirm(_extends__default.default({},componentData,{gif:gif})):pubsub.update("componentData",{gif:gif}),onCloseRequested()},_proto.convertGiphyToComponentData=function(giphy){var _giphy$images$downsiz,_giphy$images$downsiz2,_giphy$images$downsiz3;return{originalUrl:giphy.images.original.url,originalMp4:giphy.images.original.mp4,stillUrl:giphy.images.original_still.url,downsizedUrl:(null===(_giphy$images$downsiz=giphy.images.downsized)||void 0===_giphy$images$downsiz?void 0:_giphy$images$downsiz.url)||giphy.images.original.url,downsizedStillUrl:(null===(_giphy$images$downsiz2=giphy.images.downsized_still)||void 0===_giphy$images$downsiz2?void 0:_giphy$images$downsiz2.url)||giphy.images.original.url,downsizedSmallMp4:(null===(_giphy$images$downsiz3=giphy.images.downsized_small)||void 0===_giphy$images$downsiz3?void 0:_giphy$images$downsiz3.mp4)||giphy.images.original.mp4,height:parseInt(giphy.images.original.height,10),width:parseInt(giphy.images.original.width,10)}},_proto.componentWillReceiveProps=function(nextProps){var _this2=this;null!==this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){return _this2.getGifs(nextProps.searchTag)}),300)},_proto.componentDidMount=function(){this.timer=null},_proto.render=function(){var _this3=this,styles=this.styles,_this$props2=this.props,t=_this$props2.t,searchTag=_this$props2.searchTag,_this$state=this.state,gifs=_this$state.gifs,hasMoreItems=_this$state.hasMoreItems,didFail=_this$state.didFail,loader=React__default.default.createElement("div",{className:styles["giphy_selecter_spinner_"+(gifs.length?"more":"empty_modal")]},React__default.default.createElement(MDSpinner__default.default,{borderSize:1.5,singleColor:"#000000"}));return React__default.default.createElement("div",null,React__default.default.createElement("div",{className:styles.giphy_selecter_infinite_scroll_container},!gifs.length&&searchTag?React__default.default.createElement(GiphyEmptyState,{t:t}):React__default.default.createElement(reactCustomScrollbars.Scrollbars,{renderThumbVertical:function(){return React__default.default.createElement("div",{className:styles.giphy_selecter_scrollbarThumb})},className:styles.giphy_selecter_customize_scrollbar_container},React__default.default.createElement(InfiniteScroll__default.default,{pageStart:0,loadMore:this.getMoreGifs.bind(this),hasMore:hasMoreItems,loader:this.state.didFail?null:loader,useWindow:!1,className:styles.giphy_selecter_infinite_scroll},gifs.map((function(giphy,i){return React__default.default.createElement("div",{key:i,role:"button",tabIndex:0,className:styles.giphy_selecter_gif_img_container,onKeyDown:_this3.getBoundKeyDown(giphy),onClick:_this3.getBoundOnClick(giphy)},React__default.default.createElement("img",{className:styles.giphy_selecter_gif_img,src:giphy.images.fixed_width_downsampled.url,alt:giphy.title||"gif"}))}))))),React__default.default.createElement("div",{className:styles.giphy_selecter_container},React__default.default.createElement(PoweredByGiphy,{className:styles.giphy_selecter_powerdByGiphy})),didFail&&!gifs.length?React__default.default.createElement("div",{className:styles.giphy_selecter_error_msg}," ",t("GiphyPlugin_ApiErrorMsg")):null)},GiphySelector}(React.Component),GIPHY_TYPE="wix-draft-plugin-giphy",GiphyApiInputModal=function(_Component){function GiphyApiInputModal(props){var _this;return(_this=_Component.call(this,props)||this).triggerBi=lodash.debounce((function(){var _this$props=_this.props,helpers=_this$props.helpers,toolbarName=_this$props.toolbarName;helpers.onPluginAction("searchInsideThePlugin",{searchTerm:_this.state.searchTag,plugin_id:GIPHY_TYPE,entry_point:toolbarName})}),200),_this.onChange=function(searchTag){_this.setState({searchTag:searchTag}),_this.triggerBi()},_this.onCloseRequested=function(){_this.setState({isOpen:!1}),_this.props.helpers.closeModal()},_this.handleClearText=function(){_this.setState({searchTag:""})},_this.styles=wixRichContentCommon.mergeStyles({styles:styles$2,theme:props.theme}),_this.state={searchTag:""},_this}return _inheritsLoose__default.default(GiphyApiInputModal,_Component),GiphyApiInputModal.prototype.render=function(){var _this2=this,styles=this.styles,_this$props2=this.props,t=_this$props2.t,isMobile=_this$props2.isMobile,languageDir=_this$props2.languageDir,searchTag=this.state.searchTag,mobileNavbar=React__default.default.createElement("div",null,React__default.default.createElement("div",{className:styles.giphy_api_input_modal_navbar},t("GiphyUploadModal_mobileNavbar_Title"),React__default.default.createElement("div",{onClick:this.onCloseRequested,role:"button",tabIndex:"0",onKeyPress:null,className:styles.giphy_api_input_modal_closeButton},React__default.default.createElement(CloseIcon,null))));return React__default.default.createElement("div",{dir:languageDir},isMobile?React__default.default.createElement("div",null,mobileNavbar):null,React__default.default.createElement("div",{className:styles.giphy_api_input_modal_container,"data-hook":"giphyUploadModal"},React__default.default.createElement(wixRichContentUiComponents.TextSearchInput,{inputRef:function(ref){return _this2.input=ref},onClose:this.onCloseRequested,placeHolder:t("GiphyUploadModal_Search_Placeholder"),onChange:this.onChange,value:this.state.searchTag,"data-hook":"giphyUploadModalInput"}),React__default.default.createElement(GiphySelector,_extends__default.default({searchTag:searchTag,onCloseRequested:this.onCloseRequested},this.props))))},GiphyApiInputModal}(React.Component),createInlineButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,t=_ref.t,settings=_ref.settings,isMobile=_ref.isMobile,icon=(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.replace)||MediaReplaceIcon,modalStyles=isMobile?wixRichContentEditorCommon.getModalStyles({customStyles:MOBILE_FULL_SCREEN_CUSTOM_STYLE,fullScreen:!0,isMobile:isMobile}):void 0;return[{keyName:"sizeOriginal",type:wixRichContentPluginCommons.BUTTONS.SIZE_ORIGINAL,mobile:!1},{keyName:"sizeSmallCenter",type:wixRichContentPluginCommons.BUTTONS.SIZE_SMALL_CENTER,mobile:!1},{keyName:"sizeContent",type:wixRichContentPluginCommons.BUTTONS.SIZE_CONTENT,mobile:!1},{keyName:"sizeFullWidth",type:wixRichContentPluginCommons.BUTTONS.SIZE_FULL_WIDTH,mobile:!1},{keyName:"separator1",type:wixRichContentPluginCommons.BUTTONS.SEPARATOR,mobile:!1},{keyName:"sizeSmallLeft",type:wixRichContentPluginCommons.BUTTONS.SIZE_SMALL_LEFT,mobile:!1},{keyName:"sizeSimallRight",type:wixRichContentPluginCommons.BUTTONS.SIZE_SMALL_RIGHT,mobile:!1},{keyName:"separator2",type:wixRichContentPluginCommons.BUTTONS.SEPARATOR,mobile:!1},{keyName:"replace",type:wixRichContentPluginCommons.BUTTONS.EXTERNAL_MODAL,icon:icon,modalElement:wixRichContentEditorCommon.decorateComponentWithProps(GiphyApiInputModal,settings),modalStyles:modalStyles,modalStylesFn:function(_ref2){var buttonRef=_ref2.buttonRef,modalStyles=wixRichContentEditorCommon.getModalStyles({customStyles:DESKTOP_FLY_OUT_MODAL_STYLES,fullScreen:!0,isMobile:isMobile}),_buttonRef$getBoundin=buttonRef.getBoundingClientRect(),top=_buttonRef$getBoundin.top,modalLeft=_buttonRef$getBoundin.left-15,modalTop=top>357?top-365:top+30;return _extends__default.default({},modalStyles,{content:_extends__default.default({},modalStyles.content,{top:modalTop,left:modalLeft,margin:0,position:"absolute"})})},mobile:!0,tooltipTextKey:"ReplaceGiphyButton_Tooltip",t:t},{keyName:"delete",type:wixRichContentPluginCommons.BUTTONS.DELETE,mobile:!0}]},createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,_modalStylesByToolbar,t=_ref.t,settings=_ref.settings,isMobile=_ref.isMobile,icon=(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.InsertPluginButtonIcon)||InsertPluginIcon,modalStylesByToolbar=((_modalStylesByToolbar={})[wixRichContentEditorCommon.TOOLBARS.FOOTER]=isMobile?wixRichContentEditorCommon.getModalStyles({customStyles:MOBILE_FULL_SCREEN_CUSTOM_STYLE,fullScreen:!0,isMobile:isMobile}):void 0,_modalStylesByToolbar[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN]=isMobile?wixRichContentEditorCommon.getModalStyles({customStyles:MOBILE_FULL_SCREEN_CUSTOM_STYLE,fullScreen:!0,isMobile:isMobile}):wixRichContentEditorCommon.getModalStyles({customStyles:EXTERNAL_POPUP_STYLES,fullScreen:!1,isMobile:isMobile}),_modalStylesByToolbar),buttonProps={type:wixRichContentEditorCommon.BUTTON_TYPES.MODAL,name:wixRichContentEditorCommon.INSERT_PLUGIN_BUTTONS.GIF,tooltip:t("GiphyPlugin_InsertButton_Tooltip"),getIcon:function(){return icon},componentData:settings.componentDataDefaults||DEFAULTS,modalElement:wixRichContentEditorCommon.decorateComponentWithProps(GiphyApiInputModal,settings)};return[_extends__default.default({},buttonProps,{toolbars:settings.insertToolbars||[wixRichContentEditorCommon.TOOLBARS.FOOTER,wixRichContentEditorCommon.TOOLBARS.SIDE,wixRichContentEditorCommon.TOOLBARS.MOBILE],modalStyles:modalStylesByToolbar[wixRichContentEditorCommon.TOOLBARS.FOOTER],modalStylesFn:function(_ref2){var buttonRef=_ref2.buttonRef,toolbarName=_ref2.toolbarName;return wixRichContentEditorCommon.getBottomToolbarModalStyles(buttonRef,{customStyles:DESKTOP_FLY_OUT_MODAL_STYLES,isMobile:isMobile},toolbarName)}}),_extends__default.default({},buttonProps,{toolbars:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN],modalStyles:modalStylesByToolbar[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN]})]},createToolbar=function(_ref){var t=_ref.t,settings=_ref.settings,isMobile=_ref.isMobile;return{InlineButtons:createInlineButtons({t:t,settings:settings,isMobile:isMobile}),InsertButtons:createInsertButtons({t:t,settings:settings,isMobile:isMobile}),name:"giphy"}},styles={giphy_player:"_1JieR"},GiphyViewer=function(_Component){function GiphyViewer(props){var _this;return(_this=_Component.call(this,props)||this).getSourceUrl=function(){var _this$props=_this.props,gif=_this$props.componentData.gif,isMobile=_this$props.isMobile,_this$props$settings=_this$props.settings,settings=void 0===_this$props$settings?{}:_this$props$settings;if(!gif)return null;var _DEFAULT_RESOLUTION$s=_extends__default.default({},DEFAULT_RESOLUTION,settings),mobile=_DEFAULT_RESOLUTION$s.mobile,desktop=_DEFAULT_RESOLUTION$s.desktop,size=isMobile?mobile:desktop,originalMp4=gif.originalMp4,originalUrl=gif.originalUrl;return{original:originalMp4,downsizedSmall:gif.downsizedSmallMp4}[size]||originalUrl},wixRichContentCommon.validate(props.componentData,pluginGiphySchema__default.default),_this}_inheritsLoose__default.default(GiphyViewer,_Component);var _proto=GiphyViewer.prototype;return _proto.componentWillReceiveProps=function(nextProps){lodash.isEqual(nextProps.componentData,this.props.componentData)||wixRichContentCommon.validate(nextProps.componentData,pluginGiphySchema__default.default)},_proto.render=function(){this.styles=this.styles||wixRichContentCommon.mergeStyles({styles:styles,theme:this.props.theme});var _this$props2=this.props,componentData=_this$props2.componentData,setComponentUrl=_this$props2.setComponentUrl,gifUrl=this.getSourceUrl();return gifUrl?(null==setComponentUrl||setComponentUrl(gifUrl),gifUrl.endsWith(".mp4")?React__default.default.createElement("video",{role:"img",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,"aria-label":"gif",className:this.styles.giphy_player,src:gifUrl}):React__default.default.createElement("img",{role:"img","aria-label":"gif",className:this.styles.giphy_player,src:componentData.gif.originalUrl,alt:"gif"})):null},GiphyViewer}(React.Component);GiphyViewer.defaultProps={width:"100%",height:"100%",controls:!0};var GiphyComponent=function(_Component){function GiphyComponent(props){var _this;return(_this=_Component.call(this,props)||this).handleReady=function(){_this.state.isLoaded||_this.setState({isLoaded:!0})},_this.renderPlayer=function(){var _this$props=_this.props,componentData=_this$props.componentData,theme=_this$props.theme,settings=_this$props.settings,isMobile=_this$props.isMobile,setComponentUrl=_this$props.setComponentUrl;return React__default.default.createElement(GiphyViewer,{ref:_this.setPlayer,componentData:componentData,theme:theme,settings:settings,isMobile:isMobile,setComponentUrl:setComponentUrl})},_this.onKeyDown=function(e,handler){"Enter"!==e.key&&" "!==e.key||handler()},_this.state={isLoading:!1,isLoaded:!1},_this}return _inheritsLoose__default.default(GiphyComponent,_Component),GiphyComponent.prototype.render=function(){var _this2=this,onClick=this.props.onClick;return React__default.default.createElement("div",{"data-hook":"giphyPlayer",onClick:onClick,onKeyDown:function(e){return _this2.onKeyDown(e,onClick)}},this.renderPlayer())},GiphyComponent}(React.Component);function _toPropertyKey(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}GiphyComponent.type={GIPHY_TYPE:GIPHY_TYPE};var _ModalsMap,createGiphyPlugin=function(config){var type=GIPHY_TYPE,helpers=config.helpers,t=config.t,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,isMobile=config.isMobile,rest=_objectWithoutPropertiesLoose__default.default(config,["helpers","t",type,"isMobile"].map(_toPropertyKey));return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({component:GiphyComponent,type:GIPHY_TYPE,toolbar:createToolbar({helpers:helpers,t:t,settings:settings,isMobile:isMobile}),helpers:helpers,settings:settings,t:t,isMobile:isMobile,defaultPluginData:DEFAULTS},rest))};createGiphyPlugin.functionName=GIPHY_TYPE;var Modals={GIPHY_API_INPUT:"giphy-api-input"},ModalsMap=((_ModalsMap={})[Modals.GIPHY_API_INPUT]=GiphyApiInputModal,_ModalsMap),createGiphyData=function(pluginData,isRicosSchema){void 0===pluginData&&(pluginData={}),void 0===isRicosSchema&&(isRicosSchema=!1);var giphyData=isRicosSchema?toDraftData.convertNodeDataToDraft("GIF",pluginData):pluginData;return lodash.merge({},DEFAULTS,giphyData)},Gif=function(_ref){var context=_ref.context,componentData=_ref.componentData,isMobile=context.isMobile,theme=context.theme,_context$config=context.config,settings=(void 0===_context$config?{}:_context$config)[GIPHY_TYPE]||{};return React__default.default.createElement(GiphyComponent,{componentData:componentData,isMobile:isMobile,theme:theme,settings:settings,onClick:function(){},setComponentUrl:function(){return null}})},gifDataDefaults={height:0,width:0,containerData:{alignment:"CENTER",width:{size:null,custom:null},spoiler:{enabled:null,description:null,buttonText:null},height:{custom:null},textWrap:null},original:null,downsized:null},name=ricosContent.TIPTAP_GIF_TYPE;exports.GIPHY_TYPE=GIPHY_TYPE,exports.GiphyViewer=GiphyViewer,exports.Modals=Modals,exports.ModalsMap=ModalsMap,exports.createGiphyPlugin=createGiphyPlugin,exports.pluginGiphy=function(config){var defaultOptions,pluginConfig=_extends__default.default({},DEFAULTS.config,config);return{config:pluginConfig,type:GIPHY_TYPE,createPlugin:createGiphyPlugin,ModalsMap:ModalsMap,createPluginData:createGiphyData,tiptapExtensions:(defaultOptions=pluginConfig,[{type:"node",Component:Gif,componentDataDefaults:_extends__default.default({},gifDataDefaults,{id:""}),createExtensionConfig:function(){return{name:name,defaultOptions:defaultOptions,addCommands:function(){return{}}}}}])}};
//# sourceMappingURL=module.cjs.js.map

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

import{isHexColor,validate,mergeStyles,getDynamicInlineStyleMapper,RICOS_TEXT_COLOR_TYPE,RICOS_TEXT_HIGHLIGHT_TYPE}from"wix-rich-content-common";import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{ColorPicker,createBasePlugin}from"wix-rich-content-plugin-commons";import React,{Component}from"react";import{getSelectionStyles,EditorState,Modifier,BUTTON_TYPES,getModalStyles,isAtomicBlockFocused,FORMATTING_BUTTONS,InlineToolbarButton,ClickOutside}from"wix-rich-content-editor-common";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import{isObject}from"lodash";import _createClass from"@babel/runtime/helpers/createClass";import classNames from"classnames";import Modal from"react-modal";var _pluginSettingsByType,TEXT_COLOR_TYPE="wix-rich-content-text-color",TEXT_HIGHLIGHT_TYPE="wix-rich-content-text-highlight",normalizeStyle=function(style){try{return JSON.parse(style)}catch(e){return{FG:style}}},isTextDecoration=function(style,type){return!!normalizeStyle(style)[type]},getColorByType=function(style,type){return normalizeStyle(style)[type]||""},getColor=function(style){var parsed=normalizeStyle(style);return Object.values(parsed)[0]},textForegroundPredicate=function(styleSelectionPredicate){return function(style){return styleSelectionPredicate(getColorByType(style,"FG"))}},textBackgroundPredicate=function(styleSelectionPredicate){return function(style){return styleSelectionPredicate(getColorByType(style,"BG"))}},isTextHighlight=function(style){return isTextDecoration(style,"BG")},isTextColor=function(style){return!isTextDecoration(style,"BG")},styleMapper=function(type){return type===TEXT_HIGHLIGHT_TYPE?function(color){return JSON.stringify({BG:color})}:function(color){return JSON.stringify({FG:color})}},DEFAULT_PALETTE=Object.freeze(["#ffffff","#303030","#3a54b4","#bfad80","#bf695c","#f7f7f7"]),DEFAULT_STYLE_SELECTION_PREDICATE=function(style){return isHexColor(style)},userColors=[],DEFAULTS={configTextColor:{editor:{onColorAdded:function(color){return userColors=[].concat(userColors,[color])},getUserColors:function(){return userColors}},viewer:{}},configTextHighlight:{editor:{onColorAdded:function(color){return userColors=[].concat(userColors,[color])},getUserColors:function(){return userColors}},viewer:{}}},schema={definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"color-scheme",type:"object",title:"color-scheme schema",required:["color","index"],properties:{color:{$id:"#/properties/color",type:"string",title:"hex color",default:"",examples:["#fff","#bada55"],pattern:"^#[0-9a-f]{3}(?:[0-9a-f]{3})?$"},index:{$id:"#/properties/index",type:"integer",title:"color index",default:0,examples:[0]}}},extractColor=function(colorScheme,style){return colorScheme&&colorScheme[style]?colorScheme[style].color:isHexColor(style)?style:void 0},TextColorPanel=function(_Component){function TextColorPanel(props){var _this,colorScheme;return(_this=_Component.call(this,props)||this).styleSelectionPredicate=props.predicate(props.settings.styleSelectionPredicate||DEFAULT_STYLE_SELECTION_PREDICATE),!props.settings.colorScheme||(colorScheme=props.settings.colorScheme,isObject(colorScheme)&&Object.values(colorScheme).every((function(value){return validate(value,schema)})))||console.error("Error: colorScheme is not valid"),_this.currentColors=getSelectionStyles(props.editorState,_this.styleSelectionPredicate),_this.state={currentColor:_this.currentColors.length>0?extractColor(props.settings.colorScheme,getColor(_this.currentColors[0])):_this.props.defaultColor,currentSchemeColor:_this.currentColors[0]&&getColor(_this.currentColors[0]),userColors:props.settings.getUserColors()||[]},_this.setColor=_this.setColor.bind(_assertThisInitialized(_this)),_this.onColorAdded=_this.onColorAdded.bind(_assertThisInitialized(_this)),_this}_inheritsLoose(TextColorPanel,_Component);var _proto=TextColorPanel.prototype;return _proto.componentWillUnmount=function(){this.props.setKeepToolbarOpen(!1)},_proto.setColor=function(_temp){var colorName=(void 0===_temp?{}:_temp).color,_this$props=this.props,editorState=_this$props.editorState,settings=_this$props.settings,defaultColor=_this$props.defaultColor,onSelect=_this$props.onSelect,styleMapper=_this$props.styleMapper,predicate=_this$props.predicate,newColorHex=colorName&&extractColor(settings.colorScheme,colorName);editorState=getInlineColorState(colorName,editorState,settings,styleMapper,predicate),this.setState({currentColor:newColorHex||defaultColor,currentSchemeColor:colorName||this.currentColors[0]&&getColor(this.currentColors[0])}),this.props.closeModal(editorState),onSelect&&onSelect(colorName)},_proto.onColorAdded=function(_ref2){var color=_ref2.color;this.props.settings.onColorAdded(color),this.setState({userColors:this.props.settings.getUserColors()||[]})},_proto.render=function(){var _this$props2=this.props,theme=_this$props2.theme,settings=_this$props2.settings,t=_this$props2.t,setKeepToolbarOpen=_this$props2.setKeepToolbarOpen,isMobile=_this$props2.isMobile,defaultColor=_this$props2.defaultColor,colorPickerHeaderKey=_this$props2.colorPickerHeaderKey,colorScheme=settings.colorScheme,palette=function(colorScheme){return colorScheme?Object.values(colorScheme).sort((function(entry1,entry2){return entry1.index>entry2.index?1:-1})).map((function(entry){return entry.color})):DEFAULT_PALETTE}(colorScheme),schemeAttributes=function(colorScheme){return colorScheme?Object.keys(colorScheme).reduce((function(sorted,key){return!sorted.length||colorScheme[key].index>colorScheme[sorted[0]].index?sorted.push(key):sorted.unshift(key),sorted}),[]):null}(colorScheme),onCustomPickerToggle=settings.onCustomPickerToggle,onCustomColorPicked=settings.onCustomColorPicked,paletteColors=isMobile?palette.slice(0,5):palette.slice(0,6);return React.createElement(ColorPicker,{schemeAttributes:schemeAttributes,schemeColor:this.state.currentSchemeColor,color:this.state.currentColor,defaultColor:defaultColor,palette:paletteColors,userColors:this.state.userColors.slice(0,17),onColorAdded:this.onColorAdded,onChange:this.setColor,onResetColor:this.setColor,onCustomPickerToggle:onCustomPickerToggle,onCustomColorPicked:onCustomColorPicked,theme:theme,t:t,setKeepToolbarOpen:setKeepToolbarOpen,isMobile:isMobile},(function(_ref3){var renderPalette=_ref3.renderPalette,renderUserColors=_ref3.renderUserColors,renderAddColorButton=_ref3.renderAddColorButton,renderResetColorButton=_ref3.renderResetColorButton,mergedStyles=_ref3.mergedStyles;return React.createElement(React.Fragment,null,isMobile&&React.createElement(React.Fragment,null,React.createElement("div",{className:mergedStyles.colorPicker_header},t(colorPickerHeaderKey)),React.createElement("div",{className:mergedStyles.colorPicker_separator})),React.createElement("div",{className:mergedStyles.colorPicker_palette},React.createElement("div",{className:mergedStyles.colorPicker_buttons_container},renderPalette(),renderUserColors(),isMobile&&renderAddColorButton()),!isMobile&&React.createElement(React.Fragment,null,React.createElement("hr",{className:mergedStyles.colorPicker_separator}),React.createElement("div",{className:mergedStyles.colorPicker_bottom_container},renderResetColorButton(),renderAddColorButton()))))}))},TextColorPanel}(Component),getInlineColorState=function(color,editorState,settings,styleMapper,predicate){var styleSelectionPredicate=predicate(settings&&settings.styleSelectionPredicate||DEFAULT_STYLE_SELECTION_PREDICATE),selection=editorState.getSelection(),newEditorState=getSelectionStyles(editorState,styleSelectionPredicate).reduce((function(nextEditorState,prevColor){var contentState=nextEditorState.getCurrentContent(),nextContentState=Modifier.removeInlineStyle(contentState,selection,prevColor);return EditorState.push(nextEditorState,nextContentState,"change-inline-style")}),editorState),contentState=newEditorState.getCurrentContent();return color&&(contentState=Modifier.applyInlineStyle(contentState,selection,styleMapper(color))),EditorState.push(newEditorState,contentState,"change-inline-style")},TextColorIcon=function(props){return props.newFormattingToolbar?React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21"},props),React.createElement("path",{width:"10",height:"10",viewBox:"0 0 10 10",fill:props.isDisabled?"graytext":"#000",id:"Icon",d:"M7.84 10l2-5h.32l2 5H7.84zm5.92 4h1.08l-4-10H9.16l-4 10h1.08l1.2-3h5.12l1.2 3z"}),React.createElement("path",{width:"12",height:"3",viewBox:"0 0 12 3",fill:props.isDisabled?"graytext":""+props.currentColor,id:"Fill",fillRule:"nonzero",d:"M4 19L16 19 16 16 4 16z"})):React.createElement("svg",Object.assign({width:19,height:19,viewBox:"0 0 19 19"},props),React.createElement("path",{fill:"currentColor",d:"M12.9406953 8.95385441C12.1642734 9.88748434 11.6208213 10.7926967 11.3103388 11.6694915L7.40037874 11.6694915 6.54305663 13.9353876C6.52834357 13.9742741 6.49110424 14 6.4495274 14L4.09790277 14C4.04267429 14 3.99790277 13.9552285 3.99790277 13.9 3.99790277 13.8868237 4.00050674 13.8737773 4.00556503 13.8616107L8.4700421 3.12322131C8.50105957 3.04861511 8.5739205 3 8.65471758 3L10.3160943 3C10.396723 3 10.4694666 3.04841524 10.5005916 3.12279406L12.9406953 8.95385441zM9.41798529 6.20056497L8.13269519 9.61864407 10.7182206 9.61864407 9.41798529 6.20056497zM12 13.4245258C12 14.8207269 13.145 16 14.5 16 15.855 16 17 14.8202416 17 13.4245258 17 12.103093 16.2894438 10.6820365 14.8683313 9.16135614L14.8683089 9.16137708C14.6797751 8.95963399 14.3633932 8.94892574 14.1616501 9.13745952 14.1536124 9.144971 14.1458247 9.15274572 14.1382999 9.16077099 12.7127666 10.6811133 12 12.1023649 12 13.4245258z"}))},TextHighlightIcon=function(props){return props.newFormattingToolbar?React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},props),React.createElement("path",{width:"11",height:"10",viewBox:"0 0 11 10",fill:props.isDisabled?"graytext":"#000",id:"Icon",d:"M10.616 3.366L6.5 7.482 4.207 5.189l4.116-4.116c.098-.098.256-.098.354 0l1.94 1.939c.097.098.097.256 0 .354zM5.293 8.689h-1.94L3 8.336v-1.94l.5-.5 2.293 2.293-.5.5zm6.03-6.384L9.384.366c-.487-.488-1.282-.488-1.768 0l-5.47 5.47c-.093.093-.146.22-.146.353v2.147L.823 9.512c-.06.062-.087.15-.066.235.02.084.082.152.164.18l1.5.5c.026.008.052.012.08.012.064 0 .128-.025.176-.073l.676-.677H5.5c.133 0 .26-.052.353-.146l5.47-5.47c.487-.487.487-1.28 0-1.768z",transform:"translate(-210.000000, -80.000000) translate(206.000000, 77.000000) translate(4.000000, 3.310800)"}),React.createElement("path",{width:"12",height:"3",viewBox:"0 0 12 3",fill:props.isDisabled?"graytext":""+props.currentColor,id:"Fill",fillRule:"nonzero",d:"M0 15.689L12 15.689 12 12.689 0 12.689z"})):React.createElement("svg",Object.assign({width:"19px",height:"19px",viewBox:"0 0 19 19"},props),React.createElement("title",null,"Fill Color"),React.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React.createElement("path",{d:"M13,15.4025547 C13,16.1865787 13.687,16.8487889 14.5,16.8487889 C15.313,16.8487889 16,16.1863062 16,15.4025547 C16,14.7033546 15.6214705,13.9544845 14.8644116,13.1559444 L14.8643729,13.1559811 C14.6744053,12.9556048 14.3579691,12.9471668 14.1575928,13.1371343 C14.1513476,13.1430551 14.1452562,13.1491362 14.1393249,13.1553715 C13.379775,13.9538457 13,14.7029067 13,15.4025547 Z",fill:"currentColor",fillRule:"nonzero"}),React.createElement("path",{d:"M3.5,6 C3.22385763,6 3,5.77614237 3,5.5 C3,5.22385763 3.22385763,5 3.5,5 L12.748729,5 C13.3010137,5 13.748729,5.44771525 13.748729,6 L13.748729,13 C13.748729,13.5522847 13.3010137,14 12.748729,14 L5.74872899,14 C5.19644424,14 4.74872899,13.5522847 4.74872899,13 L4.74872899,6 L3.5,6 Z M12.748729,6.00005457 L5.74872899,6.00005457 L5.74872899,13.0000546 L12.748729,6.00005457 Z",fill:"currentColor",fillRule:"nonzero",transform:"translate(8.374364, 9.500000) rotate(-315.000000) translate(-8.374364, -9.500000) "})))},pluginSettingsByType=((_pluginSettingsByType={})[TEXT_COLOR_TYPE]={defaultColor:"#000000",icon:TextColorIcon,predicate:textForegroundPredicate,tooltipKey:"TextColorButton_Tooltip",colorPickerHeaderKey:"Color_Picker_TextColorButton_Header"},_pluginSettingsByType[TEXT_HIGHLIGHT_TYPE]={defaultColor:"#ffffff",icon:TextHighlightIcon,predicate:textBackgroundPredicate,tooltipKey:"TextHighlightButton_Tooltip",colorPickerHeaderKey:"Color_Picker_TextHighlightButton_Header"},_pluginSettingsByType),getButtonProps=function(_ref){var config=_ref.config,type=_ref.type,getEditorState=config.getEditorState,setEditorState=config.setEditorState,t=config.t,theme=config.theme,isMobile=config.isMobile,helpers=config.helpers,uiSettings=config.uiSettings,settings=config[type],experiments=config.experiments,pluginSettings=pluginSettingsByType[type],styleMap=styleMapper(type),noop=function(){return!1},modalStylesFn=function(ref){if(null==ref||!ref.getBoundingClientRect)return{};var _ref$getBoundingClien=ref.getBoundingClientRect(),bottom=_ref$getBoundingClien.bottom,left=_ref$getBoundingClien.left;return isMobile?{content:{position:"absolute",left:"0px",right:"0px",bottom:"0",border:"none",background:"white",overflow:"auto",outline:"none",padding:"0px",width:"100%",zIndex:"6",top:"auto",transform:"translateY(0)",margin:0}}:{content:{display:"inline-table",transform:"translateY(0)",minHeight:"88px",position:"absolute",minWidth:"89px",maxWidth:"184",width:"182px",height:"86px",top:bottom,left:left-15,borderRadius:"2px",border:"1px solid #ededed",margin:"0",background:"#fff"},overlay:{background:"transparent"}}},TextColorModal=function(_ref2){var closeCustomModal=_ref2.closeCustomModal,onSelect=_ref2.onSelect;return React.createElement(TextColorPanel,{t:t,isMobile:isMobile,theme:theme,closeModal:function(args){var newEditorState,_helpers$closeModal,editorState,selection;newEditorState=args,editorState=getEditorState(),selection=editorState.getSelection(),setEditorState(EditorState.forceSelection(newEditorState||editorState,selection)),null==helpers||null===(_helpers$closeModal=helpers.closeModal)||void 0===_helpers$closeModal||_helpers$closeModal.call(helpers),closeCustomModal&&closeCustomModal()},editorState:getEditorState(),setEditorState:setEditorState,settings:settings,uiSettings:uiSettings,styleMapper:styleMap,predicate:pluginSettings.predicate,defaultColor:pluginSettings.defaultColor,setKeepToolbarOpen:noop,onSelect:onSelect,colorPickerHeaderKey:pluginSettings.colorPickerHeaderKey})},isDisabled=function(){return getEditorState().getSelection().isCollapsed()||isAtomicBlockFocused(getEditorState())};return{onClose:function(){},onClick:function(_ref4){return function(_ref3){var ref=_ref3.ref,render=_ref3.render;if(render)render(TextColorModal);else{var _helpers$openModal,modalStyles=getModalStyles({customStyles:modalStylesFn(ref),fullScreen:!1,isMobile:isMobile});null==helpers||null===(_helpers$openModal=helpers.openModal)||void 0===_helpers$openModal||_helpers$openModal.call(helpers,{modalStyles:modalStyles,helpers:helpers,isMobile:isMobile,modalElement:TextColorModal,theme:theme})}}({ref:_ref4.ref,render:_ref4.render})},isDisabled:isDisabled,arrow:!1,isActive:function(){var predicate=pluginSettings.predicate((null==settings?void 0:settings.styleSelectionPredicate)||DEFAULT_STYLE_SELECTION_PREDICATE);return getSelectionStyles(config.getEditorState(),predicate).length>0},getIcon:function(){var _settings$toolbar,_settings$toolbar$ico;return(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.InsertPluginButtonIcon)||function(){var _experiments$newForma,editorState,predicate,defaultColor,styleSelectionPredicate,currentColors;return pluginSettings.icon({newFormattingToolbar:null==experiments||null===(_experiments$newForma=experiments.newFormattingToolbar)||void 0===_experiments$newForma?void 0:_experiments$newForma.enabled,currentColor:(editorState=getEditorState(),predicate=pluginSettings.predicate,defaultColor=pluginSettings.defaultColor,styleSelectionPredicate=predicate(settings.styleSelectionPredicate||DEFAULT_STYLE_SELECTION_PREDICATE),currentColors=getSelectionStyles(editorState,styleSelectionPredicate),currentColors.length>0?extractColor(settings.colorScheme,getColor(currentColors[0])):defaultColor),isDisabled:isDisabled()})}},tooltip:config.t(pluginSettings.tooltipKey),getLabel:function(){return""},type:BUTTON_TYPES.DROPDOWN,dataHook:type.replace(/\s+/g,"-").toLowerCase()+"-button",modal:TextColorModal,onSelect:function(color){var editorState=getEditorState(),selection=editorState.getSelection(),coloredEditorState=getInlineColorState(color,getEditorState(),settings,styleMap,pluginSettings.predicate);setEditorState(EditorState.forceSelection(coloredEditorState||editorState,selection))}}},styles={textColorModal:"_2L0nY",textColorModal_mobile:"_2Otbl",textColorModalOverlay:"_1J3EL",textColorModalOverlay_mobile:"_2p47r",textColorPopup_button:"IiTdz",textColorPopup:"_6IxcZ"},BaseTextColor=function(_Component){function BaseTextColor(props){var _this;return(_this=_Component.call(this,props)||this).openPanel=function(){var _this$props=_this.props,isMobile=_this$props.isMobile,setKeepOpen=_this$props.setKeepOpen,config=_this$props.config,pluginParams=_this$props.pluginParams;isMobile||setKeepOpen&&setKeepOpen(!0);var settings=config[pluginParams.type],position={};if(settings.positionPicker)position=settings.positionPicker(_this.buttonRef,216);else{var _this$buttonRef$curre=_this.buttonRef.current.getBoundingClientRect(),bottom=_this$buttonRef$curre.bottom;position={left:_this$buttonRef$curre.left-108,top:bottom}}_this.setState({isPanelOpen:!0,panelLeft:position.left,panelTop:position.top})},_this.closePanel=function(editorState){_this.setState({isPanelOpen:!1}),_this.props.setKeepOpen(!1),_this.preserveSelectionState(editorState)},_this.state={showPanel:!1},_this.styles=mergeStyles({styles:styles,theme:props.theme}),_this.buttonRef=props.buttonRef,_this.styleMapper=styleMapper(props.pluginParams.type),_this}_inheritsLoose(BaseTextColor,_Component),BaseTextColor.getModalParent=function(){var _document,_document$querySelect;return null===(_document=document)||void 0===_document||null===(_document$querySelect=_document.querySelector(".DraftEditor-root"))||void 0===_document$querySelect?void 0:_document$querySelect.parentNode};var _proto=BaseTextColor.prototype;return _proto.preserveSelectionState=function(newEditorState){var _this$props2=this.props,setEditorState=_this$props2.setEditorState,editorState=(0,_this$props2.getEditorState)(),selection=editorState.getSelection();setEditorState(EditorState.forceSelection(newEditorState||editorState,selection))},_proto.render=function(){var _classNames,_classNames2,_this2=this,_this$props3=this.props,theme=_this$props3.theme,helpers=_this$props3.helpers,isMobile=_this$props3.isMobile,t=_this$props3.t,tabIndex=_this$props3.tabIndex,setEditorState=_this$props3.setEditorState,getEditorState=_this$props3.getEditorState,setKeepOpen=_this$props3.setKeepOpen,config=_this$props3.config,uiSettings=_this$props3.uiSettings,pluginParams=_this$props3.pluginParams,toolbarName=_this$props3.toolbarName,settings=config[pluginParams.type],_this$state=this.state,isPanelOpen=_this$state.isPanelOpen,panelTop=_this$state.panelTop,panelLeft=_this$state.panelLeft,tooltip=t(pluginParams.toolTip),buttonStyles={button:theme.inlineToolbarButton,buttonWrapper:theme.inlineToolbarButton_wrapper,icon:theme.inlineToolbarButton_icon,active:theme.inlineToolbarButton_active},modalStyle={content:isMobile?{top:"unset",left:0,backgroundColor:"white"}:{top:panelTop,left:panelLeft,marginTop:15,borderRadius:2,width:184}},TEXT_COLOR=FORMATTING_BUTTONS.TEXT_COLOR,TEXT_HIGHLIGHT=FORMATTING_BUTTONS.TEXT_HIGHLIGHT,formattingButtonName=pluginParams.type===TEXT_COLOR_TYPE?TEXT_COLOR:TEXT_HIGHLIGHT;return isMobile||"StaticTextToolbar"!==toolbarName||!settings.inlinePopups?React.createElement(InlineToolbarButton,{onClick:this.openPanel,isActive:this.isActive,helpers:helpers,theme:_extends({},theme,buttonStyles),isMobile:isMobile,tooltipText:tooltip,dataHook:pluginParams.dataHook,formattingButtonName:formattingButtonName,tabIndex:tabIndex,icon:pluginParams.icon,forwardRef:this.buttonRef,pluginType:pluginParams.type},React.createElement(Modal,{onRequestClose:function(){return _this2.closePanel()},isOpen:isPanelOpen,parentSelector:BaseTextColor.getModalParent,className:classNames((_classNames={},_classNames[this.styles.textColorModal]=!isMobile,_classNames[this.styles.textColorModal_mobile]=isMobile,_classNames)),overlayClassName:classNames((_classNames2={},_classNames2[this.styles.textColorModalOverlay]=!isMobile,_classNames2[this.styles.textColorModalOverlay_mobile]=isMobile,_classNames2)),style:modalStyle,ariaHideApp:!1},React.createElement(TextColorPanel,{t:t,isMobile:isMobile,theme:theme,closeModal:this.closePanel,editorState:getEditorState(),setEditorState:setEditorState,settings:settings,uiSettings:uiSettings,setKeepToolbarOpen:setKeepOpen,styleMapper:this.styleMapper,predicate:pluginParams.predicate,defaultColor:pluginParams.defaultColor,colorPickerHeaderKey:pluginParams.colorPickerHeaderKey}))):React.createElement("div",{className:styles.textColorPopup_button},React.createElement(InlineToolbarButton,{onClick:this.openPanel,isActive:this.isActive,helpers:helpers,theme:_extends({},theme,buttonStyles),isMobile:isMobile,tooltipText:tooltip,dataHook:pluginParams.dataHook,formattingButtonName:formattingButtonName,tabIndex:tabIndex,icon:pluginParams.icon,forwardRef:this.buttonRef,pluginType:pluginParams.type},isPanelOpen&&React.createElement("div",{className:styles.textColorPopup},React.createElement(ClickOutside,{onClickOutside:function(){return _this2.closePanel()}},React.createElement(TextColorPanel,{t:t,isMobile:isMobile,theme:theme,closeModal:this.closePanel,editorState:getEditorState(),setEditorState:setEditorState,settings:settings,uiSettings:uiSettings,setKeepToolbarOpen:setKeepOpen,styleMapper:this.styleMapper,predicate:pluginParams.predicate,defaultColor:pluginParams.defaultColor,colorPickerHeaderKey:pluginParams.colorPickerHeaderKey})))))},_createClass(BaseTextColor,[{key:"isActive",get:function(){var _this$props4=this.props,config=_this$props4.config,pluginParams=_this$props4.pluginParams,getEditorState=_this$props4.getEditorState,settings=config[pluginParams.type]||{},styleSelectionPredicate=pluginParams.predicate(settings.styleSelectionPredicate||DEFAULT_STYLE_SELECTION_PREDICATE);return getSelectionStyles(getEditorState(),styleSelectionPredicate).length>0}}]),BaseTextColor}(Component);BaseTextColor.defaultProps={setKeepOpen:function(){}};var TextColorButton=function(_Component){function TextColorButton(props){var _this;return(_this=_Component.call(this,props)||this).buttonRef=React.createRef(),_this}return _inheritsLoose(TextColorButton,_Component),TextColorButton.prototype.render=function(){var _settings$toolbar,_settings$toolbar$ico,settings=this.props.config[TEXT_COLOR_TYPE],pluginParams={dataHook:"TextColorButton",toolTip:"TextColorButton_Tooltip",icon:(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.InsertPluginButtonIcon)||TextColorIcon,type:TEXT_COLOR_TYPE,predicate:textForegroundPredicate,defaultColor:"#000000",colorPickerHeaderKey:"Color_Picker_TextColorButton_Header"};return React.createElement(BaseTextColor,_extends({buttonRef:this.buttonRef,pluginParams:pluginParams},this.props))},TextColorButton}(Component);TextColorButton.defaultProps={setKeepOpen:function(){}};var TextHighlightButton=function(_Component){function TextHighlightButton(props){var _this;return(_this=_Component.call(this,props)||this).buttonRef=React.createRef(),_this}return _inheritsLoose(TextHighlightButton,_Component),TextHighlightButton.prototype.render=function(){var _settings$toolbar,_settings$toolbar$ico,settings=this.props.config[TEXT_HIGHLIGHT_TYPE],pluginParams={dataHook:"TextHighlightButton",toolTip:"TextHighlightButton_Tooltip",icon:(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.InsertPluginButtonIcon)||TextHighlightIcon,type:TEXT_HIGHLIGHT_TYPE,predicate:textBackgroundPredicate,defaultColor:"#ffffff",colorPickerHeaderKey:"Color_Picker_TextHighlightButton_Header"};return React.createElement(BaseTextColor,_extends({buttonRef:this.buttonRef,pluginParams:pluginParams},this.props))},TextHighlightButton}(Component);TextHighlightButton.defaultProps={setKeepOpen:function(){}};function _toPropertyKey$1(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}var createTextColorPlugin=function(config){var type=TEXT_COLOR_TYPE,theme=config.theme,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,rest=_objectWithoutPropertiesLoose(config,["theme",type].map(_toPropertyKey$1)),toolbar=function(config){return{TextButtonMapper:function(){var _ref;return(_ref={})[FORMATTING_BUTTONS.TEXT_COLOR]={component:TextColorButton,externalizedButtonProps:getButtonProps({config:config,type:TEXT_COLOR_TYPE})},_ref},name:"text-color"}}(config);return createBasePlugin(_extends({theme:theme,toolbar:toolbar,type:type,settings:settings,defaultPluginData:DEFAULTS.configTextColor.editor},rest))};function _toPropertyKey(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}createTextColorPlugin.functionName=TEXT_COLOR_TYPE;var _ModalsMap,createTextHighlightPlugin=function(config){var type=TEXT_HIGHLIGHT_TYPE,theme=config.theme,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,rest=_objectWithoutPropertiesLoose(config,["theme",type].map(_toPropertyKey)),toolbar=function(config){return{TextButtonMapper:function(){var _ref2;return(_ref2={})[FORMATTING_BUTTONS.TEXT_HIGHLIGHT]={component:TextHighlightButton,externalizedButtonProps:getButtonProps({config:config,type:TEXT_HIGHLIGHT_TYPE})},_ref2},name:"text-highlight"}}(config);return createBasePlugin(_extends({theme:theme,toolbar:toolbar,type:type,settings:settings,defaultPluginData:DEFAULTS.configTextHighlight.editor},rest))};createTextHighlightPlugin.functionName=TEXT_HIGHLIGHT_TYPE;var Modals={TEXT_COLOR_PICKER:"TEXT_COLOR_PICKER"},ModalsMap=((_ModalsMap={})[Modals.TEXT_COLOR_PICKER]=TextColorPanel,_ModalsMap),pluginTextColor=function(config){return{config:_extends({},DEFAULTS.configTextColor.editor,config),type:TEXT_COLOR_TYPE,createPlugin:createTextColorPlugin,ModalsMap:ModalsMap}},pluginTextHighlight=function(config){return{config:_extends({},DEFAULTS.configTextHighlight.editor,config),type:TEXT_HIGHLIGHT_TYPE,createPlugin:createTextHighlightPlugin,ModalsMap:{}}},textColorInlineStyleMapper=getDynamicInlineStyleMapper(RICOS_TEXT_COLOR_TYPE),textHighlightInlineStyleMapper=getDynamicInlineStyleMapper(RICOS_TEXT_HIGHLIGHT_TYPE);export{Modals,ModalsMap,TEXT_COLOR_TYPE,TEXT_HIGHLIGHT_TYPE,createTextColorPlugin,createTextHighlightPlugin,getColor,isTextColor,isTextHighlight,pluginTextColor,pluginTextHighlight,textColorInlineStyleMapper,textHighlightInlineStyleMapper};
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{BUTTONS,createBasePlugin}from"wix-rich-content-plugin-commons";import{decorateComponentWithProps,getModalStyles,TOOLBARS,getBottomToolbarModalStyles,BUTTON_TYPES,INSERT_PLUGIN_BUTTONS}from"wix-rich-content-editor-common";import React,{Component}from"react";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import{mergeStyles,validate}from"wix-rich-content-common";import{TextSearchInput}from"wix-rich-content-ui-components";import InfiniteScroll from"react-infinite-scroller";import MDSpinner from"react-md-spinner";import{Scrollbars}from"react-custom-scrollbars";import{debounce,isEqual,merge}from"lodash";import pluginGiphySchema from"wix-rich-content-common/dist/statics/schemas/plugin-giphy.schema.json";import{convertNodeDataToDraft}from"ricos-content/libs/toDraftData";import{TIPTAP_GIF_TYPE}from"ricos-content";var InsertPluginIcon=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:19,height:13,viewBox:"0 0 19 13"},props),React.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"currentColor"},React.createElement("path",{d:"M10 1v11.2M14.51 12.227V1.405h4.502M14.154 5.407h3.85M6 3.089a2.08 2.08 0 0 0-2.041-1.684h-.875a2.59 2.59 0 0 0-2.59 2.59v5.068a2.753 2.753 0 0 0 2.753 2.753h.346A2.407 2.407 0 0 0 6 9.409V8a1 1 0 0 0-1-1H2.804"})))},MediaReplaceIcon=function(props){return React.createElement("svg",Object.assign({xmlnsXlink:"http://www.w3.org/1999/xlink",width:19,height:19,viewBox:"0 0 19 19"},props),React.createElement("defs",null,React.createElement("path",{id:"giphy-replace-path",d:"M3 7.8V3.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2v2.592A6.607 6.607 0 0 1 9.412 3C13.05 3 16 5.91 16 9.5c0 .168-.006.335-.02.5h-1.016a5.51 5.51 0 0 0 .022-.5c0-3.038-2.495-5.5-5.574-5.5a5.583 5.583 0 0 0-4.967 3H7.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H3.2a.2.2 0 0 1-.2-.2zm13 3.4v4.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2v-2.592A6.607 6.607 0 0 1 9.588 16C5.95 16 3 13.09 3 9.5c0-.168.006-.335.02-.5h1.016a5.496 5.496 0 0 0-.022.5c0 3.038 2.495 5.5 5.574 5.5a5.583 5.583 0 0 0 4.967-3H11.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h4.6c.11 0 .2.09.2.2z"})),React.createElement("g",{fillRule:"evenodd"},React.createElement("mask",{id:"giphy-replace-mask"},React.createElement("use",{xlinkHref:"#giphy-replace-path"})),React.createElement("use",{fillRule:"nonzero",xlinkHref:"#giphy-replace-path"})))},CloseIcon=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},props),React.createElement("path",{fillRule:"evenodd",d:"M17.077 6l.923.923L12.923 12 18 17.077l-.923.923L12 12.923 6.923 18 6 17.077 11.076 12 6 6.923 6.923 6 12 11.077 17.077 6z"}))},PoweredByGiphy=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:79,height:9,viewBox:"0 0 53 6"},props),React.createElement("defs",null,React.createElement("path",{id:"giphy-a",d:"M.203.01h5.254V6H.203z"}),React.createElement("path",{id:"giphy-c",d:"M0 5.99h52.224V0H0z"})),React.createElement("g",{fill:"none",fillRule:"evenodd",opacity:".3"},React.createElement("g",{fill:"currentColor"},React.createElement("path",{d:"M.418 3.536h.793c.691 0 .688-1.14 0-1.14H.418v1.14zm0 .42v.875H0V1.98c.4 0 .811-.004 1.211-.004 1.248 0 1.252 1.97 0 1.979H.418z"}),React.createElement("path",{d:"M3.76 4.472c.651 0 .924-.5.924-1.046 0-.525-.277-1.07-.916-1.082-.605 0-.93.46-.93 1.082.007.505.276 1.046.923 1.046m1.338-1.054c0 .77-.43 1.474-1.338 1.474-.909 0-1.338-.72-1.338-1.47 0-.867.556-1.494 1.345-1.494.894.005 1.331.72 1.331 1.49M8.21 4.835h-.37l-.348-1.006-.287-.956-.288.96-.344 1.002h-.367l-.95-2.854h.468l.666 2.194.676-2.194h.27l.69 2.194.651-2.194h.467zM11.474 4.83H9.541V1.982h1.922v.444H9.96v.77h1.443v.422H9.96v.766h1.514zM12.432 2.397V3.43h.796c.348 0 .5-.24.5-.508 0-.257-.152-.525-.496-.525h-.8zM14.27 4.83h-.49l-.796-.985h-.553v.985h-.419V1.977c.407 0 .811.004 1.219.004.605 0 .923.452.923.933 0 .406-.195.806-.71.887l.78.948.046.082zM16.642 4.83h-1.933V1.982h1.922v.444h-1.504v.77h1.443v.422h-1.443v.766h1.515zM17.595 4.39h.576c.64 0 .908-.512.897-1.013-.011-.48-.28-.96-.897-.96h-.576V4.39zm.576-2.409c.893 0 1.3.696 1.312 1.4.015.721-.396 1.45-1.312 1.45h-.99V1.98h.99zM21.33 4.407h.786c.231 0 .553-.081.553-.395 0-.305-.31-.443-.55-.443h-.789v.838zm0-1.245h.79c.313 0 .47-.135.47-.358 0-.2-.16-.411-.474-.411h-.786v.769zm.786-1.18c.497 0 .889.248.889.813 0 .24-.116.456-.363.566.315.102.445.44.445.656 0 .622-.456.814-.971.814h-1.2V1.98h1.2zM24.404 3.24l.744-1.259h.504v.021l-1.039 1.66v1.169h-.418V3.662l-1.01-1.66v-.02h.497z"})),React.createElement("g",null,React.createElement("g",{transform:"translate(26.66)"},React.createElement("mask",{id:"giphy-b",fill:"#fff"},React.createElement("use",{xlinkHref:"#giphy-a"})),React.createElement("path",{fill:"currentColor",d:"M4.38 1.85a1.728 1.728 0 0 0-1.23-.494c-.877 0-1.447.551-1.447 1.661 0 .73.362 1.63 1.447 1.63.284 0 .73-.057 1.038-.292v-.73H2.827V2.37h2.63v2.52C5.12 5.612 4.181 6 3.142 6 1.011 6 .203 4.5.203 3.017S1.126.011 3.15.011c.746 0 1.407.162 2.115.915l-.885.924z"})),React.createElement("mask",{id:"giphy-d",fill:"#fff"},React.createElement("use",{xlinkHref:"#giphy-c"})),React.createElement("path",{fill:"currentColor",d:"M32.981 5.846h1.516V.173H32.98zM37.113 2.96h1.092c.423 0 .639-.323.639-.696 0-.373-.224-.714-.639-.714h-1.092v1.41zm0 1.354v1.532H35.59V.173h2.615c1.446 0 2.162.956 2.162 2.066 0 1.16-.724 2.059-2.162 2.075h-1.092zM44.507 5.854V3.706h-1.939v2.148h-1.523V.181h1.523v2.156h1.939V.18h1.507v5.673zM49.347 2.118L50.51.173h1.715v.073l-2.138 3.339v2.261h-1.523V3.585L46.516.237V.173h1.716z"}))))},styles$2={giphy_api_input_modal_container:"_1H5Sv",giphy_api_input_modal_navbar:"AWRFT",giphy_api_input_modal_closeButton:"_1MqKv"},DEFAULTS=Object.freeze({config:{size:"content",alignment:"center"},configViewer:{sizes:{desktop:"original",mobile:"original"}}}),DEFAULT_RESOLUTION=Object.freeze({desktop:"original",mobile:"original"}),MOBILE_FULL_SCREEN_CUSTOM_STYLE=Object.freeze({overlay:{backgroundColor:"transparent"},content:{top:0,left:0,overflow:"hidden",paddingRight:"6px"}}),commonDesktopModalStyles={width:"320px",boxSizing:"border-box",height:"364px",overflow:"visible",paddingRight:"12px",paddingLeft:"12px",display:"block",position:"absolute",zIndex:6,paddingTop:"12px"},DESKTOP_FLY_OUT_MODAL_STYLES=Object.freeze({overlay:{backgroundColor:"rgba(0, 0, 0, 0)",zIndex:5},content:_extends({},commonDesktopModalStyles,{border:"solid 1px rgba(51, 51, 51, 0.1)",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.06)"})}),EXTERNAL_POPUP_STYLES=Object.freeze({content:commonDesktopModalStyles}),styles$1={fontElementMap:"_2F-EW",giphy_selecter_container:"_1FHxh",giphy_selecter_infinite_scroll_container:"_2JQ7f",giphy_selecter_infinite_scroll:"_2gKZe",giphy_selecter_customize_scrollbar_container:"MHsyA",giphy_selecter_headerInfiniteScroll:"_39rDb",giphy_selecter_scrollbarThumb:"_2R9xz",giphy_selecter_powerdByGiphy:"JsDyy",giphy_selecter_gif_img_container:"_1HSqB",giphy_selecter_gif_img:"_327u_",giphy_selecter_spinner_more:"_1EDWs",giphy_selecter_spinner_empty_modal:"c-iaq",giphy_selecter_error_msg:"_3jFM4",giphy_empty_state:"zhAYz"},GiphyEmptyState=function(_ref){var t=_ref.t;return React.createElement("div",{className:styles$1.giphy_empty_state},React.createElement("div",null,t("GiphyPlugin_Search_EmptyState_Title")),React.createElement("div",null,t("GiphyPlugin_Search_EmptyState_Text")))},GiphySelector=function(_Component){function GiphySelector(props){var _this;(_this=_Component.call(this,props)||this).getGifs=function(searchTag,page){searchTag?_this.giphySdkCore.search("gifs",{q:searchTag,offset:25*page,limit:25}).then((function(response){page>1?_this.setState({gifs:_this.state.gifs.concat(response.data),hasMoreItems:!0,page:_this.state.page+1,didFail:!1}):_this.setState({gifs:response.data,hasMoreItems:!0,page:_this.state.page+1,didFail:!1})})).catch((function(){_this.setState({didFail:!0,hasMoreItems:!1})})):_this.giphySdkCore.trending("gifs",{limit:100}).then((function(response){searchTag||_this.setState({gifs:response.data,hasMoreItems:!1,didFail:!1})})).catch((function(){_this.setState({didFail:!0,hasMoreItems:!1})}))},_this.getMoreGifs=function(){var searchTag=_this.props.searchTag;_this.getGifs(searchTag,_this.state.page)},_this.getBoundOnClick=function(giphy){var componentData=_this.convertGiphyToComponentData(giphy);return function(){return _this.selectGif(componentData)}},_this.getBoundKeyDown=function(giphy){var componentData=_this.convertGiphyToComponentData(giphy);return function(e){var onCloseRequested=_this.props.onCloseRequested;"Escape"===e.key&&(null==onCloseRequested||onCloseRequested()),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),_this.selectGif(componentData))}};var componentData=_this.props.componentData;_this.state={url:componentData.src||"",isLoaded:!1,hasMoreItems:!0,gifs:[],page:0,didFail:!1},_this.styles=mergeStyles({styles:styles$1,theme:_this.props.theme});var gphApiClient=require("giphy-js-sdk-core");return _this.giphySdkCore=gphApiClient(_this.props.giphySdkApiKey),_this}_inheritsLoose(GiphySelector,_Component);var _proto=GiphySelector.prototype;return _proto.selectGif=function(gif){var _this$props=this.props,componentData=_this$props.componentData,pubsub=_this$props.pubsub,onConfirm=_this$props.onConfirm,onCloseRequested=_this$props.onCloseRequested;onConfirm?onConfirm(_extends({},componentData,{gif:gif})):pubsub.update("componentData",{gif:gif}),onCloseRequested()},_proto.convertGiphyToComponentData=function(giphy){var _giphy$images$downsiz,_giphy$images$downsiz2,_giphy$images$downsiz3;return{originalUrl:giphy.images.original.url,originalMp4:giphy.images.original.mp4,stillUrl:giphy.images.original_still.url,downsizedUrl:(null===(_giphy$images$downsiz=giphy.images.downsized)||void 0===_giphy$images$downsiz?void 0:_giphy$images$downsiz.url)||giphy.images.original.url,downsizedStillUrl:(null===(_giphy$images$downsiz2=giphy.images.downsized_still)||void 0===_giphy$images$downsiz2?void 0:_giphy$images$downsiz2.url)||giphy.images.original.url,downsizedSmallMp4:(null===(_giphy$images$downsiz3=giphy.images.downsized_small)||void 0===_giphy$images$downsiz3?void 0:_giphy$images$downsiz3.mp4)||giphy.images.original.mp4,height:parseInt(giphy.images.original.height,10),width:parseInt(giphy.images.original.width,10)}},_proto.componentWillReceiveProps=function(nextProps){var _this2=this;null!==this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){return _this2.getGifs(nextProps.searchTag)}),300)},_proto.componentDidMount=function(){this.timer=null},_proto.render=function(){var _this3=this,styles=this.styles,_this$props2=this.props,t=_this$props2.t,searchTag=_this$props2.searchTag,_this$state=this.state,gifs=_this$state.gifs,hasMoreItems=_this$state.hasMoreItems,didFail=_this$state.didFail,loader=React.createElement("div",{className:styles["giphy_selecter_spinner_"+(gifs.length?"more":"empty_modal")]},React.createElement(MDSpinner,{borderSize:1.5,singleColor:"#000000"}));return React.createElement("div",null,React.createElement("div",{className:styles.giphy_selecter_infinite_scroll_container},!gifs.length&&searchTag?React.createElement(GiphyEmptyState,{t:t}):React.createElement(Scrollbars,{renderThumbVertical:function(){return React.createElement("div",{className:styles.giphy_selecter_scrollbarThumb})},className:styles.giphy_selecter_customize_scrollbar_container},React.createElement(InfiniteScroll,{pageStart:0,loadMore:this.getMoreGifs.bind(this),hasMore:hasMoreItems,loader:this.state.didFail?null:loader,useWindow:!1,className:styles.giphy_selecter_infinite_scroll},gifs.map((function(giphy,i){return React.createElement("div",{key:i,role:"button",tabIndex:0,className:styles.giphy_selecter_gif_img_container,onKeyDown:_this3.getBoundKeyDown(giphy),onClick:_this3.getBoundOnClick(giphy)},React.createElement("img",{className:styles.giphy_selecter_gif_img,src:giphy.images.fixed_width_downsampled.url,alt:giphy.title||"gif"}))}))))),React.createElement("div",{className:styles.giphy_selecter_container},React.createElement(PoweredByGiphy,{className:styles.giphy_selecter_powerdByGiphy})),didFail&&!gifs.length?React.createElement("div",{className:styles.giphy_selecter_error_msg}," ",t("GiphyPlugin_ApiErrorMsg")):null)},GiphySelector}(Component),GIPHY_TYPE="wix-draft-plugin-giphy",GiphyApiInputModal=function(_Component){function GiphyApiInputModal(props){var _this;return(_this=_Component.call(this,props)||this).triggerBi=debounce((function(){var _this$props=_this.props,helpers=_this$props.helpers,toolbarName=_this$props.toolbarName;helpers.onPluginAction("searchInsideThePlugin",{searchTerm:_this.state.searchTag,plugin_id:GIPHY_TYPE,entry_point:toolbarName})}),200),_this.onChange=function(searchTag){_this.setState({searchTag:searchTag}),_this.triggerBi()},_this.onCloseRequested=function(){_this.setState({isOpen:!1}),_this.props.helpers.closeModal()},_this.handleClearText=function(){_this.setState({searchTag:""})},_this.styles=mergeStyles({styles:styles$2,theme:props.theme}),_this.state={searchTag:""},_this}return _inheritsLoose(GiphyApiInputModal,_Component),GiphyApiInputModal.prototype.render=function(){var _this2=this,styles=this.styles,_this$props2=this.props,t=_this$props2.t,isMobile=_this$props2.isMobile,languageDir=_this$props2.languageDir,searchTag=this.state.searchTag,mobileNavbar=React.createElement("div",null,React.createElement("div",{className:styles.giphy_api_input_modal_navbar},t("GiphyUploadModal_mobileNavbar_Title"),React.createElement("div",{onClick:this.onCloseRequested,role:"button",tabIndex:"0",onKeyPress:null,className:styles.giphy_api_input_modal_closeButton},React.createElement(CloseIcon,null))));return React.createElement("div",{dir:languageDir},isMobile?React.createElement("div",null,mobileNavbar):null,React.createElement("div",{className:styles.giphy_api_input_modal_container,"data-hook":"giphyUploadModal"},React.createElement(TextSearchInput,{inputRef:function(ref){return _this2.input=ref},onClose:this.onCloseRequested,placeHolder:t("GiphyUploadModal_Search_Placeholder"),onChange:this.onChange,value:this.state.searchTag,"data-hook":"giphyUploadModalInput"}),React.createElement(GiphySelector,_extends({searchTag:searchTag,onCloseRequested:this.onCloseRequested},this.props))))},GiphyApiInputModal}(Component),createInlineButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,t=_ref.t,settings=_ref.settings,isMobile=_ref.isMobile,icon=(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.replace)||MediaReplaceIcon,modalStyles=isMobile?getModalStyles({customStyles:MOBILE_FULL_SCREEN_CUSTOM_STYLE,fullScreen:!0,isMobile:isMobile}):void 0;return[{keyName:"sizeOriginal",type:BUTTONS.SIZE_ORIGINAL,mobile:!1},{keyName:"sizeSmallCenter",type:BUTTONS.SIZE_SMALL_CENTER,mobile:!1},{keyName:"sizeContent",type:BUTTONS.SIZE_CONTENT,mobile:!1},{keyName:"sizeFullWidth",type:BUTTONS.SIZE_FULL_WIDTH,mobile:!1},{keyName:"separator1",type:BUTTONS.SEPARATOR,mobile:!1},{keyName:"sizeSmallLeft",type:BUTTONS.SIZE_SMALL_LEFT,mobile:!1},{keyName:"sizeSimallRight",type:BUTTONS.SIZE_SMALL_RIGHT,mobile:!1},{keyName:"separator2",type:BUTTONS.SEPARATOR,mobile:!1},{keyName:"replace",type:BUTTONS.EXTERNAL_MODAL,icon:icon,modalElement:decorateComponentWithProps(GiphyApiInputModal,settings),modalStyles:modalStyles,modalStylesFn:function(_ref2){var buttonRef=_ref2.buttonRef,modalStyles=getModalStyles({customStyles:DESKTOP_FLY_OUT_MODAL_STYLES,fullScreen:!0,isMobile:isMobile}),_buttonRef$getBoundin=buttonRef.getBoundingClientRect(),top=_buttonRef$getBoundin.top,modalLeft=_buttonRef$getBoundin.left-15,modalTop=top>357?top-365:top+30;return _extends({},modalStyles,{content:_extends({},modalStyles.content,{top:modalTop,left:modalLeft,margin:0,position:"absolute"})})},mobile:!0,tooltipTextKey:"ReplaceGiphyButton_Tooltip",t:t},{keyName:"delete",type:BUTTONS.DELETE,mobile:!0}]},createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,_modalStylesByToolbar,t=_ref.t,settings=_ref.settings,isMobile=_ref.isMobile,icon=(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.InsertPluginButtonIcon)||InsertPluginIcon,modalStylesByToolbar=((_modalStylesByToolbar={})[TOOLBARS.FOOTER]=isMobile?getModalStyles({customStyles:MOBILE_FULL_SCREEN_CUSTOM_STYLE,fullScreen:!0,isMobile:isMobile}):void 0,_modalStylesByToolbar[TOOLBARS.INSERT_PLUGIN]=getModalStyles(isMobile?{customStyles:MOBILE_FULL_SCREEN_CUSTOM_STYLE,fullScreen:!0,isMobile:isMobile}:{customStyles:EXTERNAL_POPUP_STYLES,fullScreen:!1,isMobile:isMobile}),_modalStylesByToolbar),buttonProps={type:BUTTON_TYPES.MODAL,name:INSERT_PLUGIN_BUTTONS.GIF,tooltip:t("GiphyPlugin_InsertButton_Tooltip"),getIcon:function(){return icon},componentData:settings.componentDataDefaults||DEFAULTS,modalElement:decorateComponentWithProps(GiphyApiInputModal,settings)};return[_extends({},buttonProps,{toolbars:settings.insertToolbars||[TOOLBARS.FOOTER,TOOLBARS.SIDE,TOOLBARS.MOBILE],modalStyles:modalStylesByToolbar[TOOLBARS.FOOTER],modalStylesFn:function(_ref2){var buttonRef=_ref2.buttonRef,toolbarName=_ref2.toolbarName;return getBottomToolbarModalStyles(buttonRef,{customStyles:DESKTOP_FLY_OUT_MODAL_STYLES,isMobile:isMobile},toolbarName)}}),_extends({},buttonProps,{toolbars:[TOOLBARS.INSERT_PLUGIN],modalStyles:modalStylesByToolbar[TOOLBARS.INSERT_PLUGIN]})]},createToolbar=function(_ref){var t=_ref.t,settings=_ref.settings,isMobile=_ref.isMobile;return{InlineButtons:createInlineButtons({t:t,settings:settings,isMobile:isMobile}),InsertButtons:createInsertButtons({t:t,settings:settings,isMobile:isMobile}),name:"giphy"}},styles={giphy_player:"_1JieR"},GiphyViewer=function(_Component){function GiphyViewer(props){var _this;return(_this=_Component.call(this,props)||this).getSourceUrl=function(){var _this$props=_this.props,gif=_this$props.componentData.gif,isMobile=_this$props.isMobile,_this$props$settings=_this$props.settings;if(!gif)return null;var _DEFAULT_RESOLUTION$s=_extends({},DEFAULT_RESOLUTION,void 0===_this$props$settings?{}:_this$props$settings),mobile=_DEFAULT_RESOLUTION$s.mobile,desktop=_DEFAULT_RESOLUTION$s.desktop,size=isMobile?mobile:desktop,originalMp4=gif.originalMp4,originalUrl=gif.originalUrl;return{original:originalMp4,downsizedSmall:gif.downsizedSmallMp4}[size]||originalUrl},validate(props.componentData,pluginGiphySchema),_this}_inheritsLoose(GiphyViewer,_Component);var _proto=GiphyViewer.prototype;return _proto.componentWillReceiveProps=function(nextProps){isEqual(nextProps.componentData,this.props.componentData)||validate(nextProps.componentData,pluginGiphySchema)},_proto.render=function(){this.styles=this.styles||mergeStyles({styles:styles,theme:this.props.theme});var _this$props2=this.props,componentData=_this$props2.componentData,setComponentUrl=_this$props2.setComponentUrl,gifUrl=this.getSourceUrl();return gifUrl?(null==setComponentUrl||setComponentUrl(gifUrl),gifUrl.endsWith(".mp4")?React.createElement("video",{role:"img",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,"aria-label":"gif",className:this.styles.giphy_player,src:gifUrl}):React.createElement("img",{role:"img","aria-label":"gif",className:this.styles.giphy_player,src:componentData.gif.originalUrl,alt:"gif"})):null},GiphyViewer}(Component);GiphyViewer.defaultProps={width:"100%",height:"100%",controls:!0};var GiphyComponent=function(_Component){function GiphyComponent(props){var _this;return(_this=_Component.call(this,props)||this).handleReady=function(){_this.state.isLoaded||_this.setState({isLoaded:!0})},_this.renderPlayer=function(){var _this$props=_this.props,componentData=_this$props.componentData,theme=_this$props.theme,settings=_this$props.settings,isMobile=_this$props.isMobile,setComponentUrl=_this$props.setComponentUrl;return React.createElement(GiphyViewer,{ref:_this.setPlayer,componentData:componentData,theme:theme,settings:settings,isMobile:isMobile,setComponentUrl:setComponentUrl})},_this.onKeyDown=function(e,handler){"Enter"!==e.key&&" "!==e.key||handler()},_this.state={isLoading:!1,isLoaded:!1},_this}return _inheritsLoose(GiphyComponent,_Component),GiphyComponent.prototype.render=function(){var _this2=this,onClick=this.props.onClick;return React.createElement("div",{"data-hook":"giphyPlayer",onClick:onClick,onKeyDown:function(e){return _this2.onKeyDown(e,onClick)}},this.renderPlayer())},GiphyComponent}(Component);function _toPropertyKey(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}GiphyComponent.type={GIPHY_TYPE:GIPHY_TYPE};var _ModalsMap,createGiphyPlugin=function(config){var type=GIPHY_TYPE,helpers=config.helpers,t=config.t,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,isMobile=config.isMobile,rest=_objectWithoutPropertiesLoose(config,["helpers","t",type,"isMobile"].map(_toPropertyKey));return createBasePlugin(_extends({component:GiphyComponent,type:GIPHY_TYPE,toolbar:createToolbar({helpers:helpers,t:t,settings:settings,isMobile:isMobile}),helpers:helpers,settings:settings,t:t,isMobile:isMobile,defaultPluginData:DEFAULTS},rest))};createGiphyPlugin.functionName=GIPHY_TYPE;var Modals={GIPHY_API_INPUT:"giphy-api-input"},ModalsMap=((_ModalsMap={})[Modals.GIPHY_API_INPUT]=GiphyApiInputModal,_ModalsMap),createGiphyData=function(pluginData,isRicosSchema){void 0===pluginData&&(pluginData={}),void 0===isRicosSchema&&(isRicosSchema=!1);var giphyData=isRicosSchema?convertNodeDataToDraft("GIF",pluginData):pluginData;return merge({},DEFAULTS,giphyData)},Gif=function(_ref){var context=_ref.context,componentData=_ref.componentData,isMobile=context.isMobile,theme=context.theme,_context$config=context.config,settings=(void 0===_context$config?{}:_context$config)[GIPHY_TYPE]||{};return React.createElement(GiphyComponent,{componentData:componentData,isMobile:isMobile,theme:theme,settings:settings,onClick:function(){},setComponentUrl:function(){return null}})},gifDataDefaults={height:0,width:0,containerData:{alignment:"CENTER",width:{size:null,custom:null},spoiler:{enabled:null,description:null,buttonText:null},height:{custom:null},textWrap:null},original:null,downsized:null},name=TIPTAP_GIF_TYPE,pluginGiphy=function(config){var defaultOptions,pluginConfig=_extends({},DEFAULTS.config,config);return{config:pluginConfig,type:GIPHY_TYPE,createPlugin:createGiphyPlugin,ModalsMap:ModalsMap,createPluginData:createGiphyData,tiptapExtensions:(defaultOptions=pluginConfig,[{type:"node",Component:Gif,componentDataDefaults:_extends({},gifDataDefaults,{id:""}),createExtensionConfig:function(){return{name:name,defaultOptions:defaultOptions,addCommands:function(){return{}}}}}])}};export{GIPHY_TYPE,GiphyViewer,Modals,ModalsMap,createGiphyPlugin,pluginGiphy};
//# sourceMappingURL=module.js.map

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("wix-rich-content-common");var _extends__default=_interopDefaultLegacy(_extends);Object.freeze(["#ffffff","#303030","#3a54b4","#bfad80","#bf695c","#f7f7f7"]);var userColors=[],DEFAULTS_configTextColor={editor:{onColorAdded:function(color){return userColors=[].concat(userColors,[color])},getUserColors:function(){return userColors}},viewer:{}},DEFAULTS_configTextHighlight={editor:{onColorAdded:function(color){return userColors=[].concat(userColors,[color])},getUserColors:function(){return userColors}},viewer:{}};exports.TEXT_COLOR_TYPE="wix-rich-content-text-color",exports.TEXT_HIGHLIGHT_TYPE="wix-rich-content-text-highlight",exports.pluginTextColor=function(config){return{config:_extends__default.default({},DEFAULTS_configTextColor.viewer,config),type:"wix-rich-content-text-color"}},exports.pluginTextHighlight=function(config){return{config:_extends__default.default({},DEFAULTS_configTextHighlight.viewer,config),type:"wix-rich-content-text-highlight"}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),wixRichContentCommon=require("wix-rich-content-common"),pluginGiphySchema=require("wix-rich-content-common/dist/statics/schemas/plugin-giphy.schema.json"),lodash=require("lodash");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),pluginGiphySchema__default=_interopDefaultLegacy(pluginGiphySchema),styles={giphy_player:"_1JieR"},DEFAULTS=Object.freeze({config:{size:"content",alignment:"center"},configViewer:{sizes:{desktop:"original",mobile:"original"}}}),DEFAULT_RESOLUTION=Object.freeze({desktop:"original",mobile:"original"});Object.freeze({overlay:{backgroundColor:"transparent"},content:{top:0,left:0,overflow:"hidden",paddingRight:"6px"}});var commonDesktopModalStyles={width:"320px",boxSizing:"border-box",height:"364px",overflow:"visible",paddingRight:"12px",paddingLeft:"12px",display:"block",position:"absolute",zIndex:6,paddingTop:"12px"};Object.freeze({overlay:{backgroundColor:"rgba(0, 0, 0, 0)",zIndex:5},content:_extends__default.default({},commonDesktopModalStyles,{border:"solid 1px rgba(51, 51, 51, 0.1)",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.06)"})}),Object.freeze({content:commonDesktopModalStyles});var GiphyViewer=function(_Component){function GiphyViewer(props){var _this;return(_this=_Component.call(this,props)||this).getSourceUrl=function(){var _this$props=_this.props,gif=_this$props.componentData.gif,isMobile=_this$props.isMobile,_this$props$settings=_this$props.settings,settings=void 0===_this$props$settings?{}:_this$props$settings;if(!gif)return null;var _DEFAULT_RESOLUTION$s=_extends__default.default({},DEFAULT_RESOLUTION,settings),mobile=_DEFAULT_RESOLUTION$s.mobile,desktop=_DEFAULT_RESOLUTION$s.desktop,size=isMobile?mobile:desktop,originalMp4=gif.originalMp4,originalUrl=gif.originalUrl;return{original:originalMp4,downsizedSmall:gif.downsizedSmallMp4}[size]||originalUrl},wixRichContentCommon.validate(props.componentData,pluginGiphySchema__default.default),_this}_inheritsLoose__default.default(GiphyViewer,_Component);var _proto=GiphyViewer.prototype;return _proto.componentWillReceiveProps=function(nextProps){lodash.isEqual(nextProps.componentData,this.props.componentData)||wixRichContentCommon.validate(nextProps.componentData,pluginGiphySchema__default.default)},_proto.render=function(){this.styles=this.styles||wixRichContentCommon.mergeStyles({styles:styles,theme:this.props.theme});var _this$props2=this.props,componentData=_this$props2.componentData,setComponentUrl=_this$props2.setComponentUrl,gifUrl=this.getSourceUrl();return gifUrl?(null==setComponentUrl||setComponentUrl(gifUrl),gifUrl.endsWith(".mp4")?React__default.default.createElement("video",{role:"img",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,"aria-label":"gif",className:this.styles.giphy_player,src:gifUrl}):React__default.default.createElement("img",{role:"img","aria-label":"gif",className:this.styles.giphy_player,src:componentData.gif.originalUrl,alt:"gif"})):null},GiphyViewer}(React.Component);GiphyViewer.defaultProps={width:"100%",height:"100%",controls:!0};var GIPHY_TYPE="wix-draft-plugin-giphy",typeMapper=function(){var _ref;return(_ref={})[GIPHY_TYPE]={component:GiphyViewer},_ref};exports.GIPHY_TYPE=GIPHY_TYPE,exports.giphyTypeMapper=typeMapper,exports.pluginGiphy=function(config){return{config:_extends__default.default({},DEFAULTS.configViewer,config),type:GIPHY_TYPE,typeMapper:typeMapper}};
//# sourceMappingURL=module.viewer.cjs.js.map

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

import _extends from"@babel/runtime/helpers/extends";import"wix-rich-content-common";var TEXT_COLOR_TYPE="wix-rich-content-text-color",TEXT_HIGHLIGHT_TYPE="wix-rich-content-text-highlight";Object.freeze(["#ffffff","#303030","#3a54b4","#bfad80","#bf695c","#f7f7f7"]);var userColors=[],DEFAULTS_configTextColor={editor:{onColorAdded:function(color){return userColors=[].concat(userColors,[color])},getUserColors:function(){return userColors}},viewer:{}},DEFAULTS_configTextHighlight={editor:{onColorAdded:function(color){return userColors=[].concat(userColors,[color])},getUserColors:function(){return userColors}},viewer:{}},pluginTextColor=function(config){return{config:_extends({},DEFAULTS_configTextColor.viewer,config),type:"wix-rich-content-text-color"}},pluginTextHighlight=function(config){return{config:_extends({},DEFAULTS_configTextHighlight.viewer,config),type:"wix-rich-content-text-highlight"}};export{TEXT_COLOR_TYPE,TEXT_HIGHLIGHT_TYPE,pluginTextColor,pluginTextHighlight};
import _extends from"@babel/runtime/helpers/extends";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component}from"react";import{validate,mergeStyles}from"wix-rich-content-common";import pluginGiphySchema from"wix-rich-content-common/dist/statics/schemas/plugin-giphy.schema.json";import{isEqual}from"lodash";var styles={giphy_player:"_1JieR"},DEFAULTS=Object.freeze({config:{size:"content",alignment:"center"},configViewer:{sizes:{desktop:"original",mobile:"original"}}}),DEFAULT_RESOLUTION=Object.freeze({desktop:"original",mobile:"original"});Object.freeze({overlay:{backgroundColor:"transparent"},content:{top:0,left:0,overflow:"hidden",paddingRight:"6px"}});var commonDesktopModalStyles={width:"320px",boxSizing:"border-box",height:"364px",overflow:"visible",paddingRight:"12px",paddingLeft:"12px",display:"block",position:"absolute",zIndex:6,paddingTop:"12px"};Object.freeze({overlay:{backgroundColor:"rgba(0, 0, 0, 0)",zIndex:5},content:_extends({},commonDesktopModalStyles,{border:"solid 1px rgba(51, 51, 51, 0.1)",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.06)"})}),Object.freeze({content:commonDesktopModalStyles});var GiphyViewer=function(_Component){function GiphyViewer(props){var _this;return(_this=_Component.call(this,props)||this).getSourceUrl=function(){var _this$props=_this.props,gif=_this$props.componentData.gif,isMobile=_this$props.isMobile,_this$props$settings=_this$props.settings;if(!gif)return null;var _DEFAULT_RESOLUTION$s=_extends({},DEFAULT_RESOLUTION,void 0===_this$props$settings?{}:_this$props$settings),mobile=_DEFAULT_RESOLUTION$s.mobile,desktop=_DEFAULT_RESOLUTION$s.desktop,size=isMobile?mobile:desktop,originalMp4=gif.originalMp4,originalUrl=gif.originalUrl;return{original:originalMp4,downsizedSmall:gif.downsizedSmallMp4}[size]||originalUrl},validate(props.componentData,pluginGiphySchema),_this}_inheritsLoose(GiphyViewer,_Component);var _proto=GiphyViewer.prototype;return _proto.componentWillReceiveProps=function(nextProps){isEqual(nextProps.componentData,this.props.componentData)||validate(nextProps.componentData,pluginGiphySchema)},_proto.render=function(){this.styles=this.styles||mergeStyles({styles:styles,theme:this.props.theme});var _this$props2=this.props,componentData=_this$props2.componentData,setComponentUrl=_this$props2.setComponentUrl,gifUrl=this.getSourceUrl();return gifUrl?(null==setComponentUrl||setComponentUrl(gifUrl),gifUrl.endsWith(".mp4")?React.createElement("video",{role:"img",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,"aria-label":"gif",className:this.styles.giphy_player,src:gifUrl}):React.createElement("img",{role:"img","aria-label":"gif",className:this.styles.giphy_player,src:componentData.gif.originalUrl,alt:"gif"})):null},GiphyViewer}(Component);GiphyViewer.defaultProps={width:"100%",height:"100%",controls:!0};var GIPHY_TYPE="wix-draft-plugin-giphy",typeMapper=function(){var _ref;return(_ref={})[GIPHY_TYPE]={component:GiphyViewer},_ref},pluginGiphy=function(config){return{config:_extends({},DEFAULTS.configViewer,config),type:GIPHY_TYPE,typeMapper:typeMapper}};export{GIPHY_TYPE,typeMapper as giphyTypeMapper,pluginGiphy};
//# sourceMappingURL=module.viewer.js.map

@@ -1,41 +0,24 @@

export const DEFAULT_PALETTE: readonly string[];
export const DEFAULT_COLOR: "#000000";
export const DEFAULT_HIGHLIGHT_COLOR: "#ffffff";
export const PANEL_WIDTH: 216;
export const PANEL_HEIGHT: 116;
export function DEFAULT_STYLE_SELECTION_PREDICATE(style: any): boolean;
export function DEFAULT_FOREGROUND_STYLE_FN(style: any): {
color: any;
} | {
color?: undefined;
};
export function DEFAULT_FOREGROUND_STYLE_FN_DRAFT(styles: any): any;
export function DEFAULT_BACKGROUND_STYLE_FN(style: any): {
backgroundColor: any;
transition: string;
} | {
backgroundColor?: undefined;
transition?: undefined;
};
export function DEFAULT_BACKGROUND_STYLE_FN_DRAFT(styles: any): any;
export namespace DEFAULTS {
export namespace configTextColor {
export namespace editor {
export function onColorAdded(color: any): any[];
export function getUserColors(): any[];
}
export const viewer: {};
}
export namespace configTextHighlight {
export namespace editor_1 {
export function onColorAdded_1(color: any): any[];
export { onColorAdded_1 as onColorAdded };
export function getUserColors_1(): any[];
export { getUserColors_1 as getUserColors };
}
export { editor_1 as editor };
const viewer_1: {};
export { viewer_1 as viewer };
}
}
import { ModalStyles } from 'wix-rich-content-common';
export declare const PAGE_SIZE = 25;
export declare const WAIT_INTERVAL = 300;
export declare const SEARCH_TYPE = "gifs";
export declare const DEFAULTS: Readonly<{
config: {
size: string;
alignment: string;
};
configViewer: {
sizes: {
desktop: string;
mobile: string;
};
};
}>;
export declare const DEFAULT_RESOLUTION: Readonly<{
desktop: string;
mobile: string;
}>;
export declare const MOBILE_FULL_SCREEN_CUSTOM_STYLE: ModalStyles;
export declare const DESKTOP_FLY_OUT_MODAL_STYLES: ModalStyles;
export declare const EXTERNAL_POPUP_STYLES: ModalStyles;
//# sourceMappingURL=constants.d.ts.map

@@ -1,5 +0,4 @@

import { TextColorPluginEditorConfig, TextHighlightPluginEditorConfig } from './types';
import { GiphyPluginEditorConfig } from './types';
import { EditorPluginCreator } from 'wix-rich-content-common';
export declare const pluginTextColor: EditorPluginCreator<TextColorPluginEditorConfig>;
export declare const pluginTextHighlight: EditorPluginCreator<TextHighlightPluginEditorConfig>;
export declare const pluginGiphy: EditorPluginCreator<GiphyPluginEditorConfig>;
//# sourceMappingURL=editor.d.ts.map

@@ -1,9 +0,6 @@

export { createTextColorPlugin } from './createTextColorPlugin';
export { createTextHighlightPlugin } from './createTextHighlightPlugin';
export { TEXT_COLOR_TYPE, TEXT_HIGHLIGHT_TYPE } from './types';
export { createGiphyPlugin } from './createGiphyPlugin';
export { default as GiphyViewer } from './giphy-viewer';
export { GIPHY_TYPE } from './types';
export { Modals, ModalsMap } from './modals';
export { getColor, isTextColor, isTextHighlight } from './text-decorations-utils';
export { pluginTextColor, pluginTextHighlight } from './editor';
export declare const textColorInlineStyleMapper: import("wix-rich-content-common").InlineStyleMapperFunction<Record<string, any>>;
export declare const textHighlightInlineStyleMapper: import("wix-rich-content-common").InlineStyleMapperFunction<Record<string, any>>;
export { pluginGiphy } from './editor';
//# sourceMappingURL=index.d.ts.map

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

import TextColorPanel from './toolbar/TextColorPanel';
import GiphyApiInputModal from './toolbar/giphyApiInputModal';
declare const Modals: {
TEXT_COLOR_PICKER: string;
GIPHY_API_INPUT: string;
};
declare const ModalsMap: {
[x: string]: typeof TextColorPanel;
[x: string]: typeof GiphyApiInputModal;
};
export { Modals, ModalsMap };
//# sourceMappingURL=modals.d.ts.map
import { CreatePluginToolbar } from 'wix-rich-content-common';
export declare const createTextColorToolbar: CreatePluginToolbar;
export declare const createTextHighlightToolbar: CreatePluginToolbar;
declare const createToolbar: CreatePluginToolbar;
export default createToolbar;
//# sourceMappingURL=createToolbar.d.ts.map
import { EditorPluginConfig, ViewerPluginConfig } from 'wix-rich-content-common';
export declare const TEXT_COLOR_TYPE = "wix-rich-content-text-color";
export declare const TEXT_HIGHLIGHT_TYPE = "wix-rich-content-text-highlight";
export interface TextColorPluginEditorConfig extends EditorPluginConfig {
inlinePopups?: boolean;
export declare const GIPHY_TYPE = "wix-draft-plugin-giphy";
export interface GiphyPluginEditorConfig extends EditorPluginConfig {
[key: string]: any;
}
export interface TextColorPluginViewerConfig extends ViewerPluginConfig {
export interface GiphyPluginViewerConfig extends ViewerPluginConfig {
[key: string]: any;
}
export interface TextHighlightPluginEditorConfig extends EditorPluginConfig {
inlinePopups?: boolean;
[key: string]: any;
export interface GIFObject {
type: string;
id: string;
slug: string;
url: string;
bitly_gif_url: string;
bitly_url: string;
embed_url: string;
username: string;
source: string;
rating: string;
caption: string;
content_url: string;
source_tld: string;
source_post_url: string;
import_datetime: string;
trending_datetime: string;
images: ImageObject;
meta: MetaObject;
title: string;
}
export interface TextHighlightPluginViewerConfig extends ViewerPluginConfig {
[key: string]: any;
export interface ImageObject {
fixed_height: {
url: string;
width: string;
height: string;
size: string;
mp4: string;
mp4_size: string;
webp: string;
webp_size: string;
};
fixed_height_still: {
url: string;
width: string;
height: string;
};
fixed_height_downsampled: {
url: string;
width: string;
height: string;
size: string;
webp: string;
webp_size: string;
};
fixed_width: {
url: string;
width: string;
height: string;
size: string;
mp4: string;
mp4_size: string;
webp: string;
webp_size: string;
};
fixed_width_still: {
url: string;
width: string;
height: string;
};
fixed_width_downsampled: {
url: string;
width: string;
height: string;
size: string;
webp: string;
webp_size: string;
};
fixed_height_small: {
url: string;
width: string;
height: string;
size: string;
webp: string;
webp_size: string;
};
fixed_height_small_still: {
url: string;
width: string;
height: string;
};
fixed_width_small: {
url: string;
width: string;
height: string;
size: string;
webp: string;
webp_size: string;
};
fixed_width_small_still: {
url: string;
width: string;
height: string;
};
downsized: {
url: string;
width: string;
height: string;
size: string;
};
downsized_still: {
url: string;
width: string;
height: string;
};
downsized_large: {
url: string;
width: string;
height: string;
size: string;
};
original: {
url: string;
width: string;
height: string;
size: string;
frames: string;
mp4: string;
mp4_size: string;
webp: string;
webp_size: string;
};
original_still: {
url: string;
width: string;
height: string;
};
}
export interface MetaObject {
msg: string;
status: number;
response_id: string;
}
//# sourceMappingURL=types.d.ts.map

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

import { TEXT_COLOR_TYPE, TEXT_HIGHLIGHT_TYPE, TextColorPluginViewerConfig, TextHighlightPluginViewerConfig } from './types';
import { typeMapper } from './typeMapper';
import { GIPHY_TYPE, GiphyPluginViewerConfig } from './types';
import { ViewerPluginCreator } from 'wix-rich-content-common';
export { TEXT_COLOR_TYPE, TEXT_HIGHLIGHT_TYPE };
export declare const pluginTextColor: ViewerPluginCreator<TextColorPluginViewerConfig>;
export declare const pluginTextHighlight: ViewerPluginCreator<TextHighlightPluginViewerConfig>;
export { typeMapper as giphyTypeMapper, GIPHY_TYPE };
export declare const pluginGiphy: ViewerPluginCreator<GiphyPluginViewerConfig>;
//# sourceMappingURL=viewer.d.ts.map

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

{"name":"richlagetest","version":"0.0.0-c1c54508e143627c121ba7103459dabfff1b632f"}
{"name":"richlagetest","version":"0.0.0-c3497ae916083b3348946dca8135c80bbe4d3833"}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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