Skip to content

Commit

Permalink
BlockNote server util import testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-elias committed Jan 8, 2025
1 parent 00b4b12 commit eda4f09
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@aws-sdk/credential-providers": "^3.363.0",
"@blocknote/mantine": "^0.22.0",
"@blocknote/react": "^0.22.0",
"@blocknote/server-util": "^0.22.0",
"@codesandbox/sandpack-react": "^2.13.5",
"@dagrejs/dagre": "^1.1.2",
"@emotion/react": "^11.11.1",
Expand Down
1 change: 0 additions & 1 deletion packages/twenty-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"typeorm": "../../node_modules/typeorm/.bin/typeorm"
},
"dependencies": {
"@blocknote/server-util": "^0.22.0",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@graphql-yoga/nestjs": "patch:@graphql-yoga/[email protected]#./patches/@graphql-yoga+nestjs+2.1.0.patch",
"@langchain/mistralai": "^0.0.24",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,24 @@ export class QueryRunnerArgsFactory {
case FieldMetadataType.RICH_TEXT: {
const richTextValue = richTextValueSchema.parse(value);

const { blocksToMarkdownLossy, tryParseMarkdownToBlocks } =
ServerBlockNoteEditor.create();
const serverBlockNoteEditor = ServerBlockNoteEditor.create();

const valueInBothFormats: RichTextMetadata = {
markdown: richTextValue.blocknote
? await blocksToMarkdownLossy(JSON.parse(richTextValue.blocknote))
? await serverBlockNoteEditor.blocksToMarkdownLossy(
JSON.parse(richTextValue.blocknote),
)
: null,
blocknote: richTextValue.markdown
? JSON.stringify(
await tryParseMarkdownToBlocks(richTextValue.markdown),
await serverBlockNoteEditor.tryParseMarkdownToBlocks(
richTextValue.markdown,
),
)
: null,
};

return [key, richTextValue];
return [key, valueInBothFormats];
}
default:
return [key, value];
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45113,7 +45113,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "twenty-server@workspace:packages/twenty-server"
dependencies:
"@blocknote/server-util": "npm:^0.22.0"
"@esbuild-plugins/node-modules-polyfill": "npm:^0.2.2"
"@graphql-yoga/nestjs": "patch:@graphql-yoga/[email protected]#./patches/@graphql-yoga+nestjs+2.1.0.patch"
"@langchain/mistralai": "npm:^0.0.24"
Expand Down Expand Up @@ -45232,6 +45231,7 @@ __metadata:
"@babel/preset-typescript": "npm:^7.24.6"
"@blocknote/mantine": "npm:^0.22.0"
"@blocknote/react": "npm:^0.22.0"
"@blocknote/server-util": "npm:^0.22.0"
"@codesandbox/sandpack-react": "npm:^2.13.5"
"@crxjs/vite-plugin": "npm:^1.0.14"
"@dagrejs/dagre": "npm:^1.1.2"
Expand Down

0 comments on commit eda4f09

Please sign in to comment.