@heartlandone/vega 2.95.0 → 2.96.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/cjs/{app-globals-76815382.js → app-globals-38afea36.js} +7 -7
- package/dist/cjs/{code-block-493c7ce7.js → code-block-4126dc3b.js} +1501 -55
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-ab21fcbf.js → component-value-history-controller-slimmer.abstract-38ba956e.js} +2 -2
- package/dist/cjs/{content-state-fc34a814.js → content-state-50e8a03c.js} +142 -580
- package/dist/cjs/{element-appender-slimmer-1d6323c2.js → element-appender-slimmer-7773fdab.js} +115 -0
- package/dist/cjs/{image-annotation-action-7c4cd316.js → image-annotation-action-89363de8.js} +2 -2
- package/dist/cjs/{image-extension-30a7c10f.js → image-extension-c881c454.js} +2 -2
- package/dist/cjs/index.cjs.js +10 -10
- package/dist/cjs/{link-extension-92a63cb7.js → link-extension-b7f99a52.js} +2 -2
- package/dist/cjs/loader.cjs.js +7 -7
- package/dist/cjs/{public-rules-9e1ea1d9.js → public-rules-72894208.js} +3 -3
- package/dist/cjs/{range-30219330.js → range-95d41dea.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-23bf7485.js → rich-text-editor-required-rule-4d6d2493.js} +1 -1
- package/dist/cjs/{split-cell-operation-43752212.js → split-cell-operation-70be116d.js} +2 -2
- package/dist/cjs/{token-extension-d123d9d0.js → token-extension-eb828948.js} +35 -11
- package/dist/cjs/vega-code-block.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +27 -4
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +58 -9
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +608 -90
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-section-title.cjs.entry.js +896 -14
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +1 -1
- package/dist/cjs/vega.cjs.js +7 -7
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +2 -2
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +30 -7
- package/dist/collection/components/vega-input-select/vega-input-select.js +2 -2
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.css +4 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.js +10 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-list-strategy.js +8 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-annotation-strategy.abstract.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.js +36 -4
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-items-strategy.abstract.js +27 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-nest-items-strategy.js +74 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.js +81 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.js +30 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.js +160 -9
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +376 -10
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-unnest-items-strategy.js +104 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/nest-list-items-action.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/list-annotation.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +10 -1
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +11 -3
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +7 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +8 -4
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +34 -1
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +20 -3
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.js +25 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/abstract-delete-content-handler.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.js +30 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/abstract-list-keyboard-handler.js +204 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-shift-tab-outdent-handler.js +42 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-tab-indent-handler.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/list-keyboard-slimmer.js +180 -0
- package/dist/collection/components/vega-section-title/slimmers/a11y-tree/build-section-title-a11y-tree.js +54 -0
- package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +4 -4
- package/dist/collection/components/vega-section-title/vega-section-title.js +18 -2
- package/dist/collection/helpers/a11y-tree/a11y-node-dto.js +210 -0
- package/dist/collection/helpers/a11y-tree/a11y-tree-applier.js +189 -0
- package/dist/collection/helpers/a11y-tree/a11y-tree.types.js +48 -0
- package/dist/collection/helpers/a11y-tree/strategies/baseline-strategy.js +78 -0
- package/dist/collection/helpers/a11y-tree/strategies/firefox-nvda-strategy.js +56 -0
- package/dist/collection/helpers/a11y-tree/strategies/webkit-voiceover-strategy.js +140 -0
- package/dist/collection/helpers/a11y-tree/strategy-resolver.js +172 -0
- package/dist/collection/helpers/slimmers/a11y-tree-slimmer.js +54 -0
- package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +29 -0
- package/dist/collection/helpers/slimmers/element-appender/visibility-modifiers/clip-on-scroll-modifier.js +70 -0
- package/dist/collection/helpers/slimmers/element-appender/visibility-modifiers/visibility-modifier.interface.js +1 -0
- package/dist/collection/helpers/ui/element-appender.js +16 -0
- package/dist/esm/{app-globals-eafcc7a1.js → app-globals-d7b651c1.js} +7 -7
- package/dist/esm/{code-block-e12588fe.js → code-block-0a88b481.js} +1495 -51
- package/dist/esm/{component-value-history-controller-slimmer.abstract-4e8eb313.js → component-value-history-controller-slimmer.abstract-6846edfa.js} +2 -2
- package/dist/esm/{content-state-8032467a.js → content-state-79ca99e5.js} +105 -541
- package/dist/esm/{element-appender-slimmer-7fcb944b.js → element-appender-slimmer-73ad10ae.js} +115 -0
- package/dist/esm/{image-annotation-action-08a20d5e.js → image-annotation-action-bb299ef1.js} +2 -2
- package/dist/esm/{image-extension-b6c7e4a7.js → image-extension-48a96f98.js} +2 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/{link-extension-97fcb8fb.js → link-extension-09534514.js} +2 -2
- package/dist/esm/loader.js +7 -7
- package/dist/esm/{public-rules-c06f0d2a.js → public-rules-5eb03ef0.js} +3 -3
- package/dist/esm/{range-e999837f.js → range-d4deb7df.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-71f8ee98.js → rich-text-editor-required-rule-5bbbce23.js} +1 -1
- package/dist/esm/{split-cell-operation-359f8082.js → split-cell-operation-7f3058ad.js} +2 -2
- package/dist/esm/{token-extension-f5bf9c21.js → token-extension-40c32bcc.js} +30 -6
- package/dist/esm/vega-code-block.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +1 -1
- package/dist/esm/vega-dropdown_5.entry.js +27 -4
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-popover_2.entry.js +1 -1
- package/dist/esm/vega-rich-text-content.entry.js +58 -9
- package/dist/esm/vega-rich-text-editor_4.entry.js +604 -86
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +3 -3
- package/dist/esm/vega-section-title.entry.js +897 -15
- package/dist/esm/vega-time-picker_2.entry.js +1 -1
- package/dist/esm/vega-tooltip_2.entry.js +1 -1
- package/dist/esm/vega.js +7 -7
- package/dist/sri/vega-sri-manifest.json +94 -94
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +6 -6
- package/dist/types/components/vega-dropdown/types.d.ts +2 -2
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +32 -9
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +6 -6
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-annotation-strategy.abstract.d.ts +36 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.d.ts +14 -2
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-items-strategy.abstract.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-nest-items-strategy.d.ts +21 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-selection.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.d.ts +30 -3
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.d.ts +99 -3
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-unnest-items-strategy.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/nest-list-items-action.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/list-annotation.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +6 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +5 -1
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +2 -2
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler-base.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/bullets-numbers-toolbar-button-slimmer.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/abstract-list-keyboard-handler.d.ts +99 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-shift-tab-outdent-handler.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/helper/list-tab-indent-handler.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/bullets-numbers/list-keyboard-slimmer.d.ts +73 -0
- package/dist/types/components/vega-section-title/slimmers/a11y-tree/build-section-title-a11y-tree.d.ts +41 -0
- package/dist/types/components/vega-section-title/vega-section-title.d.ts +9 -0
- package/dist/types/components.d.ts +10 -10
- package/dist/types/helpers/a11y-tree/a11y-node-dto.d.ts +173 -0
- package/dist/types/helpers/a11y-tree/a11y-tree-applier.d.ts +28 -0
- package/dist/types/helpers/a11y-tree/a11y-tree.types.d.ts +137 -0
- package/dist/types/helpers/a11y-tree/strategies/baseline-strategy.d.ts +18 -0
- package/dist/types/helpers/a11y-tree/strategies/firefox-nvda-strategy.d.ts +16 -0
- package/dist/types/helpers/a11y-tree/strategies/webkit-voiceover-strategy.d.ts +23 -0
- package/dist/types/helpers/a11y-tree/strategy-resolver.d.ts +59 -0
- package/dist/types/helpers/slimmers/a11y-tree-slimmer.d.ts +49 -0
- package/dist/types/helpers/slimmers/element-appender/element-appender-slimmer.d.ts +9 -0
- package/dist/types/helpers/slimmers/element-appender/visibility-modifiers/clip-on-scroll-modifier.d.ts +37 -0
- package/dist/types/helpers/slimmers/element-appender/visibility-modifiers/visibility-modifier.interface.d.ts +56 -0
- package/dist/types/helpers/ui/element-appender.d.ts +7 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-9c39f90b.entry.js → p-1dfbc542.entry.js} +1 -1
- package/dist/vega/{p-e235020b.entry.js → p-22cc174e.entry.js} +1 -1
- package/dist/vega/{p-b187b82d.entry.js → p-2df5d59b.entry.js} +1 -1
- package/dist/vega/{p-f7e459cd.js → p-312d8205.js} +1 -1
- package/dist/vega/{p-a7209700.js → p-3345d903.js} +1 -1
- package/dist/vega/{p-02355de8.js → p-3c23ec90.js} +1 -1
- package/dist/vega/p-55e0014a.js +3 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-65fee02f.entry.js +1 -0
- package/dist/vega/p-6a51d720.js +1 -0
- package/dist/vega/{p-fe24b459.js → p-6c7b6d45.js} +1 -1
- package/dist/vega/{p-579cdeae.js → p-84b7a775.js} +1 -1
- package/dist/vega/{p-df828d90.entry.js → p-96da7d30.entry.js} +1 -1
- package/dist/vega/{p-88be9ec5.js → p-9d3f69cb.js} +1 -1
- package/dist/vega/{p-8a001caa.js → p-9f11b579.js} +1 -1
- package/dist/vega/{p-ba2b9663.entry.js → p-acaff62d.entry.js} +1 -1
- package/dist/vega/p-b63319e9.entry.js +1 -0
- package/dist/vega/{p-c079c935.entry.js → p-b660f38c.entry.js} +1 -1
- package/dist/vega/p-b8ffa42f.entry.js +1 -0
- package/dist/vega/{p-4fe40b76.js → p-c4564904.js} +1 -1
- package/dist/vega/p-d9158512.js +1 -0
- package/dist/vega/p-e62d41ee.js +1 -0
- package/dist/vega/{p-9f7154d2.js → p-ec5dee32.js} +1 -1
- package/dist/vega/{p-05d04c07.entry.js → p-f29d9707.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -2
- package/dist/vega/p-0be4df0a.js +0 -1
- package/dist/vega/p-38c9d782.js +0 -1
- package/dist/vega/p-513bc0d9.js +0 -1
- package/dist/vega/p-8d4b85e7.entry.js +0 -1
- package/dist/vega/p-c5d3b008.entry.js +0 -1
- package/dist/vega/p-d25ca0c3.entry.js +0 -1
- package/dist/vega/p-f4da615a.js +0 -3
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { generateUUID } from '../../../../../utils/misc';
|
|
2
|
+
import { SyncUpSelectionAction } from '../../actions/sync-up-selection-action';
|
|
3
|
+
import { RemoveNestListAction } from '../../actions/remove-nest-list-action';
|
|
4
|
+
import { ReplaceNestListAction } from '../../actions/replace-nest-list-action';
|
|
5
|
+
import { RTEListBlock } from '../../blocks/list-block';
|
|
6
|
+
import { RTEListItemBlock } from '../../blocks/list-item-block';
|
|
7
|
+
import { AbstractListItemsStrategy } from './list-items-strategy.abstract';
|
|
8
|
+
/**
|
|
9
|
+
* Promote selected nested list items one level up.
|
|
10
|
+
*/
|
|
11
|
+
export class ListUnnestItemsStrategy extends AbstractListItemsStrategy {
|
|
12
|
+
/**
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
handleAction(action, target) {
|
|
16
|
+
var _a;
|
|
17
|
+
const selectedItems = this.getOrderedContiguousItems(target, action.selectedBlocks);
|
|
18
|
+
const parentListParent = target.parent;
|
|
19
|
+
if (!selectedItems.length || !(parentListParent instanceof RTEListItemBlock)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const selectedStartIndex = target.children.indexOf(selectedItems[0]);
|
|
23
|
+
const selectedEndIndex = target.children.indexOf(selectedItems[selectedItems.length - 1]);
|
|
24
|
+
if (selectedStartIndex < 0 || selectedEndIndex < selectedStartIndex) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const parentListItem = parentListParent;
|
|
28
|
+
const grandParentList = parentListItem.parent;
|
|
29
|
+
const insertAfterIndex = grandParentList.children.indexOf(parentListItem);
|
|
30
|
+
if (insertAfterIndex < 0) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const trailingSiblingItems = target.children.slice(selectedEndIndex + 1);
|
|
34
|
+
const selectedItemSet = new Set(selectedItems);
|
|
35
|
+
target.children = target.children.filter((item) => !selectedItemSet.has(item));
|
|
36
|
+
grandParentList.children = [
|
|
37
|
+
...grandParentList.children.slice(0, insertAfterIndex + 1),
|
|
38
|
+
...selectedItems,
|
|
39
|
+
...grandParentList.children.slice(insertAfterIndex + 1),
|
|
40
|
+
];
|
|
41
|
+
selectedItems.forEach((item) => {
|
|
42
|
+
item.parent = grandParentList;
|
|
43
|
+
item.children.forEach((node) => node.apply(new SyncUpSelectionAction()));
|
|
44
|
+
});
|
|
45
|
+
if (trailingSiblingItems.length > 0) {
|
|
46
|
+
const trailingSiblingSet = new Set(trailingSiblingItems);
|
|
47
|
+
target.children = target.children.filter((item) => !trailingSiblingSet.has(item));
|
|
48
|
+
const newParentItem = selectedItems[selectedItems.length - 1];
|
|
49
|
+
let nestedList = (_a = newParentItem.nestList) === null || _a === void 0 ? void 0 : _a[newParentItem.nestList.length - 1];
|
|
50
|
+
// Shift+Tab follows same-type guard: when the last nested list has a
|
|
51
|
+
// different type, create a new child list of target.type instead of merging.
|
|
52
|
+
if (nestedList && nestedList.type !== target.type) {
|
|
53
|
+
nestedList = null;
|
|
54
|
+
}
|
|
55
|
+
if (!nestedList) {
|
|
56
|
+
nestedList = new RTEListBlock(generateUUID(), target.type);
|
|
57
|
+
const existingNestLists = Array.isArray(newParentItem.nestList)
|
|
58
|
+
? newParentItem.nestList
|
|
59
|
+
: [];
|
|
60
|
+
newParentItem.apply(new ReplaceNestListAction([...existingNestLists, nestedList]));
|
|
61
|
+
}
|
|
62
|
+
nestedList.children = nestedList.children.concat(trailingSiblingItems);
|
|
63
|
+
trailingSiblingItems.forEach((item) => {
|
|
64
|
+
item.parent = nestedList;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// Lists after target are visually after every target item. Once selected items
|
|
68
|
+
// move above their former parent, transfer those later branches to the last
|
|
69
|
+
// selected item even when target still contains leading items; otherwise the
|
|
70
|
+
// branches render before the promoted selection and document order changes.
|
|
71
|
+
const trailingNestLists = this.collectTrailingNestLists(parentListItem, target);
|
|
72
|
+
if (trailingNestLists.length > 0) {
|
|
73
|
+
const lastSelected = selectedItems[selectedItems.length - 1];
|
|
74
|
+
const existingNest = Array.isArray(lastSelected.nestList)
|
|
75
|
+
? lastSelected.nestList
|
|
76
|
+
: [];
|
|
77
|
+
lastSelected.apply(new ReplaceNestListAction([...existingNest, ...trailingNestLists]));
|
|
78
|
+
}
|
|
79
|
+
if (target.children.length === 0) {
|
|
80
|
+
parentListItem.apply(new RemoveNestListAction(target));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Collect and remove nestList entries that appear after the given target list
|
|
85
|
+
* in the parent item's nestList array. These trailing entries need to be
|
|
86
|
+
* transferred to the unnested item to preserve visual document order.
|
|
87
|
+
*
|
|
88
|
+
* @param {RTEListItemBlock} parentListItem - The list item owning the nestList.
|
|
89
|
+
* @param {RTEListBlock} target - The list being removed (used as the reference point).
|
|
90
|
+
* @returns {RTEListBlock[]} The trailing nestList entries (already removed from parentListItem).
|
|
91
|
+
*/
|
|
92
|
+
collectTrailingNestLists(parentListItem, target) {
|
|
93
|
+
var _a;
|
|
94
|
+
const nestLists = (_a = parentListItem.nestList) !== null && _a !== void 0 ? _a : [];
|
|
95
|
+
const targetIndex = nestLists.indexOf(target);
|
|
96
|
+
if (targetIndex < 0 || targetIndex >= nestLists.length - 1) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
const trailing = nestLists.slice(targetIndex + 1);
|
|
100
|
+
// Keep only entries up to and including target (target will be removed separately).
|
|
101
|
+
parentListItem.apply(new ReplaceNestListAction(nestLists.slice(0, targetIndex + 1)));
|
|
102
|
+
return trailing;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -16,6 +16,8 @@ export var ModifyContentActionType;
|
|
|
16
16
|
ModifyContentActionType["LINE_BREAK_MULTIPLE_BLOCKS"] = "LINE_BREAK_MULTIPLE_BLOCKS";
|
|
17
17
|
ModifyContentActionType["TRANSFORM_LIST_BLOCK"] = "TRANSFORM_LIST_BLOCK";
|
|
18
18
|
ModifyContentActionType["TRANSFORM_PARAGRAPH_BLOCK"] = "TRANSFORM_PARAGRAPH_BLOCK";
|
|
19
|
+
ModifyContentActionType["NEST_LIST_ITEMS"] = "NEST_LIST_ITEMS";
|
|
20
|
+
ModifyContentActionType["UNNEST_LIST_ITEMS"] = "UNNEST_LIST_ITEMS";
|
|
19
21
|
ModifyContentActionType["DELETE_BLOCK_CONTENT"] = "DELETE_BLOCK_CONTENT";
|
|
20
22
|
ModifyContentActionType["INSERT_IMAGE_TO_BLOCK"] = "INSERT_IMAGE_TO_BLOCK";
|
|
21
23
|
ModifyContentActionType["UPDATE_IMAGE_NODE_URL"] = "UPDATE_IMAGE_NODE_URL";
|
package/dist/collection/components/vega-rich-text-editor/dto/actions/nest-list-items-action.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ModifyContentAction, ModifyContentActionType } from './modify-content-action.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Action to nest the selected list items under the previous sibling.
|
|
4
|
+
*/
|
|
5
|
+
export class NestListItemsAction extends ModifyContentAction {
|
|
6
|
+
constructor(selectedBlocks) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = ModifyContentActionType.NEST_LIST_ITEMS;
|
|
9
|
+
this.isFlushable = true;
|
|
10
|
+
this.selectedBlocks = selectedBlocks;
|
|
11
|
+
}
|
|
12
|
+
}
|
package/dist/collection/components/vega-rich-text-editor/dto/actions/unnest-list-items-action.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ModifyContentAction, ModifyContentActionType } from './modify-content-action.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Action to promote the selected nested list items one level up.
|
|
4
|
+
*/
|
|
5
|
+
export class UnnestListItemsAction extends ModifyContentAction {
|
|
6
|
+
constructor(selectedBlocks) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = ModifyContentActionType.UNNEST_LIST_ITEMS;
|
|
9
|
+
this.isFlushable = true;
|
|
10
|
+
this.selectedBlocks = selectedBlocks;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -18,6 +18,18 @@ export class ListAnnotation extends BlockAnnotation {
|
|
|
18
18
|
marginLeft: '16px',
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the default standalone styles for a list block's item marker
|
|
23
|
+
* (`li::marker`). Capping the marker font-size keeps bullets/numbers
|
|
24
|
+
* at a normal size when list items are styled as title/subtitle.
|
|
25
|
+
*
|
|
26
|
+
* @returns {AnnotationStyle} The default marker styles.
|
|
27
|
+
*/
|
|
28
|
+
static getDefaultMarkerStyles() {
|
|
29
|
+
return {
|
|
30
|
+
fontSize: '16px',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
21
33
|
/**
|
|
22
34
|
* @inheritDoc
|
|
23
35
|
*/
|
|
@@ -5,6 +5,8 @@ import { ActionHandleStrategyRegistry } from '../action-handle-strategies/action
|
|
|
5
5
|
import { ListTransformToListStrategy } from '../action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy';
|
|
6
6
|
import { ListTransformToParagraphStrategy } from '../action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy';
|
|
7
7
|
import { ListInsertImageStrategy } from '../action-handle-strategies/modify-content-strategies/list-insert-image-strategy';
|
|
8
|
+
import { ListNestItemsStrategy } from '../action-handle-strategies/modify-content-strategies/list-nest-items-strategy';
|
|
9
|
+
import { ListUnnestItemsStrategy } from '../action-handle-strategies/modify-content-strategies/list-unnest-items-strategy';
|
|
8
10
|
import { BlockAnnotationTypeEnum } from '../annotations/block-annotation.abstract';
|
|
9
11
|
import { ListAnnotation } from '../annotations/list-annotation';
|
|
10
12
|
import { isNonNullable } from '../../../../types/type-guard';
|
|
@@ -12,7 +14,12 @@ import { CustomAttributeAnnotation } from '../annotations/custom-attribute-annot
|
|
|
12
14
|
import { CustomClassAnnotation } from '../annotations/custom-class-annotation';
|
|
13
15
|
import { CustomStyleAnnotation } from '../annotations/custom-style-annotation';
|
|
14
16
|
/**
|
|
15
|
-
* List block
|
|
17
|
+
* List block.
|
|
18
|
+
*
|
|
19
|
+
* Bidirectional nesting contract:
|
|
20
|
+
* - Every child list item must have item.parent === this list block.
|
|
21
|
+
* - If this list block is nested, its parent must be a list item and that
|
|
22
|
+
* list item keeps this block in listItem.nestList.
|
|
16
23
|
*/
|
|
17
24
|
export class RTEListBlock extends RTEBlock {
|
|
18
25
|
constructor(id, type, options) {
|
|
@@ -126,5 +133,7 @@ export class RTEListBlock extends RTEBlock {
|
|
|
126
133
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_LIST_BLOCK, RTEListBlock.name, new ListTransformToListStrategy());
|
|
127
134
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.TRANSFORM_PARAGRAPH_BLOCK, RTEListBlock.name, new ListTransformToParagraphStrategy());
|
|
128
135
|
ActionHandleStrategyRegistry.register(ModifyContentActionType.INSERT_IMAGE_TO_BLOCK, RTEListBlock.name, new ListInsertImageStrategy());
|
|
136
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.NEST_LIST_ITEMS, RTEListBlock.name, new ListNestItemsStrategy());
|
|
137
|
+
ActionHandleStrategyRegistry.register(ModifyContentActionType.UNNEST_LIST_ITEMS, RTEListBlock.name, new ListUnnestItemsStrategy());
|
|
129
138
|
})();
|
|
130
139
|
RTEListBlock.dtoName = 'RTEListBlock';
|
|
@@ -19,7 +19,11 @@ import { BlockUpdateTextStyleStrategy } from '../action-handle-strategies/apply-
|
|
|
19
19
|
import { HorizontalAlignmentAnnotationAction } from '../actions/horizontal-alignment-annotation-action';
|
|
20
20
|
import { BlockUpdateHorizontalAlignmentStrategy } from '../action-handle-strategies/apply-annotation-strategies/block-update-horizontal-alignment-strategy';
|
|
21
21
|
/**
|
|
22
|
-
* List item block
|
|
22
|
+
* List item block.
|
|
23
|
+
*
|
|
24
|
+
* Bidirectional nesting contract:
|
|
25
|
+
* - nestList stores nested list blocks owned by this list item.
|
|
26
|
+
* - Every nested list block must have listBlock.parent === this list item.
|
|
23
27
|
*/
|
|
24
28
|
export class RTEListItemBlock extends RTETextBlock {
|
|
25
29
|
constructor(id, nestList, options) {
|
|
@@ -46,7 +50,7 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
46
50
|
listItemBlock.children = block.nodes.map((richText) => RTETextNode.from(richText, listItemBlock, options));
|
|
47
51
|
if (block.children) {
|
|
48
52
|
listItemBlock.nestList = block.children.map((child) => {
|
|
49
|
-
const listBlock = RTEListBlock.from(child);
|
|
53
|
+
const listBlock = RTEListBlock.from(child, options);
|
|
50
54
|
listBlock.parent = listItemBlock;
|
|
51
55
|
return listBlock;
|
|
52
56
|
});
|
|
@@ -73,8 +77,12 @@ export class RTEListItemBlock extends RTETextBlock {
|
|
|
73
77
|
* @inheritDoc
|
|
74
78
|
*/
|
|
75
79
|
toHtml(options) {
|
|
80
|
+
var _a;
|
|
76
81
|
const attrStr = super.generateAttributeString(options);
|
|
77
|
-
|
|
82
|
+
const nestListHtml = ((_a = this.nestList) === null || _a === void 0 ? void 0 : _a.length)
|
|
83
|
+
? this.nestList.map((list) => list.toHtml(options)).join('')
|
|
84
|
+
: '';
|
|
85
|
+
return [`<li${attrStr}>`, this.getChildrenHtml(options), nestListHtml, `</li>`].join('');
|
|
78
86
|
}
|
|
79
87
|
/**
|
|
80
88
|
* @inheritDoc
|
|
@@ -24,6 +24,7 @@ import { LogUtility } from '../../../utils/log';
|
|
|
24
24
|
import { HTMLContentCleaner } from '../slimmers/controllers/html-cleaner';
|
|
25
25
|
import { RTEFilterStylesStrategyRegistry } from './filter-styles-strategies/filter-styles-strategy-registry';
|
|
26
26
|
import { DeleteSelectedContentStrategy } from './action-handle-strategies/modify-content-strategies/delete-selected-content-strategy';
|
|
27
|
+
import { ReplaceNestListAction } from './actions/replace-nest-list-action';
|
|
27
28
|
/**
|
|
28
29
|
* Class representing the content state of the rich text editor.
|
|
29
30
|
*/
|
|
@@ -191,14 +192,19 @@ export class VegaRTEContent {
|
|
|
191
192
|
/**
|
|
192
193
|
* Convert text to list.
|
|
193
194
|
*
|
|
194
|
-
* @param {RTETextBlock} block -
|
|
195
|
+
* @param {RTETextBlock | RTEListItemBlock} block - Block to convert or rebuild.
|
|
195
196
|
* @returns {RTEListItemBlock} list item block dto.
|
|
196
197
|
*/
|
|
197
198
|
toListItem(block) {
|
|
199
|
+
var _a;
|
|
198
200
|
block.children.map((node) => node.apply(new SyncUpSelectionAction()));
|
|
199
201
|
const listItemBlock = new RTEListItemBlock(generateUUID());
|
|
200
202
|
listItemBlock.apply(new AppendChildrenAction(block['children']));
|
|
201
203
|
listItemBlock['annotationMap'] = block['annotationMap'];
|
|
204
|
+
if (block instanceof RTEListItemBlock && ((_a = block.nestList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
205
|
+
listItemBlock.apply(new ReplaceNestListAction([...block.nestList]));
|
|
206
|
+
block.apply(new ReplaceNestListAction([]));
|
|
207
|
+
}
|
|
202
208
|
return listItemBlock;
|
|
203
209
|
}
|
|
204
210
|
/**
|
|
@@ -27,10 +27,14 @@ export class ListBlockFilterStylesStrategy extends RTEFilterStylesStrategy {
|
|
|
27
27
|
* @inheritDoc
|
|
28
28
|
*/
|
|
29
29
|
toCssText() {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const containerClass = RTEFilterStylesStrategy.RTE_CONTENT_CONTAINER_CLASS_NAME;
|
|
31
|
+
const tags = this.elementTagName.split(',').map((tag) => tag.trim());
|
|
32
|
+
const baseSelector = tags.map((tag) => `.${containerClass} ${tag}`).join(', ');
|
|
33
|
+
const markerSelector = tags
|
|
34
|
+
.map((tag) => `.${containerClass} ${tag} > li::marker`)
|
|
33
35
|
.join(', ');
|
|
34
|
-
|
|
36
|
+
const markerStyles = this.convertStylesMapToCssText(ListAnnotation.getDefaultMarkerStyles());
|
|
37
|
+
return (`${baseSelector} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} } ` +
|
|
38
|
+
`${markerSelector} { ${markerStyles} }`);
|
|
35
39
|
}
|
|
36
40
|
}
|
package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js
CHANGED
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
|
+
import { RTEListItemBlock } from '../../blocks/list-item-block';
|
|
2
3
|
import { RTEBlockRenderer } from './block-renderer.abstract';
|
|
3
4
|
import RTEListItemBlockRenderer from './list-item-block-renderer';
|
|
5
|
+
const defaultOrderedListMarkerRule = ['decimal', 'lower-alpha', 'lower-roman'];
|
|
6
|
+
const defaultBulletListMarkerRule = ['disc', 'circle', 'square'];
|
|
4
7
|
class RTEListBlockRenderer extends RTEBlockRenderer {
|
|
5
8
|
render(block, renderContext) {
|
|
6
9
|
const BlockTag = block.getBlockTag();
|
|
7
|
-
|
|
10
|
+
const styles = block.getStyles(renderContext);
|
|
11
|
+
const resolvedListMarker = this.resolveListMarker(block, styles);
|
|
12
|
+
if (resolvedListMarker) {
|
|
13
|
+
styles.listStyleType = resolvedListMarker;
|
|
14
|
+
}
|
|
15
|
+
return (h(BlockTag, Object.assign({}, this.getCustomAttrs(block), { key: block.id, ref: (ref) => super.registerRef(ref, block), style: styles, class: block.getClasses() }), block.children.map((listItemBlock) => RTEListItemBlockRenderer.render(listItemBlock, renderContext))));
|
|
16
|
+
}
|
|
17
|
+
resolveListMarker(block, styles) {
|
|
18
|
+
if (styles.listStyleType || styles['list-style-type']) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const depth = this.getListDepth(block, block.type);
|
|
22
|
+
if (block.type === 'number-list') {
|
|
23
|
+
return defaultOrderedListMarkerRule[depth % defaultOrderedListMarkerRule.length];
|
|
24
|
+
}
|
|
25
|
+
if (block.type === 'bullet-list') {
|
|
26
|
+
return defaultBulletListMarkerRule[depth % defaultBulletListMarkerRule.length];
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
getListDepth(block, targetType) {
|
|
31
|
+
let depth = 0;
|
|
32
|
+
let currentList = block;
|
|
33
|
+
while (currentList.parent instanceof RTEListItemBlock) {
|
|
34
|
+
const parentList = currentList.parent.parent;
|
|
35
|
+
if (parentList.type === targetType) {
|
|
36
|
+
depth++;
|
|
37
|
+
}
|
|
38
|
+
currentList = parentList;
|
|
39
|
+
}
|
|
40
|
+
return depth;
|
|
8
41
|
}
|
|
9
42
|
}
|
|
10
43
|
export default new RTEListBlockRenderer();
|
|
@@ -3,9 +3,26 @@ import RTEListBlockRenderer from './list-block-renderer';
|
|
|
3
3
|
import { RTEBlockTextNodesRenderer } from './block-text-nodes-renderer.abstract';
|
|
4
4
|
class RTEListItemBlockRenderer extends RTEBlockTextNodesRenderer {
|
|
5
5
|
render(block, renderContext) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
var _a;
|
|
7
|
+
const hasNestList = ((_a = block.nestList) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
8
|
+
return (h("li", Object.assign({}, this.getCustomAttrs(block), { key: this.getRenderKey(block), ref: (ref) => super.registerRef(ref, block), style: block.getStyles(), class: block.getClasses() }),
|
|
9
|
+
hasNestList ? (
|
|
10
|
+
// Keep text nodes wrapped as a block-level element when a nested list exists.
|
|
11
|
+
// This preserves stable marker/text flow and selection behavior before the child list.
|
|
12
|
+
h("span", { style: { display: 'block' } }, super.renderNodes(block, renderContext))) : (super.renderNodes(block, renderContext)),
|
|
13
|
+
hasNestList && this.renderChildren(block.nestList, renderContext)));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Include structural ownership and direct nested-list identity in the key so
|
|
17
|
+
* list mutations recreate the li when its rendered child shape changes.
|
|
18
|
+
*
|
|
19
|
+
* @param {RTEListItemBlock} block - List item being rendered.
|
|
20
|
+
* @returns {string} Structure-aware render key.
|
|
21
|
+
*/
|
|
22
|
+
getRenderKey(block) {
|
|
23
|
+
var _a;
|
|
24
|
+
const nestListIds = ((_a = block.nestList) !== null && _a !== void 0 ? _a : []).map((list) => list.id);
|
|
25
|
+
return JSON.stringify([block.parent.id, block.id, nestListIds]);
|
|
9
26
|
}
|
|
10
27
|
renderChildren(children, renderContext) {
|
|
11
28
|
return children === null || children === void 0 ? void 0 : children.map((block) => RTEListBlockRenderer.render(block, renderContext));
|
|
@@ -33,12 +33,29 @@ export class TableAnnotationHandlerBase extends AnnotationGeneratorStrategyAbstr
|
|
|
33
33
|
const updatedBorderColor = borderColor === 'initial' ? '' : borderColor;
|
|
34
34
|
return {
|
|
35
35
|
style: borderStyle === 'initial' ? '' : borderStyle,
|
|
36
|
-
width: borderWidth
|
|
36
|
+
width: this.normalizeBorderWidth(borderWidth),
|
|
37
37
|
color: RTETableColorManager.getColorKey(updatedBorderColor) || updatedBorderColor,
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Normalize a border width read from the DOM, dropping the `initial` value and the
|
|
44
|
+
* CSS keyword widths (`thin`/`medium`/`thick`). Those only appear as serialization
|
|
45
|
+
* artifacts of shorthand borders (e.g. `border: none` → `border-width: medium`) and
|
|
46
|
+
* are not valid numeric dimensions, so leaving them in would populate the properties
|
|
47
|
+
* "Weight" field with an invalid value and block the whole form from saving.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} borderWidth - The raw border width read from the element style.
|
|
50
|
+
* @returns {string} The normalized border width (empty string when it is a keyword).
|
|
51
|
+
*/
|
|
52
|
+
normalizeBorderWidth(borderWidth) {
|
|
53
|
+
if (borderWidth === 'initial' ||
|
|
54
|
+
TableAnnotationHandlerBase.BORDER_WIDTH_KEYWORDS.includes(borderWidth)) {
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
return borderWidth;
|
|
58
|
+
}
|
|
42
59
|
/**
|
|
43
60
|
* Extract width from element.
|
|
44
61
|
*
|
|
@@ -76,3 +93,10 @@ export class TableAnnotationHandlerBase extends AnnotationGeneratorStrategyAbstr
|
|
|
76
93
|
return null;
|
|
77
94
|
}
|
|
78
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* CSS border-width keywords. These are produced as serialization artifacts when a
|
|
98
|
+
* shorthand border without an explicit width is round-tripped (e.g. `border: none`
|
|
99
|
+
* expands to `border-width: medium`). They are not valid numeric dimensions for the
|
|
100
|
+
* table/cell properties "Weight" field, so they are normalized away on import.
|
|
101
|
+
*/
|
|
102
|
+
TableAnnotationHandlerBase.BORDER_WIDTH_KEYWORDS = ['thin', 'medium', 'thick'];
|
|
@@ -53,6 +53,8 @@ export class LiToRTEListItemBlockStrategy extends BlockToRTEBlockStrategyAbstrac
|
|
|
53
53
|
*/
|
|
54
54
|
appendChildBlocks(currentBlock, childBlocks) {
|
|
55
55
|
currentBlock.nestList = childBlocks.filter((block) => ['bullet-list', 'number-list'].includes(block.type));
|
|
56
|
+
// Maintain bidirectional parent link so that nested list blocks can traverse up to the list item.
|
|
57
|
+
currentBlock.nestList.forEach((block) => (block.parent = currentBlock));
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
60
|
* Should continue process to child elements.
|
|
@@ -61,11 +61,25 @@ export class AbstractDeleteContentHandler extends BaseHandler {
|
|
|
61
61
|
* @returns {Nullable<RTENode>} The next node, or null when the given node is the last node of the content.
|
|
62
62
|
*/
|
|
63
63
|
getNextNode(node) {
|
|
64
|
+
var _a;
|
|
64
65
|
const block = node.parent;
|
|
65
66
|
const nodeIndex = block.children.indexOf(node);
|
|
66
67
|
if (nodeIndex >= 0 && nodeIndex < block.children.length - 1) {
|
|
67
68
|
return block.children[nodeIndex + 1];
|
|
68
69
|
}
|
|
70
|
+
// When the caret is at the end of a list item that owns nested lists, the next
|
|
71
|
+
// caret position is the first node of the first non-empty nested list, not the following sibling
|
|
72
|
+
// block. Descend into the item's own nestList before ascending to siblings so that
|
|
73
|
+
// a forward delete merges the first nested item up instead of skipping the whole
|
|
74
|
+
// nested list and merging the following sibling into the deepest nested item.
|
|
75
|
+
if (block.isListItemBlock() && ((_a = block.nestList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
76
|
+
for (const nestedList of block.nestList) {
|
|
77
|
+
const firstNestedNode = nestedList.getFirstNode();
|
|
78
|
+
if (firstNestedNode) {
|
|
79
|
+
return firstNestedNode;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
69
83
|
const nextBlock = this.getNextBlock(block);
|
|
70
84
|
return nextBlock ? nextBlock.getFirstNode() : null;
|
|
71
85
|
}
|
|
@@ -76,10 +90,25 @@ export class AbstractDeleteContentHandler extends BaseHandler {
|
|
|
76
90
|
* @returns {Nullable<RTEBlock>} The next block, or null when the given block is the last block of the content.
|
|
77
91
|
*/
|
|
78
92
|
getNextBlock(block) {
|
|
93
|
+
var _a, _b;
|
|
79
94
|
const parent = block.parent;
|
|
80
95
|
if (!parent || !parent.children) {
|
|
81
96
|
return null;
|
|
82
97
|
}
|
|
98
|
+
// Nested lists are owned through a list item's nestList collection rather than
|
|
99
|
+
// its children collection. Traverse the remaining nested-list branches before
|
|
100
|
+
// ascending to the owning item and its following siblings.
|
|
101
|
+
if (parent instanceof RTEBlock && parent.isListItemBlock()) {
|
|
102
|
+
const nestedListIndex = ((_a = parent.nestList) !== null && _a !== void 0 ? _a : []).indexOf(block);
|
|
103
|
+
if (nestedListIndex >= 0) {
|
|
104
|
+
for (const nestedList of ((_b = parent.nestList) !== null && _b !== void 0 ? _b : []).slice(nestedListIndex + 1)) {
|
|
105
|
+
if (nestedList.getFirstNode()) {
|
|
106
|
+
return nestedList;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return this.getNextBlock(parent);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
83
112
|
const siblings = parent.children;
|
|
84
113
|
const blockIndex = siblings.indexOf(block);
|
|
85
114
|
if (blockIndex >= 0 && siblings[blockIndex + 1]) {
|
|
@@ -5,10 +5,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { h } from '@stencil/core';
|
|
8
|
-
import { InjectVegaSlimmer, MapToComponentField, MapToComponentMethod } from 'vega-slimmer/core';
|
|
8
|
+
import { InjectVegaSlimmer, MapToComponentField, MapToComponentMethod, methodPlaceholder, } from 'vega-slimmer/core';
|
|
9
9
|
import { VegaInternalIconManager } from '../../../../../../helpers/icon/internal-icon-manager';
|
|
10
10
|
import ListUL from '../../../../assets/list-ul';
|
|
11
11
|
import ListOL from '../../../../assets/list-ol';
|
|
12
|
+
import { ListKeyboardSlimmer } from './list-keyboard-slimmer';
|
|
12
13
|
import { BulletsToolbarButtonSlimmer } from './bullets-toolbar-button-slimmer';
|
|
13
14
|
import { NumbersToolbarButtonSlimmer } from './numbers-toolbar-button-slimmer';
|
|
14
15
|
import { VisualModeToolbarButtonSlimmer } from '../visual-mode-toolbar-button-slimmer.abstract';
|
|
@@ -24,6 +25,13 @@ export class BulletsNumbersToolbarButtonSlimmer extends VisualModeToolbarButtonS
|
|
|
24
25
|
});
|
|
25
26
|
this.bulletsToolbarButtonSlimmer = new BulletsToolbarButtonSlimmer();
|
|
26
27
|
this.numbersToolbarButtonSlimmer = new NumbersToolbarButtonSlimmer();
|
|
28
|
+
this.listKeyboardSlimmer = new ListKeyboardSlimmer();
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
methodPlaceholder();
|
|
32
|
+
}
|
|
33
|
+
componentDidLoad() {
|
|
34
|
+
methodPlaceholder();
|
|
27
35
|
}
|
|
28
36
|
componentWillRender() {
|
|
29
37
|
if (this.numbersToolbarButtonSlimmer.isSelected()) {
|
|
@@ -86,12 +94,33 @@ export class BulletsNumbersToolbarButtonSlimmer extends VisualModeToolbarButtonS
|
|
|
86
94
|
__decorate([
|
|
87
95
|
MapToComponentField()
|
|
88
96
|
], BulletsNumbersToolbarButtonSlimmer.prototype, "selectionController", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
MapToComponentField()
|
|
99
|
+
], BulletsNumbersToolbarButtonSlimmer.prototype, "valueController", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
MapToComponentField()
|
|
102
|
+
], BulletsNumbersToolbarButtonSlimmer.prototype, "value", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
MapToComponentField()
|
|
105
|
+
], BulletsNumbersToolbarButtonSlimmer.prototype, "toolbarItems", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
MapToComponentField()
|
|
108
|
+
], BulletsNumbersToolbarButtonSlimmer.prototype, "vegaRichTextEditorRenderer", void 0);
|
|
89
109
|
__decorate([
|
|
90
110
|
InjectVegaSlimmer()
|
|
91
111
|
], BulletsNumbersToolbarButtonSlimmer.prototype, "bulletsToolbarButtonSlimmer", void 0);
|
|
92
112
|
__decorate([
|
|
93
113
|
InjectVegaSlimmer()
|
|
94
114
|
], BulletsNumbersToolbarButtonSlimmer.prototype, "numbersToolbarButtonSlimmer", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
InjectVegaSlimmer()
|
|
117
|
+
], BulletsNumbersToolbarButtonSlimmer.prototype, "listKeyboardSlimmer", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
MapToComponentMethod('disconnectedCallback')
|
|
120
|
+
], BulletsNumbersToolbarButtonSlimmer.prototype, "disconnectedCallback", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
MapToComponentMethod('componentDidLoad')
|
|
123
|
+
], BulletsNumbersToolbarButtonSlimmer.prototype, "componentDidLoad", null);
|
|
95
124
|
__decorate([
|
|
96
125
|
MapToComponentMethod('componentWillRender')
|
|
97
126
|
], BulletsNumbersToolbarButtonSlimmer.prototype, "componentWillRender", null);
|