Socket
Socket
Sign inDemoInstall

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-78671d73a2fed1cdad482b0f9e0934f36a513cd5 to 0.0.0-79e90eb34d73fa9c9d6e3b1db7b9e456d68b6f0f

dist/lib/HtmlComponent.cjs.js

6

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

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

"use strict";var _extends=require("@babel/runtime/helpers/extends"),loadable=require("@loadable/component"),wixRichContentCommon=require("wix-rich-content-common");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),loadable__default=_interopDefaultLegacy(loadable),COLLAPSIBLE_LIST_TYPE="wix-rich-content-plugin-collapsible-list",typeMapper=function typeMapper(){var _ref;return _ref={},_ref[COLLAPSIBLE_LIST_TYPE]={component:loadable__default.default({resolved:{},chunkName:function(){return"collapsible-list-viewer"},isReady:function(props){var key=this.resolve(props);return!0===this.resolved[key]&&("undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[key])},importAsync:function(){return Promise.resolve().then((function(){return require(
/* webpackChunkName: "collapsible-list-viewer" */
"./collapsible-list-viewer.cjs.js")}))},requireAsync:function(props){var _this=this,key=this.resolve(props);return this.resolved[key]=!1,this.importAsync(props).then((function(resolved){return _this.resolved[key]=!0,resolved}))},requireSync:function requireSync(props){var id=this.resolve(props);return"undefined"!=typeof __webpack_require__?__webpack_require__(id):eval("module.require")(id)},resolve:function resolve(){return require.resolveWeak?require.resolveWeak("./collapsible-list-viewer"):eval("require.resolve")("./collapsible-list-viewer")}})},_ref},EXPANDED="expanded",FIRST_EXPANDED="first_expanded",DEFAULTS=Object.freeze({config:{expandState:FIRST_EXPANDED,expandOnlyOne:!1},pairs:[{key:wixRichContentCommon.generateKey()}]}),pluginCollapsibleList=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:COLLAPSIBLE_LIST_TYPE,typeMapper:typeMapper}};exports.COLLAPSIBLE_LIST_TYPE=COLLAPSIBLE_LIST_TYPE,exports.EXPANDED=EXPANDED,exports.FIRST_EXPANDED=FIRST_EXPANDED,exports.pluginCollapsibleList=pluginCollapsibleList,exports.typeMapper=typeMapper;
"use strict";var _extends=require("@babel/runtime/helpers/extends"),loadable=require("@loadable/component");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),loadable__default=_interopDefaultLegacy(loadable),HTML_TYPE="wix-draft-plugin-html",typeMapper=function typeMapper(){var _ref;return _ref={},_ref[HTML_TYPE]={component:loadable__default.default({resolved:{},chunkName:function(){return"HtmlComponent"},isReady:function(props){var key=this.resolve(props);return!0===this.resolved[key]&&("undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[key])},importAsync:function(){return Promise.resolve().then((function(){return require(
/* webpackChunkName: "HtmlComponent" */
"./HtmlComponent.cjs.js")}))},requireAsync:function(props){var _this=this,key=this.resolve(props);return this.resolved[key]=!1,this.importAsync(props).then((function(resolved){return _this.resolved[key]=!0,resolved}))},requireSync:function requireSync(props){var id=this.resolve(props);return"undefined"!=typeof __webpack_require__?__webpack_require__(id):eval("module.require")(id)},resolve:function resolve(){return require.resolveWeak?require.resolveWeak("./HtmlComponent"):eval("require.resolve")("./HtmlComponent")}})},_ref},SRC_TYPE_HTML="html",SRC_TYPE_URL="url",INIT_WIDTH=350,INIT_HEIGHT=550,DEFAULTS_CONFIG={alignment:"center"},defaults=function(isAdsense){return{srcType:SRC_TYPE_HTML,src:"",config:_extends__default.default({},DEFAULTS_CONFIG,isAdsense&&{isAdsense:isAdsense})}},DEFAULTS_VIEWER={},pluginHtml=function(config){return{config:_extends__default.default({},DEFAULTS_VIEWER,config),type:HTML_TYPE,typeMapper:typeMapper}};exports.HTML_TYPE=HTML_TYPE,exports.INIT_HEIGHT=INIT_HEIGHT,exports.INIT_WIDTH=INIT_WIDTH,exports.SRC_TYPE_HTML=SRC_TYPE_HTML,exports.SRC_TYPE_URL=SRC_TYPE_URL,exports.defaults=defaults,exports.pluginHtml=pluginHtml,exports.typeMapper=typeMapper;

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@babel/runtime/helpers/extends");var viewerLoadable=require("./viewer-loadable.cjs.js");require("@loadable/component"),require("wix-rich-content-common"),exports.COLLAPSIBLE_LIST_TYPE=viewerLoadable.COLLAPSIBLE_LIST_TYPE,exports.collapsibleListTypeMapper=viewerLoadable.typeMapper,exports.pluginCollapsibleList=viewerLoadable.pluginCollapsibleList;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("@babel/runtime/helpers/extends");var viewerLoadable=require("./viewer-loadable.cjs.js");require("@loadable/component"),exports.HTML_TYPE=viewerLoadable.HTML_TYPE,exports.htmlTypeMapper=viewerLoadable.typeMapper,exports.pluginHtml=viewerLoadable.pluginHtml;

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

import"@babel/runtime/helpers/extends";export{C as COLLAPSIBLE_LIST_TYPE,t as collapsibleListTypeMapper,p as pluginCollapsibleList}from"./viewer-loadable2.js";import"@loadable/component";import"wix-rich-content-common";
import"@babel/runtime/helpers/extends";export{H as HTML_TYPE,t as htmlTypeMapper,p as pluginHtml}from"./viewer-loadable2.js";import"@loadable/component";

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

import _extends from"@babel/runtime/helpers/extends";import loadable from"@loadable/component";import{generateKey}from"wix-rich-content-common";var COLLAPSIBLE_LIST_TYPE="wix-rich-content-plugin-collapsible-list",typeMapper=function typeMapper(){var _ref;return _ref={},_ref[COLLAPSIBLE_LIST_TYPE]={component:loadable({resolved:{},chunkName:function(){return"collapsible-list-viewer"},isReady:function(props){var key=this.resolve(props);return!0===this.resolved[key]&&("undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[key])},importAsync:function(){return import(
/* webpackChunkName: "collapsible-list-viewer" */
"./collapsible-list-viewer.js")},requireAsync:function(props){var _this=this,key=this.resolve(props);return this.resolved[key]=!1,this.importAsync(props).then((function(resolved){return _this.resolved[key]=!0,resolved}))},requireSync:function requireSync(props){var id=this.resolve(props);return"undefined"!=typeof __webpack_require__?__webpack_require__(id):eval("module.require")(id)},resolve:function resolve(){return require.resolveWeak?require.resolveWeak("./collapsible-list-viewer"):eval("require.resolve")("./collapsible-list-viewer")}})},_ref},EXPANDED="expanded",FIRST_EXPANDED="first_expanded",DEFAULTS=Object.freeze({config:{expandState:FIRST_EXPANDED,expandOnlyOne:!1},pairs:[{key:generateKey()}]}),pluginCollapsibleList=function(config){return{config:_extends({},DEFAULTS.config,config),type:COLLAPSIBLE_LIST_TYPE,typeMapper:typeMapper}};export{COLLAPSIBLE_LIST_TYPE as C,EXPANDED as E,FIRST_EXPANDED as F,pluginCollapsibleList as p,typeMapper as t};
import _extends from"@babel/runtime/helpers/extends";import loadable from"@loadable/component";var HTML_TYPE="wix-draft-plugin-html",typeMapper=function typeMapper(){var _ref;return _ref={},_ref[HTML_TYPE]={component:loadable({resolved:{},chunkName:function(){return"HtmlComponent"},isReady:function(props){var key=this.resolve(props);return!0===this.resolved[key]&&("undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[key])},importAsync:function(){return import(
/* webpackChunkName: "HtmlComponent" */
"./HtmlComponent.js")},requireAsync:function(props){var _this=this,key=this.resolve(props);return this.resolved[key]=!1,this.importAsync(props).then((function(resolved){return _this.resolved[key]=!0,resolved}))},requireSync:function requireSync(props){var id=this.resolve(props);return"undefined"!=typeof __webpack_require__?__webpack_require__(id):eval("module.require")(id)},resolve:function resolve(){return require.resolveWeak?require.resolveWeak("./HtmlComponent"):eval("require.resolve")("./HtmlComponent")}})},_ref},SRC_TYPE_HTML="html",SRC_TYPE_URL="url",INIT_WIDTH=350,INIT_HEIGHT=550,DEFAULTS_CONFIG={alignment:"center"},defaults=function(isAdsense){return{srcType:SRC_TYPE_HTML,src:"",config:_extends({},DEFAULTS_CONFIG,isAdsense&&{isAdsense:isAdsense})}},DEFAULTS_VIEWER={},pluginHtml=function(config){return{config:_extends({},DEFAULTS_VIEWER,config),type:HTML_TYPE,typeMapper:typeMapper}};export{HTML_TYPE as H,INIT_HEIGHT as I,SRC_TYPE_HTML as S,INIT_WIDTH as a,SRC_TYPE_URL as b,defaults as d,pluginHtml as p,typeMapper as t};

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

"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"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),classNames=require("classnames"),wixRichContentCommon=require("wix-rich-content-common"),wixRichContentUiComponents=require("wix-rich-content-ui-components"),reactBeautifulDnd=require("react-beautiful-dnd");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _ModalsMap,_extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),COLLAPSIBLE_LIST_TYPE="wix-rich-content-plugin-collapsible-list",directions_LTR="ltr",directions_RTL="rtl",DEFAULTS=Object.freeze({config:{expandState:"first_expanded",expandOnlyOne:!1},pairs:[{key:wixRichContentCommon.generateKey()}]}),EMPTY_PAIR_VALUE={title:wixRichContentEditorCommon.EditorState.createEmpty(),content:wixRichContentEditorCommon.EditorState.createEmpty()},CollapsibleList=function(store,componentData){var _this=this;this.getData=function(){return _this.componentData},this.getConfig=function(){return _this.getData().config},this.getPairs=function(){return _this.getData().pairs},this.getPair=function(idx){return _this.getPairs()[idx]},this.getTitle=function(idx){return _this.getPair(idx).title||wixRichContentEditorCommon.EditorState.createEmpty()},this.getContent=function(idx){return _this.getPair(idx).content||wixRichContentEditorCommon.EditorState.createEmpty()},this.getDirection=function(){return _this.getConfig().direction},this.changeDirection=function(){var direction=_this.getDirection()===directions_LTR?directions_RTL:directions_LTR,updatedData={config:_extends__default.default({},_this.getConfig(),{direction:direction})};_this.updateData(updatedData)},this.getExpandState=function(){return _this.getConfig().expandState},this.setExpandState=function(expandState){var updatedData={config:_extends__default.default({},_this.getConfig(),{expandState:expandState})};"expanded"===expandState&&(updatedData.config.expandOnlyOne=void 0),_this.updateData(updatedData)},this.getExpandOnlyOne=function(){return _this.getConfig().expandOnlyOne},this.toggleExpandOnlyOne=function(){var updatedData={config:_extends__default.default({},_this.getConfig(),{expandOnlyOne:!_this.getExpandOnlyOne()})};_this.updateData(updatedData)},this.setData=function(data){_this.store.set("componentData",data)},this.updateData=function(data){var componentData=_this.getData();_this.setData(_extends__default.default({},componentData,data))},this.setTitle=function(idx,editorState){var pair={title:editorState};_this.setPair(idx,pair)},this.setContent=function(idx,editorState){var pair={content:editorState};_this.setPair(idx,pair)},this.setPair=function(idx,updatedPair){var pairs=[].concat(_this.getPairs()),currentPair=_this.getPair(idx),newPair=_extends__default.default({},currentPair.title&&currentPair.content?{}:EMPTY_PAIR_VALUE,currentPair,updatedPair);pairs.splice(idx,1,newPair),_this.updateData({pairs:pairs})},this.createNewPair=function(){return{key:wixRichContentCommon.generateKey(),title:wixRichContentEditorCommon.EditorState.createEmpty(),content:wixRichContentEditorCommon.EditorState.createEmpty()}},this.insertNewPair=function(){var pairs=_this.getPairs();_this.updateData({pairs:[].concat(pairs,[_this.createNewPair()])})},this.reorderPairs=function(startIdx,endIdx){var pairs=_this.getPairs(),pairToMove=pairs.splice(startIdx,1)[0];pairs.splice(endIdx,0,pairToMove),_this.updateData({pairs:pairs})},this.deletePair=function(pairIndex){var pairs=_this.getPairs();pairs.splice(pairIndex,1),_this.updateData({pairs:pairs})},this.store=store,this.componentData=componentData},styles$5={title:"_3hUj0",settingsContainer:"_62k0D",separator:"_20bm0",direction_selector:"_1jUkB",direction_selector_option:"_1w4ED"},CollapsibleListSettings=function(_Component){function CollapsibleListSettings(props){var _this;(_this=_Component.call(this,props)||this).renderOption=function(_ref){var item=_ref.item;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(item.icon,null),React__default.default.createElement("p",null,item.label))},_this.renderExpandOptions=function(){var _this$props=_this.props,getDataManager=_this$props.getDataManager,t=_this$props.t,theme=_this$props.theme,isMobile=_this$props.isMobile;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(wixRichContentUiComponents.RadioGroupVertical,{label:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_Title"),value:getDataManager().getExpandState(),dataSource:[{value:"expanded",labelText:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_Expanded"),dataHook:"Expanded"},{value:"first_expanded",labelText:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_FirstExpanded"),dataHook:"FirstExpanded"},{value:"collapsed",labelText:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_Collapsed"),dataHook:"Collapsed"}],t:t,theme:theme,onChange:function(value){return getDataManager().setExpandState(value)}}),"expanded"!==getDataManager().getExpandState()&&React__default.default.createElement(wixRichContentUiComponents.LabeledToggle,{label:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_InSections"),checked:getDataManager().getExpandOnlyOne(),onChange:getDataManager().toggleExpandOnlyOne,theme:theme,style:isMobile?{paddingTop:"28px"}:{},dataHook:"onePairExpanded"}))},_this.renderSeparator=function(){return React__default.default.createElement(wixRichContentUiComponents.Separator,{horizontal:!0,className:_this.styles.separator})},_this.renderDirectionOptions=function(){var _this$props2=_this.props,getDataManager=_this$props2.getDataManager,t=_this$props2.t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("p",{className:_this.styles.title},t("CollapsibleList_CollapsibleListSettings_Tab_Settings_Direction_Title")," ",React__default.default.createElement(wixRichContentUiComponents.InfoIcon,{tooltipText:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_Direction_Title_Tooltip")})),React__default.default.createElement(wixRichContentUiComponents.SelectionList,{theme:_this.styles,dataSource:[{value:directions_LTR,label:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_Direction_LTR"),icon:wixRichContentPluginCommons.LTRIcon,dataHook:"ltrDirection"},{value:directions_RTL,label:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_Direction_RTL"),icon:wixRichContentPluginCommons.RTLIcon,dataHook:"rtlDirection"}],renderItem:_this.renderOption,value:getDataManager().getDirection(),onChange:getDataManager().changeDirection,className:_this.styles.direction_selector,optionClassName:_this.styles.direction_selector_option}))};var _theme=props.theme;return _this.styles=wixRichContentCommon.mergeStyles({styles:styles$5,theme:_theme}),_this}return _inheritsLoose__default.default(CollapsibleListSettings,_Component),CollapsibleListSettings.prototype.render=function(){return React__default.default.createElement("div",{className:this.styles.settingsContainer},this.renderExpandOptions(),this.renderSeparator(),this.renderDirectionOptions())},CollapsibleListSettings}(React.Component),styles$4={collapsibleListModal:"_2gcEm",collapsibleListModalTitle:"_22bSm",collapsibleListModal_scrollContainer:"bpnq3",collapsibleListModal_mobile:"_1QgQS"},CollapsibleListModal=function(_Component){function CollapsibleListModal(props){var _this;(_this=_Component.call(this,props)||this).onComponentUpdate=function(){return _this.forceUpdate()},_this.revertComponentData=function(){var helpers=_this.props.helpers,initialComponentData=_this.state.initialComponentData;initialComponentData&&_this.getDataManager().updateData(initialComponentData),helpers.closeModal()},_this.onDoneClick=function(){_this.props.helpers.closeModal()},_this.getDataManager=function(){var pubsub=_this.props.pubsub;return new CollapsibleList(pubsub.store,pubsub.get("componentData"))},_this.renderDesktopHeader=function(){var t=_this.props.t;return React__default.default.createElement("h3",{className:_this.styles.collapsibleListModalTitle},t("CollapsibleList_CollapsibleListSettings_Common_Header"))},_this.renderMobileHeader=function(){var _this$props=_this.props,t=_this$props.t,theme=_this$props.theme;return React__default.default.createElement(wixRichContentUiComponents.SettingsMobileHeader,{t:t,theme:theme,onCancel:_this.revertComponentData,onSave:_this.onDoneClick})},_this.renderSettings=function(){var _classNames,_this$props2=_this.props,isMobile=_this$props2.isMobile,theme=_this$props2.theme,t=_this$props2.t;return React__default.default.createElement("div",{className:classNames__default.default(styles$4.collapsibleListModal_scrollContainer,(_classNames={},_classNames[styles$4.collapsibleListModal_mobile]=isMobile,_classNames))},React__default.default.createElement(CollapsibleListSettings,{getDataManager:_this.getDataManager,theme:theme,isMobile:isMobile,t:t}))},_this.renderDesktopFooterPanel=function(){var _this$props3=_this.props,theme=_this$props3.theme,t=_this$props3.t;return React__default.default.createElement(wixRichContentUiComponents.SettingsPanelFooter,{fixed:!0,theme:theme,cancel:_this.revertComponentData,save:_this.onDoneClick,t:t})},_this.state=_this.initState(props);var _theme=props.theme;return _this.styles=wixRichContentCommon.mergeStyles({styles:styles$4,theme:_theme}),_this}_inheritsLoose__default.default(CollapsibleListModal,_Component);var _proto=CollapsibleListModal.prototype;return _proto.initState=function(props){return{initialComponentData:props.pubsub.get("componentData")}},_proto.componentDidMount=function(){var pubsub=this.props.pubsub;pubsub.subscribe("componentData",this.onComponentUpdate),this.setState({initialComponentData:pubsub.get("componentData")})},_proto.componentWillUnmount=function(){this.props.pubsub.unsubscribe("componentData",this.onComponentUpdate)},_proto.render=function(){var _this$props4=this.props,isMobile=_this$props4.isMobile,languageDir=_this$props4.languageDir;return React__default.default.createElement("div",{className:this.styles.collapsibleListModal,"data-hook":"collapsibleListModal",dir:languageDir},isMobile?this.renderMobileHeader():this.renderDesktopHeader(),this.renderSettings(),!isMobile&&this.renderDesktopFooterPanel())},CollapsibleListModal}(React.Component),Modals={COLLAPSIBLE_LIST_MODAL:"collapsible-list-modal"},ModalsMap=((_ModalsMap={})[Modals.COLLAPSIBLE_LIST_MODAL]=CollapsibleListModal,_ModalsMap),modalStyles={customStyles:{overlay:{backgroundColor:"transparent"},content:{borderRadius:"2px",boxShadow:"0 4px 8px 0 rgba(0, 0, 0, 0.1)",border:"solid 1px rgba(255, 255, 255, 0.25)"}}},createInlineButtons=function(_ref){var t=_ref.t,disableKeyboardEvents=_ref.disableKeyboardEvents;return[{keyName:"settings",type:wixRichContentPluginCommons.BUTTONS.EXTERNAL_MODAL,fullHeight:!0,modalName:Modals.COLLAPSIBLE_LIST_MODAL,children:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_TabName"),modalStyles:wixRichContentEditorCommon.getModalStyles(modalStyles),t:t,mobile:!0,triggerSettingsBi:!0,pluginId:COLLAPSIBLE_LIST_TYPE},{keyName:"separator",mobile:!1,type:wixRichContentPluginCommons.BUTTONS.SEPARATOR},{keyName:"delete",type:wixRichContentPluginCommons.BUTTONS.DELETE,mobile:!0,beforeOnClickDelete:function(){null==disableKeyboardEvents||disableKeyboardEvents(!1)}}]},InsertPluginIcon=function(props){return React__default.default.createElement("svg",Object.assign({width:"19px",height:"12px",viewBox:"0 0 23 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React__default.default.createElement("g",{transform:"translate(-265.000000, -379.000000)",fill:"currentColor"},React__default.default.createElement("g",{transform:"translate(265.000000, 379.000000)"},React__default.default.createElement("path",{d:"M10,0.8 L22.6,0.8 C22.7104569,0.8 22.8,0.88954305 22.8,1 L22.8,1.6 C22.8,1.71045695 22.7104569,1.8 22.6,1.8 L10,1.8 C9.88954305,1.8 9.8,1.71045695 9.8,1.6 L9.8,1 C9.8,0.88954305 9.88954305,0.8 10,0.8 Z M10,5.8 L22.6,5.8 C22.7104569,5.8 22.8,5.88954305 22.8,6 L22.8,6.6 C22.8,6.71045695 22.7104569,6.8 22.6,6.8 L10,6.8 C9.88954305,6.8 9.8,6.71045695 9.8,6.6 L9.8,6 C9.8,5.88954305 9.88954305,5.8 10,5.8 Z M10,10.8 L22.6,10.8 C22.7104569,10.8 22.8,10.8895431 22.8,11 L22.8,11.6 C22.8,11.7104569 22.7104569,11.8 22.6,11.8 L10,11.8 C9.88954305,11.8 9.8,11.7104569 9.8,11.6 L9.8,11 C9.8,10.8895431 9.88954305,10.8 10,10.8 Z",fillRule:"nonzero"}),React__default.default.createElement("path",{d:"M2.61252587,5.04452587 C2.55011987,5.10656164 2.44933186,5.10656164 2.38692587,5.04452587 L2.04692587,4.70452587 C2.01688154,4.67451494 2,4.63379134 2,4.59132587 C2,4.54886039 2.01688154,4.50813679 2.04692587,4.47812587 L4.47972587,2.04532587 L2.04772587,-0.386674135 C2.01768154,-0.416685056 2.0008,-0.457408655 2.0008,-0.499874135 C2.0008,-0.542339615 2.01768154,-0.583063214 2.04772587,-0.613074135 L2.38692587,-0.953074135 C2.41693679,-0.983118462 2.45766039,-1 2.50012587,-1 C2.54259134,-1 2.58331494,-0.983118462 2.61332587,-0.953074135 L5.49812587,1.93172587 C5.52817019,1.96173679 5.54505173,2.00246039 5.54505173,2.04492587 C5.54505173,2.08739134 5.52817019,2.12811494 5.49812587,2.15812587 L2.61252587,5.04372587 L2.61252587,5.04452587 Z",transform:"translate(3.772526, 2.045526) rotate(-270.000000) translate(-3.772526, -2.045526) "})))))},ArrowIcon=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("g",{fillRule:"evenodd"},React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M11.999 9L6 14.241 6.657 15 11.999 10.334 17.343 15 18 14.241z",transform:"translate(-129 -185) translate(97 105) translate(23 71) rotate(-90 21 12) matrix(1 0 0 -1 0 24)"})))))))},PlusIcon=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("g",{fillRule:"evenodd"},React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M12.5 6v5.5H18v1h-5.5V18h-1v-5.5H6v-1h5.5V6h1z",transform:"translate(-129 -269) translate(97 105) translate(23 155) rotate(-90 21 12)"}))))))},DndIcon=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20"},props),React__default.default.createElement("g",{fillRule:"evenodd"},React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M5.37 7.083c-.684-.025-1.22-.596-1.203-1.28.017-.685.58-1.228 1.265-1.22.684.009 1.234.566 1.235 1.25-.014.704-.594 1.263-1.297 1.25zM5.37 2.5c-.684-.026-1.22-.597-1.203-1.28.017-.685.58-1.228 1.265-1.22.684.009 1.234.566 1.235 1.25-.014.703-.594 1.263-1.297 1.25zM5.463 9.167c.684.025 1.22.596 1.203 1.28-.017.685-.58 1.228-1.265 1.22-.684-.009-1.234-.566-1.234-1.25.014-.703.594-1.262 1.296-1.25zM1.203 7.083C.52 7.058-.017 6.487 0 5.803c.017-.685.581-1.228 1.265-1.22.685.009 1.235.566 1.235 1.25-.013.704-.594 1.263-1.297 1.25zM1.203 2.5C.52 2.474-.017 1.903 0 1.22.017.534.581-.009 1.265 0 1.95.01 2.5.566 2.5 1.25c-.013.703-.594 1.263-1.297 1.25zM1.297 9.167c.683.025 1.22.596 1.203 1.28-.017.685-.581 1.228-1.265 1.22C.55 11.658 0 11.1 0 10.417c.015-.703.594-1.262 1.297-1.25z",transform:"translate(-99 -190) translate(99 176) translate(0 14) translate(6.667 4.167)"})))))))},styles$3={ltr:"E6y_Z",rtl:"_2wLEl",iconContainer:"_21s0b",icon:"_2z8L4",isExpanded:"aPvla"};function ExpandCollapseButton(props){var onClick=props.onClick,idx=props.idx,ariaLabel=props.ariaLabel;return React__default.default.createElement("div",{role:"button",tabIndex:"-1",className:styles$3.iconContainer,onClick:onClick,onKeyUp:function(e){return(" "===e.key||"Enter"===e.key)&&onClick(e)},"data-hook":"ExpandCollapseButton_"+idx},React__default.default.createElement(ArrowIcon,{role:"button",tabIndex:"0","aria-label":ariaLabel,className:classNames__default.default(styles$3.icon,props.isExpanded&&styles$3.isExpanded)}))}var styles$2={titleContainer:"_3LwlN",title:"_3CwVy",content:"_3TxVS"},CollapsibleListPair=function(_Component){function CollapsibleListPair(props){var _this;(_this=_Component.call(this,props)||this).focusTitle=function(){var _this$titleEditorRef$;return null===(_this$titleEditorRef$=_this.titleEditorRef.current)||void 0===_this$titleEditorRef$?void 0:_this$titleEditorRef$.focus()},_this.renderTitle=function(){var _this$props=_this.props,idx=_this$props.idx,renderTitle=_this$props.renderTitle;return React__default.default.createElement("div",{className:_this.styles.title},renderTitle(idx,_this.titleEditorRef))},_this.focusContent=function(){var _this$contentEditorRe;return null===(_this$contentEditorRe=_this.contentEditorRef.current)||void 0===_this$contentEditorRe?void 0:_this$contentEditorRe.focus()},_this.renderContent=function(){var _this$props2=_this.props,idx=_this$props2.idx,renderContent=_this$props2.renderContent;return _this$props2.isExpanded&&React__default.default.createElement("div",{className:_this.styles.content},renderContent(idx,_this.contentEditorRef))},_this.onClick=function(e){var _helpers$onViewerActi,_this$props3=_this.props,isExpanded=_this$props3.isExpanded,onCollapseClick=_this$props3.onCollapseClick,onExpandClick=_this$props3.onExpandClick,idx=_this$props3.idx,helpers=_this$props3.helpers,isInEditor=_this$props3.isInEditor;isExpanded?onCollapseClick(idx):onExpandClick(idx),null===(_helpers$onViewerActi=helpers.onViewerAction)||void 0===_helpers$onViewerActi||_helpers$onViewerActi.call(helpers,COLLAPSIBLE_LIST_TYPE,"Click",isExpanded?"collapse":"expand"),isInEditor||(e.preventDefault(),setTimeout((function(){return wixRichContentCommon.anchorScroll(_this.pairRef,_this.context.experiments)})))},_this.onKeyDown=function(e){"a"===e.key&&(e.ctrlKey||e.metaKey)&&e.stopPropagation()};var theme=props.theme;return _this.styles=wixRichContentCommon.mergeStyles({styles:styles$2,theme:theme}),_this.titleEditorRef=React__default.default.createRef(),_this.contentEditorRef=React__default.default.createRef(),_this.pairRef=React__default.default.createRef(),_this}return _inheritsLoose__default.default(CollapsibleListPair,_Component),CollapsibleListPair.prototype.render=function(){var _this2=this,_this$props4=this.props,isExpanded=_this$props4.isExpanded,idx=_this$props4.idx,t=_this$props4.t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:this.styles.titleContainer,onKeyDown:this.onKeyDown,ref:function(_ref){return _this2.pairRef=_ref}},React__default.default.createElement(ExpandCollapseButton,{isExpanded:isExpanded,onClick:this.onClick,idx:idx,ariaLabel:t(isExpanded?"CollapsibleListPlugin_ExpandButton_AriaLabel":"CollapsibleListPlugin_CollapseButton_AriaLabel")}),this.renderTitle()),this.renderContent())},CollapsibleListPair}(React.Component);CollapsibleListPair.contextType=wixRichContentCommon.GlobalContext;var getPairsAllCollpased=function(pairs){return pairs.map((function(){return!1}))},getDefaultPairsState=function(pairs,defaultPairsExpandState){var pairsState="expanded"===defaultPairsExpandState?function(pairs){return pairs.map((function(){return!0}))}(pairs):getPairsAllCollpased(pairs);return"first_expanded"===defaultPairsExpandState&&(pairsState[0]=!0),pairsState},CollapsibleListPairs=function(_Component){function CollapsibleListPairs(props){var _this;return(_this=_Component.call(this,props)||this).focusPair=function(_ref){var idx=_ref.idx,isTitle=_ref.isTitle,pair=_this.pairsRefs[idx];isTitle?null==pair||pair.focusTitle():(null==pair?void 0:pair.focusContent())||null==pair||pair.focusTitle()},_this.expandPair=function(idx){var _this$props=_this.props,pairs=_this$props.pairs,expandOnlyOne=_this$props.expandOnlyOne,pairsState=_this.state.pairsState;expandOnlyOne&&(pairsState=getPairsAllCollpased(pairs)),pairsState[idx]=!0,_this.setState({pairsState:pairsState})},_this.collapsePair=function(idx){var pairsState=[].concat(_this.state.pairsState);pairsState[idx]=!1,_this.setState({pairsState:pairsState})},_this.insertNewPair=function(){var expandOnlyOne=_this.state.expandOnlyOne,pairsState=_this.state.pairsState;expandOnlyOne&&(pairsState=getPairsAllCollpased(pairsState)),pairsState=[].concat(pairsState,[!0]),_this.setState({pairsState:pairsState})},_this.deletePair=function(idx){var pairsState=_this.state.pairsState;pairsState.splice(idx,1),_this.setState({pairsState:pairsState})},_this.reorderPairs=function(startIdx,endIdx){var pairsState=_this.state.pairsState,pairToMove=pairsState.splice(startIdx,1)[0];pairsState.splice(endIdx,0,pairToMove),_this.setState({pairsState:pairsState})},_this.pairsRefs=[],_this.state=_this.initState(props),_this}_inheritsLoose__default.default(CollapsibleListPairs,_Component);var _proto=CollapsibleListPairs.prototype;return _proto.initState=function(props){var pairs=props.pairs,expandState=props.expandState;return{defaultPairsExpandState:expandState,expandOnlyOne:props.expandOnlyOne,pairsState:getDefaultPairsState(pairs,expandState)}},CollapsibleListPairs.getDerivedStateFromProps=function(props,state){var pairs=props.pairs,expandState=props.expandState,expandOnlyOne=props.expandOnlyOne;return state.defaultPairsExpandState!==expandState||expandOnlyOne&&expandOnlyOne!==state.expandOnlyOne?{defaultPairsExpandState:expandState,expandOnlyOne:expandOnlyOne,pairsState:getDefaultPairsState(pairs,expandState)}:null},_proto.render=function(){var _this2=this,_this$props2=this.props,pairs=_this$props2.pairs,PairWrapper=_this$props2.PairWrapper,t=_this$props2.t,theme=_this$props2.theme,renderTitle=_this$props2.renderTitle,renderContent=_this$props2.renderContent,helpers=_this$props2.helpers,isInEditor=_this$props2.isInEditor,pairsState=this.state.pairsState;return pairs.map((function(pair,idx){return React__default.default.createElement(PairWrapper,{key:pair.key,id:pair.key,index:idx},React__default.default.createElement(CollapsibleListPair,{ref:function(_ref2){return _this2.pairsRefs[idx]=_ref2},t:t,key:pair.key,idx:idx,isExpanded:pairsState[idx],onCollapseClick:_this2.collapsePair,onExpandClick:_this2.expandPair,theme:theme,renderTitle:renderTitle,renderContent:renderContent,helpers:helpers,isInEditor:isInEditor}))}))},CollapsibleListPairs}(React.Component);CollapsibleListPairs.defaultProps={PairWrapper:"div"};var styles$1_new_pair_container="_1AgMx",styles$1_new_pair_button="_1Zqb4",styles$1_new_pair_label="_3iSqB";function NewPairButton(props){return React__default.default.createElement("div",{role:"button",tabIndex:"0",className:styles$1_new_pair_container,onClick:props.onClick,onKeyPress:function(e){return("Enter"===e.key||" "===e.key)&&props.onClick(e)},"data-hook":"CollapsibleListNewPair_button"},React__default.default.createElement("div",{className:styles$1_new_pair_button},React__default.default.createElement(PlusIcon,null),React__default.default.createElement("label",{className:styles$1_new_pair_label},props.label)))}var styles_dndIcon="hDgGn";function DndHandle(props){return React__default.default.createElement("div",_extends__default.default({className:styles_dndIcon},props.dragHandleProps),React__default.default.createElement(DndIcon,null))}var CollapsibleListComponent=function(_React$Component){function CollapsibleListComponent(_props){var _this,_this2=this;(_this=_React$Component.call(this,_props)||this).focusPair=function(pair){return setTimeout((function(){_this.collapsibleListRef.current.focusPair(pair)}))},_this.expandPair=function(idx){return _this.collapsibleListRef.current.expandPair(idx)},_this.focusTitle=function(idx){var pair={idx:idx,isTitle:!0};_this.focusPair(pair)},_this.focusContent=function(idx){var pair={idx:idx,isTitle:!1};_this.focusPair(pair)},_this.onTitleBackspace=function(idx){_this.getDataManager().getPairs().length>1&&(_this.getDataManager().deletePair(idx),_this.collapsibleListRef.current.deletePair(idx),0===idx?_this.focusTitle(idx):_this.focusContent(idx-1))},_this.renderTitle=function(idx,setRef){return React__default.default.createElement(_this2.renderInput,{value:_this.getDataManager().getTitle(idx),setRef:setRef,onChange:function(val){return _this.getDataManager().setTitle(idx,val)},placeholder:_this.titlePlaceholder,onBackspaceAtBeginningOfContent:function(){return _this.onTitleBackspace(idx)},handleReturn:_this.handleTitleReturn(idx),toolbarsToIgnore:["SideToolbar"]})},_this.renderContent=function(idx,setRef){return React__default.default.createElement(_this2.renderInput,{value:_this.getDataManager().getContent(idx),setRef:setRef,onChange:function(val){return _this.getDataManager().setContent(idx,val)},placeholder:_this.contentPlaceholder,onBackspaceAtBeginningOfContent:function(){return _this.focusTitle(idx)}})},_this.renderInput=function(_ref){var value=_ref.value,setRef=_ref.setRef,onChange=_ref.onChange,placeholder=_ref.placeholder,onBackspaceAtBeginningOfContent=_ref.onBackspaceAtBeginningOfContent,handleReturn=_ref.handleReturn,toolbarsToIgnore=_ref.toolbarsToIgnore,renderInnerRCE=_this.props.renderInnerRCE,direction=_this.getDataManager().getDirection();return renderInnerRCE({editorState:value,setRef:setRef,onChange:onChange,renderedIn:COLLAPSIBLE_LIST_TYPE,onBackspaceAtBeginningOfContent:onBackspaceAtBeginningOfContent,direction:direction,additionalProps:{textAlignment:"ltr"===direction?"left":"right",placeholder:placeholder,handleReturn:handleReturn},toolbarsToIgnore:toolbarsToIgnore,onFocus:function(){return _this.props.disableKeyboardEvents(!0)},onBlur:function(){return _this.props.disableKeyboardEvents(!1)}})},_this.handleTitleReturn=function(idx){return function(){return function(){return _this.expandPair(idx),_this.focusContent(idx),"handled"}}},_this.onNewPairButtonClick=function(){var newPairIdx=_this.getDataManager().getPairs().length;_this.getDataManager().insertNewPair(),_this.collapsibleListRef.current.insertNewPair(),_this.focusTitle(newPairIdx)},_this.onDragEnd=function(result){result.destination&&result.source.index!==result.destination.index&&(_this.getDataManager().reorderPairs(result.source.index,result.destination.index),_this.collapsibleListRef.current.reorderPairs(result.source.index,result.destination.index))},_this.getDataManager=function(props){var _ref2=props||_this.props,store=_ref2.store,componentData=_ref2.componentData;return new CollapsibleList(store,componentData)},_this.PairWrapper=function(_ref3){var id=_ref3.id,index=_ref3.index,children=_ref3.children,_this$props=_this.props,isMobile=_this$props.isMobile,blockProps=_this$props.blockProps,isDragDisabled=isMobile||!blockProps.isFocused;return React__default.default.createElement(reactBeautifulDnd.Draggable,{key:id,draggableId:id,index:index,isDragDisabled:isDragDisabled},(function(provided){return React__default.default.createElement("div",_extends__default.default({ref:provided.innerRef},provided.draggableProps),!isDragDisabled&&React__default.default.createElement(DndHandle,{dragHandleProps:provided.dragHandleProps}),children)}))},_this.onFocus=function(e){return e.stopPropagation()};var theme=_props.theme,t=_props.t;return _this.styles=wixRichContentCommon.mergeStyles({styles:styles$3,theme:theme}),_this.titlePlaceholder=t("CollapsibleList_ShownText_Placeholder"),_this.contentPlaceholder=t("CollapsibleList_CollapsedText_Placeholder"),_this.addNewPairLabel=t("CollapsibleList_ShownText_Add_Placeholder"),_this.collapsibleListRef=React__default.default.createRef(),_this}return _inheritsLoose__default.default(CollapsibleListComponent,_React$Component),CollapsibleListComponent.prototype.render=function(){var _this3=this,_this$props2=this.props,blockProps=_this$props2.blockProps,theme=_this$props2.theme,t=_this$props2.t,isMobile=_this$props2.isMobile,helpers=_this$props2.helpers,pairs=this.getDataManager().getPairs(),expandState=this.getDataManager().getExpandState(),expandOnlyOne=this.getDataManager().getExpandOnlyOne(),direction=this.getDataManager().getDirection();return React__default.default.createElement("div",{className:this.styles[direction],onFocus:this.onFocus,tabIndex:"0","data-hook":"collapsibleListComponent"},React__default.default.createElement(reactBeautifulDnd.DragDropContext,{onDragEnd:this.onDragEnd},React__default.default.createElement(reactBeautifulDnd.Droppable,{droppableId:"droppable"},(function(provided){return React__default.default.createElement("div",_extends__default.default({},provided.droppableProps,{ref:provided.innerRef}),React__default.default.createElement(CollapsibleListPairs,{ref:_this3.collapsibleListRef,theme:theme,t:t,isMobile:isMobile,pairs:pairs,expandState:expandState,expandOnlyOne:expandOnlyOne,renderTitle:_this3.renderTitle,renderContent:_this3.renderContent,PairWrapper:_this3.PairWrapper,helpers:helpers,isInEditor:!0}),provided.placeholder)}))),blockProps.isFocused&&React__default.default.createElement(NewPairButton,{label:this.addNewPairLabel,onClick:this.onNewPairButtonClick}))},CollapsibleListComponent}(React__default.default.Component),createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,t=_ref.t,settings=_ref.settings,locale=_ref.locale,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,componentData=_extends__default.default({},DEFAULTS,{config:_extends__default.default({},DEFAULTS.config,{direction:wixRichContentCommon.isRtl(locale)?directions_RTL:directions_LTR})});return[{type:wixRichContentEditorCommon.BUTTON_TYPES.BUTTON,name:wixRichContentEditorCommon.INSERT_PLUGIN_BUTTONS.COLLAPSIBLE_LIST,getLabel:function(){return t("CollapsibleList_InsertButton")},tooltip:t("CollapsibleListPlugin_InsertButton_Tooltip"),getIcon:function(){return icon},isActive:function(){return!1},isDisabled:function(){return!1},componentData:componentData,toolbars:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN,wixRichContentEditorCommon.TOOLBARS.MOBILE,wixRichContentEditorCommon.TOOLBARS.FOOTER,wixRichContentEditorCommon.TOOLBARS.SIDE],section:"BlockToolbar_Section_Advanced"}]},createToolbar=function(_ref){var t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,locale=_ref.locale,disableKeyboardEvents=_ref.disableKeyboardEvents;return{InlineButtons:createInlineButtons({t:t,disableKeyboardEvents:disableKeyboardEvents}),InsertButtons:createInsertButtons({t:t,settings:settings,isMobile:isMobile,locale:locale}),name:COLLAPSIBLE_LIST_TYPE}};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)}var createCollapsibleListPlugin=function(config){var localeContent=config.localeContent,locale=config.locale,helpers=config.helpers,t=config.t,_config$COLLAPSIBLE_L=config[COLLAPSIBLE_LIST_TYPE],settings=void 0===_config$COLLAPSIBLE_L?{}:_config$COLLAPSIBLE_L,isMobile=config.isMobile,disableKeyboardEvents=config.disableKeyboardEvents,rest=_objectWithoutPropertiesLoose__default.default(config,["localeContent","locale","helpers","t",COLLAPSIBLE_LIST_TYPE,"isMobile","disableKeyboardEvents"].map(_toPropertyKey));return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({component:CollapsibleListComponent,type:COLLAPSIBLE_LIST_TYPE,toolbar:createToolbar({helpers:helpers,t:t,settings:settings,isMobile:isMobile,locale:localeContent||locale,disableKeyboardEvents:disableKeyboardEvents}),helpers:helpers,settings:settings,t:t,isMobile:isMobile,defaultPluginData:DEFAULTS,noPluginBorder:!0,noPointerEventsOnFocus:!0,locale:localeContent||locale,disableKeyboardEvents:disableKeyboardEvents},rest))};createCollapsibleListPlugin.functionName=COLLAPSIBLE_LIST_TYPE;var CollapsibleListViewer=function(_Component){function CollapsibleListViewer(props){var _this;(_this=_Component.call(this,props)||this).getPair=function(idx){return _this.props.componentData.pairs[idx]},_this.renderInnerRCV=function(contentState){var _this$props=_this.props,innerRCV=_this$props.innerRCV,componentData=_this$props.componentData;return innerRCV({contentState:contentState,textAlignment:function(componentData){return"ltr"===componentData.config.direction?"left":"right"}(componentData),direction:function(componentData){return componentData.config.direction}(componentData)})},_this.renderTitle=function(idx){var pair=_this.getPair(idx);return _this.renderInnerRCV(pair.title)},_this.renderContent=function(idx){var pair=_this.getPair(idx);return _this.renderInnerRCV(pair.content)};var theme=props.theme;return _this.styles=wixRichContentCommon.mergeStyles({styles:styles$3,theme:theme}),_this}return _inheritsLoose__default.default(CollapsibleListViewer,_Component),CollapsibleListViewer.prototype.render=function(){var _this$props2=this.props,theme=_this$props2.theme,t=_this$props2.t,componentData=_this$props2.componentData,isMobile=_this$props2.isMobile,helpers=_this$props2.helpers,config=componentData.config,pairs=componentData.pairs,direction=config.direction,expandState=config.expandState,expandOnlyOne=config.expandOnlyOne;return React__default.default.createElement("div",{className:this.styles[direction]},React__default.default.createElement(CollapsibleListPairs,{theme:theme,t:t,isMobile:isMobile,pairs:pairs,expandState:expandState,expandOnlyOne:expandOnlyOne,renderTitle:this.renderTitle,renderContent:this.renderContent,helpers:helpers}))},CollapsibleListViewer}(React.Component);exports.COLLAPSIBLE_LIST_TYPE=COLLAPSIBLE_LIST_TYPE,exports.Modals=Modals,exports.ModalsMap=ModalsMap,exports.collapsibleListViewer=CollapsibleListViewer,exports.createCollapsibleListPlugin=createCollapsibleListPlugin,exports.pluginCollapsibleList=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:COLLAPSIBLE_LIST_TYPE,createPlugin:createCollapsibleListPlugin,ModalsMap:ModalsMap}};
"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"),React=require("react"),_assertThisInitialized=require("@babel/runtime/helpers/assertThisInitialized"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),classNames=require("classnames"),wixRichContentUiComponents=require("wix-rich-content-ui-components"),wixRichContentCommon=require("wix-rich-content-common"),lodash=require("lodash"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),pluginHtmlSchema=require("wix-rich-content-common/dist/statics/schemas/plugin-html.schema.json"),toDraftData=require("ricos-content/libs/toDraftData");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _VALIDATORS,_NORMALIZERS,_TOOLTIP_TEXT_BY_SRC_,_extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),React__default=_interopDefaultLegacy(React),_assertThisInitialized__default=_interopDefaultLegacy(_assertThisInitialized),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),classNames__default=_interopDefaultLegacy(classNames),pluginHtmlSchema__default=_interopDefaultLegacy(pluginHtmlSchema),EditIcon=function(props){return React__default.default.createElement("svg",Object.assign({width:19,viewBox:"0 0 19 19"},props),React__default.default.createElement("path",{d:"M11.498 5.326L3 13.8V16h2.2l8.486-8.486-2.188-2.188zm.688-.687l2.199 2.176L16 5.2 13.83 3l-1.644 1.64zM2 13.523a.2.2 0 0 1 .059-.141l11.1-11.1a1 1 0 0 1 1.414 0l2.146 2.145a1 1 0 0 1 0 1.414l-11.1 11.1a.2.2 0 0 1-.142.059H2.2a.2.2 0 0 1-.2-.2v-3.277zM5 4h1.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H5v1.8a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V5H2.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2H4V2.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2V4z"}))},InsertPluginIcon=function(props){return React__default.default.createElement("svg",Object.assign({viewBox:"0 0 19 19",width:"19",height:"19"},props),React__default.default.createElement("path",{d:"M4.889 5L1 8.89l3.889 3.888.707-.708-3.182-3.18 3.182-3.184zm8.818 7.779l3.89-3.89L13.706 5 13 5.708l3.182 3.181L13 12.072z"}),React__default.default.createElement("path",{stroke:"currentColor",d:"M11.948 2L7 15.978"}))},Adsense=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"24",viewBox:"0 0 24 24"},props),React__default.default.createElement("g",{fillRule:"evenodd"},React__default.default.createElement("path",{d:"M17.764 0c.277 0 .5.224.5.5 0 .075-.016.149-.049.216l-2.767 5.767L8.702 20.99 8.7 20.99l-.199.431c-.163.354-.518.58-.907.58H.5c-.276 0-.5-.224-.5-.5 0-.078.018-.154.053-.224l1.593-3.187L7.618 5.283l-.04.028L9.768.58c.163-.354.518-.58.907-.58h7.09zM20.848 11c.276 0 .5.224.5.5 0 .076-.017.15-.05.218l-1.505 3.099-2.814 6.034-.262.57c-.164.353-.518.579-.907.579h-4.687v-.001L9.691 22l1.644-3.469L14.845 11h6.003z",transform:"translate(1 1)"})))},DEFAULTS_CONFIG={alignment:"center"},htmlButtonsTypes={html:"html",adsense:"adsense"},defaults=function(isAdsense){return{srcType:"html",src:"",config:_extends__default.default({},DEFAULTS_CONFIG,isAdsense&&{isAdsense:isAdsense})}},styles$2_container="_2rikd",styles$2_tooltip="_2JU9j",AdsenseTitle=function(_ref){var t=_ref.t;return React__default.default.createElement("div",{className:styles$2_container},t("HtmlEditPanel_HtmlInput_AdSense_Title"),React__default.default.createElement("div",{className:styles$2_tooltip},React__default.default.createElement(wixRichContentUiComponents.InfoIcon,{tooltipText:t("HtmlEditPanel_HtmlInput_AdSense_Tooltip")})))},styles$1={fontElementMap:"tBbsp",htmlEditPanel_button:"l7Urd",htmlEditPanel:"_1Whgf",htmlEditPanel_input:"_1vXv2",htmlEditPanel_textArea:"_33T-k",htmlEditPanel_buttons:"_3W4Az",htmlEditPanel_primaryButton:"RVO-5",htmlEditPanel_secondaryButton:"_1zKYg"},VALIDATORS=((_VALIDATORS={}).html=function(){return null},_VALIDATORS.url=function(url){var error=null;return url&&wixRichContentCommon.isValidUrl(url)?!wixRichContentCommon.startsWithHttps(url)&&wixRichContentCommon.hasProtocol(url)&&(error="HtmlEditPanel_HttpsError"):error="HtmlEditPanel_UrlError",error},_VALIDATORS),NORMALIZERS=((_NORMALIZERS={}).html=lodash.identity,_NORMALIZERS.url=function(url){return wixRichContentCommon.hasProtocol(url)?url:"https://"+lodash.trimStart(url,"//")},_NORMALIZERS),HtmlEditPanel=function(_Component){function HtmlEditPanel(){for(var _this$state,_this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).initialData=_this.props.componentData,_this.styles=wixRichContentCommon.mergeStyles({styles:styles$1,theme:_this.props.theme}),_this.state=((_this$state={srcType:_this.initialData.srcType})[_this.initialData.srcType]=_this.initialData.src,_this$state.submitted=!1,_this$state),_this.handleSrcTypeChange=function(srcType){_this.setState({srcType:srcType})},_this.handleSrcChange=function(target){var _this$setState,name=target.name,value=target.value;_this.setState(((_this$setState={})[name]=value,_this$setState),(function(){return _this.updateComponentData()}))},_this.handleCancelClick=function(){_this.props.store.update("componentData",_this.initialData),_this.props.close()},_this.updateComponentData=function(){var srcType=_this.state.srcType;_this.isValid()&&_this.props.store.update("componentData",{srcType:srcType,src:NORMALIZERS[srcType](_this.state[srcType])||""}),_this.setState({submitted:!0})},_this.getError=function(){var srcType=_this.state.srcType;return VALIDATORS[srcType](_this.state[srcType])},_this.isValid=function(){return!_this.getError()},_this.render=function(){var styles=_assertThisInitialized__default.default(_this).styles,_this$state2=_this.state,srcType=_this$state2.srcType,submitted=_this$state2.submitted,_this$props=_this.props,t=_this$props.t,tabIndex=_this$props.tabIndex,theme=_this$props.theme,config=_this$props.componentData.config,inputBaseProps={onChange:_this.handleSrcChange,getTarget:!0,tabIndex:tabIndex,theme:theme};return React__default.default.createElement("div",{className:styles.htmlEditPanel},null!=config&&config.isAdsense?React__default.default.createElement(AdsenseTitle,{t:t}):React__default.default.createElement(wixRichContentUiComponents.RadioGroupHorizontal,{theme:theme,name:"srcType",value:_this.state.srcType,onChange:_this.handleSrcTypeChange,dataSource:[{value:"html",labelText:t("HtmlEditPanel_Code"),dataHook:"htmlEditPanel_radioHtml"},{value:"url",labelText:t("HtmlEditPanel_Source"),dataHook:"htmlEditPanel_radioUrl"}],inline:!0}),React__default.default.createElement("div",{className:styles.htmlEditPanel_input},"html"===srcType&&React__default.default.createElement("div",{className:styles.htmlEditPanel_textArea},React__default.default.createElement(wixRichContentUiComponents.InputWithLabel,_extends__default.default({name:"html",value:_this.state.html,placeholder:null!=config&&config.isAdsense?t("HtmlEditPanel_HtmlInput_AdSense_Placeholder"):t("HtmlEditPanel_HtmlInput_Placeholder"),isTextArea:!0,isFullHeight:!0,dataHook:"htmlEditPanel_htmlInput"},inputBaseProps))),"url"===srcType&&React__default.default.createElement(wixRichContentUiComponents.TextInput,_extends__default.default({name:"url",value:_this.state.url,"data-hook":"htmlEditPanel_htmlInput",error:submitted?t(_this.getError()):null,placeholder:t("HtmlEditPanel_UrlInput_Placeholder")},inputBaseProps))),React__default.default.createElement("div",{className:styles.htmlEditPanel_buttons},React__default.default.createElement("button",{className:classNames__default.default(styles.htmlEditPanel_button,styles.htmlEditPanel_secondaryButton),onClick:_this.handleCancelClick,"data-hook":"htmlEditPanel_Cancel"},t("HtmlEditPanel_Cancel")),React__default.default.createElement("button",{className:classNames__default.default(styles.htmlEditPanel_button,styles.htmlEditPanel_primaryButton),onClick:_this.props.close,"data-hook":"htmlEditPanel_Update"},t("HtmlEditPanel_Update"))))},_this}return _inheritsLoose__default.default(HtmlEditPanel,_Component),HtmlEditPanel}(React.Component),getAlignmentButtonPropsFn=function(getEditorBounds){return function(_ref){var _componentData$config,componentData=_ref.componentData,editorBounds=null==getEditorBounds?void 0:getEditorBounds(),maxAlignmentWidth=editorBounds?editorBounds.width-1:739;return{disabled:((null==componentData||null===(_componentData$config=componentData.config)||void 0===_componentData$config?void 0:_componentData$config.width)||0)>maxAlignmentWidth}}},TOOLTIP_TEXT_BY_SRC_TYPE=((_TOOLTIP_TEXT_BY_SRC_={}).html="HtmlPlugin_EditHtml_Tooltip",_TOOLTIP_TEXT_BY_SRC_.url="HtmlPlugin_EditUrl_Tooltip",_TOOLTIP_TEXT_BY_SRC_),createInlineButtons=function(_ref2){var _settings$toolbar,_ref2$settings=_ref2.settings,settings=void 0===_ref2$settings?{}:_ref2$settings,getEditorBounds=_ref2.getEditorBounds,maxWidth=settings.maxWidth,_settings$minWidth=settings.minWidth,minWidth=void 0===_settings$minWidth?35:_settings$minWidth,_settings$maxHeight=settings.maxHeight,maxHeight=void 0===_settings$maxHeight?1200:_settings$maxHeight,_settings$minHeight=settings.minHeight,minHeight=void 0===_settings$minHeight?35:_settings$minHeight,icons=(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar?void 0:_settings$toolbar.icons)||{};return[{type:wixRichContentPluginCommons.BUTTONS.INLINE_PANEL,keyName:"edit",panelContent:wixRichContentCommon.translate()(HtmlEditPanel),icon:icons.edit||EditIcon,mapComponentDataToButtonProps:function(_ref3){var src=_ref3.src,srcType=_ref3.srcType;return{tooltipTextKey:src?TOOLTIP_TEXT_BY_SRC_TYPE[srcType]:"HtmlPlugin_EditEmpty_Tooltip"}}},{type:wixRichContentPluginCommons.BUTTONS.SEPARATOR,keyName:"separator1"},{type:wixRichContentPluginCommons.BUTTONS.WIDTH,getEditorBounds:getEditorBounds,keyName:"width",min:minWidth,mapStoreDataToPanelProps:function(){var bounds=getEditorBounds();return bounds&&bounds.width?{max:maxWidth?Math.min(maxWidth,bounds.width):bounds.width}:{max:maxWidth||940}}},{type:wixRichContentPluginCommons.BUTTONS.HEIGHT,keyName:"height",min:minHeight,max:maxHeight,inputMax:9999},{type:wixRichContentPluginCommons.BUTTONS.SEPARATOR,keyName:"separator2"},{type:wixRichContentPluginCommons.BUTTONS.TEXT_ALIGN_LEFT,keyName:"alignLeft",icon:icons.alignLeft||wixRichContentPluginCommons.SizeSmallLeftIcon,mapStoreDataToButtonProps:getAlignmentButtonPropsFn(getEditorBounds)},{type:wixRichContentPluginCommons.BUTTONS.TEXT_ALIGN_CENTER,keyName:"alignCenter",icon:icons.alignCenter||wixRichContentPluginCommons.SizeSmallCenterIcon},{type:wixRichContentPluginCommons.BUTTONS.TEXT_ALIGN_RIGHT,keyName:"alignRight",icon:icons.alignRight||wixRichContentPluginCommons.SizeSmallRightIcon,mapStoreDataToButtonProps:getAlignmentButtonPropsFn(getEditorBounds)},{type:wixRichContentPluginCommons.BUTTONS.SEPARATOR,keyName:"separator3"},{type:wixRichContentPluginCommons.BUTTONS.DELETE,keyName:"delete",mobile:!0}]},createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,_buttonsMap,helpers=_ref.helpers,t=_ref.t,settings=_ref.settings,_settings$exposeButto=settings.exposeButtons,exposeButtons=void 0===_settings$exposeButto?[htmlButtonsTypes.html]:_settings$exposeButto,siteDomain=settings.siteDomain,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,index=exposeButtons.indexOf(htmlButtonsTypes.adsense);!siteDomain&&index>-1&&exposeButtons.splice(index,1);var buttonsMap=((_buttonsMap={})[htmlButtonsTypes.html]={type:wixRichContentEditorCommon.BUTTON_TYPES.BUTTON,name:wixRichContentEditorCommon.INSERT_PLUGIN_BUTTONS.HTML,helpers:helpers,toolbars:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN,wixRichContentEditorCommon.TOOLBARS.MOBILE,wixRichContentEditorCommon.TOOLBARS.FOOTER,wixRichContentEditorCommon.TOOLBARS.SIDE],tooltip:t("HtmlPlugin_InsertButton_Tooltip"),getIcon:function(){return icon},componentData:defaults(!1)},_buttonsMap[htmlButtonsTypes.adsense]={type:wixRichContentEditorCommon.BUTTON_TYPES.BUTTON,name:wixRichContentEditorCommon.INSERT_PLUGIN_BUTTONS.ADSENSE,componentData:defaults(!0),helpers:helpers,toolbars:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN,wixRichContentEditorCommon.TOOLBARS.MOBILE,wixRichContentEditorCommon.TOOLBARS.FOOTER,wixRichContentEditorCommon.TOOLBARS.SIDE],section:"BlockToolbar_Section_Embed_Anywhere",tooltip:t("AdSensePlugin_InsertButton_Tooltip"),getIcon:function(){return Adsense}},_buttonsMap);return exposeButtons.map((function(buttonType){return buttonsMap[buttonType]}))},createToolbar=function(_ref){var helpers=_ref.helpers,t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,getEditorBounds=_ref.getEditorBounds;return{InlineButtons:createInlineButtons({settings:settings,getEditorBounds:getEditorBounds}),InsertButtons:isMobile?[]:createInsertButtons({helpers:helpers,t:t,settings:settings}),name:"html"}},htmlIframeSrc="\n <head>\n <style type=\"text/css\">\n iframe[class|='instagram'],\n blockquote[class|='instagram'] {\n /* fallback script for ios below */\n min-width: 0 !important;\n width: calc(100vw - 2px);\n }\n\n body {\n margin: 0;\n max-width: calc(100vw);\n display: inline-block;\n float: left;\n width: 100%;\n box-sizing: border-box;\n }\n body > iframe {\n margin: 0 !important;\n width: calc(100vw - 2px) !important;\n }\n body::before,\n body::after {\n content: '.';\n height: 0;\n margin: 0;\n overflow: hidden;\n visibility: hidden;\n display: block;\n clear: both;\n }\n </style>\n <script>\n var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n (function fixInstagramWidth() {\n // This is a fallback for the styles above. Because inline styles can't be overridden in ios.\n var callback = function() {\n try {\n if (document.body.firstChild.className.indexOf('instagram') >= 0) {\n document.body.firstChild.style.minWidth = '0';\n document.body.firstChild.style.width = 'calc(100vw - 2px)';\n }\n } catch (e) {}\n };\n\n var observer = new MutationObserver(callback);\n\n observer.observe(document, {\n childList: true,\n subtree: true,\n });\n })();\n\n function initSendHeight(id) {\n /**\n * Handle image load by triggering a resize\n */\n function imageLoaded(event) {\n if (!event || event.type !== 'load') {\n return;\n }\n\n var img = event.srcElement;\n // Remove image from loading stack\n var imageIndex = images.indexOf(img);\n if (imageIndex !== -1) {\n images.splice(imageIndex, 1);\n }\n\n handleResize();\n }\n\n /**\n * Add 'load' event listener and store reference to image\n * @param {elm} img Image being loaded\n */\n var images = [];\n function addImage(img) {\n if (images.indexOf(img) === -1) {\n img.addEventListener('load', imageLoaded);\n images.push(img);\n }\n }\n\n /**\n * Filter out images in the DOM that haven't loaded yet and add listener\n */\n function addImageLoadListeners() {\n var imgs = document.querySelectorAll('img');\n for (var i = 0; i < imgs.length; i++) {\n var image = imgs[i];\n // Do nothing if image is already loaded\n if (\n image.nodeName === 'IMG' &&\n image.src &&\n image.complete === false &&\n image.readyState !== 4\n ) {\n addImage(image);\n }\n }\n }\n\n function getHeight() {\n var height = parseInt(document.body.offsetHeight, 10);\n var styles = document.defaultView.getComputedStyle(document.body);\n height += parseInt(styles.getPropertyValue('margin-bottom'), 10);\n height += parseInt(styles.getPropertyValue('margin-top'), 10);\n return height;\n }\n\n function handleResize() {\n multipleDelayedSendHeight();\n }\n\n function handleIframeAdded(iframe) {\n if (isIOS) {\n iframe.onload = function() {\n var src = iframe.src; \n if (src.indexOf('reloadMe') > -1) {\n return;\n }\n iframe.src = src.replace('?', '?reloadMe=1&');\n };\n }\n }\n\n var timerId;\n function multipleDelayedSendHeight() {\n sendHeight();\n clearTimeout(timerId);\n let delay = 100;\n timerId = setTimeout(function request() {\n sendHeight();\n delay *= 2;\n if (delay < 20000) {\n timerId = setTimeout(request, delay);\n }\n }, delay);\n }\n\n function sendHeight() {\n var height = getHeight();\n parent.postMessage({ type: 'htmlPlugin:heightResize', id: id, height: height }, '*');\n }\n\n function setupMutationObserver() {\n var target = document.querySelector('body');\n var observer = new MutationObserver(function(mutations) {\n addImageLoadListeners();\n handleResize();\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(el) {\n if (el.nodeName === 'IFRAME') {\n handleIframeAdded(el);\n }\n });\n });\n });\n\n var config = {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n };\n\n observer.observe(target, config);\n }\n\n window.addEventListener('resize', handleResize); //this handles width change\n setupMutationObserver();\n handleResize();\n }\n\n window.addEventListener('message', function(event) {\n if (event.data.type !== 'htmlPlugin:updateContent') {\n return;\n }\n\n var content = [\n '<!DOCTYPE html>',\n '<html>',\n '<head>' + document.head.innerHTML + '</head>',\n '<body>' + event.data.content + '</body>',\n '</html>',\n ].join('');\n\n document.open('text/html', 'replace');\n document.write(content);\n document.close();\n initSendHeight(event.data.id);\n });\n <\/script>\n </head>\n\n <body></body>\n",styles_iframe="_2xvJT",_excluded=["iframeRef"],Iframe=function(_ref){var _context$experiments$,iframeRef=_ref.iframeRef,otherProps=_objectWithoutPropertiesLoose__default.default(_ref,_excluded),loading=null!==(_context$experiments$=React.useContext(wixRichContentCommon.GlobalContext).experiments.lazyImagesAndIframes)&&void 0!==_context$experiments$&&_context$experiments$.enabled?"lazy":void 0;return React__default.default.createElement("iframe",Object.assign({ref:iframeRef,className:styles_iframe,title:"remote content",style:{backgroundColor:"transparent"},loading:loading},otherProps))},isSSR="undefined"==typeof window,IframeHtml=function(_Component){function IframeHtml(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={shouldRender:!1},_this.id=Math.random().toString(36).substr(2,9),_this.writeToIframe=function(iframeElement){var _iframeElement$conten;_this.iframe=iframeElement;var iframeDocument=null==iframeElement||null===(_iframeElement$conten=iframeElement.contentWindow)||void 0===_iframeElement$conten?void 0:_iframeElement$conten.document;iframeDocument&&(iframeDocument.open("text/html","replace"),iframeDocument.write(htmlIframeSrc),iframeDocument.close())},_this.updateIframeContent=function(content){var _this$iframe;_this.shouldIgnoreLoad=!0,null===(_this$iframe=_this.iframe)||void 0===_this$iframe||_this$iframe.contentWindow.postMessage({type:"htmlPlugin:updateContent",id:_this.id,content:content},"*")},_this.handleIframeMessage=function(_ref){var data=_ref.data,type=data.type,id=data.id,height=data.height;"htmlPlugin:heightResize"===type&&id===_this.id&&_this.props.onHeightChange(height)},_this.handleIframeLoad=function(){!_this.shouldIgnoreLoad&&_this.updateIframeContent(_this.props.html)},_this.setIframe=function(iframe){_this.iframe=iframe},_this}_inheritsLoose__default.default(IframeHtml,_Component);var _proto=IframeHtml.prototype;return _proto.componentDidMount=function(){this.setState({shouldRender:!0}),!isSSR&&window.addEventListener("message",this.handleIframeMessage)},_proto.componentWillUnmount=function(){!isSSR&&window.removeEventListener("message",this.handleIframeMessage)},_proto.componentWillReceiveProps=function(nextProps){this.props.html!==nextProps.html&&this.updateIframeContent(nextProps.html)},_proto.render=function(){var iframeSandboxDomain=this.props.iframeSandboxDomain,iframeProps={style:{backgroundColor:"transparent"},onLoad:this.handleIframeLoad};if(iframeSandboxDomain){var strippedUrl=iframeSandboxDomain.replace(/\/$/,"");iframeProps.src=strippedUrl+"/html/db9376e69cfa487ea0fa0b912ae51a4f_v1.html",iframeProps.iframeRef=this.setIframe}else iframeProps.iframeRef=this.writeToIframe;return this.state.shouldRender?React__default.default.createElement(Iframe,iframeProps):null},IframeHtml}(React.Component),IframeUrl=function(props){return React__default.default.createElement(Iframe,Object.assign({},props,{sandbox:"allow-popups allow-presentation allow-forms allow-same-origin allow-scripts"}))},htmlComponentStyles={htmlComponent:"yuWXS",htmlComponent_placeholder:"_3tucQ"},HtmlComponent=function(_Component){function HtmlComponent(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={siteDomain:void 0},_this.setHeight=function(iframeHeight){var _this$props$store;iframeHeight!==_this.state.iframeHeight&&(_this.setState({iframeHeight:iframeHeight}),null===(_this$props$store=_this.props.store)||void 0===_this$props$store||_this$props$store.update("componentData",{config:{height:iframeHeight}}))},_this.getIframeHeight=function(){var _this$props=_this.props,_this$props$settings=_this$props.settings,height=(_this$props$settings=void 0===_this$props$settings?{}:_this$props$settings).height,config=_this$props.componentData.config,iframeHeight=_this.state.iframeHeight,maxDiff=Math.min(50,.1*_this.state.iframeHeight),normalizedHeight=iframeHeight;return config.height&&(normalizedHeight=iframeHeight&&config.height<iframeHeight&&config.height+maxDiff>iframeHeight?iframeHeight:config.height),normalizedHeight||height||550},_this}_inheritsLoose__default.default(HtmlComponent,_Component);var _proto=HtmlComponent.prototype;return _proto.componentDidMount=function(){var _this$props2=this.props,config=_this$props2.componentData.config,_this$props2$settings=_this$props2.settings,settings=void 0===_this$props2$settings?{}:_this$props2$settings,width=settings.width,height=settings.height,siteDomain=settings.siteDomain;config.width||(width?config.width=width:this.element?config.width=this.element.getBoundingClientRect().width:config.width=350),config.height||(config.height=height||550),this.setState({siteDomain:siteDomain})},HtmlComponent.getDerivedStateFromProps=function(props,state){var componentData=props.componentData;if("html"===componentData.srcType){var html=componentData&&componentData.src,pageURL=function(siteDomain){if(siteDomain){var res=/http.+com/gm.exec(siteDomain);return res?res[0]:res}}(state.siteDomain);if(pageURL&&html&&html.includes&&html.includes("adsbygoogle")){var updatedAd='<ins class="adsbygoogle"\n\tdata-page-url="'+pageURL+'"';html=html.replace(new RegExp('<ins class="adsbygoogle"',"g"),updatedAd)}return{html:html}}},_proto.render=function(){var _this$context$experim,_this2=this,html=this.state.html,_this$props3=this.props,iframeSandboxDomain=_this$props3.iframeSandboxDomain,theme=_this$props3.theme,componentData=_this$props3.componentData,_this$props3$settings=_this$props3.settings,width=(_this$props3$settings=void 0===_this$props3$settings?{}:_this$props3$settings).width;this.styles=this.styles||wixRichContentCommon.mergeStyles({styles:htmlComponentStyles,theme:theme}),wixRichContentCommon.validate(componentData,pluginHtmlSchema__default.default);var src=componentData.src,srcType=componentData.srcType,_componentData$config=componentData.config,currentWidth=(_componentData$config=void 0===_componentData$config?{}:_componentData$config).width,style={width:this.props.isMobile?"auto":currentWidth||width||350,height:this.getIframeHeight(),maxHeight:this.state.iframeHeight,maxWidth:"100%"};return React__default.default.createElement("div",{className:this.styles.htmlComponent,ref:function(_ref){return _this2.element=_ref},style:style,"data-hook":"HtmlComponent"},"html"===srcType&&src&&React__default.default.createElement(IframeHtml,{iframeSandboxDomain:iframeSandboxDomain||(null===(_this$context$experim=this.context.experiments.forceIframeSandboxDomain)||void 0===_this$context$experim?void 0:_this$context$experim.enabled)&&"https://www.filesusr.com",key:"html",tabIndex:0,html:html,onHeightChange:this.setHeight}),"url"===srcType&&wixRichContentCommon.isValidUrl(src)&&React__default.default.createElement(IframeUrl,{key:"url",tabIndex:0,src:wixRichContentCommon.normalizeUrl(src)}),!src&&!wixRichContentCommon.isValidUrl(src)&&React__default.default.createElement("div",{className:this.styles.htmlComponent_placeholder}))},HtmlComponent}(React.Component);HtmlComponent.contextType=wixRichContentCommon.GlobalContext;var HTML_TYPE="wix-draft-plugin-html";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)}var createHtmlPlugin=function(config){var helpers=config.helpers,isMobile=config.isMobile,t=config.t,_config$HTML_TYPE=config[HTML_TYPE],settings=void 0===_config$HTML_TYPE?{}:_config$HTML_TYPE,getEditorBounds=config.getEditorBounds,rest=_objectWithoutPropertiesLoose__default.default(config,["helpers","isMobile","t",HTML_TYPE,"getEditorBounds"].map(_toPropertyKey)),simulateEditClick=function(_ref){var e=_ref.e,pubsub=_ref.pubsub;return setTimeout((function(){return pubsub.set("onClickTrigger",{event:e,key:"edit"})}))};return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({onOverlayClick:simulateEditClick,component:HtmlComponent,settings:settings,type:HTML_TYPE,toolbar:createToolbar({helpers:helpers,t:t,isMobile:isMobile,settings:settings,getEditorBounds:getEditorBounds}),helpers:helpers,isMobile:isMobile,t:t,getEditorBounds:getEditorBounds,defaultPluginData:defaults(),onComponentMount:simulateEditClick},rest))};createHtmlPlugin.functionName=HTML_TYPE;var createHtmlData=function(pluginData,isRicosSchema){void 0===pluginData&&(pluginData={}),void 0===isRicosSchema&&(isRicosSchema=!1);var htmlData=isRicosSchema?toDraftData.convertNodeDataToDraft("HTML",pluginData):pluginData;return lodash.merge({},defaults(),htmlData)};exports.HTML_TYPE=HTML_TYPE,exports.createHtmlPlugin=createHtmlPlugin,exports.htmlButtonsTypes=htmlButtonsTypes,exports.pluginHtml=function(config){return{config:_extends__default.default({},DEFAULTS_CONFIG,config),type:HTML_TYPE,createPlugin:createHtmlPlugin,ModalsMap:{},createPluginData:createHtmlData}};
//# sourceMappingURL=module.cjs.js.map

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

import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{LTRIcon,RTLIcon,BUTTONS,createBasePlugin}from"wix-rich-content-plugin-commons";import{EditorState,getModalStyles,BUTTON_TYPES,INSERT_PLUGIN_BUTTONS,TOOLBARS}from"wix-rich-content-editor-common";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component}from"react";import classNames from"classnames";import{generateKey,mergeStyles,anchorScroll,GlobalContext,isRtl}from"wix-rich-content-common";import{RadioGroupVertical,LabeledToggle,Separator,InfoIcon,SelectionList,SettingsMobileHeader,SettingsPanelFooter}from"wix-rich-content-ui-components";import{Draggable,DragDropContext,Droppable}from"react-beautiful-dnd";var _ModalsMap,COLLAPSIBLE_LIST_TYPE="wix-rich-content-plugin-collapsible-list",directions_LTR="ltr",directions_RTL="rtl",DEFAULTS=Object.freeze({config:{expandState:"first_expanded",expandOnlyOne:!1},pairs:[{key:generateKey()}]}),EMPTY_PAIR_VALUE={title:EditorState.createEmpty(),content:EditorState.createEmpty()},CollapsibleList=function(store,componentData){var _this=this;this.getData=function(){return _this.componentData},this.getConfig=function(){return _this.getData().config},this.getPairs=function(){return _this.getData().pairs},this.getPair=function(idx){return _this.getPairs()[idx]},this.getTitle=function(idx){return _this.getPair(idx).title||EditorState.createEmpty()},this.getContent=function(idx){return _this.getPair(idx).content||EditorState.createEmpty()},this.getDirection=function(){return _this.getConfig().direction},this.changeDirection=function(){var direction=_this.getDirection()===directions_LTR?directions_RTL:directions_LTR,updatedData={config:_extends({},_this.getConfig(),{direction:direction})};_this.updateData(updatedData)},this.getExpandState=function(){return _this.getConfig().expandState},this.setExpandState=function(expandState){var updatedData={config:_extends({},_this.getConfig(),{expandState:expandState})};"expanded"===expandState&&(updatedData.config.expandOnlyOne=void 0),_this.updateData(updatedData)},this.getExpandOnlyOne=function(){return _this.getConfig().expandOnlyOne},this.toggleExpandOnlyOne=function(){var updatedData={config:_extends({},_this.getConfig(),{expandOnlyOne:!_this.getExpandOnlyOne()})};_this.updateData(updatedData)},this.setData=function(data){_this.store.set("componentData",data)},this.updateData=function(data){var componentData=_this.getData();_this.setData(_extends({},componentData,data))},this.setTitle=function(idx,editorState){var pair={title:editorState};_this.setPair(idx,pair)},this.setContent=function(idx,editorState){var pair={content:editorState};_this.setPair(idx,pair)},this.setPair=function(idx,updatedPair){var pairs=[].concat(_this.getPairs()),currentPair=_this.getPair(idx),newPair=_extends({},currentPair.title&&currentPair.content?{}:EMPTY_PAIR_VALUE,currentPair,updatedPair);pairs.splice(idx,1,newPair),_this.updateData({pairs:pairs})},this.createNewPair=function(){return{key:generateKey(),title:EditorState.createEmpty(),content:EditorState.createEmpty()}},this.insertNewPair=function(){var pairs=_this.getPairs();_this.updateData({pairs:[].concat(pairs,[_this.createNewPair()])})},this.reorderPairs=function(startIdx,endIdx){var pairs=_this.getPairs(),pairToMove=pairs.splice(startIdx,1)[0];pairs.splice(endIdx,0,pairToMove),_this.updateData({pairs:pairs})},this.deletePair=function(pairIndex){var pairs=_this.getPairs();pairs.splice(pairIndex,1),_this.updateData({pairs:pairs})},this.store=store,this.componentData=componentData},styles$5={title:"_3hUj0",settingsContainer:"_62k0D",separator:"_20bm0",direction_selector:"_1jUkB",direction_selector_option:"_1w4ED"},CollapsibleListSettings=function(_Component){function CollapsibleListSettings(props){var _this;(_this=_Component.call(this,props)||this).renderOption=function(_ref){var item=_ref.item;return React.createElement(React.Fragment,null,React.createElement(item.icon,null),React.createElement("p",null,item.label))},_this.renderExpandOptions=function(){var _this$props=_this.props,getDataManager=_this$props.getDataManager,t=_this$props.t,theme=_this$props.theme,isMobile=_this$props.isMobile;return React.createElement(React.Fragment,null,React.createElement(RadioGroupVertical,{label:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_Title"),value:getDataManager().getExpandState(),dataSource:[{value:"expanded",labelText:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_Expanded"),dataHook:"Expanded"},{value:"first_expanded",labelText:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_FirstExpanded"),dataHook:"FirstExpanded"},{value:"collapsed",labelText:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_Collapsed"),dataHook:"Collapsed"}],t:t,theme:theme,onChange:function(value){return getDataManager().setExpandState(value)}}),"expanded"!==getDataManager().getExpandState()&&React.createElement(LabeledToggle,{label:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_CollapseView_InSections"),checked:getDataManager().getExpandOnlyOne(),onChange:getDataManager().toggleExpandOnlyOne,theme:theme,style:isMobile?{paddingTop:"28px"}:{},dataHook:"onePairExpanded"}))},_this.renderSeparator=function(){return React.createElement(Separator,{horizontal:!0,className:_this.styles.separator})},_this.renderDirectionOptions=function(){var _this$props2=_this.props,getDataManager=_this$props2.getDataManager,t=_this$props2.t;return React.createElement(React.Fragment,null,React.createElement("p",{className:_this.styles.title},t("CollapsibleList_CollapsibleListSettings_Tab_Settings_Direction_Title")," ",React.createElement(InfoIcon,{tooltipText:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_Direction_Title_Tooltip")})),React.createElement(SelectionList,{theme:_this.styles,dataSource:[{value:directions_LTR,label:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_Direction_LTR"),icon:LTRIcon,dataHook:"ltrDirection"},{value:directions_RTL,label:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_Direction_RTL"),icon:RTLIcon,dataHook:"rtlDirection"}],renderItem:_this.renderOption,value:getDataManager().getDirection(),onChange:getDataManager().changeDirection,className:_this.styles.direction_selector,optionClassName:_this.styles.direction_selector_option}))};var _theme=props.theme;return _this.styles=mergeStyles({styles:styles$5,theme:_theme}),_this}return _inheritsLoose(CollapsibleListSettings,_Component),CollapsibleListSettings.prototype.render=function(){return React.createElement("div",{className:this.styles.settingsContainer},this.renderExpandOptions(),this.renderSeparator(),this.renderDirectionOptions())},CollapsibleListSettings}(Component),styles$4={collapsibleListModal:"_2gcEm",collapsibleListModalTitle:"_22bSm",collapsibleListModal_scrollContainer:"bpnq3",collapsibleListModal_mobile:"_1QgQS"},Modals={COLLAPSIBLE_LIST_MODAL:"collapsible-list-modal"},ModalsMap=((_ModalsMap={})[Modals.COLLAPSIBLE_LIST_MODAL]=function(_Component){function CollapsibleListModal(props){var _this;(_this=_Component.call(this,props)||this).onComponentUpdate=function(){return _this.forceUpdate()},_this.revertComponentData=function(){var helpers=_this.props.helpers,initialComponentData=_this.state.initialComponentData;initialComponentData&&_this.getDataManager().updateData(initialComponentData),helpers.closeModal()},_this.onDoneClick=function(){_this.props.helpers.closeModal()},_this.getDataManager=function(){var pubsub=_this.props.pubsub;return new CollapsibleList(pubsub.store,pubsub.get("componentData"))},_this.renderDesktopHeader=function(){var t=_this.props.t;return React.createElement("h3",{className:_this.styles.collapsibleListModalTitle},t("CollapsibleList_CollapsibleListSettings_Common_Header"))},_this.renderMobileHeader=function(){var _this$props=_this.props,t=_this$props.t,theme=_this$props.theme;return React.createElement(SettingsMobileHeader,{t:t,theme:theme,onCancel:_this.revertComponentData,onSave:_this.onDoneClick})},_this.renderSettings=function(){var _classNames,_this$props2=_this.props,isMobile=_this$props2.isMobile,theme=_this$props2.theme,t=_this$props2.t;return React.createElement("div",{className:classNames(styles$4.collapsibleListModal_scrollContainer,(_classNames={},_classNames[styles$4.collapsibleListModal_mobile]=isMobile,_classNames))},React.createElement(CollapsibleListSettings,{getDataManager:_this.getDataManager,theme:theme,isMobile:isMobile,t:t}))},_this.renderDesktopFooterPanel=function(){var _this$props3=_this.props,theme=_this$props3.theme,t=_this$props3.t;return React.createElement(SettingsPanelFooter,{fixed:!0,theme:theme,cancel:_this.revertComponentData,save:_this.onDoneClick,t:t})},_this.state=_this.initState(props);var _theme=props.theme;return _this.styles=mergeStyles({styles:styles$4,theme:_theme}),_this}_inheritsLoose(CollapsibleListModal,_Component);var _proto=CollapsibleListModal.prototype;return _proto.initState=function(props){return{initialComponentData:props.pubsub.get("componentData")}},_proto.componentDidMount=function(){var pubsub=this.props.pubsub;pubsub.subscribe("componentData",this.onComponentUpdate),this.setState({initialComponentData:pubsub.get("componentData")})},_proto.componentWillUnmount=function(){this.props.pubsub.unsubscribe("componentData",this.onComponentUpdate)},_proto.render=function(){var _this$props4=this.props,isMobile=_this$props4.isMobile,languageDir=_this$props4.languageDir;return React.createElement("div",{className:this.styles.collapsibleListModal,"data-hook":"collapsibleListModal",dir:languageDir},isMobile?this.renderMobileHeader():this.renderDesktopHeader(),this.renderSettings(),!isMobile&&this.renderDesktopFooterPanel())},CollapsibleListModal}(Component),_ModalsMap),modalStyles={customStyles:{overlay:{backgroundColor:"transparent"},content:{borderRadius:"2px",boxShadow:"0 4px 8px 0 rgba(0, 0, 0, 0.1)",border:"solid 1px rgba(255, 255, 255, 0.25)"}}},createInlineButtons=function(_ref){var t=_ref.t,disableKeyboardEvents=_ref.disableKeyboardEvents;return[{keyName:"settings",type:BUTTONS.EXTERNAL_MODAL,fullHeight:!0,modalName:Modals.COLLAPSIBLE_LIST_MODAL,children:t("CollapsibleList_CollapsibleListSettings_Tab_Settings_TabName"),modalStyles:getModalStyles(modalStyles),t:t,mobile:!0,triggerSettingsBi:!0,pluginId:COLLAPSIBLE_LIST_TYPE},{keyName:"separator",mobile:!1,type:BUTTONS.SEPARATOR},{keyName:"delete",type:BUTTONS.DELETE,mobile:!0,beforeOnClickDelete:function(){null==disableKeyboardEvents||disableKeyboardEvents(!1)}}]},InsertPluginIcon=function(props){return React.createElement("svg",Object.assign({width:"19px",height:"12px",viewBox:"0 0 23 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React.createElement("g",{transform:"translate(-265.000000, -379.000000)",fill:"currentColor"},React.createElement("g",{transform:"translate(265.000000, 379.000000)"},React.createElement("path",{d:"M10,0.8 L22.6,0.8 C22.7104569,0.8 22.8,0.88954305 22.8,1 L22.8,1.6 C22.8,1.71045695 22.7104569,1.8 22.6,1.8 L10,1.8 C9.88954305,1.8 9.8,1.71045695 9.8,1.6 L9.8,1 C9.8,0.88954305 9.88954305,0.8 10,0.8 Z M10,5.8 L22.6,5.8 C22.7104569,5.8 22.8,5.88954305 22.8,6 L22.8,6.6 C22.8,6.71045695 22.7104569,6.8 22.6,6.8 L10,6.8 C9.88954305,6.8 9.8,6.71045695 9.8,6.6 L9.8,6 C9.8,5.88954305 9.88954305,5.8 10,5.8 Z M10,10.8 L22.6,10.8 C22.7104569,10.8 22.8,10.8895431 22.8,11 L22.8,11.6 C22.8,11.7104569 22.7104569,11.8 22.6,11.8 L10,11.8 C9.88954305,11.8 9.8,11.7104569 9.8,11.6 L9.8,11 C9.8,10.8895431 9.88954305,10.8 10,10.8 Z",fillRule:"nonzero"}),React.createElement("path",{d:"M2.61252587,5.04452587 C2.55011987,5.10656164 2.44933186,5.10656164 2.38692587,5.04452587 L2.04692587,4.70452587 C2.01688154,4.67451494 2,4.63379134 2,4.59132587 C2,4.54886039 2.01688154,4.50813679 2.04692587,4.47812587 L4.47972587,2.04532587 L2.04772587,-0.386674135 C2.01768154,-0.416685056 2.0008,-0.457408655 2.0008,-0.499874135 C2.0008,-0.542339615 2.01768154,-0.583063214 2.04772587,-0.613074135 L2.38692587,-0.953074135 C2.41693679,-0.983118462 2.45766039,-1 2.50012587,-1 C2.54259134,-1 2.58331494,-0.983118462 2.61332587,-0.953074135 L5.49812587,1.93172587 C5.52817019,1.96173679 5.54505173,2.00246039 5.54505173,2.04492587 C5.54505173,2.08739134 5.52817019,2.12811494 5.49812587,2.15812587 L2.61252587,5.04372587 L2.61252587,5.04452587 Z",transform:"translate(3.772526, 2.045526) rotate(-270.000000) translate(-3.772526, -2.045526) "})))))},ArrowIcon=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("g",{fillRule:"evenodd"},React.createElement("g",null,React.createElement("g",null,React.createElement("g",null,React.createElement("g",null,React.createElement("path",{d:"M11.999 9L6 14.241 6.657 15 11.999 10.334 17.343 15 18 14.241z",transform:"translate(-129 -185) translate(97 105) translate(23 71) rotate(-90 21 12) matrix(1 0 0 -1 0 24)"})))))))},PlusIcon=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("g",{fillRule:"evenodd"},React.createElement("g",null,React.createElement("g",null,React.createElement("g",null,React.createElement("path",{d:"M12.5 6v5.5H18v1h-5.5V18h-1v-5.5H6v-1h5.5V6h1z",transform:"translate(-129 -269) translate(97 105) translate(23 155) rotate(-90 21 12)"}))))))},DndIcon=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20"},props),React.createElement("g",{fillRule:"evenodd"},React.createElement("g",null,React.createElement("g",null,React.createElement("g",null,React.createElement("g",null,React.createElement("path",{d:"M5.37 7.083c-.684-.025-1.22-.596-1.203-1.28.017-.685.58-1.228 1.265-1.22.684.009 1.234.566 1.235 1.25-.014.704-.594 1.263-1.297 1.25zM5.37 2.5c-.684-.026-1.22-.597-1.203-1.28.017-.685.58-1.228 1.265-1.22.684.009 1.234.566 1.235 1.25-.014.703-.594 1.263-1.297 1.25zM5.463 9.167c.684.025 1.22.596 1.203 1.28-.017.685-.58 1.228-1.265 1.22-.684-.009-1.234-.566-1.234-1.25.014-.703.594-1.262 1.296-1.25zM1.203 7.083C.52 7.058-.017 6.487 0 5.803c.017-.685.581-1.228 1.265-1.22.685.009 1.235.566 1.235 1.25-.013.704-.594 1.263-1.297 1.25zM1.203 2.5C.52 2.474-.017 1.903 0 1.22.017.534.581-.009 1.265 0 1.95.01 2.5.566 2.5 1.25c-.013.703-.594 1.263-1.297 1.25zM1.297 9.167c.683.025 1.22.596 1.203 1.28-.017.685-.581 1.228-1.265 1.22C.55 11.658 0 11.1 0 10.417c.015-.703.594-1.262 1.297-1.25z",transform:"translate(-99 -190) translate(99 176) translate(0 14) translate(6.667 4.167)"})))))))},styles$3={ltr:"E6y_Z",rtl:"_2wLEl",iconContainer:"_21s0b",icon:"_2z8L4",isExpanded:"aPvla"};function ExpandCollapseButton(props){var onClick=props.onClick,idx=props.idx,ariaLabel=props.ariaLabel;return React.createElement("div",{role:"button",tabIndex:"-1",className:styles$3.iconContainer,onClick:onClick,onKeyUp:function(e){return(" "===e.key||"Enter"===e.key)&&onClick(e)},"data-hook":"ExpandCollapseButton_"+idx},React.createElement(ArrowIcon,{role:"button",tabIndex:"0","aria-label":ariaLabel,className:classNames(styles$3.icon,props.isExpanded&&styles$3.isExpanded)}))}var styles$2={titleContainer:"_3LwlN",title:"_3CwVy",content:"_3TxVS"},CollapsibleListPair=function(_Component){function CollapsibleListPair(props){var _this;(_this=_Component.call(this,props)||this).focusTitle=function(){var _this$titleEditorRef$;return null===(_this$titleEditorRef$=_this.titleEditorRef.current)||void 0===_this$titleEditorRef$?void 0:_this$titleEditorRef$.focus()},_this.renderTitle=function(){var _this$props=_this.props,idx=_this$props.idx,renderTitle=_this$props.renderTitle;return React.createElement("div",{className:_this.styles.title},renderTitle(idx,_this.titleEditorRef))},_this.focusContent=function(){var _this$contentEditorRe;return null===(_this$contentEditorRe=_this.contentEditorRef.current)||void 0===_this$contentEditorRe?void 0:_this$contentEditorRe.focus()},_this.renderContent=function(){var _this$props2=_this.props,idx=_this$props2.idx,renderContent=_this$props2.renderContent;return _this$props2.isExpanded&&React.createElement("div",{className:_this.styles.content},renderContent(idx,_this.contentEditorRef))},_this.onClick=function(e){var _helpers$onViewerActi,_this$props3=_this.props,isExpanded=_this$props3.isExpanded,onCollapseClick=_this$props3.onCollapseClick,onExpandClick=_this$props3.onExpandClick,idx=_this$props3.idx,helpers=_this$props3.helpers,isInEditor=_this$props3.isInEditor;isExpanded?onCollapseClick(idx):onExpandClick(idx),null===(_helpers$onViewerActi=helpers.onViewerAction)||void 0===_helpers$onViewerActi||_helpers$onViewerActi.call(helpers,COLLAPSIBLE_LIST_TYPE,"Click",isExpanded?"collapse":"expand"),isInEditor||(e.preventDefault(),setTimeout((function(){return anchorScroll(_this.pairRef,_this.context.experiments)})))},_this.onKeyDown=function(e){"a"===e.key&&(e.ctrlKey||e.metaKey)&&e.stopPropagation()};var theme=props.theme;return _this.styles=mergeStyles({styles:styles$2,theme:theme}),_this.titleEditorRef=React.createRef(),_this.contentEditorRef=React.createRef(),_this.pairRef=React.createRef(),_this}return _inheritsLoose(CollapsibleListPair,_Component),CollapsibleListPair.prototype.render=function(){var _this2=this,_this$props4=this.props,isExpanded=_this$props4.isExpanded,idx=_this$props4.idx,t=_this$props4.t;return React.createElement(React.Fragment,null,React.createElement("div",{className:this.styles.titleContainer,onKeyDown:this.onKeyDown,ref:function(_ref){return _this2.pairRef=_ref}},React.createElement(ExpandCollapseButton,{isExpanded:isExpanded,onClick:this.onClick,idx:idx,ariaLabel:t(isExpanded?"CollapsibleListPlugin_ExpandButton_AriaLabel":"CollapsibleListPlugin_CollapseButton_AriaLabel")}),this.renderTitle()),this.renderContent())},CollapsibleListPair}(Component);CollapsibleListPair.contextType=GlobalContext;var getPairsAllCollpased=function(pairs){return pairs.map((function(){return!1}))},getDefaultPairsState=function(pairs,defaultPairsExpandState){var pairsState="expanded"===defaultPairsExpandState?function(pairs){return pairs.map((function(){return!0}))}(pairs):getPairsAllCollpased(pairs);return"first_expanded"===defaultPairsExpandState&&(pairsState[0]=!0),pairsState},CollapsibleListPairs=function(_Component){function CollapsibleListPairs(props){var _this;return(_this=_Component.call(this,props)||this).focusPair=function(_ref){var idx=_ref.idx,isTitle=_ref.isTitle,pair=_this.pairsRefs[idx];isTitle?null==pair||pair.focusTitle():(null==pair?void 0:pair.focusContent())||null==pair||pair.focusTitle()},_this.expandPair=function(idx){var _this$props=_this.props,pairs=_this$props.pairs,expandOnlyOne=_this$props.expandOnlyOne,pairsState=_this.state.pairsState;expandOnlyOne&&(pairsState=getPairsAllCollpased(pairs)),pairsState[idx]=!0,_this.setState({pairsState:pairsState})},_this.collapsePair=function(idx){var pairsState=[].concat(_this.state.pairsState);pairsState[idx]=!1,_this.setState({pairsState:pairsState})},_this.insertNewPair=function(){var expandOnlyOne=_this.state.expandOnlyOne,pairsState=_this.state.pairsState;expandOnlyOne&&(pairsState=getPairsAllCollpased(pairsState)),pairsState=[].concat(pairsState,[!0]),_this.setState({pairsState:pairsState})},_this.deletePair=function(idx){var pairsState=_this.state.pairsState;pairsState.splice(idx,1),_this.setState({pairsState:pairsState})},_this.reorderPairs=function(startIdx,endIdx){var pairsState=_this.state.pairsState,pairToMove=pairsState.splice(startIdx,1)[0];pairsState.splice(endIdx,0,pairToMove),_this.setState({pairsState:pairsState})},_this.pairsRefs=[],_this.state=_this.initState(props),_this}_inheritsLoose(CollapsibleListPairs,_Component);var _proto=CollapsibleListPairs.prototype;return _proto.initState=function(props){var pairs=props.pairs,expandState=props.expandState;return{defaultPairsExpandState:expandState,expandOnlyOne:props.expandOnlyOne,pairsState:getDefaultPairsState(pairs,expandState)}},CollapsibleListPairs.getDerivedStateFromProps=function(props,state){var pairs=props.pairs,expandState=props.expandState,expandOnlyOne=props.expandOnlyOne;return state.defaultPairsExpandState!==expandState||expandOnlyOne&&expandOnlyOne!==state.expandOnlyOne?{defaultPairsExpandState:expandState,expandOnlyOne:expandOnlyOne,pairsState:getDefaultPairsState(pairs,expandState)}:null},_proto.render=function(){var _this2=this,_this$props2=this.props,pairs=_this$props2.pairs,PairWrapper=_this$props2.PairWrapper,t=_this$props2.t,theme=_this$props2.theme,renderTitle=_this$props2.renderTitle,renderContent=_this$props2.renderContent,helpers=_this$props2.helpers,isInEditor=_this$props2.isInEditor,pairsState=this.state.pairsState;return pairs.map((function(pair,idx){return React.createElement(PairWrapper,{key:pair.key,id:pair.key,index:idx},React.createElement(CollapsibleListPair,{ref:function(_ref2){return _this2.pairsRefs[idx]=_ref2},t:t,key:pair.key,idx:idx,isExpanded:pairsState[idx],onCollapseClick:_this2.collapsePair,onExpandClick:_this2.expandPair,theme:theme,renderTitle:renderTitle,renderContent:renderContent,helpers:helpers,isInEditor:isInEditor}))}))},CollapsibleListPairs}(Component);CollapsibleListPairs.defaultProps={PairWrapper:"div"};var styles$1_new_pair_container="_1AgMx",styles$1_new_pair_button="_1Zqb4",styles$1_new_pair_label="_3iSqB";function NewPairButton(props){return React.createElement("div",{role:"button",tabIndex:"0",className:styles$1_new_pair_container,onClick:props.onClick,onKeyPress:function(e){return("Enter"===e.key||" "===e.key)&&props.onClick(e)},"data-hook":"CollapsibleListNewPair_button"},React.createElement("div",{className:styles$1_new_pair_button},React.createElement(PlusIcon,null),React.createElement("label",{className:styles$1_new_pair_label},props.label)))}var styles_dndIcon="hDgGn";function DndHandle(props){return React.createElement("div",_extends({className:styles_dndIcon},props.dragHandleProps),React.createElement(DndIcon,null))}var CollapsibleListComponent=function(_React$Component){function CollapsibleListComponent(_props){var _this,_this2=this;(_this=_React$Component.call(this,_props)||this).focusPair=function(pair){return setTimeout((function(){_this.collapsibleListRef.current.focusPair(pair)}))},_this.expandPair=function(idx){return _this.collapsibleListRef.current.expandPair(idx)},_this.focusTitle=function(idx){var pair={idx:idx,isTitle:!0};_this.focusPair(pair)},_this.focusContent=function(idx){var pair={idx:idx,isTitle:!1};_this.focusPair(pair)},_this.onTitleBackspace=function(idx){_this.getDataManager().getPairs().length>1&&(_this.getDataManager().deletePair(idx),_this.collapsibleListRef.current.deletePair(idx),0===idx?_this.focusTitle(idx):_this.focusContent(idx-1))},_this.renderTitle=function(idx,setRef){return React.createElement(_this2.renderInput,{value:_this.getDataManager().getTitle(idx),setRef:setRef,onChange:function(val){return _this.getDataManager().setTitle(idx,val)},placeholder:_this.titlePlaceholder,onBackspaceAtBeginningOfContent:function(){return _this.onTitleBackspace(idx)},handleReturn:_this.handleTitleReturn(idx),toolbarsToIgnore:["SideToolbar"]})},_this.renderContent=function(idx,setRef){return React.createElement(_this2.renderInput,{value:_this.getDataManager().getContent(idx),setRef:setRef,onChange:function(val){return _this.getDataManager().setContent(idx,val)},placeholder:_this.contentPlaceholder,onBackspaceAtBeginningOfContent:function(){return _this.focusTitle(idx)}})},_this.renderInput=function(_ref){var value=_ref.value,setRef=_ref.setRef,onChange=_ref.onChange,placeholder=_ref.placeholder,onBackspaceAtBeginningOfContent=_ref.onBackspaceAtBeginningOfContent,handleReturn=_ref.handleReturn,toolbarsToIgnore=_ref.toolbarsToIgnore,renderInnerRCE=_this.props.renderInnerRCE,direction=_this.getDataManager().getDirection();return renderInnerRCE({editorState:value,setRef:setRef,onChange:onChange,renderedIn:COLLAPSIBLE_LIST_TYPE,onBackspaceAtBeginningOfContent:onBackspaceAtBeginningOfContent,direction:direction,additionalProps:{textAlignment:"ltr"===direction?"left":"right",placeholder:placeholder,handleReturn:handleReturn},toolbarsToIgnore:toolbarsToIgnore,onFocus:function(){return _this.props.disableKeyboardEvents(!0)},onBlur:function(){return _this.props.disableKeyboardEvents(!1)}})},_this.handleTitleReturn=function(idx){return function(){return function(){return _this.expandPair(idx),_this.focusContent(idx),"handled"}}},_this.onNewPairButtonClick=function(){var newPairIdx=_this.getDataManager().getPairs().length;_this.getDataManager().insertNewPair(),_this.collapsibleListRef.current.insertNewPair(),_this.focusTitle(newPairIdx)},_this.onDragEnd=function(result){result.destination&&result.source.index!==result.destination.index&&(_this.getDataManager().reorderPairs(result.source.index,result.destination.index),_this.collapsibleListRef.current.reorderPairs(result.source.index,result.destination.index))},_this.getDataManager=function(props){var _ref2=props||_this.props,store=_ref2.store,componentData=_ref2.componentData;return new CollapsibleList(store,componentData)},_this.PairWrapper=function(_ref3){var id=_ref3.id,index=_ref3.index,children=_ref3.children,_this$props=_this.props,isMobile=_this$props.isMobile,blockProps=_this$props.blockProps,isDragDisabled=isMobile||!blockProps.isFocused;return React.createElement(Draggable,{key:id,draggableId:id,index:index,isDragDisabled:isDragDisabled},(function(provided){return React.createElement("div",_extends({ref:provided.innerRef},provided.draggableProps),!isDragDisabled&&React.createElement(DndHandle,{dragHandleProps:provided.dragHandleProps}),children)}))},_this.onFocus=function(e){return e.stopPropagation()};var theme=_props.theme,t=_props.t;return _this.styles=mergeStyles({styles:styles$3,theme:theme}),_this.titlePlaceholder=t("CollapsibleList_ShownText_Placeholder"),_this.contentPlaceholder=t("CollapsibleList_CollapsedText_Placeholder"),_this.addNewPairLabel=t("CollapsibleList_ShownText_Add_Placeholder"),_this.collapsibleListRef=React.createRef(),_this}return _inheritsLoose(CollapsibleListComponent,_React$Component),CollapsibleListComponent.prototype.render=function(){var _this3=this,_this$props2=this.props,blockProps=_this$props2.blockProps,theme=_this$props2.theme,t=_this$props2.t,isMobile=_this$props2.isMobile,helpers=_this$props2.helpers,pairs=this.getDataManager().getPairs(),expandState=this.getDataManager().getExpandState(),expandOnlyOne=this.getDataManager().getExpandOnlyOne(),direction=this.getDataManager().getDirection();return React.createElement("div",{className:this.styles[direction],onFocus:this.onFocus,tabIndex:"0","data-hook":"collapsibleListComponent"},React.createElement(DragDropContext,{onDragEnd:this.onDragEnd},React.createElement(Droppable,{droppableId:"droppable"},(function(provided){return React.createElement("div",_extends({},provided.droppableProps,{ref:provided.innerRef}),React.createElement(CollapsibleListPairs,{ref:_this3.collapsibleListRef,theme:theme,t:t,isMobile:isMobile,pairs:pairs,expandState:expandState,expandOnlyOne:expandOnlyOne,renderTitle:_this3.renderTitle,renderContent:_this3.renderContent,PairWrapper:_this3.PairWrapper,helpers:helpers,isInEditor:!0}),provided.placeholder)}))),blockProps.isFocused&&React.createElement(NewPairButton,{label:this.addNewPairLabel,onClick:this.onNewPairButtonClick}))},CollapsibleListComponent}(React.Component),createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,t=_ref.t,settings=_ref.settings,locale=_ref.locale,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,componentData=_extends({},DEFAULTS,{config:_extends({},DEFAULTS.config,{direction:isRtl(locale)?directions_RTL:directions_LTR})});return[{type:BUTTON_TYPES.BUTTON,name:INSERT_PLUGIN_BUTTONS.COLLAPSIBLE_LIST,getLabel:function(){return t("CollapsibleList_InsertButton")},tooltip:t("CollapsibleListPlugin_InsertButton_Tooltip"),getIcon:function(){return icon},isActive:function(){return!1},isDisabled:function(){return!1},componentData:componentData,toolbars:[TOOLBARS.INSERT_PLUGIN,TOOLBARS.MOBILE,TOOLBARS.FOOTER,TOOLBARS.SIDE],section:"BlockToolbar_Section_Advanced"}]},createToolbar=function(_ref){var t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,locale=_ref.locale,disableKeyboardEvents=_ref.disableKeyboardEvents;return{InlineButtons:createInlineButtons({t:t,disableKeyboardEvents:disableKeyboardEvents}),InsertButtons:createInsertButtons({t:t,settings:settings,isMobile:isMobile,locale:locale}),name:COLLAPSIBLE_LIST_TYPE}};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)}var createCollapsibleListPlugin=function(config){var localeContent=config.localeContent,locale=config.locale,helpers=config.helpers,t=config.t,_config$COLLAPSIBLE_L=config[COLLAPSIBLE_LIST_TYPE],settings=void 0===_config$COLLAPSIBLE_L?{}:_config$COLLAPSIBLE_L,isMobile=config.isMobile,disableKeyboardEvents=config.disableKeyboardEvents,rest=_objectWithoutPropertiesLoose(config,["localeContent","locale","helpers","t",COLLAPSIBLE_LIST_TYPE,"isMobile","disableKeyboardEvents"].map(_toPropertyKey));return createBasePlugin(_extends({component:CollapsibleListComponent,type:COLLAPSIBLE_LIST_TYPE,toolbar:createToolbar({helpers:helpers,t:t,settings:settings,isMobile:isMobile,locale:localeContent||locale,disableKeyboardEvents:disableKeyboardEvents}),helpers:helpers,settings:settings,t:t,isMobile:isMobile,defaultPluginData:DEFAULTS,noPluginBorder:!0,noPointerEventsOnFocus:!0,locale:localeContent||locale,disableKeyboardEvents:disableKeyboardEvents},rest))};createCollapsibleListPlugin.functionName=COLLAPSIBLE_LIST_TYPE;var CollapsibleListViewer=function(_Component){function CollapsibleListViewer(props){var _this;(_this=_Component.call(this,props)||this).getPair=function(idx){return _this.props.componentData.pairs[idx]},_this.renderInnerRCV=function(contentState){var _this$props=_this.props,innerRCV=_this$props.innerRCV,componentData=_this$props.componentData;return innerRCV({contentState:contentState,textAlignment:function(componentData){return"ltr"===componentData.config.direction?"left":"right"}(componentData),direction:function(componentData){return componentData.config.direction}(componentData)})},_this.renderTitle=function(idx){var pair=_this.getPair(idx);return _this.renderInnerRCV(pair.title)},_this.renderContent=function(idx){var pair=_this.getPair(idx);return _this.renderInnerRCV(pair.content)};var theme=props.theme;return _this.styles=mergeStyles({styles:styles$3,theme:theme}),_this}return _inheritsLoose(CollapsibleListViewer,_Component),CollapsibleListViewer.prototype.render=function(){var _this$props2=this.props,theme=_this$props2.theme,t=_this$props2.t,componentData=_this$props2.componentData,isMobile=_this$props2.isMobile,helpers=_this$props2.helpers,config=componentData.config,pairs=componentData.pairs,direction=config.direction,expandState=config.expandState,expandOnlyOne=config.expandOnlyOne;return React.createElement("div",{className:this.styles[direction]},React.createElement(CollapsibleListPairs,{theme:theme,t:t,isMobile:isMobile,pairs:pairs,expandState:expandState,expandOnlyOne:expandOnlyOne,renderTitle:this.renderTitle,renderContent:this.renderContent,helpers:helpers}))},CollapsibleListViewer}(Component),pluginCollapsibleList=function(config){return{config:_extends({},DEFAULTS.config,config),type:COLLAPSIBLE_LIST_TYPE,createPlugin:createCollapsibleListPlugin,ModalsMap:ModalsMap}};export{COLLAPSIBLE_LIST_TYPE,Modals,ModalsMap,CollapsibleListViewer as collapsibleListViewer,createCollapsibleListPlugin,pluginCollapsibleList};
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{BUTTONS,SizeSmallLeftIcon,SizeSmallCenterIcon,SizeSmallRightIcon,createBasePlugin}from"wix-rich-content-plugin-commons";import React,{Component,useContext}from"react";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import classNames from"classnames";import{InfoIcon,RadioGroupHorizontal,InputWithLabel,TextInput}from"wix-rich-content-ui-components";import{isValidUrl,startsWithHttps,hasProtocol,mergeStyles,translate,GlobalContext,validate,normalizeUrl}from"wix-rich-content-common";import{identity,trimStart,merge}from"lodash";import{BUTTON_TYPES,INSERT_PLUGIN_BUTTONS,TOOLBARS}from"wix-rich-content-editor-common";import pluginHtmlSchema from"wix-rich-content-common/dist/statics/schemas/plugin-html.schema.json";import{convertNodeDataToDraft}from"ricos-content/libs/toDraftData";var _VALIDATORS,_NORMALIZERS,_TOOLTIP_TEXT_BY_SRC_,EditIcon=function(props){return React.createElement("svg",Object.assign({width:19,viewBox:"0 0 19 19"},props),React.createElement("path",{d:"M11.498 5.326L3 13.8V16h2.2l8.486-8.486-2.188-2.188zm.688-.687l2.199 2.176L16 5.2 13.83 3l-1.644 1.64zM2 13.523a.2.2 0 0 1 .059-.141l11.1-11.1a1 1 0 0 1 1.414 0l2.146 2.145a1 1 0 0 1 0 1.414l-11.1 11.1a.2.2 0 0 1-.142.059H2.2a.2.2 0 0 1-.2-.2v-3.277zM5 4h1.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H5v1.8a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V5H2.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2H4V2.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2V4z"}))},InsertPluginIcon=function(props){return React.createElement("svg",Object.assign({viewBox:"0 0 19 19",width:"19",height:"19"},props),React.createElement("path",{d:"M4.889 5L1 8.89l3.889 3.888.707-.708-3.182-3.18 3.182-3.184zm8.818 7.779l3.89-3.89L13.706 5 13 5.708l3.182 3.181L13 12.072z"}),React.createElement("path",{stroke:"currentColor",d:"M11.948 2L7 15.978"}))},Adsense=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"24",viewBox:"0 0 24 24"},props),React.createElement("g",{fillRule:"evenodd"},React.createElement("path",{d:"M17.764 0c.277 0 .5.224.5.5 0 .075-.016.149-.049.216l-2.767 5.767L8.702 20.99 8.7 20.99l-.199.431c-.163.354-.518.58-.907.58H.5c-.276 0-.5-.224-.5-.5 0-.078.018-.154.053-.224l1.593-3.187L7.618 5.283l-.04.028L9.768.58c.163-.354.518-.58.907-.58h7.09zM20.848 11c.276 0 .5.224.5.5 0 .076-.017.15-.05.218l-1.505 3.099-2.814 6.034-.262.57c-.164.353-.518.579-.907.579h-4.687v-.001L9.691 22l1.644-3.469L14.845 11h6.003z",transform:"translate(1 1)"})))},DEFAULTS_CONFIG={alignment:"center"},htmlButtonsTypes={html:"html",adsense:"adsense"},defaults=function(isAdsense){return{srcType:"html",src:"",config:_extends({},DEFAULTS_CONFIG,isAdsense&&{isAdsense:isAdsense})}},styles$2_container="_2rikd",styles$2_tooltip="_2JU9j",AdsenseTitle=function(_ref){var t=_ref.t;return React.createElement("div",{className:styles$2_container},t("HtmlEditPanel_HtmlInput_AdSense_Title"),React.createElement("div",{className:styles$2_tooltip},React.createElement(InfoIcon,{tooltipText:t("HtmlEditPanel_HtmlInput_AdSense_Tooltip")})))},styles$1={fontElementMap:"tBbsp",htmlEditPanel_button:"l7Urd",htmlEditPanel:"_1Whgf",htmlEditPanel_input:"_1vXv2",htmlEditPanel_textArea:"_33T-k",htmlEditPanel_buttons:"_3W4Az",htmlEditPanel_primaryButton:"RVO-5",htmlEditPanel_secondaryButton:"_1zKYg"},VALIDATORS=((_VALIDATORS={}).html=function(){return null},_VALIDATORS.url=function(url){var error=null;return url&&isValidUrl(url)?!startsWithHttps(url)&&hasProtocol(url)&&(error="HtmlEditPanel_HttpsError"):error="HtmlEditPanel_UrlError",error},_VALIDATORS),NORMALIZERS=((_NORMALIZERS={}).html=identity,_NORMALIZERS.url=function(url){return hasProtocol(url)?url:"https://"+trimStart(url,"//")},_NORMALIZERS),HtmlEditPanel=function(_Component){function HtmlEditPanel(){for(var _this$state,_this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).initialData=_this.props.componentData,_this.styles=mergeStyles({styles:styles$1,theme:_this.props.theme}),_this.state=((_this$state={srcType:_this.initialData.srcType})[_this.initialData.srcType]=_this.initialData.src,_this$state.submitted=!1,_this$state),_this.handleSrcTypeChange=function(srcType){_this.setState({srcType:srcType})},_this.handleSrcChange=function(target){var _this$setState,name=target.name,value=target.value;_this.setState(((_this$setState={})[name]=value,_this$setState),(function(){return _this.updateComponentData()}))},_this.handleCancelClick=function(){_this.props.store.update("componentData",_this.initialData),_this.props.close()},_this.updateComponentData=function(){var srcType=_this.state.srcType;_this.isValid()&&_this.props.store.update("componentData",{srcType:srcType,src:NORMALIZERS[srcType](_this.state[srcType])||""}),_this.setState({submitted:!0})},_this.getError=function(){var srcType=_this.state.srcType;return VALIDATORS[srcType](_this.state[srcType])},_this.isValid=function(){return!_this.getError()},_this.render=function(){var styles=_assertThisInitialized(_this).styles,_this$state2=_this.state,srcType=_this$state2.srcType,submitted=_this$state2.submitted,_this$props=_this.props,t=_this$props.t,tabIndex=_this$props.tabIndex,theme=_this$props.theme,config=_this$props.componentData.config,inputBaseProps={onChange:_this.handleSrcChange,getTarget:!0,tabIndex:tabIndex,theme:theme};return React.createElement("div",{className:styles.htmlEditPanel},null!=config&&config.isAdsense?React.createElement(AdsenseTitle,{t:t}):React.createElement(RadioGroupHorizontal,{theme:theme,name:"srcType",value:_this.state.srcType,onChange:_this.handleSrcTypeChange,dataSource:[{value:"html",labelText:t("HtmlEditPanel_Code"),dataHook:"htmlEditPanel_radioHtml"},{value:"url",labelText:t("HtmlEditPanel_Source"),dataHook:"htmlEditPanel_radioUrl"}],inline:!0}),React.createElement("div",{className:styles.htmlEditPanel_input},"html"===srcType&&React.createElement("div",{className:styles.htmlEditPanel_textArea},React.createElement(InputWithLabel,_extends({name:"html",value:_this.state.html,placeholder:null!=config&&config.isAdsense?t("HtmlEditPanel_HtmlInput_AdSense_Placeholder"):t("HtmlEditPanel_HtmlInput_Placeholder"),isTextArea:!0,isFullHeight:!0,dataHook:"htmlEditPanel_htmlInput"},inputBaseProps))),"url"===srcType&&React.createElement(TextInput,_extends({name:"url",value:_this.state.url,"data-hook":"htmlEditPanel_htmlInput",error:submitted?t(_this.getError()):null,placeholder:t("HtmlEditPanel_UrlInput_Placeholder")},inputBaseProps))),React.createElement("div",{className:styles.htmlEditPanel_buttons},React.createElement("button",{className:classNames(styles.htmlEditPanel_button,styles.htmlEditPanel_secondaryButton),onClick:_this.handleCancelClick,"data-hook":"htmlEditPanel_Cancel"},t("HtmlEditPanel_Cancel")),React.createElement("button",{className:classNames(styles.htmlEditPanel_button,styles.htmlEditPanel_primaryButton),onClick:_this.props.close,"data-hook":"htmlEditPanel_Update"},t("HtmlEditPanel_Update"))))},_this}return _inheritsLoose(HtmlEditPanel,_Component),HtmlEditPanel}(Component),getAlignmentButtonPropsFn=function(getEditorBounds){return function(_ref){var _componentData$config,componentData=_ref.componentData,editorBounds=null==getEditorBounds?void 0:getEditorBounds(),maxAlignmentWidth=editorBounds?editorBounds.width-1:739;return{disabled:((null==componentData||null===(_componentData$config=componentData.config)||void 0===_componentData$config?void 0:_componentData$config.width)||0)>maxAlignmentWidth}}},TOOLTIP_TEXT_BY_SRC_TYPE=((_TOOLTIP_TEXT_BY_SRC_={}).html="HtmlPlugin_EditHtml_Tooltip",_TOOLTIP_TEXT_BY_SRC_.url="HtmlPlugin_EditUrl_Tooltip",_TOOLTIP_TEXT_BY_SRC_),createInlineButtons=function(_ref2){var _settings$toolbar,_ref2$settings=_ref2.settings,settings=void 0===_ref2$settings?{}:_ref2$settings,getEditorBounds=_ref2.getEditorBounds,maxWidth=settings.maxWidth,_settings$minWidth=settings.minWidth,minWidth=void 0===_settings$minWidth?35:_settings$minWidth,_settings$maxHeight=settings.maxHeight,maxHeight=void 0===_settings$maxHeight?1200:_settings$maxHeight,_settings$minHeight=settings.minHeight,minHeight=void 0===_settings$minHeight?35:_settings$minHeight,icons=(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar?void 0:_settings$toolbar.icons)||{};return[{type:BUTTONS.INLINE_PANEL,keyName:"edit",panelContent:translate()(HtmlEditPanel),icon:icons.edit||EditIcon,mapComponentDataToButtonProps:function(_ref3){var src=_ref3.src,srcType=_ref3.srcType;return{tooltipTextKey:src?TOOLTIP_TEXT_BY_SRC_TYPE[srcType]:"HtmlPlugin_EditEmpty_Tooltip"}}},{type:BUTTONS.SEPARATOR,keyName:"separator1"},{type:BUTTONS.WIDTH,getEditorBounds:getEditorBounds,keyName:"width",min:minWidth,mapStoreDataToPanelProps:function(){var bounds=getEditorBounds();return bounds&&bounds.width?{max:maxWidth?Math.min(maxWidth,bounds.width):bounds.width}:{max:maxWidth||940}}},{type:BUTTONS.HEIGHT,keyName:"height",min:minHeight,max:maxHeight,inputMax:9999},{type:BUTTONS.SEPARATOR,keyName:"separator2"},{type:BUTTONS.TEXT_ALIGN_LEFT,keyName:"alignLeft",icon:icons.alignLeft||SizeSmallLeftIcon,mapStoreDataToButtonProps:getAlignmentButtonPropsFn(getEditorBounds)},{type:BUTTONS.TEXT_ALIGN_CENTER,keyName:"alignCenter",icon:icons.alignCenter||SizeSmallCenterIcon},{type:BUTTONS.TEXT_ALIGN_RIGHT,keyName:"alignRight",icon:icons.alignRight||SizeSmallRightIcon,mapStoreDataToButtonProps:getAlignmentButtonPropsFn(getEditorBounds)},{type:BUTTONS.SEPARATOR,keyName:"separator3"},{type:BUTTONS.DELETE,keyName:"delete",mobile:!0}]},createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,_buttonsMap,helpers=_ref.helpers,t=_ref.t,settings=_ref.settings,_settings$exposeButto=settings.exposeButtons,exposeButtons=void 0===_settings$exposeButto?[htmlButtonsTypes.html]:_settings$exposeButto,siteDomain=settings.siteDomain,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,index=exposeButtons.indexOf(htmlButtonsTypes.adsense);!siteDomain&&index>-1&&exposeButtons.splice(index,1);var buttonsMap=((_buttonsMap={})[htmlButtonsTypes.html]={type:BUTTON_TYPES.BUTTON,name:INSERT_PLUGIN_BUTTONS.HTML,helpers:helpers,toolbars:[TOOLBARS.INSERT_PLUGIN,TOOLBARS.MOBILE,TOOLBARS.FOOTER,TOOLBARS.SIDE],tooltip:t("HtmlPlugin_InsertButton_Tooltip"),getIcon:function(){return icon},componentData:defaults(!1)},_buttonsMap[htmlButtonsTypes.adsense]={type:BUTTON_TYPES.BUTTON,name:INSERT_PLUGIN_BUTTONS.ADSENSE,componentData:defaults(!0),helpers:helpers,toolbars:[TOOLBARS.INSERT_PLUGIN,TOOLBARS.MOBILE,TOOLBARS.FOOTER,TOOLBARS.SIDE],section:"BlockToolbar_Section_Embed_Anywhere",tooltip:t("AdSensePlugin_InsertButton_Tooltip"),getIcon:function(){return Adsense}},_buttonsMap);return exposeButtons.map((function(buttonType){return buttonsMap[buttonType]}))},createToolbar=function(_ref){var helpers=_ref.helpers,t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,getEditorBounds=_ref.getEditorBounds;return{InlineButtons:createInlineButtons({settings:settings,getEditorBounds:getEditorBounds}),InsertButtons:isMobile?[]:createInsertButtons({helpers:helpers,t:t,settings:settings}),name:"html"}},htmlIframeSrc="\n <head>\n <style type=\"text/css\">\n iframe[class|='instagram'],\n blockquote[class|='instagram'] {\n /* fallback script for ios below */\n min-width: 0 !important;\n width: calc(100vw - 2px);\n }\n\n body {\n margin: 0;\n max-width: calc(100vw);\n display: inline-block;\n float: left;\n width: 100%;\n box-sizing: border-box;\n }\n body > iframe {\n margin: 0 !important;\n width: calc(100vw - 2px) !important;\n }\n body::before,\n body::after {\n content: '.';\n height: 0;\n margin: 0;\n overflow: hidden;\n visibility: hidden;\n display: block;\n clear: both;\n }\n </style>\n <script>\n var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n (function fixInstagramWidth() {\n // This is a fallback for the styles above. Because inline styles can't be overridden in ios.\n var callback = function() {\n try {\n if (document.body.firstChild.className.indexOf('instagram') >= 0) {\n document.body.firstChild.style.minWidth = '0';\n document.body.firstChild.style.width = 'calc(100vw - 2px)';\n }\n } catch (e) {}\n };\n\n var observer = new MutationObserver(callback);\n\n observer.observe(document, {\n childList: true,\n subtree: true,\n });\n })();\n\n function initSendHeight(id) {\n /**\n * Handle image load by triggering a resize\n */\n function imageLoaded(event) {\n if (!event || event.type !== 'load') {\n return;\n }\n\n var img = event.srcElement;\n // Remove image from loading stack\n var imageIndex = images.indexOf(img);\n if (imageIndex !== -1) {\n images.splice(imageIndex, 1);\n }\n\n handleResize();\n }\n\n /**\n * Add 'load' event listener and store reference to image\n * @param {elm} img Image being loaded\n */\n var images = [];\n function addImage(img) {\n if (images.indexOf(img) === -1) {\n img.addEventListener('load', imageLoaded);\n images.push(img);\n }\n }\n\n /**\n * Filter out images in the DOM that haven't loaded yet and add listener\n */\n function addImageLoadListeners() {\n var imgs = document.querySelectorAll('img');\n for (var i = 0; i < imgs.length; i++) {\n var image = imgs[i];\n // Do nothing if image is already loaded\n if (\n image.nodeName === 'IMG' &&\n image.src &&\n image.complete === false &&\n image.readyState !== 4\n ) {\n addImage(image);\n }\n }\n }\n\n function getHeight() {\n var height = parseInt(document.body.offsetHeight, 10);\n var styles = document.defaultView.getComputedStyle(document.body);\n height += parseInt(styles.getPropertyValue('margin-bottom'), 10);\n height += parseInt(styles.getPropertyValue('margin-top'), 10);\n return height;\n }\n\n function handleResize() {\n multipleDelayedSendHeight();\n }\n\n function handleIframeAdded(iframe) {\n if (isIOS) {\n iframe.onload = function() {\n var src = iframe.src; \n if (src.indexOf('reloadMe') > -1) {\n return;\n }\n iframe.src = src.replace('?', '?reloadMe=1&');\n };\n }\n }\n\n var timerId;\n function multipleDelayedSendHeight() {\n sendHeight();\n clearTimeout(timerId);\n let delay = 100;\n timerId = setTimeout(function request() {\n sendHeight();\n delay *= 2;\n if (delay < 20000) {\n timerId = setTimeout(request, delay);\n }\n }, delay);\n }\n\n function sendHeight() {\n var height = getHeight();\n parent.postMessage({ type: 'htmlPlugin:heightResize', id: id, height: height }, '*');\n }\n\n function setupMutationObserver() {\n var target = document.querySelector('body');\n var observer = new MutationObserver(function(mutations) {\n addImageLoadListeners();\n handleResize();\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(el) {\n if (el.nodeName === 'IFRAME') {\n handleIframeAdded(el);\n }\n });\n });\n });\n\n var config = {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n };\n\n observer.observe(target, config);\n }\n\n window.addEventListener('resize', handleResize); //this handles width change\n setupMutationObserver();\n handleResize();\n }\n\n window.addEventListener('message', function(event) {\n if (event.data.type !== 'htmlPlugin:updateContent') {\n return;\n }\n\n var content = [\n '<!DOCTYPE html>',\n '<html>',\n '<head>' + document.head.innerHTML + '</head>',\n '<body>' + event.data.content + '</body>',\n '</html>',\n ].join('');\n\n document.open('text/html', 'replace');\n document.write(content);\n document.close();\n initSendHeight(event.data.id);\n });\n <\/script>\n </head>\n\n <body></body>\n",styles_iframe="_2xvJT",_excluded=["iframeRef"],Iframe=function(_ref){var _context$experiments$,iframeRef=_ref.iframeRef,otherProps=_objectWithoutPropertiesLoose(_ref,_excluded),loading=null!==(_context$experiments$=useContext(GlobalContext).experiments.lazyImagesAndIframes)&&void 0!==_context$experiments$&&_context$experiments$.enabled?"lazy":void 0;return React.createElement("iframe",Object.assign({ref:iframeRef,className:styles_iframe,title:"remote content",style:{backgroundColor:"transparent"},loading:loading},otherProps))},isSSR="undefined"==typeof window,IframeHtml=function(_Component){function IframeHtml(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={shouldRender:!1},_this.id=Math.random().toString(36).substr(2,9),_this.writeToIframe=function(iframeElement){var _iframeElement$conten;_this.iframe=iframeElement;var iframeDocument=null==iframeElement||null===(_iframeElement$conten=iframeElement.contentWindow)||void 0===_iframeElement$conten?void 0:_iframeElement$conten.document;iframeDocument&&(iframeDocument.open("text/html","replace"),iframeDocument.write(htmlIframeSrc),iframeDocument.close())},_this.updateIframeContent=function(content){var _this$iframe;_this.shouldIgnoreLoad=!0,null===(_this$iframe=_this.iframe)||void 0===_this$iframe||_this$iframe.contentWindow.postMessage({type:"htmlPlugin:updateContent",id:_this.id,content:content},"*")},_this.handleIframeMessage=function(_ref){var data=_ref.data,type=data.type,id=data.id,height=data.height;"htmlPlugin:heightResize"===type&&id===_this.id&&_this.props.onHeightChange(height)},_this.handleIframeLoad=function(){!_this.shouldIgnoreLoad&&_this.updateIframeContent(_this.props.html)},_this.setIframe=function(iframe){_this.iframe=iframe},_this}_inheritsLoose(IframeHtml,_Component);var _proto=IframeHtml.prototype;return _proto.componentDidMount=function(){this.setState({shouldRender:!0}),!isSSR&&window.addEventListener("message",this.handleIframeMessage)},_proto.componentWillUnmount=function(){!isSSR&&window.removeEventListener("message",this.handleIframeMessage)},_proto.componentWillReceiveProps=function(nextProps){this.props.html!==nextProps.html&&this.updateIframeContent(nextProps.html)},_proto.render=function(){var iframeSandboxDomain=this.props.iframeSandboxDomain,iframeProps={style:{backgroundColor:"transparent"},onLoad:this.handleIframeLoad};if(iframeSandboxDomain){var strippedUrl=iframeSandboxDomain.replace(/\/$/,"");iframeProps.src=strippedUrl+"/html/db9376e69cfa487ea0fa0b912ae51a4f_v1.html",iframeProps.iframeRef=this.setIframe}else iframeProps.iframeRef=this.writeToIframe;return this.state.shouldRender?React.createElement(Iframe,iframeProps):null},IframeHtml}(Component),IframeUrl=function(props){return React.createElement(Iframe,Object.assign({},props,{sandbox:"allow-popups allow-presentation allow-forms allow-same-origin allow-scripts"}))},htmlComponentStyles={htmlComponent:"yuWXS",htmlComponent_placeholder:"_3tucQ"},HtmlComponent=function(_Component){function HtmlComponent(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={siteDomain:void 0},_this.setHeight=function(iframeHeight){var _this$props$store;iframeHeight!==_this.state.iframeHeight&&(_this.setState({iframeHeight:iframeHeight}),null===(_this$props$store=_this.props.store)||void 0===_this$props$store||_this$props$store.update("componentData",{config:{height:iframeHeight}}))},_this.getIframeHeight=function(){var _this$props=_this.props,_this$props$settings=_this$props.settings,height=(_this$props$settings=void 0===_this$props$settings?{}:_this$props$settings).height,config=_this$props.componentData.config,iframeHeight=_this.state.iframeHeight,maxDiff=Math.min(50,.1*_this.state.iframeHeight),normalizedHeight=iframeHeight;return config.height&&(normalizedHeight=iframeHeight&&config.height<iframeHeight&&config.height+maxDiff>iframeHeight?iframeHeight:config.height),normalizedHeight||height||550},_this}_inheritsLoose(HtmlComponent,_Component);var _proto=HtmlComponent.prototype;return _proto.componentDidMount=function(){var _this$props2=this.props,config=_this$props2.componentData.config,_this$props2$settings=_this$props2.settings,settings=void 0===_this$props2$settings?{}:_this$props2$settings,width=settings.width,height=settings.height,siteDomain=settings.siteDomain;config.width||(width?config.width=width:this.element?config.width=this.element.getBoundingClientRect().width:config.width=350),config.height||(config.height=height||550),this.setState({siteDomain:siteDomain})},HtmlComponent.getDerivedStateFromProps=function(props,state){var componentData=props.componentData;if("html"===componentData.srcType){var html=componentData&&componentData.src,pageURL=function(siteDomain){if(siteDomain){var res=/http.+com/gm.exec(siteDomain);return res?res[0]:res}}(state.siteDomain);if(pageURL&&html&&html.includes&&html.includes("adsbygoogle")){var updatedAd='<ins class="adsbygoogle"\n\tdata-page-url="'+pageURL+'"';html=html.replace(new RegExp('<ins class="adsbygoogle"',"g"),updatedAd)}return{html:html}}},_proto.render=function(){var _this$context$experim,_this2=this,html=this.state.html,_this$props3=this.props,iframeSandboxDomain=_this$props3.iframeSandboxDomain,theme=_this$props3.theme,componentData=_this$props3.componentData,_this$props3$settings=_this$props3.settings,width=(_this$props3$settings=void 0===_this$props3$settings?{}:_this$props3$settings).width;this.styles=this.styles||mergeStyles({styles:htmlComponentStyles,theme:theme}),validate(componentData,pluginHtmlSchema);var src=componentData.src,srcType=componentData.srcType,_componentData$config=componentData.config,currentWidth=(_componentData$config=void 0===_componentData$config?{}:_componentData$config).width,style={width:this.props.isMobile?"auto":currentWidth||width||350,height:this.getIframeHeight(),maxHeight:this.state.iframeHeight,maxWidth:"100%"};return React.createElement("div",{className:this.styles.htmlComponent,ref:function(_ref){return _this2.element=_ref},style:style,"data-hook":"HtmlComponent"},"html"===srcType&&src&&React.createElement(IframeHtml,{iframeSandboxDomain:iframeSandboxDomain||(null===(_this$context$experim=this.context.experiments.forceIframeSandboxDomain)||void 0===_this$context$experim?void 0:_this$context$experim.enabled)&&"https://www.filesusr.com",key:"html",tabIndex:0,html:html,onHeightChange:this.setHeight}),"url"===srcType&&isValidUrl(src)&&React.createElement(IframeUrl,{key:"url",tabIndex:0,src:normalizeUrl(src)}),!src&&!isValidUrl(src)&&React.createElement("div",{className:this.styles.htmlComponent_placeholder}))},HtmlComponent}(Component);HtmlComponent.contextType=GlobalContext;var HTML_TYPE="wix-draft-plugin-html";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)}var createHtmlPlugin=function(config){var helpers=config.helpers,isMobile=config.isMobile,t=config.t,_config$HTML_TYPE=config[HTML_TYPE],settings=void 0===_config$HTML_TYPE?{}:_config$HTML_TYPE,getEditorBounds=config.getEditorBounds,rest=_objectWithoutPropertiesLoose(config,["helpers","isMobile","t",HTML_TYPE,"getEditorBounds"].map(_toPropertyKey)),simulateEditClick=function(_ref){var e=_ref.e,pubsub=_ref.pubsub;return setTimeout((function(){return pubsub.set("onClickTrigger",{event:e,key:"edit"})}))};return createBasePlugin(_extends({onOverlayClick:simulateEditClick,component:HtmlComponent,settings:settings,type:HTML_TYPE,toolbar:createToolbar({helpers:helpers,t:t,isMobile:isMobile,settings:settings,getEditorBounds:getEditorBounds}),helpers:helpers,isMobile:isMobile,t:t,getEditorBounds:getEditorBounds,defaultPluginData:defaults(),onComponentMount:simulateEditClick},rest))};createHtmlPlugin.functionName=HTML_TYPE;var createHtmlData=function(pluginData,isRicosSchema){void 0===pluginData&&(pluginData={}),void 0===isRicosSchema&&(isRicosSchema=!1);var htmlData=isRicosSchema?convertNodeDataToDraft("HTML",pluginData):pluginData;return merge({},defaults(),htmlData)},pluginHtml=function(config){return{config:_extends({},DEFAULTS_CONFIG,config),type:HTML_TYPE,createPlugin:createHtmlPlugin,ModalsMap:{},createPluginData:createHtmlData}};export{HTML_TYPE,createHtmlPlugin,htmlButtonsTypes,pluginHtml};
//# sourceMappingURL=module.js.map

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

"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"),classNames=require("classnames");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),classNames__default=_interopDefaultLegacy(classNames),ArrowIcon=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("g",{fillRule:"evenodd"},React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M11.999 9L6 14.241 6.657 15 11.999 10.334 17.343 15 18 14.241z",transform:"translate(-129 -185) translate(97 105) translate(23 71) rotate(-90 21 12) matrix(1 0 0 -1 0 24)"})))))))},styles$1={ltr:"E6y_Z",rtl:"_2wLEl",iconContainer:"_21s0b",icon:"_2z8L4",isExpanded:"aPvla"};function ExpandCollapseButton(props){var onClick=props.onClick,idx=props.idx,ariaLabel=props.ariaLabel;return React__default.default.createElement("div",{role:"button",tabIndex:"-1",className:styles$1.iconContainer,onClick:onClick,onKeyUp:function(e){return(" "===e.key||"Enter"===e.key)&&onClick(e)},"data-hook":"ExpandCollapseButton_"+idx},React__default.default.createElement(ArrowIcon,{role:"button",tabIndex:"0","aria-label":ariaLabel,className:classNames__default.default(styles$1.icon,props.isExpanded&&styles$1.isExpanded)}))}var styles={titleContainer:"_3LwlN",title:"_3CwVy",content:"_3TxVS"},COLLAPSIBLE_LIST_TYPE="wix-rich-content-plugin-collapsible-list",CollapsibleListPair=function(_Component){function CollapsibleListPair(props){var _this;(_this=_Component.call(this,props)||this).focusTitle=function(){var _this$titleEditorRef$;return null===(_this$titleEditorRef$=_this.titleEditorRef.current)||void 0===_this$titleEditorRef$?void 0:_this$titleEditorRef$.focus()},_this.renderTitle=function(){var _this$props=_this.props,idx=_this$props.idx,renderTitle=_this$props.renderTitle;return React__default.default.createElement("div",{className:_this.styles.title},renderTitle(idx,_this.titleEditorRef))},_this.focusContent=function(){var _this$contentEditorRe;return null===(_this$contentEditorRe=_this.contentEditorRef.current)||void 0===_this$contentEditorRe?void 0:_this$contentEditorRe.focus()},_this.renderContent=function(){var _this$props2=_this.props,idx=_this$props2.idx,renderContent=_this$props2.renderContent;return _this$props2.isExpanded&&React__default.default.createElement("div",{className:_this.styles.content},renderContent(idx,_this.contentEditorRef))},_this.onClick=function(e){var _helpers$onViewerActi,_this$props3=_this.props,isExpanded=_this$props3.isExpanded,onCollapseClick=_this$props3.onCollapseClick,onExpandClick=_this$props3.onExpandClick,idx=_this$props3.idx,helpers=_this$props3.helpers,isInEditor=_this$props3.isInEditor;isExpanded?onCollapseClick(idx):onExpandClick(idx),null===(_helpers$onViewerActi=helpers.onViewerAction)||void 0===_helpers$onViewerActi||_helpers$onViewerActi.call(helpers,COLLAPSIBLE_LIST_TYPE,"Click",isExpanded?"collapse":"expand"),isInEditor||(e.preventDefault(),setTimeout((function(){return wixRichContentCommon.anchorScroll(_this.pairRef,_this.context.experiments)})))},_this.onKeyDown=function(e){"a"===e.key&&(e.ctrlKey||e.metaKey)&&e.stopPropagation()};var theme=props.theme;return _this.styles=wixRichContentCommon.mergeStyles({styles:styles,theme:theme}),_this.titleEditorRef=React__default.default.createRef(),_this.contentEditorRef=React__default.default.createRef(),_this.pairRef=React__default.default.createRef(),_this}return _inheritsLoose__default.default(CollapsibleListPair,_Component),CollapsibleListPair.prototype.render=function(){var _this2=this,_this$props4=this.props,isExpanded=_this$props4.isExpanded,idx=_this$props4.idx,t=_this$props4.t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement("div",{className:this.styles.titleContainer,onKeyDown:this.onKeyDown,ref:function(_ref){return _this2.pairRef=_ref}},React__default.default.createElement(ExpandCollapseButton,{isExpanded:isExpanded,onClick:this.onClick,idx:idx,ariaLabel:t(isExpanded?"CollapsibleListPlugin_ExpandButton_AriaLabel":"CollapsibleListPlugin_CollapseButton_AriaLabel")}),this.renderTitle()),this.renderContent())},CollapsibleListPair}(React.Component);CollapsibleListPair.contextType=wixRichContentCommon.GlobalContext;var DEFAULTS=Object.freeze({config:{expandState:"first_expanded",expandOnlyOne:!1},pairs:[{key:wixRichContentCommon.generateKey()}]}),getPairsAllCollpased=function(pairs){return pairs.map((function(){return!1}))},getDefaultPairsState=function(pairs,defaultPairsExpandState){var pairsState="expanded"===defaultPairsExpandState?function(pairs){return pairs.map((function(){return!0}))}(pairs):getPairsAllCollpased(pairs);return"first_expanded"===defaultPairsExpandState&&(pairsState[0]=!0),pairsState},CollapsibleListPairs=function(_Component){function CollapsibleListPairs(props){var _this;return(_this=_Component.call(this,props)||this).focusPair=function(_ref){var idx=_ref.idx,isTitle=_ref.isTitle,pair=_this.pairsRefs[idx];isTitle?null==pair||pair.focusTitle():(null==pair?void 0:pair.focusContent())||null==pair||pair.focusTitle()},_this.expandPair=function(idx){var _this$props=_this.props,pairs=_this$props.pairs,expandOnlyOne=_this$props.expandOnlyOne,pairsState=_this.state.pairsState;expandOnlyOne&&(pairsState=getPairsAllCollpased(pairs)),pairsState[idx]=!0,_this.setState({pairsState:pairsState})},_this.collapsePair=function(idx){var pairsState=[].concat(_this.state.pairsState);pairsState[idx]=!1,_this.setState({pairsState:pairsState})},_this.insertNewPair=function(){var expandOnlyOne=_this.state.expandOnlyOne,pairsState=_this.state.pairsState;expandOnlyOne&&(pairsState=getPairsAllCollpased(pairsState)),pairsState=[].concat(pairsState,[!0]),_this.setState({pairsState:pairsState})},_this.deletePair=function(idx){var pairsState=_this.state.pairsState;pairsState.splice(idx,1),_this.setState({pairsState:pairsState})},_this.reorderPairs=function(startIdx,endIdx){var pairsState=_this.state.pairsState,pairToMove=pairsState.splice(startIdx,1)[0];pairsState.splice(endIdx,0,pairToMove),_this.setState({pairsState:pairsState})},_this.pairsRefs=[],_this.state=_this.initState(props),_this}_inheritsLoose__default.default(CollapsibleListPairs,_Component);var _proto=CollapsibleListPairs.prototype;return _proto.initState=function(props){var pairs=props.pairs,expandState=props.expandState;return{defaultPairsExpandState:expandState,expandOnlyOne:props.expandOnlyOne,pairsState:getDefaultPairsState(pairs,expandState)}},CollapsibleListPairs.getDerivedStateFromProps=function(props,state){var pairs=props.pairs,expandState=props.expandState,expandOnlyOne=props.expandOnlyOne;return state.defaultPairsExpandState!==expandState||expandOnlyOne&&expandOnlyOne!==state.expandOnlyOne?{defaultPairsExpandState:expandState,expandOnlyOne:expandOnlyOne,pairsState:getDefaultPairsState(pairs,expandState)}:null},_proto.render=function(){var _this2=this,_this$props2=this.props,pairs=_this$props2.pairs,PairWrapper=_this$props2.PairWrapper,t=_this$props2.t,theme=_this$props2.theme,renderTitle=_this$props2.renderTitle,renderContent=_this$props2.renderContent,helpers=_this$props2.helpers,isInEditor=_this$props2.isInEditor,pairsState=this.state.pairsState;return pairs.map((function(pair,idx){return React__default.default.createElement(PairWrapper,{key:pair.key,id:pair.key,index:idx},React__default.default.createElement(CollapsibleListPair,{ref:function(_ref2){return _this2.pairsRefs[idx]=_ref2},t:t,key:pair.key,idx:idx,isExpanded:pairsState[idx],onCollapseClick:_this2.collapsePair,onExpandClick:_this2.expandPair,theme:theme,renderTitle:renderTitle,renderContent:renderContent,helpers:helpers,isInEditor:isInEditor}))}))},CollapsibleListPairs}(React.Component);CollapsibleListPairs.defaultProps={PairWrapper:"div"};var CollapsibleListViewer=function(_Component){function CollapsibleListViewer(props){var _this;(_this=_Component.call(this,props)||this).getPair=function(idx){return _this.props.componentData.pairs[idx]},_this.renderInnerRCV=function(contentState){var _this$props=_this.props,innerRCV=_this$props.innerRCV,componentData=_this$props.componentData;return innerRCV({contentState:contentState,textAlignment:function(componentData){return"ltr"===componentData.config.direction?"left":"right"}(componentData),direction:function(componentData){return componentData.config.direction}(componentData)})},_this.renderTitle=function(idx){var pair=_this.getPair(idx);return _this.renderInnerRCV(pair.title)},_this.renderContent=function(idx){var pair=_this.getPair(idx);return _this.renderInnerRCV(pair.content)};var theme=props.theme;return _this.styles=wixRichContentCommon.mergeStyles({styles:styles$1,theme:theme}),_this}return _inheritsLoose__default.default(CollapsibleListViewer,_Component),CollapsibleListViewer.prototype.render=function(){var _this$props2=this.props,theme=_this$props2.theme,t=_this$props2.t,componentData=_this$props2.componentData,isMobile=_this$props2.isMobile,helpers=_this$props2.helpers,config=componentData.config,pairs=componentData.pairs,direction=config.direction,expandState=config.expandState,expandOnlyOne=config.expandOnlyOne;return React__default.default.createElement("div",{className:this.styles[direction]},React__default.default.createElement(CollapsibleListPairs,{theme:theme,t:t,isMobile:isMobile,pairs:pairs,expandState:expandState,expandOnlyOne:expandOnlyOne,renderTitle:this.renderTitle,renderContent:this.renderContent,helpers:helpers}))},CollapsibleListViewer}(React.Component),typeMapper=function(){var _ref;return(_ref={})[COLLAPSIBLE_LIST_TYPE]={component:CollapsibleListViewer},_ref};exports.COLLAPSIBLE_LIST_TYPE=COLLAPSIBLE_LIST_TYPE,exports.collapsibleListTypeMapper=typeMapper,exports.pluginCollapsibleList=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:COLLAPSIBLE_LIST_TYPE,typeMapper:typeMapper}};
"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"),pluginHtmlSchema=require("wix-rich-content-common/dist/statics/schemas/plugin-html.schema.json"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose");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),pluginHtmlSchema__default=_interopDefaultLegacy(pluginHtmlSchema),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),DEFAULTS_VIEWER={},htmlIframeSrc="\n <head>\n <style type=\"text/css\">\n iframe[class|='instagram'],\n blockquote[class|='instagram'] {\n /* fallback script for ios below */\n min-width: 0 !important;\n width: calc(100vw - 2px);\n }\n\n body {\n margin: 0;\n max-width: calc(100vw);\n display: inline-block;\n float: left;\n width: 100%;\n box-sizing: border-box;\n }\n body > iframe {\n margin: 0 !important;\n width: calc(100vw - 2px) !important;\n }\n body::before,\n body::after {\n content: '.';\n height: 0;\n margin: 0;\n overflow: hidden;\n visibility: hidden;\n display: block;\n clear: both;\n }\n </style>\n <script>\n var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n (function fixInstagramWidth() {\n // This is a fallback for the styles above. Because inline styles can't be overridden in ios.\n var callback = function() {\n try {\n if (document.body.firstChild.className.indexOf('instagram') >= 0) {\n document.body.firstChild.style.minWidth = '0';\n document.body.firstChild.style.width = 'calc(100vw - 2px)';\n }\n } catch (e) {}\n };\n\n var observer = new MutationObserver(callback);\n\n observer.observe(document, {\n childList: true,\n subtree: true,\n });\n })();\n\n function initSendHeight(id) {\n /**\n * Handle image load by triggering a resize\n */\n function imageLoaded(event) {\n if (!event || event.type !== 'load') {\n return;\n }\n\n var img = event.srcElement;\n // Remove image from loading stack\n var imageIndex = images.indexOf(img);\n if (imageIndex !== -1) {\n images.splice(imageIndex, 1);\n }\n\n handleResize();\n }\n\n /**\n * Add 'load' event listener and store reference to image\n * @param {elm} img Image being loaded\n */\n var images = [];\n function addImage(img) {\n if (images.indexOf(img) === -1) {\n img.addEventListener('load', imageLoaded);\n images.push(img);\n }\n }\n\n /**\n * Filter out images in the DOM that haven't loaded yet and add listener\n */\n function addImageLoadListeners() {\n var imgs = document.querySelectorAll('img');\n for (var i = 0; i < imgs.length; i++) {\n var image = imgs[i];\n // Do nothing if image is already loaded\n if (\n image.nodeName === 'IMG' &&\n image.src &&\n image.complete === false &&\n image.readyState !== 4\n ) {\n addImage(image);\n }\n }\n }\n\n function getHeight() {\n var height = parseInt(document.body.offsetHeight, 10);\n var styles = document.defaultView.getComputedStyle(document.body);\n height += parseInt(styles.getPropertyValue('margin-bottom'), 10);\n height += parseInt(styles.getPropertyValue('margin-top'), 10);\n return height;\n }\n\n function handleResize() {\n multipleDelayedSendHeight();\n }\n\n function handleIframeAdded(iframe) {\n if (isIOS) {\n iframe.onload = function() {\n var src = iframe.src; \n if (src.indexOf('reloadMe') > -1) {\n return;\n }\n iframe.src = src.replace('?', '?reloadMe=1&');\n };\n }\n }\n\n var timerId;\n function multipleDelayedSendHeight() {\n sendHeight();\n clearTimeout(timerId);\n let delay = 100;\n timerId = setTimeout(function request() {\n sendHeight();\n delay *= 2;\n if (delay < 20000) {\n timerId = setTimeout(request, delay);\n }\n }, delay);\n }\n\n function sendHeight() {\n var height = getHeight();\n parent.postMessage({ type: 'htmlPlugin:heightResize', id: id, height: height }, '*');\n }\n\n function setupMutationObserver() {\n var target = document.querySelector('body');\n var observer = new MutationObserver(function(mutations) {\n addImageLoadListeners();\n handleResize();\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(el) {\n if (el.nodeName === 'IFRAME') {\n handleIframeAdded(el);\n }\n });\n });\n });\n\n var config = {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n };\n\n observer.observe(target, config);\n }\n\n window.addEventListener('resize', handleResize); //this handles width change\n setupMutationObserver();\n handleResize();\n }\n\n window.addEventListener('message', function(event) {\n if (event.data.type !== 'htmlPlugin:updateContent') {\n return;\n }\n\n var content = [\n '<!DOCTYPE html>',\n '<html>',\n '<head>' + document.head.innerHTML + '</head>',\n '<body>' + event.data.content + '</body>',\n '</html>',\n ].join('');\n\n document.open('text/html', 'replace');\n document.write(content);\n document.close();\n initSendHeight(event.data.id);\n });\n <\/script>\n </head>\n\n <body></body>\n",styles_iframe="_2xvJT",_excluded=["iframeRef"],Iframe=function(_ref){var _context$experiments$,iframeRef=_ref.iframeRef,otherProps=_objectWithoutPropertiesLoose__default.default(_ref,_excluded),loading=null!==(_context$experiments$=React.useContext(wixRichContentCommon.GlobalContext).experiments.lazyImagesAndIframes)&&void 0!==_context$experiments$&&_context$experiments$.enabled?"lazy":void 0;return React__default.default.createElement("iframe",Object.assign({ref:iframeRef,className:styles_iframe,title:"remote content",style:{backgroundColor:"transparent"},loading:loading},otherProps))},isSSR="undefined"==typeof window,IframeHtml=function(_Component){function IframeHtml(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={shouldRender:!1},_this.id=Math.random().toString(36).substr(2,9),_this.writeToIframe=function(iframeElement){var _iframeElement$conten;_this.iframe=iframeElement;var iframeDocument=null==iframeElement||null===(_iframeElement$conten=iframeElement.contentWindow)||void 0===_iframeElement$conten?void 0:_iframeElement$conten.document;iframeDocument&&(iframeDocument.open("text/html","replace"),iframeDocument.write(htmlIframeSrc),iframeDocument.close())},_this.updateIframeContent=function(content){var _this$iframe;_this.shouldIgnoreLoad=!0,null===(_this$iframe=_this.iframe)||void 0===_this$iframe||_this$iframe.contentWindow.postMessage({type:"htmlPlugin:updateContent",id:_this.id,content:content},"*")},_this.handleIframeMessage=function(_ref){var data=_ref.data,type=data.type,id=data.id,height=data.height;"htmlPlugin:heightResize"===type&&id===_this.id&&_this.props.onHeightChange(height)},_this.handleIframeLoad=function(){!_this.shouldIgnoreLoad&&_this.updateIframeContent(_this.props.html)},_this.setIframe=function(iframe){_this.iframe=iframe},_this}_inheritsLoose__default.default(IframeHtml,_Component);var _proto=IframeHtml.prototype;return _proto.componentDidMount=function(){this.setState({shouldRender:!0}),!isSSR&&window.addEventListener("message",this.handleIframeMessage)},_proto.componentWillUnmount=function(){!isSSR&&window.removeEventListener("message",this.handleIframeMessage)},_proto.componentWillReceiveProps=function(nextProps){this.props.html!==nextProps.html&&this.updateIframeContent(nextProps.html)},_proto.render=function(){var iframeSandboxDomain=this.props.iframeSandboxDomain,iframeProps={style:{backgroundColor:"transparent"},onLoad:this.handleIframeLoad};if(iframeSandboxDomain){var strippedUrl=iframeSandboxDomain.replace(/\/$/,"");iframeProps.src=strippedUrl+"/html/db9376e69cfa487ea0fa0b912ae51a4f_v1.html",iframeProps.iframeRef=this.setIframe}else iframeProps.iframeRef=this.writeToIframe;return this.state.shouldRender?React__default.default.createElement(Iframe,iframeProps):null},IframeHtml}(React.Component),IframeUrl=function(props){return React__default.default.createElement(Iframe,Object.assign({},props,{sandbox:"allow-popups allow-presentation allow-forms allow-same-origin allow-scripts"}))},htmlComponentStyles={htmlComponent:"yuWXS",htmlComponent_placeholder:"_3tucQ"},HtmlComponent=function(_Component){function HtmlComponent(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={siteDomain:void 0},_this.setHeight=function(iframeHeight){var _this$props$store;iframeHeight!==_this.state.iframeHeight&&(_this.setState({iframeHeight:iframeHeight}),null===(_this$props$store=_this.props.store)||void 0===_this$props$store||_this$props$store.update("componentData",{config:{height:iframeHeight}}))},_this.getIframeHeight=function(){var _this$props=_this.props,_this$props$settings=_this$props.settings,height=(_this$props$settings=void 0===_this$props$settings?{}:_this$props$settings).height,config=_this$props.componentData.config,iframeHeight=_this.state.iframeHeight,maxDiff=Math.min(50,.1*_this.state.iframeHeight),normalizedHeight=iframeHeight;return config.height&&(normalizedHeight=iframeHeight&&config.height<iframeHeight&&config.height+maxDiff>iframeHeight?iframeHeight:config.height),normalizedHeight||height||550},_this}_inheritsLoose__default.default(HtmlComponent,_Component);var _proto=HtmlComponent.prototype;return _proto.componentDidMount=function(){var _this$props2=this.props,config=_this$props2.componentData.config,_this$props2$settings=_this$props2.settings,settings=void 0===_this$props2$settings?{}:_this$props2$settings,width=settings.width,height=settings.height,siteDomain=settings.siteDomain;config.width||(width?config.width=width:this.element?config.width=this.element.getBoundingClientRect().width:config.width=350),config.height||(config.height=height||550),this.setState({siteDomain:siteDomain})},HtmlComponent.getDerivedStateFromProps=function(props,state){var componentData=props.componentData;if("html"===componentData.srcType){var html=componentData&&componentData.src,pageURL=function(siteDomain){if(siteDomain){var res=/http.+com/gm.exec(siteDomain);return res?res[0]:res}}(state.siteDomain);if(pageURL&&html&&html.includes&&html.includes("adsbygoogle")){var updatedAd='<ins class="adsbygoogle"\n\tdata-page-url="'+pageURL+'"';html=html.replace(new RegExp('<ins class="adsbygoogle"',"g"),updatedAd)}return{html:html}}},_proto.render=function(){var _this$context$experim,_this2=this,html=this.state.html,_this$props3=this.props,iframeSandboxDomain=_this$props3.iframeSandboxDomain,theme=_this$props3.theme,componentData=_this$props3.componentData,_this$props3$settings=_this$props3.settings,width=(_this$props3$settings=void 0===_this$props3$settings?{}:_this$props3$settings).width;this.styles=this.styles||wixRichContentCommon.mergeStyles({styles:htmlComponentStyles,theme:theme}),wixRichContentCommon.validate(componentData,pluginHtmlSchema__default.default);var src=componentData.src,srcType=componentData.srcType,_componentData$config=componentData.config,currentWidth=(_componentData$config=void 0===_componentData$config?{}:_componentData$config).width,style={width:this.props.isMobile?"auto":currentWidth||width||350,height:this.getIframeHeight(),maxHeight:this.state.iframeHeight,maxWidth:"100%"};return React__default.default.createElement("div",{className:this.styles.htmlComponent,ref:function(_ref){return _this2.element=_ref},style:style,"data-hook":"HtmlComponent"},"html"===srcType&&src&&React__default.default.createElement(IframeHtml,{iframeSandboxDomain:iframeSandboxDomain||(null===(_this$context$experim=this.context.experiments.forceIframeSandboxDomain)||void 0===_this$context$experim?void 0:_this$context$experim.enabled)&&"https://www.filesusr.com",key:"html",tabIndex:0,html:html,onHeightChange:this.setHeight}),"url"===srcType&&wixRichContentCommon.isValidUrl(src)&&React__default.default.createElement(IframeUrl,{key:"url",tabIndex:0,src:wixRichContentCommon.normalizeUrl(src)}),!src&&!wixRichContentCommon.isValidUrl(src)&&React__default.default.createElement("div",{className:this.styles.htmlComponent_placeholder}))},HtmlComponent}(React.Component);HtmlComponent.contextType=wixRichContentCommon.GlobalContext;var HTML_TYPE="wix-draft-plugin-html",typeMapper=function(){var _ref;return(_ref={})[HTML_TYPE]={component:HtmlComponent},_ref};exports.HTML_TYPE=HTML_TYPE,exports.htmlTypeMapper=typeMapper,exports.pluginHtml=function(config){return{config:_extends__default.default({},DEFAULTS_VIEWER,config),type:HTML_TYPE,typeMapper:typeMapper}};
//# sourceMappingURL=module.viewer.cjs.js.map

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

import _extends from"@babel/runtime/helpers/extends";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component}from"react";import{anchorScroll,mergeStyles,GlobalContext,generateKey}from"wix-rich-content-common";import classNames from"classnames";var ArrowIcon=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("g",{fillRule:"evenodd"},React.createElement("g",null,React.createElement("g",null,React.createElement("g",null,React.createElement("g",null,React.createElement("path",{d:"M11.999 9L6 14.241 6.657 15 11.999 10.334 17.343 15 18 14.241z",transform:"translate(-129 -185) translate(97 105) translate(23 71) rotate(-90 21 12) matrix(1 0 0 -1 0 24)"})))))))},styles$1={ltr:"E6y_Z",rtl:"_2wLEl",iconContainer:"_21s0b",icon:"_2z8L4",isExpanded:"aPvla"};function ExpandCollapseButton(props){var onClick=props.onClick,idx=props.idx,ariaLabel=props.ariaLabel;return React.createElement("div",{role:"button",tabIndex:"-1",className:styles$1.iconContainer,onClick:onClick,onKeyUp:function(e){return(" "===e.key||"Enter"===e.key)&&onClick(e)},"data-hook":"ExpandCollapseButton_"+idx},React.createElement(ArrowIcon,{role:"button",tabIndex:"0","aria-label":ariaLabel,className:classNames(styles$1.icon,props.isExpanded&&styles$1.isExpanded)}))}var styles={titleContainer:"_3LwlN",title:"_3CwVy",content:"_3TxVS"},COLLAPSIBLE_LIST_TYPE="wix-rich-content-plugin-collapsible-list",CollapsibleListPair=function(_Component){function CollapsibleListPair(props){var _this;(_this=_Component.call(this,props)||this).focusTitle=function(){var _this$titleEditorRef$;return null===(_this$titleEditorRef$=_this.titleEditorRef.current)||void 0===_this$titleEditorRef$?void 0:_this$titleEditorRef$.focus()},_this.renderTitle=function(){var _this$props=_this.props,idx=_this$props.idx,renderTitle=_this$props.renderTitle;return React.createElement("div",{className:_this.styles.title},renderTitle(idx,_this.titleEditorRef))},_this.focusContent=function(){var _this$contentEditorRe;return null===(_this$contentEditorRe=_this.contentEditorRef.current)||void 0===_this$contentEditorRe?void 0:_this$contentEditorRe.focus()},_this.renderContent=function(){var _this$props2=_this.props,idx=_this$props2.idx,renderContent=_this$props2.renderContent;return _this$props2.isExpanded&&React.createElement("div",{className:_this.styles.content},renderContent(idx,_this.contentEditorRef))},_this.onClick=function(e){var _helpers$onViewerActi,_this$props3=_this.props,isExpanded=_this$props3.isExpanded,onCollapseClick=_this$props3.onCollapseClick,onExpandClick=_this$props3.onExpandClick,idx=_this$props3.idx,helpers=_this$props3.helpers,isInEditor=_this$props3.isInEditor;isExpanded?onCollapseClick(idx):onExpandClick(idx),null===(_helpers$onViewerActi=helpers.onViewerAction)||void 0===_helpers$onViewerActi||_helpers$onViewerActi.call(helpers,COLLAPSIBLE_LIST_TYPE,"Click",isExpanded?"collapse":"expand"),isInEditor||(e.preventDefault(),setTimeout((function(){return anchorScroll(_this.pairRef,_this.context.experiments)})))},_this.onKeyDown=function(e){"a"===e.key&&(e.ctrlKey||e.metaKey)&&e.stopPropagation()};var theme=props.theme;return _this.styles=mergeStyles({styles:styles,theme:theme}),_this.titleEditorRef=React.createRef(),_this.contentEditorRef=React.createRef(),_this.pairRef=React.createRef(),_this}return _inheritsLoose(CollapsibleListPair,_Component),CollapsibleListPair.prototype.render=function(){var _this2=this,_this$props4=this.props,isExpanded=_this$props4.isExpanded,idx=_this$props4.idx,t=_this$props4.t;return React.createElement(React.Fragment,null,React.createElement("div",{className:this.styles.titleContainer,onKeyDown:this.onKeyDown,ref:function(_ref){return _this2.pairRef=_ref}},React.createElement(ExpandCollapseButton,{isExpanded:isExpanded,onClick:this.onClick,idx:idx,ariaLabel:t(isExpanded?"CollapsibleListPlugin_ExpandButton_AriaLabel":"CollapsibleListPlugin_CollapseButton_AriaLabel")}),this.renderTitle()),this.renderContent())},CollapsibleListPair}(Component);CollapsibleListPair.contextType=GlobalContext;var DEFAULTS=Object.freeze({config:{expandState:"first_expanded",expandOnlyOne:!1},pairs:[{key:generateKey()}]}),getPairsAllCollpased=function(pairs){return pairs.map((function(){return!1}))},getDefaultPairsState=function(pairs,defaultPairsExpandState){var pairsState="expanded"===defaultPairsExpandState?function(pairs){return pairs.map((function(){return!0}))}(pairs):getPairsAllCollpased(pairs);return"first_expanded"===defaultPairsExpandState&&(pairsState[0]=!0),pairsState},CollapsibleListPairs=function(_Component){function CollapsibleListPairs(props){var _this;return(_this=_Component.call(this,props)||this).focusPair=function(_ref){var idx=_ref.idx,isTitle=_ref.isTitle,pair=_this.pairsRefs[idx];isTitle?null==pair||pair.focusTitle():(null==pair?void 0:pair.focusContent())||null==pair||pair.focusTitle()},_this.expandPair=function(idx){var _this$props=_this.props,pairs=_this$props.pairs,expandOnlyOne=_this$props.expandOnlyOne,pairsState=_this.state.pairsState;expandOnlyOne&&(pairsState=getPairsAllCollpased(pairs)),pairsState[idx]=!0,_this.setState({pairsState:pairsState})},_this.collapsePair=function(idx){var pairsState=[].concat(_this.state.pairsState);pairsState[idx]=!1,_this.setState({pairsState:pairsState})},_this.insertNewPair=function(){var expandOnlyOne=_this.state.expandOnlyOne,pairsState=_this.state.pairsState;expandOnlyOne&&(pairsState=getPairsAllCollpased(pairsState)),pairsState=[].concat(pairsState,[!0]),_this.setState({pairsState:pairsState})},_this.deletePair=function(idx){var pairsState=_this.state.pairsState;pairsState.splice(idx,1),_this.setState({pairsState:pairsState})},_this.reorderPairs=function(startIdx,endIdx){var pairsState=_this.state.pairsState,pairToMove=pairsState.splice(startIdx,1)[0];pairsState.splice(endIdx,0,pairToMove),_this.setState({pairsState:pairsState})},_this.pairsRefs=[],_this.state=_this.initState(props),_this}_inheritsLoose(CollapsibleListPairs,_Component);var _proto=CollapsibleListPairs.prototype;return _proto.initState=function(props){var pairs=props.pairs,expandState=props.expandState;return{defaultPairsExpandState:expandState,expandOnlyOne:props.expandOnlyOne,pairsState:getDefaultPairsState(pairs,expandState)}},CollapsibleListPairs.getDerivedStateFromProps=function(props,state){var pairs=props.pairs,expandState=props.expandState,expandOnlyOne=props.expandOnlyOne;return state.defaultPairsExpandState!==expandState||expandOnlyOne&&expandOnlyOne!==state.expandOnlyOne?{defaultPairsExpandState:expandState,expandOnlyOne:expandOnlyOne,pairsState:getDefaultPairsState(pairs,expandState)}:null},_proto.render=function(){var _this2=this,_this$props2=this.props,pairs=_this$props2.pairs,PairWrapper=_this$props2.PairWrapper,t=_this$props2.t,theme=_this$props2.theme,renderTitle=_this$props2.renderTitle,renderContent=_this$props2.renderContent,helpers=_this$props2.helpers,isInEditor=_this$props2.isInEditor,pairsState=this.state.pairsState;return pairs.map((function(pair,idx){return React.createElement(PairWrapper,{key:pair.key,id:pair.key,index:idx},React.createElement(CollapsibleListPair,{ref:function(_ref2){return _this2.pairsRefs[idx]=_ref2},t:t,key:pair.key,idx:idx,isExpanded:pairsState[idx],onCollapseClick:_this2.collapsePair,onExpandClick:_this2.expandPair,theme:theme,renderTitle:renderTitle,renderContent:renderContent,helpers:helpers,isInEditor:isInEditor}))}))},CollapsibleListPairs}(Component);CollapsibleListPairs.defaultProps={PairWrapper:"div"};var CollapsibleListViewer=function(_Component){function CollapsibleListViewer(props){var _this;(_this=_Component.call(this,props)||this).getPair=function(idx){return _this.props.componentData.pairs[idx]},_this.renderInnerRCV=function(contentState){var _this$props=_this.props,innerRCV=_this$props.innerRCV,componentData=_this$props.componentData;return innerRCV({contentState:contentState,textAlignment:function(componentData){return"ltr"===componentData.config.direction?"left":"right"}(componentData),direction:function(componentData){return componentData.config.direction}(componentData)})},_this.renderTitle=function(idx){var pair=_this.getPair(idx);return _this.renderInnerRCV(pair.title)},_this.renderContent=function(idx){var pair=_this.getPair(idx);return _this.renderInnerRCV(pair.content)};var theme=props.theme;return _this.styles=mergeStyles({styles:styles$1,theme:theme}),_this}return _inheritsLoose(CollapsibleListViewer,_Component),CollapsibleListViewer.prototype.render=function(){var _this$props2=this.props,theme=_this$props2.theme,t=_this$props2.t,componentData=_this$props2.componentData,isMobile=_this$props2.isMobile,helpers=_this$props2.helpers,config=componentData.config,pairs=componentData.pairs,direction=config.direction,expandState=config.expandState,expandOnlyOne=config.expandOnlyOne;return React.createElement("div",{className:this.styles[direction]},React.createElement(CollapsibleListPairs,{theme:theme,t:t,isMobile:isMobile,pairs:pairs,expandState:expandState,expandOnlyOne:expandOnlyOne,renderTitle:this.renderTitle,renderContent:this.renderContent,helpers:helpers}))},CollapsibleListViewer}(Component),typeMapper=function(){var _ref;return(_ref={})[COLLAPSIBLE_LIST_TYPE]={component:CollapsibleListViewer},_ref},pluginCollapsibleList=function(config){return{config:_extends({},DEFAULTS.config,config),type:COLLAPSIBLE_LIST_TYPE,typeMapper:typeMapper}};export{COLLAPSIBLE_LIST_TYPE,typeMapper as collapsibleListTypeMapper,pluginCollapsibleList};
import _extends from"@babel/runtime/helpers/extends";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{useContext,Component}from"react";import{GlobalContext,mergeStyles,validate,isValidUrl,normalizeUrl}from"wix-rich-content-common";import pluginHtmlSchema from"wix-rich-content-common/dist/statics/schemas/plugin-html.schema.json";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var DEFAULTS_VIEWER={},htmlIframeSrc="\n <head>\n <style type=\"text/css\">\n iframe[class|='instagram'],\n blockquote[class|='instagram'] {\n /* fallback script for ios below */\n min-width: 0 !important;\n width: calc(100vw - 2px);\n }\n\n body {\n margin: 0;\n max-width: calc(100vw);\n display: inline-block;\n float: left;\n width: 100%;\n box-sizing: border-box;\n }\n body > iframe {\n margin: 0 !important;\n width: calc(100vw - 2px) !important;\n }\n body::before,\n body::after {\n content: '.';\n height: 0;\n margin: 0;\n overflow: hidden;\n visibility: hidden;\n display: block;\n clear: both;\n }\n </style>\n <script>\n var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n (function fixInstagramWidth() {\n // This is a fallback for the styles above. Because inline styles can't be overridden in ios.\n var callback = function() {\n try {\n if (document.body.firstChild.className.indexOf('instagram') >= 0) {\n document.body.firstChild.style.minWidth = '0';\n document.body.firstChild.style.width = 'calc(100vw - 2px)';\n }\n } catch (e) {}\n };\n\n var observer = new MutationObserver(callback);\n\n observer.observe(document, {\n childList: true,\n subtree: true,\n });\n })();\n\n function initSendHeight(id) {\n /**\n * Handle image load by triggering a resize\n */\n function imageLoaded(event) {\n if (!event || event.type !== 'load') {\n return;\n }\n\n var img = event.srcElement;\n // Remove image from loading stack\n var imageIndex = images.indexOf(img);\n if (imageIndex !== -1) {\n images.splice(imageIndex, 1);\n }\n\n handleResize();\n }\n\n /**\n * Add 'load' event listener and store reference to image\n * @param {elm} img Image being loaded\n */\n var images = [];\n function addImage(img) {\n if (images.indexOf(img) === -1) {\n img.addEventListener('load', imageLoaded);\n images.push(img);\n }\n }\n\n /**\n * Filter out images in the DOM that haven't loaded yet and add listener\n */\n function addImageLoadListeners() {\n var imgs = document.querySelectorAll('img');\n for (var i = 0; i < imgs.length; i++) {\n var image = imgs[i];\n // Do nothing if image is already loaded\n if (\n image.nodeName === 'IMG' &&\n image.src &&\n image.complete === false &&\n image.readyState !== 4\n ) {\n addImage(image);\n }\n }\n }\n\n function getHeight() {\n var height = parseInt(document.body.offsetHeight, 10);\n var styles = document.defaultView.getComputedStyle(document.body);\n height += parseInt(styles.getPropertyValue('margin-bottom'), 10);\n height += parseInt(styles.getPropertyValue('margin-top'), 10);\n return height;\n }\n\n function handleResize() {\n multipleDelayedSendHeight();\n }\n\n function handleIframeAdded(iframe) {\n if (isIOS) {\n iframe.onload = function() {\n var src = iframe.src; \n if (src.indexOf('reloadMe') > -1) {\n return;\n }\n iframe.src = src.replace('?', '?reloadMe=1&');\n };\n }\n }\n\n var timerId;\n function multipleDelayedSendHeight() {\n sendHeight();\n clearTimeout(timerId);\n let delay = 100;\n timerId = setTimeout(function request() {\n sendHeight();\n delay *= 2;\n if (delay < 20000) {\n timerId = setTimeout(request, delay);\n }\n }, delay);\n }\n\n function sendHeight() {\n var height = getHeight();\n parent.postMessage({ type: 'htmlPlugin:heightResize', id: id, height: height }, '*');\n }\n\n function setupMutationObserver() {\n var target = document.querySelector('body');\n var observer = new MutationObserver(function(mutations) {\n addImageLoadListeners();\n handleResize();\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(el) {\n if (el.nodeName === 'IFRAME') {\n handleIframeAdded(el);\n }\n });\n });\n });\n\n var config = {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n };\n\n observer.observe(target, config);\n }\n\n window.addEventListener('resize', handleResize); //this handles width change\n setupMutationObserver();\n handleResize();\n }\n\n window.addEventListener('message', function(event) {\n if (event.data.type !== 'htmlPlugin:updateContent') {\n return;\n }\n\n var content = [\n '<!DOCTYPE html>',\n '<html>',\n '<head>' + document.head.innerHTML + '</head>',\n '<body>' + event.data.content + '</body>',\n '</html>',\n ].join('');\n\n document.open('text/html', 'replace');\n document.write(content);\n document.close();\n initSendHeight(event.data.id);\n });\n <\/script>\n </head>\n\n <body></body>\n",styles_iframe="_2xvJT",_excluded=["iframeRef"],Iframe=function(_ref){var _context$experiments$,iframeRef=_ref.iframeRef,otherProps=_objectWithoutPropertiesLoose(_ref,_excluded),loading=null!==(_context$experiments$=useContext(GlobalContext).experiments.lazyImagesAndIframes)&&void 0!==_context$experiments$&&_context$experiments$.enabled?"lazy":void 0;return React.createElement("iframe",Object.assign({ref:iframeRef,className:styles_iframe,title:"remote content",style:{backgroundColor:"transparent"},loading:loading},otherProps))},isSSR="undefined"==typeof window,IframeHtml=function(_Component){function IframeHtml(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={shouldRender:!1},_this.id=Math.random().toString(36).substr(2,9),_this.writeToIframe=function(iframeElement){var _iframeElement$conten;_this.iframe=iframeElement;var iframeDocument=null==iframeElement||null===(_iframeElement$conten=iframeElement.contentWindow)||void 0===_iframeElement$conten?void 0:_iframeElement$conten.document;iframeDocument&&(iframeDocument.open("text/html","replace"),iframeDocument.write(htmlIframeSrc),iframeDocument.close())},_this.updateIframeContent=function(content){var _this$iframe;_this.shouldIgnoreLoad=!0,null===(_this$iframe=_this.iframe)||void 0===_this$iframe||_this$iframe.contentWindow.postMessage({type:"htmlPlugin:updateContent",id:_this.id,content:content},"*")},_this.handleIframeMessage=function(_ref){var data=_ref.data,type=data.type,id=data.id,height=data.height;"htmlPlugin:heightResize"===type&&id===_this.id&&_this.props.onHeightChange(height)},_this.handleIframeLoad=function(){!_this.shouldIgnoreLoad&&_this.updateIframeContent(_this.props.html)},_this.setIframe=function(iframe){_this.iframe=iframe},_this}_inheritsLoose(IframeHtml,_Component);var _proto=IframeHtml.prototype;return _proto.componentDidMount=function(){this.setState({shouldRender:!0}),!isSSR&&window.addEventListener("message",this.handleIframeMessage)},_proto.componentWillUnmount=function(){!isSSR&&window.removeEventListener("message",this.handleIframeMessage)},_proto.componentWillReceiveProps=function(nextProps){this.props.html!==nextProps.html&&this.updateIframeContent(nextProps.html)},_proto.render=function(){var iframeSandboxDomain=this.props.iframeSandboxDomain,iframeProps={style:{backgroundColor:"transparent"},onLoad:this.handleIframeLoad};if(iframeSandboxDomain){var strippedUrl=iframeSandboxDomain.replace(/\/$/,"");iframeProps.src=strippedUrl+"/html/db9376e69cfa487ea0fa0b912ae51a4f_v1.html",iframeProps.iframeRef=this.setIframe}else iframeProps.iframeRef=this.writeToIframe;return this.state.shouldRender?React.createElement(Iframe,iframeProps):null},IframeHtml}(Component),IframeUrl=function(props){return React.createElement(Iframe,Object.assign({},props,{sandbox:"allow-popups allow-presentation allow-forms allow-same-origin allow-scripts"}))},htmlComponentStyles={htmlComponent:"yuWXS",htmlComponent_placeholder:"_3tucQ"},HtmlComponent=function(_Component){function HtmlComponent(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={siteDomain:void 0},_this.setHeight=function(iframeHeight){var _this$props$store;iframeHeight!==_this.state.iframeHeight&&(_this.setState({iframeHeight:iframeHeight}),null===(_this$props$store=_this.props.store)||void 0===_this$props$store||_this$props$store.update("componentData",{config:{height:iframeHeight}}))},_this.getIframeHeight=function(){var _this$props=_this.props,_this$props$settings=_this$props.settings,height=(_this$props$settings=void 0===_this$props$settings?{}:_this$props$settings).height,config=_this$props.componentData.config,iframeHeight=_this.state.iframeHeight,maxDiff=Math.min(50,.1*_this.state.iframeHeight),normalizedHeight=iframeHeight;return config.height&&(normalizedHeight=iframeHeight&&config.height<iframeHeight&&config.height+maxDiff>iframeHeight?iframeHeight:config.height),normalizedHeight||height||550},_this}_inheritsLoose(HtmlComponent,_Component);var _proto=HtmlComponent.prototype;return _proto.componentDidMount=function(){var _this$props2=this.props,config=_this$props2.componentData.config,_this$props2$settings=_this$props2.settings,settings=void 0===_this$props2$settings?{}:_this$props2$settings,width=settings.width,height=settings.height,siteDomain=settings.siteDomain;config.width||(width?config.width=width:this.element?config.width=this.element.getBoundingClientRect().width:config.width=350),config.height||(config.height=height||550),this.setState({siteDomain:siteDomain})},HtmlComponent.getDerivedStateFromProps=function(props,state){var componentData=props.componentData;if("html"===componentData.srcType){var html=componentData&&componentData.src,pageURL=function(siteDomain){if(siteDomain){var res=/http.+com/gm.exec(siteDomain);return res?res[0]:res}}(state.siteDomain);if(pageURL&&html&&html.includes&&html.includes("adsbygoogle")){var updatedAd='<ins class="adsbygoogle"\n\tdata-page-url="'+pageURL+'"';html=html.replace(new RegExp('<ins class="adsbygoogle"',"g"),updatedAd)}return{html:html}}},_proto.render=function(){var _this$context$experim,_this2=this,html=this.state.html,_this$props3=this.props,iframeSandboxDomain=_this$props3.iframeSandboxDomain,theme=_this$props3.theme,componentData=_this$props3.componentData,_this$props3$settings=_this$props3.settings,width=(_this$props3$settings=void 0===_this$props3$settings?{}:_this$props3$settings).width;this.styles=this.styles||mergeStyles({styles:htmlComponentStyles,theme:theme}),validate(componentData,pluginHtmlSchema);var src=componentData.src,srcType=componentData.srcType,_componentData$config=componentData.config,currentWidth=(_componentData$config=void 0===_componentData$config?{}:_componentData$config).width,style={width:this.props.isMobile?"auto":currentWidth||width||350,height:this.getIframeHeight(),maxHeight:this.state.iframeHeight,maxWidth:"100%"};return React.createElement("div",{className:this.styles.htmlComponent,ref:function(_ref){return _this2.element=_ref},style:style,"data-hook":"HtmlComponent"},"html"===srcType&&src&&React.createElement(IframeHtml,{iframeSandboxDomain:iframeSandboxDomain||(null===(_this$context$experim=this.context.experiments.forceIframeSandboxDomain)||void 0===_this$context$experim?void 0:_this$context$experim.enabled)&&"https://www.filesusr.com",key:"html",tabIndex:0,html:html,onHeightChange:this.setHeight}),"url"===srcType&&isValidUrl(src)&&React.createElement(IframeUrl,{key:"url",tabIndex:0,src:normalizeUrl(src)}),!src&&!isValidUrl(src)&&React.createElement("div",{className:this.styles.htmlComponent_placeholder}))},HtmlComponent}(Component);HtmlComponent.contextType=GlobalContext;var HTML_TYPE="wix-draft-plugin-html",typeMapper=function(){var _ref;return(_ref={})[HTML_TYPE]={component:HtmlComponent},_ref},pluginHtml=function(config){return{config:_extends({},DEFAULTS_VIEWER,config),type:HTML_TYPE,typeMapper:typeMapper}};export{HTML_TYPE,typeMapper as htmlTypeMapper,pluginHtml};
//# sourceMappingURL=module.viewer.js.map

@@ -1,19 +0,43 @@

export { COLLAPSIBLE_LIST_TYPE } from './types';
export declare const COMPONENT_DATA = "componentData";
export declare const directions: {
LTR: string;
RTL: string;
export declare const SRC_TYPE_HTML = "html";
export declare const SRC_TYPE_URL = "url";
export declare const MAX_ALIGNMENT_WIDTH = 739;
export declare const MIN_WIDTH = 35;
export declare const INIT_WIDTH = 350;
export declare const MAX_WIDTH = 940;
export declare const MIN_HEIGHT = 35;
export declare const INIT_HEIGHT = 550;
export declare const MAX_HEIGHT = 1200;
export declare const MAX_HEIGHT_INPUT = 9999;
export declare const DEFAULTS_CONFIG: {
alignment: string;
};
export declare const EXPANDED = "expanded";
export declare const COLLAPSED = "collapsed";
export declare const FIRST_EXPANDED = "first_expanded";
export declare const DEFAULTS: Readonly<{
export declare const htmlButtonsTypes: {
html: string;
adsense: string;
};
export declare const adsenseDefaults: () => {
srcType: string;
src: string;
config: {
expandState: string;
expandOnlyOne: boolean;
alignment: string;
} | {
alignment: string;
} | {
isAdsense: true;
alignment: string;
};
pairs: {
key: string;
}[];
}>;
};
export declare const defaults: (isAdsense?: boolean | undefined) => {
srcType: string;
src: string;
config: {
alignment: string;
} | {
alignment: string;
} | {
isAdsense: true;
alignment: string;
};
};
export declare const DEFAULTS_VIEWER: {};
//# sourceMappingURL=defaults.d.ts.map

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

import { CollapsibleListPluginEditorConfig } from './types';
import { HtmlPluginEditorConfig } from './types';
import { EditorPluginCreator } from 'wix-rich-content-common';
export declare const pluginCollapsibleList: EditorPluginCreator<CollapsibleListPluginEditorConfig>;
export declare const pluginHtml: EditorPluginCreator<HtmlPluginEditorConfig>;
//# sourceMappingURL=editor.d.ts.map

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

export { default as EditIcon } from './EditIcon';
export { default as InsertPluginIcon } from './InsertPluginIcon';
export { default as ArrowIcon } from './ArrowIcon';
export { default as PlusIcon } from './PlusIcon';
export { default as DndIcon } from './DndIcon';
export { default as AdsenseIcon } from './Adsense';
//# sourceMappingURL=index.d.ts.map

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

export { createCollapsibleListPlugin } from './createCollapsibleListPlugin';
export { default as collapsibleListViewer } from './collapsible-list-viewer';
export { COLLAPSIBLE_LIST_TYPE } from './types';
export { Modals, ModalsMap } from './modals';
export { pluginCollapsibleList } from './editor';
export { createHtmlPlugin } from './createHtmlPlugin';
export { HTML_TYPE } from './types';
export { pluginHtml } from './editor';
export { htmlButtonsTypes } from './defaults';
//# sourceMappingURL=index.d.ts.map
import { EditorPluginConfig, ViewerPluginConfig } from 'wix-rich-content-common';
export declare const COLLAPSIBLE_LIST_TYPE = "wix-rich-content-plugin-collapsible-list";
export interface CollapsibleListPluginEditorConfig extends EditorPluginConfig {
export declare const HTML_TYPE = "wix-draft-plugin-html";
export interface HtmlPluginEditorConfig extends EditorPluginConfig {
[key: string]: any;
}
export interface CollapsibleListPluginViewerConfig extends ViewerPluginConfig {
export interface HtmlPluginViewerConfig extends ViewerPluginConfig {
[key: string]: any;
}
//# sourceMappingURL=types.d.ts.map
import { typeMapper } from './typeMapper-loadable';
import { COLLAPSIBLE_LIST_TYPE, CollapsibleListPluginViewerConfig } from './types';
import { HTML_TYPE, HtmlPluginViewerConfig } from './types';
import { ViewerPluginCreator } from 'wix-rich-content-common';
export { COLLAPSIBLE_LIST_TYPE, typeMapper as collapsibleListTypeMapper };
export declare const pluginCollapsibleList: ViewerPluginCreator<CollapsibleListPluginViewerConfig>;
export { typeMapper as htmlTypeMapper, HTML_TYPE };
export declare const pluginHtml: ViewerPluginCreator<HtmlPluginViewerConfig>;
//# sourceMappingURL=viewer-loadable.d.ts.map
import { typeMapper } from './typeMapper';
import { COLLAPSIBLE_LIST_TYPE, CollapsibleListPluginViewerConfig } from './types';
import { HTML_TYPE, HtmlPluginViewerConfig } from './types';
import { ViewerPluginCreator } from 'wix-rich-content-common';
export { COLLAPSIBLE_LIST_TYPE, typeMapper as collapsibleListTypeMapper };
export declare const pluginCollapsibleList: ViewerPluginCreator<CollapsibleListPluginViewerConfig>;
export { typeMapper as htmlTypeMapper, HTML_TYPE };
export declare const pluginHtml: ViewerPluginCreator<HtmlPluginViewerConfig>;
//# sourceMappingURL=viewer.d.ts.map

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

{"name":"richlagetest","version":"0.0.0-78671d73a2fed1cdad482b0f9e0934f36a513cd5"}
{"name":"richlagetest","version":"0.0.0-79e90eb34d73fa9c9d6e3b1db7b9e456d68b6f0f"}

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

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