@lexical/code 0.44.1-nightly.20260518.0 → 0.45.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/{LexicalCode.js.flow → dist/LexicalCode.js.flow} +1 -1
- package/package.json +32 -18
- package/src/index.ts +53 -0
- /package/{LexicalCode.dev.js → dist/LexicalCode.dev.js} +0 -0
- /package/{LexicalCode.dev.mjs → dist/LexicalCode.dev.mjs} +0 -0
- /package/{LexicalCode.js → dist/LexicalCode.js} +0 -0
- /package/{LexicalCode.mjs → dist/LexicalCode.mjs} +0 -0
- /package/{LexicalCode.node.mjs → dist/LexicalCode.node.mjs} +0 -0
- /package/{LexicalCode.prod.js → dist/LexicalCode.prod.js} +0 -0
- /package/{LexicalCode.prod.mjs → dist/LexicalCode.prod.mjs} +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
|
@@ -127,7 +127,7 @@ export interface Token {
|
|
|
127
127
|
content: TokenContent;
|
|
128
128
|
}
|
|
129
129
|
export interface Tokenizer {
|
|
130
|
-
defaultLanguage: string;
|
|
130
|
+
defaultLanguage: string | null;
|
|
131
131
|
tokenize(code: string, language?: string): (string | Token)[];
|
|
132
132
|
}
|
|
133
133
|
declare export var PrismTokenizer: Tokenizer;
|
package/package.json
CHANGED
|
@@ -8,37 +8,51 @@
|
|
|
8
8
|
"code"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.
|
|
12
|
-
"main": "LexicalCode.js",
|
|
13
|
-
"types": "index.d.ts",
|
|
11
|
+
"version": "0.45.0",
|
|
12
|
+
"main": "./dist/LexicalCode.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@lexical/code-core": "0.
|
|
16
|
-
"@lexical/
|
|
17
|
-
"
|
|
18
|
-
"lexical": "0.
|
|
15
|
+
"@lexical/code-core": "0.45.0",
|
|
16
|
+
"@lexical/extension": "0.45.0",
|
|
17
|
+
"lexical": "0.45.0",
|
|
18
|
+
"@lexical/code-prism": "0.45.0"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
22
|
"url": "git+https://github.com/facebook/lexical.git",
|
|
23
23
|
"directory": "packages/lexical-code"
|
|
24
24
|
},
|
|
25
|
-
"module": "LexicalCode.mjs",
|
|
25
|
+
"module": "./dist/LexicalCode.mjs",
|
|
26
26
|
"sideEffects": true,
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
+
"source": "./src/index.ts",
|
|
29
30
|
"import": {
|
|
30
|
-
"types": "./index.d.ts",
|
|
31
|
-
"development": "./LexicalCode.dev.mjs",
|
|
32
|
-
"production": "./LexicalCode.prod.mjs",
|
|
33
|
-
"node": "./LexicalCode.node.mjs",
|
|
34
|
-
"default": "./LexicalCode.mjs"
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"development": "./dist/LexicalCode.dev.mjs",
|
|
33
|
+
"production": "./dist/LexicalCode.prod.mjs",
|
|
34
|
+
"node": "./dist/LexicalCode.node.mjs",
|
|
35
|
+
"default": "./dist/LexicalCode.mjs"
|
|
35
36
|
},
|
|
36
37
|
"require": {
|
|
37
|
-
"types": "./index.d.ts",
|
|
38
|
-
"development": "./LexicalCode.dev.js",
|
|
39
|
-
"production": "./LexicalCode.prod.js",
|
|
40
|
-
"default": "./LexicalCode.js"
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"development": "./dist/LexicalCode.dev.js",
|
|
40
|
+
"production": "./dist/LexicalCode.prod.js",
|
|
41
|
+
"default": "./dist/LexicalCode.js"
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"src",
|
|
48
|
+
"!src/__tests__",
|
|
49
|
+
"!src/__bench__",
|
|
50
|
+
"!src/__mocks__",
|
|
51
|
+
"!src/**/*.test.ts",
|
|
52
|
+
"!src/**/*.test.tsx",
|
|
53
|
+
"!src/**/*.bench.ts",
|
|
54
|
+
"!src/**/*.bench.tsx",
|
|
55
|
+
"README.md",
|
|
56
|
+
"LICENSE"
|
|
57
|
+
]
|
|
44
58
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as LexicalCodePrism from '@lexical/code-prism';
|
|
10
|
+
|
|
11
|
+
export type {SerializedCodeNode} from '@lexical/code-core';
|
|
12
|
+
export {
|
|
13
|
+
$createCodeHighlightNode,
|
|
14
|
+
$createCodeNode,
|
|
15
|
+
$getCodeLineDirection,
|
|
16
|
+
$getEndOfCodeInLine,
|
|
17
|
+
$getFirstCodeNodeOfLine,
|
|
18
|
+
$getLastCodeNodeOfLine,
|
|
19
|
+
$getStartOfCodeInLine,
|
|
20
|
+
$isCodeHighlightNode,
|
|
21
|
+
$isCodeNode,
|
|
22
|
+
$outdentLeadingSpaces,
|
|
23
|
+
CodeExtension,
|
|
24
|
+
CodeHighlightNode,
|
|
25
|
+
type CodeIndentConfig,
|
|
26
|
+
CodeIndentExtension,
|
|
27
|
+
CodeNode,
|
|
28
|
+
DEFAULT_CODE_LANGUAGE,
|
|
29
|
+
getDefaultCodeLanguage,
|
|
30
|
+
} from '@lexical/code-core';
|
|
31
|
+
|
|
32
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
33
|
+
export const CODE_LANGUAGE_FRIENDLY_NAME_MAP =
|
|
34
|
+
LexicalCodePrism.CODE_LANGUAGE_FRIENDLY_NAME_MAP;
|
|
35
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
36
|
+
export const CODE_LANGUAGE_MAP = LexicalCodePrism.CODE_LANGUAGE_MAP;
|
|
37
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
38
|
+
export const getCodeLanguageOptions = LexicalCodePrism.getCodeLanguageOptions;
|
|
39
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
40
|
+
export const getCodeLanguages = LexicalCodePrism.getCodeLanguages;
|
|
41
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
42
|
+
export const getCodeThemeOptions = LexicalCodePrism.getCodeThemeOptions;
|
|
43
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
44
|
+
export const getLanguageFriendlyName = LexicalCodePrism.getLanguageFriendlyName;
|
|
45
|
+
/** @deprecated renamed to `normalizeCodeLanguage` and moved to `@lexical/code-prism` */
|
|
46
|
+
export const normalizeCodeLang = LexicalCodePrism.normalizeCodeLanguage;
|
|
47
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
48
|
+
export const normalizeCodeLanguage = LexicalCodePrism.normalizeCodeLanguage;
|
|
49
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
50
|
+
export const PrismTokenizer = LexicalCodePrism.PrismTokenizer;
|
|
51
|
+
/** @deprecated moved to `@lexical/code-prism` */
|
|
52
|
+
export const registerCodeHighlighting =
|
|
53
|
+
LexicalCodePrism.registerCodeHighlighting;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|