From d6758037b6730b25e085b0bf84cea831f6f56ee2 Mon Sep 17 00:00:00 2001 From: naaiyy Date: Fri, 14 Aug 2026 22:20:04 +0200 Subject: [PATCH 1/2] fix: align the directory tree with the sidebar --- .../web/features/app-shell/app-sidebar-row.ts | 8 + apps/web/features/editor/pages/page-tree.tsx | 3 +- .../features/libraries/library-explorer.tsx | 1 + .../libraries/library-file-icon.test.ts | 34 ++++ .../features/libraries/library-file-icon.tsx | 158 ++++++++++++++++ apps/web/features/libraries/library-tree.tsx | 168 +++++++++++------- apps/web/public/document-icons/excel.svg | 1 + apps/web/public/document-icons/markdown.svg | 4 + apps/web/public/document-icons/pdf.svg | 7 + apps/web/public/document-icons/powerpoint.svg | 1 + apps/web/public/document-icons/text.svg | 5 + apps/web/public/document-icons/word.svg | 12 ++ 12 files changed, 337 insertions(+), 65 deletions(-) create mode 100644 apps/web/features/libraries/library-file-icon.test.ts create mode 100644 apps/web/features/libraries/library-file-icon.tsx create mode 100644 apps/web/public/document-icons/excel.svg create mode 100644 apps/web/public/document-icons/markdown.svg create mode 100644 apps/web/public/document-icons/pdf.svg create mode 100644 apps/web/public/document-icons/powerpoint.svg create mode 100644 apps/web/public/document-icons/text.svg create mode 100644 apps/web/public/document-icons/word.svg diff --git a/apps/web/features/app-shell/app-sidebar-row.ts b/apps/web/features/app-shell/app-sidebar-row.ts index 9c7d2078..de6645b2 100644 --- a/apps/web/features/app-shell/app-sidebar-row.ts +++ b/apps/web/features/app-shell/app-sidebar-row.ts @@ -11,3 +11,11 @@ export const appSidebarIconClassName = export const appSidebarRowClassName = `flex ${appSidebarRowHeightClassName} w-full items-center justify-start gap-1.5 rounded-md border-0 px-2 text-xs font-normal text-sidebar-foreground/65 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`; export const appSidebarRowGapClassName = "gap-px"; + +export const appSidebarTreeLeadingInsetRem = 1.25; + +export const appSidebarTreeDepthInsetRem = 0.75; + +export function getAppSidebarTreePaddingInlineStart(depth: number): string { + return `${appSidebarTreeLeadingInsetRem + depth * appSidebarTreeDepthInsetRem}rem`; +} diff --git a/apps/web/features/editor/pages/page-tree.tsx b/apps/web/features/editor/pages/page-tree.tsx index 3f5ca336..d2070fe0 100644 --- a/apps/web/features/editor/pages/page-tree.tsx +++ b/apps/web/features/editor/pages/page-tree.tsx @@ -14,6 +14,7 @@ import { useEditorSiteOptional } from "@/features/editor/editor-state"; import { appSidebarIconSlotClassName, appSidebarRowHeightClassName, + getAppSidebarTreePaddingInlineStart, } from "@/features/app-shell/app-sidebar-row"; import { api, type Id } from "@baseblocks/backend"; import { @@ -273,7 +274,7 @@ function PageTreeRow({ asChild isActive={selectedPageId === page._id} style={{ - paddingInlineStart: `calc(var(--app-sidebar-leading-inset) + ${item.depth * 0.75}rem)`, + paddingInlineStart: getAppSidebarTreePaddingInlineStart(item.depth), }} className={cn( "flex min-w-0 gap-1.5 overflow-hidden rounded-md p-0 text-xs font-normal transition-colors data-[active=true]:font-medium", diff --git a/apps/web/features/libraries/library-explorer.tsx b/apps/web/features/libraries/library-explorer.tsx index 927c12cd..b2817bd6 100644 --- a/apps/web/features/libraries/library-explorer.tsx +++ b/apps/web/features/libraries/library-explorer.tsx @@ -407,6 +407,7 @@ export function LibraryExplorer({ canManage={canManage} currentFolderId={currentFolderId} nodes={model.nodes} + selectedEntityId={openFileId ?? currentFolderId} onCreateFolder={createFolder} onDeleteEntity={deleteEntity} onDownloadFile={(entity) => { diff --git a/apps/web/features/libraries/library-file-icon.test.ts b/apps/web/features/libraries/library-file-icon.test.ts new file mode 100644 index 00000000..2030c2a9 --- /dev/null +++ b/apps/web/features/libraries/library-file-icon.test.ts @@ -0,0 +1,34 @@ +import { describe, expect, test } from "bun:test"; +import { getLibraryFileIconKind } from "./library-file-icon"; + +describe("getLibraryFileIconKind", () => { + test.each([ + ["report.pdf", "application/octet-stream", "pdf"], + [ + "slides.pptx", + "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "presentation", + ], + [ + "data.xlsx", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "spreadsheet", + ], + [ + "notes.docx", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "document", + ], + ["readme.md", "text/markdown; charset=utf-8", "markdown"], + ["data.csv", "text/csv", "csv"], + ["photo.png", "image/png", "image"], + ["clip.mp4", "video/mp4", "video"], + ["song.mp3", "audio/mpeg", "audio"], + ["source.ts", "text/plain", "code"], + ["bundle.zip", "application/zip", "archive"], + ["notes.txt", "text/plain", "text"], + ["unknown.bin", "application/octet-stream", "file"], + ] as const)("maps %s to %s", (filename, contentType, expected) => { + expect(getLibraryFileIconKind(filename, contentType)).toBe(expected); + }); +}); diff --git a/apps/web/features/libraries/library-file-icon.tsx b/apps/web/features/libraries/library-file-icon.tsx new file mode 100644 index 00000000..9fd01da4 --- /dev/null +++ b/apps/web/features/libraries/library-file-icon.tsx @@ -0,0 +1,158 @@ +import { HugeiconsIcon } from "@hugeicons/react"; +import { + Csv01Icon, + File01Icon, + FileArchiveIcon, + FileAudioIcon, + FileCodeIcon, + FileImageIcon, + FileVideoIcon, +} from "@hugeicons/core-free-icons"; +import { cn } from "@baseblocks/ui/lib/utils"; +import Image from "next/image"; + +export type LibraryFileIconKind = + | "archive" + | "audio" + | "code" + | "csv" + | "document" + | "file" + | "image" + | "markdown" + | "pdf" + | "presentation" + | "spreadsheet" + | "text" + | "video"; + +const extensionPattern = /\.([^.]+)$/; + +export function getLibraryFileIconKind( + filename: string, + contentType: string, +): LibraryFileIconKind { + const normalizedType = contentType.toLowerCase().split(";", 1)[0] ?? ""; + const extension = filename.toLowerCase().match(extensionPattern)?.[1] ?? ""; + + if (normalizedType === "application/pdf" || extension === "pdf") return "pdf"; + if ( + normalizedType.includes("presentation") || + normalizedType === "application/vnd.ms-powerpoint" || + ["ppt", "pptx"].includes(extension) + ) { + return "presentation"; + } + if ( + normalizedType.includes("spreadsheet") || + normalizedType === "application/vnd.ms-excel" || + ["xls", "xlsx"].includes(extension) + ) { + return "spreadsheet"; + } + if ( + normalizedType.includes("wordprocessingml") || + normalizedType === "application/msword" || + ["doc", "docx"].includes(extension) + ) { + return "document"; + } + if ( + normalizedType === "text/markdown" || + ["md", "mdx", "markdown"].includes(extension) + ) { + return "markdown"; + } + if (normalizedType === "text/csv" || extension === "csv") return "csv"; + if (normalizedType.startsWith("image/")) return "image"; + if (normalizedType.startsWith("video/")) return "video"; + if (normalizedType.startsWith("audio/")) return "audio"; + if ( + [ + "application/zip", + "application/x-7z-compressed", + "application/x-rar-compressed", + "application/gzip", + ].includes(normalizedType) || + ["zip", "7z", "rar", "gz", "tar"].includes(extension) + ) { + return "archive"; + } + if ( + ["application/json", "application/javascript", "application/xml"].includes( + normalizedType, + ) || + [ + "css", + "html", + "js", + "jsx", + "json", + "sql", + "ts", + "tsx", + "xml", + "yaml", + "yml", + ].includes(extension) + ) { + return "code"; + } + if (normalizedType.startsWith("text/") || extension === "txt") return "text"; + return "file"; +} + +const documentIconSource: Partial> = { + document: "/document-icons/word.svg", + markdown: "/document-icons/markdown.svg", + pdf: "/document-icons/pdf.svg", + presentation: "/document-icons/powerpoint.svg", + spreadsheet: "/document-icons/excel.svg", + text: "/document-icons/text.svg", +}; + +const fallbackIcon = { + archive: FileArchiveIcon, + audio: FileAudioIcon, + code: FileCodeIcon, + csv: Csv01Icon, + file: File01Icon, + image: FileImageIcon, + video: FileVideoIcon, +} as const; + +export function LibraryFileIcon({ + className, + contentType, + filename, +}: { + className?: string; + contentType: string; + filename: string; +}) { + const kind = getLibraryFileIconKind(filename, contentType); + const source = documentIconSource[kind]; + + if (source) { + return ( + + ); + } + + return ( + + ); +} diff --git a/apps/web/features/libraries/library-tree.tsx b/apps/web/features/libraries/library-tree.tsx index 6b8bb63f..1cf6ad5b 100644 --- a/apps/web/features/libraries/library-tree.tsx +++ b/apps/web/features/libraries/library-tree.tsx @@ -2,18 +2,22 @@ import { HugeiconsIcon } from "@hugeicons/react"; import { - ArrowDown01Icon, ArrowRight01Icon, Delete01Icon, Download01Icon, DragDropVerticalIcon, - File01Icon, Folder01Icon, FolderAddIcon, Link01Icon, PencilEdit01Icon, Upload01Icon, } from "@hugeicons/core-free-icons"; +import { + appSidebarIconSlotClassName, + appSidebarRowGapClassName, + appSidebarRowHeightClassName, + getAppSidebarTreePaddingInlineStart, +} from "@/features/app-shell/app-sidebar-row"; import type { FolderId, LibraryEntity } from "@/features/libraries/model"; import { InlineRename } from "@/components/tree/inline-rename"; import { MiddleTruncate } from "@/components/tree/middle-truncate"; @@ -47,6 +51,7 @@ import { } from "@dnd-kit/react"; import { useState } from "react"; import { toast } from "sonner"; +import { LibraryFileIcon } from "./library-file-icon"; type LibraryDropData = { kind: "library-tree-drop"; @@ -92,6 +97,7 @@ export function LibraryTree(props: { }) => Promise; onRenameEntity: (entity: LibraryEntity, name: string) => Promise; onUploadFiles: () => void; + selectedEntityId: string | null; title?: string; uploadDisabled?: boolean; }) { @@ -182,7 +188,13 @@ export function LibraryTree(props: { ) : null} -
+
0 && "flex", + appSidebarRowGapClassName, + )} + > {rows.length > 0 ? ( rows.map((node) => ( setExpanded((current) => { const next = new Set(current); @@ -249,6 +262,7 @@ function LibraryTreeRow({ dragDisabled, dropDisabled, renaming, + selected, onToggle, onOpen, onRename, @@ -266,6 +280,7 @@ function LibraryTreeRow({ dragDisabled: boolean; dropDisabled: boolean; renaming: boolean; + selected: boolean; onToggle: () => void; onOpen: () => void; onRename: () => void; @@ -282,68 +297,93 @@ function LibraryTreeRow({ data: { kind: "library-tree-entity", entityId: node.id }, }); return ( - - -
{ - ref(element); - handleRef(element); - }} - role="treeitem" - tabIndex={0} - aria-level={node.depth + 1} - aria-expanded={folder ? expanded : undefined} - className={cn( - "group relative flex h-8 items-center gap-1 rounded-md px-1 hover:bg-accent", - isDragging && "opacity-30", - )} - style={{ paddingLeft: node.depth * 16 + 4 }} - > - - {folder ? ( - - ) : ( - - )} - {folder ? ( - - ) : ( - - )} - {renaming ? ( - +
event.stopPropagation()} + > + +
{ + ref(element); + handleRef(element); + }} + role="treeitem" + tabIndex={0} + aria-level={node.depth + 1} + aria-expanded={folder ? expanded : undefined} + aria-selected={selected} + data-selected={selected} + className={cn( + "group/library relative flex min-w-0 items-center gap-1.5 rounded-md pe-2 text-xs font-normal text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[selected=true]:bg-accent data-[selected=true]:font-medium data-[selected=true]:text-foreground", + appSidebarRowHeightClassName, + isDragging && "opacity-30", + )} + style={{ + paddingInlineStart: getAppSidebarTreePaddingInlineStart( + node.depth, + ), + }} + > + - ) : ( - - )} -
-
+ + {folder ? ( + <> + + + + ) : node.data.kind === "file" ? ( + + ) : null} + + {renaming ? ( + + ) : ( + + )} +
+ +
{!folder ? ( <> diff --git a/apps/web/public/document-icons/excel.svg b/apps/web/public/document-icons/excel.svg new file mode 100644 index 00000000..db246517 --- /dev/null +++ b/apps/web/public/document-icons/excel.svg @@ -0,0 +1 @@ + diff --git a/apps/web/public/document-icons/markdown.svg b/apps/web/public/document-icons/markdown.svg new file mode 100644 index 00000000..6328262a --- /dev/null +++ b/apps/web/public/document-icons/markdown.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/web/public/document-icons/pdf.svg b/apps/web/public/document-icons/pdf.svg new file mode 100644 index 00000000..a37d36b5 --- /dev/null +++ b/apps/web/public/document-icons/pdf.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/apps/web/public/document-icons/powerpoint.svg b/apps/web/public/document-icons/powerpoint.svg new file mode 100644 index 00000000..4b2cef96 --- /dev/null +++ b/apps/web/public/document-icons/powerpoint.svg @@ -0,0 +1 @@ + diff --git a/apps/web/public/document-icons/text.svg b/apps/web/public/document-icons/text.svg new file mode 100644 index 00000000..5d5c9f79 --- /dev/null +++ b/apps/web/public/document-icons/text.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/apps/web/public/document-icons/word.svg b/apps/web/public/document-icons/word.svg new file mode 100644 index 00000000..26677257 --- /dev/null +++ b/apps/web/public/document-icons/word.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + From 2189ee1bf7e1ca5c1bbeb27f39a42f73c5b16309 Mon Sep 17 00:00:00 2001 From: naaiyy Date: Fri, 14 Aug 2026 22:50:30 +0200 Subject: [PATCH 2/2] chore: use OpenEditor 0.0.48 --- apps/web/package.json | 14 ++--- bun.lock | 59 ++++++++++------------ package.json | 5 +- packages/backend/package.json | 6 +-- packages/custom-blocks/package.json | 4 +- packages/openeditor-contracts/package.json | 10 ++-- patches/@openeditor%2Freact@0.0.47.patch | 33 ------------ 7 files changed, 46 insertions(+), 85 deletions(-) delete mode 100644 patches/@openeditor%2Freact@0.0.47.patch diff --git a/apps/web/package.json b/apps/web/package.json index a4a9ffef..8d9cf1a9 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -29,13 +29,13 @@ "@flags-sdk/vercel": "^1.4.6", "@hugeicons/core-free-icons": "^4.2.3", "@hugeicons/react": "^1.1.9", - "@openeditor/workspace": "0.0.47", - "@openeditor/core": "0.0.47", - "@openeditor/custom-block": "0.0.47", - "@openeditor/emoji": "0.0.47", - "@openeditor/exporters": "0.0.47", - "@openeditor/react": "0.0.47", - "@openeditor/ui": "0.0.47", + "@openeditor/workspace": "0.0.48", + "@openeditor/core": "0.0.48", + "@openeditor/custom-block": "0.0.48", + "@openeditor/emoji": "0.0.48", + "@openeditor/exporters": "0.0.48", + "@openeditor/react": "0.0.48", + "@openeditor/ui": "0.0.48", "@vercel/analytics": "^2.0.1", "@vercel/sdk": "^1.28.8", "ai": "7.0.49", diff --git a/bun.lock b/bun.lock index f367ed72..7c423c2d 100644 --- a/bun.lock +++ b/bun.lock @@ -33,13 +33,13 @@ "@flags-sdk/vercel": "^1.4.6", "@hugeicons/core-free-icons": "^4.2.3", "@hugeicons/react": "^1.1.9", - "@openeditor/core": "0.0.47", - "@openeditor/custom-block": "0.0.47", - "@openeditor/emoji": "0.0.47", - "@openeditor/exporters": "0.0.47", - "@openeditor/react": "0.0.47", - "@openeditor/ui": "0.0.47", - "@openeditor/workspace": "0.0.47", + "@openeditor/core": "0.0.48", + "@openeditor/custom-block": "0.0.48", + "@openeditor/emoji": "0.0.48", + "@openeditor/exporters": "0.0.48", + "@openeditor/react": "0.0.48", + "@openeditor/ui": "0.0.48", + "@openeditor/workspace": "0.0.48", "@vercel/analytics": "^2.0.1", "@vercel/sdk": "^1.28.8", "ai": "7.0.49", @@ -90,9 +90,9 @@ "@convex-dev/workflow": "^0.4.4", "@convex-dev/workpool": "^0.4.9", "@noble/hashes": "2.0.1", - "@openeditor/core": "0.0.47", - "@openeditor/custom-block": "0.0.47", - "@openeditor/workspace": "0.0.47", + "@openeditor/core": "0.0.48", + "@openeditor/custom-block": "0.0.48", + "@openeditor/workspace": "0.0.48", "@polar-sh/sdk": "0.49.0", "ai": "7.0.49", "better-auth": "^1.6.23", @@ -117,8 +117,8 @@ "@dnd-kit/react": "^0.5.0", "@hugeicons/core-free-icons": "^4.2.3", "@hugeicons/react": "^1.1.9", - "@openeditor/core": "0.0.47", - "@openeditor/custom-block": "0.0.47", + "@openeditor/core": "0.0.48", + "@openeditor/custom-block": "0.0.48", "react": "19.2.7", }, "devDependencies": { @@ -151,11 +151,11 @@ "dependencies": { "@baseblocks/custom-blocks": "workspace:*", "@baseblocks/domain": "workspace:*", - "@openeditor/core": "0.0.47", - "@openeditor/custom-block": "0.0.47", - "@openeditor/embedded-runtime": "0.0.47", - "@openeditor/extensions": "0.0.47", - "@openeditor/tiptap": "0.0.47", + "@openeditor/core": "0.0.48", + "@openeditor/custom-block": "0.0.48", + "@openeditor/embedded-runtime": "0.0.48", + "@openeditor/extensions": "0.0.48", + "@openeditor/tiptap": "0.0.48", }, "devDependencies": { "@baseblocks/tsconfig": "workspace:*", @@ -212,9 +212,6 @@ }, }, }, - "patchedDependencies": { - "@openeditor/react@0.0.47": "patches/@openeditor%2Freact@0.0.47.patch", - }, "overrides": { "@convex-dev/better-auth": "0.12.5", "@radix-ui/react-presence": "1.1.6", @@ -657,27 +654,27 @@ "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], - "@openeditor/core": ["@openeditor/core@0.0.47", "", {}, "sha512-TnrJB5VpvsRz1wbUHI9cYL2sjsYaqOnFWG6zxtorNyyuPEvEa4FaG8fdVwGBG9eE0s5lcZiyjDQeFyNaRUsZLw=="], + "@openeditor/core": ["@openeditor/core@0.0.48", "", {}, "sha512-ptFsBbDdgFbzowBgu+mmK8Hw+Ua7Uu2iXspV0debpFBN0JzQsGJYaOiHiinP2EWjnorvRs0PmgXvttVg1QThHw=="], - "@openeditor/custom-block": ["@openeditor/custom-block@0.0.47", "", { "dependencies": { "@openeditor/core": "0.0.47", "@openeditor/extensions": "0.0.47" }, "peerDependencies": { "@tiptap/core": ">=3.29.2", "@tiptap/react": ">=3.29.2", "react": ">=19" }, "optionalPeers": ["@tiptap/core", "@tiptap/react"] }, "sha512-/mbmu8jHbEgwizdEjj0DWT2m86A+7DuqdghyoEsk6gSuDoOu4MGqyI6xct8wql4/hCpmJz0ZV2dw/viWV+CfwA=="], + "@openeditor/custom-block": ["@openeditor/custom-block@0.0.48", "", { "dependencies": { "@openeditor/core": "0.0.48", "@openeditor/extensions": "0.0.48" }, "peerDependencies": { "@tiptap/core": ">=3.29.2", "@tiptap/react": ">=3.29.2", "react": ">=19" }, "optionalPeers": ["@tiptap/core", "@tiptap/react"] }, "sha512-5TOybu1GHYWnv88ngFONAg8IXQx8NJz544fHvXZpKo2SPgXxY4QBv+JVUuVwZjpqpZXrHgCzS8IChEEloBqC2A=="], - "@openeditor/embedded-runtime": ["@openeditor/embedded-runtime@0.0.47", "", { "dependencies": { "@openeditor/core": "0.0.47", "@openeditor/custom-block": "0.0.47", "@openeditor/extensions": "0.0.47", "@openeditor/tiptap": "0.0.47", "@tiptap/core": "3.29.2", "@tiptap/extension-image": "3.29.2", "@tiptap/extension-link": "3.29.2", "@tiptap/extension-table": "3.29.2", "@tiptap/extension-task-item": "3.29.2", "@tiptap/extension-task-list": "3.29.2", "@tiptap/extension-text-align": "3.29.2", "@tiptap/extension-underline": "3.29.2", "@tiptap/extension-unique-id": "3.29.2", "@tiptap/pm": "3.29.2", "@tiptap/starter-kit": "3.29.2" } }, "sha512-iYQq8DU6LW28r75T9wNyofZSJjErT1vujuSRC+IljX7rToovc4te2cDykEOvmemIaBjWx777yzcv9DvzY7cVhg=="], + "@openeditor/embedded-runtime": ["@openeditor/embedded-runtime@0.0.48", "", { "dependencies": { "@openeditor/core": "0.0.48", "@openeditor/custom-block": "0.0.48", "@openeditor/extensions": "0.0.48", "@openeditor/tiptap": "0.0.48", "@tiptap/core": "3.29.2", "@tiptap/extension-image": "3.29.2", "@tiptap/extension-link": "3.29.2", "@tiptap/extension-table": "3.29.2", "@tiptap/extension-task-item": "3.29.2", "@tiptap/extension-task-list": "3.29.2", "@tiptap/extension-text-align": "3.29.2", "@tiptap/extension-underline": "3.29.2", "@tiptap/extension-unique-id": "3.29.2", "@tiptap/pm": "3.29.2", "@tiptap/starter-kit": "3.29.2" } }, "sha512-BeAhjn25JMUw/DfWh+sm02NE4oV0+tjhi0sxYJS0SC084p1P+HKPYqtPlQUXlLCIkODoKmthzmuokb5yHcfANw=="], - "@openeditor/emoji": ["@openeditor/emoji@0.0.47", "", { "dependencies": { "@base-ui/react": "^1.6.0", "emojibase-data": "16.0.2", "frimousse": "0.3.0" }, "peerDependencies": { "react": ">=19" } }, "sha512-Ygly0O4CwmEbtyD8AtNCw4/h03nFb0Jr0VO87VCmG1Q8NXrtEMPS+fCPLVIMKOedLmJsj5bgiVllRAq/xKLLmg=="], + "@openeditor/emoji": ["@openeditor/emoji@0.0.48", "", { "dependencies": { "@base-ui/react": "^1.6.0", "emojibase-data": "16.0.2", "frimousse": "0.3.0" }, "peerDependencies": { "react": ">=19" } }, "sha512-GOcxDh0kIOsK8eSwylEHGeWk4wJmKE8BKKVp3z5ioqOEc5M7wXGW5Onhhs78dwz2Ddu6oTNGZ3NUAErGlSdhqg=="], - "@openeditor/exporters": ["@openeditor/exporters@0.0.47", "", { "dependencies": { "@openeditor/core": "0.0.47", "@openeditor/custom-block": "0.0.47", "docx": "^9.7.1", "jszip": "^3.10.1", "parse5": "^7.3.0" } }, "sha512-ctiOAluVmYr0lDU/dQDsmOO63EojhLHeg3Fi/E8J9Pt5qPmOyIY07Kz+liuUFzoE8S93HYdQYmLca+y9BmpgMA=="], + "@openeditor/exporters": ["@openeditor/exporters@0.0.48", "", { "dependencies": { "@openeditor/core": "0.0.48", "@openeditor/custom-block": "0.0.48", "docx": "^9.7.1", "jszip": "^3.10.1", "parse5": "^7.3.0" } }, "sha512-4rG50+P+3ccD/S8MRgW4XaL08JhtkLzQnEVmaVkKacdPNWF4li+ttS1WloD6feQTkIyZT5Iq0uQXwHcPIDeEgA=="], - "@openeditor/extensions": ["@openeditor/extensions@0.0.47", "", { "dependencies": { "@openeditor/core": "0.0.47" } }, "sha512-fOeA1Ko55yIZ11SEn5mlORNr9qqMwTyy9xpY+xRFcrW6hxI9DOWU+Or62qEd9zZmkXWFgsheZsWZs1G9+kGGbA=="], + "@openeditor/extensions": ["@openeditor/extensions@0.0.48", "", { "dependencies": { "@openeditor/core": "0.0.48" } }, "sha512-jCJoY5dd1h2qL5ZtAtqESV5kH6tl9GH/4zdt+p+bOXkn3HhI4GfxgzO14iQ2MWTneWSGTEnNX7q4F/wHcHeUkg=="], - "@openeditor/icons": ["@openeditor/icons@0.0.47", "", { "dependencies": { "@hugeicons/core-free-icons": "^4.2.3" } }, "sha512-NSimCfQaBPKkuKvXd/1rhpmUarb7VR/Rtush8YPbXZ0nnbkjzR2gsryK3a7mb6LRfJ0skNHofeGDagpcnL23Aw=="], + "@openeditor/icons": ["@openeditor/icons@0.0.48", "", { "dependencies": { "@hugeicons/core-free-icons": "^4.2.3" } }, "sha512-WdmFEW4SW17loRjtavychU7IbSyBYpBojGHHF5p8VVxz3q+961b2t6GLMj1caQR7qbtt4Yn7fgjrN1YwaY5nQg=="], - "@openeditor/react": ["@openeditor/react@0.0.47", "", { "dependencies": { "@floating-ui/dom": "^1.7.4", "@hugeicons/react": "^1.1.9", "@openeditor/core": "0.0.47", "@openeditor/custom-block": "0.0.47", "@openeditor/embedded-runtime": "0.0.47", "@openeditor/emoji": "0.0.47", "@openeditor/exporters": "0.0.47", "@openeditor/extensions": "0.0.47", "@openeditor/icons": "0.0.47", "@openeditor/tiptap": "0.0.47", "@tiptap/core": "3.29.2", "@tiptap/extension-link": "3.29.2", "@tiptap/extension-placeholder": "3.29.2", "@tiptap/extension-table": "3.29.2", "@tiptap/extension-task-item": "3.29.2", "@tiptap/extension-task-list": "3.29.2", "@tiptap/extension-underline": "3.29.2", "@tiptap/pm": "3.29.2", "@tiptap/react": "3.29.2", "@tiptap/starter-kit": "3.29.2", "@tiptap/suggestion": "3.29.2", "beautiful-mermaid": "1.1.3", "use-sync-external-store": "1.6.0" }, "peerDependencies": { "react": ">=19", "react-dom": ">=19" } }, "sha512-KbKRrztbZIMfpzn/dPIUxubJ7hRw3WWzlNIiCmolBxVrZ9gHBFzgmfgTqAET1dQ10zB3qAI+/IcqDOQyuKFl2Q=="], + "@openeditor/react": ["@openeditor/react@0.0.48", "", { "dependencies": { "@floating-ui/dom": "^1.7.4", "@hugeicons/react": "^1.1.9", "@openeditor/core": "0.0.48", "@openeditor/custom-block": "0.0.48", "@openeditor/embedded-runtime": "0.0.48", "@openeditor/emoji": "0.0.48", "@openeditor/exporters": "0.0.48", "@openeditor/extensions": "0.0.48", "@openeditor/icons": "0.0.48", "@openeditor/tiptap": "0.0.48", "@tiptap/core": "3.29.2", "@tiptap/extension-link": "3.29.2", "@tiptap/extension-placeholder": "3.29.2", "@tiptap/extension-table": "3.29.2", "@tiptap/extension-task-item": "3.29.2", "@tiptap/extension-task-list": "3.29.2", "@tiptap/extension-underline": "3.29.2", "@tiptap/pm": "3.29.2", "@tiptap/react": "3.29.2", "@tiptap/starter-kit": "3.29.2", "@tiptap/suggestion": "3.29.2", "beautiful-mermaid": "1.1.3", "use-sync-external-store": "1.6.0" }, "peerDependencies": { "react": ">=19", "react-dom": ">=19" } }, "sha512-mdtE1/IqVwP+zq0UQTnFz/6IWyRi3F1gLrOnK6EXTm7YV7uoFZCIBdoKAaBg2rB2hwAAH6aHOFCpm0M1QduD7A=="], - "@openeditor/tiptap": ["@openeditor/tiptap@0.0.47", "", { "dependencies": { "@openeditor/core": "0.0.47", "@tiptap/core": "3.29.2", "@tiptap/pm": "3.29.2" } }, "sha512-6QFFzPYq/JW8IQ3BA2Ppom+otAYNa/7b0puiNdiUxfjpy2YtXRVKFCPkgsdurj1h2Xhl+IrB+FxeEOAW7AjqnQ=="], + "@openeditor/tiptap": ["@openeditor/tiptap@0.0.48", "", { "dependencies": { "@openeditor/core": "0.0.48", "@tiptap/core": "3.29.2", "@tiptap/pm": "3.29.2" } }, "sha512-lkIb1JktHaq/1VXJbaFwY6A3K+v5dW3YTNMiF85LdnBM+ZhR26BKHmYKzDtcegBEOktBzUln1iGZkXNPAcE9xQ=="], - "@openeditor/ui": ["@openeditor/ui@0.0.47", "", { "dependencies": { "@base-ui/react": "^1.6.0", "@hugeicons/react": "^1.1.9", "@openeditor/emoji": "0.0.47", "@openeditor/icons": "0.0.47", "@openeditor/react": "0.0.47" }, "peerDependencies": { "react": ">=19", "react-dom": ">=19" } }, "sha512-mU4pN0S0hOpeJaFCkLAj4KWSdnJXFF+SYO/BXbR7k1qJZCNNEJrrPWNYOjSc1XyyTwtPsam2l6gZtvCWHn46lw=="], + "@openeditor/ui": ["@openeditor/ui@0.0.48", "", { "dependencies": { "@base-ui/react": "^1.6.0", "@hugeicons/react": "^1.1.9", "@openeditor/emoji": "0.0.48", "@openeditor/icons": "0.0.48", "@openeditor/react": "0.0.48" }, "peerDependencies": { "react": ">=19", "react-dom": ">=19" } }, "sha512-n2d/66s7UDP5Xym37nEO9gYDYkkaTDqEI8nuAyu9gsi04UtI27XFqdDlz4w0EvYpiHIEA3z0JR6YresM+xwaJQ=="], - "@openeditor/workspace": ["@openeditor/workspace@0.0.47", "", { "dependencies": { "@openeditor/core": "0.0.47" } }, "sha512-L3kpuwGMdZv+OuTS1XobeG5l1f+hslaWHBJ09sOtJafuOnaLbddgQMFt7Ixuh6tkS8l0NNUTQvPfoMSKTvrIZA=="], + "@openeditor/workspace": ["@openeditor/workspace@0.0.48", "", { "dependencies": { "@openeditor/core": "0.0.48" } }, "sha512-RIDX5RJrpI5ZugPnEUQjiT/9RjiJYIL4O9Q/pNDjTvcOU8eQpRSOG7Nzgx6gqabbS9icAvwBgNTtHvIpYevWCg=="], "@opentelemetry/api": ["@opentelemetry/api@1.9.1", "", {}, "sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q=="], diff --git a/package.json b/package.json index 4ebb2fe6..2d99c655 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,5 @@ "apps/*", "packages/*", "tooling/*" - ], - "patchedDependencies": { - "@openeditor/react@0.0.47": "patches/@openeditor%2Freact@0.0.47.patch" - } + ] } diff --git a/packages/backend/package.json b/packages/backend/package.json index 35cfc824..fe404f7f 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -41,9 +41,9 @@ "@convex-dev/workflow": "^0.4.4", "@convex-dev/workpool": "^0.4.9", "@noble/hashes": "2.0.1", - "@openeditor/core": "0.0.47", - "@openeditor/custom-block": "0.0.47", - "@openeditor/workspace": "0.0.47", + "@openeditor/core": "0.0.48", + "@openeditor/custom-block": "0.0.48", + "@openeditor/workspace": "0.0.48", "@polar-sh/sdk": "0.49.0", "ai": "7.0.49", "better-auth": "^1.6.23", diff --git a/packages/custom-blocks/package.json b/packages/custom-blocks/package.json index 69d18402..870e12b9 100644 --- a/packages/custom-blocks/package.json +++ b/packages/custom-blocks/package.json @@ -22,8 +22,8 @@ "@dnd-kit/react": "^0.5.0", "@hugeicons/core-free-icons": "^4.2.3", "@hugeicons/react": "^1.1.9", - "@openeditor/custom-block": "0.0.47", - "@openeditor/core": "0.0.47", + "@openeditor/custom-block": "0.0.48", + "@openeditor/core": "0.0.48", "react": "19.2.7" }, "devDependencies": { diff --git a/packages/openeditor-contracts/package.json b/packages/openeditor-contracts/package.json index 7c76bfb4..d33c2bd3 100644 --- a/packages/openeditor-contracts/package.json +++ b/packages/openeditor-contracts/package.json @@ -18,11 +18,11 @@ "dependencies": { "@baseblocks/custom-blocks": "workspace:*", "@baseblocks/domain": "workspace:*", - "@openeditor/core": "0.0.47", - "@openeditor/custom-block": "0.0.47", - "@openeditor/embedded-runtime": "0.0.47", - "@openeditor/extensions": "0.0.47", - "@openeditor/tiptap": "0.0.47" + "@openeditor/core": "0.0.48", + "@openeditor/custom-block": "0.0.48", + "@openeditor/embedded-runtime": "0.0.48", + "@openeditor/extensions": "0.0.48", + "@openeditor/tiptap": "0.0.48" }, "devDependencies": { "@baseblocks/tsconfig": "workspace:*", diff --git a/patches/@openeditor%2Freact@0.0.47.patch b/patches/@openeditor%2Freact@0.0.47.patch deleted file mode 100644 index cc89349c..00000000 --- a/patches/@openeditor%2Freact@0.0.47.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/dist/index.d.ts b/dist/index.d.ts -index 7eec8927755a5ed9d91e581ef38b0aecd46e8845..efb39192f1fbe050853a93f7757f3ce4ba9d79cf 100644 ---- a/dist/index.d.ts -+++ b/dist/index.d.ts -@@ -272,6 +272,8 @@ type OpenEditorReactProps = OpenEditorAuthoringCapabilities & { - registry: OpenEditorCustomBlockRegistry; - editors: readonly OpenEditorCustomBlockEditorAdapter[]; - host: OpenEditorCustomBlockEditorHost; -+ icons?: Readonly>; -+ blockMenuExtensions?: readonly OpenEditorBlockMenuExtension[]; - }; - }; - type OpenEditorReactConfig = OpenEditorReactProps; -diff --git a/dist/index.js b/dist/index.js -index aeefe880b3d38ececcca8a4e251cc6bf39298d93..a8dfc2ccf8e9657a476acf89cc17ecde13db47f1 100644 ---- a/dist/index.js -+++ b/dist/index.js -@@ -2618,6 +2618,6 @@ var useOpenEditorController = ({ - const resolver = createOpenEditorBlockMenuResolver({ - target: createOpenEditorBlockTarget(() => currentEditorRef.current, ref), -- getExtensions: () => [] -+ getExtensions: () => customBlocks?.blockMenuExtensions ?? [] - }); - blockMenuResolversRef.current.set(key, resolver); - return resolver; -@@ -2696,6 +2696,7 @@ var useOpenEditorController = ({ - key: definition.id, - label: definition.label, - group: "embed", -+ icon: customBlocks.icons?.[definition.id], - order: 1e4 + index, - execute: ({ range }) => Boolean(editor?.chain().focus().deleteRange(range).insertContent(createOpenEditorCustomBlockNode(customBlocks.registry, definition.id)).run()) - })) ?? [],