@lexical/code-core 0.46.1-nightly.20260707.0 → 0.46.1-nightly.20260709.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.
@@ -5,8 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { EditorConfig, LexicalNode, LexicalUpdateJSON, NodeKey, SerializedTextNode, Spread } from 'lexical';
9
- import { ElementNode, TextNode } from 'lexical';
8
+ import { type EditorConfig, type ElementNode, type LexicalNode, type LexicalUpdateJSON, type NodeKey, type SerializedTextNode, type Spread, TextNode } from 'lexical';
10
9
  type SerializedCodeHighlightNode = Spread<{
11
10
  highlightType: string | null | undefined;
12
11
  }, SerializedTextNode>;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { DOMPreprocessFn } from '@lexical/html';
8
+ import { type DOMPreprocessFn } from '@lexical/html';
9
9
  /**
10
10
  * VS Code → browser code-block pastes ship the block as either:
11
11
  *
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { LexicalEditor } from 'lexical';
8
+ import { type LexicalEditor } from 'lexical';
9
9
  /**
10
10
  * @internal
11
11
  * Register the keyboard and command handlers that drive code-block
@@ -5,8 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { DOMConversionMap, DOMExportOutput, EditorConfig, LexicalEditor, LexicalNode, LexicalUpdateJSON, NodeKey, ParagraphNode, RangeSelection, SerializedElementNode, Spread, TabNode } from 'lexical';
9
- import { ElementNode } from 'lexical';
8
+ import { type DOMConversionMap, type DOMExportOutput, type EditorConfig, ElementNode, type LexicalEditor, type LexicalNode, type LexicalUpdateJSON, type NodeKey, type ParagraphNode, type RangeSelection, type SerializedElementNode, type Spread, type TabNode } from 'lexical';
10
9
  import { type CodeHighlightNode } from './CodeHighlightNode';
11
10
  export type SerializedCodeNode = Spread<{
12
11
  language: string | null | undefined;
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { CodeHighlightNode } from './CodeHighlightNode';
9
- import type { LexicalNode, LineBreakNode, RangeSelection, TabNode } from 'lexical';
8
+ import { type LexicalNode, type LineBreakNode, type RangeSelection, type TabNode } from 'lexical';
9
+ import { type CodeHighlightNode } from './CodeHighlightNode';
10
10
  export declare function $getFirstCodeNodeOfLine(anchor: CodeHighlightNode | TabNode | LineBreakNode): CodeHighlightNode | TabNode | LineBreakNode;
11
11
  export declare function $getLastCodeNodeOfLine(anchor: CodeHighlightNode | TabNode | LineBreakNode): CodeHighlightNode | TabNode | LineBreakNode;
12
12
  /**
package/package.json CHANGED
@@ -8,15 +8,15 @@
8
8
  "code"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.46.1-nightly.20260707.0",
11
+ "version": "0.46.1-nightly.20260709.0",
12
12
  "main": "./dist/LexicalCodeCore.js",
13
13
  "types": "./dist/typescript-too-old.d.ts",
14
14
  "dependencies": {
15
- "@lexical/extension": "0.46.1-nightly.20260707.0",
16
- "@lexical/html": "0.46.1-nightly.20260707.0",
17
- "@lexical/utils": "0.46.1-nightly.20260707.0",
18
- "@lexical/internal": "0.46.1-nightly.20260707.0",
19
- "lexical": "0.46.1-nightly.20260707.0"
15
+ "@lexical/html": "0.46.1-nightly.20260709.0",
16
+ "@lexical/extension": "0.46.1-nightly.20260709.0",
17
+ "@lexical/internal": "0.46.1-nightly.20260709.0",
18
+ "lexical": "0.46.1-nightly.20260709.0",
19
+ "@lexical/utils": "0.46.1-nightly.20260709.0"
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",
@@ -6,21 +6,18 @@
6
6
  *
7
7
  */
8
8
 
9
- import type {
10
- EditorConfig,
11
- EditorThemeClasses,
12
- LexicalNode,
13
- LexicalUpdateJSON,
14
- NodeKey,
15
- SerializedTextNode,
16
- Spread,
17
- } from 'lexical';
18
-
19
9
  import {
20
10
  $applyNodeReplacement,
21
11
  addClassNamesToElement,
22
- ElementNode,
12
+ type EditorConfig,
13
+ type EditorThemeClasses,
14
+ type ElementNode,
15
+ type LexicalNode,
16
+ type LexicalUpdateJSON,
17
+ type NodeKey,
23
18
  removeClassNamesFromElement,
19
+ type SerializedTextNode,
20
+ type Spread,
24
21
  TextNode,
25
22
  } from 'lexical';
26
23
 
@@ -6,11 +6,10 @@
6
6
  *
7
7
  */
8
8
 
9
- import type {DOMPreprocessFn} from '@lexical/html';
10
-
11
9
  import {
12
10
  defineImportRule,
13
11
  defineOverlayRules,
12
+ type DOMPreprocessFn,
14
13
  ImportOverlays,
15
14
  sel,
16
15
  } from '@lexical/html';
@@ -6,16 +6,6 @@
6
6
  *
7
7
  */
8
8
 
9
- import type {CodeHighlightNode} from './CodeHighlightNode';
10
- import type {
11
- BaseSelection,
12
- LexicalCommand,
13
- LexicalEditor,
14
- LineBreakNode,
15
- RangeSelection,
16
- TabNode,
17
- } from 'lexical';
18
-
19
9
  import {effect, namedSignals} from '@lexical/extension';
20
10
  import invariant from '@lexical/internal/invariant';
21
11
  import {$onEscapeDown, $onEscapeUp} from '@lexical/utils';
@@ -34,6 +24,7 @@ import {
34
24
  $isTabNode,
35
25
  $normalizeCaret,
36
26
  $setSelectionFromCaretRange,
27
+ type BaseSelection,
37
28
  COMMAND_PRIORITY_LOW,
38
29
  defineExtension,
39
30
  INDENT_CONTENT_COMMAND,
@@ -43,15 +34,23 @@ import {
43
34
  KEY_ARROW_RIGHT_COMMAND,
44
35
  KEY_ARROW_UP_COMMAND,
45
36
  KEY_TAB_COMMAND,
37
+ type LexicalCommand,
38
+ type LexicalEditor,
39
+ type LineBreakNode,
46
40
  mergeRegister,
47
41
  MOVE_TO_END,
48
42
  MOVE_TO_START,
49
43
  OUTDENT_CONTENT_COMMAND,
44
+ type RangeSelection,
50
45
  safeCast,
46
+ type TabNode,
51
47
  } from 'lexical';
52
48
 
53
49
  import {CodeExtension} from './CodeExtension';
54
- import {$isCodeHighlightNode} from './CodeHighlightNode';
50
+ import {
51
+ $isCodeHighlightNode,
52
+ type CodeHighlightNode,
53
+ } from './CodeHighlightNode';
55
54
  import {$isCodeNode} from './CodeNode';
56
55
  import {
57
56
  $getCodeLineDirection,
package/src/CodeNode.ts CHANGED
@@ -7,21 +7,6 @@
7
7
  */
8
8
 
9
9
  import type {CodeExtension} from './CodeExtension';
10
- import type {
11
- DOMConversionMap,
12
- DOMConversionOutput,
13
- DOMExportOutput,
14
- EditorConfig,
15
- LexicalEditor,
16
- LexicalNode,
17
- LexicalUpdateJSON,
18
- NodeKey,
19
- ParagraphNode,
20
- RangeSelection,
21
- SerializedElementNode,
22
- Spread,
23
- TabNode,
24
- } from 'lexical';
25
10
 
26
11
  import {getPeerDependencyFromEditor} from '@lexical/extension';
27
12
  import warnOnlyOnce from '@lexical/internal/warnOnlyOnce';
@@ -36,9 +21,22 @@ import {
36
21
  $isTabNode,
37
22
  $isTextNode,
38
23
  addClassNamesToElement,
24
+ type DOMConversionMap,
25
+ type DOMConversionOutput,
26
+ type DOMExportOutput,
27
+ type EditorConfig,
39
28
  ElementNode,
40
29
  isHTMLElement,
30
+ type LexicalEditor,
31
+ type LexicalNode,
32
+ type LexicalUpdateJSON,
33
+ type NodeKey,
34
+ type ParagraphNode,
35
+ type RangeSelection,
36
+ type SerializedElementNode,
41
37
  setDOMStyleFromCSS,
38
+ type Spread,
39
+ type TabNode,
42
40
  } from 'lexical';
43
41
 
44
42
  import {
@@ -6,16 +6,6 @@
6
6
  *
7
7
  */
8
8
 
9
- import type {CodeHighlightNode} from './CodeHighlightNode';
10
- import type {
11
- CaretDirection,
12
- LexicalNode,
13
- LineBreakNode,
14
- RangeSelection,
15
- SiblingCaret,
16
- TabNode,
17
- } from 'lexical';
18
-
19
9
  import invariant from '@lexical/internal/invariant';
20
10
  import {
21
11
  $createLineBreakNode,
@@ -24,13 +14,20 @@ import {
24
14
  $isElementNode,
25
15
  $isLineBreakNode,
26
16
  $isTabNode,
17
+ type CaretDirection,
27
18
  getTextDirection,
19
+ type LexicalNode,
20
+ type LineBreakNode,
21
+ type RangeSelection,
22
+ type SiblingCaret,
23
+ type TabNode,
28
24
  tokenizeRawText,
29
25
  } from 'lexical';
30
26
 
31
27
  import {
32
28
  $createCodeHighlightNode,
33
29
  $isCodeHighlightNode,
30
+ type CodeHighlightNode,
34
31
  } from './CodeHighlightNode';
35
32
 
36
33
  function $getLastMatchingCodeNode<D extends CaretDirection>(