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-5cec144654d3c83acaec9c34d801588198416d8b to 0.0.0-5cef900108d383242769ac1b670bae10a43a8b29

dist/src/createToolbar.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"),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:{}}};
"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"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),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),classNames__default=_interopDefaultLegacy(classNames),UNDO_REDO_TYPE="wix-rich-content-undo-redo",undoIcon=function(props){return React__default.default.createElement("svg",Object.assign({width:"19px",height:"19px",viewBox:"0 0 19 19"},props),React__default.default.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React__default.default.createElement("g",{transform:"translate(3.000000, 3.000000)",fill:"currentColor",fillRule:"nonzero"},React__default.default.createElement("path",{d:"M5.84025878,0.134851469 L6.35974122,0.604040132 L4.94038416,2.1736918 C5.31801204,2.09184132 5.70619176,2.05 6.1,2.05 C9.10995189,2.05 11.55,4.49004811 11.55,7.5 C11.55,10.5099519 9.10995189,12.95 6.1,12.95 C3.16346157,12.95 0.769365764,10.6275271 0.654327502,7.71919617 L0.65,7.5 L1.35,7.5 C1.35,10.1233526 3.47664744,12.25 6.1,12.25 C8.72335256,12.25 10.85,10.1233526 10.85,7.5 C10.85,4.87664744 8.72335256,2.75 6.1,2.75 C5.62381821,2.75 5.15770309,2.81999077 4.71257593,2.95571988 L6.36376971,4.84941226 L5.83623029,5.30952328 L3.54217296,2.67927615 L5.84025878,0.134851469 Z",id:"Undo"}))))},redoIcon=function(){return React__default.default.createElement("svg",{width:"19px",height:"19px",viewBox:"0 0 19 19"},React__default.default.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React__default.default.createElement("g",{transform:"translate(9.000000, 9.500000) scale(-1, 1) translate(-9.000000, -9.500000) translate(3.000000, 3.000000)",fill:"currentColor",fillRule:"nonzero"},React__default.default.createElement("path",{d:"M5.84025878,0.134851469 L6.35974122,0.604040132 L4.93938956,2.17390748 C5.31733043,2.09191482 5.70584601,2.05 6.1,2.05 C9.10995189,2.05 11.55,4.49004811 11.55,7.5 C11.55,10.5099519 9.10995189,12.95 6.1,12.95 C3.16346157,12.95 0.769365764,10.6275271 0.654327502,7.71919617 L0.65,7.5 L1.35,7.5 C1.35,10.1233526 3.47664744,12.25 6.1,12.25 C8.72335256,12.25 10.85,10.1233526 10.85,7.5 C10.85,4.87664744 8.72335256,2.75 6.1,2.75 C5.62381821,2.75 5.15770309,2.81999077 4.71257593,2.95571988 L6.36376971,4.84941226 L5.83623029,5.30952328 L3.54217296,2.67927615 L5.84025878,0.134851469 Z"}))))},UndoButton=function(props){var _config$toolbar,_config$toolbar$icons,_editorState$getUndoS,_editorState$getUndoS2,isMobile=props.isMobile,_props$theme=props.theme,theme=void 0===_props$theme?{}:_props$theme,helpers=props.helpers,children=props.children,className=props.className,config=props.config,tabIndex=props.tabIndex,t=props.t,getEditorState=props.getEditorState,setEditorState=props.setEditorState,editorState=getEditorState(),combinedClassName=classNames__default.default(theme.undo,className),icon=(null==config||null===(_config$toolbar=config.toolbar)||void 0===_config$toolbar||null===(_config$toolbar$icons=_config$toolbar.icons)||void 0===_config$toolbar$icons?void 0:_config$toolbar$icons.Undo)||undoIcon,disabled=(null==editorState||null===(_editorState$getUndoS=editorState.getUndoStack())||void 0===_editorState$getUndoS||null===(_editorState$getUndoS2=_editorState$getUndoS.isEmpty)||void 0===_editorState$getUndoS2?void 0:_editorState$getUndoS2.call(_editorState$getUndoS))||!editorState,onClick=function(event){event.stopPropagation(),setEditorState(wixRichContentEditorCommon.undo(getEditorState()))};return isMobile?React__default.default.createElement(wixRichContentEditorCommon.InlineToolbarButton,{disabled:disabled,onClick:onClick,isActive:!1,helpers:helpers,theme:theme,isMobile:isMobile,tooltipText:t("UndoButton_Tooltip"),dataHook:"undoButton",formattingButtonName:wixRichContentEditorCommon.FORMATTING_BUTTONS.UNDO,tabIndex:tabIndex,pluginType:UNDO_REDO_TYPE,icon:icon},children):React__default.default.createElement("button",{tabIndex:tabIndex,disabled:disabled,onClick:onClick,className:combinedClassName},children)},RedoButton=function(props){var _config$toolbar,_config$toolbar$icons,_editorState$getRedoS,_editorState$getRedoS2,isMobile=props.isMobile,_props$theme=props.theme,theme=void 0===_props$theme?{}:_props$theme,helpers=props.helpers,children=props.children,className=props.className,config=props.config,tabIndex=props.tabIndex,t=props.t,getEditorState=props.getEditorState,setEditorState=props.setEditorState,editorState=getEditorState(),combinedClassName=classNames__default.default(theme.redo,className),icon=(null==config||null===(_config$toolbar=config.toolbar)||void 0===_config$toolbar||null===(_config$toolbar$icons=_config$toolbar.icons)||void 0===_config$toolbar$icons?void 0:_config$toolbar$icons.Redo)||redoIcon(),disabled=(null==editorState||null===(_editorState$getRedoS=editorState.getRedoStack())||void 0===_editorState$getRedoS||null===(_editorState$getRedoS2=_editorState$getRedoS.isEmpty)||void 0===_editorState$getRedoS2?void 0:_editorState$getRedoS2.call(_editorState$getRedoS))||!editorState,onClick=function(event){event.stopPropagation(),setEditorState(wixRichContentEditorCommon.redo(getEditorState()))};return isMobile?React__default.default.createElement(wixRichContentEditorCommon.InlineToolbarButton,{disabled:disabled,onClick:onClick,isActive:!1,theme:theme,helpers:helpers,isMobile:isMobile,tooltipText:t("RedoButton_Tooltip"),dataHook:"redoButton",formattingButtonName:wixRichContentEditorCommon.FORMATTING_BUTTONS.REDO,tabIndex:tabIndex,pluginType:UNDO_REDO_TYPE,icon:redoIcon},children):React__default.default.createElement("button",{tabIndex:tabIndex,disabled:disabled,onClick:onClick,className:combinedClassName},isMobile&&icon,children)},createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,_settings$toolbar2,_settings$toolbar2$ic,t=_ref.t,settings=_ref.settings,getEditorState=_ref.getEditorState,setEditorState=_ref.setEditorState,undoIcon$1=(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.Undo)||undoIcon,redoIcon$1=(null==settings||null===(_settings$toolbar2=settings.toolbar)||void 0===_settings$toolbar2||null===(_settings$toolbar2$ic=_settings$toolbar2.icons)||void 0===_settings$toolbar2$ic?void 0:_settings$toolbar2$ic.Redo)||redoIcon;return[{type:wixRichContentEditorCommon.BUTTON_TYPES.BUTTON,name:wixRichContentEditorCommon.INSERT_PLUGIN_BUTTONS.UNDO,tooltip:t("UndoButton_Tooltip"),toolbars:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN,wixRichContentEditorCommon.TOOLBARS.FOOTER],getIcon:function(){return undoIcon$1},componentData:{},onClick:function(e){e.preventDefault(),setEditorState(wixRichContentEditorCommon.undo(getEditorState()))},isDisabled:function(){return getEditorState().getUndoStack().isEmpty()}},{type:wixRichContentEditorCommon.BUTTON_TYPES.BUTTON,name:wixRichContentEditorCommon.INSERT_PLUGIN_BUTTONS.REDO,tooltip:t("RedoButton_Tooltip"),toolbars:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN,wixRichContentEditorCommon.TOOLBARS.FOOTER],getIcon:function(){return redoIcon$1},componentData:{},onClick:function(e){e.preventDefault(),setEditorState(wixRichContentEditorCommon.redo(getEditorState()))},isDisabled:function(){return getEditorState().getRedoStack().isEmpty()}}]},createToolbar=function(_ref){var t=_ref.t,getEditorState=_ref.getEditorState,setEditorState=_ref.setEditorState,settings=_ref.settings;return{TextButtonMapper:function(){var _ref2;return(_ref2={})[wixRichContentEditorCommon.FORMATTING_BUTTONS.UNDO]={component:function(props){return React__default.default.createElement(UndoButton,Object.assign({t:t,getEditorState:getEditorState,setEditorState:setEditorState},props))},externalizedButtonProps:{type:wixRichContentEditorCommon.BUTTON_TYPES.BUTTON,getLabel:function(){return""},isActive:function(){return!1},isDisabled:function(){return getEditorState().getUndoStack().isEmpty()},tooltip:t("UndoButton_Tooltip"),getIcon:function(){var _settings$toolbars,_settings$toolbars$ic;return(null==settings||null===(_settings$toolbars=settings.toolbars)||void 0===_settings$toolbars||null===(_settings$toolbars$ic=_settings$toolbars.icons)||void 0===_settings$toolbars$ic?void 0:_settings$toolbars$ic.Undo)||undoIcon},onClick:function(e){e.preventDefault(),setEditorState(wixRichContentEditorCommon.undo(getEditorState()))}}},_ref2[wixRichContentEditorCommon.FORMATTING_BUTTONS.REDO]={component:function(props){return React__default.default.createElement(RedoButton,Object.assign({t:t,getEditorState:getEditorState,setEditorState:setEditorState},props))},externalizedButtonProps:{getLabel:function(){return""},type:wixRichContentEditorCommon.BUTTON_TYPES.BUTTON,isActive:function(){return!1},isDisabled:function(){return getEditorState().getRedoStack().isEmpty()},tooltip:t("RedoButton_Tooltip"),getIcon:function(){var _settings$toolbars2,_settings$toolbars2$i;return(null==settings||null===(_settings$toolbars2=settings.toolbars)||void 0===_settings$toolbars2||null===(_settings$toolbars2$i=_settings$toolbars2.icons)||void 0===_settings$toolbars2$i?void 0:_settings$toolbars2$i.Redo)||redoIcon},onClick:function(e){e.preventDefault(),setEditorState(wixRichContentEditorCommon.redo(getEditorState()))}}},_ref2},InsertButtons:createInsertButtons({t:t,getEditorState:getEditorState,setEditorState:setEditorState,settings:settings}),name:"undo-redo"}},DEFAULTS={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 createUndoRedoPlugin=function(config){var type=UNDO_REDO_TYPE,helpers=config.helpers,theme=config.theme,t=config.t,relValue=config.relValue,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,rest=_objectWithoutPropertiesLoose__default.default(config,["helpers","theme","t","relValue",type].map(_toPropertyKey));return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({settings:settings,theme:theme,type:type,relValue:relValue,toolbar:createToolbar(config),helpers:helpers,t:t,defaultPluginData:DEFAULTS},rest))};createUndoRedoPlugin.functionName=UNDO_REDO_TYPE;exports.UNDO_REDO_TYPE=UNDO_REDO_TYPE,exports.createUndoRedoPlugin=createUndoRedoPlugin,exports.pluginUndoRedo=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:UNDO_REDO_TYPE,createPlugin:createUndoRedoPlugin,ModalsMap:{}}};
//# sourceMappingURL=module.cjs.js.map

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

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};
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{createBasePlugin}from"wix-rich-content-plugin-commons";import React from"react";import{InlineToolbarButton,FORMATTING_BUTTONS,undo,redo,BUTTON_TYPES,INSERT_PLUGIN_BUTTONS,TOOLBARS}from"wix-rich-content-editor-common";import classNames from"classnames";var UNDO_REDO_TYPE="wix-rich-content-undo-redo",undoIcon=function(props){return React.createElement("svg",Object.assign({width:"19px",height:"19px",viewBox:"0 0 19 19"},props),React.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React.createElement("g",{transform:"translate(3.000000, 3.000000)",fill:"currentColor",fillRule:"nonzero"},React.createElement("path",{d:"M5.84025878,0.134851469 L6.35974122,0.604040132 L4.94038416,2.1736918 C5.31801204,2.09184132 5.70619176,2.05 6.1,2.05 C9.10995189,2.05 11.55,4.49004811 11.55,7.5 C11.55,10.5099519 9.10995189,12.95 6.1,12.95 C3.16346157,12.95 0.769365764,10.6275271 0.654327502,7.71919617 L0.65,7.5 L1.35,7.5 C1.35,10.1233526 3.47664744,12.25 6.1,12.25 C8.72335256,12.25 10.85,10.1233526 10.85,7.5 C10.85,4.87664744 8.72335256,2.75 6.1,2.75 C5.62381821,2.75 5.15770309,2.81999077 4.71257593,2.95571988 L6.36376971,4.84941226 L5.83623029,5.30952328 L3.54217296,2.67927615 L5.84025878,0.134851469 Z",id:"Undo"}))))},redoIcon=function(){return React.createElement("svg",{width:"19px",height:"19px",viewBox:"0 0 19 19"},React.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React.createElement("g",{transform:"translate(9.000000, 9.500000) scale(-1, 1) translate(-9.000000, -9.500000) translate(3.000000, 3.000000)",fill:"currentColor",fillRule:"nonzero"},React.createElement("path",{d:"M5.84025878,0.134851469 L6.35974122,0.604040132 L4.93938956,2.17390748 C5.31733043,2.09191482 5.70584601,2.05 6.1,2.05 C9.10995189,2.05 11.55,4.49004811 11.55,7.5 C11.55,10.5099519 9.10995189,12.95 6.1,12.95 C3.16346157,12.95 0.769365764,10.6275271 0.654327502,7.71919617 L0.65,7.5 L1.35,7.5 C1.35,10.1233526 3.47664744,12.25 6.1,12.25 C8.72335256,12.25 10.85,10.1233526 10.85,7.5 C10.85,4.87664744 8.72335256,2.75 6.1,2.75 C5.62381821,2.75 5.15770309,2.81999077 4.71257593,2.95571988 L6.36376971,4.84941226 L5.83623029,5.30952328 L3.54217296,2.67927615 L5.84025878,0.134851469 Z"}))))},UndoButton=function(props){var _config$toolbar,_config$toolbar$icons,_editorState$getUndoS,_editorState$getUndoS2,isMobile=props.isMobile,_props$theme=props.theme,theme=void 0===_props$theme?{}:_props$theme,helpers=props.helpers,children=props.children,className=props.className,config=props.config,tabIndex=props.tabIndex,t=props.t,getEditorState=props.getEditorState,setEditorState=props.setEditorState,editorState=getEditorState(),combinedClassName=classNames(theme.undo,className),icon=(null==config||null===(_config$toolbar=config.toolbar)||void 0===_config$toolbar||null===(_config$toolbar$icons=_config$toolbar.icons)||void 0===_config$toolbar$icons?void 0:_config$toolbar$icons.Undo)||undoIcon,disabled=(null==editorState||null===(_editorState$getUndoS=editorState.getUndoStack())||void 0===_editorState$getUndoS||null===(_editorState$getUndoS2=_editorState$getUndoS.isEmpty)||void 0===_editorState$getUndoS2?void 0:_editorState$getUndoS2.call(_editorState$getUndoS))||!editorState,onClick=function(event){event.stopPropagation(),setEditorState(undo(getEditorState()))};return isMobile?React.createElement(InlineToolbarButton,{disabled:disabled,onClick:onClick,isActive:!1,helpers:helpers,theme:theme,isMobile:isMobile,tooltipText:t("UndoButton_Tooltip"),dataHook:"undoButton",formattingButtonName:FORMATTING_BUTTONS.UNDO,tabIndex:tabIndex,pluginType:UNDO_REDO_TYPE,icon:icon},children):React.createElement("button",{tabIndex:tabIndex,disabled:disabled,onClick:onClick,className:combinedClassName},children)},RedoButton=function(props){var _config$toolbar,_config$toolbar$icons,_editorState$getRedoS,_editorState$getRedoS2,isMobile=props.isMobile,_props$theme=props.theme,theme=void 0===_props$theme?{}:_props$theme,helpers=props.helpers,children=props.children,className=props.className,config=props.config,tabIndex=props.tabIndex,t=props.t,getEditorState=props.getEditorState,setEditorState=props.setEditorState,editorState=getEditorState(),combinedClassName=classNames(theme.redo,className),icon=(null==config||null===(_config$toolbar=config.toolbar)||void 0===_config$toolbar||null===(_config$toolbar$icons=_config$toolbar.icons)||void 0===_config$toolbar$icons?void 0:_config$toolbar$icons.Redo)||redoIcon(),disabled=(null==editorState||null===(_editorState$getRedoS=editorState.getRedoStack())||void 0===_editorState$getRedoS||null===(_editorState$getRedoS2=_editorState$getRedoS.isEmpty)||void 0===_editorState$getRedoS2?void 0:_editorState$getRedoS2.call(_editorState$getRedoS))||!editorState,onClick=function(event){event.stopPropagation(),setEditorState(redo(getEditorState()))};return isMobile?React.createElement(InlineToolbarButton,{disabled:disabled,onClick:onClick,isActive:!1,theme:theme,helpers:helpers,isMobile:isMobile,tooltipText:t("RedoButton_Tooltip"),dataHook:"redoButton",formattingButtonName:FORMATTING_BUTTONS.REDO,tabIndex:tabIndex,pluginType:UNDO_REDO_TYPE,icon:redoIcon},children):React.createElement("button",{tabIndex:tabIndex,disabled:disabled,onClick:onClick,className:combinedClassName},isMobile&&icon,children)},createInsertButtons=function(_ref){var _settings$toolbar,_settings$toolbar$ico,_settings$toolbar2,_settings$toolbar2$ic,t=_ref.t,settings=_ref.settings,getEditorState=_ref.getEditorState,setEditorState=_ref.setEditorState,undoIcon$1=(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.Undo)||undoIcon,redoIcon$1=(null==settings||null===(_settings$toolbar2=settings.toolbar)||void 0===_settings$toolbar2||null===(_settings$toolbar2$ic=_settings$toolbar2.icons)||void 0===_settings$toolbar2$ic?void 0:_settings$toolbar2$ic.Redo)||redoIcon;return[{type:BUTTON_TYPES.BUTTON,name:INSERT_PLUGIN_BUTTONS.UNDO,tooltip:t("UndoButton_Tooltip"),toolbars:[TOOLBARS.INSERT_PLUGIN,TOOLBARS.FOOTER],getIcon:function(){return undoIcon$1},componentData:{},onClick:function(e){e.preventDefault(),setEditorState(undo(getEditorState()))},isDisabled:function(){return getEditorState().getUndoStack().isEmpty()}},{type:BUTTON_TYPES.BUTTON,name:INSERT_PLUGIN_BUTTONS.REDO,tooltip:t("RedoButton_Tooltip"),toolbars:[TOOLBARS.INSERT_PLUGIN,TOOLBARS.FOOTER],getIcon:function(){return redoIcon$1},componentData:{},onClick:function(e){e.preventDefault(),setEditorState(redo(getEditorState()))},isDisabled:function(){return getEditorState().getRedoStack().isEmpty()}}]},createToolbar=function(_ref){var t=_ref.t,getEditorState=_ref.getEditorState,setEditorState=_ref.setEditorState,settings=_ref.settings;return{TextButtonMapper:function(){var _ref2;return(_ref2={})[FORMATTING_BUTTONS.UNDO]={component:function(props){return React.createElement(UndoButton,Object.assign({t:t,getEditorState:getEditorState,setEditorState:setEditorState},props))},externalizedButtonProps:{type:BUTTON_TYPES.BUTTON,getLabel:function(){return""},isActive:function(){return!1},isDisabled:function(){return getEditorState().getUndoStack().isEmpty()},tooltip:t("UndoButton_Tooltip"),getIcon:function(){var _settings$toolbars,_settings$toolbars$ic;return(null==settings||null===(_settings$toolbars=settings.toolbars)||void 0===_settings$toolbars||null===(_settings$toolbars$ic=_settings$toolbars.icons)||void 0===_settings$toolbars$ic?void 0:_settings$toolbars$ic.Undo)||undoIcon},onClick:function(e){e.preventDefault(),setEditorState(undo(getEditorState()))}}},_ref2[FORMATTING_BUTTONS.REDO]={component:function(props){return React.createElement(RedoButton,Object.assign({t:t,getEditorState:getEditorState,setEditorState:setEditorState},props))},externalizedButtonProps:{getLabel:function(){return""},type:BUTTON_TYPES.BUTTON,isActive:function(){return!1},isDisabled:function(){return getEditorState().getRedoStack().isEmpty()},tooltip:t("RedoButton_Tooltip"),getIcon:function(){var _settings$toolbars2,_settings$toolbars2$i;return(null==settings||null===(_settings$toolbars2=settings.toolbars)||void 0===_settings$toolbars2||null===(_settings$toolbars2$i=_settings$toolbars2.icons)||void 0===_settings$toolbars2$i?void 0:_settings$toolbars2$i.Redo)||redoIcon},onClick:function(e){e.preventDefault(),setEditorState(redo(getEditorState()))}}},_ref2},InsertButtons:createInsertButtons({t:t,getEditorState:getEditorState,setEditorState:setEditorState,settings:settings}),name:"undo-redo"}},DEFAULTS={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 createUndoRedoPlugin=function(config){var type=UNDO_REDO_TYPE,helpers=config.helpers,theme=config.theme,t=config.t,relValue=config.relValue,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,rest=_objectWithoutPropertiesLoose(config,["helpers","theme","t","relValue",type].map(_toPropertyKey));return createBasePlugin(_extends({settings:settings,theme:theme,type:type,relValue:relValue,toolbar:createToolbar(config),helpers:helpers,t:t,defaultPluginData:DEFAULTS},rest))};createUndoRedoPlugin.functionName=UNDO_REDO_TYPE;var pluginUndoRedo=function(config){return{config:_extends({},DEFAULTS.config,config),type:UNDO_REDO_TYPE,createPlugin:createUndoRedoPlugin,ModalsMap:{}}};export{UNDO_REDO_TYPE,createUndoRedoPlugin,pluginUndoRedo};
//# sourceMappingURL=module.js.map

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

"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))}}};
"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_config={};exports.pluginUndoRedo=function(config){return{config:_extends__default.default({},DEFAULTS_config,config),type:"wix-rich-content-undo-redo"}};
//# sourceMappingURL=module.viewer.cjs.js.map

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

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};
import _extends from"@babel/runtime/helpers/extends";var DEFAULTS_config={},pluginUndoRedo=function(config){return{config:_extends({},DEFAULTS_config,config),type:"wix-rich-content-undo-redo"}};export{pluginUndoRedo};
//# sourceMappingURL=module.viewer.js.map
export declare const DEFAULTS: {
config: {};
configViewer: {
hideMarkdown: boolean;
};
};
//# sourceMappingURL=defaults.d.ts.map

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

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

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

export { createHeadersMarkdownPlugin } from './createHeadersMarkdownPlugin';
export { createHeadersMarkdownDecorator } from './viewer';
export declare const HEADERS_MARKDOWN_TYPE = "wix-draft-plugin-headers-markdown";
export { pluginHeadersMarkdown } from './editor';
export { UNDO_REDO_TYPE } from './types';
export { createUndoRedoPlugin } from './createUndoRedoPlugin';
export { pluginUndoRedo } from './editor';
//# sourceMappingURL=index.d.ts.map
import { EditorPluginConfig, ViewerPluginConfig } from 'wix-rich-content-common';
export declare const HEADERS_MARKDOWN_TYPE = "wix-draft-plugin-headers-markdown";
export interface HeadersMarkdownPluginEditorConfig extends EditorPluginConfig {
export declare const UNDO_REDO_TYPE = "wix-rich-content-undo-redo";
export interface UndoRedoPluginEditorConfig extends EditorPluginConfig {
[key: string]: any;
}
export interface HeadersMarkdownPluginViewerConfig extends ViewerPluginConfig {
export interface UndoRedoPluginViewerConfig extends ViewerPluginConfig {
[key: string]: any;
}
//# sourceMappingURL=types.d.ts.map

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

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

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

{"name":"richlagetest","version":"0.0.0-5cec144654d3c83acaec9c34d801588198416d8b"}
{"name":"richlagetest","version":"0.0.0-5cef900108d383242769ac1b670bae10a43a8b29"}

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