Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More →
Socket
Sign inDemoInstall
Socket

react-simple-wysiwyg

Package Overview
Dependencies
Maintainers
0
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-wysiwyg - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

4

lib/index.cjs.js

@@ -285,3 +285,3 @@ 'use strict';

var selectedIndex = parseInt(selectedValue, 10);
var _a = items[selectedIndex], command = _a[1], commandArgument = _a[2];
var _a = items[selectedIndex] || [], command = _a[1], commandArgument = _a[2];
e.preventDefault();

@@ -294,3 +294,3 @@ if (document.activeElement !== $el) {

}
else {
else if (command) {
document.execCommand(command, false, commandArgument);

@@ -297,0 +297,0 @@ }

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactSimpleWysiwyg={},e.React)}(this,(function(e,t){"use strict";var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function o(){if(document.selection)return document.selection.createRange().parentElement();var e=window.getSelection();return e&&e.rangeCount>0&&e.getRangeAt(0).startContainer.parentNode||void 0}function l(e){return e?e.replace(/&nbsp;|\u202F|\u00A0/g," "):""}"function"==typeof SuppressedError&&SuppressedError;var a=t.memo(t.forwardRef((function(e,o){var a=e.className,c=e.disabled,u=e.tagName,i=e.value,d=void 0===i?"":i,s=r(e,["className","disabled","tagName","value"]),m=t.useRef(),f=t.useRef(d),v=t.useRef(s);return t.useEffect((function(){v.current=s;var e=m.current;e&&l(f.current)!==l(d)&&(f.current=d,e.innerHTML=d,function(e){var t=document.createTextNode("");e.appendChild(t);var n=document.activeElement===e;if(null!==t&&null!==t.nodeValue&&n){var r=window.getSelection();if(null!==r){var o=document.createRange();o.setStart(t,t.nodeValue.length),o.collapse(!0),r.removeAllRanges(),r.addRange(o)}e instanceof HTMLElement&&e.focus()}}(e))})),t.useMemo((function(){function e(e){var t,r,o=m.current;if(o){var l=o.innerHTML;l!==f.current&&(null===(r=(t=v.current).onChange)||void 0===r||r.call(t,n(n({},e),{target:{value:l,name:s.name}}))),f.current=l}}return t.createElement(u||"div",n(n({},s),{className:a,contentEditable:!c,dangerouslySetInnerHTML:{__html:d},onBlur:function(t){return(v.current.onBlur||e)(t)},onInput:e,onKeyDown:function(t){return(v.current.onKeyDown||e)(t)},onKeyUp:function(t){return(v.current.onKeyUp||e)(t)},ref:function(e){m.current=e,"function"==typeof o?o(e):"object"==typeof o&&o&&(o.current=e)}}))}),[a,c,u])}))),c=t.createContext(void 0);function u(e){var r=e.children,o=t.useState({htmlMode:!1,update:function(e){a((function(t){return n(n(n({},t),e),{date:Date.now()})}))}}),l=o[0],a=o[1];return t.createElement(c.Provider,{value:l},r)}function i(){var e=t.useContext(c);if(!e)throw new Error("You should wrap your component by EditorProvider");return e}function d(e){var o=r(e,[]);return t.createElement("textarea",n({},o))}var s=[],m=[];function f(e){var l=e.children,c=e.containerProps,u=e.onSelect,s=r(e,["children","containerProps","onSelect"]),m=i();function f(e){var t;e.target!==m.$el&&((null===(t=m.$el)||void 0===t?void 0:t.contains(e.target))||m.update({$selection:void 0}))}return t.useEffect((function(){return document.addEventListener("click",f),function(){return document.removeEventListener("click",f)}})),m.htmlMode?t.createElement("div",n({className:"rsw-editor"},c),l,t.createElement(d,n({},s,{className:"rsw-ce rsw-html"}))):t.createElement("div",n({className:"rsw-editor"},c),l,t.createElement(a,n({},s,{ref:function(e){m.update({$el:e})},onSelect:function(e){null==u||u(e),m.update({$selection:o()})},className:"rsw-ce"})))}!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,l="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=s.indexOf(l);-1===a&&(a=s.push(l)-1,m[a]={}),n=m[a]&&m[a][r]?m[a][r]:m[a][r]=c()}else n=c();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var a="prepend"===r?"afterbegin":"beforeend";return l.insertAdjacentElement(a,e),e}}(".rsw-editor{border:1px solid #ddd;border-radius:.375rem;display:flex;flex-direction:column;min-height:100px;overflow:hidden}.rsw-ce{flex:1 0 auto;outline:none;padding:.5rem}.rsw-ce[contentEditable=true]:empty:not(:focus):before{color:grey;content:attr(placeholder)}.rsw-html{background:transparent;border:none;font-family:monospace,Courier New}.rsw-separator{align-self:stretch;border-right:1px solid #ddd;display:flex;margin:0 3px}.rsw-dd{box-sizing:border-box;outline:none}.rsw-btn{background:transparent;border:0;color:#222;cursor:pointer;font-size:1em;height:2em;outline:none;padding:0;width:2em}.rsw-btn:hover{background:#eaeaea}.rsw-btn[data-active=true]{background:#e0e0e0}.rsw-toolbar{align-items:center;background-color:#f5f5f5;border-bottom:1px solid #ddd;display:flex}",{});var v=N("Bold","𝐁","bold"),p=N("Bullet list",t.createElement((function(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},t.createElement("path",{fill:"currentColor",d:"M7 5h14v2H7V5zm0 8v-2h14v2H7zM4 4.50001c.83 0 1.5.66992 1.5 1.5 0 .83007-.67 1.5-1.5 1.5s-1.5-.66993-1.5-1.5c0-.83008.67-1.5 1.5-1.5zM4 10.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zM7 19v-2h14v2H7zm-3-2.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z"}))}),null),"insertUnorderedList"),h=N("Clear formatting","TĖēₓ","removeFormat"),E=N("Italic","𝑰","italic"),g=N("Strike through",t.createElement("s",null,"ab"),"strikeThrough"),b=N("Link","🔗",(function(e){var t=e.$selection;"A"===(null==t?void 0:t.nodeName)?document.execCommand("unlink"):document.execCommand("createLink",!1,prompt("URL","")||void 0)})),y=N("Numbered list",t.createElement((function(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},t.createElement("path",{fill:"currentColor",d:"M6.99938 12.998v-2H20.9994v2H6.99938zm0 6.0001v-2H20.9994v2H6.99938zm0-12.00001v-2H20.9994v2H6.99938zm-4 1v-3h-1v-1h2v4h-1zm-1 9.00001v-1h3v4h-3v-1h2v-.5h-1v-1h1v-.5h-2zM4.25 10c.41421 0 .75.3358.75.75 0 .2024-.08017.3861-.2105.521L3.11983 13H5v1H2v-.9218L4 11H2v-1h2.25z"}))}),null),"insertOrderedList"),w=N("Redo","↷","redo"),x=N("Underline",t.createElement("span",{style:{textDecoration:"underline"}},"𝐔"),"underline"),B=N("Undo","â†ķ","undo");function N(e,r,o){return l.displayName=e.replace(/\s/g,""),l;function l(l){var a=i(),c=a.$el,u=a.$selection,d=!1;return"string"==typeof o&&(d=!!u&&document.queryCommandState(o)),a.htmlMode?null:t.createElement("button",n({type:"button",title:e},l,{className:"rsw-btn",onMouseDown:function(e){e.preventDefault(),document.activeElement!==c&&(null==c||c.focus()),"function"==typeof o?o(a):document.execCommand(o)},"data-active":d}),r)}}var S=k("Styles",[["Normal","formatBlock","DIV"],["𝗛ð—ēð—Ūð—ąð—ēð—ŋ 𝟭","formatBlock","H1"],["Header 2","formatBlock","H2"],["ð™ē𝚘𝚍𝚎","formatBlock","PRE"]]);function k(e,r){return o.displayName=e,o;function o(o){var l=i(),a=l.$el,c=l.$selection;if(l.htmlMode)return null;var u=r.findIndex((function(e){return"formatBlock"===e[1]&&(null==c?void 0:c.nodeName)===e[2]}));return t.createElement(C,n({},o,{onChange:function(e){var t=e.target,n=t.value,o=parseInt(n,10),c=r[o],u=c[1],i=c[2];e.preventDefault(),document.activeElement!==a&&(null==a||a.focus());"function"==typeof u?u(l):document.execCommand(u,!1,i);setTimeout((function(){return t.value=n}),10)},title:e,items:r,selected:u}))}}function C(e){var o=e.items,l=e.selected,a=r(e,["items","selected"]);return t.createElement("select",n({},a,{value:l,className:"rsw-dd"}),t.createElement("option",{hidden:!0},a.title),o.map((function(e,n){return t.createElement("option",{key:e[2],value:n},e[0])})))}function H(e){var o=r(e,[]),l=i();return t.createElement("button",n({type:"button",title:"HTML mode",className:"rsw-btn",onClick:function(){l.update({htmlMode:!l.htmlMode})},"data-active":l.htmlMode},o),"</>")}function M(){return i().htmlMode?null:t.createElement("div",{className:"rsw-separator"})}function L(e){return t.createElement("div",n({},e,{className:"rsw-toolbar"}))}function T(e){return t.createElement(u,null,t.createElement(f,n({},e),t.createElement(L,null,t.createElement(B,null),t.createElement(w,null),t.createElement(M,null),t.createElement(v,null),t.createElement(E,null),t.createElement(x,null),t.createElement(g,null),t.createElement(M,null),t.createElement(y,null),t.createElement(p,null),t.createElement(M,null),t.createElement(b,null),t.createElement(h,null),t.createElement(H,null),t.createElement(M,null),t.createElement(S,null))))}e.BtnBold=v,e.BtnBulletList=p,e.BtnClearFormatting=h,e.BtnItalic=E,e.BtnLink=b,e.BtnNumberedList=y,e.BtnRedo=w,e.BtnStrikeThrough=g,e.BtnStyles=S,e.BtnUnderline=x,e.BtnUndo=B,e.ContentEditable=a,e.DefaultEditor=T,e.Dropdown=C,e.Editor=f,e.EditorContext=c,e.EditorProvider=u,e.HtmlButton=H,e.HtmlEditor=d,e.Separator=M,e.Toolbar=L,e.createButton=N,e.createDropdown=k,e.default=T,e.useEditorState=i,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactSimpleWysiwyg={},e.React)}(this,(function(e,t){"use strict";var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function o(){if(document.selection)return document.selection.createRange().parentElement();var e=window.getSelection();return e&&e.rangeCount>0&&e.getRangeAt(0).startContainer.parentNode||void 0}function l(e){return e?e.replace(/&nbsp;|\u202F|\u00A0/g," "):""}"function"==typeof SuppressedError&&SuppressedError;var a=t.memo(t.forwardRef((function(e,o){var a=e.className,c=e.disabled,u=e.tagName,i=e.value,d=void 0===i?"":i,s=r(e,["className","disabled","tagName","value"]),m=t.useRef(),f=t.useRef(d),v=t.useRef(s);return t.useEffect((function(){v.current=s;var e=m.current;e&&l(f.current)!==l(d)&&(f.current=d,e.innerHTML=d,function(e){var t=document.createTextNode("");e.appendChild(t);var n=document.activeElement===e;if(null!==t&&null!==t.nodeValue&&n){var r=window.getSelection();if(null!==r){var o=document.createRange();o.setStart(t,t.nodeValue.length),o.collapse(!0),r.removeAllRanges(),r.addRange(o)}e instanceof HTMLElement&&e.focus()}}(e))})),t.useMemo((function(){function e(e){var t,r,o=m.current;if(o){var l=o.innerHTML;l!==f.current&&(null===(r=(t=v.current).onChange)||void 0===r||r.call(t,n(n({},e),{target:{value:l,name:s.name}}))),f.current=l}}return t.createElement(u||"div",n(n({},s),{className:a,contentEditable:!c,dangerouslySetInnerHTML:{__html:d},onBlur:function(t){return(v.current.onBlur||e)(t)},onInput:e,onKeyDown:function(t){return(v.current.onKeyDown||e)(t)},onKeyUp:function(t){return(v.current.onKeyUp||e)(t)},ref:function(e){m.current=e,"function"==typeof o?o(e):"object"==typeof o&&o&&(o.current=e)}}))}),[a,c,u])}))),c=t.createContext(void 0);function u(e){var r=e.children,o=t.useState({htmlMode:!1,update:function(e){a((function(t){return n(n(n({},t),e),{date:Date.now()})}))}}),l=o[0],a=o[1];return t.createElement(c.Provider,{value:l},r)}function i(){var e=t.useContext(c);if(!e)throw new Error("You should wrap your component by EditorProvider");return e}function d(e){var o=r(e,[]);return t.createElement("textarea",n({},o))}var s=[],m=[];function f(e){var l=e.children,c=e.containerProps,u=e.onSelect,s=r(e,["children","containerProps","onSelect"]),m=i();function f(e){var t;e.target!==m.$el&&((null===(t=m.$el)||void 0===t?void 0:t.contains(e.target))||m.update({$selection:void 0}))}return t.useEffect((function(){return document.addEventListener("click",f),function(){return document.removeEventListener("click",f)}})),m.htmlMode?t.createElement("div",n({className:"rsw-editor"},c),l,t.createElement(d,n({},s,{className:"rsw-ce rsw-html"}))):t.createElement("div",n({className:"rsw-editor"},c),l,t.createElement(a,n({},s,{ref:function(e){m.update({$el:e})},onSelect:function(e){null==u||u(e),m.update({$selection:o()})},className:"rsw-ce"})))}!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,l="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=s.indexOf(l);-1===a&&(a=s.push(l)-1,m[a]={}),n=m[a]&&m[a][r]?m[a][r]:m[a][r]=c()}else n=c();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var a="prepend"===r?"afterbegin":"beforeend";return l.insertAdjacentElement(a,e),e}}(".rsw-editor{border:1px solid #ddd;border-radius:.375rem;display:flex;flex-direction:column;min-height:100px;overflow:hidden}.rsw-ce{flex:1 0 auto;outline:none;padding:.5rem}.rsw-ce[contentEditable=true]:empty:not(:focus):before{color:grey;content:attr(placeholder)}.rsw-html{background:transparent;border:none;font-family:monospace,Courier New}.rsw-separator{align-self:stretch;border-right:1px solid #ddd;display:flex;margin:0 3px}.rsw-dd{box-sizing:border-box;outline:none}.rsw-btn{background:transparent;border:0;color:#222;cursor:pointer;font-size:1em;height:2em;outline:none;padding:0;width:2em}.rsw-btn:hover{background:#eaeaea}.rsw-btn[data-active=true]{background:#e0e0e0}.rsw-toolbar{align-items:center;background-color:#f5f5f5;border-bottom:1px solid #ddd;display:flex}",{});var v=N("Bold","𝐁","bold"),p=N("Bullet list",t.createElement((function(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},t.createElement("path",{fill:"currentColor",d:"M7 5h14v2H7V5zm0 8v-2h14v2H7zM4 4.50001c.83 0 1.5.66992 1.5 1.5 0 .83007-.67 1.5-1.5 1.5s-1.5-.66993-1.5-1.5c0-.83008.67-1.5 1.5-1.5zM4 10.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zM7 19v-2h14v2H7zm-3-2.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z"}))}),null),"insertUnorderedList"),h=N("Clear formatting","TĖēₓ","removeFormat"),E=N("Italic","𝑰","italic"),g=N("Strike through",t.createElement("s",null,"ab"),"strikeThrough"),b=N("Link","🔗",(function(e){var t=e.$selection;"A"===(null==t?void 0:t.nodeName)?document.execCommand("unlink"):document.execCommand("createLink",!1,prompt("URL","")||void 0)})),y=N("Numbered list",t.createElement((function(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},t.createElement("path",{fill:"currentColor",d:"M6.99938 12.998v-2H20.9994v2H6.99938zm0 6.0001v-2H20.9994v2H6.99938zm0-12.00001v-2H20.9994v2H6.99938zm-4 1v-3h-1v-1h2v4h-1zm-1 9.00001v-1h3v4h-3v-1h2v-.5h-1v-1h1v-.5h-2zM4.25 10c.41421 0 .75.3358.75.75 0 .2024-.08017.3861-.2105.521L3.11983 13H5v1H2v-.9218L4 11H2v-1h2.25z"}))}),null),"insertOrderedList"),w=N("Redo","↷","redo"),x=N("Underline",t.createElement("span",{style:{textDecoration:"underline"}},"𝐔"),"underline"),B=N("Undo","â†ķ","undo");function N(e,r,o){return l.displayName=e.replace(/\s/g,""),l;function l(l){var a=i(),c=a.$el,u=a.$selection,d=!1;return"string"==typeof o&&(d=!!u&&document.queryCommandState(o)),a.htmlMode?null:t.createElement("button",n({type:"button",title:e},l,{className:"rsw-btn",onMouseDown:function(e){e.preventDefault(),document.activeElement!==c&&(null==c||c.focus()),"function"==typeof o?o(a):document.execCommand(o)},"data-active":d}),r)}}var S=k("Styles",[["Normal","formatBlock","DIV"],["𝗛ð—ēð—Ūð—ąð—ēð—ŋ 𝟭","formatBlock","H1"],["Header 2","formatBlock","H2"],["ð™ē𝚘𝚍𝚎","formatBlock","PRE"]]);function k(e,r){return o.displayName=e,o;function o(o){var l=i(),a=l.$el,c=l.$selection;if(l.htmlMode)return null;var u=r.findIndex((function(e){return"formatBlock"===e[1]&&(null==c?void 0:c.nodeName)===e[2]}));return t.createElement(C,n({},o,{onChange:function(e){var t=e.target,n=t.value,o=parseInt(n,10),c=r[o]||[],u=c[1],i=c[2];e.preventDefault(),document.activeElement!==a&&(null==a||a.focus());"function"==typeof u?u(l):u&&document.execCommand(u,!1,i);setTimeout((function(){return t.value=n}),10)},title:e,items:r,selected:u}))}}function C(e){var o=e.items,l=e.selected,a=r(e,["items","selected"]);return t.createElement("select",n({},a,{value:l,className:"rsw-dd"}),t.createElement("option",{hidden:!0},a.title),o.map((function(e,n){return t.createElement("option",{key:e[2],value:n},e[0])})))}function H(e){var o=r(e,[]),l=i();return t.createElement("button",n({type:"button",title:"HTML mode",className:"rsw-btn",onClick:function(){l.update({htmlMode:!l.htmlMode})},"data-active":l.htmlMode},o),"</>")}function M(){return i().htmlMode?null:t.createElement("div",{className:"rsw-separator"})}function L(e){return t.createElement("div",n({},e,{className:"rsw-toolbar"}))}function T(e){return t.createElement(u,null,t.createElement(f,n({},e),t.createElement(L,null,t.createElement(B,null),t.createElement(w,null),t.createElement(M,null),t.createElement(v,null),t.createElement(E,null),t.createElement(x,null),t.createElement(g,null),t.createElement(M,null),t.createElement(y,null),t.createElement(p,null),t.createElement(M,null),t.createElement(b,null),t.createElement(h,null),t.createElement(H,null),t.createElement(M,null),t.createElement(S,null))))}e.BtnBold=v,e.BtnBulletList=p,e.BtnClearFormatting=h,e.BtnItalic=E,e.BtnLink=b,e.BtnNumberedList=y,e.BtnRedo=w,e.BtnStrikeThrough=g,e.BtnStyles=S,e.BtnUnderline=x,e.BtnUndo=B,e.ContentEditable=a,e.DefaultEditor=T,e.Dropdown=C,e.Editor=f,e.EditorContext=c,e.EditorProvider=u,e.HtmlButton=H,e.HtmlEditor=d,e.Separator=M,e.Toolbar=L,e.createButton=N,e.createDropdown=k,e.default=T,e.useEditorState=i,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "react-simple-wysiwyg",
"version": "3.0.2",
"version": "3.0.3",
"description": "Simple and lightweight React WYSIWYG editor",

@@ -5,0 +5,0 @@ "main": "lib/index.cjs.js",

# react-simple-wysiwyg
[![Build Status](https://travis-ci.org/megahertz/react-simple-wysiwyg.svg?branch=master)](https://travis-ci.org/megahertz/react-simple-wysiwyg)
[![Tests](https://github.com/megahertz/react-simple-wysiwyg/actions/workflows/tests.yml/badge.svg)](https://github.com/megahertz/react-simple-wysiwyg/actions/workflows/tests.yml)
[![NPM version](https://badge.fury.io/js/react-simple-wysiwyg.svg)](https://badge.fury.io/js/react-simple-wysiwyg)

@@ -162,3 +162,27 @@ [![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-simple-wysiwyg.svg?color=rgb%2868%2C%20204%2C%2017%29)](https://bundlephobia.com/result?p=react-simple-wysiwyg)

## Troubleshooting
### Style issues: no list item bullets, wrong link styles and so on
[#31](https://github.com/megahertz/react-simple-wysiwyg/issues/31),
[#44](https://github.com/megahertz/react-simple-wysiwyg/issues/44),
[#45](https://github.com/megahertz/react-simple-wysiwyg/issues/45)
RSW editor doesn't isolate its styles from the parent styles.
It's a pretty common case when you use a global reset or normalize styles which
remove bullets or numbers for lists.
To fix that, you should redefine these styles again:
```css
.rsw-ce ul {
list-style: disc;
padding-left: 2em;
}
.rsw-ce ol {
list-style: decimal;
padding-left: 2em;
}
```
## Credits

@@ -165,0 +189,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡ïļ by Socket Inc