From 28fc3f323e2639efaa1019ea55c089c599fe3e34 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Wed, 15 May 2024 18:19:21 +0530 Subject: [PATCH] fix: build errors --- packages/editor/core/src/lib/utils.ts | 15 ++++++++++----- yarn.lock | 5 +++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/editor/core/src/lib/utils.ts b/packages/editor/core/src/lib/utils.ts index e02ded23f..137c70c2e 100644 --- a/packages/editor/core/src/lib/utils.ts +++ b/packages/editor/core/src/lib/utils.ts @@ -1,4 +1,4 @@ -import { generateJSON, getSchema } from "@tiptap/core"; +import { Extensions, generateJSON, getSchema } from "@tiptap/core"; import { Selection } from "@tiptap/pm/state"; import { clsx, type ClassValue } from "clsx"; import { CoreEditorExtensionsWithoutProps } from "src/ui/extensions/core-without-props"; @@ -61,12 +61,17 @@ export const isValidHttpUrl = (string: string): boolean => { return url.protocol === "http:" || url.protocol === "https:"; }; +/** + * @description return an object with contentJSON and editorSchema + * @description contentJSON- ProseMirror JSON from HTML content + * @description editorSchema- editor schema from extensions + * @param {string} html + * @returns {object} {contentJSON, editorSchema} + */ export const generateJSONfromHTML = (html: string) => { const extensions = CoreEditorExtensionsWithoutProps(); - // @ts-expect-error update types - const contentJSON = generateJSON(html ?? "

", extensions); - // @ts-expect-error update types - const editorSchema = getSchema(extensions); + const contentJSON = generateJSON(html ?? "

", extensions as Extensions); + const editorSchema = getSchema(extensions as Extensions); return { contentJSON, editorSchema, diff --git a/yarn.lock b/yarn.lock index f8bbbf45f..a5b2f150e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2410,6 +2410,11 @@ resolved "https://registry.yarnpkg.com/@tiptap/extension-code/-/extension-code-2.3.2.tgz#36689994b76550e068ca9cc29cc8721e441bf2b5" integrity sha512-LyIRBFJCxbgi96ejoeewESvfUf5igfngamZJK+uegfTcznimP0AjSWs3whJwZ9QXUsQrB9tIrWIG4GBtatp6qw== +"@tiptap/extension-collaboration@^2.3.2": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-collaboration/-/extension-collaboration-2.4.0.tgz#d830694ac61a4b9857ffb77f24585e13a9cd6a0c" + integrity sha512-achU+GU9tqxn3zsU61CbwWrCausf0U23MJIpo8vnywOIx6E955by6okHEHoUazLIGVFXVc5DBzBP7bf+Snzk0Q== + "@tiptap/extension-document@^2.3.2": version "2.3.2" resolved "https://registry.yarnpkg.com/@tiptap/extension-document/-/extension-document-2.3.2.tgz#8914f952c946d150398913f1801295f101ded179"