@ckeditor/ckeditor5-enter 48.2.0 → 48.3.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/dist/augmentation.d.ts +13 -13
- package/dist/enter.d.ts +21 -21
- package/dist/entercommand.d.ts +44 -44
- package/dist/enterobserver.d.ts +34 -34
- package/dist/index-content.css +1 -0
- package/dist/index-editor.css +1 -0
- package/dist/index.css +0 -2
- package/dist/index.d.ts +12 -12
- package/dist/index.js +345 -393
- package/dist/index.js.map +1 -1
- package/dist/shiftenter.d.ts +19 -19
- package/dist/shiftentercommand.d.ts +26 -26
- package/dist/utils.d.ts +15 -15
- package/package.json +4 -4
- package/dist/index.css.map +0 -1
package/dist/augmentation.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { Enter, ShiftEnter, EnterCommand, ShiftEnterCommand } from
|
|
6
|
-
declare module
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
import type { Enter, ShiftEnter, EnterCommand, ShiftEnterCommand } from "./index.js";
|
|
6
|
+
declare module "@ckeditor/ckeditor5-core" {
|
|
7
|
+
interface PluginsMap {
|
|
8
|
+
[Enter.pluginName]: Enter;
|
|
9
|
+
[ShiftEnter.pluginName]: ShiftEnter;
|
|
10
|
+
}
|
|
11
|
+
interface CommandsMap {
|
|
12
|
+
enter: EnterCommand;
|
|
13
|
+
shiftEnter: ShiftEnterCommand;
|
|
14
|
+
}
|
|
15
15
|
}
|
package/dist/enter.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
6
|
+
* @module enter/enter
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
* This plugin handles the <kbd>Enter</kbd> keystroke (hard line break) in the editor.
|
|
11
|
+
*
|
|
12
|
+
* See also the {@link module:enter/shiftenter~ShiftEnter} plugin.
|
|
13
|
+
*
|
|
14
|
+
* For more information about this feature see the {@glink api/enter package page}.
|
|
15
|
+
*/
|
|
16
16
|
export declare class Enter extends Plugin {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): "Enter";
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static override get isOfficialPlugin(): true;
|
|
25
|
+
init(): void;
|
|
26
26
|
}
|
package/dist/entercommand.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Command } from
|
|
9
|
-
import type { ModelWriter } from
|
|
6
|
+
* @module enter/entercommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { ModelWriter } from "@ckeditor/ckeditor5-engine";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* Enter command used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> keystroke.
|
|
12
|
+
*/
|
|
13
13
|
export declare class EnterCommand extends Command {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
override execute(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Splits a block where the document selection is placed, in the way how the <kbd>Enter</kbd> key is expected to work:
|
|
20
|
+
*
|
|
21
|
+
* ```
|
|
22
|
+
* <p>Foo[]bar</p> -> <p>Foo</p><p>[]bar</p>
|
|
23
|
+
* <p>Foobar[]</p> -> <p>Foobar</p><p>[]</p>
|
|
24
|
+
* <p>Fo[ob]ar</p> -> <p>Fo</p><p>[]ar</p>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* In some cases, the split will not happen:
|
|
28
|
+
*
|
|
29
|
+
* ```
|
|
30
|
+
* // The selection parent is a limit element:
|
|
31
|
+
* <figcaption>A[bc]d</figcaption> -> <figcaption>A[]d</figcaption>
|
|
32
|
+
*
|
|
33
|
+
* // The selection spans over multiple elements:
|
|
34
|
+
* <h>x[x</h><p>y]y<p> -> <h>x</h><p>[]y</p>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param writer Writer to use when performing the enter action.
|
|
38
|
+
* @returns Boolean indicating if the block was split.
|
|
39
|
+
*/
|
|
40
|
+
enterBlock(writer: ModelWriter): boolean;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
* Fired after the the {@link module:enter/entercommand~EnterCommand} is finished executing.
|
|
44
|
+
*
|
|
45
|
+
* @eventName ~EnterCommand#afterExecute
|
|
46
|
+
*/
|
|
47
47
|
export type EnterCommandAfterExecuteEvent = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
name: "afterExecute";
|
|
49
|
+
args: [{
|
|
50
|
+
writer: ModelWriter;
|
|
51
|
+
}];
|
|
52
52
|
};
|
package/dist/enterobserver.d.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Observer, ViewDocumentDomEventData, type EditingView, type BubblingEvent } from
|
|
6
|
+
* @module enter/enterobserver
|
|
7
|
+
*/
|
|
8
|
+
import { Observer, ViewDocumentDomEventData, type EditingView, type BubblingEvent } from "@ckeditor/ckeditor5-engine";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* Enter observer introduces the {@link module:engine/view/document~ViewDocument#event:enter `Document#enter`} event.
|
|
11
|
+
*/
|
|
12
12
|
export declare class EnterObserver extends Observer {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
constructor(view: EditingView);
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
observe(): void;
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
stopObserving(): void;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
* Fired when the user presses the <kbd>Enter</kbd> key.
|
|
28
|
+
*
|
|
29
|
+
* Note: This event is fired by the {@link module:enter/enterobserver~EnterObserver observer}
|
|
30
|
+
* (usually registered by the {@link module:enter/enter~Enter Enter feature} and
|
|
31
|
+
* {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature}).
|
|
32
|
+
*
|
|
33
|
+
* @eventName module:engine/view/document~ViewDocument#enter
|
|
34
|
+
*/
|
|
35
35
|
export type ViewDocumentEnterEvent = BubblingEvent<{
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
name: "enter";
|
|
37
|
+
args: [ViewDocumentEnterEventData];
|
|
38
38
|
}>;
|
|
39
39
|
export interface ViewDocumentEnterEventData extends ViewDocumentDomEventData<InputEvent> {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Whether it is a soft enter (<kbd>Shift</kbd>+<kbd>Enter</kbd>) or a hard enter (<kbd>Enter</kbd>).
|
|
42
|
+
*/
|
|
43
|
+
isSoft: boolean;
|
|
44
44
|
}
|
package/dist/index-content.css
CHANGED
package/dist/index-editor.css
CHANGED
package/dist/index.css
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { Enter } from
|
|
9
|
-
export { ShiftEnter } from
|
|
10
|
-
export { EnterObserver, type ViewDocumentEnterEvent, type ViewDocumentEnterEventData } from
|
|
11
|
-
export { EnterCommand, type EnterCommandAfterExecuteEvent } from
|
|
12
|
-
export { ShiftEnterCommand, type ShiftEnterCommandAfterExecuteEvent } from
|
|
13
|
-
export { getCopyOnEnterAttributes as _getCopyOnEnterAttributes } from
|
|
14
|
-
import
|
|
6
|
+
* @module enter
|
|
7
|
+
*/
|
|
8
|
+
export { Enter } from "./enter.js";
|
|
9
|
+
export { ShiftEnter } from "./shiftenter.js";
|
|
10
|
+
export { EnterObserver, type ViewDocumentEnterEvent, type ViewDocumentEnterEventData } from "./enterobserver.js";
|
|
11
|
+
export { EnterCommand, type EnterCommandAfterExecuteEvent } from "./entercommand.js";
|
|
12
|
+
export { ShiftEnterCommand, type ShiftEnterCommandAfterExecuteEvent } from "./shiftentercommand.js";
|
|
13
|
+
export { getCopyOnEnterAttributes as _getCopyOnEnterAttributes } from "./utils.js";
|
|
14
|
+
import "./augmentation.js";
|