@wangeditor-next/core 1.5.1 → 1.5.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.5.2](https://github.com/cycleccc/wangEditor/compare/@wangeditor-next/core@1.5.0...@wangeditor-next/core@1.5.2) (2024-07-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * remove extra lists when pasting Feishu doc lists ([bd2d905](https://github.com/cycleccc/wangEditor/commit/bd2d90556404e3b5b82ff114931d7a1be1126556))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.5.1](https://github.com/cycleccc/wangEditor/compare/@wangeditor-next/core@1.5.0...@wangeditor-next/core@1.5.1) (2024-07-14)
7
18
 
8
19
 
package/dist/index.esm.js CHANGED
@@ -292,7 +292,7 @@ var shouldClear = op => {
292
292
  return true;
293
293
  };
294
294
 
295
- /*! *****************************************************************************
295
+ /******************************************************************************
296
296
  Copyright (c) Microsoft Corporation.
297
297
 
298
298
  Permission to use, copy, modify, and/or distribute this software for any
@@ -306,7 +306,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
306
306
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
307
307
  PERFORMANCE OF THIS SOFTWARE.
308
308
  ***************************************************************************** */
309
- /* global Reflect, Promise */
309
+ /* global Reflect, Promise, SuppressedError, Symbol */
310
310
 
311
311
  var extendStatics = function(d, b) {
312
312
  extendStatics = Object.setPrototypeOf ||
@@ -363,11 +363,20 @@ function __read(o, n) {
363
363
  return ar;
364
364
  }
365
365
 
366
- function __spreadArray(to, from) {
367
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
368
- to[j] = from[i];
369
- return to;
370
- }
366
+ function __spreadArray(to, from, pack) {
367
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
368
+ if (ar || !(i in from)) {
369
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
370
+ ar[i] = from[i];
371
+ }
372
+ }
373
+ return to.concat(ar || Array.prototype.slice.call(from));
374
+ }
375
+
376
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
377
+ var e = new Error(message);
378
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
379
+ };
371
380
 
372
381
  /**
373
382
  * An auto-incrementing identifier for keys.
@@ -2802,9 +2811,13 @@ var withContent = function (editor) {
2802
2811
  if (!DomEditor.isSelectedEmptyParagraph(e)) {
2803
2812
  // 当前不是空行,且 非 inline - 则换行
2804
2813
  if (display.indexOf('inline') < 0) {
2805
- var el_1 = domNodes[index - 1];
2806
- if (el_1.matches('ul:not([data-w-e-type]),ol:not([data-w-e-type])')) {
2807
- e.insertBreak(); // 列表项,需要插入空行
2814
+ if (index >= 1) {
2815
+ var prevEl = domNodes[index - 1];
2816
+ // 如果是 list 列表需要多插入一个回车,模拟双回车删除空 list
2817
+ if ('matches' in prevEl &&
2818
+ prevEl.matches('ul:not([data-w-e-type]),ol:not([data-w-e-type])')) {
2819
+ e.insertBreak();
2820
+ }
2808
2821
  }
2809
2822
  e.insertBreak();
2810
2823
  }
package/dist/index.js CHANGED
@@ -313,7 +313,7 @@
313
313
  };
314
314
  var withHistory_1 = withHistory;
315
315
 
316
- /*! *****************************************************************************
316
+ /******************************************************************************
317
317
  Copyright (c) Microsoft Corporation.
318
318
 
319
319
  Permission to use, copy, modify, and/or distribute this software for any
@@ -327,7 +327,7 @@
327
327
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
328
328
  PERFORMANCE OF THIS SOFTWARE.
329
329
  ***************************************************************************** */
330
- /* global Reflect, Promise */
330
+ /* global Reflect, Promise, SuppressedError, Symbol */
331
331
 
332
332
  var extendStatics = function(d, b) {
333
333
  extendStatics = Object.setPrototypeOf ||
@@ -384,11 +384,20 @@
384
384
  return ar;
385
385
  }
386
386
 
387
- function __spreadArray(to, from) {
388
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
389
- to[j] = from[i];
390
- return to;
391
- }
387
+ function __spreadArray(to, from, pack) {
388
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
389
+ if (ar || !(i in from)) {
390
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
391
+ ar[i] = from[i];
392
+ }
393
+ }
394
+ return to.concat(ar || Array.prototype.slice.call(from));
395
+ }
396
+
397
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
398
+ var e = new Error(message);
399
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
400
+ };
392
401
 
393
402
  /**
394
403
  * An auto-incrementing identifier for keys.
@@ -2823,9 +2832,13 @@
2823
2832
  if (!DomEditor.isSelectedEmptyParagraph(e)) {
2824
2833
  // 当前不是空行,且 非 inline - 则换行
2825
2834
  if (display.indexOf('inline') < 0) {
2826
- var el_1 = domNodes[index - 1];
2827
- if (el_1.matches('ul:not([data-w-e-type]),ol:not([data-w-e-type])')) {
2828
- e.insertBreak(); // 列表项,需要插入空行
2835
+ if (index >= 1) {
2836
+ var prevEl = domNodes[index - 1];
2837
+ // 如果是 list 列表需要多插入一个回车,模拟双回车删除空 list
2838
+ if ('matches' in prevEl &&
2839
+ prevEl.matches('ul:not([data-w-e-type]),ol:not([data-w-e-type])')) {
2840
+ e.insertBreak();
2841
+ }
2829
2842
  }
2830
2843
  e.insertBreak();
2831
2844
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-next/core",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "wangEditor core",
5
5
  "author": "cycleccc <2991205548@qq.com>",
6
6
  "contributors": [],
@@ -66,5 +66,5 @@
66
66
  "devDependencies": {
67
67
  "@types/is-hotkey": "^0.1.2"
68
68
  },
69
- "gitHead": "5d55ac379a7f66a17894d7a7e224a76bca2642c7"
69
+ "gitHead": "df10e6d36e9d83b99f56146d49f6c7985bb9f13c"
70
70
  }