suneditor 3.1.4 → 3.2.0
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/dist/suneditor-contents.min.css +1 -1
- package/dist/suneditor.min.css +28 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +2 -1
- package/src/assets/design/color.css +12 -0
- package/src/assets/design/size.css +9 -2
- package/src/assets/icons/defaultIcons.js +96 -47
- package/src/assets/suneditor-contents.css +3 -2
- package/src/assets/suneditor.css +480 -31
- package/src/core/config/contextProvider.js +2 -1
- package/src/core/config/eventManager.js +41 -2
- package/src/core/config/optionProvider.js +23 -2
- package/src/core/editor.js +32 -14
- package/src/core/event/actions/index.js +76 -9
- package/src/core/event/effects/common.registry.js +2 -1
- package/src/core/event/effects/keydown.registry.js +169 -33
- package/src/core/event/effects/ruleHelpers.js +20 -6
- package/src/core/event/eventOrchestrator.js +136 -23
- package/src/core/event/handlers/handler_toolbar.js +4 -2
- package/src/core/event/handlers/handler_ww_dragDrop.js +10 -0
- package/src/core/event/handlers/handler_ww_input.js +9 -2
- package/src/core/event/handlers/handler_ww_key.js +86 -17
- package/src/core/event/handlers/handler_ww_mouse.js +45 -8
- package/src/core/event/ports.js +23 -5
- package/src/core/event/reducers/keydown.reducer.js +15 -2
- package/src/core/event/rules/keydown.rule.arrow.js +12 -2
- package/src/core/event/rules/keydown.rule.backspace.js +110 -15
- package/src/core/event/rules/keydown.rule.delete.js +62 -7
- package/src/core/event/rules/keydown.rule.enter.js +62 -31
- package/src/core/event/support/defaultLineManager.js +9 -2
- package/src/core/event/support/selectionState.js +13 -3
- package/src/core/kernel/coreKernel.js +1 -0
- package/src/core/logic/dom/char.js +13 -3
- package/src/core/logic/dom/format.js +171 -39
- package/src/core/logic/dom/html.js +350 -72
- package/src/core/logic/dom/inline.js +229 -34
- package/src/core/logic/dom/listFormat.js +111 -20
- package/src/core/logic/dom/nodeTransform.js +36 -11
- package/src/core/logic/dom/offset.js +116 -31
- package/src/core/logic/dom/selection.js +147 -29
- package/src/core/logic/panel/blockHandle.js +785 -0
- package/src/core/logic/panel/blockResolver.js +278 -0
- package/src/core/logic/panel/finder.js +16 -6
- package/src/core/logic/panel/menu.js +119 -18
- package/src/core/logic/panel/toolbar.js +75 -19
- package/src/core/logic/panel/viewer.js +76 -20
- package/src/core/logic/shell/_commandExecutor.js +44 -9
- package/src/core/logic/shell/commandDispatcher.js +46 -4
- package/src/core/logic/shell/component.js +102 -25
- package/src/core/logic/shell/focusManager.js +13 -3
- package/src/core/logic/shell/history.js +21 -6
- package/src/core/logic/shell/pluginManager.js +21 -13
- package/src/core/logic/shell/shortcuts.js +9 -1
- package/src/core/logic/shell/ui.js +139 -37
- package/src/core/schema/frameContext.js +34 -3
- package/src/core/schema/options.js +46 -4
- package/src/core/section/constructor.js +537 -93
- package/src/core/section/documentType.js +35 -6
- package/src/helper/converter.js +24 -7
- package/src/helper/dom/domCheck.js +25 -5
- package/src/helper/dom/domQuery.js +2 -1
- package/src/helper/dom/domUtils.js +17 -4
- package/src/helper/env.js +11 -2
- package/src/helper/keyCodeMap.js +6 -2
- package/src/helper/markdown.js +24 -5
- package/src/helper/msOffice.js +9 -2
- package/src/interfaces/plugins.js +1 -1
- package/src/langs/ckb.js +0 -1
- package/src/langs/cs.js +0 -1
- package/src/langs/da.js +0 -1
- package/src/langs/de.js +0 -1
- package/src/langs/en.js +0 -1
- package/src/langs/es.js +0 -1
- package/src/langs/fa.js +0 -1
- package/src/langs/fr.js +0 -1
- package/src/langs/he.js +0 -1
- package/src/langs/hu.js +0 -1
- package/src/langs/index.js +27 -1
- package/src/langs/it.js +0 -1
- package/src/langs/ja.js +0 -1
- package/src/langs/km.js +0 -1
- package/src/langs/ko.js +0 -1
- package/src/langs/lv.js +0 -1
- package/src/langs/nl.js +0 -1
- package/src/langs/pl.js +0 -1
- package/src/langs/pt_br.js +0 -1
- package/src/langs/ro.js +0 -1
- package/src/langs/ru.js +0 -1
- package/src/langs/se.js +0 -1
- package/src/langs/tr.js +0 -1
- package/src/langs/uk.js +0 -1
- package/src/langs/ur.js +0 -1
- package/src/langs/zh_cn.js +0 -1
- package/src/modules/contract/Browser.js +58 -14
- package/src/modules/contract/ColorPicker.js +12 -4
- package/src/modules/contract/Controller.js +37 -7
- package/src/modules/contract/Figure.js +156 -36
- package/src/modules/contract/HueSlider.js +27 -4
- package/src/modules/contract/Modal.js +50 -10
- package/src/modules/manager/FileManager.js +50 -8
- package/src/modules/ui/CommandMenu.js +597 -0
- package/src/modules/ui/ModalAnchorEditor.js +33 -6
- package/src/modules/ui/SelectMenu.js +481 -36
- package/src/modules/ui/index.js +1 -0
- package/src/plugins/browser/audioGallery.js +2 -1
- package/src/plugins/browser/fileBrowser.js +9 -2
- package/src/plugins/browser/fileGallery.js +2 -1
- package/src/plugins/browser/imageGallery.js +18 -3
- package/src/plugins/browser/videoGallery.js +13 -4
- package/src/plugins/command/blockquote.js +6 -1
- package/src/plugins/command/codeBlock.js +43 -5
- package/src/plugins/command/exportPDF.js +20 -4
- package/src/plugins/command/fileUpload.js +46 -11
- package/src/plugins/command/list_bulleted.js +6 -1
- package/src/plugins/command/list_numbered.js +6 -1
- package/src/plugins/dropdown/align.js +21 -33
- package/src/plugins/dropdown/backgroundColor.js +10 -2
- package/src/plugins/dropdown/blockStyle.js +17 -22
- package/src/plugins/dropdown/font.js +34 -34
- package/src/plugins/dropdown/hr.js +15 -43
- package/src/plugins/dropdown/layout.js +10 -27
- package/src/plugins/dropdown/lineHeight.js +10 -33
- package/src/plugins/dropdown/list.js +19 -25
- package/src/plugins/dropdown/paragraphStyle.js +16 -24
- package/src/plugins/dropdown/table/index.js +72 -17
- package/src/plugins/dropdown/table/render/table.html.js +3 -1
- package/src/plugins/dropdown/table/services/table.cell.js +33 -7
- package/src/plugins/dropdown/table/services/table.clipboard.js +5 -1
- package/src/plugins/dropdown/table/services/table.grid.js +40 -9
- package/src/plugins/dropdown/table/services/table.resize.js +55 -11
- package/src/plugins/dropdown/table/services/table.selection.js +27 -7
- package/src/plugins/dropdown/table/services/table.style.js +120 -20
- package/src/plugins/dropdown/template.js +13 -29
- package/src/plugins/dropdown/textStyle.js +22 -35
- package/src/plugins/field/autocomplete.js +8 -4
- package/src/plugins/field/slashCommand.js +297 -0
- package/src/plugins/index.js +3 -0
- package/src/plugins/input/fontSize.js +37 -8
- package/src/plugins/input/pageNavigator.js +7 -1
- package/src/plugins/modal/audio.js +71 -17
- package/src/plugins/modal/drawing.js +41 -11
- package/src/plugins/modal/embed.js +92 -22
- package/src/plugins/modal/image/index.js +114 -28
- package/src/plugins/modal/image/services/image.size.js +9 -2
- package/src/plugins/modal/image/services/image.upload.js +38 -4
- package/src/plugins/modal/link.js +9 -2
- package/src/plugins/modal/math.js +10 -2
- package/src/plugins/modal/video/index.js +112 -26
- package/src/plugins/modal/video/render/video.html.js +4 -1
- package/src/plugins/modal/video/services/video.size.js +15 -4
- package/src/plugins/modal/video/services/video.upload.js +10 -2
- package/src/plugins/popup/anchor.js +14 -2
- package/src/suneditor.js +8 -2
- package/src/themes/cobalt.css +12 -0
- package/src/themes/cream.css +12 -0
- package/src/themes/dark.css +12 -0
- package/src/themes/midnight.css +12 -0
- package/src/typedef.js +32 -21
- package/types/assets/icons/defaultIcons.d.ts +1 -0
- package/types/core/config/contextProvider.d.ts +7 -1
- package/types/core/config/eventManager.d.ts +37 -4
- package/types/core/config/optionProvider.d.ts +5 -1
- package/types/core/event/actions/index.d.ts +44 -6
- package/types/core/event/effects/keydown.registry.d.ts +37 -7
- package/types/core/event/effects/ruleHelpers.d.ts +6 -1
- package/types/core/event/eventOrchestrator.d.ts +6 -1
- package/types/core/event/handlers/handler_ww_clipboard.d.ts +15 -3
- package/types/core/event/handlers/handler_ww_dragDrop.d.ts +14 -2
- package/types/core/event/handlers/handler_ww_input.d.ts +10 -2
- package/types/core/event/handlers/handler_ww_key.d.ts +10 -2
- package/types/core/event/handlers/handler_ww_mouse.d.ts +25 -5
- package/types/core/event/ports.d.ts +7 -2
- package/types/core/event/rules/keydown.rule.backspace.d.ts +6 -1
- package/types/core/kernel/store.d.ts +4 -1
- package/types/core/logic/dom/format.d.ts +32 -14
- package/types/core/logic/dom/html.d.ts +11 -3
- package/types/core/logic/dom/nodeTransform.d.ts +6 -6
- package/types/core/logic/panel/blockHandle.d.ts +64 -0
- package/types/core/logic/panel/blockResolver.d.ts +50 -0
- package/types/core/logic/panel/menu.d.ts +72 -3
- package/types/core/logic/shell/commandDispatcher.d.ts +8 -0
- package/types/core/logic/shell/component.d.ts +5 -3
- package/types/core/logic/shell/shortcuts.d.ts +10 -1
- package/types/core/logic/shell/ui.d.ts +7 -1
- package/types/core/schema/context.d.ts +7 -1
- package/types/core/schema/frameContext.d.ts +36 -4
- package/types/core/schema/options.d.ts +83 -2
- package/types/core/section/constructor.d.ts +38 -1
- package/types/events.d.ts +208 -32
- package/types/helper/converter.d.ts +4 -2
- package/types/helper/dom/domCheck.d.ts +12 -2
- package/types/helper/dom/domQuery.d.ts +35 -7
- package/types/helper/dom/domUtils.d.ts +4 -1
- package/types/interfaces/plugins.d.ts +2 -2
- package/types/langs/_Lang.d.ts +0 -1
- package/types/modules/contract/ColorPicker.d.ts +2 -2
- package/types/modules/contract/Controller.d.ts +7 -0
- package/types/modules/contract/Figure.d.ts +31 -4
- package/types/modules/ui/CommandMenu.d.ts +262 -0
- package/types/modules/ui/SelectMenu.d.ts +56 -3
- package/types/modules/ui/index.d.ts +1 -0
- package/types/plugins/browser/audioGallery.d.ts +1 -1
- package/types/plugins/browser/fileBrowser.d.ts +1 -1
- package/types/plugins/browser/fileGallery.d.ts +1 -1
- package/types/plugins/browser/imageGallery.d.ts +1 -1
- package/types/plugins/browser/videoGallery.d.ts +1 -1
- package/types/plugins/dropdown/align.d.ts +1 -1
- package/types/plugins/dropdown/blockStyle.d.ts +3 -1
- package/types/plugins/dropdown/table/index.d.ts +4 -1
- package/types/plugins/dropdown/table/services/table.clipboard.d.ts +5 -1
- package/types/plugins/dropdown/table/services/table.grid.d.ts +10 -2
- package/types/plugins/field/autocomplete.d.ts +0 -1
- package/types/plugins/field/slashCommand.d.ts +165 -0
- package/types/plugins/index.d.ts +3 -0
- package/types/plugins/modal/link.d.ts +4 -1
- package/types/typedef.d.ts +48 -23
|
@@ -84,9 +84,18 @@ class Inline {
|
|
|
84
84
|
let endCon = range.endContainer;
|
|
85
85
|
let endOff = range.endOffset;
|
|
86
86
|
|
|
87
|
-
if (
|
|
87
|
+
if (
|
|
88
|
+
(isRemoveFormat &&
|
|
89
|
+
range.collapsed &&
|
|
90
|
+
this.#$.format.isLine(startCon.parentNode) &&
|
|
91
|
+
this.#$.format.isLine(endCon.parentNode)) ||
|
|
92
|
+
(startCon === endCon && startCon.nodeType === 1 && dom.check.isNonEditable(startCon))
|
|
93
|
+
) {
|
|
88
94
|
const format = startCon.parentNode;
|
|
89
|
-
if (
|
|
95
|
+
if (
|
|
96
|
+
!dom.check.isListCell(format) ||
|
|
97
|
+
!converter.getValues(format.style).some((k) => this.#listKebab.includes(k))
|
|
98
|
+
) {
|
|
90
99
|
return;
|
|
91
100
|
}
|
|
92
101
|
}
|
|
@@ -154,12 +163,21 @@ class Inline {
|
|
|
154
163
|
for (let i = 0; i < checkAttrs.length; i++) {
|
|
155
164
|
if (sNode.nodeType === 1) {
|
|
156
165
|
const s = checkAttrs[i];
|
|
157
|
-
const classReg = /^\./.test(s)
|
|
166
|
+
const classReg = /^\./.test(s)
|
|
167
|
+
? new wRegExp('\\s*' + s.replace(/^\./, '') + '(\\s+|$)', 'ig')
|
|
168
|
+
: false;
|
|
158
169
|
const sNodeStyle = /** @type {HTMLElement} */ (sNode).style;
|
|
159
170
|
const sNodeClassName = /** @type {HTMLElement} */ (sNode).className;
|
|
160
171
|
|
|
161
|
-
const styleCheck = isRemoveNode
|
|
162
|
-
|
|
172
|
+
const styleCheck = isRemoveNode
|
|
173
|
+
? !!sNodeStyle[s]
|
|
174
|
+
: !!sNodeStyle[s] && !!checkStyles[s] && sNodeStyle[s] === checkStyles[s];
|
|
175
|
+
const classCheck =
|
|
176
|
+
classReg === false
|
|
177
|
+
? false
|
|
178
|
+
: isRemoveNode
|
|
179
|
+
? !!sNodeClassName.match(classReg)
|
|
180
|
+
: !!sNodeClassName.match(classReg) && !!checkClassName.match(classReg);
|
|
163
181
|
if (styleCheck || classCheck) {
|
|
164
182
|
checkCnt++;
|
|
165
183
|
}
|
|
@@ -228,7 +246,8 @@ class Inline {
|
|
|
228
246
|
if (isRemoveFormat) return null;
|
|
229
247
|
|
|
230
248
|
// remove node check
|
|
231
|
-
const tagRemove =
|
|
249
|
+
const tagRemove =
|
|
250
|
+
(!removeNodeRegExp && isRemoveNode) || /** @type {RegExp} */ (removeNodeRegExp)?.test(vNode.nodeName);
|
|
232
251
|
|
|
233
252
|
// tag remove
|
|
234
253
|
if (tagRemove && !strictRemove) {
|
|
@@ -254,14 +273,26 @@ class Inline {
|
|
|
254
273
|
|
|
255
274
|
// remove only
|
|
256
275
|
if (isRemoveNode) {
|
|
257
|
-
if (
|
|
276
|
+
if (
|
|
277
|
+
(classRegExp || !originClasses) &&
|
|
278
|
+
(styleRegExp || !originStyle) &&
|
|
279
|
+
!style &&
|
|
280
|
+
!classes &&
|
|
281
|
+
tagRemove
|
|
282
|
+
) {
|
|
258
283
|
_removeCheck.v = true;
|
|
259
284
|
return null;
|
|
260
285
|
}
|
|
261
286
|
}
|
|
262
287
|
|
|
263
288
|
// change
|
|
264
|
-
if (
|
|
289
|
+
if (
|
|
290
|
+
style ||
|
|
291
|
+
classes ||
|
|
292
|
+
vNode.nodeName !== newNodeName ||
|
|
293
|
+
Boolean(styleRegExp) !== Boolean(originStyle) ||
|
|
294
|
+
Boolean(classRegExp) !== Boolean(originClasses)
|
|
295
|
+
) {
|
|
265
296
|
if (styleRegExp && originStyle.length > 0) vNode.style.cssText = style;
|
|
266
297
|
if (!vNode.style.cssText) {
|
|
267
298
|
vNode.removeAttribute('style');
|
|
@@ -341,9 +372,24 @@ class Inline {
|
|
|
341
372
|
|
|
342
373
|
// one line
|
|
343
374
|
if (oneLine) {
|
|
344
|
-
if (this.#sn_resetCommonListCell(lineNodes[0], stylesToModify))
|
|
375
|
+
if (this.#sn_resetCommonListCell(lineNodes[0], stylesToModify))
|
|
376
|
+
range = this.#$.selection.setRange(startCon, startOff, endCon, endOff);
|
|
345
377
|
|
|
346
|
-
const newRange = this.#setNode_oneLine(
|
|
378
|
+
const newRange = this.#setNode_oneLine(
|
|
379
|
+
lineNodes[0],
|
|
380
|
+
newNode,
|
|
381
|
+
validation,
|
|
382
|
+
startCon,
|
|
383
|
+
startOff,
|
|
384
|
+
endCon,
|
|
385
|
+
endOff,
|
|
386
|
+
isRemoveFormat,
|
|
387
|
+
isRemoveNode,
|
|
388
|
+
range.collapsed,
|
|
389
|
+
_removeCheck,
|
|
390
|
+
_getMaintainedNode,
|
|
391
|
+
_isMaintainedNode,
|
|
392
|
+
);
|
|
347
393
|
start.container = newRange.startContainer;
|
|
348
394
|
start.offset = newRange.startOffset;
|
|
349
395
|
end.container = newRange.endContainer;
|
|
@@ -356,21 +402,41 @@ class Inline {
|
|
|
356
402
|
} else {
|
|
357
403
|
// multi line
|
|
358
404
|
let appliedCommonList = false;
|
|
359
|
-
if (endLength > 0 && this.#sn_resetCommonListCell(lineNodes[endLength], stylesToModify))
|
|
405
|
+
if (endLength > 0 && this.#sn_resetCommonListCell(lineNodes[endLength], stylesToModify))
|
|
406
|
+
appliedCommonList = true;
|
|
360
407
|
if (this.#sn_resetCommonListCell(lineNodes[0], stylesToModify)) appliedCommonList = true;
|
|
361
408
|
if (appliedCommonList) this.#$.selection.setRange(startCon, startOff, endCon, endOff);
|
|
362
409
|
|
|
363
410
|
// end
|
|
364
411
|
if (endLength > 0) {
|
|
365
412
|
newNode = styleNode.cloneNode(false);
|
|
366
|
-
end = this.#setNode_endLine(
|
|
413
|
+
end = this.#setNode_endLine(
|
|
414
|
+
lineNodes[endLength],
|
|
415
|
+
newNode,
|
|
416
|
+
validation,
|
|
417
|
+
endCon,
|
|
418
|
+
endOff,
|
|
419
|
+
isRemoveFormat,
|
|
420
|
+
isRemoveNode,
|
|
421
|
+
_removeCheck,
|
|
422
|
+
_getMaintainedNode,
|
|
423
|
+
_isMaintainedNode,
|
|
424
|
+
);
|
|
367
425
|
}
|
|
368
426
|
|
|
369
427
|
// mid
|
|
370
428
|
for (let i = endLength - 1, newRange; i > 0; i--) {
|
|
371
429
|
this.#sn_resetCommonListCell(lineNodes[i], stylesToModify);
|
|
372
430
|
newNode = styleNode.cloneNode(false);
|
|
373
|
-
newRange = this.#setNode_middleLine(
|
|
431
|
+
newRange = this.#setNode_middleLine(
|
|
432
|
+
lineNodes[i],
|
|
433
|
+
newNode,
|
|
434
|
+
validation,
|
|
435
|
+
isRemoveFormat,
|
|
436
|
+
isRemoveNode,
|
|
437
|
+
_removeCheck,
|
|
438
|
+
end.container,
|
|
439
|
+
);
|
|
374
440
|
if (newRange.endContainer && newRange.ancestor.contains(newRange.endContainer)) {
|
|
375
441
|
end.ancestor = null;
|
|
376
442
|
end.container = newRange.endContainer;
|
|
@@ -380,7 +446,19 @@ class Inline {
|
|
|
380
446
|
|
|
381
447
|
// start
|
|
382
448
|
newNode = styleNode.cloneNode(false);
|
|
383
|
-
start = this.#setNode_startLine(
|
|
449
|
+
start = this.#setNode_startLine(
|
|
450
|
+
lineNodes[0],
|
|
451
|
+
newNode,
|
|
452
|
+
validation,
|
|
453
|
+
startCon,
|
|
454
|
+
startOff,
|
|
455
|
+
isRemoveFormat,
|
|
456
|
+
isRemoveNode,
|
|
457
|
+
_removeCheck,
|
|
458
|
+
_getMaintainedNode,
|
|
459
|
+
_isMaintainedNode,
|
|
460
|
+
end.container,
|
|
461
|
+
);
|
|
384
462
|
|
|
385
463
|
if (start.endContainer) {
|
|
386
464
|
end.ancestor = null;
|
|
@@ -438,7 +516,13 @@ class Inline {
|
|
|
438
516
|
* @returns {boolean}
|
|
439
517
|
*/
|
|
440
518
|
_isIgnoreNodeChange(element) {
|
|
441
|
-
return
|
|
519
|
+
return (
|
|
520
|
+
element &&
|
|
521
|
+
element.nodeType === 1 &&
|
|
522
|
+
(dom.check.isNonEditable(element) ||
|
|
523
|
+
!this.#$.format.isTextStyleNode(element) ||
|
|
524
|
+
this.#$.component.is(element))
|
|
525
|
+
);
|
|
442
526
|
}
|
|
443
527
|
|
|
444
528
|
/**
|
|
@@ -458,16 +542,43 @@ class Inline {
|
|
|
458
542
|
* @param {(element: Node) => boolean} _isMaintainedNode Function to check if node should be maintained.
|
|
459
543
|
* @returns {{ancestor: *, startContainer: *, startOffset: *, endContainer: *, endOffset: *}}
|
|
460
544
|
*/
|
|
461
|
-
#setNode_oneLine(
|
|
545
|
+
#setNode_oneLine(
|
|
546
|
+
element,
|
|
547
|
+
newInnerNode,
|
|
548
|
+
validation,
|
|
549
|
+
startCon,
|
|
550
|
+
startOff,
|
|
551
|
+
endCon,
|
|
552
|
+
endOff,
|
|
553
|
+
isRemoveFormat,
|
|
554
|
+
isRemoveNode,
|
|
555
|
+
collapsed,
|
|
556
|
+
_removeCheck,
|
|
557
|
+
_getMaintainedNode,
|
|
558
|
+
_isMaintainedNode,
|
|
559
|
+
) {
|
|
462
560
|
// not add tag
|
|
463
561
|
let parentCon = startCon.parentNode;
|
|
464
|
-
while (
|
|
562
|
+
while (
|
|
563
|
+
!parentCon.nextSibling &&
|
|
564
|
+
!parentCon.previousSibling &&
|
|
565
|
+
!this.#$.format.isLine(parentCon.parentNode) &&
|
|
566
|
+
!dom.check.isWysiwygFrame(parentCon.parentNode)
|
|
567
|
+
) {
|
|
465
568
|
if (parentCon.nodeName === newInnerNode.nodeName) break;
|
|
466
569
|
parentCon = parentCon.parentNode;
|
|
467
570
|
}
|
|
468
571
|
|
|
469
|
-
if (
|
|
470
|
-
|
|
572
|
+
if (
|
|
573
|
+
!isRemoveNode &&
|
|
574
|
+
!isRemoveFormat &&
|
|
575
|
+
parentCon === endCon.parentNode &&
|
|
576
|
+
parentCon.nodeName === newInnerNode.nodeName
|
|
577
|
+
) {
|
|
578
|
+
if (
|
|
579
|
+
dom.check.isZeroWidth(startCon.textContent.slice(0, startOff)) &&
|
|
580
|
+
dom.check.isZeroWidth(endCon.textContent.slice(endOff))
|
|
581
|
+
) {
|
|
471
582
|
const children = parentCon.childNodes;
|
|
472
583
|
let sameTag = true;
|
|
473
584
|
|
|
@@ -545,7 +656,14 @@ class Inline {
|
|
|
545
656
|
if (startContainer.nodeType === 3) {
|
|
546
657
|
const sText = /** @type {Text} */ (startContainer);
|
|
547
658
|
_prevText = sText.substringData(0, startOffset);
|
|
548
|
-
_nextText = sText.substringData(
|
|
659
|
+
_nextText = sText.substringData(
|
|
660
|
+
startOffset,
|
|
661
|
+
isSameNode
|
|
662
|
+
? endOffset >= startOffset
|
|
663
|
+
? endOffset - startOffset
|
|
664
|
+
: sText.data.length - startOffset
|
|
665
|
+
: sText.data.length - startOffset,
|
|
666
|
+
);
|
|
549
667
|
}
|
|
550
668
|
|
|
551
669
|
const prevNode = dom.utils.createTextNode(_prevText);
|
|
@@ -756,7 +874,11 @@ class Inline {
|
|
|
756
874
|
appendNode = newNode;
|
|
757
875
|
}
|
|
758
876
|
|
|
759
|
-
if (
|
|
877
|
+
if (
|
|
878
|
+
_isMaintainedNode(newInnerNode.parentNode) &&
|
|
879
|
+
!_isMaintainedNode(childNode) &&
|
|
880
|
+
!dom.check.isZeroWidth(newInnerNode)
|
|
881
|
+
) {
|
|
760
882
|
newInnerNode = newInnerNode.cloneNode(false);
|
|
761
883
|
pNode.appendChild(newInnerNode);
|
|
762
884
|
nNodeArray.push(newInnerNode);
|
|
@@ -891,7 +1013,13 @@ class Inline {
|
|
|
891
1013
|
const endPath = dom.query.getNodePath(endContainer, pNode, !mergeEndCon && !endConReset ? newEndOffset : null);
|
|
892
1014
|
|
|
893
1015
|
startOffset += newStartOffset.s;
|
|
894
|
-
endOffset = collapsed
|
|
1016
|
+
endOffset = collapsed
|
|
1017
|
+
? startOffset
|
|
1018
|
+
: mergeEndCon
|
|
1019
|
+
? startContainer.textContent.length
|
|
1020
|
+
: endConReset
|
|
1021
|
+
? endOffset + newStartOffset.s
|
|
1022
|
+
: endOffset + newEndOffset.s;
|
|
895
1023
|
|
|
896
1024
|
// tag merge
|
|
897
1025
|
const newOffsets = this.#$.nodeTransform.mergeSameTags(pNode, [startPath, endPath], true);
|
|
@@ -925,15 +1053,39 @@ class Inline {
|
|
|
925
1053
|
* @param {Node} _endContainer End container node.
|
|
926
1054
|
* @returns {NodeStyleContainerType} { ancestor, container, offset, endContainer }
|
|
927
1055
|
*/
|
|
928
|
-
#setNode_startLine(
|
|
1056
|
+
#setNode_startLine(
|
|
1057
|
+
element,
|
|
1058
|
+
newInnerNode,
|
|
1059
|
+
validation,
|
|
1060
|
+
startCon,
|
|
1061
|
+
startOff,
|
|
1062
|
+
isRemoveFormat,
|
|
1063
|
+
isRemoveNode,
|
|
1064
|
+
_removeCheck,
|
|
1065
|
+
_getMaintainedNode,
|
|
1066
|
+
_isMaintainedNode,
|
|
1067
|
+
_endContainer,
|
|
1068
|
+
) {
|
|
929
1069
|
// not add tag
|
|
930
1070
|
let parentCon = startCon.parentNode;
|
|
931
|
-
while (
|
|
1071
|
+
while (
|
|
1072
|
+
!parentCon.nextSibling &&
|
|
1073
|
+
!parentCon.previousSibling &&
|
|
1074
|
+
!this.#$.format.isLine(parentCon.parentNode) &&
|
|
1075
|
+
!dom.check.isWysiwygFrame(parentCon.parentNode)
|
|
1076
|
+
) {
|
|
932
1077
|
if (parentCon.nodeName === newInnerNode.nodeName) break;
|
|
933
1078
|
parentCon = parentCon.parentNode;
|
|
934
1079
|
}
|
|
935
1080
|
|
|
936
|
-
if (
|
|
1081
|
+
if (
|
|
1082
|
+
!isRemoveNode &&
|
|
1083
|
+
!isRemoveFormat &&
|
|
1084
|
+
parentCon.nodeName === newInnerNode.nodeName &&
|
|
1085
|
+
!this.#$.format.isLine(parentCon) &&
|
|
1086
|
+
!parentCon.nextSibling &&
|
|
1087
|
+
dom.check.isZeroWidth(startCon.textContent.slice(0, startOff))
|
|
1088
|
+
) {
|
|
937
1089
|
let sameTag = true;
|
|
938
1090
|
let s = startCon.previousSibling;
|
|
939
1091
|
while (s) {
|
|
@@ -1234,7 +1386,8 @@ class Inline {
|
|
|
1234
1386
|
if (!isRemoveNode) {
|
|
1235
1387
|
// end container path
|
|
1236
1388
|
let endPath = null;
|
|
1237
|
-
if (_endContainer && element.contains(_endContainer))
|
|
1389
|
+
if (_endContainer && element.contains(_endContainer))
|
|
1390
|
+
endPath = dom.query.getNodePath(_endContainer, element);
|
|
1238
1391
|
|
|
1239
1392
|
const tempNode = element.cloneNode(true);
|
|
1240
1393
|
const newNodeName = /** @type {HTMLElement} */ (newInnerNode).nodeName;
|
|
@@ -1369,15 +1522,38 @@ class Inline {
|
|
|
1369
1522
|
* @param {(element: Node) => boolean} _isMaintainedNode Function to check if node should be maintained.
|
|
1370
1523
|
* @returns {NodeStyleContainerType} { ancestor, container, offset }
|
|
1371
1524
|
*/
|
|
1372
|
-
#setNode_endLine(
|
|
1525
|
+
#setNode_endLine(
|
|
1526
|
+
element,
|
|
1527
|
+
newInnerNode,
|
|
1528
|
+
validation,
|
|
1529
|
+
endCon,
|
|
1530
|
+
endOff,
|
|
1531
|
+
isRemoveFormat,
|
|
1532
|
+
isRemoveNode,
|
|
1533
|
+
_removeCheck,
|
|
1534
|
+
_getMaintainedNode,
|
|
1535
|
+
_isMaintainedNode,
|
|
1536
|
+
) {
|
|
1373
1537
|
// not add tag
|
|
1374
1538
|
let parentCon = endCon.parentNode;
|
|
1375
|
-
while (
|
|
1539
|
+
while (
|
|
1540
|
+
!parentCon.nextSibling &&
|
|
1541
|
+
!parentCon.previousSibling &&
|
|
1542
|
+
!this.#$.format.isLine(parentCon.parentNode) &&
|
|
1543
|
+
!dom.check.isWysiwygFrame(parentCon.parentNode)
|
|
1544
|
+
) {
|
|
1376
1545
|
if (parentCon.nodeName === newInnerNode.nodeName) break;
|
|
1377
1546
|
parentCon = parentCon.parentNode;
|
|
1378
1547
|
}
|
|
1379
1548
|
|
|
1380
|
-
if (
|
|
1549
|
+
if (
|
|
1550
|
+
!isRemoveNode &&
|
|
1551
|
+
!isRemoveFormat &&
|
|
1552
|
+
parentCon.nodeName === newInnerNode.nodeName &&
|
|
1553
|
+
!this.#$.format.isLine(parentCon) &&
|
|
1554
|
+
!parentCon.previousSibling &&
|
|
1555
|
+
dom.check.isZeroWidth(endCon.textContent.slice(endOff))
|
|
1556
|
+
) {
|
|
1381
1557
|
let sameTag = true;
|
|
1382
1558
|
let e = endCon.nextSibling;
|
|
1383
1559
|
while (e) {
|
|
@@ -1684,7 +1860,13 @@ class Inline {
|
|
|
1684
1860
|
* @returns {boolean}
|
|
1685
1861
|
*/
|
|
1686
1862
|
#sn_isSizeNode(element) {
|
|
1687
|
-
return
|
|
1863
|
+
return (
|
|
1864
|
+
element &&
|
|
1865
|
+
typeof element !== 'string' &&
|
|
1866
|
+
element.nodeType !== 3 &&
|
|
1867
|
+
this.#$.format.isTextStyleNode(element) &&
|
|
1868
|
+
!!element.style.fontSize
|
|
1869
|
+
);
|
|
1688
1870
|
}
|
|
1689
1871
|
|
|
1690
1872
|
/**
|
|
@@ -1696,7 +1878,10 @@ class Inline {
|
|
|
1696
1878
|
*/
|
|
1697
1879
|
#sn_getMaintainedNode(_isRemove, _isSizeNode, element) {
|
|
1698
1880
|
if (!element || _isRemove) return null;
|
|
1699
|
-
return
|
|
1881
|
+
return (
|
|
1882
|
+
dom.query.getParentElement(element, this._isNonSplitNode.bind(this)) ||
|
|
1883
|
+
(!_isSizeNode ? dom.query.getParentElement(element, this.#sn_isSizeNode.bind(this)) : null)
|
|
1884
|
+
);
|
|
1700
1885
|
}
|
|
1701
1886
|
|
|
1702
1887
|
/**
|
|
@@ -1709,7 +1894,9 @@ class Inline {
|
|
|
1709
1894
|
#sn_isMaintainedNode(_isRemove, _isSizeNode, element) {
|
|
1710
1895
|
if (!element || _isRemove || element.nodeType !== 1) return false;
|
|
1711
1896
|
const anchor = this._isNonSplitNode(element);
|
|
1712
|
-
return dom.query.getParentElement(element, this._isNonSplitNode.bind(this))
|
|
1897
|
+
return dom.query.getParentElement(element, this._isNonSplitNode.bind(this))
|
|
1898
|
+
? anchor
|
|
1899
|
+
: anchor || (!_isSizeNode ? this.#sn_isSizeNode(element) : false);
|
|
1713
1900
|
}
|
|
1714
1901
|
|
|
1715
1902
|
/**
|
|
@@ -1732,8 +1919,16 @@ class Inline {
|
|
|
1732
1919
|
let appliedEl = false;
|
|
1733
1920
|
|
|
1734
1921
|
// bold, italic
|
|
1735
|
-
if (
|
|
1736
|
-
|
|
1922
|
+
if (
|
|
1923
|
+
this.#options.get('_defaultStyleTagMap')[nodeName] ===
|
|
1924
|
+
this.#options.get('_defaultTagCommand').bold.toLowerCase()
|
|
1925
|
+
)
|
|
1926
|
+
elStyle.fontWeight = 'bold';
|
|
1927
|
+
if (
|
|
1928
|
+
this.#options.get('_defaultStyleTagMap')[nodeName] ===
|
|
1929
|
+
this.#options.get('_defaultTagCommand').italic.toLowerCase()
|
|
1930
|
+
)
|
|
1931
|
+
elStyle.fontStyle = 'italic';
|
|
1737
1932
|
|
|
1738
1933
|
// styles
|
|
1739
1934
|
const cKeys = converter.getValues(childStyle);
|
|
@@ -39,7 +39,9 @@ class ListFormat {
|
|
|
39
39
|
const listStyle = type.split(':')[1] || '';
|
|
40
40
|
|
|
41
41
|
let range = this.#$.selection.getRange();
|
|
42
|
-
let selectedFormats = /** @type {Array<HTMLElement>} */ (
|
|
42
|
+
let selectedFormats = /** @type {Array<HTMLElement>} */ (
|
|
43
|
+
!selectedCells ? this.#$.format.getLinesAndComponents(false) : selectedCells
|
|
44
|
+
);
|
|
43
45
|
|
|
44
46
|
if (selectedFormats.length === 0) {
|
|
45
47
|
if (selectedCells) return;
|
|
@@ -53,13 +55,25 @@ class ListFormat {
|
|
|
53
55
|
// merge
|
|
54
56
|
const firstSel = selectedFormats[0];
|
|
55
57
|
const lastSel = selectedFormats.at(-1);
|
|
56
|
-
let topEl =
|
|
57
|
-
|
|
58
|
+
let topEl =
|
|
59
|
+
(dom.check.isListCell(firstSel) || this.#$.component.is(firstSel)) && !firstSel.previousElementSibling
|
|
60
|
+
? firstSel.parentElement.previousElementSibling
|
|
61
|
+
: firstSel.previousElementSibling;
|
|
62
|
+
let bottomEl =
|
|
63
|
+
(dom.check.isListCell(lastSel) || this.#$.component.is(lastSel)) && !lastSel.nextElementSibling
|
|
64
|
+
? lastSel.parentElement.nextElementSibling
|
|
65
|
+
: lastSel.nextElementSibling;
|
|
58
66
|
|
|
59
67
|
const isCollapsed = range.collapsed;
|
|
60
68
|
const originRange = {
|
|
61
69
|
sc: range.startContainer,
|
|
62
|
-
so:
|
|
70
|
+
so:
|
|
71
|
+
range.startContainer === range.endContainer &&
|
|
72
|
+
dom.check.isZeroWidth(range.startContainer) &&
|
|
73
|
+
range.startOffset === 0 &&
|
|
74
|
+
range.endOffset === 1
|
|
75
|
+
? range.endOffset
|
|
76
|
+
: range.startOffset,
|
|
63
77
|
ec: range.endContainer,
|
|
64
78
|
eo: range.endOffset,
|
|
65
79
|
};
|
|
@@ -67,13 +81,24 @@ class ListFormat {
|
|
|
67
81
|
let isRemove = true;
|
|
68
82
|
|
|
69
83
|
for (let i = 0, len = selectedFormats.length; i < len; i++) {
|
|
70
|
-
if (
|
|
84
|
+
if (
|
|
85
|
+
!dom.check.isList(
|
|
86
|
+
this.#$.format.getBlock(
|
|
87
|
+
selectedFormats[i],
|
|
88
|
+
(current) => this.#$.format.getBlock(current) && current !== selectedFormats[i],
|
|
89
|
+
),
|
|
90
|
+
)
|
|
91
|
+
) {
|
|
71
92
|
isRemove = false;
|
|
72
93
|
break;
|
|
73
94
|
}
|
|
74
95
|
}
|
|
75
96
|
|
|
76
|
-
if (
|
|
97
|
+
if (
|
|
98
|
+
isRemove &&
|
|
99
|
+
(!topEl || firstSel.tagName !== topEl.tagName || listTag !== topEl.tagName.toUpperCase()) &&
|
|
100
|
+
(!bottomEl || lastSel.tagName !== bottomEl.tagName || listTag !== bottomEl.tagName.toUpperCase())
|
|
101
|
+
) {
|
|
77
102
|
if (nested) {
|
|
78
103
|
for (let i = 0, len = selectedFormats.length; i < len; i++) {
|
|
79
104
|
for (let j = i - 1; j >= 0; j--) {
|
|
@@ -113,7 +138,12 @@ class ListFormat {
|
|
|
113
138
|
if (nested && dom.check.isListCell(o.parentNode)) {
|
|
114
139
|
this.#detachNested(rangeArr.f);
|
|
115
140
|
} else {
|
|
116
|
-
afterRange = this.#$.format.removeBlock(rangeArr.f[0].parentElement, {
|
|
141
|
+
afterRange = this.#$.format.removeBlock(rangeArr.f[0].parentElement, {
|
|
142
|
+
selectedFormats: rangeArr.f,
|
|
143
|
+
newBlockElement: tempList,
|
|
144
|
+
shouldDelete: false,
|
|
145
|
+
skipHistory: true,
|
|
146
|
+
});
|
|
117
147
|
}
|
|
118
148
|
|
|
119
149
|
o = selectedFormats[i].parentNode;
|
|
@@ -135,15 +165,28 @@ class ListFormat {
|
|
|
135
165
|
if (nested && dom.check.isListCell(o.parentNode)) {
|
|
136
166
|
this.#detachNested(rangeArr.f);
|
|
137
167
|
} else {
|
|
138
|
-
afterRange = this.#$.format.removeBlock(rangeArr.f[0].parentElement, {
|
|
168
|
+
afterRange = this.#$.format.removeBlock(rangeArr.f[0].parentElement, {
|
|
169
|
+
selectedFormats: rangeArr.f,
|
|
170
|
+
newBlockElement: tempList,
|
|
171
|
+
shouldDelete: false,
|
|
172
|
+
skipHistory: true,
|
|
173
|
+
});
|
|
139
174
|
}
|
|
140
175
|
}
|
|
141
176
|
}
|
|
142
177
|
} else {
|
|
143
178
|
const topElParent = topEl ? topEl.parentNode : topEl;
|
|
144
179
|
const bottomElParent = bottomEl ? bottomEl.parentNode : bottomEl;
|
|
145
|
-
topEl = /** @type {HTMLElement} */ (
|
|
146
|
-
|
|
180
|
+
topEl = /** @type {HTMLElement} */ (
|
|
181
|
+
topElParent && !dom.check.isWysiwygFrame(topElParent) && topElParent.nodeName === listTag
|
|
182
|
+
? topElParent
|
|
183
|
+
: topEl
|
|
184
|
+
);
|
|
185
|
+
bottomEl = /** @type {HTMLElement} */ (
|
|
186
|
+
bottomElParent && !dom.check.isWysiwygFrame(bottomElParent) && bottomElParent.nodeName === listTag
|
|
187
|
+
? bottomElParent
|
|
188
|
+
: bottomEl
|
|
189
|
+
);
|
|
147
190
|
|
|
148
191
|
const mergeTop = topEl?.tagName === listTag;
|
|
149
192
|
const mergeBottom = bottomEl?.tagName === listTag;
|
|
@@ -158,7 +201,21 @@ class ListFormat {
|
|
|
158
201
|
return !dom.check.isComponentContainer(current) && !dom.check.isList(current);
|
|
159
202
|
};
|
|
160
203
|
|
|
161
|
-
for (
|
|
204
|
+
for (
|
|
205
|
+
let i = 0,
|
|
206
|
+
len = selectedFormats.length,
|
|
207
|
+
newCell,
|
|
208
|
+
fTag,
|
|
209
|
+
isCell,
|
|
210
|
+
next,
|
|
211
|
+
originParent,
|
|
212
|
+
nextParent,
|
|
213
|
+
parentTag,
|
|
214
|
+
siblingTag,
|
|
215
|
+
rangeTag;
|
|
216
|
+
i < len;
|
|
217
|
+
i++
|
|
218
|
+
) {
|
|
162
219
|
fTag = selectedFormats[i];
|
|
163
220
|
if (fTag.childNodes.length === 0 && !this.#$.inline._isIgnoreNodeChange(fTag)) {
|
|
164
221
|
dom.utils.removeItem(fTag);
|
|
@@ -170,7 +227,12 @@ class ListFormat {
|
|
|
170
227
|
isCell = dom.check.isListCell(fTag);
|
|
171
228
|
rangeTag = this.#$.format.isBlock(originParent) ? originParent : null;
|
|
172
229
|
parentTag = isCell && !dom.check.isWysiwygFrame(originParent) ? originParent.parentNode : originParent;
|
|
173
|
-
siblingTag =
|
|
230
|
+
siblingTag =
|
|
231
|
+
isCell && !dom.check.isWysiwygFrame(originParent)
|
|
232
|
+
? !next || dom.check.isListCell(parentTag)
|
|
233
|
+
? originParent
|
|
234
|
+
: originParent.nextSibling
|
|
235
|
+
: fTag.nextSibling;
|
|
174
236
|
|
|
175
237
|
newCell = dom.utils.createElement('LI');
|
|
176
238
|
|
|
@@ -191,7 +253,10 @@ class ListFormat {
|
|
|
191
253
|
// if (!next) lastList = list;
|
|
192
254
|
if (!next || parentTag !== nextParent || this.#$.format.isBlock(siblingTag)) {
|
|
193
255
|
firstList ||= list;
|
|
194
|
-
if (
|
|
256
|
+
if (
|
|
257
|
+
(!mergeTop || !next || parentTag !== nextParent) &&
|
|
258
|
+
!(next && dom.check.isList(nextParent) && nextParent === originParent)
|
|
259
|
+
) {
|
|
195
260
|
if (list.parentNode !== parentTag) parentTag.insertBefore(list, siblingTag);
|
|
196
261
|
}
|
|
197
262
|
}
|
|
@@ -200,8 +265,11 @@ class ListFormat {
|
|
|
200
265
|
if (mergeTop && topNumber === null) topNumber = list.children.length - 1;
|
|
201
266
|
if (
|
|
202
267
|
next &&
|
|
203
|
-
(this.#$.format.getBlock(nextParent, passComponent) !==
|
|
204
|
-
|
|
268
|
+
(this.#$.format.getBlock(nextParent, passComponent) !==
|
|
269
|
+
this.#$.format.getBlock(originParent, passComponent) ||
|
|
270
|
+
(dom.check.isList(nextParent) &&
|
|
271
|
+
dom.check.isList(originParent) &&
|
|
272
|
+
dom.query.getNodeDepth(nextParent) !== dom.query.getNodeDepth(originParent)))
|
|
205
273
|
) {
|
|
206
274
|
list = dom.utils.createElement(listTag, { style: 'list-style-type: ' + listStyle });
|
|
207
275
|
}
|
|
@@ -257,7 +325,12 @@ class ListFormat {
|
|
|
257
325
|
if (i === 0) listFirst = true;
|
|
258
326
|
} else if (r && isList) {
|
|
259
327
|
if (r !== o) {
|
|
260
|
-
const edge = this.#$.format.removeBlock(rangeArr.f[0].parentNode, {
|
|
328
|
+
const edge = this.#$.format.removeBlock(rangeArr.f[0].parentNode, {
|
|
329
|
+
selectedFormats: rangeArr.f,
|
|
330
|
+
newBlockElement: null,
|
|
331
|
+
shouldDelete,
|
|
332
|
+
skipHistory: true,
|
|
333
|
+
});
|
|
261
334
|
o = selectedCells[i].parentNode;
|
|
262
335
|
if (listFirst) {
|
|
263
336
|
first = edge.sc;
|
|
@@ -282,7 +355,12 @@ class ListFormat {
|
|
|
282
355
|
}
|
|
283
356
|
|
|
284
357
|
if (lastIndex && dom.check.isList(r)) {
|
|
285
|
-
const edge = this.#$.format.removeBlock(rangeArr.f[0].parentNode, {
|
|
358
|
+
const edge = this.#$.format.removeBlock(rangeArr.f[0].parentNode, {
|
|
359
|
+
selectedFormats: rangeArr.f,
|
|
360
|
+
newBlockElement: null,
|
|
361
|
+
shouldDelete,
|
|
362
|
+
skipHistory: true,
|
|
363
|
+
});
|
|
286
364
|
if (listLast || len === 1) last = edge.ec;
|
|
287
365
|
if (listFirst) first = edge.sc || last;
|
|
288
366
|
}
|
|
@@ -317,7 +395,12 @@ class ListFormat {
|
|
|
317
395
|
})
|
|
318
396
|
: selectedCells;
|
|
319
397
|
const cellsLen = selectedCells.length;
|
|
320
|
-
if (
|
|
398
|
+
if (
|
|
399
|
+
cellsLen === 0 ||
|
|
400
|
+
(!nested &&
|
|
401
|
+
!dom.check.isListCell(selectedCells[0].previousElementSibling) &&
|
|
402
|
+
!dom.check.isListCell(selectedCells.at(-1).nextElementSibling))
|
|
403
|
+
) {
|
|
321
404
|
return {
|
|
322
405
|
sc: selectedCells[0],
|
|
323
406
|
so: 0,
|
|
@@ -331,7 +414,11 @@ class ListFormat {
|
|
|
331
414
|
let range = null;
|
|
332
415
|
|
|
333
416
|
if (nested) {
|
|
334
|
-
if (
|
|
417
|
+
if (
|
|
418
|
+
originList !== lastCell.parentElement &&
|
|
419
|
+
dom.check.isList(lastCell.parentElement?.parentElement) &&
|
|
420
|
+
lastCell.nextElementSibling
|
|
421
|
+
) {
|
|
335
422
|
lastCell = /** @type {HTMLElement} */ (lastCell.nextElementSibling);
|
|
336
423
|
while (lastCell) {
|
|
337
424
|
selectedCells.push(lastCell);
|
|
@@ -427,7 +514,11 @@ class ListFormat {
|
|
|
427
514
|
rChildren = dom.query.getListChildren(
|
|
428
515
|
baseNode,
|
|
429
516
|
(current) => {
|
|
430
|
-
return
|
|
517
|
+
return (
|
|
518
|
+
dom.check.isListCell(current) &&
|
|
519
|
+
!current.previousElementSibling &&
|
|
520
|
+
dom.query.getNodeDepth(current) === depth
|
|
521
|
+
);
|
|
431
522
|
},
|
|
432
523
|
null,
|
|
433
524
|
);
|