Skip to content

Commit

Permalink
Merge pull request #2693 from udecode/fix/token-import
Browse files Browse the repository at this point in the history
🐛 Fix token import
  • Loading branch information
zbeyens authored Oct 10, 2023
2 parents 65601f9 + ad484fd commit be6468a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-rockets-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-code-block': patch
---

Fix "Named export 'Token' not found.
6 changes: 3 additions & 3 deletions packages/code-block/src/decorateCodeLine.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable unused-imports/no-unused-imports,unused-imports/no-unused-vars */
import {
DecorateEntry,
getNodeString,
Expand All @@ -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';
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit be6468a

Please sign in to comment.