@ckeditor/ckeditor5-restricted-editing 40.0.0 → 40.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,142 +1,142 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import { Matcher } from 'ckeditor5/src/engine';
6
- import { getMarkerAtPosition } from './utils';
7
- const HIGHLIGHT_CLASS = 'restricted-editing-exception_selected';
8
- /**
9
- * Adds a visual highlight style to a restricted editing exception that the selection is anchored to.
10
- *
11
- * The highlight is turned on by adding the `.restricted-editing-exception_selected` class to the
12
- * exception in the view:
13
- *
14
- * * The class is removed before the conversion starts, as callbacks added with the `'highest'` priority
15
- * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.
16
- * * The class is added in the view post-fixer, after other changes in the model tree are converted to the view.
17
- *
18
- * This way, adding and removing the highlight does not interfere with conversion.
19
- */
20
- export function setupExceptionHighlighting(editor) {
21
- const view = editor.editing.view;
22
- const model = editor.model;
23
- const highlightedMarkers = new Set();
24
- // Adding the class.
25
- view.document.registerPostFixer((writer) => {
26
- const modelSelection = model.document.selection;
27
- const marker = getMarkerAtPosition(editor, modelSelection.anchor);
28
- if (!marker) {
29
- return false;
30
- }
31
- for (const viewElement of editor.editing.mapper.markerNameToElements(marker.name)) {
32
- writer.addClass(HIGHLIGHT_CLASS, viewElement);
33
- highlightedMarkers.add(viewElement);
34
- }
35
- return false;
36
- });
37
- // Removing the class.
38
- editor.conversion.for('editingDowncast').add(dispatcher => {
39
- // Make sure the highlight is removed on every possible event, before conversion is started.
40
- dispatcher.on('insert', removeHighlight, { priority: 'highest' });
41
- dispatcher.on('remove', removeHighlight, { priority: 'highest' });
42
- dispatcher.on('attribute', removeHighlight, { priority: 'highest' });
43
- dispatcher.on('cleanSelection', removeHighlight);
44
- function removeHighlight() {
45
- view.change(writer => {
46
- for (const item of highlightedMarkers.values()) {
47
- writer.removeClass(HIGHLIGHT_CLASS, item);
48
- highlightedMarkers.delete(item);
49
- }
50
- });
51
- }
52
- });
53
- }
54
- /**
55
- * A post-fixer that prevents removing a collapsed marker from the document.
56
- */
57
- export function resurrectCollapsedMarkerPostFixer(editor) {
58
- // This post-fixer shouldn't be necessary after https://github.com/ckeditor/ckeditor5/issues/5778.
59
- return writer => {
60
- let changeApplied = false;
61
- for (const { name, data } of editor.model.document.differ.getChangedMarkers()) {
62
- if (name.startsWith('restrictedEditingException') && data.newRange && data.newRange.root.rootName == '$graveyard') {
63
- writer.updateMarker(name, {
64
- range: writer.createRange(writer.createPositionAt(data.oldRange.start))
65
- });
66
- changeApplied = true;
67
- }
68
- }
69
- return changeApplied;
70
- };
71
- }
72
- /**
73
- * A post-fixer that extends a marker when the user types on its boundaries.
74
- */
75
- export function extendMarkerOnTypingPostFixer(editor) {
76
- // This post-fixer shouldn't be necessary after https://github.com/ckeditor/ckeditor5/issues/5778.
77
- return writer => {
78
- let changeApplied = false;
79
- for (const change of editor.model.document.differ.getChanges()) {
80
- if (change.type == 'insert' && change.name == '$text') {
81
- changeApplied = _tryExtendMarkerStart(editor, change.position, change.length, writer) || changeApplied;
82
- changeApplied = _tryExtendMarkedEnd(editor, change.position, change.length, writer) || changeApplied;
83
- }
84
- }
85
- return changeApplied;
86
- };
87
- }
88
- /**
89
- * A view highlight-to-marker conversion helper.
90
- *
91
- * @param config Conversion configuration.
92
- */
93
- export function upcastHighlightToMarker(config) {
94
- return (dispatcher) => dispatcher.on('element:span', (evt, data, conversionApi) => {
95
- const { writer } = conversionApi;
96
- const matcher = new Matcher(config.view);
97
- const matcherResult = matcher.match(data.viewItem);
98
- // If there is no match, this callback should not do anything.
99
- if (!matcherResult) {
100
- return;
101
- }
102
- const match = matcherResult.match;
103
- // Force consuming element's name (taken from upcast helpers elementToElement converter).
104
- match.name = true;
105
- const { modelRange: convertedChildrenRange } = conversionApi.convertChildren(data.viewItem, data.modelCursor);
106
- conversionApi.consumable.consume(data.viewItem, match);
107
- const markerName = config.model();
108
- const fakeMarkerStart = writer.createElement('$marker', { 'data-name': markerName });
109
- const fakeMarkerEnd = writer.createElement('$marker', { 'data-name': markerName });
110
- // Insert in reverse order to use converter content positions directly (without recalculating).
111
- writer.insert(fakeMarkerEnd, convertedChildrenRange.end);
112
- writer.insert(fakeMarkerStart, convertedChildrenRange.start);
113
- data.modelRange = writer.createRange(writer.createPositionBefore(fakeMarkerStart), writer.createPositionAfter(fakeMarkerEnd));
114
- data.modelCursor = data.modelRange.end;
115
- });
116
- }
117
- /**
118
- * Extend marker if change detected on marker's start position.
119
- */
120
- function _tryExtendMarkerStart(editor, position, length, writer) {
121
- const markerAtStart = getMarkerAtPosition(editor, position.getShiftedBy(length));
122
- if (markerAtStart && markerAtStart.getStart().isEqual(position.getShiftedBy(length))) {
123
- writer.updateMarker(markerAtStart, {
124
- range: writer.createRange(markerAtStart.getStart().getShiftedBy(-length), markerAtStart.getEnd())
125
- });
126
- return true;
127
- }
128
- return false;
129
- }
130
- /**
131
- * Extend marker if change detected on marker's end position.
132
- */
133
- function _tryExtendMarkedEnd(editor, position, length, writer) {
134
- const markerAtEnd = getMarkerAtPosition(editor, position);
135
- if (markerAtEnd && markerAtEnd.getEnd().isEqual(position)) {
136
- writer.updateMarker(markerAtEnd, {
137
- range: writer.createRange(markerAtEnd.getStart(), markerAtEnd.getEnd().getShiftedBy(length))
138
- });
139
- return true;
140
- }
141
- return false;
142
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import { Matcher } from 'ckeditor5/src/engine';
6
+ import { getMarkerAtPosition } from './utils';
7
+ const HIGHLIGHT_CLASS = 'restricted-editing-exception_selected';
8
+ /**
9
+ * Adds a visual highlight style to a restricted editing exception that the selection is anchored to.
10
+ *
11
+ * The highlight is turned on by adding the `.restricted-editing-exception_selected` class to the
12
+ * exception in the view:
13
+ *
14
+ * * The class is removed before the conversion starts, as callbacks added with the `'highest'` priority
15
+ * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.
16
+ * * The class is added in the view post-fixer, after other changes in the model tree are converted to the view.
17
+ *
18
+ * This way, adding and removing the highlight does not interfere with conversion.
19
+ */
20
+ export function setupExceptionHighlighting(editor) {
21
+ const view = editor.editing.view;
22
+ const model = editor.model;
23
+ const highlightedMarkers = new Set();
24
+ // Adding the class.
25
+ view.document.registerPostFixer((writer) => {
26
+ const modelSelection = model.document.selection;
27
+ const marker = getMarkerAtPosition(editor, modelSelection.anchor);
28
+ if (!marker) {
29
+ return false;
30
+ }
31
+ for (const viewElement of editor.editing.mapper.markerNameToElements(marker.name)) {
32
+ writer.addClass(HIGHLIGHT_CLASS, viewElement);
33
+ highlightedMarkers.add(viewElement);
34
+ }
35
+ return false;
36
+ });
37
+ // Removing the class.
38
+ editor.conversion.for('editingDowncast').add(dispatcher => {
39
+ // Make sure the highlight is removed on every possible event, before conversion is started.
40
+ dispatcher.on('insert', removeHighlight, { priority: 'highest' });
41
+ dispatcher.on('remove', removeHighlight, { priority: 'highest' });
42
+ dispatcher.on('attribute', removeHighlight, { priority: 'highest' });
43
+ dispatcher.on('cleanSelection', removeHighlight);
44
+ function removeHighlight() {
45
+ view.change(writer => {
46
+ for (const item of highlightedMarkers.values()) {
47
+ writer.removeClass(HIGHLIGHT_CLASS, item);
48
+ highlightedMarkers.delete(item);
49
+ }
50
+ });
51
+ }
52
+ });
53
+ }
54
+ /**
55
+ * A post-fixer that prevents removing a collapsed marker from the document.
56
+ */
57
+ export function resurrectCollapsedMarkerPostFixer(editor) {
58
+ // This post-fixer shouldn't be necessary after https://github.com/ckeditor/ckeditor5/issues/5778.
59
+ return writer => {
60
+ let changeApplied = false;
61
+ for (const { name, data } of editor.model.document.differ.getChangedMarkers()) {
62
+ if (name.startsWith('restrictedEditingException') && data.newRange && data.newRange.root.rootName == '$graveyard') {
63
+ writer.updateMarker(name, {
64
+ range: writer.createRange(writer.createPositionAt(data.oldRange.start))
65
+ });
66
+ changeApplied = true;
67
+ }
68
+ }
69
+ return changeApplied;
70
+ };
71
+ }
72
+ /**
73
+ * A post-fixer that extends a marker when the user types on its boundaries.
74
+ */
75
+ export function extendMarkerOnTypingPostFixer(editor) {
76
+ // This post-fixer shouldn't be necessary after https://github.com/ckeditor/ckeditor5/issues/5778.
77
+ return writer => {
78
+ let changeApplied = false;
79
+ for (const change of editor.model.document.differ.getChanges()) {
80
+ if (change.type == 'insert' && change.name == '$text') {
81
+ changeApplied = _tryExtendMarkerStart(editor, change.position, change.length, writer) || changeApplied;
82
+ changeApplied = _tryExtendMarkedEnd(editor, change.position, change.length, writer) || changeApplied;
83
+ }
84
+ }
85
+ return changeApplied;
86
+ };
87
+ }
88
+ /**
89
+ * A view highlight-to-marker conversion helper.
90
+ *
91
+ * @param config Conversion configuration.
92
+ */
93
+ export function upcastHighlightToMarker(config) {
94
+ return (dispatcher) => dispatcher.on('element:span', (evt, data, conversionApi) => {
95
+ const { writer } = conversionApi;
96
+ const matcher = new Matcher(config.view);
97
+ const matcherResult = matcher.match(data.viewItem);
98
+ // If there is no match, this callback should not do anything.
99
+ if (!matcherResult) {
100
+ return;
101
+ }
102
+ const match = matcherResult.match;
103
+ // Force consuming element's name (taken from upcast helpers elementToElement converter).
104
+ match.name = true;
105
+ const { modelRange: convertedChildrenRange } = conversionApi.convertChildren(data.viewItem, data.modelCursor);
106
+ conversionApi.consumable.consume(data.viewItem, match);
107
+ const markerName = config.model();
108
+ const fakeMarkerStart = writer.createElement('$marker', { 'data-name': markerName });
109
+ const fakeMarkerEnd = writer.createElement('$marker', { 'data-name': markerName });
110
+ // Insert in reverse order to use converter content positions directly (without recalculating).
111
+ writer.insert(fakeMarkerEnd, convertedChildrenRange.end);
112
+ writer.insert(fakeMarkerStart, convertedChildrenRange.start);
113
+ data.modelRange = writer.createRange(writer.createPositionBefore(fakeMarkerStart), writer.createPositionAfter(fakeMarkerEnd));
114
+ data.modelCursor = data.modelRange.end;
115
+ });
116
+ }
117
+ /**
118
+ * Extend marker if change detected on marker's start position.
119
+ */
120
+ function _tryExtendMarkerStart(editor, position, length, writer) {
121
+ const markerAtStart = getMarkerAtPosition(editor, position.getShiftedBy(length));
122
+ if (markerAtStart && markerAtStart.getStart().isEqual(position.getShiftedBy(length))) {
123
+ writer.updateMarker(markerAtStart, {
124
+ range: writer.createRange(markerAtStart.getStart().getShiftedBy(-length), markerAtStart.getEnd())
125
+ });
126
+ return true;
127
+ }
128
+ return false;
129
+ }
130
+ /**
131
+ * Extend marker if change detected on marker's end position.
132
+ */
133
+ function _tryExtendMarkedEnd(editor, position, length, writer) {
134
+ const markerAtEnd = getMarkerAtPosition(editor, position);
135
+ if (markerAtEnd && markerAtEnd.getEnd().isEqual(position)) {
136
+ writer.updateMarker(markerAtEnd, {
137
+ range: writer.createRange(markerAtEnd.getStart(), markerAtEnd.getEnd().getShiftedBy(length))
138
+ });
139
+ return true;
140
+ }
141
+ return false;
142
+ }
@@ -1,30 +1,30 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import type { Editor } from 'ckeditor5/src/core';
6
- import type { DocumentSelection, Marker, Position, Range } from 'ckeditor5/src/engine';
7
- /**
8
- * @module restricted-editing/restrictededitingmode/utils
9
- */
10
- /**
11
- * Returns a single "restricted-editing-exception" marker at a given position. Contrary to
12
- * {@link module:engine/model/markercollection~MarkerCollection#getMarkersAtPosition}, it returnd a marker also when the postion is
13
- * equal to one of the marker's start or end positions.
14
- */
15
- export declare function getMarkerAtPosition(editor: Editor, position: Position): Marker | undefined;
16
- /**
17
- * Checks if the position is fully contained in the range. Positions equal to range start or end are considered "in".
18
- */
19
- export declare function isPositionInRangeBoundaries(range: Range, position: Position): boolean;
20
- /**
21
- * Checks if the selection is fully contained in the marker. Positions on marker boundaries are considered "in".
22
- *
23
- * ```xml
24
- * <marker>[]foo</marker> -> true
25
- * <marker>f[oo]</marker> -> true
26
- * <marker>f[oo</marker> ba]r -> false
27
- * <marker>foo</marker> []bar -> false
28
- * ```
29
- */
30
- export declare function isSelectionInMarker(selection: DocumentSelection, marker?: Marker): boolean;
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type { Editor } from 'ckeditor5/src/core';
6
+ import type { DocumentSelection, Marker, Position, Range } from 'ckeditor5/src/engine';
7
+ /**
8
+ * @module restricted-editing/restrictededitingmode/utils
9
+ */
10
+ /**
11
+ * Returns a single "restricted-editing-exception" marker at a given position. Contrary to
12
+ * {@link module:engine/model/markercollection~MarkerCollection#getMarkersAtPosition}, it returnd a marker also when the postion is
13
+ * equal to one of the marker's start or end positions.
14
+ */
15
+ export declare function getMarkerAtPosition(editor: Editor, position: Position): Marker | undefined;
16
+ /**
17
+ * Checks if the position is fully contained in the range. Positions equal to range start or end are considered "in".
18
+ */
19
+ export declare function isPositionInRangeBoundaries(range: Range, position: Position): boolean;
20
+ /**
21
+ * Checks if the selection is fully contained in the marker. Positions on marker boundaries are considered "in".
22
+ *
23
+ * ```xml
24
+ * <marker>[]foo</marker> -> true
25
+ * <marker>f[oo]</marker> -> true
26
+ * <marker>f[oo</marker> ba]r -> false
27
+ * <marker>foo</marker> []bar -> false
28
+ * ```
29
+ */
30
+ export declare function isSelectionInMarker(selection: DocumentSelection, marker?: Marker): boolean;
@@ -1,50 +1,50 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module restricted-editing/restrictededitingmode/utils
7
- */
8
- /**
9
- * Returns a single "restricted-editing-exception" marker at a given position. Contrary to
10
- * {@link module:engine/model/markercollection~MarkerCollection#getMarkersAtPosition}, it returnd a marker also when the postion is
11
- * equal to one of the marker's start or end positions.
12
- */
13
- export function getMarkerAtPosition(editor, position) {
14
- for (const marker of editor.model.markers) {
15
- const markerRange = marker.getRange();
16
- if (isPositionInRangeBoundaries(markerRange, position)) {
17
- if (marker.name.startsWith('restrictedEditingException:')) {
18
- return marker;
19
- }
20
- }
21
- }
22
- }
23
- /**
24
- * Checks if the position is fully contained in the range. Positions equal to range start or end are considered "in".
25
- */
26
- export function isPositionInRangeBoundaries(range, position) {
27
- return (range.containsPosition(position) ||
28
- range.end.isEqual(position) ||
29
- range.start.isEqual(position));
30
- }
31
- /**
32
- * Checks if the selection is fully contained in the marker. Positions on marker boundaries are considered "in".
33
- *
34
- * ```xml
35
- * <marker>[]foo</marker> -> true
36
- * <marker>f[oo]</marker> -> true
37
- * <marker>f[oo</marker> ba]r -> false
38
- * <marker>foo</marker> []bar -> false
39
- * ```
40
- */
41
- export function isSelectionInMarker(selection, marker) {
42
- if (!marker) {
43
- return false;
44
- }
45
- const markerRange = marker.getRange();
46
- if (selection.isCollapsed) {
47
- return isPositionInRangeBoundaries(markerRange, selection.focus);
48
- }
49
- return markerRange.containsRange(selection.getFirstRange(), true);
50
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module restricted-editing/restrictededitingmode/utils
7
+ */
8
+ /**
9
+ * Returns a single "restricted-editing-exception" marker at a given position. Contrary to
10
+ * {@link module:engine/model/markercollection~MarkerCollection#getMarkersAtPosition}, it returnd a marker also when the postion is
11
+ * equal to one of the marker's start or end positions.
12
+ */
13
+ export function getMarkerAtPosition(editor, position) {
14
+ for (const marker of editor.model.markers) {
15
+ const markerRange = marker.getRange();
16
+ if (isPositionInRangeBoundaries(markerRange, position)) {
17
+ if (marker.name.startsWith('restrictedEditingException:')) {
18
+ return marker;
19
+ }
20
+ }
21
+ }
22
+ }
23
+ /**
24
+ * Checks if the position is fully contained in the range. Positions equal to range start or end are considered "in".
25
+ */
26
+ export function isPositionInRangeBoundaries(range, position) {
27
+ return (range.containsPosition(position) ||
28
+ range.end.isEqual(position) ||
29
+ range.start.isEqual(position));
30
+ }
31
+ /**
32
+ * Checks if the selection is fully contained in the marker. Positions on marker boundaries are considered "in".
33
+ *
34
+ * ```xml
35
+ * <marker>[]foo</marker> -> true
36
+ * <marker>f[oo]</marker> -> true
37
+ * <marker>f[oo</marker> ba]r -> false
38
+ * <marker>foo</marker> []bar -> false
39
+ * ```
40
+ */
41
+ export function isSelectionInMarker(selection, marker) {
42
+ if (!marker) {
43
+ return false;
44
+ }
45
+ const markerRange = marker.getRange();
46
+ if (selection.isCollapsed) {
47
+ return isPositionInRangeBoundaries(markerRange, selection.focus);
48
+ }
49
+ return markerRange.containsRange(selection.getFirstRange(), true);
50
+ }
@@ -1,29 +1,29 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module restricted-editing/restrictededitingmode
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import RestrictedEditingModeEditing from './restrictededitingmodeediting';
10
- import RestrictedEditingModeUI from './restrictededitingmodeui';
11
- import '../theme/restrictedediting.css';
12
- /**
13
- * The restricted editing mode plugin.
14
- *
15
- * This is a "glue" plugin which loads the following plugins:
16
- *
17
- * * The {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing restricted mode editing feature}.
18
- * * The {@link module:restricted-editing/restrictededitingmodeui~RestrictedEditingModeUI restricted mode UI feature}.
19
- */
20
- export default class RestrictedEditingMode extends Plugin {
21
- /**
22
- * @inheritDoc
23
- */
24
- static get pluginName(): "RestrictedEditingMode";
25
- /**
26
- * @inheritDoc
27
- */
28
- static get requires(): readonly [typeof RestrictedEditingModeEditing, typeof RestrictedEditingModeUI];
29
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module restricted-editing/restrictededitingmode
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import RestrictedEditingModeEditing from './restrictededitingmodeediting';
10
+ import RestrictedEditingModeUI from './restrictededitingmodeui';
11
+ import '../theme/restrictedediting.css';
12
+ /**
13
+ * The restricted editing mode plugin.
14
+ *
15
+ * This is a "glue" plugin which loads the following plugins:
16
+ *
17
+ * * The {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing restricted mode editing feature}.
18
+ * * The {@link module:restricted-editing/restrictededitingmodeui~RestrictedEditingModeUI restricted mode UI feature}.
19
+ */
20
+ export default class RestrictedEditingMode extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "RestrictedEditingMode";
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get requires(): readonly [typeof RestrictedEditingModeEditing, typeof RestrictedEditingModeUI];
29
+ }
@@ -1,33 +1,33 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module restricted-editing/restrictededitingmode
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import RestrictedEditingModeEditing from './restrictededitingmodeediting';
10
- import RestrictedEditingModeUI from './restrictededitingmodeui';
11
- import '../theme/restrictedediting.css';
12
- /**
13
- * The restricted editing mode plugin.
14
- *
15
- * This is a "glue" plugin which loads the following plugins:
16
- *
17
- * * The {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing restricted mode editing feature}.
18
- * * The {@link module:restricted-editing/restrictededitingmodeui~RestrictedEditingModeUI restricted mode UI feature}.
19
- */
20
- export default class RestrictedEditingMode extends Plugin {
21
- /**
22
- * @inheritDoc
23
- */
24
- static get pluginName() {
25
- return 'RestrictedEditingMode';
26
- }
27
- /**
28
- * @inheritDoc
29
- */
30
- static get requires() {
31
- return [RestrictedEditingModeEditing, RestrictedEditingModeUI];
32
- }
33
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module restricted-editing/restrictededitingmode
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import RestrictedEditingModeEditing from './restrictededitingmodeediting';
10
+ import RestrictedEditingModeUI from './restrictededitingmodeui';
11
+ import '../theme/restrictedediting.css';
12
+ /**
13
+ * The restricted editing mode plugin.
14
+ *
15
+ * This is a "glue" plugin which loads the following plugins:
16
+ *
17
+ * * The {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing restricted mode editing feature}.
18
+ * * The {@link module:restricted-editing/restrictededitingmodeui~RestrictedEditingModeUI restricted mode UI feature}.
19
+ */
20
+ export default class RestrictedEditingMode extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName() {
25
+ return 'RestrictedEditingMode';
26
+ }
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static get requires() {
31
+ return [RestrictedEditingModeEditing, RestrictedEditingModeUI];
32
+ }
33
+ }