diff --git a/apps/live/src/core/lib/page.ts b/apps/live/src/core/lib/page.ts index 7d23d8b195..932fcd84f7 100644 --- a/apps/live/src/core/lib/page.ts +++ b/apps/live/src/core/lib/page.ts @@ -1,5 +1,5 @@ // helpers -import { getAllDocumentFormatsFromBinaryData, getBinaryDataFromHTMLString } from "@/core/helpers/page.js"; +import { getAllDocumentFormatsFromBinaryData, getBinaryDataFromHTMLString } from "@plane/editor/lib"; // services import { PageService } from "@/core/services/page.service.js"; import { manualLogger } from "../helpers/logger.js"; @@ -19,7 +19,9 @@ export const updatePageDescription = async ( const projectId = params.get("projectId")?.toString(); if (!workspaceSlug || !projectId || !cookie) return; - const { contentBinaryEncoded, contentHTML, contentJSON } = getAllDocumentFormatsFromBinaryData(updatedDescription); + const { contentBinaryEncoded, contentHTML, contentJSON } = getAllDocumentFormatsFromBinaryData({ + descriptionBinary: updatedDescription, + }); try { const payload = { description_binary: contentBinaryEncoded, @@ -44,7 +46,9 @@ const fetchDescriptionHTMLAndTransform = async ( try { const pageDetails = await pageService.fetchDetails(workspaceSlug, projectId, pageId, cookie); - const { contentBinary } = getBinaryDataFromHTMLString(pageDetails.description_html ?? "

"); + const contentBinary = getBinaryDataFromHTMLString({ + descriptionHTML: pageDetails.description_html ?? "

", + }); return contentBinary; } catch (error) { manualLogger.error("Error while transforming from HTML to Uint8Array", error); diff --git a/apps/live/src/server.ts b/apps/live/src/server.ts index 463febdf33..cc8bfdfced 100644 --- a/apps/live/src/server.ts +++ b/apps/live/src/server.ts @@ -73,7 +73,7 @@ export class Server { return; } const { description, description_binary } = getAllDocumentFormatsFromHTMLString({ - document_html: description_html, + descriptionHTML: description_html, }); res.status(200).json({ description, diff --git a/apps/web/core/hooks/use-page-fallback.ts b/apps/web/core/hooks/use-page-fallback.ts index 0616a92ba7..f350045dd8 100644 --- a/apps/web/core/hooks/use-page-fallback.ts +++ b/apps/web/core/hooks/use-page-fallback.ts @@ -27,7 +27,9 @@ export const usePageFallback = (args: TArgs) => { if (latestEncodedDescription && latestEncodedDescription.byteLength > 0) { latestDecodedDescription = new Uint8Array(latestEncodedDescription); } else { - latestDecodedDescription = getBinaryDataFromHTMLString("

"); + latestDecodedDescription = getBinaryDataFromHTMLString({ + descriptionHTML: "

", + }); } editor.setProviderDocument(latestDecodedDescription);