@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
|
@@ -17,7 +17,7 @@ const typeGuard = require('./type-guard-f354af8b.js');
|
|
|
17
17
|
const array = require('./array-249289f2.js');
|
|
18
18
|
const staticSubjectTitle = require('./static-subject-title-70c73b16.js');
|
|
19
19
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
20
|
-
const elementAppenderSlimmer = require('./element-appender-slimmer-
|
|
20
|
+
const elementAppenderSlimmer = require('./element-appender-slimmer-7773fdab.js');
|
|
21
21
|
const clickOutsideOnlyToDismissStrategy = require('./click-outside-only-to-dismiss-strategy-407f6d1e.js');
|
|
22
22
|
const keyboardManagerSlimmer = require('./keyboard-manager-slimmer-a1223714.js');
|
|
23
23
|
const internalFormFieldValidationRule_abstract = require('./internal-form-field-validation-rule.abstract-07cdff46.js');
|
|
@@ -7,7 +7,7 @@ const component = require('./component-1e352960.js');
|
|
|
7
7
|
const injectKeyboardManager = require('./inject-keyboard-manager-5a105612.js');
|
|
8
8
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
9
9
|
const componentUsageRuntimeMetrics = require('./component-usage-runtime-metrics-389d1548.js');
|
|
10
|
-
const elementAppenderSlimmer = require('./element-appender-slimmer-
|
|
10
|
+
const elementAppenderSlimmer = require('./element-appender-slimmer-7773fdab.js');
|
|
11
11
|
const deprecatedPropertySlimmer = require('./deprecated-property-slimmer-300a3929.js');
|
|
12
12
|
require('./keyboard-manager-ca76d4dc.js');
|
|
13
13
|
require('./ui-c91c37a7.js');
|
package/dist/cjs/vega.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index-58ea899e.js');
|
|
4
|
-
const appGlobals = require('./app-globals-
|
|
4
|
+
const appGlobals = require('./app-globals-38afea36.js');
|
|
5
5
|
require('./feature-flag-controller-c19d0b58.js');
|
|
6
6
|
require('./global-slimmer-registry-b3bce7e0.js');
|
|
7
7
|
require('./index-3ca118c4.js');
|
|
8
|
-
require('./token-extension-
|
|
8
|
+
require('./token-extension-eb828948.js');
|
|
9
9
|
require('./misc-3d30df91.js');
|
|
10
10
|
require('./ui-c91c37a7.js');
|
|
11
11
|
require('./create-public-api-runtime-metrics-slimmer-91b0cbfb.js');
|
|
@@ -25,8 +25,8 @@ require('./static-subject-title-70c73b16.js');
|
|
|
25
25
|
require('./internal-calendar-period-factory-b76006f7.js');
|
|
26
26
|
require('./type-guard-f354af8b.js');
|
|
27
27
|
require('./typography-3ea4fe41.js');
|
|
28
|
-
require('./link-extension-
|
|
29
|
-
require('./code-block-
|
|
28
|
+
require('./link-extension-b7f99a52.js');
|
|
29
|
+
require('./code-block-4126dc3b.js');
|
|
30
30
|
require('./dom-node-subject-observer-factory-c82df135.js');
|
|
31
31
|
require('./observer-f49483e8.js');
|
|
32
32
|
require('./vega-internal-event-id-ecc5b87a.js');
|
|
@@ -36,14 +36,14 @@ require('./tinycolor-polyfill-502efaa8.js');
|
|
|
36
36
|
require('./vega-nonce-manager-df69d3ed.js');
|
|
37
37
|
require('./index-592b4052.js');
|
|
38
38
|
require('./object-b53e9416.js');
|
|
39
|
-
require('./content-state-
|
|
39
|
+
require('./content-state-50e8a03c.js');
|
|
40
40
|
require('./internal-icon-manager-40bcac72.js');
|
|
41
41
|
require('./icon-manager-be358b32.js');
|
|
42
|
-
require('./split-cell-operation-
|
|
42
|
+
require('./split-cell-operation-70be116d.js');
|
|
43
43
|
require('./remote-invocation-registry-fc22fdd0.js');
|
|
44
44
|
require('./pixel-98f2a10c.js');
|
|
45
45
|
require('./timer-5f33058b.js');
|
|
46
|
-
require('./image-extension-
|
|
46
|
+
require('./image-extension-c881c454.js');
|
|
47
47
|
require('./copy-d021c780.js');
|
|
48
48
|
require('./vega-dialog-controller-16be85d5.js');
|
|
49
49
|
require('./valid-credit-card-number-rule-8d370163.js');
|
|
@@ -698,7 +698,7 @@ export class VegaComboBox {
|
|
|
698
698
|
"name": "vegaVersion",
|
|
699
699
|
"text": "2.95.0"
|
|
700
700
|
}],
|
|
701
|
-
"text": "An event emitter
|
|
701
|
+
"text": "An event emitter only fired when the Select All checkbox in the dropdown has been clicked.\n\nThe event's `detail` property is `true` when the Select All checkbox is clicked to select all items,\n and `false` when the Select All checkbox is clicked to clear all selected items."
|
|
702
702
|
},
|
|
703
703
|
"complexType": {
|
|
704
704
|
"original": "boolean",
|
|
@@ -719,7 +719,7 @@ export class VegaComboBox {
|
|
|
719
719
|
"name": "vegaVersion",
|
|
720
720
|
"text": "2.95.0"
|
|
721
721
|
}],
|
|
722
|
-
"text": "An event emitter
|
|
722
|
+
"text": "An event emitter only fired when the Select All checkbox in the dropdown has been clicked.\n\nThe event's `detail` property is `true` when the Select All checkbox is clicked to select all items,\n and `false` when the Select All checkbox is clicked to clear all selected items."
|
|
723
723
|
},
|
|
724
724
|
"complexType": {
|
|
725
725
|
"original": "boolean",
|
|
@@ -234,10 +234,33 @@ export class VegaDropdown {
|
|
|
234
234
|
*/
|
|
235
235
|
this.isLazyLoading = false;
|
|
236
236
|
/**
|
|
237
|
-
* Determines whether the dropdown position
|
|
237
|
+
* Determines whether the dropdown uses viewport-based positioning (`position: fixed`) or container-based positioning (`position: absolute`).
|
|
238
238
|
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
239
|
+
* **Technical Implementation:**
|
|
240
|
+
*
|
|
241
|
+
* - When `false` (default): The dropdown content box renders with `position: absolute` and its coordinates are calculated relative to the nearest positioned ancestor. Combined with `positionRelativeTo`, you can specify which ancestor to measure from, which ensures the menu scrolls together with that ancestor.
|
|
242
|
+
*
|
|
243
|
+
* - When `true`: The dropdown content box renders with `position: fixed` and its coordinates are calculated from the viewport. The menu is visually anchored to the trigger element via JavaScript and moves with it on scroll, even though it is not part of the document flow. `positionRelativeTo` has no effect in this mode.
|
|
244
|
+
*
|
|
245
|
+
* When to set `isScreenPosition` to `true`:
|
|
246
|
+
*
|
|
247
|
+
* - Dropdowns that need to break out of container constraints (non-Shadow-DOM only):
|
|
248
|
+
* When you want the dropdown to appear outside its container's boundaries (e.g., to avoid being clipped by a parent's
|
|
249
|
+
* `overflow: hidden` or small dimensions), viewport-based positioning allows it to render freely.
|
|
250
|
+
* This only works for regular (non-Shadow-DOM) containers. Shadow DOM boundaries cannot be escaped with `position: fixed`.
|
|
251
|
+
*
|
|
252
|
+
* - Dropdowns in fixed or sticky positioned containers:
|
|
253
|
+
* When the dropdown trigger is inside a fixed or sticky positioned container, viewport-based positioning ensures correct alignment.
|
|
254
|
+
*
|
|
255
|
+
* When to keep `isScreenPosition` as `false` (default):
|
|
256
|
+
*
|
|
257
|
+
* - Simple layouts where the dropdown and its trigger are not inside scrollable containers
|
|
258
|
+
* - When you want the dropdown to scroll naturally with its container (using `position: absolute`)
|
|
259
|
+
* - When you need `positionRelativeTo` to control which ancestor the dropdown is positioned relative to
|
|
260
|
+
* - When `matchContainerHeight` is needed (this property is overridden when `isScreenPosition` is `true`)
|
|
261
|
+
*
|
|
262
|
+
* @VegaWarning - Setting this to `true` override the `positionRelativeTo` and `matchContainerHeight` properties, rendering them ineffective.
|
|
263
|
+
* - Currently, when set to `true`, the position calculation may be inaccurate if the popover is placed inside a scrollable container within a shadowRoot (e.g., inside a vega-modal with scrollable content).
|
|
241
264
|
* @vegaVersion 2.36.0
|
|
242
265
|
*/
|
|
243
266
|
this.isScreenPosition = false;
|
|
@@ -982,12 +1005,12 @@ export class VegaDropdown {
|
|
|
982
1005
|
"docs": {
|
|
983
1006
|
"tags": [{
|
|
984
1007
|
"name": "VegaWarning",
|
|
985
|
-
"text": "-
|
|
1008
|
+
"text": "- Setting this to `true` override the `positionRelativeTo` and `matchContainerHeight` properties, rendering them ineffective.\n- Currently, when set to `true`, the position calculation may be inaccurate if the popover is placed inside a scrollable container within a shadowRoot (e.g., inside a vega-modal with scrollable content)."
|
|
986
1009
|
}, {
|
|
987
1010
|
"name": "vegaVersion",
|
|
988
1011
|
"text": "2.36.0"
|
|
989
1012
|
}],
|
|
990
|
-
"text": "Determines whether the dropdown position
|
|
1013
|
+
"text": "Determines whether the dropdown uses viewport-based positioning (`position: fixed`) or container-based positioning (`position: absolute`).\n\n**Technical Implementation:**\n\n- When `false` (default): The dropdown content box renders with `position: absolute` and its coordinates are calculated relative to the nearest positioned ancestor. Combined with `positionRelativeTo`, you can specify which ancestor to measure from, which ensures the menu scrolls together with that ancestor.\n\n- When `true`: The dropdown content box renders with `position: fixed` and its coordinates are calculated from the viewport. The menu is visually anchored to the trigger element via JavaScript and moves with it on scroll, even though it is not part of the document flow. `positionRelativeTo` has no effect in this mode.\n\nWhen to set `isScreenPosition` to `true`:\n\n- Dropdowns that need to break out of container constraints (non-Shadow-DOM only):\n When you want the dropdown to appear outside its container's boundaries (e.g., to avoid being clipped by a parent's\n `overflow: hidden` or small dimensions), viewport-based positioning allows it to render freely.\n This only works for regular (non-Shadow-DOM) containers. Shadow DOM boundaries cannot be escaped with `position: fixed`.\n\n- Dropdowns in fixed or sticky positioned containers:\n When the dropdown trigger is inside a fixed or sticky positioned container, viewport-based positioning ensures correct alignment.\n\nWhen to keep `isScreenPosition` as `false` (default):\n\n- Simple layouts where the dropdown and its trigger are not inside scrollable containers\n- When you want the dropdown to scroll naturally with its container (using `position: absolute`)\n- When you need `positionRelativeTo` to control which ancestor the dropdown is positioned relative to\n- When `matchContainerHeight` is needed (this property is overridden when `isScreenPosition` is `true`)"
|
|
991
1014
|
},
|
|
992
1015
|
"attribute": "is-screen-position",
|
|
993
1016
|
"reflect": false,
|
|
@@ -1155,7 +1178,7 @@ export class VegaDropdown {
|
|
|
1155
1178
|
"name": "vegaVersion",
|
|
1156
1179
|
"text": "2.93.0"
|
|
1157
1180
|
}],
|
|
1158
|
-
"text": "An event emitter
|
|
1181
|
+
"text": "An event emitter only fired when the Select All checkbox has been clicked.\n\nThe event's `detail` property is `true` when the Select All checkbox is clicked to select all items,\n and `false` when the Select All checkbox is clicked to clear all selected items."
|
|
1159
1182
|
},
|
|
1160
1183
|
"complexType": {
|
|
1161
1184
|
"original": "boolean",
|
|
@@ -1176,7 +1199,7 @@ export class VegaDropdown {
|
|
|
1176
1199
|
"name": "vegaVersion",
|
|
1177
1200
|
"text": "2.93.0"
|
|
1178
1201
|
}],
|
|
1179
|
-
"text": "An event emitter
|
|
1202
|
+
"text": "An event emitter only fired when the Select All checkbox has been clicked.\n\nThe event's `detail` property is `true` when the Select All checkbox is clicked to select all items,\n and `false` when the Select All checkbox is clicked to clear all selected items."
|
|
1180
1203
|
},
|
|
1181
1204
|
"complexType": {
|
|
1182
1205
|
"original": "boolean",
|
|
@@ -925,7 +925,7 @@ export class VegaInputSelect {
|
|
|
925
925
|
"name": "vegaVersion",
|
|
926
926
|
"text": "2.95.0"
|
|
927
927
|
}],
|
|
928
|
-
"text": "An event emitter
|
|
928
|
+
"text": "An event emitter only fired when the Select All checkbox in the dropdown has been clicked.\n\nThe event's `detail` property is `true` when the Select All checkbox is clicked to select all items,\n and `false` when the Select All checkbox is clicked to clear all selected items."
|
|
929
929
|
},
|
|
930
930
|
"complexType": {
|
|
931
931
|
"original": "boolean",
|
|
@@ -946,7 +946,7 @@ export class VegaInputSelect {
|
|
|
946
946
|
"name": "vegaVersion",
|
|
947
947
|
"text": "2.95.0"
|
|
948
948
|
}],
|
|
949
|
-
"text": "An event emitter
|
|
949
|
+
"text": "An event emitter only fired when the Select All checkbox in the dropdown has been clicked.\n\nThe event's `detail` property is `true` when the Select All checkbox is clicked to select all items,\n and `false` when the Select All checkbox is clicked to clear all selected items."
|
|
950
950
|
},
|
|
951
951
|
"complexType": {
|
|
952
952
|
"original": "boolean",
|
|
@@ -111,6 +111,10 @@
|
|
|
111
111
|
padding-left: 8px;
|
|
112
112
|
margin-left: 16px;
|
|
113
113
|
}
|
|
114
|
+
:host .rich-text-content ul.v-rte--list > li::marker,
|
|
115
|
+
:host .rich-text-content ol.v-rte--list > li::marker {
|
|
116
|
+
font-size: 16px;
|
|
117
|
+
}
|
|
114
118
|
:host .rich-text-content .link-editor-wrapper {
|
|
115
119
|
position: relative;
|
|
116
120
|
outline: 2px solid transparent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RTEListItemBlock } from '../../blocks/list-item-block';
|
|
1
2
|
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
2
3
|
/**
|
|
3
4
|
* The delete node content contains some common functions that used for image block delete the image node or text block delete text node.
|
|
@@ -10,12 +11,29 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
10
11
|
* @returns {Nullable<RTENode>} the previous block last node
|
|
11
12
|
*/
|
|
12
13
|
getPreviousNode(currentNode) {
|
|
14
|
+
var _a;
|
|
13
15
|
const currentBlock = currentNode.parent;
|
|
14
16
|
const currentIndex = currentBlock.children.indexOf(currentNode);
|
|
15
17
|
if (currentIndex > 0) {
|
|
16
18
|
return currentBlock.children[currentIndex - 1];
|
|
17
19
|
}
|
|
18
20
|
else if (currentBlock.parent) {
|
|
21
|
+
// Special case: cursor is at the start of the first item in a nested list.
|
|
22
|
+
// Return the last direct text node of the grandparent list item so that
|
|
23
|
+
// Backspace correctly merges the nested item into the parent item rather
|
|
24
|
+
// than descending into the nested list's own descendants.
|
|
25
|
+
if (currentBlock.isListItemBlock() &&
|
|
26
|
+
currentBlock.parent.children.indexOf(currentBlock) === 0 &&
|
|
27
|
+
currentBlock.parent.parent instanceof RTEListItemBlock) {
|
|
28
|
+
const grandParentItem = currentBlock.parent.parent;
|
|
29
|
+
const nestedListIndex = ((_a = grandParentItem.nestList) !== null && _a !== void 0 ? _a : []).indexOf(currentBlock.parent);
|
|
30
|
+
if (nestedListIndex !== 0) {
|
|
31
|
+
const previousBlock = this.getPreviousBlock(currentBlock);
|
|
32
|
+
return previousBlock ? this.getBlockLastNode(previousBlock) : null;
|
|
33
|
+
}
|
|
34
|
+
const textNodes = grandParentItem.children;
|
|
35
|
+
return textNodes.length > 0 ? textNodes[textNodes.length - 1] : null;
|
|
36
|
+
}
|
|
19
37
|
const previousBlock = this.getPreviousBlock(currentBlock);
|
|
20
38
|
if (previousBlock) {
|
|
21
39
|
return this.getBlockLastNode(previousBlock);
|
|
@@ -72,6 +90,17 @@ export class BlockDeleteNodeContentStrategy extends ActionHandleStrategy {
|
|
|
72
90
|
* @returns {Nullable<RTEBlock>} The previous block if existing
|
|
73
91
|
*/
|
|
74
92
|
getPreviousBlock(currentBlock) {
|
|
93
|
+
var _a;
|
|
94
|
+
if (currentBlock.parent instanceof RTEListItemBlock) {
|
|
95
|
+
const nestedLists = (_a = currentBlock.parent.nestList) !== null && _a !== void 0 ? _a : [];
|
|
96
|
+
const nestedListIndex = nestedLists.indexOf(currentBlock);
|
|
97
|
+
if (nestedListIndex > 0) {
|
|
98
|
+
return nestedLists[nestedListIndex - 1];
|
|
99
|
+
}
|
|
100
|
+
if (nestedListIndex === 0) {
|
|
101
|
+
return currentBlock.parent;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
75
104
|
if (currentBlock && currentBlock.parent && currentBlock.parent.children) {
|
|
76
105
|
const currentBlockIndex = currentBlock.parent.children.indexOf(currentBlock);
|
|
77
106
|
if (currentBlockIndex > 0) {
|
|
@@ -40,6 +40,8 @@ export class BlockDeleteTextOrDecoratorNodeStrategy extends BlockDeleteNodeConte
|
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
+
const nodeIndex = target.children.indexOf(startContainerNode);
|
|
44
|
+
const nextSiblingNode = target.children[nodeIndex + 1];
|
|
43
45
|
const previousNode = this.getPreviousNode(startContainerNode);
|
|
44
46
|
// Remove the last character will not delete paragraph, the paragraph will removed after press delete again
|
|
45
47
|
if ((previousNode && previousNode.parent === target && previousNode['text'] === '\n') ||
|
|
@@ -49,7 +51,14 @@ export class BlockDeleteTextOrDecoratorNodeStrategy extends BlockDeleteNodeConte
|
|
|
49
51
|
}
|
|
50
52
|
else {
|
|
51
53
|
target.apply(new RemoveChildrenAction(startContainerNode));
|
|
52
|
-
|
|
54
|
+
// If this was the first node, the previous node may belong to an ancestor list
|
|
55
|
+
// item. Keep the caret at the deletion boundary before the surviving sibling.
|
|
56
|
+
if (nextSiblingNode && (previousNode === null || previousNode === void 0 ? void 0 : previousNode.parent) !== target) {
|
|
57
|
+
action.nextNode = nextSiblingNode;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
action.previousNode = previousNode;
|
|
61
|
+
}
|
|
53
62
|
return;
|
|
54
63
|
}
|
|
55
64
|
}
|
|
@@ -2,6 +2,7 @@ import { AppendChildrenAction } from '../../actions/append-child-nodes-action';
|
|
|
2
2
|
import { InsertChildrenAfterAction } from '../../actions/insert-children-after-block';
|
|
3
3
|
import { RemoveChildrenAction } from '../../actions/remove-child-action';
|
|
4
4
|
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
5
|
+
import { normalizeMixedListSelection } from './list-transform-selection';
|
|
5
6
|
/**
|
|
6
7
|
* Convert the selected blocks to list strategy.
|
|
7
8
|
*/
|
|
@@ -13,12 +14,16 @@ export class BlockTransformToListStrategy extends ActionHandleStrategy {
|
|
|
13
14
|
* @param {RTETextBlock} target - The first item of the selected block.
|
|
14
15
|
*/
|
|
15
16
|
handleAction(action, target) {
|
|
16
|
-
const contentState = target
|
|
17
|
+
const contentState = this.getRootContent(target);
|
|
18
|
+
if (!contentState) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const container = target.parent;
|
|
17
22
|
const bulletList = contentState.createList(action.listType);
|
|
18
|
-
const selectedBlocks = action.selectedBlocks;
|
|
23
|
+
const selectedBlocks = normalizeMixedListSelection(action.selectedBlocks, action.listType);
|
|
19
24
|
const listItems = selectedBlocks.map((block) => contentState.toListItem(block));
|
|
20
25
|
bulletList.apply(new AppendChildrenAction(listItems));
|
|
21
|
-
|
|
26
|
+
container.apply(new InsertChildrenAfterAction(action.selectedBlocks[0], bulletList));
|
|
22
27
|
selectedBlocks.forEach((block) => {
|
|
23
28
|
block.parent.apply(new RemoveChildrenAction(block));
|
|
24
29
|
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Base strategy for list operations that reconstruct or merge list containers.
|
|
4
|
+
* Keeps annotation cloning and equality rules consistent across those operations.
|
|
5
|
+
*/
|
|
6
|
+
export class ListAnnotationStrategy extends ActionHandleStrategy {
|
|
7
|
+
/**
|
|
8
|
+
* Copy list-container annotations without sharing mutable annotation instances.
|
|
9
|
+
* Factory-provided defaults remain intact unless the source supplies the same key.
|
|
10
|
+
*
|
|
11
|
+
* @param {RTEListBlock} source - List whose annotations should be copied.
|
|
12
|
+
* @param {RTEListBlock} target - Newly created list receiving the annotations.
|
|
13
|
+
*/
|
|
14
|
+
copyListAnnotations(source, target) {
|
|
15
|
+
source.annotationMap.forEach((annotation, key) => {
|
|
16
|
+
target.annotationMap.set(key, annotation.clone());
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Compare list annotations independently of map/object insertion order. Map keys
|
|
21
|
+
* are compared separately because rendering annotations such as LIST intentionally
|
|
22
|
+
* do not serialize to the DTO but still affect the rendered list.
|
|
23
|
+
* Array order remains significant because it can affect rendered class order.
|
|
24
|
+
*
|
|
25
|
+
* @param {RTEListBlock} first - First list to compare.
|
|
26
|
+
* @param {RTEListBlock} second - Second list to compare.
|
|
27
|
+
* @returns {boolean} Whether both list containers have equivalent annotations.
|
|
28
|
+
*/
|
|
29
|
+
haveSameListAnnotations(first, second) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const firstKeys = Array.from(first.annotationMap.keys()).sort();
|
|
32
|
+
const secondKeys = Array.from(second.annotationMap.keys()).sort();
|
|
33
|
+
if (JSON.stringify(firstKeys) !== JSON.stringify(secondKeys)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return (JSON.stringify(this.normalizeAnnotationValue((_a = first.toJSON().annotations) !== null && _a !== void 0 ? _a : {})) ===
|
|
37
|
+
JSON.stringify(this.normalizeAnnotationValue((_b = second.toJSON().annotations) !== null && _b !== void 0 ? _b : {})));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Recursively sort object keys for stable annotation comparison.
|
|
41
|
+
*
|
|
42
|
+
* @param {unknown} value - Annotation value to normalize.
|
|
43
|
+
* @returns {unknown} Normalized annotation value.
|
|
44
|
+
*/
|
|
45
|
+
normalizeAnnotationValue(value) {
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
return value.map((item) => this.normalizeAnnotationValue(item));
|
|
48
|
+
}
|
|
49
|
+
if (value && typeof value === 'object') {
|
|
50
|
+
const record = value;
|
|
51
|
+
return Object.keys(record)
|
|
52
|
+
.sort()
|
|
53
|
+
.reduce((normalized, key) => {
|
|
54
|
+
normalized[key] = this.normalizeAnnotationValue(record[key]);
|
|
55
|
+
return normalized;
|
|
56
|
+
}, {});
|
|
57
|
+
}
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -1,15 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListAnnotationStrategy } from './list-annotation-strategy.abstract';
|
|
2
2
|
/**
|
|
3
3
|
* Replace list item nest list strategy.
|
|
4
|
+
*
|
|
5
|
+
* This is the single write-through point for `nestList` mutations. It automatically
|
|
6
|
+
* normalizes the incoming array by merging adjacent lists only when their types
|
|
7
|
+
* and container annotations match. Styled list boundaries remain independent.
|
|
4
8
|
*/
|
|
5
|
-
export class ListItemReplaceNestListStrategy extends
|
|
9
|
+
export class ListItemReplaceNestListStrategy extends ListAnnotationStrategy {
|
|
6
10
|
/**
|
|
7
11
|
* @inheritDoc
|
|
8
12
|
*/
|
|
9
13
|
handleAction(action, target) {
|
|
10
|
-
action.newList
|
|
14
|
+
const normalized = this.mergeAdjacentSameType(action.newList);
|
|
15
|
+
normalized.forEach((listBlock) => {
|
|
11
16
|
listBlock.parent = target;
|
|
12
17
|
});
|
|
13
|
-
target.nestList =
|
|
18
|
+
target.nestList = normalized;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Merge adjacent entries that share the same list type and annotations.
|
|
22
|
+
* This is an idempotent O(n) pass — calling it on an already-normalized array is a no-op.
|
|
23
|
+
*
|
|
24
|
+
* @param {RTEListBlock[]} lists - The nest list array to normalize.
|
|
25
|
+
* @returns {RTEListBlock[]} A new array with adjacent same-type entries merged.
|
|
26
|
+
*/
|
|
27
|
+
mergeAdjacentSameType(lists) {
|
|
28
|
+
if (lists.length <= 1) {
|
|
29
|
+
return lists;
|
|
30
|
+
}
|
|
31
|
+
const merged = [lists[0]];
|
|
32
|
+
for (let i = 1; i < lists.length; i++) {
|
|
33
|
+
const prev = merged[merged.length - 1];
|
|
34
|
+
const current = lists[i];
|
|
35
|
+
if (prev.type === current.type && this.haveSameListAnnotations(prev, current)) {
|
|
36
|
+
current.children.forEach((item) => {
|
|
37
|
+
item.parent = prev;
|
|
38
|
+
});
|
|
39
|
+
prev.children = prev.children.concat(current.children);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
merged.push(current);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return merged;
|
|
14
46
|
}
|
|
15
47
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ActionHandleStrategy } from '../action-handle-strategy.abstract';
|
|
2
|
+
/**
|
|
3
|
+
* Shared base strategy for list-item operations that require ordered contiguous
|
|
4
|
+
* item selection within the same target list.
|
|
5
|
+
*/
|
|
6
|
+
export class AbstractListItemsStrategy extends ActionHandleStrategy {
|
|
7
|
+
/**
|
|
8
|
+
* Returns selected list items ordered by their position in target and validated
|
|
9
|
+
* as a contiguous range. Returns an empty array when selection is invalid.
|
|
10
|
+
*
|
|
11
|
+
* @param {RTEListBlock} target - The target list block containing selected items.
|
|
12
|
+
* @param {RTEListItemBlock[]} selectedBlocks - Selected list items from action payload.
|
|
13
|
+
* @returns {RTEListItemBlock[]} Ordered contiguous selected items, or empty array.
|
|
14
|
+
*/
|
|
15
|
+
getOrderedContiguousItems(target, selectedBlocks) {
|
|
16
|
+
const orderedItems = [...selectedBlocks].sort((a, b) => target.children.indexOf(a) - target.children.indexOf(b));
|
|
17
|
+
const startIndex = target.children.indexOf(orderedItems[0]);
|
|
18
|
+
if (startIndex < 0) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
return target.children
|
|
22
|
+
.slice(startIndex, startIndex + orderedItems.length)
|
|
23
|
+
.every((item, index) => item === orderedItems[index])
|
|
24
|
+
? orderedItems
|
|
25
|
+
: [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { generateUUID } from '../../../../../utils/misc';
|
|
2
|
+
import { SyncUpSelectionAction } from '../../actions/sync-up-selection-action';
|
|
3
|
+
import { ReplaceNestListAction } from '../../actions/replace-nest-list-action';
|
|
4
|
+
import { RTEListBlock } from '../../blocks/list-block';
|
|
5
|
+
import { AbstractListItemsStrategy } from './list-items-strategy.abstract';
|
|
6
|
+
/**
|
|
7
|
+
* Move selected list items into a nested list under the previous sibling.
|
|
8
|
+
*/
|
|
9
|
+
export class ListNestItemsStrategy extends AbstractListItemsStrategy {
|
|
10
|
+
/**
|
|
11
|
+
* @inheritDoc
|
|
12
|
+
*/
|
|
13
|
+
handleAction(action, target) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const selectedItems = this.getOrderedContiguousItems(target, action.selectedBlocks);
|
|
16
|
+
if (!selectedItems.length) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const startIndex = target.children.indexOf(selectedItems[0]);
|
|
20
|
+
if (startIndex <= 0) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const previousSibling = target.children[startIndex - 1];
|
|
24
|
+
const selectedItemSet = new Set(selectedItems);
|
|
25
|
+
// Tab behavior intentionally keeps using the last nested list entry if present,
|
|
26
|
+
// even when mixed nested-list types exist, to preserve current behavior.
|
|
27
|
+
// This also matches the behavior of other rich text editors, especially CKEditor.
|
|
28
|
+
let nestedList = (_a = previousSibling.nestList) === null || _a === void 0 ? void 0 : _a[previousSibling.nestList.length - 1];
|
|
29
|
+
if (!nestedList) {
|
|
30
|
+
nestedList = new RTEListBlock(generateUUID(), target.type);
|
|
31
|
+
previousSibling.apply(new ReplaceNestListAction([...((_b = previousSibling.nestList) !== null && _b !== void 0 ? _b : []), nestedList]));
|
|
32
|
+
}
|
|
33
|
+
target.children = target.children.filter((item) => !selectedItemSet.has(item));
|
|
34
|
+
nestedList.children = nestedList.children.concat(selectedItems);
|
|
35
|
+
selectedItems.forEach((item) => {
|
|
36
|
+
var _a;
|
|
37
|
+
item.parent = nestedList;
|
|
38
|
+
if ((_a = item.nestList) === null || _a === void 0 ? void 0 : _a.length) {
|
|
39
|
+
this.unifyDescendantNestLists(item, item.nestList[0].type);
|
|
40
|
+
}
|
|
41
|
+
item.children.forEach((node) => node.apply(new SyncUpSelectionAction()));
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Recursively unify all nestLists of a list item (and its descendants) to the given type.
|
|
46
|
+
* Adjacent same-type merge is handled automatically by ListItemReplaceNestListStrategy
|
|
47
|
+
* when ReplaceNestListAction is applied, so this method only needs to set the type.
|
|
48
|
+
*
|
|
49
|
+
* @param {RTEListItemBlock} item - The list item whose descendants should be normalized.
|
|
50
|
+
* @param {RTEListBlock['type']} targetType - The target list type used for normalization.
|
|
51
|
+
*/
|
|
52
|
+
unifyDescendantNestLists(item, targetType) {
|
|
53
|
+
var _a;
|
|
54
|
+
if (!((_a = item.nestList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
let typeChanged = false;
|
|
58
|
+
for (const list of item.nestList) {
|
|
59
|
+
if (list.type !== targetType) {
|
|
60
|
+
list.type = targetType;
|
|
61
|
+
typeChanged = true;
|
|
62
|
+
}
|
|
63
|
+
// Recursively unify children
|
|
64
|
+
for (const child of list.children) {
|
|
65
|
+
this.unifyDescendantNestLists(child, targetType);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// If any type was changed, re-apply through ReplaceNestListAction so that the
|
|
69
|
+
// centralized normalize in ListItemReplaceNestListStrategy merges adjacent same-type entries.
|
|
70
|
+
if (typeChanged) {
|
|
71
|
+
item.apply(new ReplaceNestListAction([...item.nestList]));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { RemoveChildrenAction } from '../../actions/remove-child-action';
|
|
2
|
+
import { InsertChildrenAfterAction } from '../../actions/insert-children-after-block';
|
|
3
|
+
import { InsertChildrenBeforeAction } from '../../actions/insert-children-before-block';
|
|
2
4
|
import { RemoveNestListAction } from '../../actions/remove-nest-list-action';
|
|
5
|
+
import { ReplaceNestListAction } from '../../actions/replace-nest-list-action';
|
|
6
|
+
import { RTEListItemBlock } from '../../blocks/list-item-block';
|
|
3
7
|
import { RemoveChildrenStrategy } from './remove-children-strategy';
|
|
4
8
|
/**
|
|
5
9
|
* List remove list item strategy.
|
|
@@ -12,16 +16,92 @@ export class ListRemoveListItemStrategy extends RemoveChildrenStrategy {
|
|
|
12
16
|
* @param {RTEListBlock} target - The list block.
|
|
13
17
|
*/
|
|
14
18
|
handleAction(action, target) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
const removingListItem = action.entityToBeRemoved instanceof RTEListItemBlock ? action.entityToBeRemoved : null;
|
|
21
|
+
const removingIndex = removingListItem ? target.children.indexOf(removingListItem) : -1;
|
|
22
|
+
if (((_a = removingListItem === null || removingListItem === void 0 ? void 0 : removingListItem.nestList) === null || _a === void 0 ? void 0 : _a.length) && removingIndex >= 0) {
|
|
23
|
+
this.promoteNestListsToUpperLevel(removingListItem, target, removingIndex);
|
|
24
|
+
}
|
|
15
25
|
super.handleAction(action, target);
|
|
16
26
|
const parent = target.parent;
|
|
17
27
|
if (target.children.length === 0 && parent) {
|
|
18
28
|
// The parent is a list item mean the current block is a nest list, so we need to use RemoveNestListAction to remove the item
|
|
19
29
|
if (parent['type'] === 'list-item') {
|
|
20
|
-
parent
|
|
30
|
+
const parentListItem = parent;
|
|
31
|
+
if ((_b = parentListItem.nestList) === null || _b === void 0 ? void 0 : _b.includes(target)) {
|
|
32
|
+
parentListItem.apply(new RemoveNestListAction(target));
|
|
33
|
+
}
|
|
21
34
|
}
|
|
22
35
|
else {
|
|
23
36
|
parent.apply(new RemoveChildrenAction(target));
|
|
24
37
|
}
|
|
25
38
|
}
|
|
26
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Promote nested lists of the list item being removed by one level.
|
|
42
|
+
*
|
|
43
|
+
* Same-type nested lists are flattened into the current (target) list to avoid
|
|
44
|
+
* creating redundant list wrappers. Different-type nested lists stay nested under
|
|
45
|
+
* the parent list item as siblings of the target list, positioned relative to the
|
|
46
|
+
* target so document order is preserved. When the parent is the root content, the
|
|
47
|
+
* different-type lists are inserted right after the target list instead.
|
|
48
|
+
*
|
|
49
|
+
* @param {RTEListItemBlock} removingListItem - The list item being removed.
|
|
50
|
+
* @param {RTEListBlock} target - The list currently containing the item.
|
|
51
|
+
* @param {number} removingIndex - The original index of the removing item.
|
|
52
|
+
*/
|
|
53
|
+
promoteNestListsToUpperLevel(removingListItem, target, removingIndex) {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const promotedLists = [...((_a = removingListItem.nestList) !== null && _a !== void 0 ? _a : [])];
|
|
56
|
+
let insertionIndex = removingIndex + 1;
|
|
57
|
+
const differentTypeLists = [];
|
|
58
|
+
promotedLists.forEach((listBlock) => {
|
|
59
|
+
if (listBlock.type === target.type) {
|
|
60
|
+
const promotedItems = [...listBlock.children];
|
|
61
|
+
if (promotedItems.length > 0) {
|
|
62
|
+
promotedItems.forEach((item) => {
|
|
63
|
+
item.parent = target;
|
|
64
|
+
});
|
|
65
|
+
target.children.splice(insertionIndex, 0, ...promotedItems);
|
|
66
|
+
insertionIndex += promotedItems.length;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
differentTypeLists.push(listBlock);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const parent = target.parent;
|
|
74
|
+
if (differentTypeLists.length > 0 && parent instanceof RTEListItemBlock) {
|
|
75
|
+
// Different-type promoted lists stay nested under the parent item, as siblings
|
|
76
|
+
// of the target list. When the removed item was merged into the parent, its
|
|
77
|
+
// own nested lists follow it up one level and belong to the parent item — not
|
|
78
|
+
// flattened into the grandparent list. Position them relative to the target so
|
|
79
|
+
// document order is preserved.
|
|
80
|
+
const currentNestLists = [...((_b = parent.nestList) !== null && _b !== void 0 ? _b : [])];
|
|
81
|
+
const targetIndex = currentNestLists.indexOf(target);
|
|
82
|
+
if (targetIndex >= 0) {
|
|
83
|
+
// When removing the first item, its nested lists were visually above the
|
|
84
|
+
// remaining items, so they must be placed before the target list to
|
|
85
|
+
// preserve document order.
|
|
86
|
+
const insertAt = removingIndex === 0 ? targetIndex : targetIndex + 1;
|
|
87
|
+
currentNestLists.splice(insertAt, 0, ...differentTypeLists);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
currentNestLists.push(...differentTypeLists);
|
|
91
|
+
}
|
|
92
|
+
parent.apply(new ReplaceNestListAction(currentNestLists));
|
|
93
|
+
}
|
|
94
|
+
else if (differentTypeLists.length > 0) {
|
|
95
|
+
// Mirror the nested-parent ordering rule: when removing the first item,
|
|
96
|
+
// its nested lists were visually above the remaining items, so insert
|
|
97
|
+
// before the target to preserve document order.
|
|
98
|
+
if (removingIndex === 0) {
|
|
99
|
+
parent.apply(new InsertChildrenBeforeAction(target, ...differentTypeLists));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
parent.apply(new InsertChildrenAfterAction(target, ...differentTypeLists));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
removingListItem.apply(new ReplaceNestListAction([]));
|
|
106
|
+
}
|
|
27
107
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize a mixed paragraph/list selection before rebuilding it as a list.
|
|
3
|
+
*
|
|
4
|
+
* Selected list items whose owning ancestor item is also selected remain inside
|
|
5
|
+
* that ancestor's nestList instead of being emitted again as flattened siblings.
|
|
6
|
+
* Their immediate list type is still updated because the nested item was part of
|
|
7
|
+
* the toolbar selection.
|
|
8
|
+
*
|
|
9
|
+
* @param {RTEBlock[]} selectedBlocks - Blocks selected by the toolbar action.
|
|
10
|
+
* @param {ListType} listType - Target list type.
|
|
11
|
+
* @returns {RTEBlock[]} Top-level selected blocks to emit into the rebuilt list.
|
|
12
|
+
*/
|
|
13
|
+
export function normalizeMixedListSelection(selectedBlocks, listType) {
|
|
14
|
+
const selectedListItems = new Set(selectedBlocks.filter((block) => block.dtoName === 'RTEListItemBlock'));
|
|
15
|
+
return selectedBlocks.filter((block) => {
|
|
16
|
+
if (!(block.dtoName === 'RTEListItemBlock')) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
let parentList = block.parent;
|
|
20
|
+
while (parentList.parent && parentList.parent.dtoName === 'RTEListItemBlock') {
|
|
21
|
+
const ownerItem = parentList.parent;
|
|
22
|
+
if (selectedListItems.has(ownerItem)) {
|
|
23
|
+
block.parent.type = listType;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
parentList = ownerItem.parent;
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
});
|
|
30
|
+
}
|