Skip to content

Commit 64f168b

Browse files
committed
Add support for Yjs docs as values #998
1 parent d9d3eba commit 64f168b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2905
-1210
lines changed

Cargo.lock

Lines changed: 101 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

browser/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@tomic/lib": "workspace:*",
1414
"chalk": "^5.3.0",
1515
"prettier": "3.0.3",
16-
"typescript": "^5.6.3"
16+
"typescript": "^5.9.3"
1717
},
1818
"description": "Generate types from Atomic Data ontologies",
1919
"license": "MIT",

browser/cli/src/DatatypeToTSTypeMap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ export const DatatypeToTSTypeMap = {
1313
[Datatype.MARKDOWN]: 'string',
1414
[Datatype.URI]: 'string',
1515
[Datatype.JSON]: 'JSONValue',
16+
[Datatype.YDOC]: 'never',
1617
[Datatype.UNKNOWN]: 'JSONValue',
1718
};

browser/create-template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"@types/node": "^20.17.0",
19-
"typescript": "^5.6.3"
19+
"typescript": "^5.9.3"
2020
},
2121
"description": "Generate templates using Atomic Data",
2222
"license": "MIT",

browser/data-browser/package.json

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,32 @@
1717
"@dnd-kit/utilities": "^3.2.2",
1818
"@emoji-mart/react": "^1.1.1",
1919
"@emotion/is-prop-valid": "^1.3.1",
20+
"@floating-ui/dom": "^1.7.4",
2021
"@modelcontextprotocol/sdk": "^1.13.3",
2122
"@oddbird/css-anchor-positioning": "^0.6.1",
2223
"@openrouter/ai-sdk-provider": "^1.2.0",
2324
"@radix-ui/react-popover": "^1.1.2",
2425
"@radix-ui/react-scroll-area": "^1.2.0",
2526
"@radix-ui/react-tabs": "^1.1.1",
2627
"@tanstack/react-router": "^1.95.1",
27-
"@tiptap/extension-file-handler": "^2.25.0",
28-
"@tiptap/extension-image": "^2.11.7",
29-
"@tiptap/extension-link": "^2.11.7",
30-
"@tiptap/extension-mention": "^2.11.7",
31-
"@tiptap/extension-placeholder": "^2.11.7",
32-
"@tiptap/extension-typography": "^2.11.7",
33-
"@tiptap/pm": "^2.11.7",
34-
"@tiptap/react": "^2.11.7",
35-
"@tiptap/starter-kit": "^2.11.7",
36-
"@tiptap/suggestion": "^2.11.7",
28+
"@tiptap/extension-collaboration": "^3.6.5",
29+
"@tiptap/extension-collaboration-caret": "^3.6.5",
30+
"@tiptap/extension-file-handler": "^3.6.5",
31+
"@tiptap/extension-image": "^3.6.5",
32+
"@tiptap/extension-link": "^3.6.5",
33+
"@tiptap/extension-mention": "^3.6.5",
34+
"@tiptap/extension-placeholder": "^3.6.5",
35+
"@tiptap/extension-typography": "^3.6.5",
36+
"@tiptap/pm": "^3.6.5",
37+
"@tiptap/react": "^3.6.5",
38+
"@tiptap/starter-kit": "^3.6.5",
39+
"@tiptap/suggestion": "^3.6.5",
40+
"@tiptap/y-tiptap": "^3.0.0",
3741
"@tomic/react": "workspace:*",
3842
"@uiw/codemirror-theme-github": "^4.24.1",
3943
"@uiw/react-codemirror": "^4.24.1",
44+
"@wuchale/jsx": "^0.7.4",
45+
"@wuchale/vite-plugin": "^0.14.6",
4046
"ai": "^5.0.29",
4147
"clsx": "^2.1.1",
4248
"downshift": "^9.0.9",
@@ -45,9 +51,9 @@
4551
"polished": "^4.3.1",
4652
"prismjs": "^1.29.0",
4753
"quick-score": "^0.2.0",
48-
"react": "^19.0.0",
54+
"react": "^19.2.0",
4955
"react-colorful": "^5.6.1",
50-
"react-dom": "^19.0.0",
56+
"react-dom": "^19.2.0",
5157
"react-dropzone": "^11.7.1",
5258
"react-hot-toast": "^2.4.1",
5359
"react-hotkeys-hook": "^3.4.7",
@@ -62,11 +68,10 @@
6268
"remark-gfm": "^4.0.0",
6369
"styled-components": "^6.1.19",
6470
"stylis": "4.3.0",
65-
"tippy.js": "^6.3.7",
6671
"tiptap-markdown": "^0.8.10",
6772
"wuchale": "^0.16.5",
68-
"@wuchale/jsx": "^0.7.4",
69-
"@wuchale/vite-plugin": "^0.14.6",
73+
"y-protocols": "^1.0.6",
74+
"yjs": "^13.6.27",
7075
"zod": "^4.1.5"
7176
},
7277
"devDependencies": {
@@ -82,7 +87,7 @@
8287
"gh-pages": "^5.0.0",
8388
"lint-staged": "^10.5.4",
8489
"types-wm": "^1.1.0",
85-
"typescript": "^5.6.3",
90+
"typescript": "^5.9.3",
8691
"vite": "^5.4.10",
8792
"vite-plugin-prismjs": "^0.0.11",
8893
"vite-plugin-pwa": "^0.20.5",

browser/data-browser/src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { StoreContext, Store } from '@tomic/react';
1+
import { StoreContext, Store, enableYjs } from '@tomic/react';
22

33
import { isDev } from './config';
44
import { registerHandlers } from './handlers';
@@ -33,6 +33,8 @@ const store = new Store({
3333
serverUrl,
3434
});
3535

36+
await enableYjs();
37+
3638
store.parseMetaTags();
3739

3840
declare global {

browser/data-browser/src/chunks/AI/RealAIChat.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ import { MessageContextItem } from './MessageContextItem';
3535
import { useProcessMessages } from './useProcessMessages';
3636
import { NoKeyOverlay } from './NoKeyOverlay';
3737
import { useOpenRouterModels } from './useOpenRouterModels';
38-
import type { MentionItem } from '@chunks/MarkdownEditor/AIChatInput/types';
38+
import type { MentionItem } from '@chunks/RTE/AIChatInput/types';
3939
import { useChat } from '@ai-sdk/react';
4040
import { useClientOnlyTransport } from './ClientOnlyTransport';
4141
import { useGenerativeData } from './useGenerativeData';
4242
import { FollowUpPrompt } from './FollowUpPrompt';
4343
import { useAISettings } from '@components/AI/AISettingsContext';
4444

4545
const AIChatInput = React.lazy(
46-
() => import('@chunks/MarkdownEditor/AIChatInput/AsyncAIChatInput'),
46+
() => import('@chunks/RTE/AIChatInput/AsyncAIChatInput'),
4747
);
4848

4949
interface RealAIChatProps {

browser/data-browser/src/chunks/MarkdownEditor/AIChatInput/AsyncAIChatInput.tsx renamed to browser/data-browser/src/chunks/RTE/AIChatInput/AsyncAIChatInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ const AsyncAIChatInput: React.FC<
179179
[serversWithResources, searchResourcesOfServer, disabled],
180180
);
181181

182-
const handleChange = (value: string) => {
182+
const handleChange = () => {
183+
// @ts-expect-error - markdown is a valid storage
184+
const value = editor.storage.markdown.getMarkdown();
183185
setMarkdown(value);
184186
markdownRef.current = value;
185187
onChange(value);

browser/data-browser/src/chunks/MarkdownEditor/AIChatInput/MentionList.tsx renamed to browser/data-browser/src/chunks/RTE/AIChatInput/MentionList.tsx

File renamed without changes.

0 commit comments

Comments
 (0)