@ckeditor/ckeditor5-typing 38.2.0-alpha.0 → 38.2.0-alpha.1
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 +4 -4
- package/src/augmentation.d.ts +1 -1
- package/src/delete.js +2 -2
- package/src/deletecommand.d.ts +1 -1
- package/src/deletecommand.js +1 -1
- package/src/index.d.ts +17 -17
- package/src/index.js +11 -11
- package/src/input.js +2 -2
- package/src/inserttextcommand.d.ts +1 -1
- package/src/inserttextcommand.js +1 -1
- package/src/texttransformation.js +1 -1
- package/src/textwatcher.js +1 -1
- package/src/twostepcaretmovement.js +9 -1
- package/src/typing.d.ts +2 -2
- package/src/typing.js +2 -2
- package/src/utils/inlinehighlight.d.ts +1 -1
- package/src/utils/inlinehighlight.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-typing",
|
|
3
|
-
"version": "38.2.0-alpha.
|
|
3
|
+
"version": "38.2.0-alpha.1",
|
|
4
4
|
"description": "Typing feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ckeditor/ckeditor5-core": "38.2.0-alpha.
|
|
17
|
-
"@ckeditor/ckeditor5-engine": "38.2.0-alpha.
|
|
18
|
-
"@ckeditor/ckeditor5-utils": "38.2.0-alpha.
|
|
16
|
+
"@ckeditor/ckeditor5-core": "38.2.0-alpha.1",
|
|
17
|
+
"@ckeditor/ckeditor5-engine": "38.2.0-alpha.1",
|
|
18
|
+
"@ckeditor/ckeditor5-utils": "38.2.0-alpha.1",
|
|
19
19
|
"lodash-es": "^4.17.15"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
package/src/augmentation.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import type { Delete, DeleteCommand, Input, InsertTextCommand, TextTransformation, TwoStepCaretMovement, Typing, TypingConfig } from './index';
|
|
5
|
+
import type { Delete, DeleteCommand, Input, InsertTextCommand, TextTransformation, TwoStepCaretMovement, Typing, TypingConfig } from './index.js';
|
|
6
6
|
declare module '@ckeditor/ckeditor5-core' {
|
|
7
7
|
interface EditorConfig {
|
|
8
8
|
/**
|
package/src/delete.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module typing/delete
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import DeleteCommand from './deletecommand';
|
|
10
|
-
import DeleteObserver from './deleteobserver';
|
|
9
|
+
import DeleteCommand from './deletecommand.js';
|
|
10
|
+
import DeleteObserver from './deleteobserver.js';
|
|
11
11
|
/**
|
|
12
12
|
* The delete and backspace feature. Handles keys such as <kbd>Delete</kbd> and <kbd>Backspace</kbd>, other
|
|
13
13
|
* keystrokes and user actions that result in deleting content in the editor.
|
package/src/deletecommand.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Command, type Editor } from '@ckeditor/ckeditor5-core';
|
|
9
9
|
import type { DocumentSelection, Selection } from '@ckeditor/ckeditor5-engine';
|
|
10
|
-
import ChangeBuffer from './utils/changebuffer';
|
|
10
|
+
import ChangeBuffer from './utils/changebuffer.js';
|
|
11
11
|
/**
|
|
12
12
|
* The delete command. Used by the {@link module:typing/delete~Delete delete feature} to handle the <kbd>Delete</kbd> and
|
|
13
13
|
* <kbd>Backspace</kbd> keys.
|
package/src/deletecommand.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Command } from '@ckeditor/ckeditor5-core';
|
|
9
9
|
import { count } from '@ckeditor/ckeditor5-utils';
|
|
10
|
-
import ChangeBuffer from './utils/changebuffer';
|
|
10
|
+
import ChangeBuffer from './utils/changebuffer.js';
|
|
11
11
|
/**
|
|
12
12
|
* The delete command. Used by the {@link module:typing/delete~Delete delete feature} to handle the <kbd>Delete</kbd> and
|
|
13
13
|
* <kbd>Backspace</kbd> keys.
|
package/src/index.d.ts
CHANGED
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module typing
|
|
7
7
|
*/
|
|
8
|
-
export { default as Typing } from './typing';
|
|
9
|
-
export { default as Input } from './input';
|
|
10
|
-
export { default as Delete } from './delete';
|
|
11
|
-
export { default as TextWatcher } from './textwatcher';
|
|
12
|
-
export { default as TwoStepCaretMovement } from './twostepcaretmovement';
|
|
13
|
-
export { default as TextTransformation } from './texttransformation';
|
|
14
|
-
export { default as inlineHighlight } from './utils/inlinehighlight';
|
|
15
|
-
export { default as findAttributeRange, findAttributeRangeBound } from './utils/findattributerange';
|
|
16
|
-
export { default as getLastTextLine, type LastTextLineData } from './utils/getlasttextline';
|
|
17
|
-
export { default as InsertTextCommand, type InsertTextCommandExecuteEvent } from './inserttextcommand';
|
|
18
|
-
export type { default as DeleteCommand } from './deletecommand';
|
|
19
|
-
export type { TypingConfig } from './typingconfig';
|
|
20
|
-
export type { ViewDocumentDeleteEvent } from './deleteobserver';
|
|
21
|
-
export type { ViewDocumentInsertTextEvent, InsertTextEventData } from './inserttextobserver';
|
|
22
|
-
export type { TextWatcherMatchedEvent } from './textwatcher';
|
|
23
|
-
export type { TextWatcherMatchedDataEvent } from './textwatcher';
|
|
24
|
-
import './augmentation';
|
|
8
|
+
export { default as Typing } from './typing.js';
|
|
9
|
+
export { default as Input } from './input.js';
|
|
10
|
+
export { default as Delete } from './delete.js';
|
|
11
|
+
export { default as TextWatcher } from './textwatcher.js';
|
|
12
|
+
export { default as TwoStepCaretMovement } from './twostepcaretmovement.js';
|
|
13
|
+
export { default as TextTransformation } from './texttransformation.js';
|
|
14
|
+
export { default as inlineHighlight } from './utils/inlinehighlight.js';
|
|
15
|
+
export { default as findAttributeRange, findAttributeRangeBound } from './utils/findattributerange.js';
|
|
16
|
+
export { default as getLastTextLine, type LastTextLineData } from './utils/getlasttextline.js';
|
|
17
|
+
export { default as InsertTextCommand, type InsertTextCommandExecuteEvent } from './inserttextcommand.js';
|
|
18
|
+
export type { default as DeleteCommand } from './deletecommand.js';
|
|
19
|
+
export type { TypingConfig } from './typingconfig.js';
|
|
20
|
+
export type { ViewDocumentDeleteEvent } from './deleteobserver.js';
|
|
21
|
+
export type { ViewDocumentInsertTextEvent, InsertTextEventData } from './inserttextobserver.js';
|
|
22
|
+
export type { TextWatcherMatchedEvent } from './textwatcher.js';
|
|
23
|
+
export type { TextWatcherMatchedDataEvent } from './textwatcher.js';
|
|
24
|
+
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module typing
|
|
7
7
|
*/
|
|
8
|
-
export { default as Typing } from './typing';
|
|
9
|
-
export { default as Input } from './input';
|
|
10
|
-
export { default as Delete } from './delete';
|
|
11
|
-
export { default as TextWatcher } from './textwatcher';
|
|
12
|
-
export { default as TwoStepCaretMovement } from './twostepcaretmovement';
|
|
13
|
-
export { default as TextTransformation } from './texttransformation';
|
|
14
|
-
export { default as inlineHighlight } from './utils/inlinehighlight';
|
|
15
|
-
export { default as findAttributeRange, findAttributeRangeBound } from './utils/findattributerange';
|
|
16
|
-
export { default as getLastTextLine } from './utils/getlasttextline';
|
|
17
|
-
export { default as InsertTextCommand } from './inserttextcommand';
|
|
18
|
-
import './augmentation';
|
|
8
|
+
export { default as Typing } from './typing.js';
|
|
9
|
+
export { default as Input } from './input.js';
|
|
10
|
+
export { default as Delete } from './delete.js';
|
|
11
|
+
export { default as TextWatcher } from './textwatcher.js';
|
|
12
|
+
export { default as TwoStepCaretMovement } from './twostepcaretmovement.js';
|
|
13
|
+
export { default as TextTransformation } from './texttransformation.js';
|
|
14
|
+
export { default as inlineHighlight } from './utils/inlinehighlight.js';
|
|
15
|
+
export { default as findAttributeRange, findAttributeRangeBound } from './utils/findattributerange.js';
|
|
16
|
+
export { default as getLastTextLine } from './utils/getlasttextline.js';
|
|
17
|
+
export { default as InsertTextCommand } from './inserttextcommand.js';
|
|
18
|
+
import './augmentation.js';
|
package/src/input.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
9
|
import { env } from '@ckeditor/ckeditor5-utils';
|
|
10
|
-
import InsertTextCommand from './inserttextcommand';
|
|
11
|
-
import InsertTextObserver from './inserttextobserver';
|
|
10
|
+
import InsertTextCommand from './inserttextcommand.js';
|
|
11
|
+
import InsertTextObserver from './inserttextobserver.js';
|
|
12
12
|
/**
|
|
13
13
|
* Handles text input coming from the keyboard or other input methods.
|
|
14
14
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module typing/inserttextcommand
|
|
7
7
|
*/
|
|
8
8
|
import { Command, type Editor } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import ChangeBuffer from './utils/changebuffer';
|
|
9
|
+
import ChangeBuffer from './utils/changebuffer.js';
|
|
10
10
|
import type { DocumentSelection, Range, Selection } from '@ckeditor/ckeditor5-engine';
|
|
11
11
|
/**
|
|
12
12
|
* The insert text command. Used by the {@link module:typing/input~Input input feature} to handle typing.
|
package/src/inserttextcommand.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module typing/inserttextcommand
|
|
7
7
|
*/
|
|
8
8
|
import { Command } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import ChangeBuffer from './utils/changebuffer';
|
|
9
|
+
import ChangeBuffer from './utils/changebuffer.js';
|
|
10
10
|
/**
|
|
11
11
|
* The insert text command. Used by the {@link module:typing/input~Input input feature} to handle typing.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module typing/texttransformation
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import TextWatcher from './textwatcher';
|
|
9
|
+
import TextWatcher from './textwatcher.js';
|
|
10
10
|
import { escapeRegExp } from 'lodash-es';
|
|
11
11
|
// All named transformations.
|
|
12
12
|
const TRANSFORMATIONS = {
|
package/src/textwatcher.js
CHANGED
|
@@ -389,7 +389,15 @@ function setSelectionAttributesFromTheNodeBefore(model, attributes, position) {
|
|
|
389
389
|
const nodeBefore = position.nodeBefore;
|
|
390
390
|
model.change(writer => {
|
|
391
391
|
if (nodeBefore) {
|
|
392
|
-
|
|
392
|
+
const attributes = [];
|
|
393
|
+
const isInlineObject = model.schema.isObject(nodeBefore) && model.schema.isInline(nodeBefore);
|
|
394
|
+
for (const [key, value] of nodeBefore.getAttributes()) {
|
|
395
|
+
if (model.schema.checkAttribute('$text', key) &&
|
|
396
|
+
(!isInlineObject || model.schema.getAttributeProperties(key).copyFromObject !== false)) {
|
|
397
|
+
attributes.push([key, value]);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
writer.setSelectionAttribute(attributes);
|
|
393
401
|
}
|
|
394
402
|
else {
|
|
395
403
|
writer.removeSelectionAttribute(attributes);
|
package/src/typing.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module typing/typing
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import Input from './input';
|
|
10
|
-
import Delete from './delete';
|
|
9
|
+
import Input from './input.js';
|
|
10
|
+
import Delete from './delete.js';
|
|
11
11
|
/**
|
|
12
12
|
* The typing feature. It handles typing.
|
|
13
13
|
*
|
package/src/typing.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module typing/typing
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import Input from './input';
|
|
10
|
-
import Delete from './delete';
|
|
9
|
+
import Input from './input.js';
|
|
10
|
+
import Delete from './delete.js';
|
|
11
11
|
/**
|
|
12
12
|
* The typing feature. It handles typing.
|
|
13
13
|
*
|
|
@@ -18,7 +18,7 @@ import type { Editor } from '@ckeditor/ckeditor5-core';
|
|
|
18
18
|
* Usage:
|
|
19
19
|
*
|
|
20
20
|
* ```ts
|
|
21
|
-
* import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';
|
|
21
|
+
* import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js';
|
|
22
22
|
*
|
|
23
23
|
* // Make `ck-link_selected` class be applied on an `a` element
|
|
24
24
|
* // whenever the corresponding `linkHref` attribute element is selected.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module typing/utils/inlinehighlight
|
|
7
7
|
*/
|
|
8
|
-
import findAttributeRange from './findattributerange';
|
|
8
|
+
import findAttributeRange from './findattributerange.js';
|
|
9
9
|
/**
|
|
10
10
|
* Adds a visual highlight style to an attribute element in which the selection is anchored.
|
|
11
11
|
* Together with two-step caret movement, they indicate that the user is typing inside the element.
|
|
@@ -21,7 +21,7 @@ import findAttributeRange from './findattributerange';
|
|
|
21
21
|
* Usage:
|
|
22
22
|
*
|
|
23
23
|
* ```ts
|
|
24
|
-
* import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';
|
|
24
|
+
* import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js';
|
|
25
25
|
*
|
|
26
26
|
* // Make `ck-link_selected` class be applied on an `a` element
|
|
27
27
|
* // whenever the corresponding `linkHref` attribute element is selected.
|