@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.
@@ -1,15 +1,15 @@
1
1
  /**
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
- }
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
- * @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
- */
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
- * @module enter/enter
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
6
+ * @module enter/enter
7
+ */
8
+ import { Plugin } from "@ckeditor/ckeditor5-core";
9
9
  /**
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
- */
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
- * @inheritDoc
19
- */
20
- static get pluginName(): "Enter";
21
- /**
22
- * @inheritDoc
23
- */
24
- static get isOfficialPlugin(): true;
25
- init(): void;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get pluginName(): "Enter";
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static override get isOfficialPlugin(): true;
25
+ init(): void;
26
26
  }
@@ -1,52 +1,52 @@
1
1
  /**
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
- */
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
- * @module enter/entercommand
7
- */
8
- import { Command } from '@ckeditor/ckeditor5-core';
9
- import type { ModelWriter } from '@ckeditor/ckeditor5-engine';
6
+ * @module enter/entercommand
7
+ */
8
+ import { Command } from "@ckeditor/ckeditor5-core";
9
+ import type { ModelWriter } from "@ckeditor/ckeditor5-engine";
10
10
  /**
11
- * Enter command used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> keystroke.
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
- * @inheritDoc
16
- */
17
- 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;
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
- * Fired after the the {@link module:enter/entercommand~EnterCommand} is finished executing.
44
- *
45
- * @eventName ~EnterCommand#afterExecute
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
- name: 'afterExecute';
49
- args: [{
50
- writer: ModelWriter;
51
- }];
48
+ name: "afterExecute";
49
+ args: [{
50
+ writer: ModelWriter;
51
+ }];
52
52
  };
@@ -1,44 +1,44 @@
1
1
  /**
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
- */
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
- * @module enter/enterobserver
7
- */
8
- import { Observer, ViewDocumentDomEventData, type EditingView, type BubblingEvent } from '@ckeditor/ckeditor5-engine';
6
+ * @module enter/enterobserver
7
+ */
8
+ import { Observer, ViewDocumentDomEventData, type EditingView, type BubblingEvent } from "@ckeditor/ckeditor5-engine";
9
9
  /**
10
- * Enter observer introduces the {@link module:engine/view/document~ViewDocument#event:enter `Document#enter`} event.
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
- * @inheritDoc
15
- */
16
- constructor(view: EditingView);
17
- /**
18
- * @inheritDoc
19
- */
20
- observe(): void;
21
- /**
22
- * @inheritDoc
23
- */
24
- stopObserving(): void;
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
- * 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
- */
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
- name: 'enter';
37
- args: [ViewDocumentEnterEventData];
36
+ name: "enter";
37
+ args: [ViewDocumentEnterEventData];
38
38
  }>;
39
39
  export interface ViewDocumentEnterEventData extends ViewDocumentDomEventData<InputEvent> {
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;
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
  }
@@ -2,3 +2,4 @@
2
2
  * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
+
@@ -2,3 +2,4 @@
2
2
  * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
+
package/dist/index.css CHANGED
@@ -3,5 +3,3 @@
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
 
6
-
7
- /*# sourceMappingURL=index.css.map */
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /**
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
- */
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
- * @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';
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";