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-a7378d442157ffbf2161b93ccb0ace39d30ab378

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

2

dist/module.viewer.cjs.js

@@ -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"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),DataSheet=require("wix-react-datasheet/lib"),classNames=require("classnames");require("wix-rich-content-common/libs/Tooltip");var lodash=require("lodash"),wixRichContentCommon=require("wix-rich-content-common");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _extends__default=_interopDefaultLegacy(_extends),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),DataSheet__default=_interopDefaultLegacy(DataSheet),classNames__default=_interopDefaultLegacy(classNames),DragAndDropIcon=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"9px",height:"13px",viewBox:"0 0 9 13"},props),React__default.default.createElement("g",{id:"Symbols",stroke:"none"},React__default.default.createElement("g",{id:"drag&drop/row/unselected",transform:"translate(-9.000000, -15.000000)",fill:"currentColor"},React__default.default.createElement("g",{transform:"translate(14.000000, 21.500000) rotate(-270.000000) translate(-14.000000, -21.500000) translate(-7.000000, 8.000000)",id:"drag&drop/column"},React__default.default.createElement("g",{id:"Group-5",transform:"translate(15.000000, 10.000000)"},React__default.default.createElement("path",{d:"M2,4.8 C2.62132034,4.8 3.13235254,5.26813868 3.19380454,5.87654553 L3.2,6 C3.2,6.62132034 2.73186132,7.13235254 2.12345447,7.19380454 L2,7.2 C1.3372583,7.2 0.8,6.66736221 0.8,6 C0.8,5.37867966 1.26813868,4.86764746 1.87654553,4.80619546 L2,4.8 Z M6,4.8 C6.62132034,4.8 7.13235254,5.26813868 7.19380454,5.87654553 L7.2,6 C7.2,6.62132034 6.73186132,7.13235254 6.12345447,7.19380454 L6,7.2 C5.3372583,7.2 4.8,6.66736221 4.8,6 C4.8,5.37867966 5.26813868,4.86764746 5.87654553,4.80619546 L6,4.8 Z M10,4.8 C10.6213203,4.8 11.1323525,5.26813868 11.1938045,5.87654553 L11.2,6 C11.2,6.62132034 10.7318613,7.13235254 10.1234545,7.19380454 L10,7.2 C9.3372583,7.2 8.8,6.66736221 8.8,6 C8.8,5.37867966 9.26813868,4.86764746 9.87654553,4.80619546 L10,4.8 Z",id:"Color"}),React__default.default.createElement("path",{d:"M2,0.2 C2.62132034,0.2 3.13235254,0.66813868 3.19380454,1.27654553 L3.2,1.4 C3.2,2.02132034 2.73186132,2.53235254 2.12345447,2.59380454 L2,2.6 C1.3372583,2.6 0.8,2.06736221 0.8,1.4 C0.8,0.778679656 1.26813868,0.267647457 1.87654553,0.206195465 L2,0.2 Z M6,0.2 C6.62132034,0.2 7.13235254,0.66813868 7.19380454,1.27654553 L7.2,1.4 C7.2,2.02132034 6.73186132,2.53235254 6.12345447,2.59380454 L6,2.6 C5.3372583,2.6 4.8,2.06736221 4.8,1.4 C4.8,0.778679656 5.26813868,0.267647457 5.87654553,0.206195465 L6,0.2 Z M10,0.2 C10.6213203,0.2 11.1323525,0.66813868 11.1938045,1.27654553 L11.2,1.4 C11.2,2.02132034 10.7318613,2.53235254 10.1234545,2.59380454 L10,2.6 C9.3372583,2.6 8.8,2.06736221 8.8,1.4 C8.8,0.778679656 9.26813868,0.267647457 9.87654553,0.206195465 L10,0.2 Z",id:"Color"}))))))},commonDesktopModalStyles={width:"362px",boxSizing:"border-box",height:"max-content",minHeight:"209px",overflow:"visible",border:"solid 1px rgba(51, 51, 51, 0.1)",display:"block",position:"absolute",zIndex:6,padding:"20px"};Object.freeze({content:commonDesktopModalStyles}),Object.freeze({overlay:{backgroundColor:"rgba(0, 0, 0, 0)",zIndex:5},content:_extends__default.default({},commonDesktopModalStyles,{borderRadius:"2px",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.06)"})}),Object.freeze({overlay:{backgroundColor:"transparent"},content:{top:0,left:0,overflow:"hidden",alignItems:"center",display:"flex",width:"100vw",justifyContent:"center"}}),Object.freeze({color1:"#FFFFFF",color2:"#D5D4D4",color3:"#000000",color4:"#000000",color5:"#000000",color6:"#ABCAFF",color7:"#81B0FF",color8:"#0261FF",color9:"#0141AA",color10:"#012055"});var styles$5_cell="_3c5-u",styles$5_header="Smmwb",styles$5_selected="_1WRNo",styles$5_editing="_1sB_i",styles$5_singleSelection="Qsa8e",styles$5_hideLastBlock="KlKsi",styles$5_editorWrapper="_11t6q",styles$5_viewerWrapper="_3iIc8",styles$5_hideFirstBlock="_1AP_7",styles$5_editor="_1Rg3q",styles$5_edit="_2Q_MS",styles$5_view="_30RxK",styles$5_disableSelection="_3NvqW",theme=function(_ref){var colors=_ref.colors,utils=_ref.utils;colors.textColor,colors.bgColor;var actionColor=colors.actionColor;utils.toCssRgbA(actionColor||"",.06)},DEFAULTS=Object.freeze({}),getStyleVal=function(elm,css){return window.getComputedStyle(elm,null).getPropertyValue(css)},paddingDiff=function(col){if("border-box"===getStyleVal(col,"box-sizing"))return 0;var padLeft=getStyleVal(col,"padding-left"),padRight=getStyleVal(col,"padding-right");return parseInt(padLeft)+parseInt(padRight)},getRefWidthAsNumber=function(ref){return getSizeStringAsNumber(ref.style.width)},getSizeStringAsNumber=function(str){return parseInt(str.substring(0,str.length-2))},range=function(start,end){for(var array=[],inc=end-start>0,i=start;inc?i<=end:i>=end;inc?i++:i--)inc?array.push(i):array.unshift(i);return array},getRange=function(_ref){var start=_ref.start,end=_ref.end,ranges=[];return start&&end&&range(start.i,end.i).map((function(i){return range(start.j,end.j).map((function(j){return ranges.push({i:i,j:j})}))})),ranges},TableDataUtil=function(_componentData){var _this=this;this.updateComponentData=function(componentData){_this.componentData=componentData},this.getRowColumns=function(i){var _this$getRow;return null===(_this$getRow=_this.getRow(i))||void 0===_this$getRow?void 0:_this$getRow.columns},this.getRows=function(){var _this$componentData,_this$componentData$c;return null===(_this$componentData=_this.componentData)||void 0===_this$componentData||null===(_this$componentData$c=_this$componentData.config)||void 0===_this$componentData$c?void 0:_this$componentData$c.rows},this.getRow=function(i){var _this$getRows;return null===(_this$getRows=_this.getRows())||void 0===_this$getRows?void 0:_this$getRows[i]},this.getRowNum=function(){return Object.entries(_this.getRows()).length},this.getColNum=function(){return Object.entries(_this.getRowColumns(0)).length},this.getCell=function(i,j){return _this.getRow(i)&&_this.getRowColumns(i)[j]},this.getCellContent=function(i,j){var _this$getCell;return null===(_this$getCell=_this.getCell(i,j))||void 0===_this$getCell?void 0:_this$getCell.content},this.getCellStyle=function(i,j){var _this$getCell2;return null===(_this$getCell2=_this.getCell(i,j))||void 0===_this$getCell2?void 0:_this$getCell2.style},this.getColsWidth=function(){return _this.componentData.config.colsWidth},this.getRowsHeight=function(){return _this.componentData.config.rowsHeight},this.getColWidth=function(j){return _this.getColsWidth()[j]},this.getRowHeight=function(i){return _this.getRowsHeight()[i]},this.getColsMinWidth=function(){return _this.componentData.config.colsMinWidth},this.getColMinWidth=function(j){for(var colMinWidth=65,numberOfRows=_this.getRowNum(),_loop=function(i){var contentState=_this.getCellContent(i,j).getCurrentContent();contentState.getBlockMap().forEach((function(block){if("atomic"===block.type){var entityKey=block.getEntityAt(0),entity=entityKey?contentState.getEntity(entityKey):void 0,type=null==entity?void 0:entity.getType();"wix-draft-plugin-image"!==type&&"wix-draft-plugin-video"!==type||(colMinWidth=300)}}))},i=0;i<numberOfRows;i++)_loop(i);return colMinWidth},this.getCellWidthAsPixel=function(tableWidth,i,colsMinWidth){void 0===colsMinWidth&&(colsMinWidth=[]);var smallestCellIndex,smallestCellWidth,currCellWidth,colsWidthSum=_this.getColsWidth().reduce((function(acc,val){return acc+val}),0);return _this.getColsWidth().forEach((function(width,index){var cellWidth=tableWidth*(width/colsWidthSum);index===i?currCellWidth=cellWidth:cellWidth<120&&(!smallestCellWidth||smallestCellWidth>cellWidth)&&(smallestCellWidth=Math.max(colsMinWidth[index],cellWidth),smallestCellIndex=index)})),smallestCellWidth&&(currCellWidth=Math.min(120,smallestCellWidth)*(_this.getColWidth(i)/_this.getColWidth(smallestCellIndex))),Math.max(currCellWidth,colsMinWidth[i])},this.getCellWidthAsRatio=function(tableWidth,totalColsWidth,cellWidth){return totalColsWidth*cellWidth/tableWidth},this.getCellMergeData=function(i,j){var _this$getCell3;return null===(_this$getCell3=_this.getCell(i,j))||void 0===_this$getCell3?void 0:_this$getCell3.merge},this.getParentCell=function(key){var parentCell;return Object.entries(_this.getRows()).forEach((function(_ref4){var i=_ref4[0],row=_ref4[1];!parentCell&&Object.entries(row.columns).forEach((function(_ref5){var j=_ref5[0],merge=_this.getCellMergeData(i,j);(null==merge?void 0:merge.key)===key&&(parentCell=_extends__default.default({},merge,{row:i,col:j}))}))})),parentCell},this.fixSelectedWithMergeCells=function(selected){var selectedCells=getRange(selected);return selectedCells.length>1&&selectedCells.forEach((function(_ref6){var i=_ref6.i,j=_ref6.j,_ref7=_this.getCellMergeData(i,j)||{},parentCellKey=_ref7.parentCellKey,rowSpan=_ref7.rowSpan,colSpan=_ref7.colSpan,parentCell=parentCellKey&&_this.getParentCell(parentCellKey),extendSelectionBySpan=function(i,j,rowSpan,colSpan){(rowSpan>1||colSpan>1)&&[].concat(Array(rowSpan).fill(0)).forEach((function(row,rowIndex){[].concat(Array(colSpan).fill(0)).forEach((function(col,colIndex){var fixPos=function(key,newPos){var start=selected.start[key]<=selected.end[key]?selected.start:selected.end,end=selected.start[key]<=selected.end[key]?selected.end:selected.start;start[key]>newPos&&(start[key]=newPos),end[key]<newPos&&(end[key]=newPos)};fixPos("i",i+rowIndex),fixPos("j",j+colIndex)}))}))};if(parentCell){var row=parentCell.row,col=parentCell.col,_rowSpan=parentCell.rowSpan,_colSpan=parentCell.colSpan;extendSelectionBySpan(parseInt(row),parseInt(col),_rowSpan,_colSpan)}else extendSelectionBySpan(i,j,rowSpan,colSpan)})),selected},this.getCellParentPosition=function(i,j){var _ref8=_this.getCellMergeData(i,j)||{},parentCellKey=_ref8.parentCellKey,rowSpan=_ref8.rowSpan,colSpan=_ref8.colSpan;if(parentCellKey){var _this$getParentCell=_this.getParentCell(parentCellKey);return{i:_this$getParentCell.row,j:_this$getParentCell.col}}if(rowSpan>1||colSpan>1)return{i:i,j:j}},this.getRowCellsParentPosition=function(i){var parentPos;return Object.entries(_this.getRowColumns(i)).forEach((function(_ref9){var j=_ref9[0];!parentPos&&(parentPos=_this.getCellParentPosition(i,j))})),parentPos},this.getColCellsParentPosition=function(j){var parentPos;return Object.entries(_this.getRows()).forEach((function(_ref10){var i=_ref10[0];!parentPos&&(parentPos=_this.getCellParentPosition(i,j))})),parentPos},this.getRowsSelection=function(rowsIndexes){return{start:{i:rowsIndexes.start,j:0},end:{i:rowsIndexes.end,j:_this.getColNum()-1}}},this.getColsSelection=function(colsIndexes){return{start:{i:0,j:colsIndexes.start},end:{i:_this.getRowNum()-1,j:colsIndexes.end}}},this.getAllCellsSelection=function(){return{start:{i:0,j:0},end:{i:_this.getRowNum()-1,j:_this.getColNum()-1}}},this.isAllCellsSelected=function(start,end){return start&&end&&0===Math.min(start.i,end.i)&&0===Math.min(start.j,end.j)&&Math.max(start.i,end.i)===_this.getRowNum()-1&&Math.max(start.j,end.j)===_this.getColNum()-1},this.getSelectionStyle=function(selection,defaultBG,defaultBorder){var _this$getCellStyle,_this$getCellStyle2,range=getRange(selection),selectionBGColor=(null===(_this$getCellStyle=_this.getCellStyle(range[0].i,range[0].j))||void 0===_this$getCellStyle?void 0:_this$getCellStyle.backgroundColor)||defaultBG,selectionBorderColor=_this.getConsistentCellBorderColor(selection,range[0].i,range[0].j,defaultBorder),selectionVerticalAlign=(null===(_this$getCellStyle2=_this.getCellStyle(range[0].i,range[0].j))||void 0===_this$getCellStyle2?void 0:_this$getCellStyle2.verticalAlign)||"top",selectionBorderIsActive=!1;return range.forEach((function(_ref11){var _this$getCellStyle3,_this$getCellStyle4,i=_ref11.i,j=_ref11.j,currentCellBGColor=(null===(_this$getCellStyle3=_this.getCellStyle(i,j))||void 0===_this$getCellStyle3?void 0:_this$getCellStyle3.backgroundColor)||defaultBG;selectionBGColor!==currentCellBGColor&&(selectionBGColor=!1);var currentCellBorderColor=_this.getConsistentCellBorderColor(selection,i,j,selectionBorderColor);selectionBorderColor!==currentCellBorderColor&&(selectionBorderColor=!1),_this.isCellBorderActive(selection,i,j)&&(selectionBorderIsActive=!0);var currentVerticalAlign=(null===(_this$getCellStyle4=_this.getCellStyle(i,j))||void 0===_this$getCellStyle4?void 0:_this$getCellStyle4.verticalAlign)||"top";selectionVerticalAlign!==currentVerticalAlign&&(selectionVerticalAlign=!1)})),{selectionBGColor:selectionBGColor,selectionBorderColor:selectionBorderColor,selectionVerticalAlign:selectionVerticalAlign,selectionBorderIsActive:selectionBorderIsActive}},this.getSelectedRows=function(range){void 0===range&&(range=[]);var colNum=_this.getColNum();return _this.getSelectedSection(range,(function(_ref12){return{key:_ref12.i,value:_ref12.j}}),colNum)},this.getSelectedCols=function(range){void 0===range&&(range=[]);var rowNum=_this.getRowNum();return _this.getSelectedSection(range,(function(_ref13){var i=_ref13.i;return{key:_ref13.j,value:i}}),rowNum)},this.getSelectedSection=function(range,keyValueMapper,cellsNum){var selectedCells={};null==range||range.forEach((function(range){var _keyValueMapper=keyValueMapper(range),key=_keyValueMapper.key,value=_keyValueMapper.value;selectedCells[key]?selectedCells[key].push(value):selectedCells[key]=[value]}));var selected=[];return Object.entries(selectedCells).forEach((function(_ref14){var j=_ref14[0];return _ref14[1].length===cellsNum&&selected.push(j)})),selected[0]&&selected},this.getCellBorderColor=function(selection,row,col){var _this$getCell4,_this$getCell4$border,_this$getCell5,_this$getCell5$border,_this$getCell6,_this$getCell6$border,_this$getCell7,_this$getCell7$border,style={},range=getRange(selection);range.find((function(_ref15){var i=_ref15.i,j=_ref15.j;return i===row&&j===col-1}))||(style.borderLeft=null===(_this$getCell4=_this.getCell(row,col))||void 0===_this$getCell4||null===(_this$getCell4$border=_this$getCell4.border)||void 0===_this$getCell4$border?void 0:_this$getCell4$border.left);range.find((function(_ref16){var i=_ref16.i,j=_ref16.j;return i===row&&j===col+1}))||(style.borderRight=null===(_this$getCell5=_this.getCell(row,col))||void 0===_this$getCell5||null===(_this$getCell5$border=_this$getCell5.border)||void 0===_this$getCell5$border?void 0:_this$getCell5$border.right);range.find((function(_ref17){var i=_ref17.i,j=_ref17.j;return i===row-1&&j===col}))||(style.borderTop=null===(_this$getCell6=_this.getCell(row,col))||void 0===_this$getCell6||null===(_this$getCell6$border=_this$getCell6.border)||void 0===_this$getCell6$border?void 0:_this$getCell6$border.top);range.find((function(_ref18){var i=_ref18.i,j=_ref18.j;return i===row+1&&j===col}))||(style.borderBottom=null===(_this$getCell7=_this.getCell(row,col))||void 0===_this$getCell7||null===(_this$getCell7$border=_this$getCell7.border)||void 0===_this$getCell7$border?void 0:_this$getCell7$border.bottom);return Object.values(style)},this.getConsistentCellBorderColor=function(selection,row,col,defaultBorder){var borderStyles=_this.getCellBorderColor(selection,row,col);return!!borderStyles.every((function(borderStyle){return borderStyle===borderStyles[0]}))&&(borderStyles[0]?_this.getColorFromBorderStyle(borderStyles[0]):defaultBorder)},this.isCellBorderActive=function(selection,row,col){return _this.getCellBorderColor(selection,row,col).some((function(borderStyle){return void 0!==borderStyle}))},this.getColorFromBorderStyle=function(borderStyle){return borderStyle.includes("transparent")?"transparent":"#"+borderStyle.split("#")[1]},this.getCellBorders=function(selection,row,col,color){var range=getRange(selection),_ref19=_this.getCellMergeData(row,col)||{},_ref19$rowSpan=_ref19.rowSpan,rowSpan=void 0===_ref19$rowSpan?1:_ref19$rowSpan,_ref19$colSpan=_ref19.colSpan,colSpan=void 0===_ref19$colSpan?1:_ref19$colSpan,borderColor=color||"var(--ricos-settings-action-color, var(--ricos-action-color, #0261ff))",borders={};return range.find((function(_ref20){var i=_ref20.i,j=_ref20.j;return i===row&&j===col-1}))||(borders.left=borderColor),range.find((function(_ref21){var i=_ref21.i,j=_ref21.j;return i===row&&j===col+colSpan}))||(borders.right=borderColor),range.find((function(_ref22){var i=_ref22.i,j=_ref22.j;return i===row-1&&j===col}))||(borders.top=borderColor),range.find((function(_ref23){var i=_ref23.i,j=_ref23.j;return i===row+rowSpan&&j===col}))||(borders.bottom=borderColor),borders},this.getRowHeader=function(){return _this.componentData.config.rowHeader},this.getColHeader=function(){return _this.componentData.config.colHeader},this.isCellContainedInHeader=function(i,j){return 0===i&&_this.getRowHeader()||0===j&&_this.getColHeader()},this.updateComponentData(_componentData)},styles$4_borderT="_3_Ps8",styles$4_borderB="_1_558",styles$4_borderL="hp7Fj",styles$4_borderR="vjkf7",CellBorders=function(_ref){var borders=_ref.borders;return[borders.top&&React__default.default.createElement("div",{key:"top",style:{background:borders.top},className:styles$4_borderT}),borders.bottom&&React__default.default.createElement("div",{key:"bottom",style:{background:borders.bottom},className:styles$4_borderB}),borders.right&&React__default.default.createElement("div",{key:"right",style:{background:borders.right},className:styles$4_borderR}),borders.left&&React__default.default.createElement("div",{key:"left",style:{background:borders.left},className:styles$4_borderL})]},tableKeysToIgnoreOnEdit=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Cell=function(_Component){function Cell(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).selectCellContent=function(){var _this$props=_this.props,row=_this$props.row,col=_this$props.col,selectCellContent=_this$props.selectCellContent;!_this$props.isMobile&&(null==selectCellContent||selectCellContent(row,col))},_this.isSingleCellSelected=function(selectedCells){var _selectedCells,_selectedCells$start,_selectedCells2,_selectedCells2$end,_selectedCells3,_selectedCells3$start,_selectedCells4,_selectedCells4$end;return void 0===selectedCells&&(selectedCells={}),(null===(_selectedCells=selectedCells)||void 0===_selectedCells||null===(_selectedCells$start=_selectedCells.start)||void 0===_selectedCells$start?void 0:_selectedCells$start.i)===(null===(_selectedCells2=selectedCells)||void 0===_selectedCells2||null===(_selectedCells2$end=_selectedCells2.end)||void 0===_selectedCells2$end?void 0:_selectedCells2$end.i)&&(null===(_selectedCells3=selectedCells)||void 0===_selectedCells3||null===(_selectedCells3$start=_selectedCells3.start)||void 0===_selectedCells3$start?void 0:_selectedCells3$start.j)===(null===(_selectedCells4=selectedCells)||void 0===_selectedCells4||null===(_selectedCells4$end=_selectedCells4.end)||void 0===_selectedCells4$end?void 0:_selectedCells4$end.j)},_this.isEditing=function(editing,selectedCells){return editing&&_this.isSingleCellSelected(selectedCells)},_this.setEditorRef=function(ref){var _this$props2=_this.props,setEditorRef=_this$props2.setEditorRef,row=_this$props2.row,col=_this$props2.col;_this.editorRef=ref,setEditorRef&&setEditorRef(ref,row,col)},_this.setTdRef=function(ref){return _this.tdRef=ref},_this.getToolbarPosition=function(){if(_this.tdRef){var cellOffsetLeft=_this.tdRef.offsetLeft;return{x:0,containerWidth:_this.props.tableWidth,offsetLeftInsideContainer:cellOffsetLeft}}},_this.onKeydown=function(e){var _this$props3=_this.props,editing=_this$props3.editing,onKeyDown=_this$props3.onKeyDown,isMobile=_this$props3.isMobile;if(editing&&!isMobile){("Backspace"===e.key||"a"===e.key&&(e.ctrlKey||e.metaKey))&&e.stopPropagation();var shouldCreateNewLine="Enter"===e.key&&(e.altKey||e.shiftKey||e.metaKey);tableKeysToIgnoreOnEdit.includes(e.key)||shouldCreateNewLine||onKeyDown(e)}else!editing&&tableKeysToIgnoreOnEdit.includes(e.key)&&(onKeyDown(e),e.stopPropagation(),e.preventDefault())},_this.fixReactModalButtons=function(toolbarButtons){Object.values(toolbarButtons).forEach((function(buttonsProps){"DROPDOWN"===buttonsProps.type&&(buttonsProps.type="modal")}))},_this.getEditorWrapperStyle=function(additionalStyles,isEditing){var shouldSetEditStyle=!_this.props.isMobile&&isEditing,style=shouldSetEditStyle?_extends__default.default({minHeight:_this.tdHeight},additionalStyles):{},verticalAlign=additionalStyles.verticalAlign;return shouldSetEditStyle&&verticalAlign&&(style.display="flex","middle"===verticalAlign?style.alignItems="center":"bottom"===verticalAlign&&(style.alignItems="flex-end")),style},_this.getCellBorders=function(cellBorders,shouldShowSelectedStyle){var _this$props4=_this.props,table=_this$props4.table,selectedCells=_this$props4.selectedCells,row=_this$props4.row,col=_this$props4.col,disableSelectedStyle=_this$props4.disableSelectedStyle,isMobile=_this$props4.isMobile,selected=_this$props4.selected,cellSelectionBorders=table.getCellBorders(selectedCells,row,col),borders={};return disableSelectedStyle&&selected?Object.entries(cellBorders).forEach((function(_ref){var key=_ref[0],val=_ref[1];!cellSelectionBorders[key]&&(borders[key]=val)})):borders=cellBorders,!isMobile&&shouldShowSelectedStyle?_extends__default.default({},borders,cellSelectionBorders):borders},_this.hideBlocks=function(){var _this$props5=_this.props,row=_this$props5.row,col=_this$props5.col,table=_this$props5.table,setEditorRef=_this$props5.setEditorRef,editorState=table.getCellContent(row,col),blocks=setEditorRef?editorState.getCurrentContent().getBlocksAsArray():editorState.blocks;if(blocks.length>=3){var lastBlockText,firstBlockText;if(setEditorRef){var currentContent=editorState.getCurrentContent();lastBlockText=currentContent.getLastBlock().getText(),firstBlockText=currentContent.getFirstBlock().getText()}else lastBlockText=blocks[blocks.length-1].text,firstBlockText=blocks[0].text;return{hideFirstBlock:""===firstBlockText||"​"===firstBlockText,hideLastBlock:""===lastBlockText||"​"===lastBlockText}}return{}},_this.onCellClick=function(){return _this.props.isMobile&&_this.props.onDoubleClick()},_this}_inheritsLoose__default.default(Cell,_Component);var _proto=Cell.prototype;return _proto.componentDidUpdate=function(prevProps){var _this$editorRef,_this$tdRef,isCellWasEditing=this.isEditing(prevProps.editing,prevProps.selectedCells),isCellEditing=this.isEditing(this.props.editing,this.props.selectedCells),isGoIntoEdit=!isCellWasEditing&&isCellEditing,isGoOutFromEdit=isCellWasEditing&&!isCellEditing,_this$props6=this.props,selectedCells=_this$props6.selectedCells,isMobile=_this$props6.isMobile,setEditingActive=_this$props6.setEditingActive,toolbarRef=_this$props6.toolbarRef;(isGoIntoEdit?(this.editorRef.focus(),setEditingActive(!0),this.selectCellContent()):isGoOutFromEdit&&(setEditingActive(!1),null==toolbarRef||toolbarRef.setEditingTextFormattingToolbarProps(!1),this.selectCellContent()),!this.props.selected||prevProps.selected||isCellEditing||isMobile)||(this.selectCellContent(),selectedCells&&1===getRange(selectedCells).length&&(null===(_this$editorRef=this.editorRef)||void 0===_this$editorRef||_this$editorRef.focus()),this.tdHeight=(null===(_this$tdRef=this.tdRef)||void 0===_this$tdRef?void 0:_this$tdRef.offsetHeight)-1)},_proto.render=function(){var _this$tdRef2,_this$props7=this.props,row=_this$props7.row,col=_this$props7.col,style=_this$props7.style,onMouseDown=_this$props7.onMouseDown,onMouseOver=_this$props7.onMouseOver,onDoubleClick=_this$props7.onDoubleClick,editing=_this$props7.editing,onContextMenu=_this$props7.onContextMenu,children=_this$props7.children,selected=_this$props7.selected,selectedCells=_this$props7.selectedCells,table=_this$props7.table,isMobile=_this$props7.isMobile,disableSelectedStyle=_this$props7.disableSelectedStyle,setEditorRef=_this$props7.setEditorRef,selectCellContent=_this$props7.selectCellContent,_ref2=table.getCell(row,col)||{},_ref2$style=_ref2.style,additionalStyles=void 0===_ref2$style?{}:_ref2$style,_ref2$merge=_ref2.merge,merge=void 0===_ref2$merge?{}:_ref2$merge,_ref2$border=_ref2.border,border=void 0===_ref2$border?{}:_ref2$border,_merge$colSpan=merge.colSpan,colSpan=void 0===_merge$colSpan?1:_merge$colSpan,_merge$rowSpan=merge.rowSpan,rowSpan=void 0===_merge$rowSpan?1:_merge$rowSpan,parentCellKey=merge.parentCellKey,isEditing=this.isEditing(editing,selectedCells),shouldShowSelectedStyle=selected&&!disableSelectedStyle&&!isEditing,range=selectedCells&&getRange(selectedCells),cellBorders=this.getCellBorders(border,shouldShowSelectedStyle),isContainedInHeader=table.isCellContainedInHeader(row,col),Tag=isContainedInHeader?"th":"td",editorState=this.editorRef&&isEditing&&table.getCellContent(row,col),Selection=editorState&&editorState.getSelection(),cellContentContainText=!!editorState&&editorState.getCurrentContent().getBlockMap().filter((function(x){return"unstyled"===x.getType()})).some((function(x){return""!==x.getText()&&"​"!==x.getText()}));if(this.editorRef&&isEditing&&(!Selection.isCollapsed()&&Selection.getHasFocus()||document&&document.querySelector('[data-id="rich-content-editor-modal"]'))&&cellContentContainText){var _this$editorRef2,_this$editorRef2$getT,_this$props$toolbarRe,toolbarButtons=lodash.cloneDeep(null===(_this$editorRef2=this.editorRef)||void 0===_this$editorRef2||null===(_this$editorRef2$getT=_this$editorRef2.getToolbarProps)||void 0===_this$editorRef2$getT?void 0:_this$editorRef2$getT.call(_this$editorRef2,wixRichContentCommon.ToolbarType.FORMATTING));toolbarButtons&&this.fixReactModalButtons(toolbarButtons),null===(_this$props$toolbarRe=this.props.toolbarRef)||void 0===_this$props$toolbarRe||_this$props$toolbarRe.setEditingTextFormattingToolbarProps(toolbarButtons)}else if(isEditing){var _this$props$toolbarRe2;null===(_this$props$toolbarRe2=this.props.toolbarRef)||void 0===_this$props$toolbarRe2||_this$props$toolbarRe2.setEditingTextFormattingToolbarProps(!1)}var editorWrapperStyle=this.getEditorWrapperStyle(additionalStyles,isEditing),_this$hideBlocks=this.hideBlocks(),hideFirstBlock=_this$hideBlocks.hideFirstBlock,hideLastBlock=_this$hideBlocks.hideLastBlock;return parentCellKey?null:React__default.default.createElement(Tag,{"data-hook":"table-plugin-cell",ref:this.setTdRef,className:classNames__default.default(styles$5_cell,isContainedInHeader&&styles$5_header,shouldShowSelectedStyle&&!isEditing&&styles$5_selected),onMouseDown:onMouseDown,onMouseOver:onMouseOver,onDoubleClick:onDoubleClick,onClick:this.onCellClick,onContextMenu:onContextMenu,colSpan:colSpan,rowSpan:rowSpan,style:_extends__default.default({},style,additionalStyles),onKeyDown:this.onKeydown},React__default.default.createElement("div",{className:classNames__default.default(setEditorRef?styles$5_editorWrapper:styles$5_viewerWrapper,!isEditing&&hideFirstBlock&&styles$5_hideFirstBlock,!isEditing&&hideLastBlock&&styles$5_hideLastBlock,!isMobile&&isEditing&&styles$5_editing,!isEditing&&styles$5_disableSelection),style:editorWrapperStyle},React__default.default.createElement(Editor,{editing:isMobile?selected:isEditing,selected:selected,contentState:table.getCellContent(row,col),setEditorRef:this.setEditorRef,isEditor:selectCellContent},children)),React__default.default.createElement(CellBorders,{borders:cellBorders}),React__default.default.createElement("div",{style:{height:shouldShowSelectedStyle?null===(_this$tdRef2=this.tdRef)||void 0===_this$tdRef2?void 0:_this$tdRef2.offsetHeight:0},className:classNames__default.default(shouldShowSelectedStyle&&styles$5_selected,1===(null==range?void 0:range.length)&&styles$5_singleSelection)}))},Cell}(React.Component),Editor=function(_Component2){function Editor(){for(var _this2,_len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return(_this2=_Component2.call.apply(_Component2,[this].concat(args))||this).setEditorRef=function(ref){_this2.editor=ref,_this2.props.setEditorRef(ref)},_this2}_inheritsLoose__default.default(Editor,_Component2);var _proto2=Editor.prototype;return _proto2.shouldComponentUpdate=function(nextProps){var _this$props8=this.props,editing=_this$props8.editing,selected=_this$props8.selected,isContentStateChanged=_this$props8.contentState!==nextProps.contentState;return editing||nextProps.editing||selected||isContentStateChanged},_proto2.render=function(){var _this$props9=this.props,children=_this$props9.children,editing=_this$props9.editing,selected=_this$props9.selected;return React__default.default.createElement("div",{className:classNames__default.default(styles$5_editor,editing?styles$5_edit:styles$5_view)},React__default.default.cloneElement(children,{ref:this.setEditorRef,editing:editing,readOnly:!editing&&!selected}))},Editor}(React.Component),RowRenderer=function(_Component){function RowRenderer(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).setRef=function(ref){var _this$props$setRowRef,_this$props;return null===(_this$props$setRowRef=(_this$props=_this.props).setRowRef)||void 0===_this$props$setRowRef?void 0:_this$props$setRowRef.call(_this$props,ref,_this.props.row)},_this}_inheritsLoose__default.default(RowRenderer,_Component);var _proto=RowRenderer.prototype;return _proto.shouldComponentUpdate=function(nextProps){var _nextProps$rowsToUpda;return(null===(_nextProps$rowsToUpda=nextProps.rowsToUpdate)||void 0===_nextProps$rowsToUpda?void 0:_nextProps$rowsToUpda.includes(nextProps.row))||!1},_proto.render=function(){var _this$props2=this.props,row=_this$props2.row,children=_this$props2.children,height=(0,_this$props2.getRowHeight)(row);return React__default.default.createElement("tr",{style:{height:height},ref:this.setRef},children)},RowRenderer}(React.Component),styles$3_viewMode="ZZwd4",styles$3_editMode="_33jXB",styles$3_container="_3S0Qj",styles$2_container="_4OA5y",styles$2_dragAndDrop="ZDIH5",styles$2_active="_13BUy",styles$2_selectAll="Sx3Cc",styles$2_dragging="_1lPd9",styles$2_horizontal="gP4sA",styles$2_selectPreview="-unpA",styles$2_vertical="_12B1r",DragAndDropSection=function(_React$Component){function DragAndDropSection(props){var _this;return(_this=_React$Component.call(this,props)||this).removeShiftKey=function(){return _this.shiftKey=!1},_this.setShiftKey=function(e){return"Shift"===e.key&&(_this.shiftKey=!0)},_this.onDragMouseDown=function(e,i){_this.curDrag=e.target,_this.startPoint=_this.getEventDiff(e),_this.isActive(i)?_this.clickedOnActiveDrag=!0:(_this.drags={},_this.shiftKey&&_this.props.activeDrag?(_this.drags.start=Math.min(i,_this.props.activeDrag[0]),_this.drags.end=Math.max(i,_this.props.activeDrag[_this.props.activeDrag.length-1])):(_this.drags.start=i,_this.drags.end=i),_this.props.onDragClick(_this.drags))},_this.getEventDiff=function(e){return _this.props.horizontal?e.pageX:e.pageY},_this.onMouseMove=function(e){if(_this.curDrag&&(_this.isDragging||Math.abs(_this.startPoint-_this.getEventDiff(e))>25)){var activeDrag=_this.props.activeDrag;_this.isDragging=!0,_this.drags={start:Math.min.apply(Math,activeDrag),end:Math.max.apply(Math,activeDrag)},_this.props.onDrag(e,_this.drags)}},_this.onMouseUp=function(e){_this.clickedOnActiveDrag&&(_this.props.onDragClick(),_this.clickedOnActiveDrag=!1),_this.curDrag&&(_this.curDrag=void 0,_this.isDragging&&(_this.isDragging=void 0,_this.props.onDragEnd(e,_this.drags),_this.drags=null))},_this.isActive=function(i){var _this$props$activeDra;return null===(_this$props$activeDra=_this.props.activeDrag)||void 0===_this$props$activeDra?void 0:_this$props$activeDra.includes(i)},_this.getSelectedPreviewStyle=function(){var _this$props=_this.props,size=_this$props.size,horizontal=_this$props.horizontal,index=_this$props.index,selectAll=_this$props.selectAll,selectPreviewStyle={visibility:_this.isActive(index)&&(selectAll?horizontal:!selectAll)&&"visible"};return horizontal?(selectPreviewStyle.height=size?size-20:0,_this.isActive(index+1)&&(selectPreviewStyle.borderRight="none"),_this.isActive(index-1)&&(selectPreviewStyle.borderLeft="none")):(selectPreviewStyle.width=size,_this.isActive(index+1)&&(selectPreviewStyle.borderBottom="none"),_this.isActive(index-1)&&(selectPreviewStyle.borderTop="none")),selectPreviewStyle},_this.state={},_this}_inheritsLoose__default.default(DragAndDropSection,_React$Component);var _proto=DragAndDropSection.prototype;return _proto.componentDidMount=function(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("keydown",this.setShiftKey),document.addEventListener("keyup",this.removeShiftKey)},_proto.componentWillUnmount=function(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("keydown",this.setShiftKey),document.removeEventListener("keyup",this.removeShiftKey)},_proto.render=function(){var _this2=this,_this$props2=this.props,horizontal=_this$props2.horizontal,selectAll=_this$props2.selectAll,index=_this$props2.index,isActive=this.isActive(index),selectPreviewStyle=this.getSelectedPreviewStyle();return React__default.default.createElement("div",{className:styles$2_container},React__default.default.createElement("div",{className:classNames__default.default(styles$2_dragAndDrop,isActive&&styles$2_active,selectAll&&styles$2_selectAll,this.isDragging&&styles$2_dragging),onMouseDown:function(e){return _this2.onDragMouseDown(e,index)},"data-hook":(horizontal?"col":"row")+"Drag-"+index},React__default.default.createElement(DragAndDropIcon,{className:classNames__default.default(horizontal&&styles$2_horizontal),style:{visibility:!selectAll&&isActive&&"visible",cursor:this.isDragging?"grabbing":"grab"}})),React__default.default.createElement("div",{className:classNames__default.default(styles$2_selectPreview,!horizontal&&styles$2_vertical),style:selectPreviewStyle}))},DragAndDropSection}(React__default.default.Component),styles$1_resizer="_1cjMQ",styles$1_horizonResizer="_39fAd",styles$1_verticalResizer="_1QWyO",styles$1_highlightOnly="_2S_Jx",Resizer=function(_PureComponent){function Resizer(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_PureComponent.call.apply(_PureComponent,[this].concat(args))||this).getPosition=function(e){return _this.props.horizontal?e.pageX:e.pageY},_this.getSize=function(){return _this.props.horizontal?_this.curTarget.offsetWidth:_this.curTarget.offsetHeight},_this.setNewSize=function(ref,size){return _this.props.horizontal?ref.style.width=size:ref.style.height=size},_this.setMinSize=function(ref,size){return ref.style.minWidth=size},_this.onMouseDown=function(e){var _this$props=_this.props,horizontal=_this$props.horizontal,size=_this$props.size,onResizeStart=_this$props.onResizeStart,index=_this$props.index,itemsRefs=_this$props.itemsRefs;horizontal?_this.ref.style.height=size+"px":_this.ref.style.width=size+"px",e.stopPropagation(),_this.curTarget=itemsRefs[index],_this.siblingCell=horizontal&&itemsRefs[index+1],_this.position=_this.getPosition(e);var padding=paddingDiff(_this.curTarget);_this.curSize=horizontal?getRefWidthAsNumber(_this.curTarget):_this.getSize()-padding,_this.siblingSize=_this.siblingCell&&getRefWidthAsNumber(_this.siblingCell),onResizeStart()},_this.onMouseMove=function(e){if(_this.curTarget){var diff=_this.getPosition(e)-_this.position,newSize=_this.curSize+diff,_this$props2=_this.props,minSize=_this$props2.minSize,setContainerSize=_this$props2.setContainerSize,horizontal=_this$props2.horizontal,overflowWidth=_this$props2.overflowWidth;if(newSize>=minSize&&(horizontal&&newSize<120&&_this.setMinSize(_this.curTarget,newSize+"px"),_this.setNewSize(_this.curTarget,newSize+"px"),setContainerSize&&setContainerSize(newSize+"px",_this.props.index),diff>0||diff<=0&&overflowWidth<=0)){var siblingNewSize=_this.siblingSize-diff;siblingNewSize&&siblingNewSize>=120&&_this.setNewSize(_this.siblingCell,siblingNewSize+"px")}}},_this.onMouseUp=function(){var _this$props3=_this.props,horizontal=_this$props3.horizontal,onResize=_this$props3.onResize,index=_this$props3.index,itemsRefs=_this$props3.itemsRefs,minSize=_this$props3.minSize;if(horizontal?_this.ref.style.height="20px":_this.ref.style.width="20px",horizontal&&_this.curTarget){var cellWidth=getRefWidthAsNumber(_this.curTarget),siblingWidth=_this.siblingCell&&getRefWidthAsNumber(_this.siblingCell);cellWidth<minSize&&(_this.curTarget.style.minWidth=cellWidth),siblingWidth&&siblingWidth<minSize&&(_this.siblingCell.style.minWidth=siblingWidth)}_this.curTarget&&_this.position&&_this.curSize&&(horizontal?onResize(itemsRefs):onResize(index,_this.getSize()),_this.curTarget=void 0,_this.position=void 0,_this.curSize=void 0)},_this.getResizerStyle=function(){var _this$props4=_this.props,horizontal=_this$props4.horizontal,highlightResizer=_this$props4.highlightResizer,index=_this$props4.index,size=_this$props4.size,style={};return highlightResizer===index&&(style=horizontal?{height:size,borderRight:"1px solid #0000ff"}:{width:size,borderBottom:"1px solid #0000ff",zIndex:3}),style},_this.setRef=function(ref){return _this.ref=ref},_this}_inheritsLoose__default.default(Resizer,_PureComponent);var _proto=Resizer.prototype;return _proto.componentDidMount=function(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)},_proto.componentWillUnmount=function(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)},_proto.render=function(){var resizerStyle=this.getResizerStyle();return React__default.default.createElement("div",{className:classNames__default.default(styles$1_resizer,this.props.highlightOnly&&styles$1_highlightOnly,this.props.horizontal?styles$1_horizonResizer:styles$1_verticalResizer),style:resizerStyle,onMouseDown:this.onMouseDown,ref:this.setRef})},Resizer}(React.PureComponent),styles_container="_2VbQq",styles_selected="_2ScdR",styles_selectAll="_24hfp",Columns=function(_PureComponent){function Columns(){return _PureComponent.apply(this,arguments)||this}return _inheritsLoose__default.default(Columns,_PureComponent),Columns.prototype.render=function(){var _this$props=this.props,colNum=_this$props.colNum,colDragProps=_this$props.colDragProps,activeDrag=_this$props.activeDrag,selectAll=_this$props.selectAll,size=_this$props.size,onResize=_this$props.onResize,highlightResizer=_this$props.highlightResizer,onResizeStart=_this$props.onResizeStart,columnsRefs=_this$props.columnsRefs,tableOverflowWidth=_this$props.tableOverflowWidth;return React__default.default.createElement("tr",null,[].concat(Array(colNum).fill(0)).map((function(row,i){return React__default.default.createElement("td",{key:"column"+i,className:classNames__default.default(styles_container,selectAll&&styles_selectAll,(null==activeDrag?void 0:activeDrag.includes(i))&&styles_selected)},React__default.default.createElement(DragAndDropSection,_extends__default.default({},colDragProps,{horizontal:!0,index:i,activeDrag:activeDrag,selectAll:selectAll,size:size})),onResize&&React__default.default.createElement(Resizer,{onResize:onResize,highlightResizer:highlightResizer,horizontal:!0,minSize:65,index:i,size:size,onResizeStart:onResizeStart,itemsRefs:columnsRefs,overflowWidth:tableOverflowWidth}))})))},Columns}(React.PureComponent),TableRenderer=function(_PureComponent){function TableRenderer(props){var _this;return(_this=_PureComponent.call(this,props)||this).onResizeWindow=lodash.debounce((function(){_this.setState({windowWidth:window.innerWidth});var _this$props=_this.props,table=_this$props.table,tableRef=_this$props.tableRef;tableRef.offsetWidth&&_this.columns.forEach((function(col,i){var width=table.getCellWidthAsPixel(tableRef.offsetWidth-1,i,table.getColsMinWidth());col&&(col.style.width=width+"px")}))}),60),_this.columns=[props.table.getColNum()],_this}_inheritsLoose__default.default(TableRenderer,_PureComponent);var _proto=TableRenderer.prototype;return _proto.componentDidMount=function(){window.addEventListener("resize",this.onResizeWindow)},_proto.componentWillUnmount=function(){window.removeEventListener("resize",this.onResizeWindow)},_proto.render=function(){var _table$getSelectedCol,_this2=this,_this$props2=this.props,children=_this$props2.children,tableRef=_this$props2.tableRef,table=_this$props2.table,colDragProps=_this$props2.colDragProps,onResize=_this$props2.onResize,onResizeStart=_this$props2.onResizeStart,highlightResizer=_this$props2.highlightResizer,selected=_this$props2.selected,selectAll=_this$props2.selectAll,tableHeight=_this$props2.tableHeight,isEditMode=_this$props2.isEditMode,isEditingActive=_this$props2.isEditingActive,tableOverflowWidth=_this$props2.tableOverflowWidth,range=selected&&getRange(selected),colsMinWidth=table.getColsMinWidth();return this.columns=this.columns.filter((function(elem){return elem.parentElement})),React__default.default.createElement("table",{className:styles$3_container},React__default.default.createElement("colgroup",null,table.getColsWidth().map((function(cellWidth,i){return React__default.default.createElement("col",{key:i,ref:function(_ref){return _ref&&(_this2.columns[i]=_ref)},style:{width:null!=tableRef&&tableRef.offsetWidth?table.getCellWidthAsPixel(tableRef.offsetWidth-1,i,colsMinWidth):cellWidth,minWidth:(null==colsMinWidth?void 0:colsMinWidth[i])||120}})}))),React__default.default.createElement("thead",null,isEditMode&&React__default.default.createElement(Columns,{colDragProps:colDragProps,colNum:table.getColNum(),onResize:onResize,onResizeStart:onResizeStart,highlightResizer:highlightResizer,activeDrag:isEditingActive?[]:null===(_table$getSelectedCol=table.getSelectedCols(range))||void 0===_table$getSelectedCol?void 0:_table$getSelectedCol.map((function(i){return parseInt(i)})),selectAll:selectAll,size:tableHeight,tableWidth:null==tableRef?void 0:tableRef.offsetWidth,columnsRefs:this.columns,tableOverflowWidth:tableOverflowWidth})),React__default.default.createElement("tbody",null,children))},TableRenderer}(React.PureComponent),TABLE_TYPE="wix-rich-content-plugin-table",TableViewer=function(_Component){function TableViewer(_props){var _this;return(_this=_Component.call(this,_props)||this).cellCreator=function(i,j){return{key:i+"-"+j,component:_this.renderCell(i,j),forceComponent:!0,disableUpdatedFlag:!0}},_this.renderCell=function(i,j){var _this$props=_this.props,renderInnerRCE=_this$props.renderInnerRCE,innerRCV=_this$props.innerRCV;return renderInnerRCE?renderInnerRCE(i,j):innerRCV({contentState:_this.table.getCellContent(i,j),renderedIn:TABLE_TYPE})},_this.createRow=function(i,columnsNumber){return[].concat(Array(columnsNumber).fill(0)).map((function(cell,j){return _this.cellCreator(i,j)}))},_this.sheetRenderer=function(props){return React__default.default.createElement(TableRenderer,_extends__default.default({},props,{table:_this.table,tableRef:_this.tableViewerRef,colDragProps:_this.props.colDragProps,onResize:_this.props.onResize,onResizeStart:_this.props.onResizeStart,highlightResizer:_this.props.highlightResizer,selectAll:_this.props.selectAll,tableHeight:_this.props.tableHeight,selected:_this.props.selected,isEditMode:_this.props.isEditMode,isEditingActive:_this.props.isEditingActive,tableOverflowWidth:_this.props.tableOverflowWidth}))},_this.rowRenderer=function(props){return React__default.default.createElement(RowRenderer,_extends__default.default({},props,{getRowHeight:_this.table.getRowHeight,setRowRef:_this.props.setRowRef,rowsToUpdate:_this.props.rowsToUpdate}))},_this.setCellRef=function(ref){return _this.cellRef=ref},_this.setTableViewerRef=function(ref){_this.tableViewerRef=ref,_this.state.isTableRefSet||_this.setState({isTableRefSet:!0})},_this.cellRenderer=function(props){var _this$props2=_this.props,setEditorRef=_this$props2.setEditorRef,toolbarRef=_this$props2.toolbarRef,setEditingActive=_this$props2.setEditingActive,tableWidth=_this$props2.tableWidth,isMobile=_this$props2.isMobile,_this$props2$selected=_this$props2.selected,selected=void 0===_this$props2$selected?{}:_this$props2$selected,disableSelectedStyle=_this$props2.disableSelectedStyle,t=_this$props2.t,selectCellContent=_this$props2.selectCellContent;return React__default.default.createElement(Cell,_extends__default.default({},props,{ref:_this.setCellRef,table:_this.table,setEditorRef:setEditorRef,toolbarRef:toolbarRef,selectedCells:selected,setEditingActive:setEditingActive,tableWidth:tableWidth,isMobile:isMobile,disableSelectedStyle:disableSelectedStyle,t:t,selectCellContent:selectCellContent}))},_this.valueRenderer=function(cell){return cell.component},_this.table=_this.props.table||new TableDataUtil(_props.componentData),_this.state={},_this}_inheritsLoose__default.default(TableViewer,_Component);var _proto=TableViewer.prototype;return _proto.componentDidMount=function(){this.tableViewerRef.children[0].classList.add("has-custom-focus")},_proto.render=function(){var _this2=this,_this$props3=this.props,onSelect=_this$props3.onSelect,selected=_this$props3.selected,isEditMode=_this$props3.isEditMode,setCellContent=_this$props3.setCellContent,onClear=_this$props3.onClear,onPaste=_this$props3.onPaste,rowNum=this.table.getRowNum(),colNum=this.table.getColNum(),grid=[].concat(Array(rowNum).fill(0)).map((function(row,i){return _this2.createRow(i,colNum)}));return React__default.default.createElement("div",{className:classNames__default.default(isEditMode?styles$3_editMode:styles$3_viewMode),ref:this.setTableViewerRef},React__default.default.createElement(DataSheet__default.default,{data:grid,valueRenderer:this.valueRenderer,onSelect:onSelect,selected:selected||{},cellRenderer:this.cellRenderer,rowRenderer:this.rowRenderer,sheetRenderer:this.sheetRenderer,onClear:onClear,getCellContent:this.table.getCellContent,setCellContent:setCellContent,onPaste:onPaste}))},TableViewer}(React.Component),typeMapper=function(){var _ref;return(_ref={})[TABLE_TYPE]={component:TableViewer,withHorizontalScroll:!0},_ref};exports.TABLE_TYPE=TABLE_TYPE,exports.pluginTable=function(config){return{config:_extends__default.default({},DEFAULTS.config,config),type:TABLE_TYPE,typeMapper:typeMapper,theme:theme}},exports.tableTypeMapper=typeMapper;
//# 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 _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component,PureComponent}from"react";import DataSheet from"wix-react-datasheet/lib";import classNames from"classnames";import"wix-rich-content-common/libs/Tooltip";import{cloneDeep,debounce}from"lodash";import{ToolbarType}from"wix-rich-content-common";var DragAndDropIcon=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"9px",height:"13px",viewBox:"0 0 9 13"},props),React.createElement("g",{id:"Symbols",stroke:"none"},React.createElement("g",{id:"drag&drop/row/unselected",transform:"translate(-9.000000, -15.000000)",fill:"currentColor"},React.createElement("g",{transform:"translate(14.000000, 21.500000) rotate(-270.000000) translate(-14.000000, -21.500000) translate(-7.000000, 8.000000)",id:"drag&drop/column"},React.createElement("g",{id:"Group-5",transform:"translate(15.000000, 10.000000)"},React.createElement("path",{d:"M2,4.8 C2.62132034,4.8 3.13235254,5.26813868 3.19380454,5.87654553 L3.2,6 C3.2,6.62132034 2.73186132,7.13235254 2.12345447,7.19380454 L2,7.2 C1.3372583,7.2 0.8,6.66736221 0.8,6 C0.8,5.37867966 1.26813868,4.86764746 1.87654553,4.80619546 L2,4.8 Z M6,4.8 C6.62132034,4.8 7.13235254,5.26813868 7.19380454,5.87654553 L7.2,6 C7.2,6.62132034 6.73186132,7.13235254 6.12345447,7.19380454 L6,7.2 C5.3372583,7.2 4.8,6.66736221 4.8,6 C4.8,5.37867966 5.26813868,4.86764746 5.87654553,4.80619546 L6,4.8 Z M10,4.8 C10.6213203,4.8 11.1323525,5.26813868 11.1938045,5.87654553 L11.2,6 C11.2,6.62132034 10.7318613,7.13235254 10.1234545,7.19380454 L10,7.2 C9.3372583,7.2 8.8,6.66736221 8.8,6 C8.8,5.37867966 9.26813868,4.86764746 9.87654553,4.80619546 L10,4.8 Z",id:"Color"}),React.createElement("path",{d:"M2,0.2 C2.62132034,0.2 3.13235254,0.66813868 3.19380454,1.27654553 L3.2,1.4 C3.2,2.02132034 2.73186132,2.53235254 2.12345447,2.59380454 L2,2.6 C1.3372583,2.6 0.8,2.06736221 0.8,1.4 C0.8,0.778679656 1.26813868,0.267647457 1.87654553,0.206195465 L2,0.2 Z M6,0.2 C6.62132034,0.2 7.13235254,0.66813868 7.19380454,1.27654553 L7.2,1.4 C7.2,2.02132034 6.73186132,2.53235254 6.12345447,2.59380454 L6,2.6 C5.3372583,2.6 4.8,2.06736221 4.8,1.4 C4.8,0.778679656 5.26813868,0.267647457 5.87654553,0.206195465 L6,0.2 Z M10,0.2 C10.6213203,0.2 11.1323525,0.66813868 11.1938045,1.27654553 L11.2,1.4 C11.2,2.02132034 10.7318613,2.53235254 10.1234545,2.59380454 L10,2.6 C9.3372583,2.6 8.8,2.06736221 8.8,1.4 C8.8,0.778679656 9.26813868,0.267647457 9.87654553,0.206195465 L10,0.2 Z",id:"Color"}))))))},commonDesktopModalStyles={width:"362px",boxSizing:"border-box",height:"max-content",minHeight:"209px",overflow:"visible",border:"solid 1px rgba(51, 51, 51, 0.1)",display:"block",position:"absolute",zIndex:6,padding:"20px"};Object.freeze({content:commonDesktopModalStyles}),Object.freeze({overlay:{backgroundColor:"rgba(0, 0, 0, 0)",zIndex:5},content:_extends({},commonDesktopModalStyles,{borderRadius:"2px",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.06)"})}),Object.freeze({overlay:{backgroundColor:"transparent"},content:{top:0,left:0,overflow:"hidden",alignItems:"center",display:"flex",width:"100vw",justifyContent:"center"}}),Object.freeze({color1:"#FFFFFF",color2:"#D5D4D4",color3:"#000000",color4:"#000000",color5:"#000000",color6:"#ABCAFF",color7:"#81B0FF",color8:"#0261FF",color9:"#0141AA",color10:"#012055"});var styles$5_cell="_3c5-u",styles$5_header="Smmwb",styles$5_selected="_1WRNo",styles$5_editing="_1sB_i",styles$5_singleSelection="Qsa8e",styles$5_hideLastBlock="KlKsi",styles$5_editorWrapper="_11t6q",styles$5_viewerWrapper="_3iIc8",styles$5_hideFirstBlock="_1AP_7",styles$5_editor="_1Rg3q",styles$5_edit="_2Q_MS",styles$5_view="_30RxK",styles$5_disableSelection="_3NvqW",theme=function(_ref){var colors=_ref.colors,utils=_ref.utils;colors.textColor,colors.bgColor;var actionColor=colors.actionColor;utils.toCssRgbA(actionColor||"",.06)},DEFAULTS=Object.freeze({}),getStyleVal=function(elm,css){return window.getComputedStyle(elm,null).getPropertyValue(css)},paddingDiff=function(col){if("border-box"===getStyleVal(col,"box-sizing"))return 0;var padLeft=getStyleVal(col,"padding-left"),padRight=getStyleVal(col,"padding-right");return parseInt(padLeft)+parseInt(padRight)},getRefWidthAsNumber=function(ref){return getSizeStringAsNumber(ref.style.width)},getSizeStringAsNumber=function(str){return parseInt(str.substring(0,str.length-2))},range=function(start,end){for(var array=[],inc=end-start>0,i=start;inc?i<=end:i>=end;inc?i++:i--)inc?array.push(i):array.unshift(i);return array},getRange=function(_ref){var start=_ref.start,end=_ref.end,ranges=[];return start&&end&&range(start.i,end.i).map((function(i){return range(start.j,end.j).map((function(j){return ranges.push({i:i,j:j})}))})),ranges},TableDataUtil=function(_componentData){var _this=this;this.updateComponentData=function(componentData){_this.componentData=componentData},this.getRowColumns=function(i){var _this$getRow;return null===(_this$getRow=_this.getRow(i))||void 0===_this$getRow?void 0:_this$getRow.columns},this.getRows=function(){var _this$componentData,_this$componentData$c;return null===(_this$componentData=_this.componentData)||void 0===_this$componentData||null===(_this$componentData$c=_this$componentData.config)||void 0===_this$componentData$c?void 0:_this$componentData$c.rows},this.getRow=function(i){var _this$getRows;return null===(_this$getRows=_this.getRows())||void 0===_this$getRows?void 0:_this$getRows[i]},this.getRowNum=function(){return Object.entries(_this.getRows()).length},this.getColNum=function(){return Object.entries(_this.getRowColumns(0)).length},this.getCell=function(i,j){return _this.getRow(i)&&_this.getRowColumns(i)[j]},this.getCellContent=function(i,j){var _this$getCell;return null===(_this$getCell=_this.getCell(i,j))||void 0===_this$getCell?void 0:_this$getCell.content},this.getCellStyle=function(i,j){var _this$getCell2;return null===(_this$getCell2=_this.getCell(i,j))||void 0===_this$getCell2?void 0:_this$getCell2.style},this.getColsWidth=function(){return _this.componentData.config.colsWidth},this.getRowsHeight=function(){return _this.componentData.config.rowsHeight},this.getColWidth=function(j){return _this.getColsWidth()[j]},this.getRowHeight=function(i){return _this.getRowsHeight()[i]},this.getColsMinWidth=function(){return _this.componentData.config.colsMinWidth},this.getColMinWidth=function(j){for(var colMinWidth=65,numberOfRows=_this.getRowNum(),_loop=function(i){var contentState=_this.getCellContent(i,j).getCurrentContent();contentState.getBlockMap().forEach((function(block){if("atomic"===block.type){var entityKey=block.getEntityAt(0),entity=entityKey?contentState.getEntity(entityKey):void 0,type=null==entity?void 0:entity.getType();"wix-draft-plugin-image"!==type&&"wix-draft-plugin-video"!==type||(colMinWidth=300)}}))},i=0;i<numberOfRows;i++)_loop(i);return colMinWidth},this.getCellWidthAsPixel=function(tableWidth,i,colsMinWidth){void 0===colsMinWidth&&(colsMinWidth=[]);var smallestCellIndex,smallestCellWidth,currCellWidth,colsWidthSum=_this.getColsWidth().reduce((function(acc,val){return acc+val}),0);return _this.getColsWidth().forEach((function(width,index){var cellWidth=tableWidth*(width/colsWidthSum);index===i?currCellWidth=cellWidth:cellWidth<120&&(!smallestCellWidth||smallestCellWidth>cellWidth)&&(smallestCellWidth=Math.max(colsMinWidth[index],cellWidth),smallestCellIndex=index)})),smallestCellWidth&&(currCellWidth=Math.min(120,smallestCellWidth)*(_this.getColWidth(i)/_this.getColWidth(smallestCellIndex))),Math.max(currCellWidth,colsMinWidth[i])},this.getCellWidthAsRatio=function(tableWidth,totalColsWidth,cellWidth){return totalColsWidth*cellWidth/tableWidth},this.getCellMergeData=function(i,j){var _this$getCell3;return null===(_this$getCell3=_this.getCell(i,j))||void 0===_this$getCell3?void 0:_this$getCell3.merge},this.getParentCell=function(key){var parentCell;return Object.entries(_this.getRows()).forEach((function(_ref4){var i=_ref4[0],row=_ref4[1];!parentCell&&Object.entries(row.columns).forEach((function(_ref5){var j=_ref5[0],merge=_this.getCellMergeData(i,j);(null==merge?void 0:merge.key)===key&&(parentCell=_extends({},merge,{row:i,col:j}))}))})),parentCell},this.fixSelectedWithMergeCells=function(selected){var selectedCells=getRange(selected);return selectedCells.length>1&&selectedCells.forEach((function(_ref6){var i=_ref6.i,j=_ref6.j,_ref7=_this.getCellMergeData(i,j)||{},parentCellKey=_ref7.parentCellKey,rowSpan=_ref7.rowSpan,colSpan=_ref7.colSpan,parentCell=parentCellKey&&_this.getParentCell(parentCellKey),extendSelectionBySpan=function(i,j,rowSpan,colSpan){(rowSpan>1||colSpan>1)&&[].concat(Array(rowSpan).fill(0)).forEach((function(row,rowIndex){[].concat(Array(colSpan).fill(0)).forEach((function(col,colIndex){var fixPos=function(key,newPos){var start=selected.start[key]<=selected.end[key]?selected.start:selected.end,end=selected.start[key]<=selected.end[key]?selected.end:selected.start;start[key]>newPos&&(start[key]=newPos),end[key]<newPos&&(end[key]=newPos)};fixPos("i",i+rowIndex),fixPos("j",j+colIndex)}))}))};if(parentCell){var row=parentCell.row,col=parentCell.col,_rowSpan=parentCell.rowSpan,_colSpan=parentCell.colSpan;extendSelectionBySpan(parseInt(row),parseInt(col),_rowSpan,_colSpan)}else extendSelectionBySpan(i,j,rowSpan,colSpan)})),selected},this.getCellParentPosition=function(i,j){var _ref8=_this.getCellMergeData(i,j)||{},parentCellKey=_ref8.parentCellKey,rowSpan=_ref8.rowSpan,colSpan=_ref8.colSpan;if(parentCellKey){var _this$getParentCell=_this.getParentCell(parentCellKey);return{i:_this$getParentCell.row,j:_this$getParentCell.col}}if(rowSpan>1||colSpan>1)return{i:i,j:j}},this.getRowCellsParentPosition=function(i){var parentPos;return Object.entries(_this.getRowColumns(i)).forEach((function(_ref9){var j=_ref9[0];!parentPos&&(parentPos=_this.getCellParentPosition(i,j))})),parentPos},this.getColCellsParentPosition=function(j){var parentPos;return Object.entries(_this.getRows()).forEach((function(_ref10){var i=_ref10[0];!parentPos&&(parentPos=_this.getCellParentPosition(i,j))})),parentPos},this.getRowsSelection=function(rowsIndexes){return{start:{i:rowsIndexes.start,j:0},end:{i:rowsIndexes.end,j:_this.getColNum()-1}}},this.getColsSelection=function(colsIndexes){return{start:{i:0,j:colsIndexes.start},end:{i:_this.getRowNum()-1,j:colsIndexes.end}}},this.getAllCellsSelection=function(){return{start:{i:0,j:0},end:{i:_this.getRowNum()-1,j:_this.getColNum()-1}}},this.isAllCellsSelected=function(start,end){return start&&end&&0===Math.min(start.i,end.i)&&0===Math.min(start.j,end.j)&&Math.max(start.i,end.i)===_this.getRowNum()-1&&Math.max(start.j,end.j)===_this.getColNum()-1},this.getSelectionStyle=function(selection,defaultBG,defaultBorder){var _this$getCellStyle,_this$getCellStyle2,range=getRange(selection),selectionBGColor=(null===(_this$getCellStyle=_this.getCellStyle(range[0].i,range[0].j))||void 0===_this$getCellStyle?void 0:_this$getCellStyle.backgroundColor)||defaultBG,selectionBorderColor=_this.getConsistentCellBorderColor(selection,range[0].i,range[0].j,defaultBorder),selectionVerticalAlign=(null===(_this$getCellStyle2=_this.getCellStyle(range[0].i,range[0].j))||void 0===_this$getCellStyle2?void 0:_this$getCellStyle2.verticalAlign)||"top",selectionBorderIsActive=!1;return range.forEach((function(_ref11){var _this$getCellStyle3,_this$getCellStyle4,i=_ref11.i,j=_ref11.j,currentCellBGColor=(null===(_this$getCellStyle3=_this.getCellStyle(i,j))||void 0===_this$getCellStyle3?void 0:_this$getCellStyle3.backgroundColor)||defaultBG;selectionBGColor!==currentCellBGColor&&(selectionBGColor=!1);var currentCellBorderColor=_this.getConsistentCellBorderColor(selection,i,j,selectionBorderColor);selectionBorderColor!==currentCellBorderColor&&(selectionBorderColor=!1),_this.isCellBorderActive(selection,i,j)&&(selectionBorderIsActive=!0);var currentVerticalAlign=(null===(_this$getCellStyle4=_this.getCellStyle(i,j))||void 0===_this$getCellStyle4?void 0:_this$getCellStyle4.verticalAlign)||"top";selectionVerticalAlign!==currentVerticalAlign&&(selectionVerticalAlign=!1)})),{selectionBGColor:selectionBGColor,selectionBorderColor:selectionBorderColor,selectionVerticalAlign:selectionVerticalAlign,selectionBorderIsActive:selectionBorderIsActive}},this.getSelectedRows=function(range){void 0===range&&(range=[]);var colNum=_this.getColNum();return _this.getSelectedSection(range,(function(_ref12){return{key:_ref12.i,value:_ref12.j}}),colNum)},this.getSelectedCols=function(range){void 0===range&&(range=[]);var rowNum=_this.getRowNum();return _this.getSelectedSection(range,(function(_ref13){var i=_ref13.i;return{key:_ref13.j,value:i}}),rowNum)},this.getSelectedSection=function(range,keyValueMapper,cellsNum){var selectedCells={};null==range||range.forEach((function(range){var _keyValueMapper=keyValueMapper(range),key=_keyValueMapper.key,value=_keyValueMapper.value;selectedCells[key]?selectedCells[key].push(value):selectedCells[key]=[value]}));var selected=[];return Object.entries(selectedCells).forEach((function(_ref14){var j=_ref14[0];return _ref14[1].length===cellsNum&&selected.push(j)})),selected[0]&&selected},this.getCellBorderColor=function(selection,row,col){var _this$getCell4,_this$getCell4$border,_this$getCell5,_this$getCell5$border,_this$getCell6,_this$getCell6$border,_this$getCell7,_this$getCell7$border,style={},range=getRange(selection);range.find((function(_ref15){var i=_ref15.i,j=_ref15.j;return i===row&&j===col-1}))||(style.borderLeft=null===(_this$getCell4=_this.getCell(row,col))||void 0===_this$getCell4||null===(_this$getCell4$border=_this$getCell4.border)||void 0===_this$getCell4$border?void 0:_this$getCell4$border.left);range.find((function(_ref16){var i=_ref16.i,j=_ref16.j;return i===row&&j===col+1}))||(style.borderRight=null===(_this$getCell5=_this.getCell(row,col))||void 0===_this$getCell5||null===(_this$getCell5$border=_this$getCell5.border)||void 0===_this$getCell5$border?void 0:_this$getCell5$border.right);range.find((function(_ref17){var i=_ref17.i,j=_ref17.j;return i===row-1&&j===col}))||(style.borderTop=null===(_this$getCell6=_this.getCell(row,col))||void 0===_this$getCell6||null===(_this$getCell6$border=_this$getCell6.border)||void 0===_this$getCell6$border?void 0:_this$getCell6$border.top);range.find((function(_ref18){var i=_ref18.i,j=_ref18.j;return i===row+1&&j===col}))||(style.borderBottom=null===(_this$getCell7=_this.getCell(row,col))||void 0===_this$getCell7||null===(_this$getCell7$border=_this$getCell7.border)||void 0===_this$getCell7$border?void 0:_this$getCell7$border.bottom);return Object.values(style)},this.getConsistentCellBorderColor=function(selection,row,col,defaultBorder){var borderStyles=_this.getCellBorderColor(selection,row,col);return!!borderStyles.every((function(borderStyle){return borderStyle===borderStyles[0]}))&&(borderStyles[0]?_this.getColorFromBorderStyle(borderStyles[0]):defaultBorder)},this.isCellBorderActive=function(selection,row,col){return _this.getCellBorderColor(selection,row,col).some((function(borderStyle){return void 0!==borderStyle}))},this.getColorFromBorderStyle=function(borderStyle){return borderStyle.includes("transparent")?"transparent":"#"+borderStyle.split("#")[1]},this.getCellBorders=function(selection,row,col,color){var range=getRange(selection),_ref19=_this.getCellMergeData(row,col)||{},_ref19$rowSpan=_ref19.rowSpan,rowSpan=void 0===_ref19$rowSpan?1:_ref19$rowSpan,_ref19$colSpan=_ref19.colSpan,colSpan=void 0===_ref19$colSpan?1:_ref19$colSpan,borderColor=color||"var(--ricos-settings-action-color, var(--ricos-action-color, #0261ff))",borders={};return range.find((function(_ref20){var i=_ref20.i,j=_ref20.j;return i===row&&j===col-1}))||(borders.left=borderColor),range.find((function(_ref21){var i=_ref21.i,j=_ref21.j;return i===row&&j===col+colSpan}))||(borders.right=borderColor),range.find((function(_ref22){var i=_ref22.i,j=_ref22.j;return i===row-1&&j===col}))||(borders.top=borderColor),range.find((function(_ref23){var i=_ref23.i,j=_ref23.j;return i===row+rowSpan&&j===col}))||(borders.bottom=borderColor),borders},this.getRowHeader=function(){return _this.componentData.config.rowHeader},this.getColHeader=function(){return _this.componentData.config.colHeader},this.isCellContainedInHeader=function(i,j){return 0===i&&_this.getRowHeader()||0===j&&_this.getColHeader()},this.updateComponentData(_componentData)},styles$4_borderT="_3_Ps8",styles$4_borderB="_1_558",styles$4_borderL="hp7Fj",styles$4_borderR="vjkf7",CellBorders=function(_ref){var borders=_ref.borders;return[borders.top&&React.createElement("div",{key:"top",style:{background:borders.top},className:styles$4_borderT}),borders.bottom&&React.createElement("div",{key:"bottom",style:{background:borders.bottom},className:styles$4_borderB}),borders.right&&React.createElement("div",{key:"right",style:{background:borders.right},className:styles$4_borderR}),borders.left&&React.createElement("div",{key:"left",style:{background:borders.left},className:styles$4_borderL})]},tableKeysToIgnoreOnEdit=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Cell=function(_Component){function Cell(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).selectCellContent=function(){var _this$props=_this.props,row=_this$props.row,col=_this$props.col,selectCellContent=_this$props.selectCellContent;!_this$props.isMobile&&(null==selectCellContent||selectCellContent(row,col))},_this.isSingleCellSelected=function(selectedCells){var _selectedCells,_selectedCells$start,_selectedCells2,_selectedCells2$end,_selectedCells3,_selectedCells3$start,_selectedCells4,_selectedCells4$end;return void 0===selectedCells&&(selectedCells={}),(null===(_selectedCells=selectedCells)||void 0===_selectedCells||null===(_selectedCells$start=_selectedCells.start)||void 0===_selectedCells$start?void 0:_selectedCells$start.i)===(null===(_selectedCells2=selectedCells)||void 0===_selectedCells2||null===(_selectedCells2$end=_selectedCells2.end)||void 0===_selectedCells2$end?void 0:_selectedCells2$end.i)&&(null===(_selectedCells3=selectedCells)||void 0===_selectedCells3||null===(_selectedCells3$start=_selectedCells3.start)||void 0===_selectedCells3$start?void 0:_selectedCells3$start.j)===(null===(_selectedCells4=selectedCells)||void 0===_selectedCells4||null===(_selectedCells4$end=_selectedCells4.end)||void 0===_selectedCells4$end?void 0:_selectedCells4$end.j)},_this.isEditing=function(editing,selectedCells){return editing&&_this.isSingleCellSelected(selectedCells)},_this.setEditorRef=function(ref){var _this$props2=_this.props,setEditorRef=_this$props2.setEditorRef,row=_this$props2.row,col=_this$props2.col;_this.editorRef=ref,setEditorRef&&setEditorRef(ref,row,col)},_this.setTdRef=function(ref){return _this.tdRef=ref},_this.getToolbarPosition=function(){if(_this.tdRef){var cellOffsetLeft=_this.tdRef.offsetLeft;return{x:0,containerWidth:_this.props.tableWidth,offsetLeftInsideContainer:cellOffsetLeft}}},_this.onKeydown=function(e){var _this$props3=_this.props,editing=_this$props3.editing,onKeyDown=_this$props3.onKeyDown,isMobile=_this$props3.isMobile;if(editing&&!isMobile){("Backspace"===e.key||"a"===e.key&&(e.ctrlKey||e.metaKey))&&e.stopPropagation();var shouldCreateNewLine="Enter"===e.key&&(e.altKey||e.shiftKey||e.metaKey);tableKeysToIgnoreOnEdit.includes(e.key)||shouldCreateNewLine||onKeyDown(e)}else!editing&&tableKeysToIgnoreOnEdit.includes(e.key)&&(onKeyDown(e),e.stopPropagation(),e.preventDefault())},_this.fixReactModalButtons=function(toolbarButtons){Object.values(toolbarButtons).forEach((function(buttonsProps){"DROPDOWN"===buttonsProps.type&&(buttonsProps.type="modal")}))},_this.getEditorWrapperStyle=function(additionalStyles,isEditing){var shouldSetEditStyle=!_this.props.isMobile&&isEditing,style=shouldSetEditStyle?_extends({minHeight:_this.tdHeight},additionalStyles):{},verticalAlign=additionalStyles.verticalAlign;return shouldSetEditStyle&&verticalAlign&&(style.display="flex","middle"===verticalAlign?style.alignItems="center":"bottom"===verticalAlign&&(style.alignItems="flex-end")),style},_this.getCellBorders=function(cellBorders,shouldShowSelectedStyle){var _this$props4=_this.props,table=_this$props4.table,selectedCells=_this$props4.selectedCells,row=_this$props4.row,col=_this$props4.col,disableSelectedStyle=_this$props4.disableSelectedStyle,isMobile=_this$props4.isMobile,selected=_this$props4.selected,cellSelectionBorders=table.getCellBorders(selectedCells,row,col),borders={};return disableSelectedStyle&&selected?Object.entries(cellBorders).forEach((function(_ref){var key=_ref[0],val=_ref[1];!cellSelectionBorders[key]&&(borders[key]=val)})):borders=cellBorders,!isMobile&&shouldShowSelectedStyle?_extends({},borders,cellSelectionBorders):borders},_this.hideBlocks=function(){var _this$props5=_this.props,row=_this$props5.row,col=_this$props5.col,table=_this$props5.table,setEditorRef=_this$props5.setEditorRef,editorState=table.getCellContent(row,col),blocks=setEditorRef?editorState.getCurrentContent().getBlocksAsArray():editorState.blocks;if(blocks.length>=3){var lastBlockText,firstBlockText;if(setEditorRef){var currentContent=editorState.getCurrentContent();lastBlockText=currentContent.getLastBlock().getText(),firstBlockText=currentContent.getFirstBlock().getText()}else lastBlockText=blocks[blocks.length-1].text,firstBlockText=blocks[0].text;return{hideFirstBlock:""===firstBlockText||"​"===firstBlockText,hideLastBlock:""===lastBlockText||"​"===lastBlockText}}return{}},_this.onCellClick=function(){return _this.props.isMobile&&_this.props.onDoubleClick()},_this}_inheritsLoose(Cell,_Component);var _proto=Cell.prototype;return _proto.componentDidUpdate=function(prevProps){var _this$editorRef,_this$tdRef,isCellWasEditing=this.isEditing(prevProps.editing,prevProps.selectedCells),isCellEditing=this.isEditing(this.props.editing,this.props.selectedCells),isGoIntoEdit=!isCellWasEditing&&isCellEditing,isGoOutFromEdit=isCellWasEditing&&!isCellEditing,_this$props6=this.props,selectedCells=_this$props6.selectedCells,isMobile=_this$props6.isMobile,setEditingActive=_this$props6.setEditingActive,toolbarRef=_this$props6.toolbarRef;(isGoIntoEdit?(this.editorRef.focus(),setEditingActive(!0),this.selectCellContent()):isGoOutFromEdit&&(setEditingActive(!1),null==toolbarRef||toolbarRef.setEditingTextFormattingToolbarProps(!1),this.selectCellContent()),!this.props.selected||prevProps.selected||isCellEditing||isMobile)||(this.selectCellContent(),selectedCells&&1===getRange(selectedCells).length&&(null===(_this$editorRef=this.editorRef)||void 0===_this$editorRef||_this$editorRef.focus()),this.tdHeight=(null===(_this$tdRef=this.tdRef)||void 0===_this$tdRef?void 0:_this$tdRef.offsetHeight)-1)},_proto.render=function(){var _this$tdRef2,_this$props7=this.props,row=_this$props7.row,col=_this$props7.col,style=_this$props7.style,onMouseDown=_this$props7.onMouseDown,onMouseOver=_this$props7.onMouseOver,onDoubleClick=_this$props7.onDoubleClick,editing=_this$props7.editing,onContextMenu=_this$props7.onContextMenu,children=_this$props7.children,selected=_this$props7.selected,selectedCells=_this$props7.selectedCells,table=_this$props7.table,isMobile=_this$props7.isMobile,disableSelectedStyle=_this$props7.disableSelectedStyle,setEditorRef=_this$props7.setEditorRef,selectCellContent=_this$props7.selectCellContent,_ref2=table.getCell(row,col)||{},_ref2$style=_ref2.style,additionalStyles=void 0===_ref2$style?{}:_ref2$style,_ref2$merge=_ref2.merge,merge=void 0===_ref2$merge?{}:_ref2$merge,_ref2$border=_ref2.border,border=void 0===_ref2$border?{}:_ref2$border,_merge$colSpan=merge.colSpan,colSpan=void 0===_merge$colSpan?1:_merge$colSpan,_merge$rowSpan=merge.rowSpan,rowSpan=void 0===_merge$rowSpan?1:_merge$rowSpan,parentCellKey=merge.parentCellKey,isEditing=this.isEditing(editing,selectedCells),shouldShowSelectedStyle=selected&&!disableSelectedStyle&&!isEditing,range=selectedCells&&getRange(selectedCells),cellBorders=this.getCellBorders(border,shouldShowSelectedStyle),isContainedInHeader=table.isCellContainedInHeader(row,col),Tag=isContainedInHeader?"th":"td",editorState=this.editorRef&&isEditing&&table.getCellContent(row,col),Selection=editorState&&editorState.getSelection(),cellContentContainText=!!editorState&&editorState.getCurrentContent().getBlockMap().filter((function(x){return"unstyled"===x.getType()})).some((function(x){return""!==x.getText()&&"​"!==x.getText()}));if(this.editorRef&&isEditing&&(!Selection.isCollapsed()&&Selection.getHasFocus()||document&&document.querySelector('[data-id="rich-content-editor-modal"]'))&&cellContentContainText){var _this$editorRef2,_this$editorRef2$getT,_this$props$toolbarRe,toolbarButtons=cloneDeep(null===(_this$editorRef2=this.editorRef)||void 0===_this$editorRef2||null===(_this$editorRef2$getT=_this$editorRef2.getToolbarProps)||void 0===_this$editorRef2$getT?void 0:_this$editorRef2$getT.call(_this$editorRef2,ToolbarType.FORMATTING));toolbarButtons&&this.fixReactModalButtons(toolbarButtons),null===(_this$props$toolbarRe=this.props.toolbarRef)||void 0===_this$props$toolbarRe||_this$props$toolbarRe.setEditingTextFormattingToolbarProps(toolbarButtons)}else if(isEditing){var _this$props$toolbarRe2;null===(_this$props$toolbarRe2=this.props.toolbarRef)||void 0===_this$props$toolbarRe2||_this$props$toolbarRe2.setEditingTextFormattingToolbarProps(!1)}var editorWrapperStyle=this.getEditorWrapperStyle(additionalStyles,isEditing),_this$hideBlocks=this.hideBlocks(),hideFirstBlock=_this$hideBlocks.hideFirstBlock,hideLastBlock=_this$hideBlocks.hideLastBlock;return parentCellKey?null:React.createElement(Tag,{"data-hook":"table-plugin-cell",ref:this.setTdRef,className:classNames(styles$5_cell,isContainedInHeader&&styles$5_header,shouldShowSelectedStyle&&!isEditing&&styles$5_selected),onMouseDown:onMouseDown,onMouseOver:onMouseOver,onDoubleClick:onDoubleClick,onClick:this.onCellClick,onContextMenu:onContextMenu,colSpan:colSpan,rowSpan:rowSpan,style:_extends({},style,additionalStyles),onKeyDown:this.onKeydown},React.createElement("div",{className:classNames(setEditorRef?styles$5_editorWrapper:styles$5_viewerWrapper,!isEditing&&hideFirstBlock&&styles$5_hideFirstBlock,!isEditing&&hideLastBlock&&styles$5_hideLastBlock,!isMobile&&isEditing&&styles$5_editing,!isEditing&&styles$5_disableSelection),style:editorWrapperStyle},React.createElement(Editor,{editing:isMobile?selected:isEditing,selected:selected,contentState:table.getCellContent(row,col),setEditorRef:this.setEditorRef,isEditor:selectCellContent},children)),React.createElement(CellBorders,{borders:cellBorders}),React.createElement("div",{style:{height:shouldShowSelectedStyle?null===(_this$tdRef2=this.tdRef)||void 0===_this$tdRef2?void 0:_this$tdRef2.offsetHeight:0},className:classNames(shouldShowSelectedStyle&&styles$5_selected,1===(null==range?void 0:range.length)&&styles$5_singleSelection)}))},Cell}(Component),Editor=function(_Component2){function Editor(){for(var _this2,_len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return(_this2=_Component2.call.apply(_Component2,[this].concat(args))||this).setEditorRef=function(ref){_this2.editor=ref,_this2.props.setEditorRef(ref)},_this2}_inheritsLoose(Editor,_Component2);var _proto2=Editor.prototype;return _proto2.shouldComponentUpdate=function(nextProps){var _this$props8=this.props,editing=_this$props8.editing,selected=_this$props8.selected,isContentStateChanged=_this$props8.contentState!==nextProps.contentState;return editing||nextProps.editing||selected||isContentStateChanged},_proto2.render=function(){var _this$props9=this.props,children=_this$props9.children,editing=_this$props9.editing,selected=_this$props9.selected;return React.createElement("div",{className:classNames(styles$5_editor,editing?styles$5_edit:styles$5_view)},React.cloneElement(children,{ref:this.setEditorRef,editing:editing,readOnly:!editing&&!selected}))},Editor}(Component),RowRenderer=function(_Component){function RowRenderer(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).setRef=function(ref){var _this$props$setRowRef,_this$props;return null===(_this$props$setRowRef=(_this$props=_this.props).setRowRef)||void 0===_this$props$setRowRef?void 0:_this$props$setRowRef.call(_this$props,ref,_this.props.row)},_this}_inheritsLoose(RowRenderer,_Component);var _proto=RowRenderer.prototype;return _proto.shouldComponentUpdate=function(nextProps){var _nextProps$rowsToUpda;return(null===(_nextProps$rowsToUpda=nextProps.rowsToUpdate)||void 0===_nextProps$rowsToUpda?void 0:_nextProps$rowsToUpda.includes(nextProps.row))||!1},_proto.render=function(){var _this$props2=this.props,row=_this$props2.row,children=_this$props2.children,height=(0,_this$props2.getRowHeight)(row);return React.createElement("tr",{style:{height:height},ref:this.setRef},children)},RowRenderer}(Component),styles$3_viewMode="ZZwd4",styles$3_editMode="_33jXB",styles$3_container="_3S0Qj",styles$2_container="_4OA5y",styles$2_dragAndDrop="ZDIH5",styles$2_active="_13BUy",styles$2_selectAll="Sx3Cc",styles$2_dragging="_1lPd9",styles$2_horizontal="gP4sA",styles$2_selectPreview="-unpA",styles$2_vertical="_12B1r",DragAndDropSection=function(_React$Component){function DragAndDropSection(props){var _this;return(_this=_React$Component.call(this,props)||this).removeShiftKey=function(){return _this.shiftKey=!1},_this.setShiftKey=function(e){return"Shift"===e.key&&(_this.shiftKey=!0)},_this.onDragMouseDown=function(e,i){_this.curDrag=e.target,_this.startPoint=_this.getEventDiff(e),_this.isActive(i)?_this.clickedOnActiveDrag=!0:(_this.drags={},_this.shiftKey&&_this.props.activeDrag?(_this.drags.start=Math.min(i,_this.props.activeDrag[0]),_this.drags.end=Math.max(i,_this.props.activeDrag[_this.props.activeDrag.length-1])):(_this.drags.start=i,_this.drags.end=i),_this.props.onDragClick(_this.drags))},_this.getEventDiff=function(e){return _this.props.horizontal?e.pageX:e.pageY},_this.onMouseMove=function(e){if(_this.curDrag&&(_this.isDragging||Math.abs(_this.startPoint-_this.getEventDiff(e))>25)){var activeDrag=_this.props.activeDrag;_this.isDragging=!0,_this.drags={start:Math.min.apply(Math,activeDrag),end:Math.max.apply(Math,activeDrag)},_this.props.onDrag(e,_this.drags)}},_this.onMouseUp=function(e){_this.clickedOnActiveDrag&&(_this.props.onDragClick(),_this.clickedOnActiveDrag=!1),_this.curDrag&&(_this.curDrag=void 0,_this.isDragging&&(_this.isDragging=void 0,_this.props.onDragEnd(e,_this.drags),_this.drags=null))},_this.isActive=function(i){var _this$props$activeDra;return null===(_this$props$activeDra=_this.props.activeDrag)||void 0===_this$props$activeDra?void 0:_this$props$activeDra.includes(i)},_this.getSelectedPreviewStyle=function(){var _this$props=_this.props,size=_this$props.size,horizontal=_this$props.horizontal,index=_this$props.index,selectAll=_this$props.selectAll,selectPreviewStyle={visibility:_this.isActive(index)&&(selectAll?horizontal:!selectAll)&&"visible"};return horizontal?(selectPreviewStyle.height=size?size-20:0,_this.isActive(index+1)&&(selectPreviewStyle.borderRight="none"),_this.isActive(index-1)&&(selectPreviewStyle.borderLeft="none")):(selectPreviewStyle.width=size,_this.isActive(index+1)&&(selectPreviewStyle.borderBottom="none"),_this.isActive(index-1)&&(selectPreviewStyle.borderTop="none")),selectPreviewStyle},_this.state={},_this}_inheritsLoose(DragAndDropSection,_React$Component);var _proto=DragAndDropSection.prototype;return _proto.componentDidMount=function(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("keydown",this.setShiftKey),document.addEventListener("keyup",this.removeShiftKey)},_proto.componentWillUnmount=function(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("keydown",this.setShiftKey),document.removeEventListener("keyup",this.removeShiftKey)},_proto.render=function(){var _this2=this,_this$props2=this.props,horizontal=_this$props2.horizontal,selectAll=_this$props2.selectAll,index=_this$props2.index,isActive=this.isActive(index),selectPreviewStyle=this.getSelectedPreviewStyle();return React.createElement("div",{className:styles$2_container},React.createElement("div",{className:classNames(styles$2_dragAndDrop,isActive&&styles$2_active,selectAll&&styles$2_selectAll,this.isDragging&&styles$2_dragging),onMouseDown:function(e){return _this2.onDragMouseDown(e,index)},"data-hook":(horizontal?"col":"row")+"Drag-"+index},React.createElement(DragAndDropIcon,{className:classNames(horizontal&&styles$2_horizontal),style:{visibility:!selectAll&&isActive&&"visible",cursor:this.isDragging?"grabbing":"grab"}})),React.createElement("div",{className:classNames(styles$2_selectPreview,!horizontal&&styles$2_vertical),style:selectPreviewStyle}))},DragAndDropSection}(React.Component),styles$1_resizer="_1cjMQ",styles$1_horizonResizer="_39fAd",styles$1_verticalResizer="_1QWyO",styles$1_highlightOnly="_2S_Jx",Resizer=function(_PureComponent){function Resizer(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_PureComponent.call.apply(_PureComponent,[this].concat(args))||this).getPosition=function(e){return _this.props.horizontal?e.pageX:e.pageY},_this.getSize=function(){return _this.props.horizontal?_this.curTarget.offsetWidth:_this.curTarget.offsetHeight},_this.setNewSize=function(ref,size){return _this.props.horizontal?ref.style.width=size:ref.style.height=size},_this.setMinSize=function(ref,size){return ref.style.minWidth=size},_this.onMouseDown=function(e){var _this$props=_this.props,horizontal=_this$props.horizontal,size=_this$props.size,onResizeStart=_this$props.onResizeStart,index=_this$props.index,itemsRefs=_this$props.itemsRefs;horizontal?_this.ref.style.height=size+"px":_this.ref.style.width=size+"px",e.stopPropagation(),_this.curTarget=itemsRefs[index],_this.siblingCell=horizontal&&itemsRefs[index+1],_this.position=_this.getPosition(e);var padding=paddingDiff(_this.curTarget);_this.curSize=horizontal?getRefWidthAsNumber(_this.curTarget):_this.getSize()-padding,_this.siblingSize=_this.siblingCell&&getRefWidthAsNumber(_this.siblingCell),onResizeStart()},_this.onMouseMove=function(e){if(_this.curTarget){var diff=_this.getPosition(e)-_this.position,newSize=_this.curSize+diff,_this$props2=_this.props,minSize=_this$props2.minSize,setContainerSize=_this$props2.setContainerSize,horizontal=_this$props2.horizontal,overflowWidth=_this$props2.overflowWidth;if(newSize>=minSize&&(horizontal&&newSize<120&&_this.setMinSize(_this.curTarget,newSize+"px"),_this.setNewSize(_this.curTarget,newSize+"px"),setContainerSize&&setContainerSize(newSize+"px",_this.props.index),diff>0||diff<=0&&overflowWidth<=0)){var siblingNewSize=_this.siblingSize-diff;siblingNewSize&&siblingNewSize>=120&&_this.setNewSize(_this.siblingCell,siblingNewSize+"px")}}},_this.onMouseUp=function(){var _this$props3=_this.props,horizontal=_this$props3.horizontal,onResize=_this$props3.onResize,index=_this$props3.index,itemsRefs=_this$props3.itemsRefs,minSize=_this$props3.minSize;if(horizontal?_this.ref.style.height="20px":_this.ref.style.width="20px",horizontal&&_this.curTarget){var cellWidth=getRefWidthAsNumber(_this.curTarget),siblingWidth=_this.siblingCell&&getRefWidthAsNumber(_this.siblingCell);cellWidth<minSize&&(_this.curTarget.style.minWidth=cellWidth),siblingWidth&&siblingWidth<minSize&&(_this.siblingCell.style.minWidth=siblingWidth)}_this.curTarget&&_this.position&&_this.curSize&&(horizontal?onResize(itemsRefs):onResize(index,_this.getSize()),_this.curTarget=void 0,_this.position=void 0,_this.curSize=void 0)},_this.getResizerStyle=function(){var _this$props4=_this.props,horizontal=_this$props4.horizontal,highlightResizer=_this$props4.highlightResizer,index=_this$props4.index,size=_this$props4.size,style={};return highlightResizer===index&&(style=horizontal?{height:size,borderRight:"1px solid #0000ff"}:{width:size,borderBottom:"1px solid #0000ff",zIndex:3}),style},_this.setRef=function(ref){return _this.ref=ref},_this}_inheritsLoose(Resizer,_PureComponent);var _proto=Resizer.prototype;return _proto.componentDidMount=function(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)},_proto.componentWillUnmount=function(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)},_proto.render=function(){var resizerStyle=this.getResizerStyle();return React.createElement("div",{className:classNames(styles$1_resizer,this.props.highlightOnly&&styles$1_highlightOnly,this.props.horizontal?styles$1_horizonResizer:styles$1_verticalResizer),style:resizerStyle,onMouseDown:this.onMouseDown,ref:this.setRef})},Resizer}(PureComponent),styles_container="_2VbQq",styles_selected="_2ScdR",styles_selectAll="_24hfp",Columns=function(_PureComponent){function Columns(){return _PureComponent.apply(this,arguments)||this}return _inheritsLoose(Columns,_PureComponent),Columns.prototype.render=function(){var _this$props=this.props,colNum=_this$props.colNum,colDragProps=_this$props.colDragProps,activeDrag=_this$props.activeDrag,selectAll=_this$props.selectAll,size=_this$props.size,onResize=_this$props.onResize,highlightResizer=_this$props.highlightResizer,onResizeStart=_this$props.onResizeStart,columnsRefs=_this$props.columnsRefs,tableOverflowWidth=_this$props.tableOverflowWidth;return React.createElement("tr",null,[].concat(Array(colNum).fill(0)).map((function(row,i){return React.createElement("td",{key:"column"+i,className:classNames(styles_container,selectAll&&styles_selectAll,(null==activeDrag?void 0:activeDrag.includes(i))&&styles_selected)},React.createElement(DragAndDropSection,_extends({},colDragProps,{horizontal:!0,index:i,activeDrag:activeDrag,selectAll:selectAll,size:size})),onResize&&React.createElement(Resizer,{onResize:onResize,highlightResizer:highlightResizer,horizontal:!0,minSize:65,index:i,size:size,onResizeStart:onResizeStart,itemsRefs:columnsRefs,overflowWidth:tableOverflowWidth}))})))},Columns}(PureComponent),TableRenderer=function(_PureComponent){function TableRenderer(props){var _this;return(_this=_PureComponent.call(this,props)||this).onResizeWindow=debounce((function(){_this.setState({windowWidth:window.innerWidth});var _this$props=_this.props,table=_this$props.table,tableRef=_this$props.tableRef;tableRef.offsetWidth&&_this.columns.forEach((function(col,i){var width=table.getCellWidthAsPixel(tableRef.offsetWidth-1,i,table.getColsMinWidth());col&&(col.style.width=width+"px")}))}),60),_this.columns=[props.table.getColNum()],_this}_inheritsLoose(TableRenderer,_PureComponent);var _proto=TableRenderer.prototype;return _proto.componentDidMount=function(){window.addEventListener("resize",this.onResizeWindow)},_proto.componentWillUnmount=function(){window.removeEventListener("resize",this.onResizeWindow)},_proto.render=function(){var _table$getSelectedCol,_this2=this,_this$props2=this.props,children=_this$props2.children,tableRef=_this$props2.tableRef,table=_this$props2.table,colDragProps=_this$props2.colDragProps,onResize=_this$props2.onResize,onResizeStart=_this$props2.onResizeStart,highlightResizer=_this$props2.highlightResizer,selected=_this$props2.selected,selectAll=_this$props2.selectAll,tableHeight=_this$props2.tableHeight,isEditMode=_this$props2.isEditMode,isEditingActive=_this$props2.isEditingActive,tableOverflowWidth=_this$props2.tableOverflowWidth,range=selected&&getRange(selected),colsMinWidth=table.getColsMinWidth();return this.columns=this.columns.filter((function(elem){return elem.parentElement})),React.createElement("table",{className:styles$3_container},React.createElement("colgroup",null,table.getColsWidth().map((function(cellWidth,i){return React.createElement("col",{key:i,ref:function(_ref){return _ref&&(_this2.columns[i]=_ref)},style:{width:null!=tableRef&&tableRef.offsetWidth?table.getCellWidthAsPixel(tableRef.offsetWidth-1,i,colsMinWidth):cellWidth,minWidth:(null==colsMinWidth?void 0:colsMinWidth[i])||120}})}))),React.createElement("thead",null,isEditMode&&React.createElement(Columns,{colDragProps:colDragProps,colNum:table.getColNum(),onResize:onResize,onResizeStart:onResizeStart,highlightResizer:highlightResizer,activeDrag:isEditingActive?[]:null===(_table$getSelectedCol=table.getSelectedCols(range))||void 0===_table$getSelectedCol?void 0:_table$getSelectedCol.map((function(i){return parseInt(i)})),selectAll:selectAll,size:tableHeight,tableWidth:null==tableRef?void 0:tableRef.offsetWidth,columnsRefs:this.columns,tableOverflowWidth:tableOverflowWidth})),React.createElement("tbody",null,children))},TableRenderer}(PureComponent),TABLE_TYPE="wix-rich-content-plugin-table",TableViewer=function(_Component){function TableViewer(_props){var _this;return(_this=_Component.call(this,_props)||this).cellCreator=function(i,j){return{key:i+"-"+j,component:_this.renderCell(i,j),forceComponent:!0,disableUpdatedFlag:!0}},_this.renderCell=function(i,j){var _this$props=_this.props,renderInnerRCE=_this$props.renderInnerRCE,innerRCV=_this$props.innerRCV;return renderInnerRCE?renderInnerRCE(i,j):innerRCV({contentState:_this.table.getCellContent(i,j),renderedIn:TABLE_TYPE})},_this.createRow=function(i,columnsNumber){return[].concat(Array(columnsNumber).fill(0)).map((function(cell,j){return _this.cellCreator(i,j)}))},_this.sheetRenderer=function(props){return React.createElement(TableRenderer,_extends({},props,{table:_this.table,tableRef:_this.tableViewerRef,colDragProps:_this.props.colDragProps,onResize:_this.props.onResize,onResizeStart:_this.props.onResizeStart,highlightResizer:_this.props.highlightResizer,selectAll:_this.props.selectAll,tableHeight:_this.props.tableHeight,selected:_this.props.selected,isEditMode:_this.props.isEditMode,isEditingActive:_this.props.isEditingActive,tableOverflowWidth:_this.props.tableOverflowWidth}))},_this.rowRenderer=function(props){return React.createElement(RowRenderer,_extends({},props,{getRowHeight:_this.table.getRowHeight,setRowRef:_this.props.setRowRef,rowsToUpdate:_this.props.rowsToUpdate}))},_this.setCellRef=function(ref){return _this.cellRef=ref},_this.setTableViewerRef=function(ref){_this.tableViewerRef=ref,_this.state.isTableRefSet||_this.setState({isTableRefSet:!0})},_this.cellRenderer=function(props){var _this$props2=_this.props,setEditorRef=_this$props2.setEditorRef,toolbarRef=_this$props2.toolbarRef,setEditingActive=_this$props2.setEditingActive,tableWidth=_this$props2.tableWidth,isMobile=_this$props2.isMobile,_this$props2$selected=_this$props2.selected,selected=void 0===_this$props2$selected?{}:_this$props2$selected,disableSelectedStyle=_this$props2.disableSelectedStyle,t=_this$props2.t,selectCellContent=_this$props2.selectCellContent;return React.createElement(Cell,_extends({},props,{ref:_this.setCellRef,table:_this.table,setEditorRef:setEditorRef,toolbarRef:toolbarRef,selectedCells:selected,setEditingActive:setEditingActive,tableWidth:tableWidth,isMobile:isMobile,disableSelectedStyle:disableSelectedStyle,t:t,selectCellContent:selectCellContent}))},_this.valueRenderer=function(cell){return cell.component},_this.table=_this.props.table||new TableDataUtil(_props.componentData),_this.state={},_this}_inheritsLoose(TableViewer,_Component);var _proto=TableViewer.prototype;return _proto.componentDidMount=function(){this.tableViewerRef.children[0].classList.add("has-custom-focus")},_proto.render=function(){var _this2=this,_this$props3=this.props,onSelect=_this$props3.onSelect,selected=_this$props3.selected,isEditMode=_this$props3.isEditMode,setCellContent=_this$props3.setCellContent,onClear=_this$props3.onClear,onPaste=_this$props3.onPaste,rowNum=this.table.getRowNum(),colNum=this.table.getColNum(),grid=[].concat(Array(rowNum).fill(0)).map((function(row,i){return _this2.createRow(i,colNum)}));return React.createElement("div",{className:classNames(isEditMode?styles$3_editMode:styles$3_viewMode),ref:this.setTableViewerRef},React.createElement(DataSheet,{data:grid,valueRenderer:this.valueRenderer,onSelect:onSelect,selected:selected||{},cellRenderer:this.cellRenderer,rowRenderer:this.rowRenderer,sheetRenderer:this.sheetRenderer,onClear:onClear,getCellContent:this.table.getCellContent,setCellContent:setCellContent,onPaste:onPaste}))},TableViewer}(Component),typeMapper=function(){var _ref;return(_ref={})[TABLE_TYPE]={component:TableViewer,withHorizontalScroll:!0},_ref},pluginTable=function(config){return{config:_extends({},DEFAULTS.config,config),type:TABLE_TYPE,typeMapper:typeMapper,theme:theme}};export{TABLE_TYPE,pluginTable,typeMapper as tableTypeMapper};
//# sourceMappingURL=module.viewer.js.map

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

export declare const DEFAULTS: Readonly<{
type: string;
config: {};
}>;
import { ThemeGeneratorFunction } from 'wix-rich-content-common';
import { TablePluginViewerConfig } from './types';
export declare const getColors: () => any;
export declare const theme: ThemeGeneratorFunction;
export declare const DEFAULTS: TablePluginViewerConfig;
//# sourceMappingURL=defaults.d.ts.map

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

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

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

export { createLineSpacingPlugin } from './createLineSpacingPlugin';
export { LINE_SPACING_TYPE } from './types';
export { createTablePlugin } from './createTablePlugin';
export { default as tableViewer } from './table-viewer';
export { TABLE_TYPE } from './types';
export { pluginTable } from './editor';
export { Modals, ModalsMap } from './modals';
export { pluginLineSpacing } from './editor';
//# sourceMappingURL=index.d.ts.map

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

import LineSpacingPanel from './toolbar/LineSpacingPanel';
import tableSettingsModal from './toolbar/tableSettingsModal';
declare const Modals: {
LINE_SPACING: string;
TABLE_SETTINGS: string;
};
declare const ModalsMap: {
[x: string]: typeof LineSpacingPanel;
[x: string]: typeof tableSettingsModal;
};
export { Modals, ModalsMap };
//# sourceMappingURL=modals.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 TABLE_TYPE = "wix-rich-content-plugin-table";
export interface TablePluginEditorConfig extends EditorPluginConfig {
[key: string]: any;
}
export interface LineSpacingPluginViewerConfig extends ViewerPluginConfig {
export interface TablePluginViewerConfig extends ViewerPluginConfig {
[key: string]: any;
}
//# sourceMappingURL=types.d.ts.map

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

import { LineSpacingPluginViewerConfig } from './types';
import { typeMapper } from './typeMapper';
import { TABLE_TYPE, TablePluginViewerConfig } from './types';
import { ViewerPluginCreator } from 'wix-rich-content-common';
export declare const pluginLineSpacing: ViewerPluginCreator<LineSpacingPluginViewerConfig>;
export { TABLE_TYPE, typeMapper as tableTypeMapper };
export declare const pluginTable: ViewerPluginCreator<TablePluginViewerConfig>;
//# sourceMappingURL=viewer.d.ts.map

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

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc