Skip to content

Commit b6786e6

Browse files
committed
Merge branch 'main' into forward-refs
2 parents 47e22e6 + c8dc85e commit b6786e6

File tree

9 files changed

+37
-15
lines changed

9 files changed

+37
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
# Exporting documents to PDF
2+
3+
This example exports the current document (all blocks) as an PDF file and downloads it to your computer.
4+
5+
**Try it out:** Edit the document and click "Download .pdf" in top-left corner, to download the PDF file.
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
# Exporting documents to .docx (Office Open XML)
2+
3+
This example exports the current document (all blocks) as an Microsoft Word Document (DOCX) file and downloads it to your computer.
4+
5+
**Try it out:** Edit the document and click "Download .docx" in top-left corner, to download the DOCX file.

examples/05-interoperability/07-converting-blocks-to-odt/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"strict": true,
1616
"forceConsistentCasingInFileNames": true,
1717
"module": "ESNext",
18-
"moduleResolution": "Node",
18+
"moduleResolution": "bundler",
1919
"resolveJsonModule": true,
2020
"isolatedModules": true,
2121
"noEmit": true,

nx.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": {
1212
"cache": true,
1313
"dependsOn": ["^build"],
14-
"outputs": ["{projectRoot}/dist"]
14+
"outputs": ["{projectRoot}/dist", "{projectRoot}/types"]
1515
},
1616
"test": {
1717
"cache": true,

package-lock.json

+1-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"start:built": "npx serve playground/dist -c ../serve.json",
2626
"build:clean": "npm run clean && npm run gen && npm run clean && lerna run --stream build",
2727
"build": "lerna run --stream build",
28-
"build:site": "lerna run --stream docs:build --concurrency 1",
28+
"build:site": "npm run gen && lerna run --stream docs:build --concurrency 1",
2929
"lint": "lerna run --stream lint",
3030
"bootstrap": "lerna bootstrap --ci -- --force && patch-package",
3131
"install-new-packages": "lerna bootstrap -- --force && patch-package",

packages/react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@
5454
"dependencies": {
5555
"@blocknote/core": "^0.24.2",
5656
"@emoji-mart/data": "^1.2.1",
57-
"@emoji-mart/react": "^1.1.1",
5857
"@floating-ui/react": "^0.26.4",
5958
"@tiptap/core": "^2.7.1",
6059
"@tiptap/react": "^2.7.1",
6160
"@tiptap/pm": "^2.7.1",
61+
"emoji-mart": "^5.6.0",
6262
"lodash.merge": "^4.6.2",
6363
"react-icons": "^5.2.1"
6464
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// From https://github.com/missive/emoji-mart/blob/main/packages/emoji-mart-react/react.tsx
2+
import React, { useEffect, useRef } from "react";
3+
import { Picker } from "emoji-mart";
4+
5+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6+
export default function EmojiPicker(props: any) {
7+
const ref = useRef(null);
8+
const instance = useRef(null) as any;
9+
10+
if (instance.current) {
11+
instance.current.update(props);
12+
}
13+
14+
useEffect(() => {
15+
instance.current = new Picker({ ...props, ref });
16+
17+
return () => {
18+
instance.current = null;
19+
};
20+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
21+
22+
return React.createElement("div", { ref });
23+
}

packages/react/src/components/Comments/EmojiPicker.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import Picker from "@emoji-mart/react";
21
import { ReactNode, useState } from "react";
32

43
import { useComponentsContext } from "../../editor/ComponentsContext.js";
54
import { useBlockNoteContext } from "../../editor/BlockNoteContext.js";
5+
import Picker from "./EmojiMartPicker.js";
66

77
export const EmojiPicker = (props: {
88
onEmojiSelect: (emoji: { native: string }) => void;

0 commit comments

Comments
 (0)