diff --git a/.changeset/twenty-rockets-thank.md b/.changeset/twenty-rockets-thank.md new file mode 100644 index 0000000000..40b33d284a --- /dev/null +++ b/.changeset/twenty-rockets-thank.md @@ -0,0 +1,5 @@ +--- +'@udecode/plate-code-block': patch +--- + +Fix "Named export 'Token' not found. diff --git a/packages/code-block/src/decorateCodeLine.ts b/packages/code-block/src/decorateCodeLine.ts index cf2ffcabe7..271c848fb0 100644 --- a/packages/code-block/src/decorateCodeLine.ts +++ b/packages/code-block/src/decorateCodeLine.ts @@ -1,4 +1,3 @@ -/* eslint-disable unused-imports/no-unused-imports,unused-imports/no-unused-vars */ import { DecorateEntry, getNodeString, @@ -7,8 +6,7 @@ import { PlateEditor, Value, } from '@udecode/plate-common'; -// noinspection ES6UnusedImports -import Prism, { languages, Token, tokenize } from 'prismjs'; +import Prism from 'prismjs'; import 'prismjs/components/prism-antlr4.js'; import 'prismjs/components/prism-bash.js'; @@ -67,6 +65,8 @@ import { } from './constants'; import { CodeBlockPlugin, TCodeBlockElement } from './types'; +const { languages, Token, tokenize } = Prism; + export interface CodeSyntaxRange extends Range { tokenType: string; [ELEMENT_CODE_SYNTAX]: true;