wix-rich-content-toolbars-ui
Advanced tools
Comparing version 8.71.47 to 8.71.48
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),cx=require("classnames"),_extends=require("@babel/runtime/helpers/extends"),Tooltip=require("wix-rich-content-common/libs/Tooltip"),ricosContext=require("ricos-context"),wixRichContentCommon=require("wix-rich-content-common"),wixRichContentUiComponents=require("wix-rich-content-ui-components"),wixRichContentEditor=require("wix-rich-content-editor"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),ricosModals=require("ricos-modals");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),cx__default=_interopDefaultLegacy(cx),_extends__default=_interopDefaultLegacy(_extends),Tooltip__default=_interopDefaultLegacy(Tooltip);function styleInject(css,ref){void 0===ref&&(ref={});var insertAt=ref.insertAt;if(css&&"undefined"!=typeof document){var head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css","top"===insertAt&&head.firstChild?head.insertBefore(style,head.firstChild):head.appendChild(style),style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css))}}var styles$5_dropdownModalButtonWrapper="_3AWpK",styles$5_mobileDropdownModalButtonWrapper="_1h1be",styles$5_dropdownModalButton="_1lUT8",styles$5_mobileDropdownModalButton="_3Uqyy",styles$5_modal="_1INEN";styleInject("._3AWpK{color:var(--ricos-settings-text-color,#000)}[dir] ._3AWpK{background:transparent;padding:4px;cursor:pointer}[dir] ._3AWpK:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}._3AWpK._3BTSj{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3AWpK._3BTSj{background-color:rgba(var(--ricos-action-color-fallback-tuple,2,97,255),.1)}._3AWpK._3BTSj svg{fill:var(--ricos-settings-icons-color,currentColor);color:var(--ricos-settings-icons-color,currentColor)}[dir] ._3AWpK._1h1be:not(._3BTSj):hover{background-color:unset}._1lUT8{display:flex;align-items:center;justify-content:center;height:20px;min-width:20px;gap:8px}._1lUT8._3Uqyy{height:32px;min-width:32px}._1INEN{display:flex;flex-direction:column;z-index:10;width:162px;box-sizing:border-box}[dir] ._1INEN{box-shadow:0 0 10px 0 rgba(0,0,0,.06);border:1px solid rgba(51,51,51,.1);border-radius:2px;background-color:#fff}._1INEN *,._1INEN :after,._1INEN :before{box-sizing:inherit}._1INEN input{box-sizing:border-box}@media only screen and (max-width:640px){._1INEN{width:100%}}");var DropdownArrowIcon=function(){return React__default.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"6",viewBox:"0 0 8 6"},React__default.default.createElement("g",{fill:"none",fillRule:"evenodd"},React__default.default.createElement("g",{fill:"currentColor"},React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M2.873 1.873L-1.127 5.367 -0.469 6.127 2.873 3.207 6.216 6.127 6.873 5.367z",transform:"translate(-439.000000, -84.000000) translate(437.000000, 77.000000) translate(6.000000, 10.000000) rotate(-270.000000) translate(-6.000000, -10.000000) translate(3.500000, 6.000000) translate(2.873490, 4.000000) scale(1, -1) rotate(90.000000) translate(-2.873490, -4.000000)"}))))))},TrashIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({xmlnsXlink:"http://www.w3.org/1999/xlink",width:"19",height:"19",viewBox:"0 0 19 19"},props),React__default.default.createElement("defs",null,React__default.default.createElement("path",{id:"trash-icon-path",d:"M15 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5h-.8a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h12.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H15zm-1 0H5v10.8c0 .11.09.2.2.2h8.6a.2.2 0 0 0 .2-.2V5zM7.2 7h.6c.11 0 .2.09.2.2v6.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zm4 0h.6c.11 0 .2.09.2.2v6.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zM6.857 3v1H6V3a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1h-.857V3H6.857z"})),React__default.default.createElement("g",{fillRule:"evenodd"},React__default.default.createElement("mask",{id:"trash-icon-mask"},React__default.default.createElement("use",{xlinkHref:"#trash-icon-path"})),React__default.default.createElement("use",{xlinkHref:"#trash-icon-path"})))},SettingsIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:19,height:19},props),React__default.default.createElement("path",{d:"M9.5 7A2.5 2.5 0 1 0 12 9.5 2.5 2.5 0 0 0 9.5 7zm0 4A1.5 1.5 0 1 1 11 9.5 1.5 1.5 0 0 1 9.5 11z"}),React__default.default.createElement("path",{d:"M17 8.66a.49.49 0 0 0-.48-.37 1.66 1.66 0 0 1-1.13-2.88.41.41 0 0 0 0-.56 7.4 7.4 0 0 0-1.19-1.2.42.42 0 0 0-.57 0 1.72 1.72 0 0 1-1.87.42 1.66 1.66 0 0 1-1-1.63.42.42 0 0 0-.39-.44 7.55 7.55 0 0 0-1.68 0 .42.42 0 0 0-.37.43 1.67 1.67 0 0 1-1 1.6 1.73 1.73 0 0 1-1.86-.42.42.42 0 0 0-.56 0 7.45 7.45 0 0 0-1.21 1.2.41.41 0 0 0 0 .57 1.66 1.66 0 0 1 .42 1.87 1.73 1.73 0 0 1-1.63 1 .41.41 0 0 0-.48.38 7.61 7.61 0 0 0 0 1.71.5.5 0 0 0 .49.37 1.64 1.64 0 0 1 1.54 1 1.67 1.67 0 0 1-.42 1.85.42.42 0 0 0 0 .56 7.45 7.45 0 0 0 1.19 1.2.42.42 0 0 0 .57 0 1.72 1.72 0 0 1 1.87-.42 1.66 1.66 0 0 1 1 1.63.42.42 0 0 0 .37.44 7.79 7.79 0 0 0 .86 0 7.55 7.55 0 0 0 .82 0 .42.42 0 0 0 .38-.43 1.67 1.67 0 0 1 1-1.6 1.73 1.73 0 0 1 1.86.42.42.42 0 0 0 .56 0 7.39 7.39 0 0 0 1.21-1.2.42.42 0 0 0 0-.57 1.66 1.66 0 0 1 1.11-2.89h.09a.42.42 0 0 0 .44-.37A7.52 7.52 0 0 0 17 8.66zm-1 1.12a2.64 2.64 0 0 0-2.06 1.66 2.67 2.67 0 0 0 .32 2.5c-.12.13-.24.25-.37.37a2.72 2.72 0 0 0-2.53-.31 2.71 2.71 0 0 0-1.63 2h-.5a2.67 2.67 0 0 0-1.59-2 2.79 2.79 0 0 0-1-.19 2.74 2.74 0 0 0-1.56.49l-.35-.36A2.69 2.69 0 0 0 5 11.36a2.63 2.63 0 0 0-2-1.62v-.53a2.73 2.73 0 0 0 2-1.55 2.69 2.69 0 0 0-.28-2.6l.37-.37a2.74 2.74 0 0 0 1.56.49A2.61 2.61 0 0 0 9.27 3h.5a2.67 2.67 0 0 0 1.59 2 2.72 2.72 0 0 0 2.57-.29c.12.11.24.23.35.36A2.68 2.68 0 0 0 14 7.61a2.64 2.64 0 0 0 2 1.65v.52z"}))},ReplaceIcon=function(props){return React__default.default.createElement("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.91888 3.35901L3.56788 5.01002L2.85988 5.71602L0.00488281 2.85601L2.89888 0L3.60188 0.711002L1.93288 2.35901H7.00388C10.8609 2.35901 13.9999 5.49802 13.9999 9.35503H12.9999C12.9999 6.04802 10.3109 3.35901 7.00388 3.35901H1.91888ZM12.1179 12.3594L10.4339 10.6754L11.1399 9.96738L13.9939 12.8214L11.1399 15.6754L10.4329 14.9684L12.0419 13.3594H6.99594C3.13897 13.3594 0 10.2184 0 6.35938H0.999991C0.999991 9.66838 3.68897 12.3594 6.99594 12.3594H12.1179Z",fill:"black"}))},AlignCenterIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"15",height:"18",viewBox:"0 0 15 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{d:"M13.5 10H8V8H10.5C11.3 8 12 7.3 12 6.5V3.5C12 2.7 11.3 2 10.5 2H8V0H7V2H4.5C3.7 2 3 2.7 3 3.5V6.5C3 7.3 3.7 8 4.5 8H7V10H1.5C0.7 10 0 10.7 0 11.5V14.5C0 15.3 0.7 16 1.5 16H7V18H8V16H13.5C14.3 16 15 15.3 15 14.5V11.5C15 10.7 14.3 10 13.5 10ZM4 6.5V3.5C4 3.2 4.2 3 4.5 3H10.5C10.8 3 11 3.2 11 3.5V6.5C11 6.8 10.8 7 10.5 7H4.5C4.2 7 4 6.8 4 6.5ZM14 14.5C14 14.8 13.8 15 13.5 15H1.5C1.2 15 1 14.8 1 14.5V11.5C1 11.2 1.2 11 1.5 11H13.5C13.8 11 14 11.2 14 11.5V14.5Z",fill:"black"}))},AlignLeftIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 0H0V16H1V0ZM16 10.5C16 9.7 15.3 9 14.5 9H4.5C3.7 9 3 9.7 3 10.5V13.5C3 14.3 3.7 15 4.5 15H14.5C15.3 15 16 14.3 16 13.5V10.5ZM15 13.5C15 13.8 14.8 14 14.5 14H4.5C4.2 14 4 13.8 4 13.5V10.5C4 10.2 4.2 10 4.5 10H14.5C14.8 10 15 10.2 15 10.5V13.5ZM9.5 7H4.5C3.7 7 3 6.3 3 5.5V2.5C3 1.7 3.7 1 4.5 1H9.5C10.3 1 11 1.7 11 2.5V5.5C11 6.3 10.3 7 9.5 7ZM4.5 2C4.2 2 4 2.2 4 2.5V5.5C4 5.8 4.2 6 4.5 6H9.5C9.8 6 10 5.8 10 5.5V2.5C10 2.2 9.8 2 9.5 2H4.5Z",fill:"#7247FF"}))},AlignRightIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 0H16V16H15V0ZM0 10.5C0 9.7 0.7 9 1.5 9H11.5C12.3 9 13 9.7 13 10.5V13.5C13 14.3 12.3 15 11.5 15H1.5C0.7 15 0 14.3 0 13.5V10.5ZM1 13.5C1 13.8 1.2 14 1.5 14H11.5C11.8 14 12 13.8 12 13.5V10.5C12 10.2 11.8 10 11.5 10H1.5C1.2 10 1 10.2 1 10.5V13.5ZM6.5 7H11.5C12.3 7 13 6.3 13 5.5V2.5C13 1.7 12.3 1 11.5 1H6.5C5.7 1 5 1.7 5 2.5V5.5C5 6.3 5.7 7 6.5 7ZM11.5 2C11.8 2 12 2.2 12 2.5V5.5C12 5.8 11.8 6 11.5 6H6.5C6.2 6 6 5.8 6 5.5V2.5C6 2.2 6.2 2 6.5 2H11.5Z",fill:"black"}))},SizeContentIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 0H0V1H14V0ZM14 13H0V14H14V13ZM1.5 3H12.5C13.3 3 14 3.7 14 4.5V9.5C14 10.3 13.3 11 12.5 11H1.5C0.7 11 0 10.3 0 9.5V4.5C0 3.7 0.7 3 1.5 3ZM12.5 10C12.8 10 13 9.8 13 9.5V4.5C13 4.2 12.8 4 12.5 4H1.5C1.2 4 1 4.2 1 4.5V9.5C1 9.8 1.2 10 1.5 10H12.5Z",fill:"black"}))},SizeFullWidthIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 0H2V1H16V0ZM16 13H2V14H16V13ZM1.5 3H16.5C17.3 3 18 3.7 18 4.5V9.5C18 10.3 17.3 11 16.5 11H1.5C0.7 11 0 10.3 0 9.5V4.5C0 3.7 0.7 3 1.5 3ZM16.5 10C16.8 10 17 9.8 17 9.5V4.5C17 4.2 16.8 4 16.5 4H1.5C1.2 4 1 4.2 1 4.5V9.5C1 9.8 1.2 10 1.5 10H16.5Z",fill:"black"}))},SizeOriginalIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 0H1.5C1.10218 0 0.720644 0.158035 0.43934 0.43934C0.158035 0.720644 0 1.10218 0 1.5V10.5C0 10.8978 0.158035 11.2794 0.43934 11.5607C0.720644 11.842 1.10218 12 1.5 12H14.5C14.8978 12 15.2794 11.842 15.5607 11.5607C15.842 11.2794 16 10.8978 16 10.5V1.5C16 1.10218 15.842 0.720644 15.5607 0.43934C15.2794 0.158035 14.8978 0 14.5 0ZM15 10.5C15 10.6326 14.9473 10.7598 14.8536 10.8536C14.7598 10.9473 14.6326 11 14.5 11H1.5C1.36739 11 1.24021 10.9473 1.14645 10.8536C1.05268 10.7598 1 10.6326 1 10.5V1.5C1 1.36739 1.05268 1.24021 1.14645 1.14645C1.24021 1.05268 1.36739 1 1.5 1H14.5C14.6326 1 14.7598 1.05268 14.8536 1.14645C14.9473 1.24021 15 1.36739 15 1.5V10.5ZM7.89003 6.69043C7.71473 6.69081 7.54635 6.75888 7.42003 6.88043C7.35697 6.93932 7.30668 7.01054 7.27227 7.08967C7.23787 7.1688 7.22009 7.25415 7.22003 7.34043C7.21885 7.4269 7.23608 7.51263 7.27056 7.59194C7.30504 7.67124 7.35599 7.74231 7.42003 7.80043C7.54657 7.92146 7.71492 7.989 7.89003 7.989C8.06513 7.989 8.23348 7.92146 8.36003 7.80043C8.42276 7.74181 8.47219 7.67042 8.50497 7.59106C8.53775 7.5117 8.55311 7.42623 8.55003 7.34043C8.55185 7.25479 8.53591 7.1697 8.50321 7.09053C8.47051 7.01136 8.42175 6.93982 8.36003 6.88043C8.23371 6.75888 8.06533 6.69081 7.89003 6.69043ZM7.63541 4.04665C7.71623 4.01398 7.80288 3.99816 7.89003 4.00017C7.97718 3.99816 8.06382 4.01398 8.14464 4.04665C8.22546 4.07932 8.29875 4.12816 8.36003 4.19017C8.42276 4.24879 8.47219 4.32018 8.50497 4.39954C8.53775 4.4789 8.55311 4.56436 8.55003 4.65017C8.55185 4.73581 8.53591 4.8209 8.50321 4.90007C8.47051 4.97924 8.42175 5.05078 8.36003 5.11017C8.23348 5.2312 8.06513 5.29874 7.89003 5.29874C7.71492 5.29874 7.54657 5.2312 7.42003 5.11017C7.35697 5.05128 7.30668 4.98006 7.27227 4.90093C7.23787 4.8218 7.22009 4.73645 7.22003 4.65017C7.21885 4.5637 7.23608 4.47797 7.27056 4.39866C7.30504 4.31936 7.35599 4.24829 7.42003 4.19017C7.4813 4.12816 7.55459 4.07932 7.63541 4.04665ZM3 4.15965V5.23965L4.44 4.27965V8.85965H5.51V3.13965H4.6L3 4.15965ZM9.98999 5.23965V4.15965L11.59 3.13965H12.5V8.85965H11.42V4.27965L9.98999 5.23965Z",fill:"black"}))},SizeSmallIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 0H0V1H14V0ZM14 13H0V14H14V13ZM12 9.5C12 10.3 11.3 11 10.5 11H3.5C2.7 11 2 10.3 2 9.5V4.5C2 3.7 2.7 3 3.5 3H10.5C11.3 3 12 3.7 12 4.5V9.5ZM3 4.5V9.5C3 9.8 3.2 10 3.5 10H10.5C10.8 10 11 9.8 11 9.5V4.5C11 4.2 10.8 4 10.5 4H3.5C3.2 4 3 4.2 3 4.5Z",fill:"#7247FF"}))},styles$4_panel_Container="_2PDcs";styleInject("._1__Fi,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}[dir] ._2PDcs{border:1px solid #ededed;box-shadow:var(--ricos-settings-whitebox-box-shadow,0 4px 8px 0 rgba(0,0,0,.1),0 0 4px 0 rgba(0,0,0,.1));border-radius:var(--ricos-settings-whitebox-border-radius,2px)}._2PDcs svg{height:unset;width:unset}");var Styles={fontElementMap:"_3WAMN",desktopPanel:"paq46"};styleInject("._3WAMN,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}.paq46{display:flex;flex-direction:column;align-items:flex-start;width:100%;align-items:center}[dir] .paq46{padding:8px 0}");var DesktopPanel=function(_ref){var options=_ref.options,externalFocus=_ref.externalFocus,theme=(React.useContext(ricosContext.RicosContext)||{}).theme,styles=wixRichContentCommon.mergeStyles({styles:Styles,theme:theme}),panelRef=React.useRef(null);React.useEffect((function(){var ref=panelRef.current;!externalFocus&&ref.focus()}),[]);var dropDownPanel=React__default.default.createElement("div",{tabIndex:-1,ref:panelRef,"data-hook":"toolbars-modal-desktopPanel",className:styles.desktopPanel},options);return externalFocus?dropDownPanel:React__default.default.createElement(wixRichContentUiComponents.FocusManager,null,dropDownPanel)},DropdownPanel=function(_ref){var options=_ref.options,panel=React__default.default.createElement(DesktopPanel,{options:options});return React__default.default.createElement("div",{className:styles$4_panel_Container},panel)},DropdownButton=function(_ref){var _cx,_cx2,Icon=_ref.Icon,dataHook=_ref.dataHook,tooltip=_ref.tooltip,options=_ref.options,id=_ref.id,_ref2=React.useContext(ricosContext.RicosContext)||{},isMobile=_ref2.isMobile,t=_ref2.t,modalService=React.useContext(ricosContext.ModalContext)||{},_useState=React.useState(null),referenceElement=_useState[0],setReferenceElement=_useState[1],ModalComponent=function(){return React__default.default.createElement("div",{tabIndex:-1,className:styles$5_modal},React__default.default.createElement(DropdownPanel,{options:options}))};React.useEffect((function(){modalService.register({Component:ModalComponent,id:id})}),[]),React.useEffect((function(){return modalService.unregister(id)}),[]);return React__default.default.createElement(Tooltip__default.default,{key:t(tooltip),content:t(tooltip),tooltipOffset:{x:0,y:-8}},React__default.default.createElement("div",{className:cx__default.default(styles$5_dropdownModalButtonWrapper,(_cx={},_cx[styles$5_mobileDropdownModalButtonWrapper]=isMobile,_cx)),ref:setReferenceElement},React__default.default.createElement("div",{"data-hook":dataHook,className:cx__default.default(styles$5_dropdownModalButton,(_cx2={},_cx2[styles$5_mobileDropdownModalButton]=isMobile,_cx2)),role:"button",onClick:function(){null!=modalService&&modalService.isModalOpen(id)?modalService.closeModal(id):null==modalService||modalService.openModal(id,{layout:isMobile?"drawer":"toolbar",positioning:{referenceElement:referenceElement,placement:"bottom"}})},tabIndex:0},React__default.default.createElement(Icon,null),React__default.default.createElement(DropdownArrowIcon,null))))},styles$3_buttonWrapper="_3PXfR",styles$3_active="_2bKwi",styles$3_disabled="EIZ9s",styles$3_mobileButtonWrapper="_2xMNG",styles$3_button="isNPD",styles$3_mobileButton="rTbef";styleInject("._3PXfR{color:var(--ricos-settings-text-color,#000)}[dir] ._3PXfR{background:transparent;padding:4px;cursor:pointer}[dir] ._3PXfR:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}._3PXfR._2bKwi{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3PXfR._2bKwi{background-color:rgba(var(--ricos-action-color-fallback-tuple,2,97,255),.1)}._3PXfR._2bKwi svg{fill:var(--ricos-settings-icons-color,currentColor);color:var(--ricos-settings-icons-color,currentColor)}._3PXfR.EIZ9s{opacity:.4}[dir] ._3PXfR.EIZ9s{cursor:default}[dir] ._3PXfR._2xMNG:not(._2bKwi):hover{background-color:unset}.isNPD{display:flex;align-items:center;justify-content:center;width:20px;height:20px}.isNPD.rTbef{width:32px;height:32px}");var ToggleButton=function(_ref){var _cx,_cx2,Icon=_ref.Icon,onClick=_ref.onClick,dataHook=_ref.dataHook,tooltip=_ref.tooltip,active=_ref.active,disabled=_ref.disabled,setRef=_ref.setRef,isMobile=(React.useContext(ricosContext.RicosContext)||{}).isMobile;return React__default.default.createElement(Tooltip__default.default,{key:tooltip,content:tooltip,tooltipOffset:{x:0,y:-8}},React__default.default.createElement("div",{className:cx__default.default(styles$3_buttonWrapper,(_cx={},_cx[styles$3_mobileButtonWrapper]=isMobile,_cx[styles$3_active]=active,_cx[styles$3_disabled]=disabled,_cx)),ref:setRef},React__default.default.createElement("div",{"data-hook":dataHook,onMouseDown:function(e){return e.preventDefault()},className:cx__default.default(styles$3_button,(_cx2={},_cx2[styles$3_mobileButton]=isMobile,_cx2)),role:"button",onClick:onClick,tabIndex:0},React__default.default.createElement(Icon,null))))},styles$2_container="_3xp71",styles$2_selected="_3Tmg_",styles$2_content="_2o70n",styles$2_prefix="CzSsK",styles$2_titleWrapper="_1lCEc",styles$2_title="_2UEur",styles$2_subtitle="_1AsLP",styles$2_suffix="_34TZF";styleInject("._2L7Dk,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}._3xp71{width:100%;color:var(--ricos-settings-text-color,#000)}[dir] ._3xp71{background-color:#fff}._3xp71._3Tmg_{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}@media only screen and (max-width:640px){._3xp71{height:47px}}._3xp71 ._2o70n{align-items:center;height:40px;display:grid;grid-auto-flow:column;grid-auto-columns:max-content auto max-content;grid-gap:12px}[dir=ltr] ._3xp71 ._2o70n,[dir=rtl] ._3xp71 ._2o70n{padding-left:20px;padding-right:20px}._3xp71 ._2o70n .CzSsK{align-self:left}._3xp71 ._2o70n ._1lCEc{display:grid;grid-auto-flow:row}._3xp71 ._2o70n ._1lCEc ._2UEur{font-size:14px}._3xp71 ._2o70n ._1lCEc ._1AsLP{font-size:12px;color:#646464}._3xp71 ._2o70n ._34TZF{align-self:right}._3xp71._3Tmg_,._3xp71:active{color:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3xp71._3Tmg_,[dir] ._3xp71:active{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-action-color-fallback-tuple,2,97,255)),.1)}._3xp71._3Tmg_ svg,._3xp71:active svg{color:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3xp71:hover{cursor:pointer;background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.05)}");var ListItemSelect=function(_ref){var _classNames,title=_ref.title,subtitle=_ref.subtitle,prefix=_ref.prefix,suffix=_ref.suffix,dataHook=_ref.dataHook,selected=_ref.selected,disabled=_ref.disabled,onClick=_ref.onClick,tooltip=_ref.tooltip,onKeyDown=_ref.onKeyDown;return React__default.default.createElement(Tooltip__default.default,{content:tooltip},React__default.default.createElement("div",{className:cx__default.default(styles$2_container,(_classNames={},_classNames[styles$2_selected]=selected,_classNames)),tabIndex:0,onKeyDown:onKeyDown,"data-hook":dataHook,"data-selected":selected,onClick:disabled?void 0:onClick},React__default.default.createElement("div",{className:styles$2_content},prefix&&React__default.default.createElement("div",{className:styles$2_prefix},prefix),React__default.default.createElement("div",{className:styles$2_titleWrapper},title&&React__default.default.createElement("div",{className:styles$2_title},title),subtitle&&React__default.default.createElement("div",{className:styles$2_subtitle},subtitle)),suffix&&React__default.default.createElement("div",{className:styles$2_suffix},suffix))))},styles$1={fontElementMap:"_3LF-I",whitespace:"_1vIFf",separator:"qiAdf"};styleInject("._3LF-I,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}[dir] ._1vIFf{margin:8px auto 0}._1vIFf .qiAdf{height:1px;width:calc(100% - 24px)}[dir] ._1vIFf .qiAdf{background-color:var(--ricos-settings-dividers-color,rgba(51,51,51,.2))}@media only screen and (max-width:640px){._1vIFf .qiAdf{width:100%}[dir] ._1vIFf .qiAdf{margin:0}}");var styles_addPluginButton="_2gCVX";styleInject("._2gCVX{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}[dir] ._2gCVX{cursor:pointer;border:none;background-color:transparent}[dir] ._2gCVX:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}");var PluginMenuButton=function(_ref){var Icon=_ref.Icon,label=_ref.label,dataHook=_ref.dataHook,onClick=_ref.onClick,t=_ref.t,tooltipText=_ref.tooltipText,languageDir=_ref.languageDir,onButtonVisible=_ref.onButtonVisible;React.useEffect((function(){null==onButtonVisible||onButtonVisible()}),[]);var pluginButton=React__default.default.createElement("button",{dir:languageDir,"data-hook":dataHook,className:styles_addPluginButton,onClick:onClick},React__default.default.createElement(Icon,null),label&&React__default.default.createElement("div",null,t(label)));return React__default.default.createElement(wixRichContentEditorCommon.ToolbarButton,{tooltipText:tooltipText,button:pluginButton})},alignmentMap={LEFT:AlignLeftIcon,CENTER:AlignCenterIcon,RIGHT:AlignRightIcon},alignmentsMap={LEFT:{text:"AlignObject_Left_Tooltip",tooltip:"AlignObject_Left_Tooltip",commandKey:"LEFT",icon:AlignLeftIcon,dataHook:"blockAlignmentAndSizeButton_alignLeft"},CENTER:{text:"AlignObject_Center_Tooltip",tooltip:"AlignObject_Center_Tooltip",commandKey:"CENTER",icon:AlignCenterIcon,dataHook:"blockAlignmentAndSizeButton_alignCenter"},RIGHT:{text:"AlignObject_Right_Tooltip",tooltip:"AlignObject_Right_Tooltip",commandKey:"RIGHT",icon:AlignRightIcon,dataHook:"blockAlignmentAndSizeButton_alignRight"}},defaultAlignments=[alignmentsMap.LEFT,alignmentsMap.CENTER,alignmentsMap.RIGHT],sizeMap={CONTENT:{text:"SizeContentButton_Tooltip",tooltip:"SizeContentButton_Tooltip",commandKey:"CONTENT",icon:SizeContentIcon,dataHook:"blockAlignmentAndSizeButton_sizeContent"},SMALL:{text:"SizeSmallCenterButton_Tooltip",tooltip:"SizeSmallCenterButton_Tooltip",commandKey:"SMALL",icon:SizeSmallIcon,dataHook:"blockAlignmentAndSizeButton_sizeSmall"},ORIGINAL:{text:"SizeOriginalButton_Tooltip",tooltip:"SizeOriginalButton_Tooltip",commandKey:"ORIGINAL",icon:SizeOriginalIcon,dataHook:"blockAlignmentAndSizeButton_sizeOriginal"},FULL_WIDTH:{text:"SizeFullWidthButton_Tooltip",tooltip:"SizeFullWidthButton_Tooltip",commandKey:"FULL_WIDTH",icon:SizeFullWidthIcon,dataHook:"blockAlignmentAndSizeButton_sizeFullWidth"}},defaultSize=[sizeMap.SMALL,sizeMap.CONTENT,sizeMap.FULL_WIDTH],sizeIconMap={CONTENT:SizeContentIcon,SMALL:SizeSmallIcon,ORIGINAL:SizeOriginalIcon,FULL_WIDTH:SizeFullWidthIcon};exports.AddPluginMenu=function(_ref){var referenceElement=_ref.referenceElement,_ref$helpers=_ref.helpers,helpers=void 0===_ref$helpers?{}:_ref$helpers,addPluginMenuConfig=_ref.addPluginMenuConfig,addButtons=_ref.addButtons,_ref2=React.useContext(ricosContext.RicosContext)||{},t=_ref2.t,theme=_ref2.theme,languageDir=_ref2.languageDir,isMobile=_ref2.isMobile,modalService=React.useContext(ricosContext.ModalContext)||{},getEditorCommands=React.useContext(ricosContext.EditorContext).getEditorCommands,uploadContext=React.useContext(wixRichContentCommon.UploadServiceContext),pluginModalLayout=function(isMobile){return isMobile?ricosModals.LAYOUTS.FULLSCREEN:ricosModals.LAYOUTS.POPOVER}(isMobile),pluginModalPlacement=function(isMobile,languageDir){return isMobile?ricosModals.PLACEMENTS.BOTTOM:"ltr"===languageDir?ricosModals.PLACEMENTS.RIGHT_START:ricosModals.PLACEMENTS.LEFT_START}(isMobile,languageDir),pluginMenuButtons=addButtons.asArray().map((function(addButton){var _button$menuConfig,_button$menuConfig2,button=addButton.getButton(),onButtonClick=function(){return function(button){var modal=button.modal,command=button.command;return modalService.closeModal("pluginMenu"),modal?null==modalService?void 0:modalService.openModal(modal.id,{positioning:{referenceElement:null==referenceElement?void 0:referenceElement.current,placement:pluginModalPlacement},layout:pluginModalLayout}):command(null==getEditorCommands?void 0:getEditorCommands(),uploadContext.uploadService,uploadContext.updateService)}(button)};return{component:function(_ref4){var onButtonVisible=_ref4.onButtonVisible;return function(_ref3,onClick,onButtonVisible){var icon=_ref3.icon,label=_ref3.label,tooltip=_ref3.tooltip,dataHook=_ref3.dataHook;return React__default.default.createElement(PluginMenuButton,{dataHook:dataHook,Icon:icon,label:label,onClick:onClick,tooltipText:t(tooltip),t:t,languageDir:languageDir,onButtonVisible:onButtonVisible})}(button,onButtonClick,onButtonVisible)},name:button.label,section:(null===(_button$menuConfig=button.menuConfig)||void 0===_button$menuConfig?void 0:_button$menuConfig.group)&&wixRichContentEditor.SECTIONS[null===(_button$menuConfig2=button.menuConfig)||void 0===_button$menuConfig2?void 0:_button$menuConfig2.group]}}));return React__default.default.createElement(wixRichContentEditor.AddPluginMenu,{pluginMenuButtonRef:referenceElement,helpers:helpers,theme:theme,plugins:pluginMenuButtons,isMobile:isMobile,addPluginMenuConfig:addPluginMenuConfig,t:t,isActive:!0})},exports.AlignCenterIcon=AlignCenterIcon,exports.AlignLeftIcon=AlignLeftIcon,exports.AlignRightIcon=AlignRightIcon,exports.DeleteButton=function(_ref){var toolbarItem=_ref.toolbarItem,t=(React.useContext(ricosContext.RicosContext)||{}).t;return React__default.default.createElement(ToggleButton,{Icon:TrashIcon,onClick:toolbarItem.commands.delete,dataHook:"blockButton_delete",tooltip:t("DeleteButton_Tooltip")})},exports.DropdownArrowIcon=DropdownArrowIcon,exports.DropdownButton=DropdownButton,exports.DropdownPanel=DropdownPanel,exports.LinkIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13"},props),React__default.default.createElement("g",{fill:"none",fillRule:"evenodd"},React__default.default.createElement("g",{fill:"currentColor"},React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M7.056 9.115c1.288-1.289 3.538-1.289 4.825 0l.343.342-.707.71-.343-.344c-.911-.914-2.5-.913-3.411 0l-2.06 2.058c-.94.94-.94 2.471 0 3.411.944.941 2.475.94 3.412 0l1.029-1.029.707.707L9.82 16c-.664.664-1.538.996-2.412.996-.873 0-1.747-.332-2.412-.997-1.33-1.33-1.33-3.495 0-4.825zm4.118-4.117c1.33-1.33 3.495-1.331 4.825 0 1.329 1.33 1.329 3.495 0 4.825l-2.06 2.059c-.643.644-1.501 1-2.412 1s-1.768-.356-2.412-1l-.344-.342.707-.71.344.344c.91.914 2.5.913 3.41 0l2.06-2.058c.939-.94.939-2.471 0-3.411-.941-.94-2.472-.938-3.411 0l-1.03 1.029-.706-.707z",transform:"translate(-247.000000, -81.000000) translate(243.000000, 77.000000)"})))))},exports.ListItemSection=function(_ref){var type=_ref.type;return React__default.default.createElement("div",{className:styles$1.whitespace},"divider"===type&&React__default.default.createElement("div",{className:styles$1.divider}))},exports.ListItemSelect=ListItemSelect,exports.NodeAlignmentButton=function(_ref){var options=_ref.options,toolbarItem=_ref.toolbarItem,_ref2=React.useContext(ricosContext.RicosContext)||{},t=_ref2.t,languageDir=_ref2.languageDir,selectedAlignment=(null==toolbarItem?void 0:toolbarItem.attributes.nodeAlignment)||("rtl"===languageDir?"RIGHT":"LEFT"),SelectedAlignmentIcon=alignmentMap[""+selectedAlignment],dropDownOptions=options?options.map((function(option){return alignmentsMap[option]})):defaultAlignments;return React__default.default.createElement(DropdownButton,{dataHook:"nodeAlignmentButton",id:"nodeAlignmentButton",options:dropDownOptions.map((function(_ref3){var dataHook=_ref3.dataHook,Icon=_ref3.icon,text=_ref3.text,commandKey=_ref3.commandKey,tooltip=_ref3.tooltip;return React__default.default.createElement(ListItemSelect,{key:commandKey,dataHook:dataHook,prefix:React__default.default.createElement(Icon,null),title:t(text),selected:commandKey===selectedAlignment,tooltip:t(tooltip),onClick:function(){var _toolbarItem$commands;return null===(_toolbarItem$commands=toolbarItem.commands)||void 0===_toolbarItem$commands?void 0:_toolbarItem$commands.setAlignment(commandKey)}})})),Icon:SelectedAlignmentIcon,tooltip:t("TextAlignmentButton_Tooltip")})},exports.NodeSizeButton=function(_ref){var options=_ref.options,toolbarItem=_ref.toolbarItem,t=(React.useContext(ricosContext.RicosContext)||{}).t,selectedSize=(null==toolbarItem?void 0:toolbarItem.attributes.nodeSize)||"CONTENT",SelectedSizeIcon=sizeIconMap[""+selectedSize],dropDownOptions=options?options.map((function(option){return sizeMap[option]})):defaultSize;return React__default.default.createElement(DropdownButton,{dataHook:"NodeSizeButton",id:"NodeSizeButton",options:dropDownOptions.map((function(_ref3){var dataHook=_ref3.dataHook,Icon=_ref3.icon,text=_ref3.text,commandKey=_ref3.commandKey,tooltip=_ref3.tooltip;return React__default.default.createElement(ListItemSelect,{key:commandKey,dataHook:dataHook,prefix:React__default.default.createElement(Icon,null),title:t(text),selected:commandKey===selectedSize,tooltip:t(tooltip),onClick:function(){var _toolbarItem$commands;return null===(_toolbarItem$commands=toolbarItem.commands)||void 0===_toolbarItem$commands?void 0:_toolbarItem$commands.setSize(commandKey)}})})),Icon:SelectedSizeIcon,tooltip:t("ButtonModal_Size_Section")})},exports.PLUGIN_MENU_MODAL_ID="pluginMenu",exports.ReplaceButton=function(_ref){var toolbarItem=_ref.toolbarItem,modalService=React.useContext(ricosContext.ModalContext)||{},uploadContext=React.useContext(wixRichContentCommon.UploadServiceContext),_useState=React.useState(null),referenceElement=_useState[0],setReferenceElement=_useState[1],_ref2=React.useContext(ricosContext.RicosContext)||{},t=_ref2.t,isMobile=_ref2.isMobile,node=toolbarItem.attributes.selectedNode;return React__default.default.createElement(ToggleButton,{Icon:ReplaceIcon,onClick:function(){return toolbarItem.commands.click({node:node,referenceElement:referenceElement,uploadContext:uploadContext,modalService:modalService,isMobile:isMobile})},dataHook:"baseToolbarButton_replace",tooltip:t("ReplaceButton_Tooltip"),setRef:setReferenceElement})},exports.ReplaceIcon=ReplaceIcon,exports.SettingsButton=function(_ref){var toolbarItem=_ref.toolbarItem,modalService=React.useContext(ricosContext.ModalContext)||{},_ref2=React.useContext(ricosContext.RicosContext)||{},isMobile=_ref2.isMobile,t=_ref2.t,_onClick=toolbarItem.commands.click,node=toolbarItem.attributes.selectedNode;return React__default.default.createElement(ToggleButton,{Icon:SettingsIcon,onClick:function(){return _onClick({modalService:modalService,isMobile:isMobile,node:node})},dataHook:"baseToolbarButton_settings",tooltip:t("SettingsButton_Tooltip")})},exports.SettingsIcon=SettingsIcon,exports.SizeContentIcon=SizeContentIcon,exports.SizeFullWidthIcon=SizeFullWidthIcon,exports.SizeOriginalIcon=SizeOriginalIcon,exports.SizeSmallIcon=SizeSmallIcon,exports.ToggleButton=ToggleButton,exports.TrashIcon=TrashIcon; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),cx=require("classnames"),_extends=require("@babel/runtime/helpers/extends"),Tooltip=require("wix-rich-content-common/libs/Tooltip"),ricosContext=require("ricos-context"),wixRichContentCommon=require("wix-rich-content-common"),wixRichContentUiComponents=require("wix-rich-content-ui-components"),wixRichContentEditor=require("wix-rich-content-editor"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),ricosModals=require("ricos-modals");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),cx__default=_interopDefaultLegacy(cx),_extends__default=_interopDefaultLegacy(_extends),Tooltip__default=_interopDefaultLegacy(Tooltip);function styleInject(css,ref){void 0===ref&&(ref={});var insertAt=ref.insertAt;if(css&&"undefined"!=typeof document){var head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css","top"===insertAt&&head.firstChild?head.insertBefore(style,head.firstChild):head.appendChild(style),style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css))}}var styles$5_dropdownModalButtonWrapper="_3AWpK",styles$5_mobileDropdownModalButtonWrapper="_1h1be",styles$5_dropdownModalButton="_1lUT8",styles$5_mobileDropdownModalButton="_3Uqyy",styles$5_modal="_1INEN";styleInject("._3AWpK{color:var(--ricos-settings-text-color,#000)}[dir] ._3AWpK{background:transparent;padding:4px;cursor:pointer}[dir] ._3AWpK:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}._3AWpK._3BTSj{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3AWpK._3BTSj{background-color:rgba(var(--ricos-action-color-fallback-tuple,2,97,255),.1)}._3AWpK._3BTSj svg{fill:var(--ricos-settings-icons-color,currentColor);color:var(--ricos-settings-icons-color,currentColor)}[dir] ._3AWpK._1h1be:not(._3BTSj):hover{background-color:unset}._1lUT8{display:flex;align-items:center;justify-content:center;height:20px;min-width:20px;gap:8px}._1lUT8._3Uqyy{height:32px;min-width:32px}._1INEN{display:flex;flex-direction:column;z-index:10;width:162px;box-sizing:border-box}[dir] ._1INEN{box-shadow:0 0 10px 0 rgba(0,0,0,.06);border:1px solid rgba(51,51,51,.1);border-radius:2px;background-color:#fff}._1INEN *,._1INEN :after,._1INEN :before{box-sizing:inherit}._1INEN input{box-sizing:border-box}@media only screen and (max-width:640px){._1INEN{width:100%}}");var DropdownArrowIcon=function(){return React__default.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"6",viewBox:"0 0 8 6"},React__default.default.createElement("g",{fill:"none",fillRule:"evenodd"},React__default.default.createElement("g",{fill:"currentColor"},React__default.default.createElement("g",null,React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M2.873 1.873L-1.127 5.367 -0.469 6.127 2.873 3.207 6.216 6.127 6.873 5.367z",transform:"translate(-439.000000, -84.000000) translate(437.000000, 77.000000) translate(6.000000, 10.000000) rotate(-270.000000) translate(-6.000000, -10.000000) translate(3.500000, 6.000000) translate(2.873490, 4.000000) scale(1, -1) rotate(90.000000) translate(-2.873490, -4.000000)"}))))))},TrashIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({xmlnsXlink:"http://www.w3.org/1999/xlink",width:"19",height:"19",viewBox:"0 0 19 19"},props),React__default.default.createElement("defs",null,React__default.default.createElement("path",{id:"trash-icon-path",d:"M15 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5h-.8a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h12.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H15zm-1 0H5v10.8c0 .11.09.2.2.2h8.6a.2.2 0 0 0 .2-.2V5zM7.2 7h.6c.11 0 .2.09.2.2v6.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zm4 0h.6c.11 0 .2.09.2.2v6.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zM6.857 3v1H6V3a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1h-.857V3H6.857z"})),React__default.default.createElement("g",{fillRule:"evenodd"},React__default.default.createElement("mask",{id:"trash-icon-mask"},React__default.default.createElement("use",{xlinkHref:"#trash-icon-path"})),React__default.default.createElement("use",{xlinkHref:"#trash-icon-path"})))},SettingsIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:19,height:19},props),React__default.default.createElement("path",{d:"M9.5 7A2.5 2.5 0 1 0 12 9.5 2.5 2.5 0 0 0 9.5 7zm0 4A1.5 1.5 0 1 1 11 9.5 1.5 1.5 0 0 1 9.5 11z"}),React__default.default.createElement("path",{d:"M17 8.66a.49.49 0 0 0-.48-.37 1.66 1.66 0 0 1-1.13-2.88.41.41 0 0 0 0-.56 7.4 7.4 0 0 0-1.19-1.2.42.42 0 0 0-.57 0 1.72 1.72 0 0 1-1.87.42 1.66 1.66 0 0 1-1-1.63.42.42 0 0 0-.39-.44 7.55 7.55 0 0 0-1.68 0 .42.42 0 0 0-.37.43 1.67 1.67 0 0 1-1 1.6 1.73 1.73 0 0 1-1.86-.42.42.42 0 0 0-.56 0 7.45 7.45 0 0 0-1.21 1.2.41.41 0 0 0 0 .57 1.66 1.66 0 0 1 .42 1.87 1.73 1.73 0 0 1-1.63 1 .41.41 0 0 0-.48.38 7.61 7.61 0 0 0 0 1.71.5.5 0 0 0 .49.37 1.64 1.64 0 0 1 1.54 1 1.67 1.67 0 0 1-.42 1.85.42.42 0 0 0 0 .56 7.45 7.45 0 0 0 1.19 1.2.42.42 0 0 0 .57 0 1.72 1.72 0 0 1 1.87-.42 1.66 1.66 0 0 1 1 1.63.42.42 0 0 0 .37.44 7.79 7.79 0 0 0 .86 0 7.55 7.55 0 0 0 .82 0 .42.42 0 0 0 .38-.43 1.67 1.67 0 0 1 1-1.6 1.73 1.73 0 0 1 1.86.42.42.42 0 0 0 .56 0 7.39 7.39 0 0 0 1.21-1.2.42.42 0 0 0 0-.57 1.66 1.66 0 0 1 1.11-2.89h.09a.42.42 0 0 0 .44-.37A7.52 7.52 0 0 0 17 8.66zm-1 1.12a2.64 2.64 0 0 0-2.06 1.66 2.67 2.67 0 0 0 .32 2.5c-.12.13-.24.25-.37.37a2.72 2.72 0 0 0-2.53-.31 2.71 2.71 0 0 0-1.63 2h-.5a2.67 2.67 0 0 0-1.59-2 2.79 2.79 0 0 0-1-.19 2.74 2.74 0 0 0-1.56.49l-.35-.36A2.69 2.69 0 0 0 5 11.36a2.63 2.63 0 0 0-2-1.62v-.53a2.73 2.73 0 0 0 2-1.55 2.69 2.69 0 0 0-.28-2.6l.37-.37a2.74 2.74 0 0 0 1.56.49A2.61 2.61 0 0 0 9.27 3h.5a2.67 2.67 0 0 0 1.59 2 2.72 2.72 0 0 0 2.57-.29c.12.11.24.23.35.36A2.68 2.68 0 0 0 14 7.61a2.64 2.64 0 0 0 2 1.65v.52z"}))},ReplaceIcon=function(props){return React__default.default.createElement("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.91888 3.35901L3.56788 5.01002L2.85988 5.71602L0.00488281 2.85601L2.89888 0L3.60188 0.711002L1.93288 2.35901H7.00388C10.8609 2.35901 13.9999 5.49802 13.9999 9.35503H12.9999C12.9999 6.04802 10.3109 3.35901 7.00388 3.35901H1.91888ZM12.1179 12.3594L10.4339 10.6754L11.1399 9.96738L13.9939 12.8214L11.1399 15.6754L10.4329 14.9684L12.0419 13.3594H6.99594C3.13897 13.3594 0 10.2184 0 6.35938H0.999991C0.999991 9.66838 3.68897 12.3594 6.99594 12.3594H12.1179Z",fill:"black"}))},AlignCenterIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"15",height:"18",viewBox:"0 0 15 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{d:"M13.5 10H8V8H10.5C11.3 8 12 7.3 12 6.5V3.5C12 2.7 11.3 2 10.5 2H8V0H7V2H4.5C3.7 2 3 2.7 3 3.5V6.5C3 7.3 3.7 8 4.5 8H7V10H1.5C0.7 10 0 10.7 0 11.5V14.5C0 15.3 0.7 16 1.5 16H7V18H8V16H13.5C14.3 16 15 15.3 15 14.5V11.5C15 10.7 14.3 10 13.5 10ZM4 6.5V3.5C4 3.2 4.2 3 4.5 3H10.5C10.8 3 11 3.2 11 3.5V6.5C11 6.8 10.8 7 10.5 7H4.5C4.2 7 4 6.8 4 6.5ZM14 14.5C14 14.8 13.8 15 13.5 15H1.5C1.2 15 1 14.8 1 14.5V11.5C1 11.2 1.2 11 1.5 11H13.5C13.8 11 14 11.2 14 11.5V14.5Z",fill:"black"}))},AlignLeftIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 0H0V16H1V0ZM16 10.5C16 9.7 15.3 9 14.5 9H4.5C3.7 9 3 9.7 3 10.5V13.5C3 14.3 3.7 15 4.5 15H14.5C15.3 15 16 14.3 16 13.5V10.5ZM15 13.5C15 13.8 14.8 14 14.5 14H4.5C4.2 14 4 13.8 4 13.5V10.5C4 10.2 4.2 10 4.5 10H14.5C14.8 10 15 10.2 15 10.5V13.5ZM9.5 7H4.5C3.7 7 3 6.3 3 5.5V2.5C3 1.7 3.7 1 4.5 1H9.5C10.3 1 11 1.7 11 2.5V5.5C11 6.3 10.3 7 9.5 7ZM4.5 2C4.2 2 4 2.2 4 2.5V5.5C4 5.8 4.2 6 4.5 6H9.5C9.8 6 10 5.8 10 5.5V2.5C10 2.2 9.8 2 9.5 2H4.5Z",fill:"#7247FF"}))},AlignRightIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 0H16V16H15V0ZM0 10.5C0 9.7 0.7 9 1.5 9H11.5C12.3 9 13 9.7 13 10.5V13.5C13 14.3 12.3 15 11.5 15H1.5C0.7 15 0 14.3 0 13.5V10.5ZM1 13.5C1 13.8 1.2 14 1.5 14H11.5C11.8 14 12 13.8 12 13.5V10.5C12 10.2 11.8 10 11.5 10H1.5C1.2 10 1 10.2 1 10.5V13.5ZM6.5 7H11.5C12.3 7 13 6.3 13 5.5V2.5C13 1.7 12.3 1 11.5 1H6.5C5.7 1 5 1.7 5 2.5V5.5C5 6.3 5.7 7 6.5 7ZM11.5 2C11.8 2 12 2.2 12 2.5V5.5C12 5.8 11.8 6 11.5 6H6.5C6.2 6 6 5.8 6 5.5V2.5C6 2.2 6.2 2 6.5 2H11.5Z",fill:"black"}))},SizeContentIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 0H0V1H14V0ZM14 13H0V14H14V13ZM1.5 3H12.5C13.3 3 14 3.7 14 4.5V9.5C14 10.3 13.3 11 12.5 11H1.5C0.7 11 0 10.3 0 9.5V4.5C0 3.7 0.7 3 1.5 3ZM12.5 10C12.8 10 13 9.8 13 9.5V4.5C13 4.2 12.8 4 12.5 4H1.5C1.2 4 1 4.2 1 4.5V9.5C1 9.8 1.2 10 1.5 10H12.5Z",fill:"black"}))},SizeFullWidthIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 0H2V1H16V0ZM16 13H2V14H16V13ZM1.5 3H16.5C17.3 3 18 3.7 18 4.5V9.5C18 10.3 17.3 11 16.5 11H1.5C0.7 11 0 10.3 0 9.5V4.5C0 3.7 0.7 3 1.5 3ZM16.5 10C16.8 10 17 9.8 17 9.5V4.5C17 4.2 16.8 4 16.5 4H1.5C1.2 4 1 4.2 1 4.5V9.5C1 9.8 1.2 10 1.5 10H16.5Z",fill:"black"}))},SizeOriginalIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 0H1.5C1.10218 0 0.720644 0.158035 0.43934 0.43934C0.158035 0.720644 0 1.10218 0 1.5V10.5C0 10.8978 0.158035 11.2794 0.43934 11.5607C0.720644 11.842 1.10218 12 1.5 12H14.5C14.8978 12 15.2794 11.842 15.5607 11.5607C15.842 11.2794 16 10.8978 16 10.5V1.5C16 1.10218 15.842 0.720644 15.5607 0.43934C15.2794 0.158035 14.8978 0 14.5 0ZM15 10.5C15 10.6326 14.9473 10.7598 14.8536 10.8536C14.7598 10.9473 14.6326 11 14.5 11H1.5C1.36739 11 1.24021 10.9473 1.14645 10.8536C1.05268 10.7598 1 10.6326 1 10.5V1.5C1 1.36739 1.05268 1.24021 1.14645 1.14645C1.24021 1.05268 1.36739 1 1.5 1H14.5C14.6326 1 14.7598 1.05268 14.8536 1.14645C14.9473 1.24021 15 1.36739 15 1.5V10.5ZM7.89003 6.69043C7.71473 6.69081 7.54635 6.75888 7.42003 6.88043C7.35697 6.93932 7.30668 7.01054 7.27227 7.08967C7.23787 7.1688 7.22009 7.25415 7.22003 7.34043C7.21885 7.4269 7.23608 7.51263 7.27056 7.59194C7.30504 7.67124 7.35599 7.74231 7.42003 7.80043C7.54657 7.92146 7.71492 7.989 7.89003 7.989C8.06513 7.989 8.23348 7.92146 8.36003 7.80043C8.42276 7.74181 8.47219 7.67042 8.50497 7.59106C8.53775 7.5117 8.55311 7.42623 8.55003 7.34043C8.55185 7.25479 8.53591 7.1697 8.50321 7.09053C8.47051 7.01136 8.42175 6.93982 8.36003 6.88043C8.23371 6.75888 8.06533 6.69081 7.89003 6.69043ZM7.63541 4.04665C7.71623 4.01398 7.80288 3.99816 7.89003 4.00017C7.97718 3.99816 8.06382 4.01398 8.14464 4.04665C8.22546 4.07932 8.29875 4.12816 8.36003 4.19017C8.42276 4.24879 8.47219 4.32018 8.50497 4.39954C8.53775 4.4789 8.55311 4.56436 8.55003 4.65017C8.55185 4.73581 8.53591 4.8209 8.50321 4.90007C8.47051 4.97924 8.42175 5.05078 8.36003 5.11017C8.23348 5.2312 8.06513 5.29874 7.89003 5.29874C7.71492 5.29874 7.54657 5.2312 7.42003 5.11017C7.35697 5.05128 7.30668 4.98006 7.27227 4.90093C7.23787 4.8218 7.22009 4.73645 7.22003 4.65017C7.21885 4.5637 7.23608 4.47797 7.27056 4.39866C7.30504 4.31936 7.35599 4.24829 7.42003 4.19017C7.4813 4.12816 7.55459 4.07932 7.63541 4.04665ZM3 4.15965V5.23965L4.44 4.27965V8.85965H5.51V3.13965H4.6L3 4.15965ZM9.98999 5.23965V4.15965L11.59 3.13965H12.5V8.85965H11.42V4.27965L9.98999 5.23965Z",fill:"black"}))},SizeSmallIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React__default.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 0H0V1H14V0ZM14 13H0V14H14V13ZM12 9.5C12 10.3 11.3 11 10.5 11H3.5C2.7 11 2 10.3 2 9.5V4.5C2 3.7 2.7 3 3.5 3H10.5C11.3 3 12 3.7 12 4.5V9.5ZM3 4.5V9.5C3 9.8 3.2 10 3.5 10H10.5C10.8 10 11 9.8 11 9.5V4.5C11 4.2 10.8 4 10.5 4H3.5C3.2 4 3 4.2 3 4.5Z",fill:"#7247FF"}))},styles$4_panel_Container="_2PDcs";styleInject("._1__Fi,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}[dir] ._2PDcs{border:1px solid #ededed;box-shadow:var(--ricos-settings-whitebox-box-shadow,0 4px 8px 0 rgba(0,0,0,.1),0 0 4px 0 rgba(0,0,0,.1));border-radius:var(--ricos-settings-whitebox-border-radius,2px)}._2PDcs svg{height:unset;width:unset}");var Styles={fontElementMap:"_3WAMN",desktopPanel:"paq46"};styleInject("._3WAMN,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}.paq46{display:flex;flex-direction:column;align-items:flex-start;width:100%;align-items:center}[dir] .paq46{padding:8px 0}");var DesktopPanel=function(_ref){var options=_ref.options,externalFocus=_ref.externalFocus,theme=(React.useContext(ricosContext.RicosContext)||{}).theme,styles=wixRichContentCommon.mergeStyles({styles:Styles,theme:theme}),panelRef=React.useRef(null);React.useEffect((function(){var ref=panelRef.current;!externalFocus&&ref.focus()}),[]);var dropDownPanel=React__default.default.createElement("div",{tabIndex:-1,ref:panelRef,"data-hook":"toolbars-modal-desktopPanel",className:styles.desktopPanel},options);return externalFocus?dropDownPanel:React__default.default.createElement(wixRichContentUiComponents.FocusManager,null,dropDownPanel)},DropdownPanel=function(_ref){var options=_ref.options,panel=React__default.default.createElement(DesktopPanel,{options:options});return React__default.default.createElement("div",{className:styles$4_panel_Container},panel)},DropdownButton=function(_ref){var _cx,_cx2,Icon=_ref.Icon,dataHook=_ref.dataHook,tooltip=_ref.tooltip,options=_ref.options,id=_ref.id,_ref2=React.useContext(ricosContext.RicosContext)||{},isMobile=_ref2.isMobile,t=_ref2.t,modalService=React.useContext(ricosContext.ModalContext)||{},_useState=React.useState(null),referenceElement=_useState[0],setReferenceElement=_useState[1],ModalComponent=function(){return React__default.default.createElement("div",{tabIndex:-1,className:styles$5_modal},React__default.default.createElement(DropdownPanel,{options:options}))};React.useEffect((function(){modalService.register({Component:ModalComponent,id:id})}),[]),React.useEffect((function(){return modalService.unregister(id)}),[]);return React__default.default.createElement(Tooltip__default.default,{key:t(tooltip),content:t(tooltip),tooltipOffset:{x:0,y:-8}},React__default.default.createElement("div",{className:cx__default.default(styles$5_dropdownModalButtonWrapper,(_cx={},_cx[styles$5_mobileDropdownModalButtonWrapper]=isMobile,_cx)),ref:setReferenceElement},React__default.default.createElement("div",{"data-hook":dataHook,className:cx__default.default(styles$5_dropdownModalButton,(_cx2={},_cx2[styles$5_mobileDropdownModalButton]=isMobile,_cx2)),role:"button",onClick:function(){null!=modalService&&modalService.isModalOpen(id)?modalService.closeModal(id):null==modalService||modalService.openModal(id,{layout:isMobile?"drawer":"toolbar",positioning:{referenceElement:referenceElement,placement:"bottom"}})},tabIndex:0},React__default.default.createElement(Icon,null),React__default.default.createElement(DropdownArrowIcon,null))))},styles$3_buttonWrapper="_3PXfR",styles$3_active="_2bKwi",styles$3_disabled="EIZ9s",styles$3_mobileButtonWrapper="_2xMNG",styles$3_button="isNPD",styles$3_mobileButton="rTbef";styleInject("._3PXfR{color:var(--ricos-settings-text-color,#000)}[dir] ._3PXfR{background:transparent;padding:4px;cursor:pointer}[dir] ._3PXfR:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}._3PXfR._2bKwi{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3PXfR._2bKwi{background-color:rgba(var(--ricos-action-color-fallback-tuple,2,97,255),.1)}._3PXfR._2bKwi svg{fill:var(--ricos-settings-icons-color,currentColor);color:var(--ricos-settings-icons-color,currentColor)}._3PXfR.EIZ9s{opacity:.4}[dir] ._3PXfR.EIZ9s{cursor:default}[dir] ._3PXfR._2xMNG:not(._2bKwi):hover{background-color:unset}.isNPD{display:flex;align-items:center;justify-content:center;width:20px;height:20px}.isNPD.rTbef{width:32px;height:32px}");var ToggleButton=function(_ref){var _cx,_cx2,Icon=_ref.Icon,onClick=_ref.onClick,dataHook=_ref.dataHook,tooltip=_ref.tooltip,active=_ref.active,disabled=_ref.disabled,setRef=_ref.setRef,isMobile=(React.useContext(ricosContext.RicosContext)||{}).isMobile;return React__default.default.createElement(Tooltip__default.default,{key:tooltip,content:tooltip,tooltipOffset:{x:0,y:-8}},React__default.default.createElement("div",{className:cx__default.default(styles$3_buttonWrapper,(_cx={},_cx[styles$3_mobileButtonWrapper]=isMobile,_cx[styles$3_active]=active,_cx[styles$3_disabled]=disabled,_cx)),ref:setRef},React__default.default.createElement("div",{"data-hook":dataHook,onMouseDown:function(e){return e.preventDefault()},className:cx__default.default(styles$3_button,(_cx2={},_cx2[styles$3_mobileButton]=isMobile,_cx2)),role:"button",onClick:onClick,tabIndex:0},React__default.default.createElement(Icon,null))))},styles$2_container="_3xp71",styles$2_selected="_3Tmg_",styles$2_content="_2o70n",styles$2_prefix="CzSsK",styles$2_titleWrapper="_1lCEc",styles$2_title="_2UEur",styles$2_subtitle="_1AsLP",styles$2_suffix="_34TZF";styleInject("._2L7Dk,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}._3xp71{width:100%;color:var(--ricos-settings-text-color,#000)}[dir] ._3xp71{background-color:#fff}._3xp71._3Tmg_{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}@media only screen and (max-width:640px){._3xp71{height:47px}}._3xp71 ._2o70n{align-items:center;height:40px;display:grid;grid-auto-flow:column;grid-auto-columns:max-content auto max-content;grid-gap:12px}[dir=ltr] ._3xp71 ._2o70n,[dir=rtl] ._3xp71 ._2o70n{padding-left:20px;padding-right:20px}._3xp71 ._2o70n .CzSsK{align-self:left}._3xp71 ._2o70n ._1lCEc{display:grid;grid-auto-flow:row}._3xp71 ._2o70n ._1lCEc ._2UEur{font-size:14px}._3xp71 ._2o70n ._1lCEc ._1AsLP{font-size:12px;color:#646464}._3xp71 ._2o70n ._34TZF{align-self:right}._3xp71._3Tmg_,._3xp71:active{color:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3xp71._3Tmg_,[dir] ._3xp71:active{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-action-color-fallback-tuple,2,97,255)),.1)}._3xp71._3Tmg_ svg,._3xp71:active svg{color:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3xp71:hover{cursor:pointer;background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.05)}");var ListItemSelect=function(_ref){var _classNames,title=_ref.title,subtitle=_ref.subtitle,prefix=_ref.prefix,suffix=_ref.suffix,dataHook=_ref.dataHook,selected=_ref.selected,disabled=_ref.disabled,onClick=_ref.onClick,tooltip=_ref.tooltip,onKeyDown=_ref.onKeyDown;return React__default.default.createElement(Tooltip__default.default,{content:tooltip},React__default.default.createElement("div",{className:cx__default.default(styles$2_container,(_classNames={},_classNames[styles$2_selected]=selected,_classNames)),tabIndex:0,onKeyDown:onKeyDown,"data-hook":dataHook,"data-selected":selected,onClick:disabled?void 0:onClick},React__default.default.createElement("div",{className:styles$2_content},prefix&&React__default.default.createElement("div",{className:styles$2_prefix},prefix),React__default.default.createElement("div",{className:styles$2_titleWrapper},title&&React__default.default.createElement("div",{className:styles$2_title},title),subtitle&&React__default.default.createElement("div",{className:styles$2_subtitle},subtitle)),suffix&&React__default.default.createElement("div",{className:styles$2_suffix},suffix))))},styles$1={fontElementMap:"_3LF-I",whitespace:"_1vIFf",separator:"qiAdf"};styleInject("._3LF-I,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}[dir] ._1vIFf{margin:8px auto 0}._1vIFf .qiAdf{height:1px;width:calc(100% - 24px)}[dir] ._1vIFf .qiAdf{background-color:var(--ricos-settings-dividers-color,rgba(51,51,51,.2))}@media only screen and (max-width:640px){._1vIFf .qiAdf{width:100%}[dir] ._1vIFf .qiAdf{margin:0}}");var styles_addPluginButton="_2gCVX";styleInject("._2gCVX{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}[dir] ._2gCVX{cursor:pointer;border:none;background-color:transparent}[dir] ._2gCVX:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}");var PluginMenuButton=function(_ref){var Icon=_ref.Icon,label=_ref.label,dataHook=_ref.dataHook,onClick=_ref.onClick,t=_ref.t,tooltipText=_ref.tooltipText,languageDir=_ref.languageDir,onButtonVisible=_ref.onButtonVisible;React.useEffect((function(){null==onButtonVisible||onButtonVisible()}),[]);var pluginButton=React__default.default.createElement("button",{dir:languageDir,"data-hook":dataHook,className:styles_addPluginButton,onClick:onClick},React__default.default.createElement(Icon,null),label&&React__default.default.createElement("div",null,t(label)));return React__default.default.createElement(wixRichContentEditorCommon.ToolbarButton,{tooltipText:tooltipText,button:pluginButton})},alignmentMap={LEFT:AlignLeftIcon,CENTER:AlignCenterIcon,RIGHT:AlignRightIcon},alignmentsMap={LEFT:{text:"AlignObject_Left_Tooltip",tooltip:"AlignObject_Left_Tooltip",commandKey:"LEFT",icon:AlignLeftIcon,dataHook:"blockAlignmentAndSizeButton_alignLeft"},CENTER:{text:"AlignObject_Center_Tooltip",tooltip:"AlignObject_Center_Tooltip",commandKey:"CENTER",icon:AlignCenterIcon,dataHook:"blockAlignmentAndSizeButton_alignCenter"},RIGHT:{text:"AlignObject_Right_Tooltip",tooltip:"AlignObject_Right_Tooltip",commandKey:"RIGHT",icon:AlignRightIcon,dataHook:"blockAlignmentAndSizeButton_alignRight"}},defaultAlignments=[alignmentsMap.LEFT,alignmentsMap.CENTER,alignmentsMap.RIGHT],sizeMap={CONTENT:{text:"SizeContentButton_Tooltip",tooltip:"SizeContentButton_Tooltip",commandKey:"CONTENT",icon:SizeContentIcon,dataHook:"blockAlignmentAndSizeButton_sizeContent"},SMALL:{text:"SizeSmallCenterButton_Tooltip",tooltip:"SizeSmallCenterButton_Tooltip",commandKey:"SMALL",icon:SizeSmallIcon,dataHook:"blockAlignmentAndSizeButton_sizeSmall"},ORIGINAL:{text:"SizeOriginalButton_Tooltip",tooltip:"SizeOriginalButton_Tooltip",commandKey:"ORIGINAL",icon:SizeOriginalIcon,dataHook:"blockAlignmentAndSizeButton_sizeOriginal"},FULL_WIDTH:{text:"SizeFullWidthButton_Tooltip",tooltip:"SizeFullWidthButton_Tooltip",commandKey:"FULL_WIDTH",icon:SizeFullWidthIcon,dataHook:"blockAlignmentAndSizeButton_sizeFullWidth"}},defaultSize=[sizeMap.SMALL,sizeMap.CONTENT,sizeMap.FULL_WIDTH],sizeIconMap={CONTENT:SizeContentIcon,SMALL:SizeSmallIcon,ORIGINAL:SizeOriginalIcon,FULL_WIDTH:SizeFullWidthIcon};exports.AddPluginMenu=function(_ref){var referenceElement=_ref.referenceElement,_ref$helpers=_ref.helpers,helpers=void 0===_ref$helpers?{}:_ref$helpers,addPluginMenuConfig=_ref.addPluginMenuConfig,addButtons=_ref.addButtons,_ref2=React.useContext(ricosContext.RicosContext)||{},t=_ref2.t,theme=_ref2.theme,languageDir=_ref2.languageDir,isMobile=_ref2.isMobile,modalService=React.useContext(ricosContext.ModalContext)||{},getEditorCommands=React.useContext(ricosContext.EditorContext).getEditorCommands,uploadContext=React.useContext(wixRichContentCommon.UploadServiceContext),pluginModalLayout=function(isMobile){return isMobile?ricosModals.LAYOUTS.FULLSCREEN:ricosModals.LAYOUTS.POPOVER}(isMobile),pluginModalPlacement=function(isMobile,languageDir){return isMobile?ricosModals.PLACEMENTS.BOTTOM:"ltr"===languageDir?ricosModals.PLACEMENTS.RIGHT_START:ricosModals.PLACEMENTS.LEFT_START}(isMobile,languageDir),pluginMenuButtons=addButtons.asArray().map((function(addButton){var _button$menuConfig,_button$menuConfig2,button=addButton.getButton(),onButtonClick=function(){return function(button){var modal=button.modal,command=button.command;return modalService.closeModal("pluginMenu"),modal?null==modalService?void 0:modalService.openModal(modal.id,{positioning:{referenceElement:null==referenceElement?void 0:referenceElement.current,placement:pluginModalPlacement},layout:pluginModalLayout}):command(null==getEditorCommands?void 0:getEditorCommands(),uploadContext.uploadService,uploadContext.updateService)}(button)};return{component:function(_ref4){var onButtonVisible=_ref4.onButtonVisible;return function(_ref3,onClick,onButtonVisible){var icon=_ref3.icon,label=_ref3.label,tooltip=_ref3.tooltip,dataHook=_ref3.dataHook;return React__default.default.createElement(PluginMenuButton,{dataHook:dataHook,Icon:icon,label:label,onClick:onClick,tooltipText:t(tooltip),t:t,languageDir:languageDir,onButtonVisible:onButtonVisible})}(button,onButtonClick,onButtonVisible)},name:button.label,section:(null===(_button$menuConfig=button.menuConfig)||void 0===_button$menuConfig?void 0:_button$menuConfig.group)&&wixRichContentEditor.SECTIONS[null===(_button$menuConfig2=button.menuConfig)||void 0===_button$menuConfig2?void 0:_button$menuConfig2.group]}}));return React__default.default.createElement(wixRichContentEditor.AddPluginMenu,{pluginMenuButtonRef:referenceElement,helpers:helpers,theme:theme,plugins:pluginMenuButtons,isMobile:isMobile,addPluginMenuConfig:addPluginMenuConfig,t:t,isActive:!0})},exports.AlignCenterIcon=AlignCenterIcon,exports.AlignLeftIcon=AlignLeftIcon,exports.AlignRightIcon=AlignRightIcon,exports.DeleteButton=function(_ref){var toolbarItem=_ref.toolbarItem,t=(React.useContext(ricosContext.RicosContext)||{}).t;return React__default.default.createElement(ToggleButton,{Icon:TrashIcon,onClick:toolbarItem.commands.delete,dataHook:"blockButton_delete",tooltip:t("DeleteButton_Tooltip")})},exports.DropdownArrowIcon=DropdownArrowIcon,exports.DropdownButton=DropdownButton,exports.DropdownPanel=DropdownPanel,exports.LinkIcon=function(props){return React__default.default.createElement("svg",_extends__default.default({xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13"},props),React__default.default.createElement("g",{fill:"none",fillRule:"evenodd"},React__default.default.createElement("g",{fill:"currentColor"},React__default.default.createElement("g",null,React__default.default.createElement("path",{d:"M7.056 9.115c1.288-1.289 3.538-1.289 4.825 0l.343.342-.707.71-.343-.344c-.911-.914-2.5-.913-3.411 0l-2.06 2.058c-.94.94-.94 2.471 0 3.411.944.941 2.475.94 3.412 0l1.029-1.029.707.707L9.82 16c-.664.664-1.538.996-2.412.996-.873 0-1.747-.332-2.412-.997-1.33-1.33-1.33-3.495 0-4.825zm4.118-4.117c1.33-1.33 3.495-1.331 4.825 0 1.329 1.33 1.329 3.495 0 4.825l-2.06 2.059c-.643.644-1.501 1-2.412 1s-1.768-.356-2.412-1l-.344-.342.707-.71.344.344c.91.914 2.5.913 3.41 0l2.06-2.058c.939-.94.939-2.471 0-3.411-.941-.94-2.472-.938-3.411 0l-1.03 1.029-.706-.707z",transform:"translate(-247.000000, -81.000000) translate(243.000000, 77.000000)"})))))},exports.ListItemSection=function(_ref){var type=_ref.type;return React__default.default.createElement("div",{className:styles$1.whitespace},"divider"===type&&React__default.default.createElement("div",{className:styles$1.divider}))},exports.ListItemSelect=ListItemSelect,exports.NodeAlignmentButton=function(_ref){var options=_ref.options,toolbarItem=_ref.toolbarItem,_ref2=React.useContext(ricosContext.RicosContext)||{},t=_ref2.t,languageDir=_ref2.languageDir,selectedAlignment=(null==toolbarItem?void 0:toolbarItem.attributes.nodeAlignment)||("rtl"===languageDir?"RIGHT":"LEFT"),SelectedAlignmentIcon=alignmentMap[""+selectedAlignment],dropDownOptions=options?options.map((function(option){return alignmentsMap[option]})):defaultAlignments;return React__default.default.createElement(DropdownButton,{dataHook:"nodeAlignmentButton",id:"nodeAlignmentButton",options:dropDownOptions.map((function(_ref3){var dataHook=_ref3.dataHook,Icon=_ref3.icon,text=_ref3.text,commandKey=_ref3.commandKey,tooltip=_ref3.tooltip;return React__default.default.createElement(ListItemSelect,{key:commandKey,dataHook:dataHook,prefix:React__default.default.createElement(Icon,null),title:t(text),selected:commandKey===selectedAlignment,tooltip:t(tooltip),onClick:function(){var _toolbarItem$commands;return null===(_toolbarItem$commands=toolbarItem.commands)||void 0===_toolbarItem$commands?void 0:_toolbarItem$commands.setAlignment(commandKey)}})})),Icon:SelectedAlignmentIcon,tooltip:t("TextAlignmentButton_Tooltip")})},exports.NodeSizeButton=function(_ref){var options=_ref.options,toolbarItem=_ref.toolbarItem,t=(React.useContext(ricosContext.RicosContext)||{}).t,selectedSize=(null==toolbarItem?void 0:toolbarItem.attributes.nodeSize)||"CONTENT",SelectedSizeIcon=sizeIconMap[""+selectedSize],dropDownOptions=options?options.map((function(option){return sizeMap[option]})):defaultSize;return React__default.default.createElement(DropdownButton,{dataHook:"NodeSizeButton",id:"NodeSizeButton",options:dropDownOptions.map((function(_ref3){var dataHook=_ref3.dataHook,Icon=_ref3.icon,text=_ref3.text,commandKey=_ref3.commandKey,tooltip=_ref3.tooltip;return React__default.default.createElement(ListItemSelect,{key:commandKey,dataHook:dataHook,prefix:React__default.default.createElement(Icon,null),title:t(text),selected:commandKey===selectedSize,tooltip:t(tooltip),onClick:function(){var _toolbarItem$commands;return null===(_toolbarItem$commands=toolbarItem.commands)||void 0===_toolbarItem$commands?void 0:_toolbarItem$commands.setSize(commandKey)}})})),Icon:SelectedSizeIcon,tooltip:t("ButtonModal_Size_Section")})},exports.PLUGIN_MENU_MODAL_ID="pluginMenu",exports.ReplaceButton=function(_ref){var toolbarItem=_ref.toolbarItem,modalService=React.useContext(ricosContext.ModalContext)||{},uploadContext=React.useContext(wixRichContentCommon.UploadServiceContext),_useState=React.useState(null),referenceElement=_useState[0],setReferenceElement=_useState[1],_ref2=React.useContext(ricosContext.RicosContext)||{},t=_ref2.t,isMobile=_ref2.isMobile,node=toolbarItem.attributes.selectedNode;return React__default.default.createElement(ToggleButton,{Icon:ReplaceIcon,onClick:function(){return toolbarItem.commands.click({node:node,referenceElement:referenceElement,uploadContext:uploadContext,modalService:modalService,isMobile:isMobile})},dataHook:"baseToolbarButton_replace",tooltip:t("ReplaceButton_Tooltip"),setRef:setReferenceElement})},exports.ReplaceIcon=ReplaceIcon,exports.SettingsButton=function(_ref){var toolbarItem=_ref.toolbarItem,modalService=React.useContext(ricosContext.ModalContext)||{},_ref2=React.useContext(ricosContext.RicosContext)||{},isMobile=_ref2.isMobile,t=_ref2.t,_useContext=React.useContext(wixRichContentCommon.UploadServiceContext),uploadService=_useContext.uploadService,updateService=_useContext.updateService,_onClick=toolbarItem.commands.click,node=toolbarItem.attributes.selectedNode;return React__default.default.createElement(ToggleButton,{Icon:SettingsIcon,onClick:function(){return _onClick({modalService:modalService,isMobile:isMobile,node:node,uploadService:uploadService,updateService:updateService})},dataHook:"baseToolbarButton_settings",tooltip:t("SettingsButton_Tooltip")})},exports.SettingsIcon=SettingsIcon,exports.SizeContentIcon=SizeContentIcon,exports.SizeFullWidthIcon=SizeFullWidthIcon,exports.SizeOriginalIcon=SizeOriginalIcon,exports.SizeSmallIcon=SizeSmallIcon,exports.ToggleButton=ToggleButton,exports.TrashIcon=TrashIcon; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import React,{useContext,useRef,useEffect,useState}from"react";import cx from"classnames";import _extends from"@babel/runtime/helpers/extends";import Tooltip from"wix-rich-content-common/libs/Tooltip";import{RicosContext,ModalContext,EditorContext}from"ricos-context";import{mergeStyles,UploadServiceContext}from"wix-rich-content-common";import{FocusManager}from"wix-rich-content-ui-components";import{SECTIONS,AddPluginMenu as AddPluginMenu$1}from"wix-rich-content-editor";import{ToolbarButton}from"wix-rich-content-editor-common";import{LAYOUTS,PLACEMENTS}from"ricos-modals";function styleInject(css,ref){void 0===ref&&(ref={});var insertAt=ref.insertAt;if(css&&"undefined"!=typeof document){var head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css","top"===insertAt&&head.firstChild?head.insertBefore(style,head.firstChild):head.appendChild(style),style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css))}}var styles$5_dropdownModalButtonWrapper="_3AWpK",styles$5_mobileDropdownModalButtonWrapper="_1h1be",styles$5_dropdownModalButton="_1lUT8",styles$5_mobileDropdownModalButton="_3Uqyy",styles$5_modal="_1INEN";styleInject("._3AWpK{color:var(--ricos-settings-text-color,#000)}[dir] ._3AWpK{background:transparent;padding:4px;cursor:pointer}[dir] ._3AWpK:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}._3AWpK._3BTSj{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3AWpK._3BTSj{background-color:rgba(var(--ricos-action-color-fallback-tuple,2,97,255),.1)}._3AWpK._3BTSj svg{fill:var(--ricos-settings-icons-color,currentColor);color:var(--ricos-settings-icons-color,currentColor)}[dir] ._3AWpK._1h1be:not(._3BTSj):hover{background-color:unset}._1lUT8{display:flex;align-items:center;justify-content:center;height:20px;min-width:20px;gap:8px}._1lUT8._3Uqyy{height:32px;min-width:32px}._1INEN{display:flex;flex-direction:column;z-index:10;width:162px;box-sizing:border-box}[dir] ._1INEN{box-shadow:0 0 10px 0 rgba(0,0,0,.06);border:1px solid rgba(51,51,51,.1);border-radius:2px;background-color:#fff}._1INEN *,._1INEN :after,._1INEN :before{box-sizing:inherit}._1INEN input{box-sizing:border-box}@media only screen and (max-width:640px){._1INEN{width:100%}}");var DropdownArrowIcon=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"6",viewBox:"0 0 8 6"},React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("g",{fill:"currentColor"},React.createElement("g",null,React.createElement("g",null,React.createElement("path",{d:"M2.873 1.873L-1.127 5.367 -0.469 6.127 2.873 3.207 6.216 6.127 6.873 5.367z",transform:"translate(-439.000000, -84.000000) translate(437.000000, 77.000000) translate(6.000000, 10.000000) rotate(-270.000000) translate(-6.000000, -10.000000) translate(3.500000, 6.000000) translate(2.873490, 4.000000) scale(1, -1) rotate(90.000000) translate(-2.873490, -4.000000)"}))))))},LinkIcon=function(props){return React.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13"},props),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("g",{fill:"currentColor"},React.createElement("g",null,React.createElement("path",{d:"M7.056 9.115c1.288-1.289 3.538-1.289 4.825 0l.343.342-.707.71-.343-.344c-.911-.914-2.5-.913-3.411 0l-2.06 2.058c-.94.94-.94 2.471 0 3.411.944.941 2.475.94 3.412 0l1.029-1.029.707.707L9.82 16c-.664.664-1.538.996-2.412.996-.873 0-1.747-.332-2.412-.997-1.33-1.33-1.33-3.495 0-4.825zm4.118-4.117c1.33-1.33 3.495-1.331 4.825 0 1.329 1.33 1.329 3.495 0 4.825l-2.06 2.059c-.643.644-1.501 1-2.412 1s-1.768-.356-2.412-1l-.344-.342.707-.71.344.344c.91.914 2.5.913 3.41 0l2.06-2.058c.939-.94.939-2.471 0-3.411-.941-.94-2.472-.938-3.411 0l-1.03 1.029-.706-.707z",transform:"translate(-247.000000, -81.000000) translate(243.000000, 77.000000)"})))))},TrashIcon=function(props){return React.createElement("svg",_extends({xmlnsXlink:"http://www.w3.org/1999/xlink",width:"19",height:"19",viewBox:"0 0 19 19"},props),React.createElement("defs",null,React.createElement("path",{id:"trash-icon-path",d:"M15 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5h-.8a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h12.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H15zm-1 0H5v10.8c0 .11.09.2.2.2h8.6a.2.2 0 0 0 .2-.2V5zM7.2 7h.6c.11 0 .2.09.2.2v6.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zm4 0h.6c.11 0 .2.09.2.2v6.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zM6.857 3v1H6V3a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1h-.857V3H6.857z"})),React.createElement("g",{fillRule:"evenodd"},React.createElement("mask",{id:"trash-icon-mask"},React.createElement("use",{xlinkHref:"#trash-icon-path"})),React.createElement("use",{xlinkHref:"#trash-icon-path"})))},SettingsIcon=function(props){return React.createElement("svg",_extends({width:19,height:19},props),React.createElement("path",{d:"M9.5 7A2.5 2.5 0 1 0 12 9.5 2.5 2.5 0 0 0 9.5 7zm0 4A1.5 1.5 0 1 1 11 9.5 1.5 1.5 0 0 1 9.5 11z"}),React.createElement("path",{d:"M17 8.66a.49.49 0 0 0-.48-.37 1.66 1.66 0 0 1-1.13-2.88.41.41 0 0 0 0-.56 7.4 7.4 0 0 0-1.19-1.2.42.42 0 0 0-.57 0 1.72 1.72 0 0 1-1.87.42 1.66 1.66 0 0 1-1-1.63.42.42 0 0 0-.39-.44 7.55 7.55 0 0 0-1.68 0 .42.42 0 0 0-.37.43 1.67 1.67 0 0 1-1 1.6 1.73 1.73 0 0 1-1.86-.42.42.42 0 0 0-.56 0 7.45 7.45 0 0 0-1.21 1.2.41.41 0 0 0 0 .57 1.66 1.66 0 0 1 .42 1.87 1.73 1.73 0 0 1-1.63 1 .41.41 0 0 0-.48.38 7.61 7.61 0 0 0 0 1.71.5.5 0 0 0 .49.37 1.64 1.64 0 0 1 1.54 1 1.67 1.67 0 0 1-.42 1.85.42.42 0 0 0 0 .56 7.45 7.45 0 0 0 1.19 1.2.42.42 0 0 0 .57 0 1.72 1.72 0 0 1 1.87-.42 1.66 1.66 0 0 1 1 1.63.42.42 0 0 0 .37.44 7.79 7.79 0 0 0 .86 0 7.55 7.55 0 0 0 .82 0 .42.42 0 0 0 .38-.43 1.67 1.67 0 0 1 1-1.6 1.73 1.73 0 0 1 1.86.42.42.42 0 0 0 .56 0 7.39 7.39 0 0 0 1.21-1.2.42.42 0 0 0 0-.57 1.66 1.66 0 0 1 1.11-2.89h.09a.42.42 0 0 0 .44-.37A7.52 7.52 0 0 0 17 8.66zm-1 1.12a2.64 2.64 0 0 0-2.06 1.66 2.67 2.67 0 0 0 .32 2.5c-.12.13-.24.25-.37.37a2.72 2.72 0 0 0-2.53-.31 2.71 2.71 0 0 0-1.63 2h-.5a2.67 2.67 0 0 0-1.59-2 2.79 2.79 0 0 0-1-.19 2.74 2.74 0 0 0-1.56.49l-.35-.36A2.69 2.69 0 0 0 5 11.36a2.63 2.63 0 0 0-2-1.62v-.53a2.73 2.73 0 0 0 2-1.55 2.69 2.69 0 0 0-.28-2.6l.37-.37a2.74 2.74 0 0 0 1.56.49A2.61 2.61 0 0 0 9.27 3h.5a2.67 2.67 0 0 0 1.59 2 2.72 2.72 0 0 0 2.57-.29c.12.11.24.23.35.36A2.68 2.68 0 0 0 14 7.61a2.64 2.64 0 0 0 2 1.65v.52z"}))},ReplaceIcon=function(props){return React.createElement("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.91888 3.35901L3.56788 5.01002L2.85988 5.71602L0.00488281 2.85601L2.89888 0L3.60188 0.711002L1.93288 2.35901H7.00388C10.8609 2.35901 13.9999 5.49802 13.9999 9.35503H12.9999C12.9999 6.04802 10.3109 3.35901 7.00388 3.35901H1.91888ZM12.1179 12.3594L10.4339 10.6754L11.1399 9.96738L13.9939 12.8214L11.1399 15.6754L10.4329 14.9684L12.0419 13.3594H6.99594C3.13897 13.3594 0 10.2184 0 6.35938H0.999991C0.999991 9.66838 3.68897 12.3594 6.99594 12.3594H12.1179Z",fill:"black"}))},AlignCenterIcon=function(props){return React.createElement("svg",_extends({width:"15",height:"18",viewBox:"0 0 15 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{d:"M13.5 10H8V8H10.5C11.3 8 12 7.3 12 6.5V3.5C12 2.7 11.3 2 10.5 2H8V0H7V2H4.5C3.7 2 3 2.7 3 3.5V6.5C3 7.3 3.7 8 4.5 8H7V10H1.5C0.7 10 0 10.7 0 11.5V14.5C0 15.3 0.7 16 1.5 16H7V18H8V16H13.5C14.3 16 15 15.3 15 14.5V11.5C15 10.7 14.3 10 13.5 10ZM4 6.5V3.5C4 3.2 4.2 3 4.5 3H10.5C10.8 3 11 3.2 11 3.5V6.5C11 6.8 10.8 7 10.5 7H4.5C4.2 7 4 6.8 4 6.5ZM14 14.5C14 14.8 13.8 15 13.5 15H1.5C1.2 15 1 14.8 1 14.5V11.5C1 11.2 1.2 11 1.5 11H13.5C13.8 11 14 11.2 14 11.5V14.5Z",fill:"black"}))},AlignLeftIcon=function(props){return React.createElement("svg",_extends({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 0H0V16H1V0ZM16 10.5C16 9.7 15.3 9 14.5 9H4.5C3.7 9 3 9.7 3 10.5V13.5C3 14.3 3.7 15 4.5 15H14.5C15.3 15 16 14.3 16 13.5V10.5ZM15 13.5C15 13.8 14.8 14 14.5 14H4.5C4.2 14 4 13.8 4 13.5V10.5C4 10.2 4.2 10 4.5 10H14.5C14.8 10 15 10.2 15 10.5V13.5ZM9.5 7H4.5C3.7 7 3 6.3 3 5.5V2.5C3 1.7 3.7 1 4.5 1H9.5C10.3 1 11 1.7 11 2.5V5.5C11 6.3 10.3 7 9.5 7ZM4.5 2C4.2 2 4 2.2 4 2.5V5.5C4 5.8 4.2 6 4.5 6H9.5C9.8 6 10 5.8 10 5.5V2.5C10 2.2 9.8 2 9.5 2H4.5Z",fill:"#7247FF"}))},AlignRightIcon=function(props){return React.createElement("svg",_extends({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 0H16V16H15V0ZM0 10.5C0 9.7 0.7 9 1.5 9H11.5C12.3 9 13 9.7 13 10.5V13.5C13 14.3 12.3 15 11.5 15H1.5C0.7 15 0 14.3 0 13.5V10.5ZM1 13.5C1 13.8 1.2 14 1.5 14H11.5C11.8 14 12 13.8 12 13.5V10.5C12 10.2 11.8 10 11.5 10H1.5C1.2 10 1 10.2 1 10.5V13.5ZM6.5 7H11.5C12.3 7 13 6.3 13 5.5V2.5C13 1.7 12.3 1 11.5 1H6.5C5.7 1 5 1.7 5 2.5V5.5C5 6.3 5.7 7 6.5 7ZM11.5 2C11.8 2 12 2.2 12 2.5V5.5C12 5.8 11.8 6 11.5 6H6.5C6.2 6 6 5.8 6 5.5V2.5C6 2.2 6.2 2 6.5 2H11.5Z",fill:"black"}))},SizeContentIcon=function(props){return React.createElement("svg",_extends({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 0H0V1H14V0ZM14 13H0V14H14V13ZM1.5 3H12.5C13.3 3 14 3.7 14 4.5V9.5C14 10.3 13.3 11 12.5 11H1.5C0.7 11 0 10.3 0 9.5V4.5C0 3.7 0.7 3 1.5 3ZM12.5 10C12.8 10 13 9.8 13 9.5V4.5C13 4.2 12.8 4 12.5 4H1.5C1.2 4 1 4.2 1 4.5V9.5C1 9.8 1.2 10 1.5 10H12.5Z",fill:"black"}))},SizeFullWidthIcon=function(props){return React.createElement("svg",_extends({width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 0H2V1H16V0ZM16 13H2V14H16V13ZM1.5 3H16.5C17.3 3 18 3.7 18 4.5V9.5C18 10.3 17.3 11 16.5 11H1.5C0.7 11 0 10.3 0 9.5V4.5C0 3.7 0.7 3 1.5 3ZM16.5 10C16.8 10 17 9.8 17 9.5V4.5C17 4.2 16.8 4 16.5 4H1.5C1.2 4 1 4.2 1 4.5V9.5C1 9.8 1.2 10 1.5 10H16.5Z",fill:"black"}))},SizeOriginalIcon=function(props){return React.createElement("svg",_extends({width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 0H1.5C1.10218 0 0.720644 0.158035 0.43934 0.43934C0.158035 0.720644 0 1.10218 0 1.5V10.5C0 10.8978 0.158035 11.2794 0.43934 11.5607C0.720644 11.842 1.10218 12 1.5 12H14.5C14.8978 12 15.2794 11.842 15.5607 11.5607C15.842 11.2794 16 10.8978 16 10.5V1.5C16 1.10218 15.842 0.720644 15.5607 0.43934C15.2794 0.158035 14.8978 0 14.5 0ZM15 10.5C15 10.6326 14.9473 10.7598 14.8536 10.8536C14.7598 10.9473 14.6326 11 14.5 11H1.5C1.36739 11 1.24021 10.9473 1.14645 10.8536C1.05268 10.7598 1 10.6326 1 10.5V1.5C1 1.36739 1.05268 1.24021 1.14645 1.14645C1.24021 1.05268 1.36739 1 1.5 1H14.5C14.6326 1 14.7598 1.05268 14.8536 1.14645C14.9473 1.24021 15 1.36739 15 1.5V10.5ZM7.89003 6.69043C7.71473 6.69081 7.54635 6.75888 7.42003 6.88043C7.35697 6.93932 7.30668 7.01054 7.27227 7.08967C7.23787 7.1688 7.22009 7.25415 7.22003 7.34043C7.21885 7.4269 7.23608 7.51263 7.27056 7.59194C7.30504 7.67124 7.35599 7.74231 7.42003 7.80043C7.54657 7.92146 7.71492 7.989 7.89003 7.989C8.06513 7.989 8.23348 7.92146 8.36003 7.80043C8.42276 7.74181 8.47219 7.67042 8.50497 7.59106C8.53775 7.5117 8.55311 7.42623 8.55003 7.34043C8.55185 7.25479 8.53591 7.1697 8.50321 7.09053C8.47051 7.01136 8.42175 6.93982 8.36003 6.88043C8.23371 6.75888 8.06533 6.69081 7.89003 6.69043ZM7.63541 4.04665C7.71623 4.01398 7.80288 3.99816 7.89003 4.00017C7.97718 3.99816 8.06382 4.01398 8.14464 4.04665C8.22546 4.07932 8.29875 4.12816 8.36003 4.19017C8.42276 4.24879 8.47219 4.32018 8.50497 4.39954C8.53775 4.4789 8.55311 4.56436 8.55003 4.65017C8.55185 4.73581 8.53591 4.8209 8.50321 4.90007C8.47051 4.97924 8.42175 5.05078 8.36003 5.11017C8.23348 5.2312 8.06513 5.29874 7.89003 5.29874C7.71492 5.29874 7.54657 5.2312 7.42003 5.11017C7.35697 5.05128 7.30668 4.98006 7.27227 4.90093C7.23787 4.8218 7.22009 4.73645 7.22003 4.65017C7.21885 4.5637 7.23608 4.47797 7.27056 4.39866C7.30504 4.31936 7.35599 4.24829 7.42003 4.19017C7.4813 4.12816 7.55459 4.07932 7.63541 4.04665ZM3 4.15965V5.23965L4.44 4.27965V8.85965H5.51V3.13965H4.6L3 4.15965ZM9.98999 5.23965V4.15965L11.59 3.13965H12.5V8.85965H11.42V4.27965L9.98999 5.23965Z",fill:"black"}))},SizeSmallIcon=function(props){return React.createElement("svg",_extends({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 0H0V1H14V0ZM14 13H0V14H14V13ZM12 9.5C12 10.3 11.3 11 10.5 11H3.5C2.7 11 2 10.3 2 9.5V4.5C2 3.7 2.7 3 3.5 3H10.5C11.3 3 12 3.7 12 4.5V9.5ZM3 4.5V9.5C3 9.8 3.2 10 3.5 10H10.5C10.8 10 11 9.8 11 9.5V4.5C11 4.2 10.8 4 10.5 4H3.5C3.2 4 3 4.2 3 4.5Z",fill:"#7247FF"}))},styles$4_panel_Container="_2PDcs";styleInject("._1__Fi,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}[dir] ._2PDcs{border:1px solid #ededed;box-shadow:var(--ricos-settings-whitebox-box-shadow,0 4px 8px 0 rgba(0,0,0,.1),0 0 4px 0 rgba(0,0,0,.1));border-radius:var(--ricos-settings-whitebox-border-radius,2px)}._2PDcs svg{height:unset;width:unset}");var Styles={fontElementMap:"_3WAMN",desktopPanel:"paq46"};styleInject("._3WAMN,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}.paq46{display:flex;flex-direction:column;align-items:flex-start;width:100%;align-items:center}[dir] .paq46{padding:8px 0}");var DesktopPanel=function(_ref){var options=_ref.options,externalFocus=_ref.externalFocus,theme=(useContext(RicosContext)||{}).theme,styles=mergeStyles({styles:Styles,theme:theme}),panelRef=useRef(null);useEffect((function(){var ref=panelRef.current;!externalFocus&&ref.focus()}),[]);var dropDownPanel=React.createElement("div",{tabIndex:-1,ref:panelRef,"data-hook":"toolbars-modal-desktopPanel",className:styles.desktopPanel},options);return externalFocus?dropDownPanel:React.createElement(FocusManager,null,dropDownPanel)},DropdownPanel=function(_ref){var options=_ref.options,panel=React.createElement(DesktopPanel,{options:options});return React.createElement("div",{className:styles$4_panel_Container},panel)},DropdownButton=function(_ref){var _cx,_cx2,Icon=_ref.Icon,dataHook=_ref.dataHook,tooltip=_ref.tooltip,options=_ref.options,id=_ref.id,_ref2=useContext(RicosContext)||{},isMobile=_ref2.isMobile,t=_ref2.t,modalService=useContext(ModalContext)||{},_useState=useState(null),referenceElement=_useState[0],setReferenceElement=_useState[1],ModalComponent=function(){return React.createElement("div",{tabIndex:-1,className:styles$5_modal},React.createElement(DropdownPanel,{options:options}))};useEffect((function(){modalService.register({Component:ModalComponent,id:id})}),[]),useEffect((function(){return modalService.unregister(id)}),[]);return React.createElement(Tooltip,{key:t(tooltip),content:t(tooltip),tooltipOffset:{x:0,y:-8}},React.createElement("div",{className:cx(styles$5_dropdownModalButtonWrapper,(_cx={},_cx[styles$5_mobileDropdownModalButtonWrapper]=isMobile,_cx)),ref:setReferenceElement},React.createElement("div",{"data-hook":dataHook,className:cx(styles$5_dropdownModalButton,(_cx2={},_cx2[styles$5_mobileDropdownModalButton]=isMobile,_cx2)),role:"button",onClick:function(){null!=modalService&&modalService.isModalOpen(id)?modalService.closeModal(id):null==modalService||modalService.openModal(id,{layout:isMobile?"drawer":"toolbar",positioning:{referenceElement:referenceElement,placement:"bottom"}})},tabIndex:0},React.createElement(Icon,null),React.createElement(DropdownArrowIcon,null))))},styles$3_buttonWrapper="_3PXfR",styles$3_active="_2bKwi",styles$3_disabled="EIZ9s",styles$3_mobileButtonWrapper="_2xMNG",styles$3_button="isNPD",styles$3_mobileButton="rTbef";styleInject("._3PXfR{color:var(--ricos-settings-text-color,#000)}[dir] ._3PXfR{background:transparent;padding:4px;cursor:pointer}[dir] ._3PXfR:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}._3PXfR._2bKwi{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3PXfR._2bKwi{background-color:rgba(var(--ricos-action-color-fallback-tuple,2,97,255),.1)}._3PXfR._2bKwi svg{fill:var(--ricos-settings-icons-color,currentColor);color:var(--ricos-settings-icons-color,currentColor)}._3PXfR.EIZ9s{opacity:.4}[dir] ._3PXfR.EIZ9s{cursor:default}[dir] ._3PXfR._2xMNG:not(._2bKwi):hover{background-color:unset}.isNPD{display:flex;align-items:center;justify-content:center;width:20px;height:20px}.isNPD.rTbef{width:32px;height:32px}");var ToggleButton=function(_ref){var _cx,_cx2,Icon=_ref.Icon,onClick=_ref.onClick,dataHook=_ref.dataHook,tooltip=_ref.tooltip,active=_ref.active,disabled=_ref.disabled,setRef=_ref.setRef,isMobile=(useContext(RicosContext)||{}).isMobile;return React.createElement(Tooltip,{key:tooltip,content:tooltip,tooltipOffset:{x:0,y:-8}},React.createElement("div",{className:cx(styles$3_buttonWrapper,(_cx={},_cx[styles$3_mobileButtonWrapper]=isMobile,_cx[styles$3_active]=active,_cx[styles$3_disabled]=disabled,_cx)),ref:setRef},React.createElement("div",{"data-hook":dataHook,onMouseDown:function(e){return e.preventDefault()},className:cx(styles$3_button,(_cx2={},_cx2[styles$3_mobileButton]=isMobile,_cx2)),role:"button",onClick:onClick,tabIndex:0},React.createElement(Icon,null))))},styles$2_container="_3xp71",styles$2_selected="_3Tmg_",styles$2_content="_2o70n",styles$2_prefix="CzSsK",styles$2_titleWrapper="_1lCEc",styles$2_title="_2UEur",styles$2_subtitle="_1AsLP",styles$2_suffix="_34TZF";styleInject("._2L7Dk,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}._3xp71{width:100%;color:var(--ricos-settings-text-color,#000)}[dir] ._3xp71{background-color:#fff}._3xp71._3Tmg_{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}@media only screen and (max-width:640px){._3xp71{height:47px}}._3xp71 ._2o70n{align-items:center;height:40px;display:grid;grid-auto-flow:column;grid-auto-columns:max-content auto max-content;grid-gap:12px}[dir=ltr] ._3xp71 ._2o70n,[dir=rtl] ._3xp71 ._2o70n{padding-left:20px;padding-right:20px}._3xp71 ._2o70n .CzSsK{align-self:left}._3xp71 ._2o70n ._1lCEc{display:grid;grid-auto-flow:row}._3xp71 ._2o70n ._1lCEc ._2UEur{font-size:14px}._3xp71 ._2o70n ._1lCEc ._1AsLP{font-size:12px;color:#646464}._3xp71 ._2o70n ._34TZF{align-self:right}._3xp71._3Tmg_,._3xp71:active{color:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3xp71._3Tmg_,[dir] ._3xp71:active{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-action-color-fallback-tuple,2,97,255)),.1)}._3xp71._3Tmg_ svg,._3xp71:active svg{color:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3xp71:hover{cursor:pointer;background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.05)}");var ListItemSelect=function(_ref){var _classNames,title=_ref.title,subtitle=_ref.subtitle,prefix=_ref.prefix,suffix=_ref.suffix,dataHook=_ref.dataHook,selected=_ref.selected,disabled=_ref.disabled,onClick=_ref.onClick,tooltip=_ref.tooltip,onKeyDown=_ref.onKeyDown;return React.createElement(Tooltip,{content:tooltip},React.createElement("div",{className:cx(styles$2_container,(_classNames={},_classNames[styles$2_selected]=selected,_classNames)),tabIndex:0,onKeyDown:onKeyDown,"data-hook":dataHook,"data-selected":selected,onClick:disabled?void 0:onClick},React.createElement("div",{className:styles$2_content},prefix&&React.createElement("div",{className:styles$2_prefix},prefix),React.createElement("div",{className:styles$2_titleWrapper},title&&React.createElement("div",{className:styles$2_title},title),subtitle&&React.createElement("div",{className:styles$2_subtitle},subtitle)),suffix&&React.createElement("div",{className:styles$2_suffix},suffix))))},styles$1={fontElementMap:"_3LF-I",whitespace:"_1vIFf",separator:"qiAdf"};styleInject("._3LF-I,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}[dir] ._1vIFf{margin:8px auto 0}._1vIFf .qiAdf{height:1px;width:calc(100% - 24px)}[dir] ._1vIFf .qiAdf{background-color:var(--ricos-settings-dividers-color,rgba(51,51,51,.2))}@media only screen and (max-width:640px){._1vIFf .qiAdf{width:100%}[dir] ._1vIFf .qiAdf{margin:0}}");var ListItemSection=function(_ref){var type=_ref.type;return React.createElement("div",{className:styles$1.whitespace},"divider"===type&&React.createElement("div",{className:styles$1.divider}))},styles_addPluginButton="_2gCVX";styleInject("._2gCVX{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}[dir] ._2gCVX{cursor:pointer;border:none;background-color:transparent}[dir] ._2gCVX:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}");var PluginMenuButton=function(_ref){var Icon=_ref.Icon,label=_ref.label,dataHook=_ref.dataHook,onClick=_ref.onClick,t=_ref.t,tooltipText=_ref.tooltipText,languageDir=_ref.languageDir,onButtonVisible=_ref.onButtonVisible;useEffect((function(){null==onButtonVisible||onButtonVisible()}),[]);var pluginButton=React.createElement("button",{dir:languageDir,"data-hook":dataHook,className:styles_addPluginButton,onClick:onClick},React.createElement(Icon,null),label&&React.createElement("div",null,t(label)));return React.createElement(ToolbarButton,{tooltipText:tooltipText,button:pluginButton})},PLUGIN_MENU_MODAL_ID="pluginMenu",AddPluginMenu=function(_ref){var referenceElement=_ref.referenceElement,_ref$helpers=_ref.helpers,helpers=void 0===_ref$helpers?{}:_ref$helpers,addPluginMenuConfig=_ref.addPluginMenuConfig,addButtons=_ref.addButtons,_ref2=useContext(RicosContext)||{},t=_ref2.t,theme=_ref2.theme,languageDir=_ref2.languageDir,isMobile=_ref2.isMobile,modalService=useContext(ModalContext)||{},getEditorCommands=useContext(EditorContext).getEditorCommands,uploadContext=useContext(UploadServiceContext),pluginModalLayout=function(isMobile){return isMobile?LAYOUTS.FULLSCREEN:LAYOUTS.POPOVER}(isMobile),pluginModalPlacement=function(isMobile,languageDir){return isMobile?PLACEMENTS.BOTTOM:"ltr"===languageDir?PLACEMENTS.RIGHT_START:PLACEMENTS.LEFT_START}(isMobile,languageDir),pluginMenuButtons=addButtons.asArray().map((function(addButton){var _button$menuConfig,_button$menuConfig2,button=addButton.getButton(),onButtonClick=function(){return function(button){var modal=button.modal,command=button.command;return modalService.closeModal("pluginMenu"),modal?null==modalService?void 0:modalService.openModal(modal.id,{positioning:{referenceElement:null==referenceElement?void 0:referenceElement.current,placement:pluginModalPlacement},layout:pluginModalLayout}):command(null==getEditorCommands?void 0:getEditorCommands(),uploadContext.uploadService,uploadContext.updateService)}(button)};return{component:function(_ref4){var onButtonVisible=_ref4.onButtonVisible;return function(_ref3,onClick,onButtonVisible){var icon=_ref3.icon,label=_ref3.label,tooltip=_ref3.tooltip,dataHook=_ref3.dataHook;return React.createElement(PluginMenuButton,{dataHook:dataHook,Icon:icon,label:label,onClick:onClick,tooltipText:t(tooltip),t:t,languageDir:languageDir,onButtonVisible:onButtonVisible})}(button,onButtonClick,onButtonVisible)},name:button.label,section:(null===(_button$menuConfig=button.menuConfig)||void 0===_button$menuConfig?void 0:_button$menuConfig.group)&&SECTIONS[null===(_button$menuConfig2=button.menuConfig)||void 0===_button$menuConfig2?void 0:_button$menuConfig2.group]}}));return React.createElement(AddPluginMenu$1,{pluginMenuButtonRef:referenceElement,helpers:helpers,theme:theme,plugins:pluginMenuButtons,isMobile:isMobile,addPluginMenuConfig:addPluginMenuConfig,t:t,isActive:!0})},ReplaceButton=function(_ref){var toolbarItem=_ref.toolbarItem,modalService=useContext(ModalContext)||{},uploadContext=useContext(UploadServiceContext),_useState=useState(null),referenceElement=_useState[0],setReferenceElement=_useState[1],_ref2=useContext(RicosContext)||{},t=_ref2.t,isMobile=_ref2.isMobile,node=toolbarItem.attributes.selectedNode;return React.createElement(ToggleButton,{Icon:ReplaceIcon,onClick:function(){return toolbarItem.commands.click({node:node,referenceElement:referenceElement,uploadContext:uploadContext,modalService:modalService,isMobile:isMobile})},dataHook:"baseToolbarButton_replace",tooltip:t("ReplaceButton_Tooltip"),setRef:setReferenceElement})},SettingsButton=function(_ref){var toolbarItem=_ref.toolbarItem,modalService=useContext(ModalContext)||{},_ref2=useContext(RicosContext)||{},isMobile=_ref2.isMobile,t=_ref2.t,_onClick=toolbarItem.commands.click,node=toolbarItem.attributes.selectedNode;return React.createElement(ToggleButton,{Icon:SettingsIcon,onClick:function(){return _onClick({modalService:modalService,isMobile:isMobile,node:node})},dataHook:"baseToolbarButton_settings",tooltip:t("SettingsButton_Tooltip")})},alignmentMap={LEFT:AlignLeftIcon,CENTER:AlignCenterIcon,RIGHT:AlignRightIcon},alignmentsMap={LEFT:{text:"AlignObject_Left_Tooltip",tooltip:"AlignObject_Left_Tooltip",commandKey:"LEFT",icon:AlignLeftIcon,dataHook:"blockAlignmentAndSizeButton_alignLeft"},CENTER:{text:"AlignObject_Center_Tooltip",tooltip:"AlignObject_Center_Tooltip",commandKey:"CENTER",icon:AlignCenterIcon,dataHook:"blockAlignmentAndSizeButton_alignCenter"},RIGHT:{text:"AlignObject_Right_Tooltip",tooltip:"AlignObject_Right_Tooltip",commandKey:"RIGHT",icon:AlignRightIcon,dataHook:"blockAlignmentAndSizeButton_alignRight"}},defaultAlignments=[alignmentsMap.LEFT,alignmentsMap.CENTER,alignmentsMap.RIGHT],NodeAlignmentButton=function(_ref){var options=_ref.options,toolbarItem=_ref.toolbarItem,_ref2=useContext(RicosContext)||{},t=_ref2.t,languageDir=_ref2.languageDir,selectedAlignment=(null==toolbarItem?void 0:toolbarItem.attributes.nodeAlignment)||("rtl"===languageDir?"RIGHT":"LEFT"),SelectedAlignmentIcon=alignmentMap[""+selectedAlignment],dropDownOptions=options?options.map((function(option){return alignmentsMap[option]})):defaultAlignments;return React.createElement(DropdownButton,{dataHook:"nodeAlignmentButton",id:"nodeAlignmentButton",options:dropDownOptions.map((function(_ref3){var dataHook=_ref3.dataHook,Icon=_ref3.icon,text=_ref3.text,commandKey=_ref3.commandKey,tooltip=_ref3.tooltip;return React.createElement(ListItemSelect,{key:commandKey,dataHook:dataHook,prefix:React.createElement(Icon,null),title:t(text),selected:commandKey===selectedAlignment,tooltip:t(tooltip),onClick:function(){var _toolbarItem$commands;return null===(_toolbarItem$commands=toolbarItem.commands)||void 0===_toolbarItem$commands?void 0:_toolbarItem$commands.setAlignment(commandKey)}})})),Icon:SelectedAlignmentIcon,tooltip:t("TextAlignmentButton_Tooltip")})},DeleteButton=function(_ref){var toolbarItem=_ref.toolbarItem,t=(useContext(RicosContext)||{}).t;return React.createElement(ToggleButton,{Icon:TrashIcon,onClick:toolbarItem.commands.delete,dataHook:"blockButton_delete",tooltip:t("DeleteButton_Tooltip")})},sizeMap={CONTENT:{text:"SizeContentButton_Tooltip",tooltip:"SizeContentButton_Tooltip",commandKey:"CONTENT",icon:SizeContentIcon,dataHook:"blockAlignmentAndSizeButton_sizeContent"},SMALL:{text:"SizeSmallCenterButton_Tooltip",tooltip:"SizeSmallCenterButton_Tooltip",commandKey:"SMALL",icon:SizeSmallIcon,dataHook:"blockAlignmentAndSizeButton_sizeSmall"},ORIGINAL:{text:"SizeOriginalButton_Tooltip",tooltip:"SizeOriginalButton_Tooltip",commandKey:"ORIGINAL",icon:SizeOriginalIcon,dataHook:"blockAlignmentAndSizeButton_sizeOriginal"},FULL_WIDTH:{text:"SizeFullWidthButton_Tooltip",tooltip:"SizeFullWidthButton_Tooltip",commandKey:"FULL_WIDTH",icon:SizeFullWidthIcon,dataHook:"blockAlignmentAndSizeButton_sizeFullWidth"}},defaultSize=[sizeMap.SMALL,sizeMap.CONTENT,sizeMap.FULL_WIDTH],sizeIconMap={CONTENT:SizeContentIcon,SMALL:SizeSmallIcon,ORIGINAL:SizeOriginalIcon,FULL_WIDTH:SizeFullWidthIcon},NodeSizeButton=function(_ref){var options=_ref.options,toolbarItem=_ref.toolbarItem,t=(useContext(RicosContext)||{}).t,selectedSize=(null==toolbarItem?void 0:toolbarItem.attributes.nodeSize)||"CONTENT",SelectedSizeIcon=sizeIconMap[""+selectedSize],dropDownOptions=options?options.map((function(option){return sizeMap[option]})):defaultSize;return React.createElement(DropdownButton,{dataHook:"NodeSizeButton",id:"NodeSizeButton",options:dropDownOptions.map((function(_ref3){var dataHook=_ref3.dataHook,Icon=_ref3.icon,text=_ref3.text,commandKey=_ref3.commandKey,tooltip=_ref3.tooltip;return React.createElement(ListItemSelect,{key:commandKey,dataHook:dataHook,prefix:React.createElement(Icon,null),title:t(text),selected:commandKey===selectedSize,tooltip:t(tooltip),onClick:function(){var _toolbarItem$commands;return null===(_toolbarItem$commands=toolbarItem.commands)||void 0===_toolbarItem$commands?void 0:_toolbarItem$commands.setSize(commandKey)}})})),Icon:SelectedSizeIcon,tooltip:t("ButtonModal_Size_Section")})};export{AddPluginMenu,AlignCenterIcon,AlignLeftIcon,AlignRightIcon,DeleteButton,DropdownArrowIcon,DropdownButton,DropdownPanel,LinkIcon,ListItemSection,ListItemSelect,NodeAlignmentButton,NodeSizeButton,PLUGIN_MENU_MODAL_ID,ReplaceButton,ReplaceIcon,SettingsButton,SettingsIcon,SizeContentIcon,SizeFullWidthIcon,SizeOriginalIcon,SizeSmallIcon,ToggleButton,TrashIcon}; | ||
import React,{useContext,useRef,useEffect,useState}from"react";import cx from"classnames";import _extends from"@babel/runtime/helpers/extends";import Tooltip from"wix-rich-content-common/libs/Tooltip";import{RicosContext,ModalContext,EditorContext}from"ricos-context";import{mergeStyles,UploadServiceContext}from"wix-rich-content-common";import{FocusManager}from"wix-rich-content-ui-components";import{SECTIONS,AddPluginMenu as AddPluginMenu$1}from"wix-rich-content-editor";import{ToolbarButton}from"wix-rich-content-editor-common";import{LAYOUTS,PLACEMENTS}from"ricos-modals";function styleInject(css,ref){void 0===ref&&(ref={});var insertAt=ref.insertAt;if(css&&"undefined"!=typeof document){var head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css","top"===insertAt&&head.firstChild?head.insertBefore(style,head.firstChild):head.appendChild(style),style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css))}}var styles$5_dropdownModalButtonWrapper="_3AWpK",styles$5_mobileDropdownModalButtonWrapper="_1h1be",styles$5_dropdownModalButton="_1lUT8",styles$5_mobileDropdownModalButton="_3Uqyy",styles$5_modal="_1INEN";styleInject("._3AWpK{color:var(--ricos-settings-text-color,#000)}[dir] ._3AWpK{background:transparent;padding:4px;cursor:pointer}[dir] ._3AWpK:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}._3AWpK._3BTSj{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3AWpK._3BTSj{background-color:rgba(var(--ricos-action-color-fallback-tuple,2,97,255),.1)}._3AWpK._3BTSj svg{fill:var(--ricos-settings-icons-color,currentColor);color:var(--ricos-settings-icons-color,currentColor)}[dir] ._3AWpK._1h1be:not(._3BTSj):hover{background-color:unset}._1lUT8{display:flex;align-items:center;justify-content:center;height:20px;min-width:20px;gap:8px}._1lUT8._3Uqyy{height:32px;min-width:32px}._1INEN{display:flex;flex-direction:column;z-index:10;width:162px;box-sizing:border-box}[dir] ._1INEN{box-shadow:0 0 10px 0 rgba(0,0,0,.06);border:1px solid rgba(51,51,51,.1);border-radius:2px;background-color:#fff}._1INEN *,._1INEN :after,._1INEN :before{box-sizing:inherit}._1INEN input{box-sizing:border-box}@media only screen and (max-width:640px){._1INEN{width:100%}}");var DropdownArrowIcon=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"6",viewBox:"0 0 8 6"},React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("g",{fill:"currentColor"},React.createElement("g",null,React.createElement("g",null,React.createElement("path",{d:"M2.873 1.873L-1.127 5.367 -0.469 6.127 2.873 3.207 6.216 6.127 6.873 5.367z",transform:"translate(-439.000000, -84.000000) translate(437.000000, 77.000000) translate(6.000000, 10.000000) rotate(-270.000000) translate(-6.000000, -10.000000) translate(3.500000, 6.000000) translate(2.873490, 4.000000) scale(1, -1) rotate(90.000000) translate(-2.873490, -4.000000)"}))))))},LinkIcon=function(props){return React.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13"},props),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("g",{fill:"currentColor"},React.createElement("g",null,React.createElement("path",{d:"M7.056 9.115c1.288-1.289 3.538-1.289 4.825 0l.343.342-.707.71-.343-.344c-.911-.914-2.5-.913-3.411 0l-2.06 2.058c-.94.94-.94 2.471 0 3.411.944.941 2.475.94 3.412 0l1.029-1.029.707.707L9.82 16c-.664.664-1.538.996-2.412.996-.873 0-1.747-.332-2.412-.997-1.33-1.33-1.33-3.495 0-4.825zm4.118-4.117c1.33-1.33 3.495-1.331 4.825 0 1.329 1.33 1.329 3.495 0 4.825l-2.06 2.059c-.643.644-1.501 1-2.412 1s-1.768-.356-2.412-1l-.344-.342.707-.71.344.344c.91.914 2.5.913 3.41 0l2.06-2.058c.939-.94.939-2.471 0-3.411-.941-.94-2.472-.938-3.411 0l-1.03 1.029-.706-.707z",transform:"translate(-247.000000, -81.000000) translate(243.000000, 77.000000)"})))))},TrashIcon=function(props){return React.createElement("svg",_extends({xmlnsXlink:"http://www.w3.org/1999/xlink",width:"19",height:"19",viewBox:"0 0 19 19"},props),React.createElement("defs",null,React.createElement("path",{id:"trash-icon-path",d:"M15 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5h-.8a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h12.6c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H15zm-1 0H5v10.8c0 .11.09.2.2.2h8.6a.2.2 0 0 0 .2-.2V5zM7.2 7h.6c.11 0 .2.09.2.2v6.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zm4 0h.6c.11 0 .2.09.2.2v6.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zM6.857 3v1H6V3a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1h-.857V3H6.857z"})),React.createElement("g",{fillRule:"evenodd"},React.createElement("mask",{id:"trash-icon-mask"},React.createElement("use",{xlinkHref:"#trash-icon-path"})),React.createElement("use",{xlinkHref:"#trash-icon-path"})))},SettingsIcon=function(props){return React.createElement("svg",_extends({width:19,height:19},props),React.createElement("path",{d:"M9.5 7A2.5 2.5 0 1 0 12 9.5 2.5 2.5 0 0 0 9.5 7zm0 4A1.5 1.5 0 1 1 11 9.5 1.5 1.5 0 0 1 9.5 11z"}),React.createElement("path",{d:"M17 8.66a.49.49 0 0 0-.48-.37 1.66 1.66 0 0 1-1.13-2.88.41.41 0 0 0 0-.56 7.4 7.4 0 0 0-1.19-1.2.42.42 0 0 0-.57 0 1.72 1.72 0 0 1-1.87.42 1.66 1.66 0 0 1-1-1.63.42.42 0 0 0-.39-.44 7.55 7.55 0 0 0-1.68 0 .42.42 0 0 0-.37.43 1.67 1.67 0 0 1-1 1.6 1.73 1.73 0 0 1-1.86-.42.42.42 0 0 0-.56 0 7.45 7.45 0 0 0-1.21 1.2.41.41 0 0 0 0 .57 1.66 1.66 0 0 1 .42 1.87 1.73 1.73 0 0 1-1.63 1 .41.41 0 0 0-.48.38 7.61 7.61 0 0 0 0 1.71.5.5 0 0 0 .49.37 1.64 1.64 0 0 1 1.54 1 1.67 1.67 0 0 1-.42 1.85.42.42 0 0 0 0 .56 7.45 7.45 0 0 0 1.19 1.2.42.42 0 0 0 .57 0 1.72 1.72 0 0 1 1.87-.42 1.66 1.66 0 0 1 1 1.63.42.42 0 0 0 .37.44 7.79 7.79 0 0 0 .86 0 7.55 7.55 0 0 0 .82 0 .42.42 0 0 0 .38-.43 1.67 1.67 0 0 1 1-1.6 1.73 1.73 0 0 1 1.86.42.42.42 0 0 0 .56 0 7.39 7.39 0 0 0 1.21-1.2.42.42 0 0 0 0-.57 1.66 1.66 0 0 1 1.11-2.89h.09a.42.42 0 0 0 .44-.37A7.52 7.52 0 0 0 17 8.66zm-1 1.12a2.64 2.64 0 0 0-2.06 1.66 2.67 2.67 0 0 0 .32 2.5c-.12.13-.24.25-.37.37a2.72 2.72 0 0 0-2.53-.31 2.71 2.71 0 0 0-1.63 2h-.5a2.67 2.67 0 0 0-1.59-2 2.79 2.79 0 0 0-1-.19 2.74 2.74 0 0 0-1.56.49l-.35-.36A2.69 2.69 0 0 0 5 11.36a2.63 2.63 0 0 0-2-1.62v-.53a2.73 2.73 0 0 0 2-1.55 2.69 2.69 0 0 0-.28-2.6l.37-.37a2.74 2.74 0 0 0 1.56.49A2.61 2.61 0 0 0 9.27 3h.5a2.67 2.67 0 0 0 1.59 2 2.72 2.72 0 0 0 2.57-.29c.12.11.24.23.35.36A2.68 2.68 0 0 0 14 7.61a2.64 2.64 0 0 0 2 1.65v.52z"}))},ReplaceIcon=function(props){return React.createElement("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.91888 3.35901L3.56788 5.01002L2.85988 5.71602L0.00488281 2.85601L2.89888 0L3.60188 0.711002L1.93288 2.35901H7.00388C10.8609 2.35901 13.9999 5.49802 13.9999 9.35503H12.9999C12.9999 6.04802 10.3109 3.35901 7.00388 3.35901H1.91888ZM12.1179 12.3594L10.4339 10.6754L11.1399 9.96738L13.9939 12.8214L11.1399 15.6754L10.4329 14.9684L12.0419 13.3594H6.99594C3.13897 13.3594 0 10.2184 0 6.35938H0.999991C0.999991 9.66838 3.68897 12.3594 6.99594 12.3594H12.1179Z",fill:"black"}))},AlignCenterIcon=function(props){return React.createElement("svg",_extends({width:"15",height:"18",viewBox:"0 0 15 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{d:"M13.5 10H8V8H10.5C11.3 8 12 7.3 12 6.5V3.5C12 2.7 11.3 2 10.5 2H8V0H7V2H4.5C3.7 2 3 2.7 3 3.5V6.5C3 7.3 3.7 8 4.5 8H7V10H1.5C0.7 10 0 10.7 0 11.5V14.5C0 15.3 0.7 16 1.5 16H7V18H8V16H13.5C14.3 16 15 15.3 15 14.5V11.5C15 10.7 14.3 10 13.5 10ZM4 6.5V3.5C4 3.2 4.2 3 4.5 3H10.5C10.8 3 11 3.2 11 3.5V6.5C11 6.8 10.8 7 10.5 7H4.5C4.2 7 4 6.8 4 6.5ZM14 14.5C14 14.8 13.8 15 13.5 15H1.5C1.2 15 1 14.8 1 14.5V11.5C1 11.2 1.2 11 1.5 11H13.5C13.8 11 14 11.2 14 11.5V14.5Z",fill:"black"}))},AlignLeftIcon=function(props){return React.createElement("svg",_extends({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 0H0V16H1V0ZM16 10.5C16 9.7 15.3 9 14.5 9H4.5C3.7 9 3 9.7 3 10.5V13.5C3 14.3 3.7 15 4.5 15H14.5C15.3 15 16 14.3 16 13.5V10.5ZM15 13.5C15 13.8 14.8 14 14.5 14H4.5C4.2 14 4 13.8 4 13.5V10.5C4 10.2 4.2 10 4.5 10H14.5C14.8 10 15 10.2 15 10.5V13.5ZM9.5 7H4.5C3.7 7 3 6.3 3 5.5V2.5C3 1.7 3.7 1 4.5 1H9.5C10.3 1 11 1.7 11 2.5V5.5C11 6.3 10.3 7 9.5 7ZM4.5 2C4.2 2 4 2.2 4 2.5V5.5C4 5.8 4.2 6 4.5 6H9.5C9.8 6 10 5.8 10 5.5V2.5C10 2.2 9.8 2 9.5 2H4.5Z",fill:"#7247FF"}))},AlignRightIcon=function(props){return React.createElement("svg",_extends({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 0H16V16H15V0ZM0 10.5C0 9.7 0.7 9 1.5 9H11.5C12.3 9 13 9.7 13 10.5V13.5C13 14.3 12.3 15 11.5 15H1.5C0.7 15 0 14.3 0 13.5V10.5ZM1 13.5C1 13.8 1.2 14 1.5 14H11.5C11.8 14 12 13.8 12 13.5V10.5C12 10.2 11.8 10 11.5 10H1.5C1.2 10 1 10.2 1 10.5V13.5ZM6.5 7H11.5C12.3 7 13 6.3 13 5.5V2.5C13 1.7 12.3 1 11.5 1H6.5C5.7 1 5 1.7 5 2.5V5.5C5 6.3 5.7 7 6.5 7ZM11.5 2C11.8 2 12 2.2 12 2.5V5.5C12 5.8 11.8 6 11.5 6H6.5C6.2 6 6 5.8 6 5.5V2.5C6 2.2 6.2 2 6.5 2H11.5Z",fill:"black"}))},SizeContentIcon=function(props){return React.createElement("svg",_extends({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 0H0V1H14V0ZM14 13H0V14H14V13ZM1.5 3H12.5C13.3 3 14 3.7 14 4.5V9.5C14 10.3 13.3 11 12.5 11H1.5C0.7 11 0 10.3 0 9.5V4.5C0 3.7 0.7 3 1.5 3ZM12.5 10C12.8 10 13 9.8 13 9.5V4.5C13 4.2 12.8 4 12.5 4H1.5C1.2 4 1 4.2 1 4.5V9.5C1 9.8 1.2 10 1.5 10H12.5Z",fill:"black"}))},SizeFullWidthIcon=function(props){return React.createElement("svg",_extends({width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 0H2V1H16V0ZM16 13H2V14H16V13ZM1.5 3H16.5C17.3 3 18 3.7 18 4.5V9.5C18 10.3 17.3 11 16.5 11H1.5C0.7 11 0 10.3 0 9.5V4.5C0 3.7 0.7 3 1.5 3ZM16.5 10C16.8 10 17 9.8 17 9.5V4.5C17 4.2 16.8 4 16.5 4H1.5C1.2 4 1 4.2 1 4.5V9.5C1 9.8 1.2 10 1.5 10H16.5Z",fill:"black"}))},SizeOriginalIcon=function(props){return React.createElement("svg",_extends({width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 0H1.5C1.10218 0 0.720644 0.158035 0.43934 0.43934C0.158035 0.720644 0 1.10218 0 1.5V10.5C0 10.8978 0.158035 11.2794 0.43934 11.5607C0.720644 11.842 1.10218 12 1.5 12H14.5C14.8978 12 15.2794 11.842 15.5607 11.5607C15.842 11.2794 16 10.8978 16 10.5V1.5C16 1.10218 15.842 0.720644 15.5607 0.43934C15.2794 0.158035 14.8978 0 14.5 0ZM15 10.5C15 10.6326 14.9473 10.7598 14.8536 10.8536C14.7598 10.9473 14.6326 11 14.5 11H1.5C1.36739 11 1.24021 10.9473 1.14645 10.8536C1.05268 10.7598 1 10.6326 1 10.5V1.5C1 1.36739 1.05268 1.24021 1.14645 1.14645C1.24021 1.05268 1.36739 1 1.5 1H14.5C14.6326 1 14.7598 1.05268 14.8536 1.14645C14.9473 1.24021 15 1.36739 15 1.5V10.5ZM7.89003 6.69043C7.71473 6.69081 7.54635 6.75888 7.42003 6.88043C7.35697 6.93932 7.30668 7.01054 7.27227 7.08967C7.23787 7.1688 7.22009 7.25415 7.22003 7.34043C7.21885 7.4269 7.23608 7.51263 7.27056 7.59194C7.30504 7.67124 7.35599 7.74231 7.42003 7.80043C7.54657 7.92146 7.71492 7.989 7.89003 7.989C8.06513 7.989 8.23348 7.92146 8.36003 7.80043C8.42276 7.74181 8.47219 7.67042 8.50497 7.59106C8.53775 7.5117 8.55311 7.42623 8.55003 7.34043C8.55185 7.25479 8.53591 7.1697 8.50321 7.09053C8.47051 7.01136 8.42175 6.93982 8.36003 6.88043C8.23371 6.75888 8.06533 6.69081 7.89003 6.69043ZM7.63541 4.04665C7.71623 4.01398 7.80288 3.99816 7.89003 4.00017C7.97718 3.99816 8.06382 4.01398 8.14464 4.04665C8.22546 4.07932 8.29875 4.12816 8.36003 4.19017C8.42276 4.24879 8.47219 4.32018 8.50497 4.39954C8.53775 4.4789 8.55311 4.56436 8.55003 4.65017C8.55185 4.73581 8.53591 4.8209 8.50321 4.90007C8.47051 4.97924 8.42175 5.05078 8.36003 5.11017C8.23348 5.2312 8.06513 5.29874 7.89003 5.29874C7.71492 5.29874 7.54657 5.2312 7.42003 5.11017C7.35697 5.05128 7.30668 4.98006 7.27227 4.90093C7.23787 4.8218 7.22009 4.73645 7.22003 4.65017C7.21885 4.5637 7.23608 4.47797 7.27056 4.39866C7.30504 4.31936 7.35599 4.24829 7.42003 4.19017C7.4813 4.12816 7.55459 4.07932 7.63541 4.04665ZM3 4.15965V5.23965L4.44 4.27965V8.85965H5.51V3.13965H4.6L3 4.15965ZM9.98999 5.23965V4.15965L11.59 3.13965H12.5V8.85965H11.42V4.27965L9.98999 5.23965Z",fill:"black"}))},SizeSmallIcon=function(props){return React.createElement("svg",_extends({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},props),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 0H0V1H14V0ZM14 13H0V14H14V13ZM12 9.5C12 10.3 11.3 11 10.5 11H3.5C2.7 11 2 10.3 2 9.5V4.5C2 3.7 2.7 3 3.5 3H10.5C11.3 3 12 3.7 12 4.5V9.5ZM3 4.5V9.5C3 9.8 3.2 10 3.5 10H10.5C10.8 10 11 9.8 11 9.5V4.5C11 4.2 10.8 4 10.5 4H3.5C3.2 4 3 4.2 3 4.5Z",fill:"#7247FF"}))},styles$4_panel_Container="_2PDcs";styleInject("._1__Fi,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}[dir] ._2PDcs{border:1px solid #ededed;box-shadow:var(--ricos-settings-whitebox-box-shadow,0 4px 8px 0 rgba(0,0,0,.1),0 0 4px 0 rgba(0,0,0,.1));border-radius:var(--ricos-settings-whitebox-border-radius,2px)}._2PDcs svg{height:unset;width:unset}");var Styles={fontElementMap:"_3WAMN",desktopPanel:"paq46"};styleInject("._3WAMN,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}.paq46{display:flex;flex-direction:column;align-items:flex-start;width:100%;align-items:center}[dir] .paq46{padding:8px 0}");var DesktopPanel=function(_ref){var options=_ref.options,externalFocus=_ref.externalFocus,theme=(useContext(RicosContext)||{}).theme,styles=mergeStyles({styles:Styles,theme:theme}),panelRef=useRef(null);useEffect((function(){var ref=panelRef.current;!externalFocus&&ref.focus()}),[]);var dropDownPanel=React.createElement("div",{tabIndex:-1,ref:panelRef,"data-hook":"toolbars-modal-desktopPanel",className:styles.desktopPanel},options);return externalFocus?dropDownPanel:React.createElement(FocusManager,null,dropDownPanel)},DropdownPanel=function(_ref){var options=_ref.options,panel=React.createElement(DesktopPanel,{options:options});return React.createElement("div",{className:styles$4_panel_Container},panel)},DropdownButton=function(_ref){var _cx,_cx2,Icon=_ref.Icon,dataHook=_ref.dataHook,tooltip=_ref.tooltip,options=_ref.options,id=_ref.id,_ref2=useContext(RicosContext)||{},isMobile=_ref2.isMobile,t=_ref2.t,modalService=useContext(ModalContext)||{},_useState=useState(null),referenceElement=_useState[0],setReferenceElement=_useState[1],ModalComponent=function(){return React.createElement("div",{tabIndex:-1,className:styles$5_modal},React.createElement(DropdownPanel,{options:options}))};useEffect((function(){modalService.register({Component:ModalComponent,id:id})}),[]),useEffect((function(){return modalService.unregister(id)}),[]);return React.createElement(Tooltip,{key:t(tooltip),content:t(tooltip),tooltipOffset:{x:0,y:-8}},React.createElement("div",{className:cx(styles$5_dropdownModalButtonWrapper,(_cx={},_cx[styles$5_mobileDropdownModalButtonWrapper]=isMobile,_cx)),ref:setReferenceElement},React.createElement("div",{"data-hook":dataHook,className:cx(styles$5_dropdownModalButton,(_cx2={},_cx2[styles$5_mobileDropdownModalButton]=isMobile,_cx2)),role:"button",onClick:function(){null!=modalService&&modalService.isModalOpen(id)?modalService.closeModal(id):null==modalService||modalService.openModal(id,{layout:isMobile?"drawer":"toolbar",positioning:{referenceElement:referenceElement,placement:"bottom"}})},tabIndex:0},React.createElement(Icon,null),React.createElement(DropdownArrowIcon,null))))},styles$3_buttonWrapper="_3PXfR",styles$3_active="_2bKwi",styles$3_disabled="EIZ9s",styles$3_mobileButtonWrapper="_2xMNG",styles$3_button="isNPD",styles$3_mobileButton="rTbef";styleInject("._3PXfR{color:var(--ricos-settings-text-color,#000)}[dir] ._3PXfR{background:transparent;padding:4px;cursor:pointer}[dir] ._3PXfR:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}._3PXfR._2bKwi{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3PXfR._2bKwi{background-color:rgba(var(--ricos-action-color-fallback-tuple,2,97,255),.1)}._3PXfR._2bKwi svg{fill:var(--ricos-settings-icons-color,currentColor);color:var(--ricos-settings-icons-color,currentColor)}._3PXfR.EIZ9s{opacity:.4}[dir] ._3PXfR.EIZ9s{cursor:default}[dir] ._3PXfR._2xMNG:not(._2bKwi):hover{background-color:unset}.isNPD{display:flex;align-items:center;justify-content:center;width:20px;height:20px}.isNPD.rTbef{width:32px;height:32px}");var ToggleButton=function(_ref){var _cx,_cx2,Icon=_ref.Icon,onClick=_ref.onClick,dataHook=_ref.dataHook,tooltip=_ref.tooltip,active=_ref.active,disabled=_ref.disabled,setRef=_ref.setRef,isMobile=(useContext(RicosContext)||{}).isMobile;return React.createElement(Tooltip,{key:tooltip,content:tooltip,tooltipOffset:{x:0,y:-8}},React.createElement("div",{className:cx(styles$3_buttonWrapper,(_cx={},_cx[styles$3_mobileButtonWrapper]=isMobile,_cx[styles$3_active]=active,_cx[styles$3_disabled]=disabled,_cx)),ref:setRef},React.createElement("div",{"data-hook":dataHook,onMouseDown:function(e){return e.preventDefault()},className:cx(styles$3_button,(_cx2={},_cx2[styles$3_mobileButton]=isMobile,_cx2)),role:"button",onClick:onClick,tabIndex:0},React.createElement(Icon,null))))},styles$2_container="_3xp71",styles$2_selected="_3Tmg_",styles$2_content="_2o70n",styles$2_prefix="CzSsK",styles$2_titleWrapper="_1lCEc",styles$2_title="_2UEur",styles$2_subtitle="_1AsLP",styles$2_suffix="_34TZF";styleInject("._2L7Dk,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}._3xp71{width:100%;color:var(--ricos-settings-text-color,#000)}[dir] ._3xp71{background-color:#fff}._3xp71._3Tmg_{color:var(--ricos-settings-text-color,var(--ricos-action-color-fallback,#0261ff))}@media only screen and (max-width:640px){._3xp71{height:47px}}._3xp71 ._2o70n{align-items:center;height:40px;display:grid;grid-auto-flow:column;grid-auto-columns:max-content auto max-content;grid-gap:12px}[dir=ltr] ._3xp71 ._2o70n,[dir=rtl] ._3xp71 ._2o70n{padding-left:20px;padding-right:20px}._3xp71 ._2o70n .CzSsK{align-self:left}._3xp71 ._2o70n ._1lCEc{display:grid;grid-auto-flow:row}._3xp71 ._2o70n ._1lCEc ._2UEur{font-size:14px}._3xp71 ._2o70n ._1lCEc ._1AsLP{font-size:12px;color:#646464}._3xp71 ._2o70n ._34TZF{align-self:right}._3xp71._3Tmg_,._3xp71:active{color:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3xp71._3Tmg_,[dir] ._3xp71:active{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-action-color-fallback-tuple,2,97,255)),.1)}._3xp71._3Tmg_ svg,._3xp71:active svg{color:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff));fill:var(--ricos-settings-action-color,var(--ricos-action-color-fallback,#0261ff))}[dir] ._3xp71:hover{cursor:pointer;background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.05)}");var ListItemSelect=function(_ref){var _classNames,title=_ref.title,subtitle=_ref.subtitle,prefix=_ref.prefix,suffix=_ref.suffix,dataHook=_ref.dataHook,selected=_ref.selected,disabled=_ref.disabled,onClick=_ref.onClick,tooltip=_ref.tooltip,onKeyDown=_ref.onKeyDown;return React.createElement(Tooltip,{content:tooltip},React.createElement("div",{className:cx(styles$2_container,(_classNames={},_classNames[styles$2_selected]=selected,_classNames)),tabIndex:0,onKeyDown:onKeyDown,"data-hook":dataHook,"data-selected":selected,onClick:disabled?void 0:onClick},React.createElement("div",{className:styles$2_content},prefix&&React.createElement("div",{className:styles$2_prefix},prefix),React.createElement("div",{className:styles$2_titleWrapper},title&&React.createElement("div",{className:styles$2_title},title),subtitle&&React.createElement("div",{className:styles$2_subtitle},subtitle)),suffix&&React.createElement("div",{className:styles$2_suffix},suffix))))},styles$1={fontElementMap:"_3LF-I",whitespace:"_1vIFf",separator:"qiAdf"};styleInject("._3LF-I,.glob_fontElementMap{font-family:var(--ricos-font-family,unset)}[dir] ._1vIFf{margin:8px auto 0}._1vIFf .qiAdf{height:1px;width:calc(100% - 24px)}[dir] ._1vIFf .qiAdf{background-color:var(--ricos-settings-dividers-color,rgba(51,51,51,.2))}@media only screen and (max-width:640px){._1vIFf .qiAdf{width:100%}[dir] ._1vIFf .qiAdf{margin:0}}");var ListItemSection=function(_ref){var type=_ref.type;return React.createElement("div",{className:styles$1.whitespace},"divider"===type&&React.createElement("div",{className:styles$1.divider}))},styles_addPluginButton="_2gCVX";styleInject("._2gCVX{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}[dir] ._2gCVX{cursor:pointer;border:none;background-color:transparent}[dir] ._2gCVX:hover{background-color:rgba(var(--ricos-settings-action-color-tuple,var(--ricos-fallback-color-tuple,0,0,0)),.06)}");var PluginMenuButton=function(_ref){var Icon=_ref.Icon,label=_ref.label,dataHook=_ref.dataHook,onClick=_ref.onClick,t=_ref.t,tooltipText=_ref.tooltipText,languageDir=_ref.languageDir,onButtonVisible=_ref.onButtonVisible;useEffect((function(){null==onButtonVisible||onButtonVisible()}),[]);var pluginButton=React.createElement("button",{dir:languageDir,"data-hook":dataHook,className:styles_addPluginButton,onClick:onClick},React.createElement(Icon,null),label&&React.createElement("div",null,t(label)));return React.createElement(ToolbarButton,{tooltipText:tooltipText,button:pluginButton})},PLUGIN_MENU_MODAL_ID="pluginMenu",AddPluginMenu=function(_ref){var referenceElement=_ref.referenceElement,_ref$helpers=_ref.helpers,helpers=void 0===_ref$helpers?{}:_ref$helpers,addPluginMenuConfig=_ref.addPluginMenuConfig,addButtons=_ref.addButtons,_ref2=useContext(RicosContext)||{},t=_ref2.t,theme=_ref2.theme,languageDir=_ref2.languageDir,isMobile=_ref2.isMobile,modalService=useContext(ModalContext)||{},getEditorCommands=useContext(EditorContext).getEditorCommands,uploadContext=useContext(UploadServiceContext),pluginModalLayout=function(isMobile){return isMobile?LAYOUTS.FULLSCREEN:LAYOUTS.POPOVER}(isMobile),pluginModalPlacement=function(isMobile,languageDir){return isMobile?PLACEMENTS.BOTTOM:"ltr"===languageDir?PLACEMENTS.RIGHT_START:PLACEMENTS.LEFT_START}(isMobile,languageDir),pluginMenuButtons=addButtons.asArray().map((function(addButton){var _button$menuConfig,_button$menuConfig2,button=addButton.getButton(),onButtonClick=function(){return function(button){var modal=button.modal,command=button.command;return modalService.closeModal("pluginMenu"),modal?null==modalService?void 0:modalService.openModal(modal.id,{positioning:{referenceElement:null==referenceElement?void 0:referenceElement.current,placement:pluginModalPlacement},layout:pluginModalLayout}):command(null==getEditorCommands?void 0:getEditorCommands(),uploadContext.uploadService,uploadContext.updateService)}(button)};return{component:function(_ref4){var onButtonVisible=_ref4.onButtonVisible;return function(_ref3,onClick,onButtonVisible){var icon=_ref3.icon,label=_ref3.label,tooltip=_ref3.tooltip,dataHook=_ref3.dataHook;return React.createElement(PluginMenuButton,{dataHook:dataHook,Icon:icon,label:label,onClick:onClick,tooltipText:t(tooltip),t:t,languageDir:languageDir,onButtonVisible:onButtonVisible})}(button,onButtonClick,onButtonVisible)},name:button.label,section:(null===(_button$menuConfig=button.menuConfig)||void 0===_button$menuConfig?void 0:_button$menuConfig.group)&&SECTIONS[null===(_button$menuConfig2=button.menuConfig)||void 0===_button$menuConfig2?void 0:_button$menuConfig2.group]}}));return React.createElement(AddPluginMenu$1,{pluginMenuButtonRef:referenceElement,helpers:helpers,theme:theme,plugins:pluginMenuButtons,isMobile:isMobile,addPluginMenuConfig:addPluginMenuConfig,t:t,isActive:!0})},ReplaceButton=function(_ref){var toolbarItem=_ref.toolbarItem,modalService=useContext(ModalContext)||{},uploadContext=useContext(UploadServiceContext),_useState=useState(null),referenceElement=_useState[0],setReferenceElement=_useState[1],_ref2=useContext(RicosContext)||{},t=_ref2.t,isMobile=_ref2.isMobile,node=toolbarItem.attributes.selectedNode;return React.createElement(ToggleButton,{Icon:ReplaceIcon,onClick:function(){return toolbarItem.commands.click({node:node,referenceElement:referenceElement,uploadContext:uploadContext,modalService:modalService,isMobile:isMobile})},dataHook:"baseToolbarButton_replace",tooltip:t("ReplaceButton_Tooltip"),setRef:setReferenceElement})},SettingsButton=function(_ref){var toolbarItem=_ref.toolbarItem,modalService=useContext(ModalContext)||{},_ref2=useContext(RicosContext)||{},isMobile=_ref2.isMobile,t=_ref2.t,_useContext=useContext(UploadServiceContext),uploadService=_useContext.uploadService,updateService=_useContext.updateService,_onClick=toolbarItem.commands.click,node=toolbarItem.attributes.selectedNode;return React.createElement(ToggleButton,{Icon:SettingsIcon,onClick:function(){return _onClick({modalService:modalService,isMobile:isMobile,node:node,uploadService:uploadService,updateService:updateService})},dataHook:"baseToolbarButton_settings",tooltip:t("SettingsButton_Tooltip")})},alignmentMap={LEFT:AlignLeftIcon,CENTER:AlignCenterIcon,RIGHT:AlignRightIcon},alignmentsMap={LEFT:{text:"AlignObject_Left_Tooltip",tooltip:"AlignObject_Left_Tooltip",commandKey:"LEFT",icon:AlignLeftIcon,dataHook:"blockAlignmentAndSizeButton_alignLeft"},CENTER:{text:"AlignObject_Center_Tooltip",tooltip:"AlignObject_Center_Tooltip",commandKey:"CENTER",icon:AlignCenterIcon,dataHook:"blockAlignmentAndSizeButton_alignCenter"},RIGHT:{text:"AlignObject_Right_Tooltip",tooltip:"AlignObject_Right_Tooltip",commandKey:"RIGHT",icon:AlignRightIcon,dataHook:"blockAlignmentAndSizeButton_alignRight"}},defaultAlignments=[alignmentsMap.LEFT,alignmentsMap.CENTER,alignmentsMap.RIGHT],NodeAlignmentButton=function(_ref){var options=_ref.options,toolbarItem=_ref.toolbarItem,_ref2=useContext(RicosContext)||{},t=_ref2.t,languageDir=_ref2.languageDir,selectedAlignment=(null==toolbarItem?void 0:toolbarItem.attributes.nodeAlignment)||("rtl"===languageDir?"RIGHT":"LEFT"),SelectedAlignmentIcon=alignmentMap[""+selectedAlignment],dropDownOptions=options?options.map((function(option){return alignmentsMap[option]})):defaultAlignments;return React.createElement(DropdownButton,{dataHook:"nodeAlignmentButton",id:"nodeAlignmentButton",options:dropDownOptions.map((function(_ref3){var dataHook=_ref3.dataHook,Icon=_ref3.icon,text=_ref3.text,commandKey=_ref3.commandKey,tooltip=_ref3.tooltip;return React.createElement(ListItemSelect,{key:commandKey,dataHook:dataHook,prefix:React.createElement(Icon,null),title:t(text),selected:commandKey===selectedAlignment,tooltip:t(tooltip),onClick:function(){var _toolbarItem$commands;return null===(_toolbarItem$commands=toolbarItem.commands)||void 0===_toolbarItem$commands?void 0:_toolbarItem$commands.setAlignment(commandKey)}})})),Icon:SelectedAlignmentIcon,tooltip:t("TextAlignmentButton_Tooltip")})},DeleteButton=function(_ref){var toolbarItem=_ref.toolbarItem,t=(useContext(RicosContext)||{}).t;return React.createElement(ToggleButton,{Icon:TrashIcon,onClick:toolbarItem.commands.delete,dataHook:"blockButton_delete",tooltip:t("DeleteButton_Tooltip")})},sizeMap={CONTENT:{text:"SizeContentButton_Tooltip",tooltip:"SizeContentButton_Tooltip",commandKey:"CONTENT",icon:SizeContentIcon,dataHook:"blockAlignmentAndSizeButton_sizeContent"},SMALL:{text:"SizeSmallCenterButton_Tooltip",tooltip:"SizeSmallCenterButton_Tooltip",commandKey:"SMALL",icon:SizeSmallIcon,dataHook:"blockAlignmentAndSizeButton_sizeSmall"},ORIGINAL:{text:"SizeOriginalButton_Tooltip",tooltip:"SizeOriginalButton_Tooltip",commandKey:"ORIGINAL",icon:SizeOriginalIcon,dataHook:"blockAlignmentAndSizeButton_sizeOriginal"},FULL_WIDTH:{text:"SizeFullWidthButton_Tooltip",tooltip:"SizeFullWidthButton_Tooltip",commandKey:"FULL_WIDTH",icon:SizeFullWidthIcon,dataHook:"blockAlignmentAndSizeButton_sizeFullWidth"}},defaultSize=[sizeMap.SMALL,sizeMap.CONTENT,sizeMap.FULL_WIDTH],sizeIconMap={CONTENT:SizeContentIcon,SMALL:SizeSmallIcon,ORIGINAL:SizeOriginalIcon,FULL_WIDTH:SizeFullWidthIcon},NodeSizeButton=function(_ref){var options=_ref.options,toolbarItem=_ref.toolbarItem,t=(useContext(RicosContext)||{}).t,selectedSize=(null==toolbarItem?void 0:toolbarItem.attributes.nodeSize)||"CONTENT",SelectedSizeIcon=sizeIconMap[""+selectedSize],dropDownOptions=options?options.map((function(option){return sizeMap[option]})):defaultSize;return React.createElement(DropdownButton,{dataHook:"NodeSizeButton",id:"NodeSizeButton",options:dropDownOptions.map((function(_ref3){var dataHook=_ref3.dataHook,Icon=_ref3.icon,text=_ref3.text,commandKey=_ref3.commandKey,tooltip=_ref3.tooltip;return React.createElement(ListItemSelect,{key:commandKey,dataHook:dataHook,prefix:React.createElement(Icon,null),title:t(text),selected:commandKey===selectedSize,tooltip:t(tooltip),onClick:function(){var _toolbarItem$commands;return null===(_toolbarItem$commands=toolbarItem.commands)||void 0===_toolbarItem$commands?void 0:_toolbarItem$commands.setSize(commandKey)}})})),Icon:SelectedSizeIcon,tooltip:t("ButtonModal_Size_Section")})};export{AddPluginMenu,AlignCenterIcon,AlignLeftIcon,AlignRightIcon,DeleteButton,DropdownArrowIcon,DropdownButton,DropdownPanel,LinkIcon,ListItemSection,ListItemSelect,NodeAlignmentButton,NodeSizeButton,PLUGIN_MENU_MODAL_ID,ReplaceButton,ReplaceIcon,SettingsButton,SettingsIcon,SizeContentIcon,SizeFullWidthIcon,SizeOriginalIcon,SizeSmallIcon,ToggleButton,TrashIcon}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "wix-rich-content-toolbars-ui", | ||
"version": "8.71.47", | ||
"version": "8.71.48", | ||
"author": { | ||
@@ -43,6 +43,6 @@ "name": "Dana Rish", | ||
"react-popper": "2.2.5", | ||
"ricos-context": "8.71.47", | ||
"ricos-schema": "8.71.47", | ||
"ricos-types": "8.71.47", | ||
"wix-rich-content-common": "8.71.47" | ||
"ricos-context": "8.71.48", | ||
"ricos-schema": "8.71.48", | ||
"ricos-types": "8.71.48", | ||
"wix-rich-content-common": "8.71.48" | ||
}, | ||
@@ -49,0 +49,0 @@ "unpkg": true, |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
187815
523
+ Addedricos-content@8.71.48(transitive)
+ Addedricos-context@8.71.48(transitive)
+ Addedricos-schema@8.71.48(transitive)
+ Addedricos-tiptap-types@8.71.48(transitive)
+ Addedricos-types@8.71.48(transitive)
+ Addedwix-rich-content-common@8.71.48(transitive)
+ Addedwix-rich-content-editor-common@8.71.48(transitive)
+ Addedwix-rich-content-ui-components@8.71.48(transitive)
- Removedricos-content@8.71.47(transitive)
- Removedricos-context@8.71.47(transitive)
- Removedricos-schema@8.71.47(transitive)
- Removedricos-tiptap-types@8.71.47(transitive)
- Removedricos-types@8.71.47(transitive)
- Removedwix-rich-content-common@8.71.47(transitive)
- Removedwix-rich-content-editor-common@8.71.47(transitive)
- Removedwix-rich-content-ui-components@8.71.47(transitive)
Updatedricos-context@8.71.48
Updatedricos-schema@8.71.48
Updatedricos-types@8.71.48