richlagetest
Advanced tools
Comparing version 0.0.0-09b87b046fae0e0cd11e7abfb50826eaaf8e7800 to 0.0.0-1a3a637d095a19a0d3411aa25704d8ba1d45d865
@@ -1,4 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ricosContent=require("ricos-content"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),reactIntersectionObserver=require("react-intersection-observer"),classNames=require("classnames"),_extends=require("@babel/runtime/helpers/extends"),lodash=require("lodash"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),_asyncToGenerator=require("@babel/runtime/helpers/asyncToGenerator"),_regeneratorRuntime=require("@babel/runtime/regenerator"),reactI18next=require("react-i18next"),i18next=require("i18next");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(k){if("default"!==k){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}})),n.default=e,Object.freeze(n)}var _inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),_extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),_asyncToGenerator__default=_interopDefaultLegacy(_asyncToGenerator),_regeneratorRuntime__default=_interopDefaultLegacy(_regeneratorRuntime),__assign$r=function(){return(__assign$r=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};var _DRAFT_TO_RICOS_DOC_T,ButtonType,ModifierKey,ToolbarType,DisplayMode,DecorationMode,baseLink={target:"SELF"},Link_fromJSON=function(object){var message=__assign$r({},baseLink);return void 0!==object.url&&null!==object.url?message.url=String(object.url):message.url=void 0,void 0!==object.anchor&&null!==object.anchor?message.anchor=String(object.anchor):message.anchor=void 0,void 0!==object.target&&null!==object.target?message.target=function(object){switch(object){case 0:case"SELF":return"SELF";case 1:case"BLANK":return"BLANK";case 2:case"PARENT":return"PARENT";case 3:case"TOP":return"TOP";case-1:case"UNRECOGNIZED":default:return"UNRECOGNIZED"}}(object.target):message.target="SELF",void 0!==object.rel&&null!==object.rel?message.rel=Link_Rel.fromJSON(object.rel):message.rel=void 0,void 0!==object.customData&&null!==object.customData?message.customData=String(object.customData):message.customData=void 0,message},Link_toJSON=function(message){var obj={};return void 0!==message.url&&(obj.url=message.url),void 0!==message.anchor&&(obj.anchor=message.anchor),void 0!==message.target&&(obj.target=function(object){switch(object){case"SELF":return"SELF";case"BLANK":return"BLANK";case"PARENT":return"PARENT";case"TOP":return"TOP";default:return"UNKNOWN"}}(message.target)),void 0!==message.rel&&(obj.rel=message.rel?Link_Rel.toJSON(message.rel):void 0),void 0!==message.customData&&(obj.customData=message.customData),obj},baseLink_Rel={},Link_Rel={fromJSON:function(object){var message=__assign$r({},baseLink_Rel);return void 0!==object.nofollow&&null!==object.nofollow?message.nofollow=Boolean(object.nofollow):message.nofollow=void 0,void 0!==object.sponsored&&null!==object.sponsored?message.sponsored=Boolean(object.sponsored):message.sponsored=void 0,void 0!==object.ugc&&null!==object.ugc?message.ugc=Boolean(object.ugc):message.ugc=void 0,message},toJSON:function(message){var obj={};return void 0!==message.nofollow&&(obj.nofollow=message.nofollow),void 0!==message.sponsored&&(obj.sponsored=message.sponsored),void 0!==message.ugc&&(obj.ugc=message.ugc),obj}},__assign$n=function(){return(__assign$n=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},baseLinkData={},LinkData={fromJSON:function(object){var message=__assign$n({},baseLinkData);return void 0!==object.link&&null!==object.link?message.link=Link_fromJSON(object.link):message.link=void 0,message},toJSON:function(message){var obj={};return void 0!==message.link&&(obj.link=message.link?Link_toJSON(message.link):void 0),obj}},DRAFT_TO_RICOS_DOC_TYPE=((_DRAFT_TO_RICOS_DOC_T={})[ricosContent.HEADER_BLOCK.ONE]="headerOne",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.TWO]="headerTwo",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.THREE]="headerThree",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.FOUR]="headerFour",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.FIVE]="headerFive",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.SIX]="headerSix",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.PARAGRAPH]="paragraph",_DRAFT_TO_RICOS_DOC_T);exports.ButtonType=void 0,(ButtonType=exports.ButtonType||(exports.ButtonType={})).CUSTOM="custom",ButtonType.FILES="file",ButtonType.TOGGLE="toggle",ButtonType.PANEL="panel",ButtonType.INLINE_PANEL="inline-panel",ButtonType.EXTERNAL_MODAL="external-modal",ButtonType.DROPDOWN="dropdown",ButtonType.SEPARATOR="separator",ButtonType.SIZE_ORIGINAL="size-original",ButtonType.SIZE_CONTENT_CENTER="size-content-center",ButtonType.SIZE_SMALL_CENTER="size-small-center",ButtonType.SIZE_SMALL_LEFT="size-small-left",ButtonType.SIZE_SMALL_RIGHT="size-small-right",ButtonType.ALIGN_LEFT="align-left",ButtonType.ALIGN_RIGHT="align-right",ButtonType.ALIGN_CENTER="align-center",ButtonType.SIZE_CONTENT="size-content",ButtonType.SIZE_FULL_WIDTH="size-full-width",ButtonType.SIZE_SMALL="size-small",ButtonType.SIZE_MEDIUM="size-medium",ButtonType.SIZE_LARGE="size-large",ButtonType.TEXT_ALIGN_LEFT="alignment-left",ButtonType.TEXT_ALIGN_CENTER="alignment-center",ButtonType.TEXT_ALIGN_RIGHT="alignment-right",ButtonType.WIDTH="width",ButtonType.HEIGHT="height",ButtonType.LINK="link",ButtonType.SPOILER="spoiler",ButtonType.DELETE="delete",ButtonType.LINK_PREVIEW="link-preview",ButtonType.VIDEO_SETTINGS="video-settings",exports.ModifierKey=void 0,(ModifierKey=exports.ModifierKey||(exports.ModifierKey={})).COMMAND="command",ModifierKey.CTRL="ctrl",ModifierKey.OPTION="option",ModifierKey.SHIFT="shift",ModifierKey.ALT="alt",exports.ToolbarType=void 0,(ToolbarType=exports.ToolbarType||(exports.ToolbarType={})).SIDE="SIDE",ToolbarType.MOBILE="MOBILE",ToolbarType.FOOTER="FOOTER",ToolbarType.STATIC="STATIC",ToolbarType.INLINE="INLINE",ToolbarType.PLUGIN="PLUGIN",ToolbarType.FORMATTING="FORMATTING",ToolbarType.INSERT_PLUGIN="INSERT_PLUGIN",ToolbarType.TEXT="ALL-TEXT-TOOLBARS",ToolbarType.SHORTCUT="SHORTCUT",ToolbarType.LINK="LINK",exports.DisplayMode=void 0,(DisplayMode=exports.DisplayMode||(exports.DisplayMode={})).NORMAL="NORMAL",DisplayMode.FLOATING="FLOATING",exports.DecorationMode=void 0,(DecorationMode=exports.DecorationMode||(exports.DecorationMode={})).PREPEND="PREPEND",DecorationMode.WRAP="WRAP",DecorationMode.APPEND="APPEND";var noOutlineStyle_noOutline="_1-vl0",AccessibilityListener=function(_Component){function AccessibilityListener(){var _this;return(_this=_Component.apply(this,arguments)||this).handleTabKeyUp=function(e){9===e.which&&document.body.classList.contains(noOutlineStyle_noOutline)&&document.body.classList.remove(noOutlineStyle_noOutline)},_this.handleClick=function(){document.body.classList.contains(noOutlineStyle_noOutline)||document.body.classList.add(noOutlineStyle_noOutline)},_this.render=function(){return null},_this}_inheritsLoose__default.default(AccessibilityListener,_Component);var _proto=AccessibilityListener.prototype;return _proto.componentDidMount=function(){document.body.classList.add(noOutlineStyle_noOutline),this.props.isMobile||(document.addEventListener("keyup",this.handleTabKeyUp),document.addEventListener("click",this.handleClick))},_proto.componentWillUnmount=function(){this.props.isMobile||(document.removeEventListener("keyup",this.handleTabKeyUp),document.removeEventListener("click",this.handleClick))},AccessibilityListener}(React.Component),cssClassMerger=function(defaultStyleClassName,themeClassName){return defaultStyleClassName+" "+themeClassName},mergeStyles=function(_ref){var styles=_ref.styles,theme=_ref.theme;if(!theme)return console.warn("mergeStyles invoked without theme!"),styles;var themeStyles=lodash.pickBy(theme),themeStylesToMerge=lodash.pickBy(themeStyles,(function(_,key){return lodash.has(styles,key)}));return lodash.mergeWith(_extends__default.default({},styles),themeStylesToMerge,cssClassMerger)},isSSR=function(){return"undefined"==typeof window},styles={placeholder:"_2bUeE"},ViewportRenderer=function(_Component){function ViewportRenderer(){return _Component.apply(this,arguments)||this}return _inheritsLoose__default.default(ViewportRenderer,_Component),ViewportRenderer.prototype.render=function(){var _this=this,_this$props=this.props,children=_this$props.children,placeholderStyle=_this$props.placeholderStyle,placeholderClass=_this$props.placeholderClass,containerStyle=_this$props.containerStyle,containerClass=_this$props.containerClass,theme=this.props.theme;return this.styles=this.styles||mergeStyles({styles:styles,theme:theme}),isSSR()||void 0===window.IntersectionObserver?children:React__default.default.createElement(reactIntersectionObserver.InView,{triggerOnce:!0},(function(_ref){var inView=_ref.inView,ref=_ref.ref;return inView?React__default.default.createElement("div",{ref:ref,style:containerStyle,className:containerClass},children):React__default.default.createElement("div",{ref:ref,className:classNames__default.default(_this.styles.placeholder,placeholderClass),style:placeholderStyle})}))},ViewportRenderer}(React.Component);function i18n(_ref){var _resources,locale=_ref.locale,localeResource=_ref.localeResource;return i18next.createInstance().init({lng:locale,keySeparator:"$",interpolation:{escapeValue:!1},react:{wait:!0},resources:(_resources={},_resources[locale]={translation:localeResource},_resources)})}function getDisplayName(Component){return Component.displayName||Component.name||"Component"}function createHocName(hocComponentName,WrappedComponent){return hocComponentName+"("+getDisplayName(WrappedComponent)+")"}ViewportRenderer.defaultProps={placeholderStyle:{},containerStyle:{},alwaysRenderChildren:!1,placeholderClass:"",containerClass:""};var memoizedNow,_excluded=["forwardedRef"],safeJsonParse=function(jsonString){try{return JSON.parse(jsonString)}catch(e){return}};function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}function compute(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C}function isOptionsObject(options){return options===Object(options)&&0!==Object.keys(options).length}function scrollIntoView$1(target,options){var targetIsDetached=!target.ownerDocument.documentElement.contains(target);if(isOptionsObject(options)&&"function"==typeof options.behavior)return options.behavior(targetIsDetached?[]:compute(target,options));if(!targetIsDetached){var computeOptions=function(options){return!1===options?{block:"end",inline:"nearest"}:isOptionsObject(options)?options:{block:"start",inline:"nearest"}}(options);return function(actions,behavior){void 0===behavior&&(behavior="auto");var canSmoothScroll="scrollBehavior"in document.body.style;actions.forEach((function(_ref){var el=_ref.el,top=_ref.top,left=_ref.left;el.scroll&&canSmoothScroll?el.scroll({top:top,left:left,behavior:behavior}):(el.scrollTop=top,el.scrollLeft=left)}))}(compute(target,computeOptions),computeOptions.behavior)}}var now=function(){return memoizedNow||(memoizedNow="performance"in window?performance.now.bind(performance):Date.now),memoizedNow()};function step(context){var time=now(),elapsed=Math.min((time-context.startTime)/context.duration,1),value=context.ease(elapsed),currentX=context.startX+(context.x-context.startX)*value,currentY=context.startY+(context.y-context.startY)*value;context.method(currentX,currentY),currentX!==context.x||currentY!==context.y?requestAnimationFrame((function(){return step(context)})):context.cb()}function smoothScroll(el,x,y,duration,ease,cb){var scrollable,startX,startY;void 0===duration&&(duration=600),void 0===ease&&(ease=function(t){return 1+--t*t*t*t*t}),scrollable=el,startX=el.scrollLeft,startY=el.scrollTop,step({scrollable:scrollable,method:function(x,y){el.scrollLeft=Math.ceil(x),el.scrollTop=Math.ceil(y)},startTime:now(),startX:startX,startY:startY,x:x,y:y,duration:duration,ease:ease,cb:cb})}var scrollIntoView=function(target,options){var overrides=options||{};return function(options){return options&&!options.behavior||"smooth"===options.behavior}(overrides)?scrollIntoView$1(target,{block:overrides.block,inline:overrides.inline,scrollMode:overrides.scrollMode,boundary:overrides.boundary,behavior:function(actions){return Promise.all(actions.reduce((function(results,_ref){var el=_ref.el,left=_ref.left,top=_ref.top,startLeft=el.scrollLeft,startTop=el.scrollTop;return startLeft===left&&startTop===top?results:[].concat(results,[new Promise((function(resolve){return smoothScroll(el,left,top,overrides.duration,overrides.ease,(function(){return resolve({el:el,left:[startLeft,left],top:[startTop,top]})}))}))])}),[]))}}):Promise.resolve(scrollIntoView$1(target,options))},anchorScrollUsingSmoothScrollIntoViewIfNeeded=function(element,fixedElementsOffset){var _element$style=element.style,paddingTop=_element$style.paddingTop,marginTop=_element$style.marginTop;element.style.marginTop="-"+fixedElementsOffset+"px",element.style.paddingTop=fixedElementsOffset+"px",scrollIntoView(element,{block:"start",inline:"start"}),element.style.marginTop=marginTop,element.style.paddingTop=paddingTop},anchorScrollUsingScrollIntoView=function(element,fixedElementsOffset){var _element$style2=element.style,paddingTop=_element$style2.paddingTop,marginTop=_element$style2.marginTop;element.style.marginTop="-"+fixedElementsOffset+"px",element.style.paddingTop=fixedElementsOffset+"px",element.scrollIntoView({behavior:"smooth"}),element.style.marginTop=marginTop,element.style.paddingTop=paddingTop},getLinkRangesInBlock=function(block,contentState){var ranges=[];return block.entityRanges.forEach((function(entityRange){var _contentState$entityM,entityType=null===(_contentState$entityM=contentState.entityMap[entityRange.key])||void 0===_contentState$entityM?void 0:_contentState$entityM.type;if("LINK"===entityType||"wix-draft-plugin-external-link"===entityType){var start=entityRange.offset,end=start+entityRange.length;ranges.push([start,end])}})),ranges},contentStateSchema={definitions:{inlineStyleDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/inline-style.json",type:"object",title:"inline style",required:["offset","length","style"],properties:{offset:{$id:"#/properties/offset",type:"integer",title:"offset",default:0,min:0,examples:[0]},length:{$id:"#/properties/length",type:"integer",title:"length",default:0,min:0,examples:[4]},style:{$id:"#/properties/style",type:"string",title:"style",default:"",examples:["color4"],pattern:"^(.*)$"}}},entityRangeDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/entity-range.json",type:"object",title:"inline style",required:["offset","length","key"],properties:{offset:{$id:"#/properties/offset",type:"integer",title:"offset",default:0,min:0,examples:[0]},length:{$id:"#/properties/length",type:"integer",title:"length",default:0,min:0,examples:[4]},key:{$id:"#/properties/style",type:"integer",title:"key",default:"",examples:[0]}}},entityDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/entity-range.json",type:"object",title:"entity",required:["type","data"],properties:{type:{$id:"#/properties/type",enum:["IMAGE","VIDEO-EMBED","LINK","mention","wix-draft-plugin-image","wix-draft-plugin-link-button","wix-draft-plugin-action-button","wix-draft-plugin-video","wix-draft-plugin-gallery","wix-draft-plugin-link","wix-draft-plugin-html","wix-draft-plugin-sound-cloud","wix-draft-plugin-hashtag","wix-draft-plugin-divider","wix-draft-plugin-emoji","wix-draft-plugin-giphy","wix-draft-plugin-map","wix-draft-plugin-file-upload","wix-draft-plugin-vertical-embed","wix-draft-plugin-poll","wix-draft-plugin-link-preview","ANCHOR","wix-rich-content-plugin-table"],title:"entity type",examples:["wix-draft-plugin-image"]},mutability:{$id:"#/properties/mutability",type:"string",enum:["MUTABLE","IMMUTABLE","SEGMENTED"],title:"entity mutability",examples:["IMMUTABLE"]},data:{$id:"#/properties/data",type:"object",title:"entity data"}},anyOf:[{}]}},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/content-state-schema.json",type:"object",title:"content state",required:["blocks","entityMap","VERSION"],properties:{blocks:{$id:"#/properties/blocks",type:"array",title:"blocks",items:{$id:"#/properties/blocks/items",type:"object",title:"block",required:["key","text","type","inlineStyleRanges","entityRanges","data"],properties:{key:{$id:"#/properties/blocks/items/properties/key",type:"string",title:"block key",default:"",examples:["45qkg"],pattern:"^(.*)$"},text:{$id:"#/properties/blocks/items/properties/text",type:"string",title:"text",default:"",examples:["test"]},type:{$id:"#/properties/blocks/items/properties/type",type:"string",title:"block type",default:"",examples:["unstyled"],enum:["unstyled","header-one","header-two","header-three","header-four","header-five","header-six","unordered-list-item","ordered-list-item","blockquote","atomic","code-block","figure"]},depth:{$id:"#/properties/blocks/items/properties/depth",type:"integer",title:"depth",maximum:10,default:0,examples:[0]},inlineStyleRanges:{$id:"#/properties/blocks/items/properties/inlineStyleRanges",type:"array",title:"inline style ranges",items:{$ref:"#/definitions/inlineStyleDef"}},entityRanges:{$id:"#/properties/blocks/items/properties/entityRanges",type:"array",title:"entity ranges",default:null,items:{$ref:"#/definitions/entityRangeDef"}},data:{$id:"#/properties/blocks/items/properties/data",type:"object",title:"data",default:null}}}},entityMap:{$id:"#/properties/entityMap",type:"object",title:"entity map",patternProperties:{"[0-9]+":{$ref:"#/definitions/entityDef"}}}}},LTR="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",isRtlRegex=new RegExp("^[^"+LTR+"]*[֑-߿יִ-﷽ﹰ-ﻼ]"),isLtrRegex=new RegExp("^[^֑-߿יִ-﷽ﹰ-ﻼ]*["+LTR+"]"),emojiRegex=/\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]/g,GlobalContext=React__default.default.createContext({isMobile:!1,experiments:{}}),isHexColor=function(str){return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(str)},rtlLangs=["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"],isRtl=function(locale){return!!locale&&rtlLangs.includes(locale.split("-|_")[0].toLowerCase())},getBlocksFromContentState=function(contentState){var entityMap,rceInRcePlugins,innerRCEBlocks=(entityMap=contentState.entityMap,rceInRcePlugins=["wix-rich-content-plugin-table","wix-rich-content-plugin-collapsible-list"],Object.values(entityMap).some((function(entity){return rceInRcePlugins.includes(entity.type)}))?getInnerRCEBlocks(contentState.entityMap):[]);return[].concat(contentState.blocks,innerRCEBlocks)};function getInnerRCEBlocks(object){var result=[];if(object instanceof Array)Array.prototype.forEach.call(object,(function(arrayElement){var innerBlocks=getInnerRCEBlocks(arrayElement);innerBlocks&&(result=[].concat(result,innerBlocks))}));else for(var _i=0,_Object$entries=Object.entries(object);_i<_Object$entries.length;_i++){var _Object$entries$_i=_Object$entries[_i],key=_Object$entries$_i[0],value=_Object$entries$_i[1];if("blocks"===key)return value;if(value instanceof Object||value instanceof Array){var innerBlocks=getInnerRCEBlocks(value);innerBlocks&&(result=[].concat(result,innerBlocks))}}return result}var _INLINE_STYLE_TYPES,_RICOS_TO_DRAFT_TYPE,_dynamicStyleParsers,_defaultStyleFnMapper,_defaultStyleSelectio;function isInEditor(contentBlock){return contentBlock.toJS}function isInLink(i,block,contentState){var entityKey=function(i,block){var _block$entityRanges$f;return isInEditor(block)?block.getEntityAt(i):null===(_block$entityRanges$f=block.entityRanges.find((function(_ref){var offset=_ref.offset,length=_ref.length;return i>offset&&i<offset+length})))||void 0===_block$entityRanges$f?void 0:_block$entityRanges$f.key}(i,block);return function(type){return"LINK"===type||"ricos-plugin-custom-link"===type}(function(block,contentState,entityKey){var _contentState$entityM;return isInEditor(block)?null!==entityKey&&contentState.getEntity(entityKey).getType():null===(_contentState$entityM=contentState.entityMap[entityKey])||void 0===_contentState$entityM?void 0:_contentState$entityM.type}(block,contentState,entityKey))}var INLINE_STYLE_TYPES=((_INLINE_STYLE_TYPES={})[ricosContent.RICOS_TEXT_COLOR_TYPE]="FG",_INLINE_STYLE_TYPES[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]="BG",_INLINE_STYLE_TYPES[ricosContent.RICOS_FONT_SIZE_TYPE]="font-size",_INLINE_STYLE_TYPES),RICOS_TO_DRAFT_TYPE=((_RICOS_TO_DRAFT_TYPE={})[ricosContent.RICOS_TEXT_COLOR_TYPE]=ricosContent.TEXT_COLOR_TYPE,_RICOS_TO_DRAFT_TYPE[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]=ricosContent.TEXT_HIGHLIGHT_TYPE,_RICOS_TO_DRAFT_TYPE),parseStyleByType=function(style,type){var property=INLINE_STYLE_TYPES[type],cssRule=safeJsonParse(style);return null==cssRule?void 0:cssRule[property]},dynamicStyleParsers=((_dynamicStyleParsers={})[ricosContent.RICOS_TEXT_COLOR_TYPE]=function(style,styleSelectionPredicate){var color=parseStyleByType(style,ricosContent.RICOS_TEXT_COLOR_TYPE);if(styleSelectionPredicate){var parsedStyle=color||style;return styleSelectionPredicate(parsedStyle)&&parsedStyle}return color||isHexColor(style)&&style},_dynamicStyleParsers[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]=function(style,styleSelectionPredicate){var color=parseStyleByType(style,ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE);return styleSelectionPredicate?styleSelectionPredicate(color)&&color:color},_dynamicStyleParsers[ricosContent.RICOS_FONT_SIZE_TYPE]=function(style){return parseStyleByType(style,ricosContent.RICOS_FONT_SIZE_TYPE)},_dynamicStyleParsers),defaultStyleFnMapper=((_defaultStyleFnMapper={})[ricosContent.RICOS_TEXT_COLOR_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[ricosContent.RICOS_TEXT_COLOR_TYPE](style,isHexColor);return parsedStyle?{color:parsedStyle}:void 0},_defaultStyleFnMapper[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE](style,isHexColor);return parsedStyle?{backgroundColor:parsedStyle}:void 0},_defaultStyleFnMapper[ricosContent.RICOS_FONT_SIZE_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[ricosContent.RICOS_FONT_SIZE_TYPE](style);return parsedStyle?{fontSize:parsedStyle}:void 0},_defaultStyleFnMapper[ricosContent.RICOS_BOLD_TYPE]=function(style){return"NOT_BOLD"===style?{fontWeight:"normal"}:void 0},_defaultStyleFnMapper[ricosContent.RICOS_ITALIC_TYPE]=function(style){return"NOT_ITALIC"===style?{fontStyle:"normal"}:void 0},_defaultStyleFnMapper),defaultStyleSelectionPredicates=((_defaultStyleSelectio={})[ricosContent.RICOS_TEXT_COLOR_TYPE]=isHexColor,_defaultStyleSelectio[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]=isHexColor,_defaultStyleSelectio);Object.defineProperty(exports,"Trans",{enumerable:!0,get:function(){return reactI18next.Trans}}),Object.defineProperty(exports,"translate",{enumerable:!0,get:function(){return reactI18next.translate}}),exports.ADD_PLUGIN_LINK_BI="addPluginLink",exports.ANCHOR_CATEGORY="section",exports.ANCHOR_VIEWER_DATA_HOOK="anchorViewer",exports.AccessibilityListener=AccessibilityListener,exports.CUSTOM_LINK="custom-link",exports.DRAFT_TO_RICOS_DOC_TYPE=DRAFT_TO_RICOS_DOC_TYPE,exports.DROPDOWN_OPTIONS_TO_DOC_STYLE_TYPE={P:"paragraph",H1:"headerOne",H2:"headerTwo",H3:"headerThree",H4:"headerFour",H5:"headerFive",H6:"headerSix"},exports.GlobalContext=GlobalContext,exports.INLINE_STYLE_TYPES=INLINE_STYLE_TYPES,exports.LINK_VIEWER_DATA_HOOK="linkViewer",exports.LinkData=LinkData,exports.Link_Rel=Link_Rel,exports.RicosTranslate=function(_ref3){var children=_ref3.children,locale=_ref3.locale,localeResource=_ref3.localeResource,i18nInstance=React.useRef(i18n({locale:locale,localeResource:localeResource})),_React$useState=React__default.default.useState(0),forceCounter=_React$useState[0],forceUpdate=_React$useState[1];return React.useEffect((function(){i18nInstance.current.addResourceBundle(locale,"translation",localeResource),i18nInstance.current.changeLanguage(locale,(function(err){err||forceUpdate(forceCounter+1)}))}),[locale,localeResource]),React__default.default.createElement(reactI18next.I18nextProvider,{i18n:i18nInstance.current},React__default.default.createElement(reactI18next.I18n,{i18n:i18nInstance.current,wait:!0,initialLanguage:locale},(function(t){return children(t)})))},exports.ViewportRenderer=ViewportRenderer,exports.WEB_ADDRESS_CATEGORY="web_address",exports.addAnchorTagToUrl=function(anchorString){var url=new URL(window.location.href);url.hash=anchorString,history.pushState({},"",url.href)},exports.alignmentClassName=function(componentData,theme,styles){var alignment=(componentData.config||{}).alignment;if(!alignment)return"";var key="align"+lodash.upperFirst(alignment);return classNames__default.default(styles[key],theme[key])},exports.anchorScroll=function(element,experiments){var _document$querySelect,_document$querySelect2,_document$querySelect3,_document$querySelect4,_experiments$anchorSc,fixedElementsOffset=((null===(_document$querySelect=document.querySelector('[id="SITE_HEADER"]'))||void 0===_document$querySelect?void 0:_document$querySelect.clientHeight)||0)+((null===(_document$querySelect2=document.querySelector('[id="WIX_ADS"]'))||void 0===_document$querySelect2?void 0:_document$querySelect2.clientHeight)||0)+((null===(_document$querySelect3=document.querySelector('[data-hook="mobileToolbar"]'))||void 0===_document$querySelect3?void 0:_document$querySelect3.clientHeight)||(null===(_document$querySelect4=document.querySelector('[data-hook="ricos-editor-toolbars"]'))||void 0===_document$querySelect4?void 0:_document$querySelect4.clientHeight)||0);null!=experiments&&null!==(_experiments$anchorSc=experiments.anchorScrollWithSmoothScrollIntoViewIfNeeded)&&void 0!==_experiments$anchorSc&&_experiments$anchorSc.enabled?anchorScrollUsingSmoothScrollIntoViewIfNeeded(element,fixedElementsOffset):anchorScrollUsingScrollIntoView(element,fixedElementsOffset)},exports.convertRelObjectToString=function(relObject){if(relObject){var relString="";return relObject.nofollow&&(relString+="nofollow "),relObject.sponsored&&(relString+="sponsored "),relObject.ugc&&(relString+="ugc"),relString.trim()}},exports.convertRelStringToObject=function(rel){var relObject={};return rel?(rel.includes("nofollow")&&(relObject.nofollow=!0),rel.includes("sponsored")&&(relObject.sponsored=!0),rel.includes("ugc")&&(relObject.ugc=!0),relObject):relObject},exports.convertTargetBooleanToString=function(targetBlank){return targetBlank?"_blank":"_top"},exports.convertTargetStringToBoolean=function(target){return"_blank"===target},exports.createHocName=createHocName,exports.createJustificationFixDecorator=function(){var isTextJustified=function(contentBlock){return"justify"===function(contentBlock){var _contentBlock$data;return isInEditor(contentBlock)?contentBlock.getData().get("textAlignment"):null==contentBlock||null===(_contentBlock$data=contentBlock.data)||void 0===_contentBlock$data?void 0:_contentBlock$data.textAlignment}(contentBlock)};return{strategy:function(contentBlock,callback,contentState){if(!isSSR()&&(isSSR()||!window.chrome)&&isTextJustified(contentBlock))for(var match,regex=/\s[^\s]/g,str=contentBlock.getText();null!==(match=regex.exec(str));)isInLink(match.index,contentBlock,contentState)||callback(match.index,match.index+1)},component:function(props){return React__default.default.createElement("span",{style:{whiteSpace:"normal"}},props.children)}}},exports.defaultStyleFnMapper=defaultStyleFnMapper,exports.depthClassName=function(depth){return"public-DraftStyleDefault-block-depth"+depth},exports.draftDecorationsToCss={BOLD:{"font-weight":"bold"},ITALIC:{"font-style":"italic"},NOT_BOLD:{"font-weight":"normal"},NOT_ITALIC:{"font-style":"normal"}},exports.dynamicStyleParsers=dynamicStyleParsers,exports.generateKey=function(){return Math.random().toString(36).substr(2,9)},exports.getBlocksFromContentState=getBlocksFromContentState,exports.getContentStateSchema=function(pluginDataSchemas){void 0===pluginDataSchemas&&(pluginDataSchemas={});var schema=contentStateSchema;return schema.definitions.entityDef.anyOf=Object.keys(pluginDataSchemas).map((function(pluginType){return{properties:{type:{const:pluginType},data:pluginDataSchemas[pluginType]}}})),schema},exports.getDirectionFromAlignmentAndTextDirection=function(textAlignment,textDirection){return"right"===textAlignment?"rtl":"left"===textAlignment?"ltr":textDirection&&"rtl"===textDirection?textDirection:"ltr"},exports.getDisplayName=getDisplayName,exports.getDynamicInlineStyleMapper=function(type){return function(config,raw){var settings=config[RICOS_TO_DRAFT_TYPE[type]||""]||{},styleParser=dynamicStyleParsers[type],styleSelectionPredicate=settings.styleSelectionPredicate?function(style){return!!styleParser(style,settings.styleSelectionPredicate)}:function(style){return!!styleParser(style,defaultStyleSelectionPredicates[type])},customStyleFn=settings.customStyleFn?function(style){return settings.customStyleFn(styleParser(style,settings.styleSelectionPredicate))}:defaultStyleFnMapper[type],mapper=getBlocksFromContentState(raw).reduce((function(map,block){return block.inlineStyleRanges&&block.inlineStyleRanges.filter((function(range){return styleSelectionPredicate(range.style)})).forEach((function(range){map[range.style]=function(children,_ref){var key=_ref.key;return React__default.default.createElement("span",{key:key,style:customStyleFn(range.style)},children)}})),map}),{});return function(){return mapper}}},exports.getLangDir=function(locale){return isRtl(locale)?"rtl":"ltr"},exports.getLinkRangesInBlock=getLinkRangesInBlock,exports.getRelValue=function(rel){return("noopener noreferrer "+(rel||"")).trim()},exports.getTextDirection=function(text){var result="neutral";if(!text)return result;var plainText=text.replace(emojiRegex,"");return isRtlRegex.test(plainText)?result="rtl":isLtrRegex.test(plainText)&&(result="ltr"),result},exports.hasLinksInBlock=function(block,contentState){return getLinkRangesInBlock(block,contentState).length>0},exports.isHexColor=isHexColor,exports.isNewTab=function(target){return"_blank"===target},exports.isRtl=isRtl,exports.isSSR=isSSR,exports.mergeStyles=mergeStyles,exports.parseStyleByType=parseStyleByType,exports.safeJsonParse=safeJsonParse,exports.simplePubsub=function(initialState){var state=initialState||{},listeners={},subscribe=function(key,callback){if("function"!=typeof callback)throw"Callback for key "+key+" is not a function";return listeners[key]=listeners[key]||[],listeners[key].push(callback),function(){listeners[key]=listeners[key].filter((function(listener){return listener!==callback}))}},update=function(key,newData,blockKey){var data=get(key),newItem=lodash.merge({},data,newData);blockKey?_setSingle(key,newItem,blockKey):set(key,newItem)},_setSingle=function(key,item,blockKey){var _extends2;state=_extends__default.default({},state,((_extends2={})[key]=item,_extends2)),listeners[key]&&listeners[key].forEach((function(listener){return listener(state[key],blockKey)}))},_setBatch=function(updates){state=_extends__default.default({},state,updates),Object.keys(updates).forEach((function(key){listeners[key]&&listeners[key].forEach((function(listener){return listener(state[key])}))}))},set=function(){1===arguments.length?_setBatch(arguments.length<=0?void 0:arguments[0]):_setSingle.apply(void 0,arguments)},setBlockHandler=function(key,blockKey,item){_setSingle(blockHandlerKey(key,blockKey),item)},get=function(key){return state[key]},getBlockHandler=function(key,blockKey){return void 0===blockKey&&(blockKey=state.focusedBlock),state[blockHandlerKey(key,blockKey)]},blockHandlerKey=function(key,blockKey){return blockKey+"_"+key};return{subscribe:subscribe,unsubscribe:function(key,callback){listeners[key]=listeners[key].filter((function(listener){return listener!==callback}))},update:update,set:set,setBlockHandler:setBlockHandler,get:get,getBlockHandler:getBlockHandler,store:{get:get,getBlockHandler:getBlockHandler,update:update,set:set,setBlockHandler:setBlockHandler},getBlockData:function(_ref3){var key=_ref3.key,_ref3$blockKey=_ref3.blockKey,blockKey=void 0===_ref3$blockKey?state.focusedBlock:_ref3$blockKey;return state[blockHandlerKey(key,blockKey)]},setBlockData:function(_ref2){var key=_ref2.key,_ref2$blockKey=_ref2.blockKey,blockKey=void 0===_ref2$blockKey?state.focusedBlock:_ref2$blockKey,item=_ref2.item;_setSingle(blockHandlerKey(key,blockKey),item)},subscribeOnBlock:function(_ref){var key=_ref.key,_ref$blockKey=_ref.blockKey,blockKey=void 0===_ref$blockKey?state.focusedBlock:_ref$blockKey,callback=_ref.callback;return subscribe(blockHandlerKey(key,blockKey),callback)}}},exports.sizeClassName=function(componentData,theme,styles){var size=(componentData.config||{}).size;if(!size)return"";var key="size"+lodash.upperFirst(lodash.camelCase(size));return classNames__default.default(styles[key],theme[key])},exports.textWrapClassName=function(componentData,theme,styles){var textWrap=(componentData.config||{}).textWrap;if(!textWrap)return"";var key="textWrap"+lodash.upperFirst(lodash.camelCase(textWrap));return classNames__default.default(styles[key],theme[key])},exports.uuid=function(){var d=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)}))},exports.validate=function(data,schema){return!0},exports.withI18n=function(Component,defaultLocaleResource,_temp){var _ref$forceRemount=(void 0===_temp?{}:_temp).forceRemount,forceRemount=void 0===_ref$forceRemount||_ref$forceRemount,Translated=reactI18next.translate(void 0,{withRef:!0})(Component),I18nWrapper=function(_PureComponent){function I18nWrapper(props){var _this;_this=_PureComponent.call(this,props)||this;var locale=props.locale,localeResource=props.localeResource;return _this.i18n=i18n({locale:locale,localeResource:localeResource}),_this.state={key:I18nWrapper.displayName+"-"+locale},_this}_inheritsLoose__default.default(I18nWrapper,_PureComponent);var _proto=I18nWrapper.prototype;return _proto.componentDidMount=function(){var _componentDidMount=_asyncToGenerator__default.default(_regeneratorRuntime__default.default.mark((function _callee(){var _yield$this$getResour,locale,localeResource;return _regeneratorRuntime__default.default.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:if("en"===this.props.locale){_context.next=7;break}return _context.next=3,this.getResourceByLocale(this.props.locale);case 3:_yield$this$getResour=_context.sent,locale=_yield$this$getResour.locale,localeResource=_yield$this$getResour.localeResource,this.changeLocale({locale:locale,localeResource:localeResource});case 7:case"end":return _context.stop()}}),_callee,this)})));return function(){return _componentDidMount.apply(this,arguments)}}(),_proto.componentWillReceiveProps=function(nextProps){this.props.locale!==nextProps.locale&&this.changeLocale(nextProps)},_proto.getResourceByLocale=function(){var _getResourceByLocale=_asyncToGenerator__default.default(_regeneratorRuntime__default.default.mark((function _callee2(locale){var localeResource;return _regeneratorRuntime__default.default.wrap((function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.prev=0,_context2.next=3,function(t){return Promise.resolve().then((function(){return _interopNamespace(require(t))}))}( | ||
/* webpackChunkName: "messages_[request]" */ | ||
"wix-rich-content-common/dist/statics/locale/messages_"+locale+".json").then((function(res){return res.default}));case 3:return localeResource=_context2.sent,_context2.abrupt("return",{locale:locale,localeResource:localeResource});case 7:throw _context2.prev=7,_context2.t0=_context2.catch(0),new Error("error while loading locale "+locale+":\n"+_context2.t0);case 10:case"end":return _context2.stop()}}),_callee2,null,[[0,7]])})));return function(_x){return _getResourceByLocale.apply(this,arguments)}}(),_proto.changeLocale=function(_ref2){var _this2=this,locale=_ref2.locale,localeResource=_ref2.localeResource;this.i18n.addResourceBundle(locale,"translation",localeResource),this.i18n.changeLanguage(locale,(function(err){err||(forceRemount?_this2.setState({key:I18nWrapper.displayName+"-"+_this2.i18n.language}):_this2.forceUpdate())}))},_proto.render=function(){var _this$props=this.props,forwardedRef=_this$props.forwardedRef,rest=_objectWithoutPropertiesLoose__default.default(_this$props,_excluded);return React__default.default.createElement(reactI18next.I18nextProvider,{i18n:this.i18n},React__default.default.createElement(Translated,Object.assign({key:this.state.key},rest,{ref:forwardedRef})))},I18nWrapper}(React.PureComponent);return I18nWrapper.defaultProps={locale:"en",localeResource:defaultLocaleResource},I18nWrapper.displayName=createHocName("I18nWrapper",Component),React__default.default.forwardRef((function(props,ref){return React__default.default.createElement(I18nWrapper,Object.assign({},props,{forwardedRef:ref}))}))},Object.keys(ricosContent).forEach((function(k){"default"===k||exports.hasOwnProperty(k)||Object.defineProperty(exports,k,{enumerable:!0,get:function(){return ricosContent[k]}})})); | ||
"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"),ReactPlayer=require("react-player"),wixRichContentUiComponents=require("wix-rich-content-ui-components"),classNames=require("classnames"),reactDom=require("react-dom"),wixRichContentCommon=require("wix-rich-content-common"),pluginSoundCloudSchema=require("wix-rich-content-common/dist/statics/schemas/plugin-sound-cloud.schema.json"),lodash=require("lodash");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),ReactPlayer__default=_interopDefaultLegacy(ReactPlayer),classNames__default=_interopDefaultLegacy(classNames),pluginSoundCloudSchema__default=_interopDefaultLegacy(pluginSoundCloudSchema),SoundCloudURLInputModal=function(_Component){function SoundCloudURLInputModal(props){var _this;(_this=_Component.call(this,props)||this).onConfirm=function(){var url=_this.state.url;if(url&&ReactPlayer__default.default.canPlay(url)){var _helpers$closeModal,_this$props=_this.props,_componentData=_this$props.componentData,helpers=_this$props.helpers,pubsub=_this$props.pubsub,onConfirm=_this$props.onConfirm;onConfirm?onConfirm(_extends__default.default({},_componentData,{src:url})):pubsub.update("componentData",{src:url}),helpers&&helpers.onVideoSelected&&helpers.onVideoSelected(url,(function(data){return pubsub.update("componentData",{metadata:_extends__default.default({},data)})})),null===(_helpers$closeModal=helpers.closeModal)||void 0===_helpers$closeModal||_helpers$closeModal.call(helpers)}else _this.setState({submittedInvalidUrl:!0})};var componentData=_this.props.componentData;return _this.state={url:componentData.src||"",submittedInvalidUrl:!1},_this}return _inheritsLoose__default.default(SoundCloudURLInputModal,_Component),SoundCloudURLInputModal.prototype.render=function(){var _this2=this,_this$state=this.state,url=_this$state.url,submittedInvalidUrl=_this$state.submittedInvalidUrl,_this$props2=this.props,t=_this$props2.t,isMobile=_this$props2.isMobile,languageDir=_this$props2.languageDir,helpers=_this$props2.helpers;return React__default.default.createElement(wixRichContentUiComponents.UrlInputModal,{onConfirm:this.onConfirm,input:url,t:t,languageDir:languageDir,title:t(isMobile?"SoundCloudUploadModal_Header_Mobile":"SoundCloudUploadModal_Header"),submittedInvalidUrl:submittedInvalidUrl,dataHook:"soundCloudUploadModal",onInputChange:function(url){return _this2.setState({url:url})},errorMessage:t("SoundCloudUploadModal_Input_InvalidUrl"),placeholder:t("SoundCloudUploadModal_Input_Placeholder"),onCloseRequested:helpers.closeModal,buttonSize:wixRichContentUiComponents.BUTTON_SIZE.medium})},SoundCloudURLInputModal}(React.Component),Modals={SOUND_CLOUD_URL_INPUT:"sound-cloud-url-input"},ModalsMap=((_ModalsMap={})[Modals.SOUND_CLOUD_URL_INPUT]=SoundCloudURLInputModal,_ModalsMap),InsertPluginIcon=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19"},props),React__default.default.createElement("path",{d:"M5.2,9 L5.8,9 C5.9104569,9 6,9.05969537 6,9.13333333 L6,14.8666667 C6,14.9403046 5.9104569,15 5.8,15 L5.2,15 C5.0895431,15 5,14.9403046 5,14.8666667 L5,9.13333333 C5,9.05969537 5.0895431,9 5.2,9 Z M3.2,8 L3.8,8 C3.9104569,8 4,8.06268014 4,8.14 L4,14.86 C4,14.9373198 3.9104569,15 3.8,15 L3.2,15 C3.0895431,15 3,14.9373198 3,14.86 L3,8.14 C3,8.06268014 3.0895431,8 3.2,8 Z M1.2,10 L1.8,10 C1.91045695,10 2,10.0447715 2,10.1 L2,13.9 C2,13.9552284 1.91045695,14 1.8,14 L1.2,14 C1.08954305,14 1,13.9552284 1,13.9 L1,10.1 C1,10.0447715 1.08954305,10 1.2,10 Z M18,11.6153846 C18,13.4846561 16.4846561,15 14.6153846,15 L7.84615385,15 C7.37883602,15 7,14.621164 7,14.1538462 L7,4.84615385 C8.1282051,4.28205128 9.39743587,4 10.8076923,4 C12.9089391,4 15.0384615,6.12783884 15.0384615,8.23076923 C16.7079981,8.4650878 18,9.8893546 18,11.6153846 Z M8,14 L14.5454545,14 C15.9010625,14 17,12.9010625 17,11.5454545 C17,10.3050264 16.0718944,9.25574738 14.8408286,9.08296796 L14.1363636,8.98409667 L14.1363636,8.27272727 C14.1363636,6.69177453 12.4441412,5 10.8636364,5 C9.81175629,5 8.85922746,5.17619715 8,5.52684396 L8,14 Z"}))},MediaReplaceIcon=function(props){return React__default.default.createElement("svg",Object.assign({xmlnsXlink:"http://www.w3.org/1999/xlink",width:19,height:19,viewBox:"0 0 19 19"},props),React__default.default.createElement("defs",null,React__default.default.createElement("path",{id:"replace-path",d:"M3 7.8V3.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2v2.592A6.607 6.607 0 0 1 9.412 3C13.05 3 16 5.91 16 9.5c0 .168-.006.335-.02.5h-1.016a5.51 5.51 0 0 0 .022-.5c0-3.038-2.495-5.5-5.574-5.5a5.583 5.583 0 0 0-4.967 3H7.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H3.2a.2.2 0 0 1-.2-.2zm13 3.4v4.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2v-2.592A6.607 6.607 0 0 1 9.588 16C5.95 16 3 13.09 3 9.5c0-.168.006-.335.02-.5h1.016a5.496 5.496 0 0 0-.022.5c0 3.038 2.495 5.5 5.574 5.5a5.583 5.583 0 0 0 4.967-3H11.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h4.6c.11 0 .2.09.2.2z"})),React__default.default.createElement("g",{fillRule:"evenodd"},React__default.default.createElement("mask",{id:"replace-mask"},React__default.default.createElement("use",{xlinkHref:"#replace-path"})),React__default.default.createElement("use",{fillRule:"nonzero",xlinkHref:"#replace-path"})))},createInlineButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,icon=(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.replace)||MediaReplaceIcon;return[{keyName:"sizeSmallCenter",type:wixRichContentPluginCommons.BUTTONS.SIZE_SMALL_CENTER,mobile:!1},{keyName:"sizeContent",type:wixRichContentPluginCommons.BUTTONS.SIZE_CONTENT,mobile:!1},{keyName:"sizeFullWidth",type:wixRichContentPluginCommons.BUTTONS.SIZE_FULL_WIDTH,mobile:!1},{keyName:"separator1",type:wixRichContentPluginCommons.BUTTONS.SEPARATOR,mobile:!1},{keyName:"sizeSmallLeft",type:wixRichContentPluginCommons.BUTTONS.SIZE_SMALL_LEFT,mobile:!1},{keyName:"sizeSmallRight",type:wixRichContentPluginCommons.BUTTONS.SIZE_SMALL_RIGHT,mobile:!1},{keyName:"separator2",type:wixRichContentPluginCommons.BUTTONS.SEPARATOR,mobile:!1},{keyName:"replace",type:wixRichContentPluginCommons.BUTTONS.EXTERNAL_MODAL,icon:icon,modalName:Modals.SOUND_CLOUD_URL_INPUT,modalStyles:wixRichContentEditorCommon.getModalStyles({fullScreen:!1,isMobile:isMobile}),mobile:!0,tooltipTextKey:"ReplaceSoundCloudButton_Tooltip",t:t},{keyName:"delete",type:wixRichContentPluginCommons.BUTTONS.DELETE,mobile:!0}]},ReactPlayerWrapper=function(_Component){function ReactPlayerWrapper(props){var _this;return(_this=_Component.call(this,props)||this).isVimeoAndRequireJS=function(){return!wixRichContentCommon.isSSR()&&(url=_this.props.url,MATCH_URL=/vimeo\.com\/.+/,!/vimeo\.com\/external\/[0-9]+\..+/.test(url)&&MATCH_URL.test(url))&&!window.Vimeo&&window.requirejs;var url,MATCH_URL},_this.state={vimeoLoaded:!1},_this}_inheritsLoose__default.default(ReactPlayerWrapper,_Component);var _proto=ReactPlayerWrapper.prototype;return _proto.componentDidMount=function(){var _this2=this;this.isVimeoAndRequireJS()&&window.require(["https://player.vimeo.com/api/player.js"],(function(player){window.Vimeo={Player:player},_this2.setState({vimeoLoaded:!0})}))},ReactPlayerWrapper.getDerivedStateFromProps=function(props){return props.disabled?{playing:!1}:null},_proto.render=function(){var _this3=this;return!this.state.vimeoLoaded&&this.isVimeoAndRequireJS()?null:React__default.default.createElement(ReactPlayer__default.default,_extends__default.default({playing:this.state.playing,onPlay:function(){return _this3.setState({playing:!0})},onPause:function(){return _this3.setState({playing:!1})}},this.props))},ReactPlayerWrapper}(React.Component);ReactPlayerWrapper.defaultProps={};var styles$1={soundCloud_player:"_1fHLh",soundCloud_container:"_2yaT6"},SoundCloudViewer=function(_Component){function SoundCloudViewer(props){var _this;return(_this=_Component.call(this,props)||this).handleReady=function(){_this.state.isLoaded||_this.setState({isLoaded:!0})},wixRichContentCommon.validate(props.componentData,pluginSoundCloudSchema__default.default),_this.state={playing:!1,isLoaded:!1},_this}_inheritsLoose__default.default(SoundCloudViewer,_Component);var _proto=SoundCloudViewer.prototype;return _proto.componentWillReceiveProps=function(nextProps){lodash.isEqual(nextProps.componentData,this.props.componentData)||wixRichContentCommon.validate(nextProps.componentData,pluginSoundCloudSchema__default.default)},_proto.render=function(){this.styles=wixRichContentCommon.mergeStyles({styles:styles$1,theme:this.props.theme});var _this$props=this.props,componentData=_this$props.componentData,width=_this$props.width,height=_this$props.height,controls=_this$props.controls,disabled=_this$props.disabled,setComponentUrl=_this$props.setComponentUrl;null==setComponentUrl||setComponentUrl(componentData.src);var isLoaded=this.state.isLoaded,props={width:width,height:height,controls:controls,disabled:disabled};return React__default.default.createElement(ReactPlayerWrapper,_extends__default.default({className:classNames__default.default(this.styles.soundCloud_player),url:componentData.src,onReady:this.handleReady,"data-loaded":isLoaded},props))},SoundCloudViewer}(React.Component);SoundCloudViewer.defaultProps={width:"100%",height:"100%",controls:!0};var styles={soundCloud_player:"_1K4oD",soundCloud_container:"_2NrS-",soundCloud_overlay:"_2_YOf",soundCloud_overlay_message:"_3REam"},SOUND_CLOUD_TYPE="wix-draft-plugin-sound-cloud",DEFAULTS$1=Object.freeze({config:{size:"content",alignment:"center"}}),SoundCloud=function(_Component){function SoundCloud(props){var _this;(_this=_Component.call(this,props)||this).setPlayer=function(player){_this.player=player},_this.handlePlay=function(event){event.preventDefault(),event.stopPropagation(),_this.setState({isLoading:!0}),setTimeout((function(){return _this.handleReady()}),5e3)},_this.handleSoundCloudStart=function(player){_this.player!==player&&_this.setState({isLoading:!1,isLoaded:!1})},_this.handleReady=function(){_this.state.isLoaded||_this.setState({isLoaded:!0})},_this.renderOverlay=function(styles,t){var isLoaded=_this.state.isLoaded,overlayText=t("SoundCloudComponent_Overlay");return React__default.default.createElement("div",{className:classNames__default.default(styles.soundCloud_overlay)},isLoaded&&React__default.default.createElement("span",{className:styles.soundCloud_overlay_message},overlayText))},_this.renderPlayer=function(){var _this$props=_this.props,componentData=_this$props.componentData,theme=_this$props.theme,disabled=_this$props.disabled,setComponentUrl=_this$props.setComponentUrl;return React__default.default.createElement(SoundCloudViewer,{ref:_this.setPlayer,componentData:componentData,onReady:_this.handleReady,onStart:_this.handleStart,theme:theme,disabled:disabled,setComponentUrl:setComponentUrl})},_this.onKeyDown=function(e,handler){"Enter"!==e.key&&" "!==e.key||handler()};var isPlayable=!props.blockProps;return _this.state={isLoading:!1,isLoaded:!1,isPlayable:isPlayable},_this}_inheritsLoose__default.default(SoundCloud,_Component);var _proto=SoundCloud.prototype;return _proto.componentDidMount=function(){this.handlePlayerFocus()},_proto.componentDidUpdate=function(){this.handlePlayerFocus()},_proto.handlePlayerFocus=function(){return!this.state.isPlayable&&this.player&&reactDom.findDOMNode(this.player).querySelector("iframe")&&(reactDom.findDOMNode(this.player).querySelector("iframe").tabIndex=-1)},_proto.render=function(){var _this2=this;this.styles=this.styles||wixRichContentCommon.mergeStyles({styles:styles,theme:this.props.theme});var _this$props2=this.props,className=_this$props2.className,onClick=_this$props2.onClick,isPlayable=this.state.isPlayable,containerClassNames=classNames__default.default(this.styles.soundCloud_container,className||"");return React__default.default.createElement("div",{"data-hook":"soundCloudPlayer",onClick:onClick,className:containerClassNames,onKeyDown:function(e){return _this2.onKeyDown(e,onClick)},draggable:!0},!isPlayable&&this.renderOverlay(this.styles,this.props.t),this.renderPlayer())},SoundCloud}(React.Component);SoundCloud.type={SOUND_CLOUD_TYPE:SOUND_CLOUD_TYPE};var createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,content=isMobile?{maxWidth:580,minHeight:"100%",minWidth:"100%",margin:0,alignContent:"center",top:0,transform:"none"}:{maxWidth:580,minHeight:348},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;return[{type:wixRichContentEditorCommon.BUTTON_TYPES.MODAL,name:wixRichContentEditorCommon.INSERT_PLUGIN_BUTTONS.SOUND_CLOUD,tooltip:t("SoundCloudPlugin_InsertButton_Tooltip"),getIcon:function(){return icon},componentData:DEFAULTS$1,toolbars:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN,wixRichContentEditorCommon.TOOLBARS.MOBILE,wixRichContentEditorCommon.TOOLBARS.FOOTER,wixRichContentEditorCommon.TOOLBARS.SIDE],modalElement:SoundCloudURLInputModal,modalStyles:wixRichContentEditorCommon.getModalStyles({customStyles:{content:content},fullScreen:!1,isMobile:isMobile}),section:"BlockToolbar_Section_Embed_Social"}]},createToolbar=function(_ref){var t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings;return{InlineButtons:createInlineButtons({t:t,isMobile:isMobile,settings:settings}),InsertButtons:createInsertButtons({t:t,isMobile:isMobile,settings:settings}),name:"soundCloud"}};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 createSoundCloudPlugin=function(config){var type=SOUND_CLOUD_TYPE,helpers=config.helpers,t=config.t,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,isMobile=config.isMobile,rest=_objectWithoutPropertiesLoose__default.default(config,["helpers","t",type,"isMobile"].map(_toPropertyKey));return console.warn("Sound-cloud plugin is deprecated and will be removed in the next version. Please consume sound-cloud plugin through video plugin as described in https://ricos.js.org/docs/plugins_api/VideoPlugin#sound-cloud-plugin"),wixRichContentPluginCommons.createBasePlugin(_extends__default.default({component:SoundCloud,settings:settings,type:type,toolbar:createToolbar({helpers:helpers,t:t,isMobile:isMobile,settings:settings}),helpers:helpers,t:t,isMobile:isMobile,defaultPluginData:DEFAULTS$1},rest))};createSoundCloudPlugin.functionName=SOUND_CLOUD_TYPE;var containerClassName=function(theme){return wixRichContentCommon.mergeStyles({styles:styles$1,theme:theme}).soundCloud_container},DEFAULTS_config={};exports.Modals=Modals,exports.ModalsMap=ModalsMap,exports.SOUND_CLOUD_TYPE=SOUND_CLOUD_TYPE,exports.SoundCloudViewer=SoundCloudViewer,exports.createSoundCloudPlugin=createSoundCloudPlugin,exports.pluginSoundCloud=function(config){return{config:_extends__default.default({},DEFAULTS_config,config),type:SOUND_CLOUD_TYPE,createPlugin:createSoundCloudPlugin,ModalsMap:ModalsMap}},exports.soundCloudTypeMapper=function(){var _ref;return(_ref={})[SOUND_CLOUD_TYPE]={component:SoundCloudViewer,classNameStrategies:{container:containerClassName}},_ref}; | ||
//# sourceMappingURL=module.cjs.js.map |
@@ -1,4 +0,2 @@ | ||
import{HEADER_BLOCK,RICOS_TEXT_COLOR_TYPE,RICOS_TEXT_HIGHLIGHT_TYPE,RICOS_FONT_SIZE_TYPE,TEXT_COLOR_TYPE,TEXT_HIGHLIGHT_TYPE,RICOS_BOLD_TYPE,RICOS_ITALIC_TYPE}from"ricos-content";export*from"ricos-content";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component,PureComponent,useRef,useEffect}from"react";import{InView}from"react-intersection-observer";import classNames from"classnames";import _extends from"@babel/runtime/helpers/extends";import{pickBy,has,mergeWith,upperFirst,camelCase,merge}from"lodash";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _regeneratorRuntime from"@babel/runtime/regenerator";import{translate,I18nextProvider,I18n}from"react-i18next";export{Trans,translate}from"react-i18next";import{createInstance}from"i18next";var __assign$r=function(){return(__assign$r=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};var _DRAFT_TO_RICOS_DOC_T,ButtonType,ModifierKey,ToolbarType,DisplayMode,DecorationMode,baseLink={target:"SELF"},Link_fromJSON=function(object){var message=__assign$r({},baseLink);return void 0!==object.url&&null!==object.url?message.url=String(object.url):message.url=void 0,void 0!==object.anchor&&null!==object.anchor?message.anchor=String(object.anchor):message.anchor=void 0,void 0!==object.target&&null!==object.target?message.target=function(object){switch(object){case 0:case"SELF":return"SELF";case 1:case"BLANK":return"BLANK";case 2:case"PARENT":return"PARENT";case 3:case"TOP":return"TOP";case-1:case"UNRECOGNIZED":default:return"UNRECOGNIZED"}}(object.target):message.target="SELF",void 0!==object.rel&&null!==object.rel?message.rel=Link_Rel.fromJSON(object.rel):message.rel=void 0,void 0!==object.customData&&null!==object.customData?message.customData=String(object.customData):message.customData=void 0,message},Link_toJSON=function(message){var obj={};return void 0!==message.url&&(obj.url=message.url),void 0!==message.anchor&&(obj.anchor=message.anchor),void 0!==message.target&&(obj.target=function(object){switch(object){case"SELF":return"SELF";case"BLANK":return"BLANK";case"PARENT":return"PARENT";case"TOP":return"TOP";default:return"UNKNOWN"}}(message.target)),void 0!==message.rel&&(obj.rel=message.rel?Link_Rel.toJSON(message.rel):void 0),void 0!==message.customData&&(obj.customData=message.customData),obj},baseLink_Rel={},Link_Rel={fromJSON:function(object){var message=__assign$r({},baseLink_Rel);return void 0!==object.nofollow&&null!==object.nofollow?message.nofollow=Boolean(object.nofollow):message.nofollow=void 0,void 0!==object.sponsored&&null!==object.sponsored?message.sponsored=Boolean(object.sponsored):message.sponsored=void 0,void 0!==object.ugc&&null!==object.ugc?message.ugc=Boolean(object.ugc):message.ugc=void 0,message},toJSON:function(message){var obj={};return void 0!==message.nofollow&&(obj.nofollow=message.nofollow),void 0!==message.sponsored&&(obj.sponsored=message.sponsored),void 0!==message.ugc&&(obj.ugc=message.ugc),obj}},__assign$n=function(){return(__assign$n=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},baseLinkData={},LinkData={fromJSON:function(object){var message=__assign$n({},baseLinkData);return void 0!==object.link&&null!==object.link?message.link=Link_fromJSON(object.link):message.link=void 0,message},toJSON:function(message){var obj={};return void 0!==message.link&&(obj.link=message.link?Link_toJSON(message.link):void 0),obj}},DROPDOWN_OPTIONS_TO_DOC_STYLE_TYPE={P:"paragraph",H1:"headerOne",H2:"headerTwo",H3:"headerThree",H4:"headerFour",H5:"headerFive",H6:"headerSix"},DRAFT_TO_RICOS_DOC_TYPE=((_DRAFT_TO_RICOS_DOC_T={})[HEADER_BLOCK.ONE]="headerOne",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.TWO]="headerTwo",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.THREE]="headerThree",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.FOUR]="headerFour",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.FIVE]="headerFive",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.SIX]="headerSix",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.PARAGRAPH]="paragraph",_DRAFT_TO_RICOS_DOC_T);!function(ButtonType){ButtonType.CUSTOM="custom",ButtonType.FILES="file",ButtonType.TOGGLE="toggle",ButtonType.PANEL="panel",ButtonType.INLINE_PANEL="inline-panel",ButtonType.EXTERNAL_MODAL="external-modal",ButtonType.DROPDOWN="dropdown",ButtonType.SEPARATOR="separator",ButtonType.SIZE_ORIGINAL="size-original",ButtonType.SIZE_CONTENT_CENTER="size-content-center",ButtonType.SIZE_SMALL_CENTER="size-small-center",ButtonType.SIZE_SMALL_LEFT="size-small-left",ButtonType.SIZE_SMALL_RIGHT="size-small-right",ButtonType.ALIGN_LEFT="align-left",ButtonType.ALIGN_RIGHT="align-right",ButtonType.ALIGN_CENTER="align-center",ButtonType.SIZE_CONTENT="size-content",ButtonType.SIZE_FULL_WIDTH="size-full-width",ButtonType.SIZE_SMALL="size-small",ButtonType.SIZE_MEDIUM="size-medium",ButtonType.SIZE_LARGE="size-large",ButtonType.TEXT_ALIGN_LEFT="alignment-left",ButtonType.TEXT_ALIGN_CENTER="alignment-center",ButtonType.TEXT_ALIGN_RIGHT="alignment-right",ButtonType.WIDTH="width",ButtonType.HEIGHT="height",ButtonType.LINK="link",ButtonType.SPOILER="spoiler",ButtonType.DELETE="delete",ButtonType.LINK_PREVIEW="link-preview",ButtonType.VIDEO_SETTINGS="video-settings"}(ButtonType||(ButtonType={})),function(ModifierKey){ModifierKey.COMMAND="command",ModifierKey.CTRL="ctrl",ModifierKey.OPTION="option",ModifierKey.SHIFT="shift",ModifierKey.ALT="alt"}(ModifierKey||(ModifierKey={})),function(ToolbarType){ToolbarType.SIDE="SIDE",ToolbarType.MOBILE="MOBILE",ToolbarType.FOOTER="FOOTER",ToolbarType.STATIC="STATIC",ToolbarType.INLINE="INLINE",ToolbarType.PLUGIN="PLUGIN",ToolbarType.FORMATTING="FORMATTING",ToolbarType.INSERT_PLUGIN="INSERT_PLUGIN",ToolbarType.TEXT="ALL-TEXT-TOOLBARS",ToolbarType.SHORTCUT="SHORTCUT",ToolbarType.LINK="LINK"}(ToolbarType||(ToolbarType={})),function(DisplayMode){DisplayMode.NORMAL="NORMAL",DisplayMode.FLOATING="FLOATING"}(DisplayMode||(DisplayMode={})),function(DecorationMode){DecorationMode.PREPEND="PREPEND",DecorationMode.WRAP="WRAP",DecorationMode.APPEND="APPEND"}(DecorationMode||(DecorationMode={}));var CUSTOM_LINK="custom-link",noOutlineStyle_noOutline="_1-vl0",AccessibilityListener=function(_Component){function AccessibilityListener(){var _this;return(_this=_Component.apply(this,arguments)||this).handleTabKeyUp=function(e){9===e.which&&document.body.classList.contains(noOutlineStyle_noOutline)&&document.body.classList.remove(noOutlineStyle_noOutline)},_this.handleClick=function(){document.body.classList.contains(noOutlineStyle_noOutline)||document.body.classList.add(noOutlineStyle_noOutline)},_this.render=function(){return null},_this}_inheritsLoose(AccessibilityListener,_Component);var _proto=AccessibilityListener.prototype;return _proto.componentDidMount=function(){document.body.classList.add(noOutlineStyle_noOutline),this.props.isMobile||(document.addEventListener("keyup",this.handleTabKeyUp),document.addEventListener("click",this.handleClick))},_proto.componentWillUnmount=function(){this.props.isMobile||(document.removeEventListener("keyup",this.handleTabKeyUp),document.removeEventListener("click",this.handleClick))},AccessibilityListener}(Component),cssClassMerger=function(defaultStyleClassName,themeClassName){return defaultStyleClassName+" "+themeClassName},mergeStyles=function(_ref){var styles=_ref.styles,theme=_ref.theme;if(!theme)return console.warn("mergeStyles invoked without theme!"),styles;var themeStyles=pickBy(theme),themeStylesToMerge=pickBy(themeStyles,(function(_,key){return has(styles,key)}));return mergeWith(_extends({},styles),themeStylesToMerge,cssClassMerger)},isSSR=function(){return"undefined"==typeof window},styles={placeholder:"_2bUeE"},ViewportRenderer=function(_Component){function ViewportRenderer(){return _Component.apply(this,arguments)||this}return _inheritsLoose(ViewportRenderer,_Component),ViewportRenderer.prototype.render=function(){var _this=this,_this$props=this.props,children=_this$props.children,placeholderStyle=_this$props.placeholderStyle,placeholderClass=_this$props.placeholderClass,containerStyle=_this$props.containerStyle,containerClass=_this$props.containerClass,theme=this.props.theme;return this.styles=this.styles||mergeStyles({styles:styles,theme:theme}),isSSR()||void 0===window.IntersectionObserver?children:React.createElement(InView,{triggerOnce:!0},(function(_ref){var inView=_ref.inView,ref=_ref.ref;return inView?React.createElement("div",{ref:ref,style:containerStyle,className:containerClass},children):React.createElement("div",{ref:ref,className:classNames(_this.styles.placeholder,placeholderClass),style:placeholderStyle})}))},ViewportRenderer}(Component);function i18n(_ref){var _resources,locale=_ref.locale,localeResource=_ref.localeResource;return createInstance().init({lng:locale,keySeparator:"$",interpolation:{escapeValue:!1},react:{wait:!0},resources:(_resources={},_resources[locale]={translation:localeResource},_resources)})}function getDisplayName(Component){return Component.displayName||Component.name||"Component"}function createHocName(hocComponentName,WrappedComponent){return hocComponentName+"("+getDisplayName(WrappedComponent)+")"}ViewportRenderer.defaultProps={placeholderStyle:{},containerStyle:{},alwaysRenderChildren:!1,placeholderClass:"",containerClass:""};var memoizedNow,_excluded=["forwardedRef"],withI18n=function(Component,defaultLocaleResource,_temp){var _ref$forceRemount=(void 0===_temp?{}:_temp).forceRemount,forceRemount=void 0===_ref$forceRemount||_ref$forceRemount,Translated=translate(void 0,{withRef:!0})(Component),I18nWrapper=function(_PureComponent){function I18nWrapper(props){var _this;_this=_PureComponent.call(this,props)||this;var locale=props.locale,localeResource=props.localeResource;return _this.i18n=i18n({locale:locale,localeResource:localeResource}),_this.state={key:I18nWrapper.displayName+"-"+locale},_this}_inheritsLoose(I18nWrapper,_PureComponent);var _proto=I18nWrapper.prototype;return _proto.componentDidMount=function(){var _componentDidMount=_asyncToGenerator(_regeneratorRuntime.mark((function _callee(){var _yield$this$getResour,locale,localeResource;return _regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:if("en"===this.props.locale){_context.next=7;break}return _context.next=3,this.getResourceByLocale(this.props.locale);case 3:_yield$this$getResour=_context.sent,locale=_yield$this$getResour.locale,localeResource=_yield$this$getResour.localeResource,this.changeLocale({locale:locale,localeResource:localeResource});case 7:case"end":return _context.stop()}}),_callee,this)})));return function(){return _componentDidMount.apply(this,arguments)}}(),_proto.componentWillReceiveProps=function(nextProps){this.props.locale!==nextProps.locale&&this.changeLocale(nextProps)},_proto.getResourceByLocale=function(){var _getResourceByLocale=_asyncToGenerator(_regeneratorRuntime.mark((function _callee2(locale){var localeResource;return _regeneratorRuntime.wrap((function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.prev=0,_context2.next=3,import( | ||
/* webpackChunkName: "messages_[request]" */ | ||
"wix-rich-content-common/dist/statics/locale/messages_"+locale+".json").then((function(res){return res.default}));case 3:return localeResource=_context2.sent,_context2.abrupt("return",{locale:locale,localeResource:localeResource});case 7:throw _context2.prev=7,_context2.t0=_context2.catch(0),new Error("error while loading locale "+locale+":\n"+_context2.t0);case 10:case"end":return _context2.stop()}}),_callee2,null,[[0,7]])})));return function(_x){return _getResourceByLocale.apply(this,arguments)}}(),_proto.changeLocale=function(_ref2){var _this2=this,locale=_ref2.locale,localeResource=_ref2.localeResource;this.i18n.addResourceBundle(locale,"translation",localeResource),this.i18n.changeLanguage(locale,(function(err){err||(forceRemount?_this2.setState({key:I18nWrapper.displayName+"-"+_this2.i18n.language}):_this2.forceUpdate())}))},_proto.render=function(){var _this$props=this.props,forwardedRef=_this$props.forwardedRef,rest=_objectWithoutPropertiesLoose(_this$props,_excluded);return React.createElement(I18nextProvider,{i18n:this.i18n},React.createElement(Translated,Object.assign({key:this.state.key},rest,{ref:forwardedRef})))},I18nWrapper}(PureComponent);return I18nWrapper.defaultProps={locale:"en",localeResource:defaultLocaleResource},I18nWrapper.displayName=createHocName("I18nWrapper",Component),React.forwardRef((function(props,ref){return React.createElement(I18nWrapper,Object.assign({},props,{forwardedRef:ref}))}))},RicosTranslate=function(_ref3){var children=_ref3.children,locale=_ref3.locale,localeResource=_ref3.localeResource,i18nInstance=useRef(i18n({locale:locale,localeResource:localeResource})),_React$useState=React.useState(0),forceCounter=_React$useState[0],forceUpdate=_React$useState[1];return useEffect((function(){i18nInstance.current.addResourceBundle(locale,"translation",localeResource),i18nInstance.current.changeLanguage(locale,(function(err){err||forceUpdate(forceCounter+1)}))}),[locale,localeResource]),React.createElement(I18nextProvider,{i18n:i18nInstance.current},React.createElement(I18n,{i18n:i18nInstance.current,wait:!0,initialLanguage:locale},(function(t){return children(t)})))},alignmentClassName=function(componentData,theme,styles){var alignment=(componentData.config||{}).alignment;if(!alignment)return"";var key="align"+upperFirst(alignment);return classNames(styles[key],theme[key])},sizeClassName=function(componentData,theme,styles){var size=(componentData.config||{}).size;if(!size)return"";var key="size"+upperFirst(camelCase(size));return classNames(styles[key],theme[key])},textWrapClassName=function(componentData,theme,styles){var textWrap=(componentData.config||{}).textWrap;if(!textWrap)return"";var key="textWrap"+upperFirst(camelCase(textWrap));return classNames(styles[key],theme[key])},depthClassName=function(depth){return"public-DraftStyleDefault-block-depth"+depth},convertRelObjectToString=function(relObject){if(relObject){var relString="";return relObject.nofollow&&(relString+="nofollow "),relObject.sponsored&&(relString+="sponsored "),relObject.ugc&&(relString+="ugc"),relString.trim()}},convertRelStringToObject=function(rel){var relObject={};return rel?(rel.includes("nofollow")&&(relObject.nofollow=!0),rel.includes("sponsored")&&(relObject.sponsored=!0),rel.includes("ugc")&&(relObject.ugc=!0),relObject):relObject},convertTargetStringToBoolean=function(target){return"_blank"===target},convertTargetBooleanToString=function(targetBlank){return targetBlank?"_blank":"_top"},getRelValue=function(rel){return("noopener noreferrer "+(rel||"")).trim()},safeJsonParse=function(jsonString){try{return JSON.parse(jsonString)}catch(e){return}};function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}function compute(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C}function isOptionsObject(options){return options===Object(options)&&0!==Object.keys(options).length}function scrollIntoView$1(target,options){var targetIsDetached=!target.ownerDocument.documentElement.contains(target);if(isOptionsObject(options)&&"function"==typeof options.behavior)return options.behavior(targetIsDetached?[]:compute(target,options));if(!targetIsDetached){var computeOptions=function(options){return!1===options?{block:"end",inline:"nearest"}:isOptionsObject(options)?options:{block:"start",inline:"nearest"}}(options);return function(actions,behavior){void 0===behavior&&(behavior="auto");var canSmoothScroll="scrollBehavior"in document.body.style;actions.forEach((function(_ref){var el=_ref.el,top=_ref.top,left=_ref.left;el.scroll&&canSmoothScroll?el.scroll({top:top,left:left,behavior:behavior}):(el.scrollTop=top,el.scrollLeft=left)}))}(compute(target,computeOptions),computeOptions.behavior)}}var now=function(){return memoizedNow||(memoizedNow="performance"in window?performance.now.bind(performance):Date.now),memoizedNow()};function step(context){var time=now(),elapsed=Math.min((time-context.startTime)/context.duration,1),value=context.ease(elapsed),currentX=context.startX+(context.x-context.startX)*value,currentY=context.startY+(context.y-context.startY)*value;context.method(currentX,currentY),currentX!==context.x||currentY!==context.y?requestAnimationFrame((function(){return step(context)})):context.cb()}function smoothScroll(el,x,y,duration,ease,cb){var scrollable,startX,startY;void 0===duration&&(duration=600),void 0===ease&&(ease=function(t){return 1+--t*t*t*t*t}),scrollable=el,startX=el.scrollLeft,startY=el.scrollTop,step({scrollable:scrollable,method:function(x,y){el.scrollLeft=Math.ceil(x),el.scrollTop=Math.ceil(y)},startTime:now(),startX:startX,startY:startY,x:x,y:y,duration:duration,ease:ease,cb:cb})}var scrollIntoView=function(target,options){var overrides=options||{};return function(options){return options&&!options.behavior||"smooth"===options.behavior}(overrides)?scrollIntoView$1(target,{block:overrides.block,inline:overrides.inline,scrollMode:overrides.scrollMode,boundary:overrides.boundary,behavior:function(actions){return Promise.all(actions.reduce((function(results,_ref){var el=_ref.el,left=_ref.left,top=_ref.top,startLeft=el.scrollLeft,startTop=el.scrollTop;return startLeft===left&&startTop===top?results:[].concat(results,[new Promise((function(resolve){return smoothScroll(el,left,top,overrides.duration,overrides.ease,(function(){return resolve({el:el,left:[startLeft,left],top:[startTop,top]})}))}))])}),[]))}}):Promise.resolve(scrollIntoView$1(target,options))},anchorScroll=function(element,experiments){var _document$querySelect,_document$querySelect2,_document$querySelect3,_document$querySelect4,_experiments$anchorSc,fixedElementsOffset=((null===(_document$querySelect=document.querySelector('[id="SITE_HEADER"]'))||void 0===_document$querySelect?void 0:_document$querySelect.clientHeight)||0)+((null===(_document$querySelect2=document.querySelector('[id="WIX_ADS"]'))||void 0===_document$querySelect2?void 0:_document$querySelect2.clientHeight)||0)+((null===(_document$querySelect3=document.querySelector('[data-hook="mobileToolbar"]'))||void 0===_document$querySelect3?void 0:_document$querySelect3.clientHeight)||(null===(_document$querySelect4=document.querySelector('[data-hook="ricos-editor-toolbars"]'))||void 0===_document$querySelect4?void 0:_document$querySelect4.clientHeight)||0);null!=experiments&&null!==(_experiments$anchorSc=experiments.anchorScrollWithSmoothScrollIntoViewIfNeeded)&&void 0!==_experiments$anchorSc&&_experiments$anchorSc.enabled?anchorScrollUsingSmoothScrollIntoViewIfNeeded(element,fixedElementsOffset):anchorScrollUsingScrollIntoView(element,fixedElementsOffset)},anchorScrollUsingSmoothScrollIntoViewIfNeeded=function(element,fixedElementsOffset){var _element$style=element.style,paddingTop=_element$style.paddingTop,marginTop=_element$style.marginTop;element.style.marginTop="-"+fixedElementsOffset+"px",element.style.paddingTop=fixedElementsOffset+"px",scrollIntoView(element,{block:"start",inline:"start"}),element.style.marginTop=marginTop,element.style.paddingTop=paddingTop},anchorScrollUsingScrollIntoView=function(element,fixedElementsOffset){var _element$style2=element.style,paddingTop=_element$style2.paddingTop,marginTop=_element$style2.marginTop;element.style.marginTop="-"+fixedElementsOffset+"px",element.style.paddingTop=fixedElementsOffset+"px",element.scrollIntoView({behavior:"smooth"}),element.style.marginTop=marginTop,element.style.paddingTop=paddingTop},addAnchorTagToUrl=function(anchorString){var url=new URL(window.location.href);url.hash=anchorString,history.pushState({},"",url.href)},isNewTab=function(target){return"_blank"===target},hasLinksInBlock=function(block,contentState){return getLinkRangesInBlock(block,contentState).length>0},getLinkRangesInBlock=function(block,contentState){var ranges=[];return block.entityRanges.forEach((function(entityRange){var _contentState$entityM,entityType=null===(_contentState$entityM=contentState.entityMap[entityRange.key])||void 0===_contentState$entityM?void 0:_contentState$entityM.type;if("LINK"===entityType||"wix-draft-plugin-external-link"===entityType){var start=entityRange.offset,end=start+entityRange.length;ranges.push([start,end])}})),ranges},contentStateSchema={definitions:{inlineStyleDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/inline-style.json",type:"object",title:"inline style",required:["offset","length","style"],properties:{offset:{$id:"#/properties/offset",type:"integer",title:"offset",default:0,min:0,examples:[0]},length:{$id:"#/properties/length",type:"integer",title:"length",default:0,min:0,examples:[4]},style:{$id:"#/properties/style",type:"string",title:"style",default:"",examples:["color4"],pattern:"^(.*)$"}}},entityRangeDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/entity-range.json",type:"object",title:"inline style",required:["offset","length","key"],properties:{offset:{$id:"#/properties/offset",type:"integer",title:"offset",default:0,min:0,examples:[0]},length:{$id:"#/properties/length",type:"integer",title:"length",default:0,min:0,examples:[4]},key:{$id:"#/properties/style",type:"integer",title:"key",default:"",examples:[0]}}},entityDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/entity-range.json",type:"object",title:"entity",required:["type","data"],properties:{type:{$id:"#/properties/type",enum:["IMAGE","VIDEO-EMBED","LINK","mention","wix-draft-plugin-image","wix-draft-plugin-link-button","wix-draft-plugin-action-button","wix-draft-plugin-video","wix-draft-plugin-gallery","wix-draft-plugin-link","wix-draft-plugin-html","wix-draft-plugin-sound-cloud","wix-draft-plugin-hashtag","wix-draft-plugin-divider","wix-draft-plugin-emoji","wix-draft-plugin-giphy","wix-draft-plugin-map","wix-draft-plugin-file-upload","wix-draft-plugin-vertical-embed","wix-draft-plugin-poll","wix-draft-plugin-link-preview","ANCHOR","wix-rich-content-plugin-table"],title:"entity type",examples:["wix-draft-plugin-image"]},mutability:{$id:"#/properties/mutability",type:"string",enum:["MUTABLE","IMMUTABLE","SEGMENTED"],title:"entity mutability",examples:["IMMUTABLE"]},data:{$id:"#/properties/data",type:"object",title:"entity data"}},anyOf:[{}]}},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/content-state-schema.json",type:"object",title:"content state",required:["blocks","entityMap","VERSION"],properties:{blocks:{$id:"#/properties/blocks",type:"array",title:"blocks",items:{$id:"#/properties/blocks/items",type:"object",title:"block",required:["key","text","type","inlineStyleRanges","entityRanges","data"],properties:{key:{$id:"#/properties/blocks/items/properties/key",type:"string",title:"block key",default:"",examples:["45qkg"],pattern:"^(.*)$"},text:{$id:"#/properties/blocks/items/properties/text",type:"string",title:"text",default:"",examples:["test"]},type:{$id:"#/properties/blocks/items/properties/type",type:"string",title:"block type",default:"",examples:["unstyled"],enum:["unstyled","header-one","header-two","header-three","header-four","header-five","header-six","unordered-list-item","ordered-list-item","blockquote","atomic","code-block","figure"]},depth:{$id:"#/properties/blocks/items/properties/depth",type:"integer",title:"depth",maximum:10,default:0,examples:[0]},inlineStyleRanges:{$id:"#/properties/blocks/items/properties/inlineStyleRanges",type:"array",title:"inline style ranges",items:{$ref:"#/definitions/inlineStyleDef"}},entityRanges:{$id:"#/properties/blocks/items/properties/entityRanges",type:"array",title:"entity ranges",default:null,items:{$ref:"#/definitions/entityRangeDef"}},data:{$id:"#/properties/blocks/items/properties/data",type:"object",title:"data",default:null}}}},entityMap:{$id:"#/properties/entityMap",type:"object",title:"entity map",patternProperties:{"[0-9]+":{$ref:"#/definitions/entityDef"}}}}},validate=function(data,schema){return!0},getContentStateSchema=function(pluginDataSchemas){void 0===pluginDataSchemas&&(pluginDataSchemas={});var schema=contentStateSchema;return schema.definitions.entityDef.anyOf=Object.keys(pluginDataSchemas).map((function(pluginType){return{properties:{type:{const:pluginType},data:pluginDataSchemas[pluginType]}}})),schema},LTR="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",isRtlRegex=new RegExp("^[^"+LTR+"]*[֑-߿יִ-﷽ﹰ-ﻼ]"),isLtrRegex=new RegExp("^[^֑-߿יִ-﷽ﹰ-ﻼ]*["+LTR+"]"),emojiRegex=/\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]/g,getTextDirection=function(text){var result="neutral";if(!text)return result;var plainText=text.replace(emojiRegex,"");return isRtlRegex.test(plainText)?result="rtl":isLtrRegex.test(plainText)&&(result="ltr"),result},getDirectionFromAlignmentAndTextDirection=function(textAlignment,textDirection){return"right"===textAlignment?"rtl":"left"===textAlignment?"ltr":textDirection&&"rtl"===textDirection?textDirection:"ltr"},GlobalContext=React.createContext({isMobile:!1,experiments:{}}),isHexColor=function(str){return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(str)},rtlLangs=["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"],isRtl=function(locale){return!!locale&&rtlLangs.includes(locale.split("-|_")[0].toLowerCase())},getLangDir=function(locale){return isRtl(locale)?"rtl":"ltr"},simplePubsub=function(initialState){var state=initialState||{},listeners={},subscribe=function(key,callback){if("function"!=typeof callback)throw"Callback for key "+key+" is not a function";return listeners[key]=listeners[key]||[],listeners[key].push(callback),function(){listeners[key]=listeners[key].filter((function(listener){return listener!==callback}))}},update=function(key,newData,blockKey){var data=get(key),newItem=merge({},data,newData);blockKey?_setSingle(key,newItem,blockKey):set(key,newItem)},_setSingle=function(key,item,blockKey){var _extends2;state=_extends({},state,((_extends2={})[key]=item,_extends2)),listeners[key]&&listeners[key].forEach((function(listener){return listener(state[key],blockKey)}))},_setBatch=function(updates){state=_extends({},state,updates),Object.keys(updates).forEach((function(key){listeners[key]&&listeners[key].forEach((function(listener){return listener(state[key])}))}))},set=function(){1===arguments.length?_setBatch(arguments.length<=0?void 0:arguments[0]):_setSingle.apply(void 0,arguments)},setBlockHandler=function(key,blockKey,item){_setSingle(blockHandlerKey(key,blockKey),item)},get=function(key){return state[key]},getBlockHandler=function(key,blockKey){return void 0===blockKey&&(blockKey=state.focusedBlock),state[blockHandlerKey(key,blockKey)]},blockHandlerKey=function(key,blockKey){return blockKey+"_"+key};return{subscribe:subscribe,unsubscribe:function(key,callback){listeners[key]=listeners[key].filter((function(listener){return listener!==callback}))},update:update,set:set,setBlockHandler:setBlockHandler,get:get,getBlockHandler:getBlockHandler,store:{get:get,getBlockHandler:getBlockHandler,update:update,set:set,setBlockHandler:setBlockHandler},getBlockData:function(_ref3){var key=_ref3.key,_ref3$blockKey=_ref3.blockKey,blockKey=void 0===_ref3$blockKey?state.focusedBlock:_ref3$blockKey;return state[blockHandlerKey(key,blockKey)]},setBlockData:function(_ref2){var key=_ref2.key,_ref2$blockKey=_ref2.blockKey,blockKey=void 0===_ref2$blockKey?state.focusedBlock:_ref2$blockKey,item=_ref2.item;_setSingle(blockHandlerKey(key,blockKey),item)},subscribeOnBlock:function(_ref){var key=_ref.key,_ref$blockKey=_ref.blockKey,blockKey=void 0===_ref$blockKey?state.focusedBlock:_ref$blockKey,callback=_ref.callback;return subscribe(blockHandlerKey(key,blockKey),callback)}}},generateKey=function(){return Math.random().toString(36).substr(2,9)},getBlocksFromContentState=function(contentState){var entityMap,rceInRcePlugins,innerRCEBlocks=(entityMap=contentState.entityMap,rceInRcePlugins=["wix-rich-content-plugin-table","wix-rich-content-plugin-collapsible-list"],Object.values(entityMap).some((function(entity){return rceInRcePlugins.includes(entity.type)}))?getInnerRCEBlocks(contentState.entityMap):[]);return[].concat(contentState.blocks,innerRCEBlocks)};function getInnerRCEBlocks(object){var result=[];if(object instanceof Array)Array.prototype.forEach.call(object,(function(arrayElement){var innerBlocks=getInnerRCEBlocks(arrayElement);innerBlocks&&(result=[].concat(result,innerBlocks))}));else for(var _i=0,_Object$entries=Object.entries(object);_i<_Object$entries.length;_i++){var _Object$entries$_i=_Object$entries[_i],key=_Object$entries$_i[0],value=_Object$entries$_i[1];if("blocks"===key)return value;if(value instanceof Object||value instanceof Array){var innerBlocks=getInnerRCEBlocks(value);innerBlocks&&(result=[].concat(result,innerBlocks))}}return result}var _INLINE_STYLE_TYPES,_RICOS_TO_DRAFT_TYPE,_dynamicStyleParsers,_defaultStyleFnMapper,_defaultStyleSelectio,ADD_PLUGIN_LINK_BI="addPluginLink",WEB_ADDRESS_CATEGORY="web_address",ANCHOR_CATEGORY="section",LINK_VIEWER_DATA_HOOK="linkViewer",ANCHOR_VIEWER_DATA_HOOK="anchorViewer";function isInEditor(contentBlock){return contentBlock.toJS}function isInLink(i,block,contentState){var entityKey=function(i,block){var _block$entityRanges$f;return isInEditor(block)?block.getEntityAt(i):null===(_block$entityRanges$f=block.entityRanges.find((function(_ref){var offset=_ref.offset,length=_ref.length;return i>offset&&i<offset+length})))||void 0===_block$entityRanges$f?void 0:_block$entityRanges$f.key}(i,block);return function(type){return"LINK"===type||"ricos-plugin-custom-link"===type}(function(block,contentState,entityKey){var _contentState$entityM;return isInEditor(block)?null!==entityKey&&contentState.getEntity(entityKey).getType():null===(_contentState$entityM=contentState.entityMap[entityKey])||void 0===_contentState$entityM?void 0:_contentState$entityM.type}(block,contentState,entityKey))}function createJustificationFixDecorator(){var isTextJustified=function(contentBlock){return"justify"===function(contentBlock){var _contentBlock$data;return isInEditor(contentBlock)?contentBlock.getData().get("textAlignment"):null==contentBlock||null===(_contentBlock$data=contentBlock.data)||void 0===_contentBlock$data?void 0:_contentBlock$data.textAlignment}(contentBlock)};return{strategy:function(contentBlock,callback,contentState){if(!isSSR()&&(isSSR()||!window.chrome)&&isTextJustified(contentBlock))for(var match,regex=/\s[^\s]/g,str=contentBlock.getText();null!==(match=regex.exec(str));)isInLink(match.index,contentBlock,contentState)||callback(match.index,match.index+1)},component:function(props){return React.createElement("span",{style:{whiteSpace:"normal"}},props.children)}}}var INLINE_STYLE_TYPES=((_INLINE_STYLE_TYPES={})[RICOS_TEXT_COLOR_TYPE]="FG",_INLINE_STYLE_TYPES[RICOS_TEXT_HIGHLIGHT_TYPE]="BG",_INLINE_STYLE_TYPES[RICOS_FONT_SIZE_TYPE]="font-size",_INLINE_STYLE_TYPES),RICOS_TO_DRAFT_TYPE=((_RICOS_TO_DRAFT_TYPE={})[RICOS_TEXT_COLOR_TYPE]=TEXT_COLOR_TYPE,_RICOS_TO_DRAFT_TYPE[RICOS_TEXT_HIGHLIGHT_TYPE]=TEXT_HIGHLIGHT_TYPE,_RICOS_TO_DRAFT_TYPE),parseStyleByType=function(style,type){var property=INLINE_STYLE_TYPES[type],cssRule=safeJsonParse(style);return null==cssRule?void 0:cssRule[property]},dynamicStyleParsers=((_dynamicStyleParsers={})[RICOS_TEXT_COLOR_TYPE]=function(style,styleSelectionPredicate){var color=parseStyleByType(style,RICOS_TEXT_COLOR_TYPE);if(styleSelectionPredicate){var parsedStyle=color||style;return styleSelectionPredicate(parsedStyle)&&parsedStyle}return color||isHexColor(style)&&style},_dynamicStyleParsers[RICOS_TEXT_HIGHLIGHT_TYPE]=function(style,styleSelectionPredicate){var color=parseStyleByType(style,RICOS_TEXT_HIGHLIGHT_TYPE);return styleSelectionPredicate?styleSelectionPredicate(color)&&color:color},_dynamicStyleParsers[RICOS_FONT_SIZE_TYPE]=function(style){return parseStyleByType(style,RICOS_FONT_SIZE_TYPE)},_dynamicStyleParsers),draftDecorationsToCss={BOLD:{"font-weight":"bold"},ITALIC:{"font-style":"italic"},NOT_BOLD:{"font-weight":"normal"},NOT_ITALIC:{"font-style":"normal"}},defaultStyleFnMapper=((_defaultStyleFnMapper={})[RICOS_TEXT_COLOR_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[RICOS_TEXT_COLOR_TYPE](style,isHexColor);return parsedStyle?{color:parsedStyle}:void 0},_defaultStyleFnMapper[RICOS_TEXT_HIGHLIGHT_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[RICOS_TEXT_HIGHLIGHT_TYPE](style,isHexColor);return parsedStyle?{backgroundColor:parsedStyle}:void 0},_defaultStyleFnMapper[RICOS_FONT_SIZE_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[RICOS_FONT_SIZE_TYPE](style);return parsedStyle?{fontSize:parsedStyle}:void 0},_defaultStyleFnMapper[RICOS_BOLD_TYPE]=function(style){return"NOT_BOLD"===style?{fontWeight:"normal"}:void 0},_defaultStyleFnMapper[RICOS_ITALIC_TYPE]=function(style){return"NOT_ITALIC"===style?{fontStyle:"normal"}:void 0},_defaultStyleFnMapper),defaultStyleSelectionPredicates=((_defaultStyleSelectio={})[RICOS_TEXT_COLOR_TYPE]=isHexColor,_defaultStyleSelectio[RICOS_TEXT_HIGHLIGHT_TYPE]=isHexColor,_defaultStyleSelectio),getDynamicInlineStyleMapper=function(type){return function(config,raw){var settings=config[RICOS_TO_DRAFT_TYPE[type]||""]||{},styleParser=dynamicStyleParsers[type],styleSelectionPredicate=settings.styleSelectionPredicate?function(style){return!!styleParser(style,settings.styleSelectionPredicate)}:function(style){return!!styleParser(style,defaultStyleSelectionPredicates[type])},customStyleFn=settings.customStyleFn?function(style){return settings.customStyleFn(styleParser(style,settings.styleSelectionPredicate))}:defaultStyleFnMapper[type],mapper=getBlocksFromContentState(raw).reduce((function(map,block){return block.inlineStyleRanges&&block.inlineStyleRanges.filter((function(range){return styleSelectionPredicate(range.style)})).forEach((function(range){map[range.style]=function(children,_ref){var key=_ref.key;return React.createElement("span",{key:key,style:customStyleFn(range.style)},children)}})),map}),{});return function(){return mapper}}},uuid=function(){var d=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)}))};export{ADD_PLUGIN_LINK_BI,ANCHOR_CATEGORY,ANCHOR_VIEWER_DATA_HOOK,AccessibilityListener,ButtonType,CUSTOM_LINK,DRAFT_TO_RICOS_DOC_TYPE,DROPDOWN_OPTIONS_TO_DOC_STYLE_TYPE,DecorationMode,DisplayMode,GlobalContext,INLINE_STYLE_TYPES,LINK_VIEWER_DATA_HOOK,LinkData,Link_Rel,ModifierKey,RicosTranslate,ToolbarType,ViewportRenderer,WEB_ADDRESS_CATEGORY,addAnchorTagToUrl,alignmentClassName,anchorScroll,convertRelObjectToString,convertRelStringToObject,convertTargetBooleanToString,convertTargetStringToBoolean,createHocName,createJustificationFixDecorator,defaultStyleFnMapper,depthClassName,draftDecorationsToCss,dynamicStyleParsers,generateKey,getBlocksFromContentState,getContentStateSchema,getDirectionFromAlignmentAndTextDirection,getDisplayName,getDynamicInlineStyleMapper,getLangDir,getLinkRangesInBlock,getRelValue,getTextDirection,hasLinksInBlock,isHexColor,isNewTab,isRtl,isSSR,mergeStyles,parseStyleByType,safeJsonParse,simplePubsub,sizeClassName,textWrapClassName,uuid,validate,withI18n}; | ||
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{BUTTONS,createBasePlugin}from"wix-rich-content-plugin-commons";import{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 ReactPlayer from"react-player";import{UrlInputModal,BUTTON_SIZE}from"wix-rich-content-ui-components";import classNames from"classnames";import{findDOMNode}from"react-dom";import{isSSR,validate,mergeStyles}from"wix-rich-content-common";import pluginSoundCloudSchema from"wix-rich-content-common/dist/statics/schemas/plugin-sound-cloud.schema.json";import{isEqual}from"lodash";var _ModalsMap,SoundCloudURLInputModal=function(_Component){function SoundCloudURLInputModal(props){var _this;(_this=_Component.call(this,props)||this).onConfirm=function(){var url=_this.state.url;if(url&&ReactPlayer.canPlay(url)){var _helpers$closeModal,_this$props=_this.props,_componentData=_this$props.componentData,helpers=_this$props.helpers,pubsub=_this$props.pubsub,onConfirm=_this$props.onConfirm;onConfirm?onConfirm(_extends({},_componentData,{src:url})):pubsub.update("componentData",{src:url}),helpers&&helpers.onVideoSelected&&helpers.onVideoSelected(url,(function(data){return pubsub.update("componentData",{metadata:_extends({},data)})})),null===(_helpers$closeModal=helpers.closeModal)||void 0===_helpers$closeModal||_helpers$closeModal.call(helpers)}else _this.setState({submittedInvalidUrl:!0})};var componentData=_this.props.componentData;return _this.state={url:componentData.src||"",submittedInvalidUrl:!1},_this}return _inheritsLoose(SoundCloudURLInputModal,_Component),SoundCloudURLInputModal.prototype.render=function(){var _this2=this,_this$state=this.state,url=_this$state.url,submittedInvalidUrl=_this$state.submittedInvalidUrl,_this$props2=this.props,t=_this$props2.t,isMobile=_this$props2.isMobile,languageDir=_this$props2.languageDir,helpers=_this$props2.helpers;return React.createElement(UrlInputModal,{onConfirm:this.onConfirm,input:url,t:t,languageDir:languageDir,title:t(isMobile?"SoundCloudUploadModal_Header_Mobile":"SoundCloudUploadModal_Header"),submittedInvalidUrl:submittedInvalidUrl,dataHook:"soundCloudUploadModal",onInputChange:function(url){return _this2.setState({url:url})},errorMessage:t("SoundCloudUploadModal_Input_InvalidUrl"),placeholder:t("SoundCloudUploadModal_Input_Placeholder"),onCloseRequested:helpers.closeModal,buttonSize:BUTTON_SIZE.medium})},SoundCloudURLInputModal}(Component),Modals={SOUND_CLOUD_URL_INPUT:"sound-cloud-url-input"},ModalsMap=((_ModalsMap={})[Modals.SOUND_CLOUD_URL_INPUT]=SoundCloudURLInputModal,_ModalsMap),InsertPluginIcon=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19"},props),React.createElement("path",{d:"M5.2,9 L5.8,9 C5.9104569,9 6,9.05969537 6,9.13333333 L6,14.8666667 C6,14.9403046 5.9104569,15 5.8,15 L5.2,15 C5.0895431,15 5,14.9403046 5,14.8666667 L5,9.13333333 C5,9.05969537 5.0895431,9 5.2,9 Z M3.2,8 L3.8,8 C3.9104569,8 4,8.06268014 4,8.14 L4,14.86 C4,14.9373198 3.9104569,15 3.8,15 L3.2,15 C3.0895431,15 3,14.9373198 3,14.86 L3,8.14 C3,8.06268014 3.0895431,8 3.2,8 Z M1.2,10 L1.8,10 C1.91045695,10 2,10.0447715 2,10.1 L2,13.9 C2,13.9552284 1.91045695,14 1.8,14 L1.2,14 C1.08954305,14 1,13.9552284 1,13.9 L1,10.1 C1,10.0447715 1.08954305,10 1.2,10 Z M18,11.6153846 C18,13.4846561 16.4846561,15 14.6153846,15 L7.84615385,15 C7.37883602,15 7,14.621164 7,14.1538462 L7,4.84615385 C8.1282051,4.28205128 9.39743587,4 10.8076923,4 C12.9089391,4 15.0384615,6.12783884 15.0384615,8.23076923 C16.7079981,8.4650878 18,9.8893546 18,11.6153846 Z M8,14 L14.5454545,14 C15.9010625,14 17,12.9010625 17,11.5454545 C17,10.3050264 16.0718944,9.25574738 14.8408286,9.08296796 L14.1363636,8.98409667 L14.1363636,8.27272727 C14.1363636,6.69177453 12.4441412,5 10.8636364,5 C9.81175629,5 8.85922746,5.17619715 8,5.52684396 L8,14 Z"}))},MediaReplaceIcon=function(props){return React.createElement("svg",Object.assign({xmlnsXlink:"http://www.w3.org/1999/xlink",width:19,height:19,viewBox:"0 0 19 19"},props),React.createElement("defs",null,React.createElement("path",{id:"replace-path",d:"M3 7.8V3.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2v2.592A6.607 6.607 0 0 1 9.412 3C13.05 3 16 5.91 16 9.5c0 .168-.006.335-.02.5h-1.016a5.51 5.51 0 0 0 .022-.5c0-3.038-2.495-5.5-5.574-5.5a5.583 5.583 0 0 0-4.967 3H7.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H3.2a.2.2 0 0 1-.2-.2zm13 3.4v4.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2v-2.592A6.607 6.607 0 0 1 9.588 16C5.95 16 3 13.09 3 9.5c0-.168.006-.335.02-.5h1.016a5.496 5.496 0 0 0-.022.5c0 3.038 2.495 5.5 5.574 5.5a5.583 5.583 0 0 0 4.967-3H11.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h4.6c.11 0 .2.09.2.2z"})),React.createElement("g",{fillRule:"evenodd"},React.createElement("mask",{id:"replace-mask"},React.createElement("use",{xlinkHref:"#replace-path"})),React.createElement("use",{fillRule:"nonzero",xlinkHref:"#replace-path"})))},createInlineButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,icon=(null==settings||null===(_settings$toolbar=settings.toolbar)||void 0===_settings$toolbar||null===(_settings$toolbar$ico=_settings$toolbar.icons)||void 0===_settings$toolbar$ico?void 0:_settings$toolbar$ico.replace)||MediaReplaceIcon;return[{keyName:"sizeSmallCenter",type:BUTTONS.SIZE_SMALL_CENTER,mobile:!1},{keyName:"sizeContent",type:BUTTONS.SIZE_CONTENT,mobile:!1},{keyName:"sizeFullWidth",type:BUTTONS.SIZE_FULL_WIDTH,mobile:!1},{keyName:"separator1",type:BUTTONS.SEPARATOR,mobile:!1},{keyName:"sizeSmallLeft",type:BUTTONS.SIZE_SMALL_LEFT,mobile:!1},{keyName:"sizeSmallRight",type:BUTTONS.SIZE_SMALL_RIGHT,mobile:!1},{keyName:"separator2",type:BUTTONS.SEPARATOR,mobile:!1},{keyName:"replace",type:BUTTONS.EXTERNAL_MODAL,icon:icon,modalName:Modals.SOUND_CLOUD_URL_INPUT,modalStyles:getModalStyles({fullScreen:!1,isMobile:isMobile}),mobile:!0,tooltipTextKey:"ReplaceSoundCloudButton_Tooltip",t:t},{keyName:"delete",type:BUTTONS.DELETE,mobile:!0}]},ReactPlayerWrapper=function(_Component){function ReactPlayerWrapper(props){var _this;return(_this=_Component.call(this,props)||this).isVimeoAndRequireJS=function(){return!isSSR()&&(url=_this.props.url,MATCH_URL=/vimeo\.com\/.+/,!/vimeo\.com\/external\/[0-9]+\..+/.test(url)&&MATCH_URL.test(url))&&!window.Vimeo&&window.requirejs;var url,MATCH_URL},_this.state={vimeoLoaded:!1},_this}_inheritsLoose(ReactPlayerWrapper,_Component);var _proto=ReactPlayerWrapper.prototype;return _proto.componentDidMount=function(){var _this2=this;this.isVimeoAndRequireJS()&&window.require(["https://player.vimeo.com/api/player.js"],(function(player){window.Vimeo={Player:player},_this2.setState({vimeoLoaded:!0})}))},ReactPlayerWrapper.getDerivedStateFromProps=function(props){return props.disabled?{playing:!1}:null},_proto.render=function(){var _this3=this;return!this.state.vimeoLoaded&&this.isVimeoAndRequireJS()?null:React.createElement(ReactPlayer,_extends({playing:this.state.playing,onPlay:function(){return _this3.setState({playing:!0})},onPause:function(){return _this3.setState({playing:!1})}},this.props))},ReactPlayerWrapper}(Component);ReactPlayerWrapper.defaultProps={};var styles$1={soundCloud_player:"_1fHLh",soundCloud_container:"_2yaT6"},SoundCloudViewer=function(_Component){function SoundCloudViewer(props){var _this;return(_this=_Component.call(this,props)||this).handleReady=function(){_this.state.isLoaded||_this.setState({isLoaded:!0})},validate(props.componentData,pluginSoundCloudSchema),_this.state={playing:!1,isLoaded:!1},_this}_inheritsLoose(SoundCloudViewer,_Component);var _proto=SoundCloudViewer.prototype;return _proto.componentWillReceiveProps=function(nextProps){isEqual(nextProps.componentData,this.props.componentData)||validate(nextProps.componentData,pluginSoundCloudSchema)},_proto.render=function(){this.styles=mergeStyles({styles:styles$1,theme:this.props.theme});var _this$props=this.props,componentData=_this$props.componentData,width=_this$props.width,height=_this$props.height,controls=_this$props.controls,disabled=_this$props.disabled,setComponentUrl=_this$props.setComponentUrl;null==setComponentUrl||setComponentUrl(componentData.src);var isLoaded=this.state.isLoaded,props={width:width,height:height,controls:controls,disabled:disabled};return React.createElement(ReactPlayerWrapper,_extends({className:classNames(this.styles.soundCloud_player),url:componentData.src,onReady:this.handleReady,"data-loaded":isLoaded},props))},SoundCloudViewer}(Component);SoundCloudViewer.defaultProps={width:"100%",height:"100%",controls:!0};var styles={soundCloud_player:"_1K4oD",soundCloud_container:"_2NrS-",soundCloud_overlay:"_2_YOf",soundCloud_overlay_message:"_3REam"},SOUND_CLOUD_TYPE="wix-draft-plugin-sound-cloud",DEFAULTS$1=Object.freeze({config:{size:"content",alignment:"center"}}),SoundCloud=function(_Component){function SoundCloud(props){var _this;(_this=_Component.call(this,props)||this).setPlayer=function(player){_this.player=player},_this.handlePlay=function(event){event.preventDefault(),event.stopPropagation(),_this.setState({isLoading:!0}),setTimeout((function(){return _this.handleReady()}),5e3)},_this.handleSoundCloudStart=function(player){_this.player!==player&&_this.setState({isLoading:!1,isLoaded:!1})},_this.handleReady=function(){_this.state.isLoaded||_this.setState({isLoaded:!0})},_this.renderOverlay=function(styles,t){var isLoaded=_this.state.isLoaded,overlayText=t("SoundCloudComponent_Overlay");return React.createElement("div",{className:classNames(styles.soundCloud_overlay)},isLoaded&&React.createElement("span",{className:styles.soundCloud_overlay_message},overlayText))},_this.renderPlayer=function(){var _this$props=_this.props,componentData=_this$props.componentData,theme=_this$props.theme,disabled=_this$props.disabled,setComponentUrl=_this$props.setComponentUrl;return React.createElement(SoundCloudViewer,{ref:_this.setPlayer,componentData:componentData,onReady:_this.handleReady,onStart:_this.handleStart,theme:theme,disabled:disabled,setComponentUrl:setComponentUrl})},_this.onKeyDown=function(e,handler){"Enter"!==e.key&&" "!==e.key||handler()};var isPlayable=!props.blockProps;return _this.state={isLoading:!1,isLoaded:!1,isPlayable:isPlayable},_this}_inheritsLoose(SoundCloud,_Component);var _proto=SoundCloud.prototype;return _proto.componentDidMount=function(){this.handlePlayerFocus()},_proto.componentDidUpdate=function(){this.handlePlayerFocus()},_proto.handlePlayerFocus=function(){return!this.state.isPlayable&&this.player&&findDOMNode(this.player).querySelector("iframe")&&(findDOMNode(this.player).querySelector("iframe").tabIndex=-1)},_proto.render=function(){var _this2=this;this.styles=this.styles||mergeStyles({styles:styles,theme:this.props.theme});var _this$props2=this.props,className=_this$props2.className,onClick=_this$props2.onClick,isPlayable=this.state.isPlayable,containerClassNames=classNames(this.styles.soundCloud_container,className||"");return React.createElement("div",{"data-hook":"soundCloudPlayer",onClick:onClick,className:containerClassNames,onKeyDown:function(e){return _this2.onKeyDown(e,onClick)},draggable:!0},!isPlayable&&this.renderOverlay(this.styles,this.props.t),this.renderPlayer())},SoundCloud}(Component);SoundCloud.type={SOUND_CLOUD_TYPE:SOUND_CLOUD_TYPE};var createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,content=isMobile?{maxWidth:580,minHeight:"100%",minWidth:"100%",margin:0,alignContent:"center",top:0,transform:"none"}:{maxWidth:580,minHeight:348},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;return[{type:BUTTON_TYPES.MODAL,name:INSERT_PLUGIN_BUTTONS.SOUND_CLOUD,tooltip:t("SoundCloudPlugin_InsertButton_Tooltip"),getIcon:function(){return icon},componentData:DEFAULTS$1,toolbars:[TOOLBARS.INSERT_PLUGIN,TOOLBARS.MOBILE,TOOLBARS.FOOTER,TOOLBARS.SIDE],modalElement:SoundCloudURLInputModal,modalStyles:getModalStyles({customStyles:{content:content},fullScreen:!1,isMobile:isMobile}),section:"BlockToolbar_Section_Embed_Social"}]},createToolbar=function(_ref){var t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings;return{InlineButtons:createInlineButtons({t:t,isMobile:isMobile,settings:settings}),InsertButtons:createInsertButtons({t:t,isMobile:isMobile,settings:settings}),name:"soundCloud"}};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 createSoundCloudPlugin=function(config){var type=SOUND_CLOUD_TYPE,helpers=config.helpers,t=config.t,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,isMobile=config.isMobile,rest=_objectWithoutPropertiesLoose(config,["helpers","t",type,"isMobile"].map(_toPropertyKey));return console.warn("Sound-cloud plugin is deprecated and will be removed in the next version. Please consume sound-cloud plugin through video plugin as described in https://ricos.js.org/docs/plugins_api/VideoPlugin#sound-cloud-plugin"),createBasePlugin(_extends({component:SoundCloud,settings:settings,type:type,toolbar:createToolbar({helpers:helpers,t:t,isMobile:isMobile,settings:settings}),helpers:helpers,t:t,isMobile:isMobile,defaultPluginData:DEFAULTS$1},rest))};createSoundCloudPlugin.functionName=SOUND_CLOUD_TYPE;var containerClassName=function(theme){return mergeStyles({styles:styles$1,theme:theme}).soundCloud_container},typeMapper=function(){var _ref;return(_ref={})[SOUND_CLOUD_TYPE]={component:SoundCloudViewer,classNameStrategies:{container:containerClassName}},_ref},DEFAULTS_config={},pluginSoundCloud=function(config){return{config:_extends({},DEFAULTS_config,config),type:SOUND_CLOUD_TYPE,createPlugin:createSoundCloudPlugin,ModalsMap:ModalsMap}};export{Modals,ModalsMap,SOUND_CLOUD_TYPE,SoundCloudViewer,createSoundCloudPlugin,pluginSoundCloud,typeMapper as soundCloudTypeMapper}; | ||
//# sourceMappingURL=module.js.map |
@@ -1,27 +0,7 @@ | ||
export * from './types'; | ||
export { default as AccessibilityListener } from './Components/AccessibilityListener'; | ||
export { default as ViewportRenderer } from './Components/ViewportRenderer'; | ||
export { default as withI18n, translate, Trans, RicosTranslate } from './Utils/withI18n'; | ||
export { default as createHocName } from './Utils/createHocName'; | ||
export { sizeClassName, alignmentClassName, textWrapClassName, depthClassName, } from './Utils/classNameStrategies'; | ||
export { mergeStyles } from './Utils/mergeStyles'; | ||
export { convertRelObjectToString, convertRelStringToObject, convertTargetStringToBoolean, convertTargetBooleanToString, getRelValue, } from './Utils/linkConverters'; | ||
export { safeJsonParse } from './Utils/jsonUtils'; | ||
export { anchorScroll, addAnchorTagToUrl, isNewTab } from './Utils/anchor'; | ||
export * from 'ricos-content'; | ||
export { default as getDisplayName } from './Utils/getDisplayName'; | ||
export { hasLinksInBlock, getLinkRangesInBlock } from './Utils/draftUtils'; | ||
export { validate, getContentStateSchema } from './Utils/data-schema-validator'; | ||
export { isSSR } from './Utils/ssrUtils'; | ||
export { getTextDirection, getDirectionFromAlignmentAndTextDirection } from './Utils/textDirection'; | ||
export { GlobalContext } from './Utils/contexts'; | ||
export { isHexColor } from './Utils/colorUtils'; | ||
export { isRtl, getLangDir } from './Utils/rtlUtils'; | ||
export { simplePubsub, Pubsub, Store } from './Utils/simplePubsub'; | ||
export { generateKey } from './Utils/generateKey'; | ||
export { getBlocksFromContentState } from './Utils/innerRCEBlocksUtils'; | ||
export * from './consts'; | ||
export { default as createJustificationFixDecorator } from './draftDecorators/createJustificationFixDecorator'; | ||
export { parseStyleByType, CustomInlineStyleType, INLINE_STYLE_TYPES, defaultStyleFnMapper, dynamicStyleParsers, getDynamicInlineStyleMapper, draftDecorationsToCss, } from './Utils/viewerUtils'; | ||
export { default as uuid } from './Utils/uuid'; | ||
export { createSoundCloudPlugin } from './createSoundCloudPlugin'; | ||
export { default as SoundCloudViewer } from './soundCloud-viewer'; | ||
export { SOUND_CLOUD_TYPE } from './types'; | ||
export { Modals, ModalsMap } from './modals'; | ||
export { typeMapper as soundCloudTypeMapper } from './typeMapper'; | ||
export { pluginSoundCloud } from './editor'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
{"name":"richlagetest","version":"0.0.0-09b87b046fae0e0cd11e7abfb50826eaaf8e7800"} | ||
{"name":"richlagetest","version":"0.0.0-1a3a637d095a19a0d3411aa25704d8ba1d45d865"} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 3 instances in 1 package
4
380273
56
1313
3