Socket
Socket
Sign inDemoInstall

richlagetest

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

richlagetest - npm Package Compare versions

Comparing version 0.0.0-a3535a7650e08ec0431ec032e46603c66e08fc05 to 0.0.0-a5679f3b7e39d78a93b76c6b7acda65d4a121791

dist/src/createHeadersMarkdownPlugin.d.ts

2

dist/module.cjs.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),wixRichContentPluginCommons=require("wix-rich-content-plugin-commons"),React=require("react"),lodash=require("lodash"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),wixRichContentCommon=require("wix-rich-content-common"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),Modal=require("react-modal"),classNames=require("classnames");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),React__default=_interopDefaultLegacy(React),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),Modal__default=_interopDefaultLegacy(Modal),classNames__default=_interopDefaultLegacy(classNames),LineSpacingIcon=function(props){return props.newFormattingToolbar?React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"17",height:"15",viewBox:"0 0 17 15"},props),React__default.default.createElement("g",{fill:"none",fillRule:"evenodd"},React__default.default.createElement("g",{fill:"currentColor"},React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M4.5 3L7 6H5v9h2l-2.5 3L2 15h2V6H2l2.5-3zM18 16v1H9v-1h9zm0-4v1H9v-1h9zm0-4v1H9V8h9zm0-4v1H9V4h9z",transform:"translate(-605.000000, -80.000000) translate(603.500000, 77.000000)"}))))):React__default.default.createElement("svg",Object.assign({width:19,height:19,viewBox:"0 0 19 19"},props),React__default.default.createElement("path",{d:"M9.2 7h7.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H9.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2zm0 3h7.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H9.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2zm0 3h7.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H9.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2zm0-9h7.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H9.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2z"}),React__default.default.createElement("path",{d:"M5.854 4.707L7 5.853l.707-.707-2-2-.005-.003-.157-.104L5.354 3l-.191.039-.157.104L5 3.146l-2 2s.708.706.707.707l1.147-1.146v8.586l-1.146-1.146-.707.707 2 2 .162.108.189.038.193-.039.162-.107 2-2L7 12.147l-1.146 1.146V4.707z"}))},styles={lineHeightsPanel:"_22Yra",lineHeightsPanel_selectedLineHeight:"W4aQP",lineSpacingMobilePanel_selectedLineHeight:"BMbAI",lineSpacingMobilePanel:"_1ZEpf",lineSpacingMobilePanel_heights:"_1ZRz9",lineSpacingMobilePanel_buttons:"ak4LK",customSpacingPanel:"_2Jf9a",customSpacingPanel_mobile:"_1K2CE",customSpacingPanel_labeledInput:"_2l5vW",lineSpacing_separator:"_1ziH-",customSpacingPanel_buttons:"_2kls2",lineSpacingContainer:"_11bfQ",lineSpacingContainer_mobile:"_3nZp1",lineSpacingModal:"_3PNI9",lineSpacingModal_mobile:"_19sHr",lineSpacingModalOverlay:"_3O-Bu",lineSpacingPopup_button:"lRuWu",lineSpacingPopup:"_3a7Rh"},LineHeightsPanel=function(_ref){var selectedHeight=_ref.selectedHeight,onSave=_ref.onSave,showCustomPanel=_ref.showCustomPanel,styles=_ref.styles,t=_ref.t;return React__default.default.createElement("div",{className:styles.lineHeightsPanel},[1,1.5,2,2.5,3].map((function(height){return function(height,isSelected,_onClick){return React__default.default.createElement("button",{className:isSelected?styles.lineHeightsPanel_selectedLineHeight:"",key:height,onClick:function(){return _onClick(""+height)}},height)}(height,parseFloat(selectedHeight)===height,onSave)})),React__default.default.createElement("button",{onClick:showCustomPanel},t("LineSpacing_customSpacing")))},MobilePanel=function(_ref2){var selectedHeight=_ref2.selectedHeight,styles=_ref2.styles,t=_ref2.t,onChange=_ref2.onChange,onSave=_ref2.onSave,onCancel=_ref2.onCancel;return React__default.default.createElement("div",{className:styles.lineSpacingMobilePanel},React__default.default.createElement("div",null,t("LineSpacing_lineSpacing")),React__default.default.createElement("div",{className:styles.lineSpacingMobilePanel_heights},[1,1.5,2,2.5,3].map((function(height){return function(height,isSelected,_onClick2){return React__default.default.createElement("button",{className:isSelected?styles.lineSpacingMobilePanel_selectedLineHeight:"",key:height,onClick:function(){return _onClick2(""+height)}},height)}(height,parseFloat(selectedHeight)===height,onChange)}))),React__default.default.createElement(Separator,null),React__default.default.createElement("div",{className:styles.lineSpacingMobilePanel_buttons},React__default.default.createElement("button",{onClick:onCancel},t("LineSpacing_cancel")),React__default.default.createElement("button",{onClick:function(){return onSave()}},t("LineSpacing_save"))))},LabeledInput=function(_ref3){var label=_ref3.label,name=_ref3.name,_ref3$unit=_ref3.unit,unit=void 0===_ref3$unit?"":_ref3$unit,_ref3$defaultValue=_ref3.defaultValue,defaultValue=void 0===_ref3$defaultValue?0:_ref3$defaultValue,spacing=_ref3.spacing,_onChange2=_ref3.onChange,min=_ref3.min,max=_ref3.max,value=void 0===spacing[name]?defaultValue:parseFloat(spacing[name]);return React__default.default.createElement("label",{className:styles.customSpacingPanel_labeledInput},React__default.default.createElement("span",null,label),React__default.default.createElement("input",{type:"number",min:min,max:max,value:value,onChange:function(e){var _onChange;return _onChange2(((_onChange={})[name]=Number(e.target.value)+unit,_onChange))}}))},Separator=function(){return React__default.default.createElement("div",{className:styles.lineSpacing_separator})},CustomPanel=function(_ref4){var spacing=_ref4.spacing,onChange=_ref4.onChange,onSave=_ref4.onSave,onCancel=_ref4.onCancel,styles=_ref4.styles,t=_ref4.t;return React__default.default.createElement("div",{className:styles.customSpacingPanel},React__default.default.createElement(LabeledInput,{label:t("LineSpacing_lineSpacing"),name:"line-height",defaultValue:1.5,onChange:onChange,spacing:spacing,min:1,max:100}),React__default.default.createElement(Separator,null),React__default.default.createElement(LabeledInput,{label:t("LineSpacing_beforeParagraph"),name:"padding-top",unit:"px",onChange:onChange,spacing:spacing,min:0,max:250}),React__default.default.createElement(LabeledInput,{label:t("LineSpacing_afterParagraph"),name:"padding-bottom",unit:"px",onChange:onChange,spacing:spacing,min:0,max:250}),React__default.default.createElement("div",{className:styles.customSpacingPanel_buttons},React__default.default.createElement("button",{onClick:onCancel},t("LineSpacing_cancel")),React__default.default.createElement("button",{onClick:function(){return onSave()}},t("LineSpacing_save"))))},Panel=function(_Component){function Panel(props){var _this;return(_this=_Component.call(this,props)||this).showCustomPanel=function(){_this.setState({isCustomPanel:!0})},_this.onBlur=function(e){var target=e.target,relatedTarget=e.relatedTarget;e.currentTarget.contains(relatedTarget)||setTimeout((function(){return target.focus()}))},_this.onChange=function(spacing){var merged=_extends__default.default({},_this.state.spacing,spacing);_this.setState({spacing:merged}),_this.props.onChange(merged)},_this.onSave=function(spacing){_this.props.onSave(_extends__default.default({},_this.state.spacing,spacing))},_this.state={spacing:props.spacing},_this.styles=wixRichContentCommon.mergeStyles({styles:styles,theme:props.theme}),_this}return _inheritsLoose__default.default(Panel,_Component),Panel.prototype.render=function(){var _classNames,_this$props=this.props,onCancel=_this$props.onCancel,t=_this$props.t,isMobile=_this$props.isMobile,_this$state=this.state,isCustomPanel=_this$state.isCustomPanel,spacing=_this$state.spacing,styles=this.styles,showCustomPanel=this.showCustomPanel,onChange=this.onChange,onSave=this.onSave,selectedHeight=spacing["line-height"],panel=isMobile?React__default.default.createElement(MobilePanel,{styles:styles,selectedHeight:selectedHeight,t:t,onChange:function(height){return onChange({"line-height":height})},onSave:onSave,onCancel:onCancel}):isCustomPanel?React__default.default.createElement(CustomPanel,{spacing:spacing,onChange:onChange,onSave:onSave,onCancel:onCancel,styles:styles,t:t,isMobile:isMobile}):React__default.default.createElement(LineHeightsPanel,{styles:styles,selectedHeight:selectedHeight,showCustomPanel:showCustomPanel,t:t,onSave:function(height){return onSave({"line-height":height})}});return React__default.default.createElement("div",{onBlur:this.onBlur,className:classNames__default.default(styles.lineSpacingContainer,(_classNames={},_classNames[styles.lineSpacingContainer_mobile]=isMobile,_classNames))},panel)},Panel}(React.Component);Panel.defaultProps={spacing:{}};var LineSpacingButton=function(_Component){function LineSpacingButton(props){var _this;return(_this=_Component.call(this,props)||this).onOpenPanel=function(){_this.currentEditorState=_this.oldEditorState=_this.props.getEditorState(),_this.selection=_this.oldEditorState.getSelection();var spacing=LineSpacingButton.getBlockSpacing(_this.oldEditorState);_this.oldSpacing=spacing,_this.setState({isPanelOpen:!0,spacing:spacing})},_this.openPanel=function(){_this.onOpenPanel();var _this$buttonRef$getBo=_this.buttonRef.getBoundingClientRect(),bottom=_this$buttonRef$getBo.bottom,left=_this$buttonRef$getBo.left;_this.props.setKeepOpen(!0),_this.setState({panelLeft:left,panelTop:bottom})},_this.closePanel=function(){_this.setState({isPanelOpen:!1}),_this.props.setKeepOpen(!1)},_this.updateSpacing=function(spacing){var _helpers$onToolbarBut,dynamicStyles=spacing,_this$props=_this.props,setEditorState=_this$props.setEditorState,onUpdate=_this$props.onUpdate,helpers=_this$props.helpers,newEditorState=wixRichContentEditorCommon.mergeBlockData(_this.oldEditorState,{dynamicStyles:dynamicStyles});setEditorState(newEditorState),null==helpers||null===(_helpers$onToolbarBut=helpers.onToolbarButtonClick)||void 0===_helpers$onToolbarBut||_helpers$onToolbarBut.call(helpers,{buttonName:wixRichContentEditorCommon.FORMATTING_BUTTONS.LINE_SPACING,pluginId:"line-spacing",value:null==spacing?void 0:spacing["line-height"]}),_this.currentEditorState=newEditorState,onUpdate(dynamicStyles)},_this.save=function(spacing){_this.closePanel(),spacing?_this.updateSpacing(spacing):_this.setEditorState(_this.currentEditorState)},_this.cancel=function(){var onUpdate=_this.props.onUpdate;_this.setEditorState(_this.oldEditorState),onUpdate(_this.oldSpacing),_this.closePanel()},_this.setEditorState=function(editorState){return _this.props.setEditorState(_this.fixSelection(editorState,_this.selection))},_this.fixSelection=wixRichContentEditorCommon.EditorState.forceSelection,_this.state={showPanel:!1},_this.styles=wixRichContentCommon.mergeStyles({styles:styles,theme:props.theme}),_this.dataHookName="LineSpacingButton",_this}return _inheritsLoose__default.default(LineSpacingButton,_Component),LineSpacingButton.getBlockSpacing=function(editorState){var _getAnchorBlockData$d=wixRichContentEditorCommon.getAnchorBlockData(editorState).dynamicStyles,dynamicStyles=void 0===_getAnchorBlockData$d?{}:_getAnchorBlockData$d;return lodash.pick(dynamicStyles,["line-height","padding-top","padding-bottom"])},LineSpacingButton.getModalParent=function(){return document.querySelector(".DraftEditor-root").parentNode},LineSpacingButton.prototype.render=function(){var _toolbar$icons,_classNames,_classNames2,_this2=this,_this$props2=this.props,theme=_this$props2.theme,helpers=_this$props2.helpers,isMobile=_this$props2.isMobile,t=_this$props2.t,tabIndex=_this$props2.tabIndex,defaultSpacing=_this$props2.defaultSpacing,toolbar=_this$props2.toolbar,toolbarName=_this$props2.toolbarName,inlinePopups=_this$props2.inlinePopups,_this$state=this.state,isPanelOpen=_this$state.isPanelOpen,spacing=_this$state.spacing,panelTop=_this$state.panelTop,panelLeft=_this$state.panelLeft,styles=this.styles,icon=(null==toolbar||null===(_toolbar$icons=toolbar.icons)||void 0===_toolbar$icons?void 0:_toolbar$icons.InsertPluginButtonIcon)||LineSpacingIcon,modalStyle=isMobile?{left:0,bottom:0,right:0}:{top:panelTop,left:panelLeft};return isMobile||"StaticTextToolbar"!==toolbarName||!inlinePopups?React__default.default.createElement(wixRichContentEditorCommon.InlineToolbarButton,{onClick:this.openPanel,isActive:!!isPanelOpen,helpers:helpers,theme:theme,isMobile:isMobile,tooltipText:t("LineSpacingButton_Tooltip"),dataHook:this.dataHookName,formattingButtonName:wixRichContentEditorCommon.FORMATTING_BUTTONS.LINE_SPACING,tabIndex:tabIndex,icon:icon,pluginType:"line-spacing",ref:function(_ref){return _this2.buttonRef=_ref}},React__default.default.createElement(Modal__default.default,{isOpen:isPanelOpen,onRequestClose:function(){return _this2.save()},className:classNames__default.default(styles.lineSpacingModal,(_classNames={},_classNames[styles.lineSpacingModal_mobile]=isMobile,_classNames)),overlayClassName:classNames__default.default(styles.lineSpacingModalOverlay,(_classNames2={},_classNames2[styles.lineSpacingModalOverlay_mobile]=isMobile,_classNames2)),parentSelector:LineSpacingButton.getModalParent,style:{content:modalStyle},ariaHideApp:!1},React__default.default.createElement(Panel,{spacing:_extends__default.default({},defaultSpacing,spacing),onChange:this.updateSpacing,onSave:this.save,onCancel:this.cancel,styles:this.styles,t:t,isMobile:isMobile,theme:theme}))):React__default.default.createElement("div",{className:styles.lineSpacingPopup_button},React__default.default.createElement(wixRichContentEditorCommon.InlineToolbarButton,{onClick:this.openPanel,isActive:!!isPanelOpen,helpers:helpers,theme:theme,isMobile:isMobile,tooltipText:t("LineSpacingButton_Tooltip"),dataHook:this.dataHookName,formattingButtonName:wixRichContentEditorCommon.FORMATTING_BUTTONS.LINE_SPACING,tabIndex:tabIndex,icon:icon,pluginType:"line-spacing",ref:function(_ref2){return _this2.buttonRef=_ref2}},isPanelOpen&&React__default.default.createElement("div",{className:styles.lineSpacingPopup},React__default.default.createElement(wixRichContentEditorCommon.ClickOutside,{onClickOutside:function(){return _this2.save()}},React__default.default.createElement(Panel,{spacing:_extends__default.default({},defaultSpacing,spacing),onChange:this.updateSpacing,onSave:this.save,onCancel:this.cancel,styles:this.styles,t:t,isMobile:isMobile,theme:theme})))))},LineSpacingButton}(React.Component);LineSpacingButton.defaultProps={inlinePopups:!1,setKeepOpen:function(){},onUpdate:function(){}};var createToolbar=function(config){var oldEditorState,spacing,getEditorState=config.getEditorState,setEditorState=config.setEditorState,helpers=config.helpers,isMobile=config.isMobile,theme=config.theme,updateSpacing=function(spacing){var dynamicStyles=spacing,newEditorState=wixRichContentEditorCommon.mergeBlockData(oldEditorState||getEditorState(),{dynamicStyles:dynamicStyles});setEditorState(newEditorState)},LineSpacingPanel=function(_ref){var editorState,_getAnchorBlockData$d,dynamicStyles,closeCustomModal=_ref.closeCustomModal,onSelect=_ref.onSelect;return oldEditorState=getEditorState(),editorState=oldEditorState,_getAnchorBlockData$d=wixRichContentEditorCommon.getAnchorBlockData(editorState).dynamicStyles,dynamicStyles=void 0===_getAnchorBlockData$d?{}:_getAnchorBlockData$d,spacing=lodash.pick(dynamicStyles,["line-height","padding-top","padding-bottom"]),React__default.default.createElement(Panel,Object.assign({onChange:function(args){updateSpacing(args),onSelect&&onSelect(args)},onSave:function(args){!function(spacing){var _helpers$closeModal;null==helpers||null===(_helpers$closeModal=helpers.closeModal)||void 0===_helpers$closeModal||_helpers$closeModal.call(helpers),spacing?updateSpacing(spacing):setEditorState(oldEditorState)}(args),onSelect&&onSelect(args),closeCustomModal&&closeCustomModal()},onCancel:function(){var _helpers$closeModal2;null==helpers||null===(_helpers$closeModal2=helpers.closeModal)||void 0===_helpers$closeModal2||_helpers$closeModal2.call(helpers),setEditorState(oldEditorState),closeCustomModal&&closeCustomModal()},spacing:spacing},config))},modalStylesFn=function(ref){var _ref$getBoundingClien=ref.getBoundingClientRect(),bottom=_ref$getBoundingClien.bottom,left=_ref$getBoundingClien.left;return isMobile?{content:{position:"absolute",left:"0px",right:"0px",bottom:"0",border:"none",background:"white",overflow:"auto",outline:"none",padding:"0px",width:"100%",zIndex:6,top:"auto",transform:"translateY(0)",margin:0}}:{content:{display:"inline-table",transform:"translateY(0)",minHeight:"116px",height:"auto",position:"absolute",minWidth:"216px",maxWidth:"360px",width:"auto",top:bottom,left:left-15,borderRadius:"6px",border:"1px solid #ededed",margin:"0",background:"#fff"},overlay:{background:"transparent"}}};return{TextButtonMapper:function(){var _ref4;return(_ref4={})[wixRichContentEditorCommon.FORMATTING_BUTTONS.LINE_SPACING]={component:wixRichContentEditorCommon.decorateComponentWithProps(LineSpacingButton,config["line-spacing"]),externalizedButtonProps:{onClick:function(_ref3){return function(_ref2){var ref=_ref2.ref,render=_ref2.render;if(render)render(LineSpacingPanel);else{var _helpers$openModal,modalStyles=wixRichContentEditorCommon.getModalStyles({customStyles:modalStylesFn(ref),fullScreen:!1,isMobile:isMobile});null==helpers||null===(_helpers$openModal=helpers.openModal)||void 0===_helpers$openModal||_helpers$openModal.call(helpers,{modalStyles:modalStyles,helpers:helpers,isMobile:isMobile,modalElement:LineSpacingPanel,theme:theme})}}({ref:_ref3.ref,render:_ref3.render})},isActive:function(){return!1},isDisabled:function(){return wixRichContentEditorCommon.isAtomicBlockFocused(config.getEditorState())},getIcon:function(){var _config$LINE_SPACING_,_config$LINE_SPACING_2,_config$LINE_SPACING_3;return(null===(_config$LINE_SPACING_=config["line-spacing"])||void 0===_config$LINE_SPACING_||null===(_config$LINE_SPACING_2=_config$LINE_SPACING_.toolbar)||void 0===_config$LINE_SPACING_2||null===(_config$LINE_SPACING_3=_config$LINE_SPACING_2.icons)||void 0===_config$LINE_SPACING_3?void 0:_config$LINE_SPACING_3.InsertPluginButtonIcon)||function(){var _config$experiments,_config$experiments$n;return LineSpacingIcon({newFormattingToolbar:null==config||null===(_config$experiments=config.experiments)||void 0===_config$experiments||null===(_config$experiments$n=_config$experiments.newFormattingToolbar)||void 0===_config$experiments$n?void 0:_config$experiments$n.enabled})}},tooltip:config.t("LineSpacingButton_Tooltip"),getLabel:function(){return""},type:wixRichContentEditorCommon.BUTTON_TYPES.DROPDOWN,modal:LineSpacingPanel,onSelect:updateSpacing}},_ref4},name:"line-spacing"}},DEFAULTS=Object.freeze({type:"line-spacing",config:{}});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 _ModalsMap,createLineSpacingPlugin=function(config){var type="line-spacing",theme=config.theme,isMobile=config.isMobile,t=config.t,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,rest=_objectWithoutPropertiesLoose__default.default(config,["theme","isMobile","t",type].map(_toPropertyKey)),toolbar=createToolbar(config);return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({theme:theme,toolbar:toolbar,isMobile:isMobile,t:t,settings:settings,type:type,defaultPluginData:DEFAULTS},rest))};createLineSpacingPlugin.functionName="line-spacing";var Modals={LINE_SPACING:"LINE_SPACING"},ModalsMap=((_ModalsMap={})[Modals.LINE_SPACING]=Panel,_ModalsMap);exports.LINE_SPACING_TYPE="line-spacing",exports.Modals=Modals,exports.ModalsMap=ModalsMap,exports.createLineSpacingPlugin=createLineSpacingPlugin,exports.pluginLineSpacing=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:"line-spacing",createPlugin:createLineSpacingPlugin,ModalsMap:ModalsMap}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),wixRichContentPluginCommons=require("wix-rich-content-plugin-commons"),React=require("react");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),React__default=_interopDefaultLegacy(React);var headersRegEx=/{\$h\d}.*?{\$h}/g,headersMarkdownStrategy=function(contentBlock,callback){!function(text,regex,callback){for(var matchArr,start;null!==(matchArr=regex.exec(text));)callback(start=matchArr.index,start+matchArr[0].length)}(contentBlock.getText(),headersRegEx,callback)},DEFAULTS={config:{},configViewer:{hideMarkdown:!0}},createHeadersMarkdownDecorator=function(config){var _config$type=config["wix-draft-plugin-headers-markdown"],settings=void 0===_config$type?{}:_config$type;return{strategy:headersMarkdownStrategy,component:function(props){return function(_ref){var children=_ref.children,hideMarkdown=_ref.hideMarkdown,sliceElementText=function(element,start,end){if("string"==typeof element)return element.slice(start,end);if(element.props&&element.props.text){var text=element.props.text.slice(start,end);return React__default.default.cloneElement(element,{text:text})}return element},Type=_ref.decoratedText.match(/h\d/)[0];if(hideMarkdown){var lastIndex=children.length-1;children[0]=sliceElementText(children[0],5),children[lastIndex]=sliceElementText(children[lastIndex],0,-4)}return React__default.default.createElement(Type,null,children)}(_extends__default.default({},props,settings))}}},createHeadersMarkdownPlugin=function(config){var _config$type=config["wix-draft-plugin-headers-markdown"],settings=void 0===_config$type?{}:_config$type,plugin={decorators:[createHeadersMarkdownDecorator(config)]};return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({settings:settings,type:"wix-draft-plugin-headers-markdown",defaultPluginData:DEFAULTS},config),plugin)};createHeadersMarkdownPlugin.functionName="wix-draft-plugin-headers-markdown";exports.HEADERS_MARKDOWN_TYPE="wix-draft-plugin-headers-markdown",exports.createHeadersMarkdownDecorator=createHeadersMarkdownDecorator,exports.createHeadersMarkdownPlugin=createHeadersMarkdownPlugin,exports.pluginHeadersMarkdown=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:"wix-draft-plugin-headers-markdown",createPlugin:createHeadersMarkdownPlugin,ModalsMap:{}}};
//# sourceMappingURL=module.cjs.js.map

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

import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{createBasePlugin}from"wix-rich-content-plugin-commons";import React,{Component}from"react";import{pick}from"lodash";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import{mergeStyles}from"wix-rich-content-common";import{mergeBlockData,FORMATTING_BUTTONS,EditorState,getAnchorBlockData,InlineToolbarButton,ClickOutside,decorateComponentWithProps,isAtomicBlockFocused,BUTTON_TYPES,getModalStyles}from"wix-rich-content-editor-common";import Modal from"react-modal";import classNames from"classnames";var LINE_SPACING_TYPE="line-spacing",LineSpacingIcon=function(props){return props.newFormattingToolbar?React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"17",height:"15",viewBox:"0 0 17 15"},props),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("g",{fill:"currentColor"},React.createElement("g",null,React.createElement("path",{d:"M4.5 3L7 6H5v9h2l-2.5 3L2 15h2V6H2l2.5-3zM18 16v1H9v-1h9zm0-4v1H9v-1h9zm0-4v1H9V8h9zm0-4v1H9V4h9z",transform:"translate(-605.000000, -80.000000) translate(603.500000, 77.000000)"}))))):React.createElement("svg",Object.assign({width:19,height:19,viewBox:"0 0 19 19"},props),React.createElement("path",{d:"M9.2 7h7.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H9.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2zm0 3h7.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H9.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2zm0 3h7.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H9.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2zm0-9h7.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H9.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2z"}),React.createElement("path",{d:"M5.854 4.707L7 5.853l.707-.707-2-2-.005-.003-.157-.104L5.354 3l-.191.039-.157.104L5 3.146l-2 2s.708.706.707.707l1.147-1.146v8.586l-1.146-1.146-.707.707 2 2 .162.108.189.038.193-.039.162-.107 2-2L7 12.147l-1.146 1.146V4.707z"}))},styles={lineHeightsPanel:"_22Yra",lineHeightsPanel_selectedLineHeight:"W4aQP",lineSpacingMobilePanel_selectedLineHeight:"BMbAI",lineSpacingMobilePanel:"_1ZEpf",lineSpacingMobilePanel_heights:"_1ZRz9",lineSpacingMobilePanel_buttons:"ak4LK",customSpacingPanel:"_2Jf9a",customSpacingPanel_mobile:"_1K2CE",customSpacingPanel_labeledInput:"_2l5vW",lineSpacing_separator:"_1ziH-",customSpacingPanel_buttons:"_2kls2",lineSpacingContainer:"_11bfQ",lineSpacingContainer_mobile:"_3nZp1",lineSpacingModal:"_3PNI9",lineSpacingModal_mobile:"_19sHr",lineSpacingModalOverlay:"_3O-Bu",lineSpacingPopup_button:"lRuWu",lineSpacingPopup:"_3a7Rh"},LineHeightsPanel=function(_ref){var selectedHeight=_ref.selectedHeight,onSave=_ref.onSave,showCustomPanel=_ref.showCustomPanel,styles=_ref.styles,t=_ref.t;return React.createElement("div",{className:styles.lineHeightsPanel},[1,1.5,2,2.5,3].map((function(height){return function(height,isSelected,_onClick){return React.createElement("button",{className:isSelected?styles.lineHeightsPanel_selectedLineHeight:"",key:height,onClick:function(){return _onClick(""+height)}},height)}(height,parseFloat(selectedHeight)===height,onSave)})),React.createElement("button",{onClick:showCustomPanel},t("LineSpacing_customSpacing")))},MobilePanel=function(_ref2){var selectedHeight=_ref2.selectedHeight,styles=_ref2.styles,t=_ref2.t,onChange=_ref2.onChange,onSave=_ref2.onSave,onCancel=_ref2.onCancel;return React.createElement("div",{className:styles.lineSpacingMobilePanel},React.createElement("div",null,t("LineSpacing_lineSpacing")),React.createElement("div",{className:styles.lineSpacingMobilePanel_heights},[1,1.5,2,2.5,3].map((function(height){return function(height,isSelected,_onClick2){return React.createElement("button",{className:isSelected?styles.lineSpacingMobilePanel_selectedLineHeight:"",key:height,onClick:function(){return _onClick2(""+height)}},height)}(height,parseFloat(selectedHeight)===height,onChange)}))),React.createElement(Separator,null),React.createElement("div",{className:styles.lineSpacingMobilePanel_buttons},React.createElement("button",{onClick:onCancel},t("LineSpacing_cancel")),React.createElement("button",{onClick:function(){return onSave()}},t("LineSpacing_save"))))},LabeledInput=function(_ref3){var label=_ref3.label,name=_ref3.name,_ref3$unit=_ref3.unit,unit=void 0===_ref3$unit?"":_ref3$unit,_ref3$defaultValue=_ref3.defaultValue,defaultValue=void 0===_ref3$defaultValue?0:_ref3$defaultValue,spacing=_ref3.spacing,_onChange2=_ref3.onChange,min=_ref3.min,max=_ref3.max,value=void 0===spacing[name]?defaultValue:parseFloat(spacing[name]);return React.createElement("label",{className:styles.customSpacingPanel_labeledInput},React.createElement("span",null,label),React.createElement("input",{type:"number",min:min,max:max,value:value,onChange:function(e){var _onChange;return _onChange2(((_onChange={})[name]=Number(e.target.value)+unit,_onChange))}}))},Separator=function(){return React.createElement("div",{className:styles.lineSpacing_separator})},CustomPanel=function(_ref4){var spacing=_ref4.spacing,onChange=_ref4.onChange,onSave=_ref4.onSave,onCancel=_ref4.onCancel,styles=_ref4.styles,t=_ref4.t;return React.createElement("div",{className:styles.customSpacingPanel},React.createElement(LabeledInput,{label:t("LineSpacing_lineSpacing"),name:"line-height",defaultValue:1.5,onChange:onChange,spacing:spacing,min:1,max:100}),React.createElement(Separator,null),React.createElement(LabeledInput,{label:t("LineSpacing_beforeParagraph"),name:"padding-top",unit:"px",onChange:onChange,spacing:spacing,min:0,max:250}),React.createElement(LabeledInput,{label:t("LineSpacing_afterParagraph"),name:"padding-bottom",unit:"px",onChange:onChange,spacing:spacing,min:0,max:250}),React.createElement("div",{className:styles.customSpacingPanel_buttons},React.createElement("button",{onClick:onCancel},t("LineSpacing_cancel")),React.createElement("button",{onClick:function(){return onSave()}},t("LineSpacing_save"))))},Panel=function(_Component){function Panel(props){var _this;return(_this=_Component.call(this,props)||this).showCustomPanel=function(){_this.setState({isCustomPanel:!0})},_this.onBlur=function(e){var target=e.target,relatedTarget=e.relatedTarget;e.currentTarget.contains(relatedTarget)||setTimeout((function(){return target.focus()}))},_this.onChange=function(spacing){var merged=_extends({},_this.state.spacing,spacing);_this.setState({spacing:merged}),_this.props.onChange(merged)},_this.onSave=function(spacing){_this.props.onSave(_extends({},_this.state.spacing,spacing))},_this.state={spacing:props.spacing},_this.styles=mergeStyles({styles:styles,theme:props.theme}),_this}return _inheritsLoose(Panel,_Component),Panel.prototype.render=function(){var _classNames,_this$props=this.props,onCancel=_this$props.onCancel,t=_this$props.t,isMobile=_this$props.isMobile,_this$state=this.state,isCustomPanel=_this$state.isCustomPanel,spacing=_this$state.spacing,styles=this.styles,showCustomPanel=this.showCustomPanel,onChange=this.onChange,onSave=this.onSave,selectedHeight=spacing["line-height"],panel=isMobile?React.createElement(MobilePanel,{styles:styles,selectedHeight:selectedHeight,t:t,onChange:function(height){return onChange({"line-height":height})},onSave:onSave,onCancel:onCancel}):isCustomPanel?React.createElement(CustomPanel,{spacing:spacing,onChange:onChange,onSave:onSave,onCancel:onCancel,styles:styles,t:t,isMobile:isMobile}):React.createElement(LineHeightsPanel,{styles:styles,selectedHeight:selectedHeight,showCustomPanel:showCustomPanel,t:t,onSave:function(height){return onSave({"line-height":height})}});return React.createElement("div",{onBlur:this.onBlur,className:classNames(styles.lineSpacingContainer,(_classNames={},_classNames[styles.lineSpacingContainer_mobile]=isMobile,_classNames))},panel)},Panel}(Component);Panel.defaultProps={spacing:{}};var LineSpacingButton=function(_Component){function LineSpacingButton(props){var _this;return(_this=_Component.call(this,props)||this).onOpenPanel=function(){_this.currentEditorState=_this.oldEditorState=_this.props.getEditorState(),_this.selection=_this.oldEditorState.getSelection();var spacing=LineSpacingButton.getBlockSpacing(_this.oldEditorState);_this.oldSpacing=spacing,_this.setState({isPanelOpen:!0,spacing:spacing})},_this.openPanel=function(){_this.onOpenPanel();var _this$buttonRef$getBo=_this.buttonRef.getBoundingClientRect(),bottom=_this$buttonRef$getBo.bottom,left=_this$buttonRef$getBo.left;_this.props.setKeepOpen(!0),_this.setState({panelLeft:left,panelTop:bottom})},_this.closePanel=function(){_this.setState({isPanelOpen:!1}),_this.props.setKeepOpen(!1)},_this.updateSpacing=function(spacing){var _helpers$onToolbarBut,dynamicStyles=spacing,_this$props=_this.props,setEditorState=_this$props.setEditorState,onUpdate=_this$props.onUpdate,helpers=_this$props.helpers,newEditorState=mergeBlockData(_this.oldEditorState,{dynamicStyles:dynamicStyles});setEditorState(newEditorState),null==helpers||null===(_helpers$onToolbarBut=helpers.onToolbarButtonClick)||void 0===_helpers$onToolbarBut||_helpers$onToolbarBut.call(helpers,{buttonName:FORMATTING_BUTTONS.LINE_SPACING,pluginId:"line-spacing",value:null==spacing?void 0:spacing["line-height"]}),_this.currentEditorState=newEditorState,onUpdate(dynamicStyles)},_this.save=function(spacing){_this.closePanel(),spacing?_this.updateSpacing(spacing):_this.setEditorState(_this.currentEditorState)},_this.cancel=function(){var onUpdate=_this.props.onUpdate;_this.setEditorState(_this.oldEditorState),onUpdate(_this.oldSpacing),_this.closePanel()},_this.setEditorState=function(editorState){return _this.props.setEditorState(_this.fixSelection(editorState,_this.selection))},_this.fixSelection=EditorState.forceSelection,_this.state={showPanel:!1},_this.styles=mergeStyles({styles:styles,theme:props.theme}),_this.dataHookName="LineSpacingButton",_this}return _inheritsLoose(LineSpacingButton,_Component),LineSpacingButton.getBlockSpacing=function(editorState){var _getAnchorBlockData$d=getAnchorBlockData(editorState).dynamicStyles;return pick(void 0===_getAnchorBlockData$d?{}:_getAnchorBlockData$d,["line-height","padding-top","padding-bottom"])},LineSpacingButton.getModalParent=function(){return document.querySelector(".DraftEditor-root").parentNode},LineSpacingButton.prototype.render=function(){var _toolbar$icons,_classNames,_classNames2,_this2=this,_this$props2=this.props,theme=_this$props2.theme,helpers=_this$props2.helpers,isMobile=_this$props2.isMobile,t=_this$props2.t,tabIndex=_this$props2.tabIndex,defaultSpacing=_this$props2.defaultSpacing,toolbar=_this$props2.toolbar,toolbarName=_this$props2.toolbarName,inlinePopups=_this$props2.inlinePopups,_this$state=this.state,isPanelOpen=_this$state.isPanelOpen,spacing=_this$state.spacing,panelTop=_this$state.panelTop,panelLeft=_this$state.panelLeft,styles=this.styles,icon=(null==toolbar||null===(_toolbar$icons=toolbar.icons)||void 0===_toolbar$icons?void 0:_toolbar$icons.InsertPluginButtonIcon)||LineSpacingIcon,modalStyle=isMobile?{left:0,bottom:0,right:0}:{top:panelTop,left:panelLeft};return isMobile||"StaticTextToolbar"!==toolbarName||!inlinePopups?React.createElement(InlineToolbarButton,{onClick:this.openPanel,isActive:!!isPanelOpen,helpers:helpers,theme:theme,isMobile:isMobile,tooltipText:t("LineSpacingButton_Tooltip"),dataHook:this.dataHookName,formattingButtonName:FORMATTING_BUTTONS.LINE_SPACING,tabIndex:tabIndex,icon:icon,pluginType:"line-spacing",ref:function(_ref){return _this2.buttonRef=_ref}},React.createElement(Modal,{isOpen:isPanelOpen,onRequestClose:function(){return _this2.save()},className:classNames(styles.lineSpacingModal,(_classNames={},_classNames[styles.lineSpacingModal_mobile]=isMobile,_classNames)),overlayClassName:classNames(styles.lineSpacingModalOverlay,(_classNames2={},_classNames2[styles.lineSpacingModalOverlay_mobile]=isMobile,_classNames2)),parentSelector:LineSpacingButton.getModalParent,style:{content:modalStyle},ariaHideApp:!1},React.createElement(Panel,{spacing:_extends({},defaultSpacing,spacing),onChange:this.updateSpacing,onSave:this.save,onCancel:this.cancel,styles:this.styles,t:t,isMobile:isMobile,theme:theme}))):React.createElement("div",{className:styles.lineSpacingPopup_button},React.createElement(InlineToolbarButton,{onClick:this.openPanel,isActive:!!isPanelOpen,helpers:helpers,theme:theme,isMobile:isMobile,tooltipText:t("LineSpacingButton_Tooltip"),dataHook:this.dataHookName,formattingButtonName:FORMATTING_BUTTONS.LINE_SPACING,tabIndex:tabIndex,icon:icon,pluginType:"line-spacing",ref:function(_ref2){return _this2.buttonRef=_ref2}},isPanelOpen&&React.createElement("div",{className:styles.lineSpacingPopup},React.createElement(ClickOutside,{onClickOutside:function(){return _this2.save()}},React.createElement(Panel,{spacing:_extends({},defaultSpacing,spacing),onChange:this.updateSpacing,onSave:this.save,onCancel:this.cancel,styles:this.styles,t:t,isMobile:isMobile,theme:theme})))))},LineSpacingButton}(Component);LineSpacingButton.defaultProps={inlinePopups:!1,setKeepOpen:function(){},onUpdate:function(){}};var createToolbar=function(config){var oldEditorState,spacing,getEditorState=config.getEditorState,setEditorState=config.setEditorState,helpers=config.helpers,isMobile=config.isMobile,theme=config.theme,updateSpacing=function(spacing){var dynamicStyles=spacing,newEditorState=mergeBlockData(oldEditorState||getEditorState(),{dynamicStyles:dynamicStyles});setEditorState(newEditorState)},LineSpacingPanel=function(_ref){var _getAnchorBlockData$d,closeCustomModal=_ref.closeCustomModal,onSelect=_ref.onSelect;return oldEditorState=getEditorState(),_getAnchorBlockData$d=getAnchorBlockData(oldEditorState).dynamicStyles,spacing=pick(void 0===_getAnchorBlockData$d?{}:_getAnchorBlockData$d,["line-height","padding-top","padding-bottom"]),React.createElement(Panel,Object.assign({onChange:function(args){updateSpacing(args),onSelect&&onSelect(args)},onSave:function(args){!function(spacing){var _helpers$closeModal;null==helpers||null===(_helpers$closeModal=helpers.closeModal)||void 0===_helpers$closeModal||_helpers$closeModal.call(helpers),spacing?updateSpacing(spacing):setEditorState(oldEditorState)}(args),onSelect&&onSelect(args),closeCustomModal&&closeCustomModal()},onCancel:function(){var _helpers$closeModal2;null==helpers||null===(_helpers$closeModal2=helpers.closeModal)||void 0===_helpers$closeModal2||_helpers$closeModal2.call(helpers),setEditorState(oldEditorState),closeCustomModal&&closeCustomModal()},spacing:spacing},config))},modalStylesFn=function(ref){var _ref$getBoundingClien=ref.getBoundingClientRect(),bottom=_ref$getBoundingClien.bottom,left=_ref$getBoundingClien.left;return isMobile?{content:{position:"absolute",left:"0px",right:"0px",bottom:"0",border:"none",background:"white",overflow:"auto",outline:"none",padding:"0px",width:"100%",zIndex:6,top:"auto",transform:"translateY(0)",margin:0}}:{content:{display:"inline-table",transform:"translateY(0)",minHeight:"116px",height:"auto",position:"absolute",minWidth:"216px",maxWidth:"360px",width:"auto",top:bottom,left:left-15,borderRadius:"6px",border:"1px solid #ededed",margin:"0",background:"#fff"},overlay:{background:"transparent"}}};return{TextButtonMapper:function(){var _ref4;return(_ref4={})[FORMATTING_BUTTONS.LINE_SPACING]={component:decorateComponentWithProps(LineSpacingButton,config["line-spacing"]),externalizedButtonProps:{onClick:function(_ref3){return function(_ref2){var ref=_ref2.ref,render=_ref2.render;if(render)render(LineSpacingPanel);else{var _helpers$openModal,modalStyles=getModalStyles({customStyles:modalStylesFn(ref),fullScreen:!1,isMobile:isMobile});null==helpers||null===(_helpers$openModal=helpers.openModal)||void 0===_helpers$openModal||_helpers$openModal.call(helpers,{modalStyles:modalStyles,helpers:helpers,isMobile:isMobile,modalElement:LineSpacingPanel,theme:theme})}}({ref:_ref3.ref,render:_ref3.render})},isActive:function(){return!1},isDisabled:function(){return isAtomicBlockFocused(config.getEditorState())},getIcon:function(){var _config$LINE_SPACING_,_config$LINE_SPACING_2,_config$LINE_SPACING_3;return(null===(_config$LINE_SPACING_=config["line-spacing"])||void 0===_config$LINE_SPACING_||null===(_config$LINE_SPACING_2=_config$LINE_SPACING_.toolbar)||void 0===_config$LINE_SPACING_2||null===(_config$LINE_SPACING_3=_config$LINE_SPACING_2.icons)||void 0===_config$LINE_SPACING_3?void 0:_config$LINE_SPACING_3.InsertPluginButtonIcon)||function(){var _config$experiments,_config$experiments$n;return LineSpacingIcon({newFormattingToolbar:null==config||null===(_config$experiments=config.experiments)||void 0===_config$experiments||null===(_config$experiments$n=_config$experiments.newFormattingToolbar)||void 0===_config$experiments$n?void 0:_config$experiments$n.enabled})}},tooltip:config.t("LineSpacingButton_Tooltip"),getLabel:function(){return""},type:BUTTON_TYPES.DROPDOWN,modal:LineSpacingPanel,onSelect:updateSpacing}},_ref4},name:"line-spacing"}},DEFAULTS=Object.freeze({type:"line-spacing",config:{}});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 _ModalsMap,createLineSpacingPlugin=function(config){var type="line-spacing",theme=config.theme,isMobile=config.isMobile,t=config.t,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,rest=_objectWithoutPropertiesLoose(config,["theme","isMobile","t",type].map(_toPropertyKey)),toolbar=createToolbar(config);return createBasePlugin(_extends({theme:theme,toolbar:toolbar,isMobile:isMobile,t:t,settings:settings,type:type,defaultPluginData:DEFAULTS},rest))};createLineSpacingPlugin.functionName="line-spacing";var Modals={LINE_SPACING:"LINE_SPACING"},ModalsMap=((_ModalsMap={})[Modals.LINE_SPACING]=Panel,_ModalsMap),pluginLineSpacing=function(config){return{config:_extends({},DEFAULTS.config,config),type:"line-spacing",createPlugin:createLineSpacingPlugin,ModalsMap:ModalsMap}};export{LINE_SPACING_TYPE,Modals,ModalsMap,createLineSpacingPlugin,pluginLineSpacing};
import _extends from"@babel/runtime/helpers/extends";import{createBasePlugin}from"wix-rich-content-plugin-commons";import React from"react";var headersRegEx=/{\$h\d}.*?{\$h}/g,headersMarkdownStrategy=function(contentBlock,callback){!function(text,regex,callback){for(var matchArr,start;null!==(matchArr=regex.exec(text));)callback(start=matchArr.index,start+matchArr[0].length)}(contentBlock.getText(),headersRegEx,callback)},DEFAULTS={config:{},configViewer:{hideMarkdown:!0}},createHeadersMarkdownDecorator=function(config){var _config$type=config["wix-draft-plugin-headers-markdown"],settings=void 0===_config$type?{}:_config$type;return{strategy:headersMarkdownStrategy,component:function(props){return function(_ref){var children=_ref.children,hideMarkdown=_ref.hideMarkdown,sliceElementText=function(element,start,end){if("string"==typeof element)return element.slice(start,end);if(element.props&&element.props.text){var text=element.props.text.slice(start,end);return React.cloneElement(element,{text:text})}return element},Type=_ref.decoratedText.match(/h\d/)[0];if(hideMarkdown){var lastIndex=children.length-1;children[0]=sliceElementText(children[0],5),children[lastIndex]=sliceElementText(children[lastIndex],0,-4)}return React.createElement(Type,null,children)}(_extends({},props,settings))}}},createHeadersMarkdownPlugin=function(config){var _config$type=config["wix-draft-plugin-headers-markdown"],settings=void 0===_config$type?{}:_config$type,plugin={decorators:[createHeadersMarkdownDecorator(config)]};return createBasePlugin(_extends({settings:settings,type:"wix-draft-plugin-headers-markdown",defaultPluginData:DEFAULTS},config),plugin)};createHeadersMarkdownPlugin.functionName="wix-draft-plugin-headers-markdown";var pluginHeadersMarkdown=function(config){return{config:_extends({},DEFAULTS.config,config),type:"wix-draft-plugin-headers-markdown",createPlugin:createHeadersMarkdownPlugin,ModalsMap:{}}},HEADERS_MARKDOWN_TYPE="wix-draft-plugin-headers-markdown";export{HEADERS_MARKDOWN_TYPE,createHeadersMarkdownDecorator,createHeadersMarkdownPlugin,pluginHeadersMarkdown};
//# sourceMappingURL=module.js.map

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

"use strict";function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends__default=_interopDefaultLegacy(require("@babel/runtime/helpers/extends")),DEFAULTS=Object.freeze({type:"line-spacing",config:{}});exports.pluginLineSpacing=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:"line-spacing"}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),React=require("react");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),React__default=_interopDefaultLegacy(React);var headersRegEx=/{\$h\d}.*?{\$h}/g,headersMarkdownStrategy=function(contentBlock,callback){!function(text,regex,callback){for(var matchArr,start;null!==(matchArr=regex.exec(text));)callback(start=matchArr.index,start+matchArr[0].length)}(contentBlock.getText(),headersRegEx,callback)},DEFAULTS_configViewer={hideMarkdown:!0},createHeadersMarkdownDecorator=function(config){var _config$type=config["wix-draft-plugin-headers-markdown"],settings=void 0===_config$type?{}:_config$type;return{strategy:headersMarkdownStrategy,component:function(props){return function(_ref){var children=_ref.children,hideMarkdown=_ref.hideMarkdown,sliceElementText=function(element,start,end){if("string"==typeof element)return element.slice(start,end);if(element.props&&element.props.text){var text=element.props.text.slice(start,end);return React__default.default.cloneElement(element,{text:text})}return element},Type=_ref.decoratedText.match(/h\d/)[0];if(hideMarkdown){var lastIndex=children.length-1;children[0]=sliceElementText(children[0],5),children[lastIndex]=sliceElementText(children[lastIndex],0,-4)}return React__default.default.createElement(Type,null,children)}(_extends__default.default({},props,settings))}}};exports.createHeadersMarkdownDecorator=createHeadersMarkdownDecorator,exports.pluginHeadersMarkdown=function(config){return{config:_extends__default.default({},DEFAULTS_configViewer,config),type:"wix-draft-plugin-headers-markdown",decorator:function(theme,config){var _createHeadersMarkdow;return createHeadersMarkdownDecorator(((_createHeadersMarkdow={})["wix-draft-plugin-headers-markdown"]=_extends__default.default({},config),_createHeadersMarkdow))}}};
//# sourceMappingURL=module.viewer.cjs.js.map

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

import _extends from"@babel/runtime/helpers/extends";var DEFAULTS=Object.freeze({type:"line-spacing",config:{}}),pluginLineSpacing=function(config){return{config:_extends({},DEFAULTS.config,config),type:"line-spacing"}};export{pluginLineSpacing};
import _extends from"@babel/runtime/helpers/extends";import React from"react";var headersRegEx=/{\$h\d}.*?{\$h}/g,headersMarkdownStrategy=function(contentBlock,callback){!function(text,regex,callback){for(var matchArr,start;null!==(matchArr=regex.exec(text));)callback(start=matchArr.index,start+matchArr[0].length)}(contentBlock.getText(),headersRegEx,callback)},DEFAULTS_configViewer={hideMarkdown:!0},createHeadersMarkdownDecorator=function(config){var _config$type=config["wix-draft-plugin-headers-markdown"],settings=void 0===_config$type?{}:_config$type;return{strategy:headersMarkdownStrategy,component:function(props){return function(_ref){var children=_ref.children,hideMarkdown=_ref.hideMarkdown,sliceElementText=function(element,start,end){if("string"==typeof element)return element.slice(start,end);if(element.props&&element.props.text){var text=element.props.text.slice(start,end);return React.cloneElement(element,{text:text})}return element},Type=_ref.decoratedText.match(/h\d/)[0];if(hideMarkdown){var lastIndex=children.length-1;children[0]=sliceElementText(children[0],5),children[lastIndex]=sliceElementText(children[lastIndex],0,-4)}return React.createElement(Type,null,children)}(_extends({},props,settings))}}},pluginHeadersMarkdown=function(config){return{config:_extends({},DEFAULTS_configViewer,config),type:"wix-draft-plugin-headers-markdown",decorator:function(theme,config){var _createHeadersMarkdow;return createHeadersMarkdownDecorator(((_createHeadersMarkdow={})["wix-draft-plugin-headers-markdown"]=_extends({},config),_createHeadersMarkdow))}}};export{createHeadersMarkdownDecorator,pluginHeadersMarkdown};
//# sourceMappingURL=module.viewer.js.map

@@ -1,5 +0,7 @@

export declare const DEFAULTS: Readonly<{
type: string;
export declare const DEFAULTS: {
config: {};
}>;
configViewer: {
hideMarkdown: boolean;
};
};
//# sourceMappingURL=defaults.d.ts.map

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

import { LineSpacingPluginEditorConfig } from './types';
import { HeadersMarkdownPluginEditorConfig } from './types';
import { EditorPluginCreator } from 'wix-rich-content-common';
export declare const pluginLineSpacing: EditorPluginCreator<LineSpacingPluginEditorConfig>;
export declare const pluginHeadersMarkdown: EditorPluginCreator<HeadersMarkdownPluginEditorConfig>;
//# sourceMappingURL=editor.d.ts.map

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

export { createLineSpacingPlugin } from './createLineSpacingPlugin';
export { LINE_SPACING_TYPE } from './types';
export { Modals, ModalsMap } from './modals';
export { pluginLineSpacing } from './editor';
export { createHeadersMarkdownPlugin } from './createHeadersMarkdownPlugin';
export { createHeadersMarkdownDecorator } from './viewer';
export declare const HEADERS_MARKDOWN_TYPE = "wix-draft-plugin-headers-markdown";
export { pluginHeadersMarkdown } from './editor';
//# sourceMappingURL=index.d.ts.map
import { EditorPluginConfig, ViewerPluginConfig } from 'wix-rich-content-common';
export declare const LINE_SPACING_TYPE = "line-spacing";
export interface LineSpacingPluginEditorConfig extends EditorPluginConfig {
inlinePopups?: boolean;
export declare const HEADERS_MARKDOWN_TYPE = "wix-draft-plugin-headers-markdown";
export interface HeadersMarkdownPluginEditorConfig extends EditorPluginConfig {
[key: string]: any;
}
export interface LineSpacingPluginViewerConfig extends ViewerPluginConfig {
export interface HeadersMarkdownPluginViewerConfig extends ViewerPluginConfig {
[key: string]: any;
}
//# sourceMappingURL=types.d.ts.map

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

import { LineSpacingPluginViewerConfig } from './types';
import { DraftDecorator } from 'draft-js';
import { HeadersMarkdownPluginViewerConfig, HeadersMarkdownPluginEditorConfig } from './types';
import { ViewerPluginCreator } from 'wix-rich-content-common';
export declare const pluginLineSpacing: ViewerPluginCreator<LineSpacingPluginViewerConfig>;
export declare const createHeadersMarkdownDecorator: (config: HeadersMarkdownPluginEditorConfig) => DraftDecorator;
export declare const pluginHeadersMarkdown: ViewerPluginCreator<HeadersMarkdownPluginViewerConfig>;
//# sourceMappingURL=viewer.d.ts.map

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

{"name":"richlagetest","version":"0.0.0-a3535a7650e08ec0431ec032e46603c66e08fc05"}
{"name":"richlagetest","version":"0.0.0-a5679f3b7e39d78a93b76c6b7acda65d4a121791"}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc