suneditor 2.43.10 → 2.43.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suneditor",
3
- "version": "2.43.10",
3
+ "version": "2.43.13",
4
4
  "description": "Pure JavaScript based WYSIWYG web editor",
5
5
  "author": "JiHong.Lee",
6
6
  "license": "MIT",
package/src/lib/core.js CHANGED
@@ -5102,11 +5102,11 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
5102
5102
  .replace(this.editorTagsBlacklistRegExp, '');
5103
5103
  },
5104
5104
 
5105
- _cleanStyle: function (m, v, tagName) {
5105
+ _cleanStyle: function (m, v, name) {
5106
5106
  const sv = m.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/);
5107
5107
  if (sv) {
5108
5108
  if (!v) v = [];
5109
- const style = sv[0].replace(/"/g, '').match(this._cleanStyleRegExp[tagName]);
5109
+ const style = sv[0].replace(/"/g, '').match(this._cleanStyleRegExp[name]);
5110
5110
  if (style) {
5111
5111
  const allowedStyle = [];
5112
5112
  for (let i = 0, len = style.length, r; i < len; i++) {
@@ -5123,10 +5123,10 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
5123
5123
  if (!options.plugins.fontSize) continue;
5124
5124
  break;
5125
5125
  case 'color':
5126
- if (!options.plugins.fontColor) continue;
5126
+ if (!options.plugins.fontColor || /rgba\(([0-9]+\s*,\s*){3}0\)|windowtext/i.test(c)) continue;
5127
5127
  break;
5128
5128
  case 'backgroundColor':
5129
- if (!options.plugins.hiliteColor) continue;
5129
+ if (!options.plugins.hiliteColor || /rgba\(([0-9]+\s*,\s*){3}0\)|windowtext/i.test(c)) continue;
5130
5130
  break;
5131
5131
  }
5132
5132
 
@@ -5845,7 +5845,6 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
5845
5845
  }
5846
5846
 
5847
5847
  this._initWysiwygArea(reload, _initHTML);
5848
- this.setDir(options.rtl ? 'rtl' : 'ltr');
5849
5848
  },
5850
5849
 
5851
5850
  /**
@@ -6325,8 +6324,6 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
6325
6324
 
6326
6325
  if (!command && !display) return;
6327
6326
  if (target.disabled) return;
6328
- if (!core.isReadOnly && !core.hasFocus) core.nativeFocus();
6329
- if (!core.isReadOnly && !core._variable.isCodeView) core._editorRange();
6330
6327
 
6331
6328
  core.actionCall(command, display, target);
6332
6329
  },
package/src/options.d.ts CHANGED
@@ -94,6 +94,10 @@ export interface SunEditorOptions {
94
94
  * Top offset value of "sticky toolbar".
95
95
  */
96
96
  stickyToolbar?: number | string;
97
+ /**
98
+ * The toolbar is rendered hidden.
99
+ */
100
+ hideToolbar?: boolean;
97
101
  /**
98
102
  * Top offset value of "full Screen".
99
103
  */
@@ -127,7 +127,7 @@ export default {
127
127
  contextAnchor.newWindowCheck.checked = this.options.linkTargetNewWindow;
128
128
  } else if (contextAnchor.linkAnchor) {
129
129
  this.context.dialog.updateModal = true;
130
- const href = this.options.linkNoPrefix ? contextAnchor.linkAnchor.href.replace(contextAnchor.linkAnchor.origin + '/', '') : contextAnchor.linkAnchor.href;
130
+ const href = contextAnchor.linkAnchor.getAttribute('href');
131
131
  contextAnchor.linkValue = contextAnchor.preview.textContent = contextAnchor.urlInput.value = anchorPlugin.selfPathBookmark.call(this, href) ? href.substr(href.lastIndexOf('#')) : href;
132
132
  contextAnchor.anchorText.value = contextAnchor.linkAnchor.textContent || contextAnchor.linkAnchor.getAttribute('alt');
133
133
  contextAnchor.newWindowCheck.checked = (/_blank/i.test(contextAnchor.linkAnchor.target) ? true : false);