diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ea4adeb96..7eb5bd74d34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## vNEXT (not yet published) +## v3.1.3 + +### `@liveblocks/react-ui` + +- Fix `AiChat` component not scrolling instantly to the bottom on render when + messages are already loaded. + ## v3.1.2 ### `@liveblocks/react-ui` and `@liveblocks/emails` diff --git a/package-lock.json b/package-lock.json index d3a8536e7c7..fc8f5663125 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37305,10 +37305,10 @@ }, "packages/liveblocks-client": { "name": "@liveblocks/client", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/core": "3.1.2" + "@liveblocks/core": "3.1.3" }, "devDependencies": { "@liveblocks/eslint-config": "*", @@ -37317,7 +37317,7 @@ }, "packages/liveblocks-core": { "name": "@liveblocks/core", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "devDependencies": { "@liveblocks/eslint-config": "*", @@ -37335,11 +37335,11 @@ }, "packages/liveblocks-emails": { "name": "@liveblocks/emails", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/core": "3.1.2", - "@liveblocks/node": "3.1.2" + "@liveblocks/core": "3.1.3", + "@liveblocks/node": "3.1.3" }, "devDependencies": { "@liveblocks/eslint-config": "*", @@ -37453,10 +37453,10 @@ }, "packages/liveblocks-node": { "name": "@liveblocks/node", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/core": "3.1.2", + "@liveblocks/core": "3.1.3", "@stablelib/base64": "^1.0.1", "fast-sha256": "^1.3.0", "node-fetch": "^2.6.1" @@ -37471,11 +37471,11 @@ }, "packages/liveblocks-node-lexical": { "name": "@liveblocks/node-lexical", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/core": "3.1.2", - "@liveblocks/node": "3.1.2", + "@liveblocks/core": "3.1.3", + "@liveblocks/node": "3.1.3", "yjs": "^13.6.18" }, "devDependencies": { @@ -37492,11 +37492,11 @@ }, "packages/liveblocks-node-prosemirror": { "name": "@liveblocks/node-prosemirror", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/core": "3.1.2", - "@liveblocks/node": "3.1.2", + "@liveblocks/core": "3.1.3", + "@liveblocks/node": "3.1.3", "yjs": "^13.6.20" }, "devDependencies": { @@ -37706,11 +37706,11 @@ }, "packages/liveblocks-react": { "name": "@liveblocks/react", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2" + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3" }, "devDependencies": { "@liveblocks/eslint-config": "*", @@ -37740,15 +37740,15 @@ }, "packages/liveblocks-react-blocknote": { "name": "@liveblocks/react-blocknote", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", - "@liveblocks/react": "3.1.2", - "@liveblocks/react-tiptap": "3.1.2", - "@liveblocks/react-ui": "3.1.2", - "@liveblocks/yjs": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", + "@liveblocks/react": "3.1.3", + "@liveblocks/react-tiptap": "3.1.3", + "@liveblocks/react-ui": "3.1.3", + "@liveblocks/yjs": "3.1.3", "@tiptap/core": "^2.7.2", "vitest-tsconfig-paths": "^3.4.1" }, @@ -37785,15 +37785,15 @@ }, "packages/liveblocks-react-lexical": { "name": "@liveblocks/react-lexical", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { "@floating-ui/react-dom": "^2.1.1", - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", - "@liveblocks/react": "3.1.2", - "@liveblocks/react-ui": "3.1.2", - "@liveblocks/yjs": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", + "@liveblocks/react": "3.1.3", + "@liveblocks/react-ui": "3.1.3", + "@liveblocks/yjs": "3.1.3", "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-toggle": "^1.1.0", "yjs": "^13.6.18" @@ -38322,15 +38322,15 @@ }, "packages/liveblocks-react-tiptap": { "name": "@liveblocks/react-tiptap", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { "@floating-ui/react-dom": "^2.1.2", - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", - "@liveblocks/react": "3.1.2", - "@liveblocks/react-ui": "3.1.2", - "@liveblocks/yjs": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", + "@liveblocks/react": "3.1.3", + "@liveblocks/react-ui": "3.1.3", + "@liveblocks/yjs": "3.1.3", "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-toggle": "^1.1.0", "@tiptap/core": "^2.7.2", @@ -38855,13 +38855,13 @@ }, "packages/liveblocks-react-ui": { "name": "@liveblocks/react-ui", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { "@floating-ui/react-dom": "^2.1.2", - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", - "@liveblocks/react": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", + "@liveblocks/react": "3.1.3", "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-popover": "^1.1.2", "@radix-ui/react-slot": "^1.1.0", @@ -40036,11 +40036,11 @@ }, "packages/liveblocks-redux": { "name": "@liveblocks/redux", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2" + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3" }, "devDependencies": { "@liveblocks/eslint-config": "*", @@ -40167,10 +40167,10 @@ }, "packages/liveblocks-yjs": { "name": "@liveblocks/yjs", - "version": "3.1.2", + "version": "3.1.3", "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", "js-base64": "^3.7.7", "y-indexeddb": "^9.0.12" }, @@ -40247,11 +40247,11 @@ }, "packages/liveblocks-zustand": { "name": "@liveblocks/zustand", - "version": "3.1.2", + "version": "3.1.3", "license": "Apache-2.0", "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2" + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3" }, "devDependencies": { "@liveblocks/eslint-config": "*", diff --git a/packages/liveblocks-client/package.json b/packages/liveblocks-client/package.json index 4680956c5b3..52410b0c435 100644 --- a/packages/liveblocks-client/package.json +++ b/packages/liveblocks-client/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/client", - "version": "3.1.2", + "version": "3.1.3", "description": "A client that lets you interact with Liveblocks servers. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", "license": "Apache-2.0", "type": "module", @@ -34,7 +34,7 @@ "test:watch": "jest --silent --verbose --color=always --passWithNoTests --watch" }, "dependencies": { - "@liveblocks/core": "3.1.2" + "@liveblocks/core": "3.1.3" }, "devDependencies": { "@liveblocks/eslint-config": "*", diff --git a/packages/liveblocks-core/package.json b/packages/liveblocks-core/package.json index 53d0a570a4f..edc51c466c1 100644 --- a/packages/liveblocks-core/package.json +++ b/packages/liveblocks-core/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/core", - "version": "3.1.2", + "version": "3.1.3", "description": "Private internals for Liveblocks. DO NOT import directly from this package!", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/liveblocks-emails/package.json b/packages/liveblocks-emails/package.json index 331fb59af94..88cb4ac4d38 100644 --- a/packages/liveblocks-emails/package.json +++ b/packages/liveblocks-emails/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/emails", - "version": "3.1.2", + "version": "3.1.3", "description": "A set of functions and utilities to make sending emails based on Liveblocks notification events easy. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", "license": "Apache-2.0", "type": "module", @@ -35,8 +35,8 @@ "test:watch": "jest --silent --verbose --color=always --watch" }, "dependencies": { - "@liveblocks/core": "3.1.2", - "@liveblocks/node": "3.1.2" + "@liveblocks/core": "3.1.3", + "@liveblocks/node": "3.1.3" }, "peerDependencies": { "react": "^18 || ^19 || ^19.0.0-rc" diff --git a/packages/liveblocks-node-lexical/package.json b/packages/liveblocks-node-lexical/package.json index 827f32c2221..fa57eaebfb8 100644 --- a/packages/liveblocks-node-lexical/package.json +++ b/packages/liveblocks-node-lexical/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/node-lexical", - "version": "3.1.2", + "version": "3.1.3", "description": "A server-side utility that lets you modify lexical documents hosted in Liveblocks.", "license": "Apache-2.0", "type": "module", @@ -34,8 +34,8 @@ "test:watch": "jest --silent --verbose --color=always --watch" }, "dependencies": { - "@liveblocks/core": "3.1.2", - "@liveblocks/node": "3.1.2", + "@liveblocks/core": "3.1.3", + "@liveblocks/node": "3.1.3", "yjs": "^13.6.18" }, "peerDependencies": { diff --git a/packages/liveblocks-node-prosemirror/package.json b/packages/liveblocks-node-prosemirror/package.json index 3ebf76b62ea..0bfc4aca0f9 100644 --- a/packages/liveblocks-node-prosemirror/package.json +++ b/packages/liveblocks-node-prosemirror/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/node-prosemirror", - "version": "3.1.2", + "version": "3.1.3", "description": "A server-side utility that lets you modify prosemirror and tiptap documents hosted in Liveblocks.", "license": "Apache-2.0", "type": "module", @@ -34,8 +34,8 @@ "test:watch": "jest --silent --verbose --color=always --watch" }, "dependencies": { - "@liveblocks/core": "3.1.2", - "@liveblocks/node": "3.1.2", + "@liveblocks/core": "3.1.3", + "@liveblocks/node": "3.1.3", "yjs": "^13.6.20" }, "peerDependencies": { diff --git a/packages/liveblocks-node/package.json b/packages/liveblocks-node/package.json index 8c4ab16bae3..47d2be9f354 100644 --- a/packages/liveblocks-node/package.json +++ b/packages/liveblocks-node/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/node", - "version": "3.1.2", + "version": "3.1.3", "description": "A server-side utility that lets you set up a Liveblocks authentication endpoint. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", "license": "Apache-2.0", "type": "module", @@ -34,7 +34,7 @@ "test:watch": "jest --silent --verbose --color=always --watch" }, "dependencies": { - "@liveblocks/core": "3.1.2", + "@liveblocks/core": "3.1.3", "@stablelib/base64": "^1.0.1", "fast-sha256": "^1.3.0", "node-fetch": "^2.6.1" diff --git a/packages/liveblocks-react-blocknote/package.json b/packages/liveblocks-react-blocknote/package.json index 9284e5c1700..7a7aac70881 100644 --- a/packages/liveblocks-react-blocknote/package.json +++ b/packages/liveblocks-react-blocknote/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/react-blocknote", - "version": "3.1.2", + "version": "3.1.3", "description": "An integration of BlockNote + React to enable collaboration, comments, live cursors, and more with Liveblocks.", "license": "Apache-2.0", "type": "module", @@ -42,12 +42,12 @@ "test:watch": "vitest" }, "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", - "@liveblocks/react": "3.1.2", - "@liveblocks/react-tiptap": "3.1.2", - "@liveblocks/react-ui": "3.1.2", - "@liveblocks/yjs": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", + "@liveblocks/react": "3.1.3", + "@liveblocks/react-tiptap": "3.1.3", + "@liveblocks/react-ui": "3.1.3", + "@liveblocks/yjs": "3.1.3", "@tiptap/core": "^2.7.2", "vitest-tsconfig-paths": "^3.4.1" }, diff --git a/packages/liveblocks-react-lexical/package.json b/packages/liveblocks-react-lexical/package.json index c39c2bab771..3abf4410610 100644 --- a/packages/liveblocks-react-lexical/package.json +++ b/packages/liveblocks-react-lexical/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/react-lexical", - "version": "3.1.2", + "version": "3.1.3", "description": "An integration of Lexical + React to enable collaboration, comments, live cursors, and more with Liveblocks.", "license": "Apache-2.0", "type": "module", @@ -43,11 +43,11 @@ }, "dependencies": { "@floating-ui/react-dom": "^2.1.1", - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", - "@liveblocks/react": "3.1.2", - "@liveblocks/react-ui": "3.1.2", - "@liveblocks/yjs": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", + "@liveblocks/react": "3.1.3", + "@liveblocks/react-ui": "3.1.3", + "@liveblocks/yjs": "3.1.3", "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-toggle": "^1.1.0", "yjs": "^13.6.18" diff --git a/packages/liveblocks-react-tiptap/package.json b/packages/liveblocks-react-tiptap/package.json index 319e96e6a94..ae8dd87cbf5 100644 --- a/packages/liveblocks-react-tiptap/package.json +++ b/packages/liveblocks-react-tiptap/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/react-tiptap", - "version": "3.1.2", + "version": "3.1.3", "description": "An integration of TipTap + React to enable collaboration, comments, live cursors, and more with Liveblocks.", "license": "Apache-2.0", "type": "module", @@ -43,11 +43,11 @@ }, "dependencies": { "@floating-ui/react-dom": "^2.1.2", - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", - "@liveblocks/react": "3.1.2", - "@liveblocks/react-ui": "3.1.2", - "@liveblocks/yjs": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", + "@liveblocks/react": "3.1.3", + "@liveblocks/react-ui": "3.1.3", + "@liveblocks/yjs": "3.1.3", "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-toggle": "^1.1.0", "@tiptap/core": "^2.7.2", diff --git a/packages/liveblocks-react-ui/package.json b/packages/liveblocks-react-ui/package.json index 9d00a17cf7d..06c9bfd4574 100644 --- a/packages/liveblocks-react-ui/package.json +++ b/packages/liveblocks-react-ui/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/react-ui", - "version": "3.1.2", + "version": "3.1.3", "description": "A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", "license": "Apache-2.0", "type": "module", @@ -76,9 +76,9 @@ }, "dependencies": { "@floating-ui/react-dom": "^2.1.2", - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", - "@liveblocks/react": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", + "@liveblocks/react": "3.1.3", "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-popover": "^1.1.2", "@radix-ui/react-slot": "^1.1.0", diff --git a/packages/liveblocks-react-ui/src/components/AiChat.tsx b/packages/liveblocks-react-ui/src/components/AiChat.tsx index 12db8aab93f..a4f7bfd58ee 100644 --- a/packages/liveblocks-react-ui/src/components/AiChat.tsx +++ b/packages/liveblocks-react-ui/src/components/AiChat.tsx @@ -9,7 +9,6 @@ import { RegisterAiTool, useAiChatMessages, } from "@liveblocks/react"; -import { useLayoutEffect } from "@liveblocks/react/_private"; import { type ComponentProps, type ComponentType, @@ -306,12 +305,13 @@ function AutoScrollHandler({ scrollToBottom: (behavior: "instant" | "smooth") => void; }) { // Scroll to bottom when the component first mounts - useLayoutEffect(() => { + useEffect(() => { scrollToBottom("instant"); }, [scrollToBottom]); // Scroll to bottom when sending a new message useEffect(() => { + if (lastSentMessageId === null) return; scrollToBottom("smooth"); }, [lastSentMessageId, scrollToBottom]); diff --git a/packages/liveblocks-react/package.json b/packages/liveblocks-react/package.json index bf09c0f7165..0dd25b6dd19 100644 --- a/packages/liveblocks-react/package.json +++ b/packages/liveblocks-react/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/react", - "version": "3.1.2", + "version": "3.1.3", "description": "A set of React hooks and providers to use Liveblocks declaratively. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", "license": "Apache-2.0", "type": "module", @@ -61,8 +61,8 @@ "showdeps": "depcruise src --include-only '^src' --exclude='__tests__' --output-type dot | dot -T svg > /tmp/dependency-graph.svg && open /tmp/dependency-graph.svg" }, "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2" + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3" }, "peerDependencies": { "@types/react": "*", diff --git a/packages/liveblocks-redux/package.json b/packages/liveblocks-redux/package.json index e613ecd27f5..9ba9eb6a27b 100644 --- a/packages/liveblocks-redux/package.json +++ b/packages/liveblocks-redux/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/redux", - "version": "3.1.2", + "version": "3.1.3", "description": "A store enhancer to integrate Liveblocks into Redux stores. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", "license": "Apache-2.0", "type": "module", @@ -33,8 +33,8 @@ "test:watch": "jest --silent --verbose --color=always --watch" }, "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2" + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3" }, "peerDependencies": { "redux": "^4 || ^5" diff --git a/packages/liveblocks-yjs/package.json b/packages/liveblocks-yjs/package.json index 3ec26cb8f65..b7facc8f90c 100644 --- a/packages/liveblocks-yjs/package.json +++ b/packages/liveblocks-yjs/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/yjs", - "version": "3.1.2", + "version": "3.1.3", "description": "Integrate your existing or new Yjs documents with Liveblocks.", "icense": "Apache-2.0", "type": "module", @@ -33,8 +33,8 @@ "test:watch": "jest --silent --verbose --color=always --watch" }, "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2", + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3", "js-base64": "^3.7.7", "y-indexeddb": "^9.0.12" }, diff --git a/packages/liveblocks-zustand/package.json b/packages/liveblocks-zustand/package.json index 838b8440f80..34d89de009b 100644 --- a/packages/liveblocks-zustand/package.json +++ b/packages/liveblocks-zustand/package.json @@ -1,6 +1,6 @@ { "name": "@liveblocks/zustand", - "version": "3.1.2", + "version": "3.1.3", "description": "A middleware for Zustand to automatically synchronize your stores with Liveblocks. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", "license": "Apache-2.0", "type": "module", @@ -34,8 +34,8 @@ "test:watch": "jest --silent --verbose --color=always --watch" }, "dependencies": { - "@liveblocks/client": "3.1.2", - "@liveblocks/core": "3.1.2" + "@liveblocks/client": "3.1.3", + "@liveblocks/core": "3.1.3" }, "peerDependencies": { "zustand": "^5.0.1"