@ckeditor/ckeditor5-select-all 36.0.0 → 37.0.0-alpha.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/package.json +14 -13
- package/src/index.d.ts +10 -0
- package/src/selectall.d.ts +31 -0
- package/src/selectall.js +0 -2
- package/src/selectallcommand.d.ts +37 -0
- package/src/selectallcommand.js +9 -11
- package/src/selectallediting.d.ts +29 -0
- package/src/selectallediting.js +0 -2
- package/src/selectallui.d.ts +30 -0
- package/src/selectallui.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-select-all",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.0-alpha.0",
|
|
4
4
|
"description": "Select all feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
],
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@ckeditor/ckeditor5-core": "^
|
|
16
|
-
"@ckeditor/ckeditor5-utils": "^
|
|
17
|
-
"@ckeditor/ckeditor5-ui": "^
|
|
15
|
+
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.0",
|
|
16
|
+
"@ckeditor/ckeditor5-utils": "^37.0.0-alpha.0",
|
|
17
|
+
"@ckeditor/ckeditor5-ui": "^37.0.0-alpha.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
|
21
|
-
"@ckeditor/ckeditor5-engine": "^
|
|
22
|
-
"@ckeditor/ckeditor5-essentials": "^
|
|
23
|
-
"@ckeditor/ckeditor5-heading": "^
|
|
24
|
-
"@ckeditor/ckeditor5-image": "^
|
|
25
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
|
26
|
-
"@ckeditor/ckeditor5-table": "^
|
|
27
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
|
20
|
+
"@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.0",
|
|
21
|
+
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.0",
|
|
22
|
+
"@ckeditor/ckeditor5-essentials": "^37.0.0-alpha.0",
|
|
23
|
+
"@ckeditor/ckeditor5-heading": "^37.0.0-alpha.0",
|
|
24
|
+
"@ckeditor/ckeditor5-image": "^37.0.0-alpha.0",
|
|
25
|
+
"@ckeditor/ckeditor5-paragraph": "^37.0.0-alpha.0",
|
|
26
|
+
"@ckeditor/ckeditor5-table": "^37.0.0-alpha.0",
|
|
27
|
+
"@ckeditor/ckeditor5-editor-classic": "^37.0.0-alpha.0",
|
|
28
28
|
"typescript": "^4.8.4",
|
|
29
29
|
"webpack": "^5.58.1",
|
|
30
30
|
"webpack-cli": "^4.9.0"
|
|
@@ -53,5 +53,6 @@
|
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsc -p ./tsconfig.release.json",
|
|
55
55
|
"postversion": "npm run build"
|
|
56
|
-
}
|
|
56
|
+
},
|
|
57
|
+
"types": "src/index.d.ts"
|
|
57
58
|
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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 select-all
|
|
7
|
+
*/
|
|
8
|
+
export { default as SelectAll } from './selectall';
|
|
9
|
+
export { default as SelectAllEditing } from './selectallediting';
|
|
10
|
+
export { default as SelectAllUI } from './selectallui';
|
|
@@ -0,0 +1,31 @@
|
|
|
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 select-all/selectall
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependencies } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
/**
|
|
10
|
+
* The select all feature.
|
|
11
|
+
*
|
|
12
|
+
* This is a "glue" plugin which loads the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature}
|
|
13
|
+
* and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.
|
|
14
|
+
*
|
|
15
|
+
* Please refer to the documentation of individual features to learn more.
|
|
16
|
+
*/
|
|
17
|
+
export default class SelectAll extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): PluginDependencies;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): 'SelectAll';
|
|
26
|
+
}
|
|
27
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
28
|
+
interface PluginsMap {
|
|
29
|
+
[SelectAll.pluginName]: SelectAll;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/selectall.js
CHANGED
|
@@ -15,8 +15,6 @@ import SelectAllUI from './selectallui';
|
|
|
15
15
|
* and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.
|
|
16
16
|
*
|
|
17
17
|
* Please refer to the documentation of individual features to learn more.
|
|
18
|
-
*
|
|
19
|
-
* @extends module:core/plugin~Plugin
|
|
20
18
|
*/
|
|
21
19
|
export default class SelectAll extends Plugin {
|
|
22
20
|
/**
|
|
@@ -0,0 +1,37 @@
|
|
|
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 select-all/selectallcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
/**
|
|
10
|
+
* The select all command.
|
|
11
|
+
*
|
|
12
|
+
* It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle
|
|
13
|
+
* the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke.
|
|
14
|
+
*
|
|
15
|
+
* Executing this command changes the {@glink framework/architecture/editing-engine#model model}
|
|
16
|
+
* selection so it contains the entire content of the editable root of the editor the selection is
|
|
17
|
+
* {@link module:engine/model/selection~Selection#anchor anchored} in.
|
|
18
|
+
*
|
|
19
|
+
* If the selection was anchored in a {@glink framework/tutorials/implementing-a-block-widget nested editable}
|
|
20
|
+
* (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command
|
|
21
|
+
* will expand the selection to encompass more and more content up to the entire editable root of the editor.
|
|
22
|
+
*/
|
|
23
|
+
export default class SelectAllCommand extends Command {
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
constructor(editor: Editor);
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
execute(): void;
|
|
32
|
+
}
|
|
33
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
34
|
+
interface CommandsMap {
|
|
35
|
+
selectAll: SelectAllCommand;
|
|
36
|
+
}
|
|
37
|
+
}
|
package/src/selectallcommand.js
CHANGED
|
@@ -12,15 +12,13 @@ import { Command } from '@ckeditor/ckeditor5-core';
|
|
|
12
12
|
* It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle
|
|
13
13
|
* the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke.
|
|
14
14
|
*
|
|
15
|
-
* Executing this command changes the {@glink framework/
|
|
15
|
+
* Executing this command changes the {@glink framework/architecture/editing-engine#model model}
|
|
16
16
|
* selection so it contains the entire content of the editable root of the editor the selection is
|
|
17
17
|
* {@link module:engine/model/selection~Selection#anchor anchored} in.
|
|
18
18
|
*
|
|
19
|
-
* If the selection was anchored in a {@glink framework/
|
|
19
|
+
* If the selection was anchored in a {@glink framework/tutorials/implementing-a-block-widget nested editable}
|
|
20
20
|
* (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command
|
|
21
21
|
* will expand the selection to encompass more and more content up to the entire editable root of the editor.
|
|
22
|
-
*
|
|
23
|
-
* @extends module:core/command~Command
|
|
24
22
|
*/
|
|
25
23
|
export default class SelectAllCommand extends Command {
|
|
26
24
|
/**
|
|
@@ -54,13 +52,13 @@ export default class SelectAllCommand extends Command {
|
|
|
54
52
|
});
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Checks whether the element is a valid select-all scope. Returns true, if the element is a
|
|
57
|
+
* {@link module:engine/model/schema~Schema#isLimit limit}, and can contain any text or paragraph.
|
|
58
|
+
*
|
|
59
|
+
* @param schema Schema to check against.
|
|
60
|
+
* @param element Model element.
|
|
61
|
+
*/
|
|
64
62
|
function isSelectAllScope(schema, element) {
|
|
65
63
|
return schema.isLimit(element) && (schema.checkChild(element, '$text') || schema.checkChild(element, 'paragraph'));
|
|
66
64
|
}
|
|
@@ -0,0 +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 select-all/selectallediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
/**
|
|
10
|
+
* The select all editing feature.
|
|
11
|
+
*
|
|
12
|
+
* It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}
|
|
13
|
+
* and the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke listener which executes it.
|
|
14
|
+
*/
|
|
15
|
+
export default class SelectAllEditing extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): 'SelectAllEditing';
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
init(): void;
|
|
24
|
+
}
|
|
25
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
26
|
+
interface PluginsMap {
|
|
27
|
+
[SelectAllEditing.pluginName]: SelectAllEditing;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/selectallediting.js
CHANGED
|
@@ -14,8 +14,6 @@ const SELECT_ALL_KEYSTROKE = parseKeystroke('Ctrl+A');
|
|
|
14
14
|
*
|
|
15
15
|
* It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}
|
|
16
16
|
* and the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke listener which executes it.
|
|
17
|
-
*
|
|
18
|
-
* @extends module:core/plugin~Plugin
|
|
19
17
|
*/
|
|
20
18
|
export default class SelectAllEditing extends Plugin {
|
|
21
19
|
/**
|
|
@@ -0,0 +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 select-all/selectallui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
/**
|
|
10
|
+
* The select all UI feature.
|
|
11
|
+
*
|
|
12
|
+
* It registers the `'selectAll'` UI button in the editor's
|
|
13
|
+
* {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button
|
|
14
|
+
* executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.
|
|
15
|
+
*/
|
|
16
|
+
export default class SelectAllUI extends Plugin {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): 'SelectAllUI';
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
init(): void;
|
|
25
|
+
}
|
|
26
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
27
|
+
interface PluginsMap {
|
|
28
|
+
[SelectAllUI.pluginName]: SelectAllUI;
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/selectallui.js
CHANGED
|
@@ -14,8 +14,6 @@ import selectAllIcon from '../theme/icons/select-all.svg';
|
|
|
14
14
|
* It registers the `'selectAll'` UI button in the editor's
|
|
15
15
|
* {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button
|
|
16
16
|
* executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.
|
|
17
|
-
*
|
|
18
|
-
* @extends module:core/plugin~Plugin
|
|
19
17
|
*/
|
|
20
18
|
export default class SelectAllUI extends Plugin {
|
|
21
19
|
/**
|