Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/code-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
"test-watch": "vitest watch"
},
"dependencies": {
"@blocknote/core": "0.51.3",
"@shikijs/core": "^4",
"@shikijs/engine-javascript": "^4",
"@shikijs/langs-precompiled": "^4",
"@shikijs/themes": "^4",
"@shikijs/types": "^4"
"@shikijs/themes": "^4"
},
"devDependencies": {
"@blocknote/core": "0.51.3",
Comment thread
nperez0111 marked this conversation as resolved.
Outdated
"@shikijs/types": "^4",
Comment thread
nperez0111 marked this conversation as resolved.
Outdated
"eslint": "^8.57.1",
"rollup-plugin-webpack-stats": "^0.2.6",
"typescript": "^5.9.3",
Expand Down
3 changes: 0 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,14 @@
"@tiptap/core": "^3.13.0",
"@tiptap/extension-bold": "^3.13.0",
"@tiptap/extension-code": "^3.13.0",
"@tiptap/extension-horizontal-rule": "^3.13.0",
"@tiptap/extension-italic": "^3.13.0",
"@tiptap/extension-paragraph": "^3.13.0",
"@tiptap/extension-strike": "^3.13.0",
"@tiptap/extension-text": "^3.13.0",
"@tiptap/extension-underline": "^3.13.0",
"@tiptap/extensions": "^3.13.0",
"@tiptap/pm": "^3.13.0",
"emoji-mart": "^5.6.0",
"fast-deep-equal": "^3.1.3",
"lib0": "^0.2.99",
"prosemirror-highlight": "^0.15.1",
"prosemirror-model": "^1.25.4",
"prosemirror-state": "^1.4.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { CommentBody } from "../../types.js";
import { DefaultThreadStoreAuth } from "../DefaultThreadStoreAuth.js";
import { YjsThreadStore } from "./YjsThreadStore.js";

// Mock UUID to generate sequential IDs
// Mock crypto.randomUUID to generate sequential IDs
let mockUuidCounter = 0;
vi.mock("lib0/random", async (importOriginal) => ({
...(await importOriginal<typeof import("lib0/random")>()),
uuidv4: () => `mocked-uuid-${++mockUuidCounter}`,
}));
const originalRandomUUID = crypto.randomUUID.bind(crypto);
vi.spyOn(crypto, "randomUUID").mockImplementation(
() => `mocked-uuid-${++mockUuidCounter}` as ReturnType<typeof originalRandomUUID>,
);
Comment thread
coderabbitai[bot] marked this conversation as resolved.

describe("YjsThreadStore", () => {
let store: YjsThreadStore;
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/comments/threadstore/yjs/YjsThreadStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uuidv4 } from "lib0/random";

Comment thread
nperez0111 marked this conversation as resolved.
Outdated
import * as Y from "yjs";
import { CommentBody, CommentData, ThreadData } from "../../types.js";
import { ThreadStoreAuth } from "../ThreadStoreAuth.js";
Expand Down Expand Up @@ -57,7 +57,7 @@ export class YjsThreadStore extends YjsThreadStoreBase {

const comment: CommentData = {
type: "comment",
id: uuidv4(),
id: crypto.randomUUID(),
userId: this.userId,
createdAt: date,
updatedAt: date,
Expand All @@ -68,7 +68,7 @@ export class YjsThreadStore extends YjsThreadStoreBase {

const thread: ThreadData = {
type: "thread",
id: uuidv4(),
id: crypto.randomUUID(),
createdAt: date,
updatedAt: date,
comments: [comment],
Expand Down Expand Up @@ -105,7 +105,7 @@ export class YjsThreadStore extends YjsThreadStoreBase {
const date = new Date();
const comment: CommentData = {
type: "comment",
id: uuidv4(),
id: crypto.randomUUID(),
userId: this.userId,
createdAt: date,
updatedAt: date,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/extensions/Placeholder/Placeholder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Plugin, PluginKey } from "prosemirror-state";
import { Decoration, DecorationSet } from "prosemirror-view";
import { uuidv4 } from "lib0/random";

import {
createExtension,
ExtensionOptions,
Expand All @@ -23,7 +23,7 @@ export const PlaceholderExtension = createExtension(
new Plugin({
key: PLUGIN_KEY,
view: (view) => {
const uniqueEditorSelector = `placeholder-selector-${uuidv4()}`;
const uniqueEditorSelector = `placeholder-selector-${crypto.randomUUID()}`;
view.dom.classList.add(uniqueEditorSelector);
const styleEl = document.createElement("style");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "@tiptap/core";
import { Fragment, Slice } from "prosemirror-model";
import { Plugin, PluginKey } from "prosemirror-state";
import { uuidv4 } from "lib0/random";


/**
* Code from Tiptap UniqueID extension (https://tiptap.dev/api/extensions/unique-id)
Expand Down Expand Up @@ -65,7 +65,7 @@ const UniqueID = Extension.create({
return testOptions.mockID.toString() as string;
}

return uuidv4();
return crypto.randomUUID();
},
filterTransaction: null,
};
Expand Down
4 changes: 2 additions & 2 deletions packages/mantine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
},
"dependencies": {
"@blocknote/core": "0.51.3",
"@blocknote/react": "0.51.3",
"react-icons": "^5.5.0"
"@blocknote/react": "0.51.3"
},
"devDependencies": {
"react-icons": "^5.5.0",
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
Expand Down
10 changes: 10 additions & 0 deletions packages/mantine/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ export default defineConfig((conf) => ({
// make sure to externalize deps that shouldn't be bundled
// into your library
external: (source) => {
// Bundle react-icons into the output (tree-shaken) so consumers
// don't need to install it as a peer/runtime dependency.
const bundledDeps = ["react-icons"];
if (
bundledDeps.some(
(dep) => source === dep || source.startsWith(dep + "/")
)
) {
return false;
}
if (
Object.keys({
...pkg.dependencies,
Expand Down
9 changes: 4 additions & 5 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,18 @@
"@blocknote/core": "0.51.3",
"@emoji-mart/data": "^1.2.1",
"@floating-ui/react": "^0.27.18",
"@floating-ui/utils": "^0.2.10",
"@tanstack/react-store": "0.7.7",
"@tiptap/core": "^3.13.0",
"@tiptap/pm": "^3.13.0",
"@tiptap/react": "^3.13.0",
"@types/use-sync-external-store": "1.5.0",
"emoji-mart": "^5.6.0",
"fast-deep-equal": "^3.1.3",
"lodash.merge": "^4.6.2",
"react-icons": "^5.5.0",
"use-sync-external-store": "1.6.0"
},
"devDependencies": {
"@types/lodash.foreach": "^4.5.9",
"@types/lodash.groupby": "^4.6.9",
"@types/lodash.merge": "^4.6.9",
"react-icons": "^5.5.0",
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
Expand All @@ -91,6 +87,9 @@
"vite-plugin-externalize-deps": "^0.10.0",
"vitest": "^4.1.2"
},
"optionalDependencies": {
"@types/use-sync-external-store": "1.5.0"
},
"peerDependencies": {
"react": "^18.0 || ^19.0 || >= 19.0.0-rc",
"react-dom": "^18.0 || ^19.0 || >= 19.0.0-rc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
formatKeyboardShortcut,
} from "@blocknote/core";
import { useCallback } from "react";
import { IconType } from "react-icons";
import type { IconType } from "../../../icons.js";
import {
RiBold,
RiCodeFill,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "@blocknote/core";
import { TableHandlesExtension } from "@blocknote/core/extensions";
import { useCallback } from "react";
import { IconType } from "react-icons";
import type { IconType } from "../../../icons.js";
import {
RiAlignCenter,
RiAlignJustify,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
StyleSchema,
} from "@blocknote/core";
import { useMemo } from "react";
import type { IconType } from "react-icons";
import type { IconType } from "../../../icons.js";
import {
RiH1,
RiH2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
RiVolumeUpFill,
} from "react-icons/ri";

import { IconType } from "react-icons";
import type { IconType } from "../../icons.js";
import { DefaultReactSuggestionItem } from "./types.js";

const icons: Record<string, IconType> = {
Expand Down
12 changes: 12 additions & 0 deletions packages/react/src/icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Compatible replacement for `IconType` from react-icons.
* Defined locally so consumers don't need react-icons installed for
* type-checking.
*/
export type IconType = (
props: React.SVGAttributes<SVGElement> & {
size?: string | number;
color?: string;
title?: string;
}
) => React.ReactNode;
2 changes: 2 additions & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ export * from "./schema/ReactBlockSpec.js";
export * from "./schema/ReactInlineContentSpec.js";
export * from "./schema/ReactStyleSpec.js";

export * from "./icons.js";

export * from "./util/elementOverflow.js";
export * from "./util/mergeRefs.js";

Expand Down
10 changes: 10 additions & 0 deletions packages/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ export default defineConfig((conf) => ({
// make sure to externalize deps that shouldn't be bundled
// into your library
external: (source) => {
// Bundle react-icons into the output (tree-shaken) so consumers
// don't need to install it as a peer/runtime dependency.
const bundledDeps = ["react-icons"];
if (
bundledDeps.some(
(dep) => source === dep || source.startsWith(dep + "/")
)
) {
return false;
}
if (
Object.keys({
...pkg.dependencies,
Expand Down
9 changes: 4 additions & 5 deletions packages/server-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@
"dependencies": {
"@blocknote/core": "0.51.3",
"@blocknote/react": "0.51.3",
"@tiptap/core": "^3.13.0",
"@tiptap/pm": "^3.13.0",
"jsdom": "^25.0.1",
"y-prosemirror": "^1.3.7",
"y-protocols": "^1.0.6",
"yjs": "^13.6.27"
"jsdom": "^25.0.1"
},
"devDependencies": {
"@types/jsdom": "^21.1.7",
"y-prosemirror": "^1.3.7",
"y-protocols": "^1.0.6",
"yjs": "^13.6.27",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"eslint": "^8.57.1",
Expand Down
1 change: 0 additions & 1 deletion packages/shadcn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-toggle": "^1.1.10",
"@radix-ui/react-tooltip": "^1.2.8",
"autoprefixer": "^10.4.21",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.525.0",
Expand Down
6 changes: 1 addition & 5 deletions packages/xl-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@
"@ai-sdk/provider-utils": "^4.0.2",
"@ai-sdk/react": "^3.0.5",
"@blocknote/core": "0.51.3",
"@blocknote/mantine": "0.51.3",
"@blocknote/react": "0.51.3",
"@floating-ui/react": "^0.27.18",
"@handlewithcare/prosemirror-suggest-changes": "^0.1.8",
"@tiptap/core": "^3.13.0",
"ai": "^6.0.5",
"lodash.isequal": "^4.5.0",
"lodash.merge": "^4.6.2",
Expand All @@ -87,12 +85,10 @@
"prosemirror-tables": "^1.8.3",
"prosemirror-transform": "^1.11.0",
"prosemirror-view": "^1.41.4",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"react-icons": "^5.5.0",
"y-prosemirror": "^1.3.7"
},
"devDependencies": {
"react-icons": "^5.5.0",
"@ai-sdk/anthropic": "^3.0.2",
"@ai-sdk/google": "^3.0.2",
"@ai-sdk/groq": "^3.0.2",
Expand Down
10 changes: 10 additions & 0 deletions packages/xl-ai/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ export default defineConfig((conf) => ({
// make sure to externalize deps that shouldn't be bundled
// into your library
external: (source) => {
// Bundle react-icons into the output (tree-shaken) so consumers
// don't need to install it as a peer/runtime dependency.
const bundledDeps = ["react-icons"];
if (
bundledDeps.some(
(dep) => source === dep || source.startsWith(dep + "/")
)
) {
return false;
}
if (
Object.keys({
...pkg.dependencies,
Expand Down
8 changes: 3 additions & 5 deletions packages/xl-email-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@
},
"dependencies": {
"@blocknote/core": "0.51.3",
"@blocknote/react": "0.51.3",
"@react-email/components": "^1.0.5",
"@react-email/render": "^2.0.4",
"buffer": "^6.0.3",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"react-email": "^5.2.5",
"web-streams-polyfill": "^4.2.0"
},
"devDependencies": {
"@types/jsdom": "^21.1.7",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"react-email": "^5.2.5",
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"eslint": "^8.57.1",
Expand Down
6 changes: 2 additions & 4 deletions packages/xl-multi-column/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@
"@tiptap/core": "^3.13.0",
"prosemirror-model": "^1.25.4",
"prosemirror-state": "^1.4.4",
"prosemirror-tables": "^1.8.3",
"prosemirror-transform": "^1.11.0",
"prosemirror-view": "^1.41.4",
"react-icons": "^5.5.0"
"prosemirror-view": "^1.41.4"
},
"devDependencies": {
"react-icons": "^5.5.0",
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"eslint": "^8.57.1",
Expand Down
10 changes: 10 additions & 0 deletions packages/xl-multi-column/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ export default defineConfig((conf) => ({
// make sure to externalize deps that shouldn't be bundled
// into your library
external: (source) => {
// Bundle react-icons into the output (tree-shaken) so consumers
// don't need to install it as a peer/runtime dependency.
const bundledDeps = ["react-icons"];
if (
bundledDeps.some(
(dep) => source === dep || source.startsWith(dep + "/")
)
) {
return false;
}
if (
Object.keys({
...pkg.dependencies,
Expand Down
1 change: 0 additions & 1 deletion packages/xl-odt-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"@blocknote/core": "0.51.3",
"@blocknote/xl-multi-column": "0.51.3",
"@zip.js/zip.js": "^2.8.8",
"buffer": "^6.0.3",
"image-meta": "^0.2.2"
},
"devDependencies": {
Expand Down
Loading
Loading