From ad484fdd5859c869477f1f063cfbd924ce1a8ceb Mon Sep 17 00:00:00 2001 From: zbeyens Date: Tue, 10 Oct 2023 10:53:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/twenty-rockets-thank.md | 5 +++++ packages/code-block/src/decorateCodeLine.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/twenty-rockets-thank.md 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;