@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.
package/CHANGELOG.md CHANGED
@@ -5,21 +5,21 @@ All changes in the package are documented in the main repository. See: https://g
5
5
 
6
6
  Changes for the past releases are available below.
7
7
 
8
- ## [19.0.0](https://github.com/ckeditor/ckeditor5-restricted-editing/compare/v18.0.0...v19.0.0) (2020-04-29)
8
+ ## [19.0.0](https://github.com/ckeditor/ckeditor5-restricted-editing/compare/v18.0.0...v19.0.0) (April 29, 2020)
9
9
 
10
10
  ### Other changes
11
11
 
12
12
  * Updated translations. ([4d7336d](https://github.com/ckeditor/ckeditor5-restricted-editing/commit/4d7336d))
13
13
 
14
14
 
15
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-restricted-editing/compare/v17.0.0...v18.0.0) (2020-03-19)
15
+ ## [18.0.0](https://github.com/ckeditor/ckeditor5-restricted-editing/compare/v17.0.0...v18.0.0) (March 19, 2020)
16
16
 
17
17
  ### Other changes
18
18
 
19
19
  * Updated translations. ([e2a6a7d](https://github.com/ckeditor/ckeditor5-restricted-editing/commit/e2a6a7d))
20
20
 
21
21
 
22
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-restricted-editing/compare/v16.0.0...v17.0.0) (2020-02-19)
22
+ ## [17.0.0](https://github.com/ckeditor/ckeditor5-restricted-editing/compare/v16.0.0...v17.0.0) (February 19, 2020)
23
23
 
24
24
  ### MAJOR BREAKING CHANGES
25
25
 
@@ -48,6 +48,6 @@ Changes for the past releases are available below.
48
48
  * Updated translations. ([c076842](https://github.com/ckeditor/ckeditor5-restricted-editing/commit/c076842))
49
49
 
50
50
 
51
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-restricted-editing/tree/v16.0.0) (2019-12-04)
51
+ ## [16.0.0](https://github.com/ckeditor/ckeditor5-restricted-editing/tree/v16.0.0) (December 4, 2019)
52
52
 
53
53
  The initial release.
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor&nbsp;5 restricted editing feature** – https://github.com/ckeditor/ckeditor5-restricted-editing <br>
5
- Copyright (c) 2003-2023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 20032023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
6
6
 
7
7
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
8
8
 
@@ -14,4 +14,4 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
14
14
  Trademarks
15
15
  ----------
16
16
 
17
- **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
17
+ **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-restricted-editing",
3
- "version": "40.0.0",
3
+ "version": "40.2.0",
4
4
  "description": "Restricted editing feature for CKEditor 5 editors.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "main": "src/index.js",
13
13
  "dependencies": {
14
- "ckeditor5": "40.0.0"
14
+ "ckeditor5": "40.2.0"
15
15
  },
16
16
  "author": "CKSource (http://cksource.com/)",
17
17
  "license": "GPL-2.0-or-later",
@@ -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
- import type { RestrictedEditingMode, RestrictedEditingModeEditing, RestrictedEditingModeUI, StandardEditingMode, StandardEditingModeEditing, StandardEditingModeUI, RestrictedEditingConfig, RestrictedEditingExceptionCommand, RestrictedEditingModeNavigationCommand } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface PluginsMap {
8
- [RestrictedEditingMode.pluginName]: RestrictedEditingMode;
9
- [RestrictedEditingModeEditing.pluginName]: RestrictedEditingModeEditing;
10
- [RestrictedEditingModeUI.pluginName]: RestrictedEditingModeUI;
11
- [StandardEditingMode.pluginName]: StandardEditingMode;
12
- [StandardEditingModeEditing.pluginName]: StandardEditingModeEditing;
13
- [StandardEditingModeUI.pluginName]: StandardEditingModeUI;
14
- }
15
- interface CommandsMap {
16
- restrictedEditingException: RestrictedEditingExceptionCommand;
17
- goToPreviousRestrictedEditingException: RestrictedEditingModeNavigationCommand;
18
- goToNextRestrictedEditingException: RestrictedEditingModeNavigationCommand;
19
- }
20
- interface EditorConfig {
21
- /**
22
- * The configuration of the restricted editing mode feature. Introduced by the
23
- * {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
24
- *
25
- * Read more in {@link module:restricted-editing/restrictededitingconfig~RestrictedEditingConfig}.
26
- */
27
- restrictedEditing?: RestrictedEditingConfig;
28
- }
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
+ import type { RestrictedEditingMode, RestrictedEditingModeEditing, RestrictedEditingModeUI, StandardEditingMode, StandardEditingModeEditing, StandardEditingModeUI, RestrictedEditingConfig, RestrictedEditingExceptionCommand, RestrictedEditingModeNavigationCommand } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface PluginsMap {
8
+ [RestrictedEditingMode.pluginName]: RestrictedEditingMode;
9
+ [RestrictedEditingModeEditing.pluginName]: RestrictedEditingModeEditing;
10
+ [RestrictedEditingModeUI.pluginName]: RestrictedEditingModeUI;
11
+ [StandardEditingMode.pluginName]: StandardEditingMode;
12
+ [StandardEditingModeEditing.pluginName]: StandardEditingModeEditing;
13
+ [StandardEditingModeUI.pluginName]: StandardEditingModeUI;
14
+ }
15
+ interface CommandsMap {
16
+ restrictedEditingException: RestrictedEditingExceptionCommand;
17
+ goToPreviousRestrictedEditingException: RestrictedEditingModeNavigationCommand;
18
+ goToNextRestrictedEditingException: RestrictedEditingModeNavigationCommand;
19
+ }
20
+ interface EditorConfig {
21
+ /**
22
+ * The configuration of the restricted editing mode feature. Introduced by the
23
+ * {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
24
+ *
25
+ * Read more in {@link module:restricted-editing/restrictededitingconfig~RestrictedEditingConfig}.
26
+ */
27
+ restrictedEditing?: RestrictedEditingConfig;
28
+ }
29
+ }
@@ -1,5 +1,5 @@
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
- export {};
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
+ export {};
package/src/index.d.ts CHANGED
@@ -1,17 +1,17 @@
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
7
- */
8
- export { default as RestrictedEditingMode } from './restrictededitingmode';
9
- export { default as RestrictedEditingModeEditing } from './restrictededitingmodeediting';
10
- export { default as RestrictedEditingModeUI } from './restrictededitingmodeui';
11
- export { default as StandardEditingMode } from './standardeditingmode';
12
- export { default as StandardEditingModeEditing } from './standardeditingmodeediting';
13
- export { default as StandardEditingModeUI } from './standardeditingmodeui';
14
- export type { RestrictedEditingConfig } from './restrictededitingconfig';
15
- export type { default as RestrictedEditingExceptionCommand } from './restrictededitingexceptioncommand';
16
- export type { default as RestrictedEditingModeNavigationCommand } from './restrictededitingmodenavigationcommand';
17
- import './augmentation';
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
7
+ */
8
+ export { default as RestrictedEditingMode } from './restrictededitingmode';
9
+ export { default as RestrictedEditingModeEditing } from './restrictededitingmodeediting';
10
+ export { default as RestrictedEditingModeUI } from './restrictededitingmodeui';
11
+ export { default as StandardEditingMode } from './standardeditingmode';
12
+ export { default as StandardEditingModeEditing } from './standardeditingmodeediting';
13
+ export { default as StandardEditingModeUI } from './standardeditingmodeui';
14
+ export type { RestrictedEditingConfig } from './restrictededitingconfig';
15
+ export type { default as RestrictedEditingExceptionCommand } from './restrictededitingexceptioncommand';
16
+ export type { default as RestrictedEditingModeNavigationCommand } from './restrictededitingmodenavigationcommand';
17
+ import './augmentation';
package/src/index.js CHANGED
@@ -1,14 +1,14 @@
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
7
- */
8
- export { default as RestrictedEditingMode } from './restrictededitingmode';
9
- export { default as RestrictedEditingModeEditing } from './restrictededitingmodeediting';
10
- export { default as RestrictedEditingModeUI } from './restrictededitingmodeui';
11
- export { default as StandardEditingMode } from './standardeditingmode';
12
- export { default as StandardEditingModeEditing } from './standardeditingmodeediting';
13
- export { default as StandardEditingModeUI } from './standardeditingmodeui';
14
- import './augmentation';
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
7
+ */
8
+ export { default as RestrictedEditingMode } from './restrictededitingmode';
9
+ export { default as RestrictedEditingModeEditing } from './restrictededitingmodeediting';
10
+ export { default as RestrictedEditingModeUI } from './restrictededitingmodeui';
11
+ export { default as StandardEditingMode } from './standardeditingmode';
12
+ export { default as StandardEditingModeEditing } from './standardeditingmodeediting';
13
+ export { default as StandardEditingModeUI } from './standardeditingmodeui';
14
+ import './augmentation';
@@ -1,60 +1,60 @@
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/restrictededitingconfig
7
- */
8
- /**
9
- * The configuration of the restricted editing mode feature.
10
- * The option is used by the {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
11
- *
12
- * ```ts
13
- * ClassicEditor
14
- * .create( {
15
- * restrictedEditing: {
16
- * allowedCommands: [ 'bold', 'link', 'unlink' ],
17
- * allowedAttributes: [ 'bold', 'linkHref' ]
18
- * }
19
- * } )
20
- * .then( ... )
21
- * .catch( ... );
22
- * ```
23
- *
24
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
25
- */
26
- export interface RestrictedEditingConfig {
27
- /**
28
- * The command names allowed in non-restricted areas of the content.
29
- *
30
- * Defines which feature commands should be enabled in the restricted editing mode. The commands used for typing and deleting text
31
- * (`'input'`, `'delete'` and `'deleteForward'`) are allowed by the feature inside non-restricted regions and do not need to be defined.
32
- *
33
- * **Note**: The restricted editing mode always allows to use the restricted mode navigation commands as well as `'undo'` and `'redo'`
34
- * commands.
35
- *
36
- * The default value is:
37
- *
38
- * ```ts
39
- * const restrictedEditingConfig = {
40
- * allowedCommands: [ 'bold', 'italic', 'link', 'unlink' ]
41
- * };
42
- * ```
43
- *
44
- * To make a command always enabled (also outside non-restricted areas) use
45
- * {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing#enableCommand} method.
46
- */
47
- allowedCommands: Array<string>;
48
- /**
49
- * The text attribute names allowed when pasting content ot non-restricted areas.
50
- *
51
- * The default value is:
52
- *
53
- * ```ts
54
- * const restrictedEditingConfig = {
55
- * allowedAttributes: [ 'bold', 'italic', 'linkHref' ]
56
- * };
57
- * ```
58
- */
59
- allowedAttributes: Array<string>;
60
- }
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/restrictededitingconfig
7
+ */
8
+ /**
9
+ * The configuration of the restricted editing mode feature.
10
+ * The option is used by the {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
11
+ *
12
+ * ```ts
13
+ * ClassicEditor
14
+ * .create( {
15
+ * restrictedEditing: {
16
+ * allowedCommands: [ 'bold', 'link', 'unlink' ],
17
+ * allowedAttributes: [ 'bold', 'linkHref' ]
18
+ * }
19
+ * } )
20
+ * .then( ... )
21
+ * .catch( ... );
22
+ * ```
23
+ *
24
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
25
+ */
26
+ export interface RestrictedEditingConfig {
27
+ /**
28
+ * The command names allowed in non-restricted areas of the content.
29
+ *
30
+ * Defines which feature commands should be enabled in the restricted editing mode. The commands used for typing and deleting text
31
+ * (`'input'`, `'delete'` and `'deleteForward'`) are allowed by the feature inside non-restricted regions and do not need to be defined.
32
+ *
33
+ * **Note**: The restricted editing mode always allows to use the restricted mode navigation commands as well as `'undo'` and `'redo'`
34
+ * commands.
35
+ *
36
+ * The default value is:
37
+ *
38
+ * ```ts
39
+ * const restrictedEditingConfig = {
40
+ * allowedCommands: [ 'bold', 'italic', 'link', 'unlink' ]
41
+ * };
42
+ * ```
43
+ *
44
+ * To make a command always enabled (also outside non-restricted areas) use
45
+ * {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing#enableCommand} method.
46
+ */
47
+ allowedCommands: Array<string>;
48
+ /**
49
+ * The text attribute names allowed when pasting content ot non-restricted areas.
50
+ *
51
+ * The default value is:
52
+ *
53
+ * ```ts
54
+ * const restrictedEditingConfig = {
55
+ * allowedAttributes: [ 'bold', 'italic', 'linkHref' ]
56
+ * };
57
+ * ```
58
+ */
59
+ allowedAttributes: Array<string>;
60
+ }
@@ -1,5 +1,5 @@
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
- export {};
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
+ export {};
@@ -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
- /**
6
- * @module restricted-editing/restrictededitingexceptioncommand
7
- */
8
- import { Command } from 'ckeditor5/src/core';
9
- /**
10
- * The command that toggles exceptions from the restricted editing on text.
11
- */
12
- export default class RestrictedEditingExceptionCommand extends Command {
13
- /**
14
- * A flag indicating whether the command is active
15
- *
16
- * @readonly
17
- */
18
- value: boolean;
19
- /**
20
- * @inheritDoc
21
- */
22
- refresh(): void;
23
- /**
24
- * @inheritDoc
25
- */
26
- execute(options?: RestrictedEditingExceptionCommandParams): void;
27
- }
28
- export interface RestrictedEditingExceptionCommandParams {
29
- forceValue?: unknown;
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
+ /**
6
+ * @module restricted-editing/restrictededitingexceptioncommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core';
9
+ /**
10
+ * The command that toggles exceptions from the restricted editing on text.
11
+ */
12
+ export default class RestrictedEditingExceptionCommand extends Command {
13
+ /**
14
+ * A flag indicating whether the command is active
15
+ *
16
+ * @readonly
17
+ */
18
+ value: boolean;
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ refresh(): void;
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ execute(options?: RestrictedEditingExceptionCommandParams): void;
27
+ }
28
+ export interface RestrictedEditingExceptionCommandParams {
29
+ forceValue?: unknown;
30
+ }
@@ -1,61 +1,61 @@
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/restrictededitingexceptioncommand
7
- */
8
- import { Command } from 'ckeditor5/src/core';
9
- /**
10
- * The command that toggles exceptions from the restricted editing on text.
11
- */
12
- export default class RestrictedEditingExceptionCommand extends Command {
13
- /**
14
- * @inheritDoc
15
- */
16
- refresh() {
17
- const model = this.editor.model;
18
- const doc = model.document;
19
- this.value = !!doc.selection.getAttribute('restrictedEditingException');
20
- this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'restrictedEditingException');
21
- }
22
- /**
23
- * @inheritDoc
24
- */
25
- execute(options = {}) {
26
- const model = this.editor.model;
27
- const document = model.document;
28
- const selection = document.selection;
29
- const valueToSet = (options.forceValue === undefined) ? !this.value : options.forceValue;
30
- model.change(writer => {
31
- const ranges = model.schema.getValidRanges(selection.getRanges(), 'restrictedEditingException');
32
- if (selection.isCollapsed) {
33
- if (valueToSet) {
34
- writer.setSelectionAttribute('restrictedEditingException', valueToSet);
35
- }
36
- else {
37
- const isSameException = (value) => {
38
- return value.item.getAttribute('restrictedEditingException') === this.value;
39
- };
40
- const focus = selection.focus;
41
- const exceptionStart = focus.getLastMatchingPosition(isSameException, { direction: 'backward' });
42
- const exceptionEnd = focus.getLastMatchingPosition(isSameException);
43
- writer.removeSelectionAttribute('restrictedEditingException');
44
- if (!(focus.isEqual(exceptionStart) || focus.isEqual(exceptionEnd))) {
45
- writer.removeAttribute('restrictedEditingException', writer.createRange(exceptionStart, exceptionEnd));
46
- }
47
- }
48
- }
49
- else {
50
- for (const range of ranges) {
51
- if (valueToSet) {
52
- writer.setAttribute('restrictedEditingException', valueToSet, range);
53
- }
54
- else {
55
- writer.removeAttribute('restrictedEditingException', range);
56
- }
57
- }
58
- }
59
- });
60
- }
61
- }
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/restrictededitingexceptioncommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core';
9
+ /**
10
+ * The command that toggles exceptions from the restricted editing on text.
11
+ */
12
+ export default class RestrictedEditingExceptionCommand extends Command {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ refresh() {
17
+ const model = this.editor.model;
18
+ const doc = model.document;
19
+ this.value = !!doc.selection.getAttribute('restrictedEditingException');
20
+ this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'restrictedEditingException');
21
+ }
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ execute(options = {}) {
26
+ const model = this.editor.model;
27
+ const document = model.document;
28
+ const selection = document.selection;
29
+ const valueToSet = (options.forceValue === undefined) ? !this.value : options.forceValue;
30
+ model.change(writer => {
31
+ const ranges = model.schema.getValidRanges(selection.getRanges(), 'restrictedEditingException');
32
+ if (selection.isCollapsed) {
33
+ if (valueToSet) {
34
+ writer.setSelectionAttribute('restrictedEditingException', valueToSet);
35
+ }
36
+ else {
37
+ const isSameException = (value) => {
38
+ return value.item.getAttribute('restrictedEditingException') === this.value;
39
+ };
40
+ const focus = selection.focus;
41
+ const exceptionStart = focus.getLastMatchingPosition(isSameException, { direction: 'backward' });
42
+ const exceptionEnd = focus.getLastMatchingPosition(isSameException);
43
+ writer.removeSelectionAttribute('restrictedEditingException');
44
+ if (!(focus.isEqual(exceptionStart) || focus.isEqual(exceptionEnd))) {
45
+ writer.removeAttribute('restrictedEditingException', writer.createRange(exceptionStart, exceptionEnd));
46
+ }
47
+ }
48
+ }
49
+ else {
50
+ for (const range of ranges) {
51
+ if (valueToSet) {
52
+ writer.setAttribute('restrictedEditingException', valueToSet, range);
53
+ }
54
+ else {
55
+ writer.removeAttribute('restrictedEditingException', range);
56
+ }
57
+ }
58
+ }
59
+ });
60
+ }
61
+ }
@@ -1,39 +1,39 @@
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/converters
7
- */
8
- import type { Editor } from 'ckeditor5/src/core';
9
- import { type MatcherPattern, type ModelPostFixer, type UpcastDispatcher } from 'ckeditor5/src/engine';
10
- /**
11
- * Adds a visual highlight style to a restricted editing exception that the selection is anchored to.
12
- *
13
- * The highlight is turned on by adding the `.restricted-editing-exception_selected` class to the
14
- * exception in the view:
15
- *
16
- * * The class is removed before the conversion starts, as callbacks added with the `'highest'` priority
17
- * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.
18
- * * The class is added in the view post-fixer, after other changes in the model tree are converted to the view.
19
- *
20
- * This way, adding and removing the highlight does not interfere with conversion.
21
- */
22
- export declare function setupExceptionHighlighting(editor: Editor): void;
23
- /**
24
- * A post-fixer that prevents removing a collapsed marker from the document.
25
- */
26
- export declare function resurrectCollapsedMarkerPostFixer(editor: Editor): ModelPostFixer;
27
- /**
28
- * A post-fixer that extends a marker when the user types on its boundaries.
29
- */
30
- export declare function extendMarkerOnTypingPostFixer(editor: Editor): ModelPostFixer;
31
- /**
32
- * A view highlight-to-marker conversion helper.
33
- *
34
- * @param config Conversion configuration.
35
- */
36
- export declare function upcastHighlightToMarker(config: {
37
- view: MatcherPattern;
38
- model: () => string;
39
- }): (dispatcher: UpcastDispatcher) => void;
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/converters
7
+ */
8
+ import type { Editor } from 'ckeditor5/src/core';
9
+ import { type MatcherPattern, type ModelPostFixer, type UpcastDispatcher } from 'ckeditor5/src/engine';
10
+ /**
11
+ * Adds a visual highlight style to a restricted editing exception that the selection is anchored to.
12
+ *
13
+ * The highlight is turned on by adding the `.restricted-editing-exception_selected` class to the
14
+ * exception in the view:
15
+ *
16
+ * * The class is removed before the conversion starts, as callbacks added with the `'highest'` priority
17
+ * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.
18
+ * * The class is added in the view post-fixer, after other changes in the model tree are converted to the view.
19
+ *
20
+ * This way, adding and removing the highlight does not interfere with conversion.
21
+ */
22
+ export declare function setupExceptionHighlighting(editor: Editor): void;
23
+ /**
24
+ * A post-fixer that prevents removing a collapsed marker from the document.
25
+ */
26
+ export declare function resurrectCollapsedMarkerPostFixer(editor: Editor): ModelPostFixer;
27
+ /**
28
+ * A post-fixer that extends a marker when the user types on its boundaries.
29
+ */
30
+ export declare function extendMarkerOnTypingPostFixer(editor: Editor): ModelPostFixer;
31
+ /**
32
+ * A view highlight-to-marker conversion helper.
33
+ *
34
+ * @param config Conversion configuration.
35
+ */
36
+ export declare function upcastHighlightToMarker(config: {
37
+ view: MatcherPattern;
38
+ model: () => string;
39
+ }): (dispatcher: UpcastDispatcher) => void;