Skip to content

Merge next into develop #6279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 253 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
253 commits
Select commit Hold shift + click to select a range
8e85b59
Merge branch 'develop' into 'next'
bdbch Jul 31, 2024
2f6064b
v3.0.0-next.0
bdbch Jul 31, 2024
ffc4ad4
build: enabled CI releases for next
nperez0111 Aug 6, 2024
4247646
chore: update package-lock
nperez0111 Aug 7, 2024
0fa9e1a
Merge branch 'develop' into next
nperez0111 Aug 7, 2024
96601f7
refactor(placeholder): deprecate `considerAnyAsEmpty`
nperez0111 Aug 7, 2024
08593a2
refactor(react): throw an error if misconfigured in SSR mode
nperez0111 Aug 7, 2024
a92f4a6
build: use tsup for compilation (#5455)
nperez0111 Aug 7, 2024
d086c4e
chore: rm umd key
nperez0111 Aug 8, 2024
64a74f6
feat(starter-kit): enable more extensions in the starter-kit for easi…
nperez0111 Aug 10, 2024
06ffa88
Merge branch 'develop' into next
nperez0111 Aug 14, 2024
a07eea2
chore(release): release new pre-release version v3.0.0-next.1 (#5456)
github-actions[bot] Aug 14, 2024
e9ff069
feat: add `instanceId` property to editor
nperez0111 Aug 15, 2024
14afcad
Merge branch 'develop' into next
nperez0111 Sep 24, 2024
37913d5
fix: update `getPos` type inside `NodeViewRendererProps`(#5623)
WilliamIPark Sep 24, 2024
763af10
chore: rebuild package-lock
nperez0111 Sep 24, 2024
12bb31a
Fix/insert content at block insertions (#5651)
bdbch Sep 26, 2024
d1870ca
Merge "develop" into branch "next"
nperez0111 Sep 26, 2024
ad7ea1a
Merge branch 'develop' into next
nperez0111 Nov 1, 2024
718bf26
Merge branch 'develop' into next
nperez0111 Nov 1, 2024
8c68da2
Merge branch 'develop' into next
nperez0111 Nov 1, 2024
35a3489
perf: memoize the context value
nperez0111 Nov 1, 2024
2ef1c84
fix(react): `shouldRerenderOnTransaction` defaults to false for perf
nperez0111 Nov 6, 2024
fea61ff
test: update demos for tests to pass
nperez0111 Nov 11, 2024
d72ca37
fix: set defaultCellMinWidth
nperez0111 Nov 11, 2024
05e1755
test: cleanup tests
nperez0111 Nov 11, 2024
e6ce7b6
fix: make useEditorState run before layout
nperez0111 Nov 11, 2024
564a6b3
test: update tests
nperez0111 Nov 11, 2024
90dfd46
test: update react tests
nperez0111 Nov 11, 2024
f7453a3
Merge branch 'develop' into next
nperez0111 Nov 11, 2024
165d7c5
feat(demo): add accessibility demo
nperez0111 Nov 6, 2024
f465671
fix(react): change types to reflect the new default value
nperez0111 Nov 7, 2024
f9f4c79
feat: make the example much better
nperez0111 Nov 7, 2024
4daa8ec
refactor: clean up the demo a bit
nperez0111 Nov 8, 2024
d73c67f
style: add styling to dropdown
nperez0111 Nov 8, 2024
81b11a7
fix: allow arrow down & arrow up to move nav
nperez0111 Nov 8, 2024
65cc837
fix: add selection states
nperez0111 Nov 8, 2024
34b8d59
fix: add whitespace after blocks for voiceover word separation
nperez0111 Nov 8, 2024
54c5fb1
chore: format
nperez0111 Nov 8, 2024
0f5b8da
chore: aria in the right element
nperez0111 Nov 8, 2024
a018b63
refactor: cleanup implementation
nperez0111 Nov 11, 2024
2a1d31c
Merge branch 'develop' into next
nperez0111 Dec 4, 2024
1eabcd1
test: fix test
nperez0111 Dec 4, 2024
0f2aae8
chore(release): publish a new pre-release version (next) (#5653)
github-actions[bot] Dec 16, 2024
466dca4
fix: package the pm package correctly
nperez0111 Dec 16, 2024
4d2139b
chore: add changeset
nperez0111 Dec 16, 2024
a6919e6
chore(release): publish a new pre-release version (next) (#5939)
github-actions[bot] Dec 16, 2024
f9c598a
Merge branch 'develop' into next
nperez0111 Dec 30, 2024
d129dd6
Merge branch 'develop' into next
nperez0111 Dec 30, 2024
3ea3f66
Merge branch 'develop' into next
nperez0111 Dec 31, 2024
43a8ced
Merge branch 'develop' into next
nperez0111 Dec 31, 2024
ac261c8
Merge remote-tracking branch 'origin/next' into next
nperez0111 Dec 31, 2024
20f68f6
refactor: remove `editor.getCharacterCount` function
nperez0111 Dec 31, 2024
3b4e06c
feat(font-size): add font size extension (#5894)
kart-c Dec 31, 2024
d6c7558
perf(core): if a transaction is a no-op do not attempt to re-apply it…
nperez0111 Dec 31, 2024
0a976d8
fix: updates can actually be emitted again
nperez0111 Jan 2, 2025
0bad53e
feat: make text-style non-consuming (#5979)
nperez0111 Jan 3, 2025
e5f1342
feat(extension-utils): add a new package, extension-utils (#5970)
nperez0111 Jan 6, 2025
131c7d0
feat(table): make all table packages be in one package, add a new Tab…
nperez0111 Jan 6, 2025
c05be0a
chore: bump package-lock
nperez0111 Jan 6, 2025
7b4e6f5
build: migrate to pnpm (#5978)
nperez0111 Jan 6, 2025
c82fd7c
test: fix tests & enforce cypress to install (#5989)
nperez0111 Jan 6, 2025
e151795
chore: purposefully update the lockfile with new versions
nperez0111 Jan 6, 2025
321b621
chore: add lint
nperez0111 Jan 6, 2025
6a53bb2
feat(static-renderer): add `@tiptap/static-renderer` to enable static…
nperez0111 Jan 6, 2025
0b4981c
feat(text-style): merge all pkgs into text-style, add `background-col…
nperez0111 Jan 8, 2025
7d3b1a8
refactor(table): re-export the sub-path (#6002)
nperez0111 Jan 8, 2025
97b4c1e
chore: sub-path to right dir
nperez0111 Jan 8, 2025
efe6daf
chore: update changesets to be valid again
nperez0111 Jan 8, 2025
bf040b9
feat(html): switch from `zeed-dom` to `happy-dom-without-node` (#5984)
nperez0111 Jan 8, 2025
d4a9bf3
build: just use the default export again
nperez0111 Jan 8, 2025
bfec9b2
feat: migrate `@tiptap/extension-utils` -> `@tiptap/extensions` (#6003)
nperez0111 Jan 9, 2025
ff8eed6
feat(core): support `validate` options in node and mark attribute def…
bobthecow Jan 9, 2025
620ee40
chore: lint
nperez0111 Jan 9, 2025
a6e6823
chore(release): publish a new pre-release version (next) (#5969)
github-actions[bot] Jan 10, 2025
06c90ce
build: retry to publish
nperez0111 Jan 10, 2025
beab9bf
chore: use turbo cache
nperez0111 Jan 10, 2025
f77cbac
fix(text-style): merge nested styles
nperez0111 Jan 10, 2025
b69f500
test: fix tests
nperez0111 Jan 10, 2025
cd76bb5
fix(html): better server-side handling
nperez0111 Jan 11, 2025
bdb47ba
build: do not publish next versions as latest
nperez0111 Jan 16, 2025
56994fe
chore: wrong line
nperez0111 Jan 16, 2025
4c995e4
test: add tests specifically for React static rendering (#6029)
nperez0111 Jan 17, 2025
996fb99
fix: update so examples run again
nperez0111 Jan 20, 2025
f8c053e
chore: gh actions update pnpm
nperez0111 Jan 20, 2025
78718ef
build: dedupe deps, not optimize them
nperez0111 Jan 20, 2025
b606b9f
chore: add deps
nperez0111 Jan 21, 2025
4193931
chore: add deps
nperez0111 Jan 21, 2025
71c17ad
chore: forget pnpm-lock
nperez0111 Jan 21, 2025
d22fc55
chore: regenerate pnpm lock
nperez0111 Jan 21, 2025
6b4c67c
chore: please the linter
nperez0111 Jan 21, 2025
dd0a25f
feat(core): add JSX transformer for DX of `renderHTML` method (#5558)
nperez0111 Jan 22, 2025
d6d5c88
feat(core): add a `delete` event which can detect node deletions (#6022)
nperez0111 Jan 22, 2025
28c5418
chore: add changeset
nperez0111 Jan 22, 2025
b2ab982
chore: update pnpm-lock
nperez0111 Jan 22, 2025
569ab62
fix(core): re:`delete` automatically filter y-sync transactions, allo…
nperez0111 Jan 22, 2025
0e3207f
feat(core): add support for markviews (#5759)
nperez0111 Jan 22, 2025
3e5ff5c
build: move to latest cypress (#6041)
nperez0111 Jan 23, 2025
38146b7
refactor: extract bubble-menu & floating-menu to own export (#5993)
nperez0111 Jan 23, 2025
062afaf
refactor(core): update setContent command signature for better defaul…
nperez0111 Jan 24, 2025
704f462
feat(core): add ability to run editor without a browser + `mount` API…
nperez0111 Jan 24, 2025
18923ea
feat(core): the delete event can now detect mark deletions too (#6047)
nperez0111 Jan 24, 2025
a0e0dc7
feat: update changesets and move more extensions into `@tiptap/extens…
nperez0111 Jan 27, 2025
2c911d2
feat(list): add new `extension-list` package which packages all the l…
nperez0111 Jan 27, 2025
ab0083e
chore: update changesets
nperez0111 Jan 27, 2025
835b1d3
feat: move the character-count extension into `@tiptap/extensions` (#…
nperez0111 Jan 27, 2025
6f080fc
chore: do not bundle relative deps
nperez0111 Jan 27, 2025
8a8789c
build: export character-count as relative export
nperez0111 Jan 27, 2025
2d715fc
Merge branch 'develop' into next
nperez0111 Jan 27, 2025
81d7c6d
chore: update example
nperez0111 Jan 27, 2025
e32c403
test: update test file
nperez0111 Jan 27, 2025
a33d20c
use @tiptap/y-tiptap instead of y-prosemirror (#6064)
bdbch Jan 28, 2025
32958d6
feat(core): `editor.storage` strong typing and separate instances (#6…
nperez0111 Jan 28, 2025
e80ba58
test: update examples for trailing-node and selection extension (#6065)
nperez0111 Jan 28, 2025
f731cd9
chore(release): publish version 3.0.0-next.5(#6012)
github-actions[bot] Jan 28, 2025
881a58f
feat: add a codemod for transforming imports (#6067)
nperez0111 Jan 29, 2025
2d42e94
sync next with develop
bdbch Jan 30, 2025
2172a4c
sfix merge conflicts
bdbch Jan 30, 2025
73f0671
remove unexisting package from changesets ignore list
bdbch Jan 30, 2025
8c522f8
fix merge conflicts, remove tiptap-demos from config
bdbch Jan 30, 2025
1089831
add version to codemod
bdbch Jan 30, 2025
3ac7e29
chore(release): publish a new pre-release version (next) (#6071)
github-actions[bot] Jan 30, 2025
ff8a24a
make import codemod private for now
bdbch Jan 30, 2025
89bd9c7
Fix/enforce-type-imports-so-that-bundler-ignores-types (#6132)
arnaugomez Mar 3, 2025
d8a3d93
Rename History extension to UndoRedo (#6172)
bdbch Mar 12, 2025
25ec82e
Rename CollaborationCursor extension to CollaborationCaret (#6173)
bdbch Mar 12, 2025
b0e0b23
reverted package name changes in codemod for v2 to v3 migration
bdbch Mar 16, 2025
ac35ec8
reinstigate history extension and move it into deprecated packages di…
bdbch Mar 20, 2025
c148c28
sync lockfile
bdbch Mar 20, 2025
46d9ee4
fix table tests
bdbch Mar 27, 2025
f714c31
starter kit: add missing dependency (#6189)
mimecuvalo Mar 27, 2025
ccd681c
update changelog text for history extension renaming
bdbch Mar 27, 2025
f869399
update with a more clear changelog message
bdbch Mar 27, 2025
6446459
Merge branch 'next' of github.com:ueberdosis/tiptap into next
bdbch Mar 27, 2025
8de8e13
fix(core): add even more strict types for Nodes, Marks, and Extension…
nperez0111 Mar 28, 2025
d40601d
sync next with main/develop
bdbch Mar 28, 2025
d69bc77
chore(release): publish a new pre-release version (next) (#6156)
github-actions[bot] Mar 28, 2025
2c18248
fix prosemirror cross-dependencies
bdbch Mar 28, 2025
07f25df
set access to public
bdbch Mar 28, 2025
af9a6be
fix serialize import from pm view
bdbch Mar 28, 2025
1e91f9b
Fix broken prosemirror-module build missing history package (#6221)
bdbch Mar 31, 2025
46eba52
chore(release): publish a new pre-release version (next) (#6222)
github-actions[bot] Mar 31, 2025
e8f8e19
fix vue global draghandle demo
bdbch Apr 15, 2025
52b6644
fix(selection): skip decorations for node selection and non editable …
Aslam97 Apr 16, 2025
04d3307
enter beta pre-tag (#6274)
bdbch Apr 17, 2025
ba81198
use @beta for publish step (#6278)
bdbch Apr 17, 2025
7af392c
revert - use next tag instead of beta
bdbch Apr 17, 2025
991f43c
fix(table): also export TableView from table extension exports (#6218)
bdbch Mar 30, 2025
664834f
fix: clone node before dragging for better dispaly (#6174)
JinForYoda Mar 30, 2025
d0557ef
fix(link): fixes links with marks (#6078)
GormanDesign Mar 31, 2025
d230f7e
feat: add width and height attributes to Image node
arnaugomez Apr 1, 2025
7627150
Merge branch 'develop' of github.com:ueberdosis/tiptap into next
bdbch Apr 17, 2025
3d67595
VueNodeViewRenderer should return `null` for `contentDOM` for a non-l…
ChuanfengZhang Apr 18, 2025
5988305
make sure rel attribute is set on html output for YouTube extension (…
bdbch Apr 18, 2025
a897bb8
bump y-tiptap to 2.0.0 to avoid dependency loop
bdbch Apr 22, 2025
ef3a7e4
chore(release): publish a new pre-release version (beta) (#6273)
github-actions[bot] Apr 22, 2025
3aa670a
Fix broken React unmount because of non-existing view on unmount (#6284)
bdbch Apr 22, 2025
d2c04e0
chore(release): publish a new pre-release version (beta) (#6288)
github-actions[bot] Apr 22, 2025
1b4c82b
Use pnpm workspace dependencies instead of hardcoded ones (#6290)
bdbch Apr 22, 2025
dca2852
chore(release): publish a new pre-release version (beta) (#6291)
github-actions[bot] Apr 22, 2025
5e957e5
fix: use `editorView` for `isDestroyed` check for SSR (#6233)
nperez0111 Apr 23, 2025
b70c453
Revert "Fix broken React unmount because of non-existing view on unmo…
bdbch Apr 23, 2025
631b0cc
fixed infinite-loop because editor.isDestroyed would return invalid r…
bdbch Apr 23, 2025
7a37765
Fix invalid editor.isDestroyed value (#6295)
bdbch Apr 23, 2025
df3d999
Merge branch 'next' of github.com:ueberdosis/tiptap into next
bdbch Apr 23, 2025
c04e019
feat: support multiple triggers in Mention extension
arnaugomez Apr 25, 2025
78dc9de
refactor: simplify code and extract utility function
arnaugomez Apr 25, 2025
b17fcf0
feat: improve multiple triggers demo content to show multiple triggers
arnaugomez Apr 25, 2025
c99dbf5
feat: move multimention demo to examples folder
arnaugomez Apr 25, 2025
68034ab
chore: changeset
arnaugomez Apr 25, 2025
e639bf6
fix: add suggestion char property to make test pass
arnaugomez Apr 25, 2025
3bf6127
feat: add explanation comments
arnaugomez Apr 25, 2025
b06d6b1
test: mention demo e2e tests
arnaugomez Apr 28, 2025
40d2f3b
fix: access the correct value of extension storage inside the renderT…
arnaugomez Apr 28, 2025
5729cf4
Merge pull request #6300 from ueberdosis/feature/mention-multiple-tri…
arnaugomez Apr 29, 2025
9f207a6
fix(core): allow unregistering multiple plugins (#6299)
nperez0111 Apr 30, 2025
f6f9039
build(deps-dev): bump vite from 5.4.15 to 5.4.17 (#6240)
dependabot[bot] Apr 30, 2025
55c78d6
feat(text-align): add toggle command (#6101)
zzxming Apr 30, 2025
87962aa
use correct changeset
bdbch Apr 30, 2025
c28c77c
upgrade y-prosemirror (#6313)
bdbch Apr 30, 2025
f51dd2c
Merge branch 'next' of github.com:ueberdosis/tiptap into next
bdbch Apr 30, 2025
f43b2e5
add changeset
bdbch Apr 30, 2025
b64ae7f
chore(release): publish a new pre-release version (beta) (#6294)
github-actions[bot] Apr 30, 2025
4d52b8a
Merge branch 'next' of github.com:ueberdosis/tiptap into next
bdbch Apr 30, 2025
1ae247f
fix tests
bdbch May 5, 2025
34001a5
update pkg-pr-new step
bdbch May 5, 2025
62b0877
feat: update prosemirror-changeset package to support token encoders
arnaugomez May 6, 2025
e28aacb
Merge pull request #6326 from ueberdosis/feature/update-prosemirror-c…
arnaugomez May 6, 2025
8c69002
sync develop with main (#6330)
bdbch May 7, 2025
7147fdd
chore(release): publish a new pre-release version (beta) (#6327)
github-actions[bot] May 7, 2025
2ea0475
Allow setting HTML tags other than <span> for "as" in MarkViewContent…
unachang113 May 13, 2025
4c03acf
fix: fix eslint issues when you run lint:fix command
arnaugomez May 19, 2025
a98fcaa
Merge pull request #6371 from ueberdosis/fix/fix-eslint-issues-on-lin…
arnaugomez May 20, 2025
2bd5b98
fix: apply prettier and eslint automatic fixes
arnaugomez May 20, 2025
a84ec2a
Merge pull request #6374 from ueberdosis/fix/run-lint-fix-command
arnaugomez May 22, 2025
4f49894
Fix happy-dom overwriting NodeJS process variable (#6384)
bdbch May 26, 2025
ef12b32
add support for react 19 ref props (#6405)
bdbch Jun 4, 2025
1e56160
fix: update ReactNodeViewProps to allow null ref values (#6415)
bdbch Jun 4, 2025
0c1e100
fix(jsx): list jsx-dev-runtime in package.json in files (#6414)
octet-stream Jun 4, 2025
e2f23d8
chore(release): publish a new pre-release version (beta) (#6352)
github-actions[bot] Jun 5, 2025
d0fda30
Merge pull request #6411 from ueberdosis/feature/emit-content-error-w…
arnaugomez Jun 5, 2025
a035719
Merge pull request #6422 from ueberdosis/feature/emit-content-error-w…
arnaugomez Jun 5, 2025
699b463
chore(release): publish a new pre-release version (beta) (#6423)
github-actions[bot] Jun 6, 2025
13db381
fix: update comments with the correct library names
arnaugomez Jun 16, 2025
a974ebc
chore: changeset
arnaugomez Jun 16, 2025
a7e4f61
docs: add full stop
arnaugomez Jun 16, 2025
f9a33ae
fix incorrectly added ref props (#6458)
bdbch Jun 17, 2025
ae6805d
chore(release): publish a new pre-release version (beta) (#6460)
github-actions[bot] Jun 17, 2025
ecb0dee
fix: streamline ref prop handling in ReactRenderer for compatibility …
bdbch Jun 19, 2025
583f01f
chore(release): publish a new pre-release version (beta) (#6469)
github-actions[bot] Jun 19, 2025
7ac01ef
open source pro extensions (next) (#6467)
bdbch Jun 20, 2025
2d85934
chore(release): publish a new pre-release version (beta) (#6471)
github-actions[bot] Jun 20, 2025
2a0e9f7
add repository info to package.json
bdbch Jun 20, 2025
3f4bac2
add repository info to package.json
bdbch Jun 20, 2025
c21b4b4
update dedupeDeps
bdbch Jun 20, 2025
4dcea78
Revert "update dedupeDeps"
bdbch Jun 20, 2025
81bb134
fix react static renderer to parse inline styles as string (#6476)
bdbch Jun 20, 2025
0f14cc5
add missing event options for bubble and floating menu (#6478)
bdbch Jun 20, 2025
bf7c333
chore(release): publish a new pre-release version (beta) (#6477)
github-actions[bot] Jun 20, 2025
3f7877e
added missing emoji extension repo information
bdbch Jun 20, 2025
6412b50
Remove stuck DOM elements after suggestions are removed (#6480)
bdbch Jun 20, 2025
00693b8
Enhance bubble menu positioning for table cell selections (#6482)
bdbch Jun 20, 2025
da7ccd9
Migrate `next` version of details extension (#6484)
bdbch Jun 20, 2025
e817e3f
update changelogs and changeset
bdbch Jun 20, 2025
a9de97c
chore(release): publish a new pre-release version (beta) (#6483)
github-actions[bot] Jun 20, 2025
1992430
fix(extension-youtube): Update YouTube URL regex pattern (#6474)
lambdasawa Jun 21, 2025
ebef861
chore(release): publish a new pre-release version (beta) (#6486)
github-actions[bot] Jun 21, 2025
95b8c71
fix(NodePos): add validation for target position within document rang…
AdeboyeDN Jun 21, 2025
a3f51fe
chore(release): publish a new pre-release version (beta) (#6488)
github-actions[bot] Jun 21, 2025
a68b258
use changeset publish instead of manually publishing via pnpm (#6490)
bdbch Jun 21, 2025
aab2cb2
build(deps): bump cypress-io/github-action from 6.7.16 to 6.10.0 (#6431)
dependabot[bot] Jun 21, 2025
087d114
Fix horizontal rule `can()` check always returning true (#6492)
bdbch Jun 21, 2025
b57d90c
chore(release): publish a new pre-release version (beta) (#6493)
github-actions[bot] Jun 21, 2025
bf835b0
Fix issue where inserting an image below an existing image #6401 (#6416)
TH-coder Jun 22, 2025
ac897e7
Extension, Mark, and Node classes allow functions for creation (#6301)
bdbch Jun 22, 2025
73d1888
Bdbch/6446 cleanup bubble menu resize (#6496)
bdbch Jun 22, 2025
b68dd43
chore(release): publish a new pre-release version (beta) (#6495)
github-actions[bot] Jun 22, 2025
a3f1ccb
Merge pull request #6452 from ueberdosis/fix/accurate-library-names-i…
arnaugomez Jun 23, 2025
d598dab
build(deps): bump cypress-io/github-action from 6.10.0 to 6.10.1 (#6500)
dependabot[bot] Jun 25, 2025
ac585c1
Demo improvements (#6509)
bdbch Jun 26, 2025
e20006b
On drop: delete selection in source tiptap only if editable (#6505)
HPrinz Jun 26, 2025
ab8bc2f
implement node based math extension (#6508)
bdbch Jun 26, 2025
8b37afb
chore(release): publish a new pre-release version (beta) (#6498)
github-actions[bot] Jun 26, 2025
f9465b4
fix: show mention indicator when converting mention to html
arnaugomez Jun 27, 2025
b3afd1e
chore: changeset
arnaugomez Jun 27, 2025
338b065
fix: do not instantiate editor
arnaugomez Jun 27, 2025
8eb2968
fix: do not render text of html as undefined if suggestion of mention…
arnaugomez Jun 27, 2025
4a719fc
fix: explain why we suppress the typescript error
arnaugomez Jun 27, 2025
1aabcb3
fix: do not use ts-expect-error as it crashes cypress test run
arnaugomez Jun 27, 2025
8f29613
Merge pull request #6518 from ueberdosis/fix/render-html-mention
arnaugomez Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
62 changes: 62 additions & 0 deletions .changeset/beige-llamas-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
'@tiptap/extension-character-count': patch
'@tiptap/extension-table-header': patch
'@tiptap/extension-list-keymap': patch
'@tiptap/extension-placeholder': patch
'@tiptap/extension-dropcursor': patch
'@tiptap/extension-table-cell': patch
'@tiptap/extension-gapcursor': patch
'@tiptap/extension-list-item': patch
'@tiptap/extension-table-row': patch
'@tiptap/extension-task-item': patch
'@tiptap/extension-task-list': patch
'@tiptap/extension-code-block-lowlight': patch
'@tiptap/extension-collaboration-caret': patch
'@tiptap/extension-history': patch
'@tiptap/extension-focus': patch
'@tiptap/extension-horizontal-rule': patch
'tiptap-2-migrate-imports': patch
'@tiptap/extension-collaboration': patch
'@tiptap/extension-floating-menu': patch
'@tiptap/extension-ordered-list': patch
'@tiptap/extension-bubble-menu': patch
'@tiptap/extension-bullet-list': patch
'@tiptap/extension-font-family': patch
'@tiptap/extension-superscript': patch
'@tiptap/extension-blockquote': patch
'@tiptap/extension-code-block': patch
'@tiptap/extension-hard-break': patch
'@tiptap/extension-text-align': patch
'@tiptap/extension-text-style': patch
'@tiptap/extension-typography': patch
'@tiptap/extension-highlight': patch
'@tiptap/extension-paragraph': patch
'@tiptap/extension-subscript': patch
'@tiptap/extension-underline': patch
'@tiptap/extension-document': patch
'@tiptap/extension-heading': patch
'@tiptap/extension-mention': patch
'@tiptap/extension-youtube': patch
'@tiptap/extension-italic': patch
'@tiptap/extension-strike': patch
'@tiptap/extension-color': patch
'@tiptap/extension-image': patch
'@tiptap/extension-table': patch
'@tiptap/static-renderer': patch
'@tiptap/extension-bold': patch
'@tiptap/extension-code': patch
'@tiptap/extension-link': patch
'@tiptap/extension-list': patch
'@tiptap/extension-text': patch
'@tiptap/starter-kit': patch
'@tiptap/extensions': patch
'@tiptap/suggestion': patch
'@tiptap/react': patch
'@tiptap/vue-2': patch
'@tiptap/vue-3': patch
'@tiptap/core': patch
'@tiptap/html': patch
'@tiptap/pm': patch
---

We are now using pnpm package aliases for versions to enable better version pinning for the monorepository
5 changes: 5 additions & 0 deletions .changeset/big-wolves-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tiptap/extension-placeholder': major
---

Remove the `considerAnyAsEmpty` option from placeholder, which has been unused since version 2.5
273 changes: 273 additions & 0 deletions .changeset/blue-shrimps-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
---
'@tiptap/static-renderer': major
---

# @tiptap/static-renderer

The `@tiptap/static-renderer` package provides a way to render a Tiptap/ProseMirror document to any target format, like an HTML string, a React component, or even markdown. It does so, by taking the original JSON of a document (or document partial) and attempts to map this to the output format, by matching against a list of nodes & marks.

## Why Static Render?

The main use case for static rendering is to render a Tiptap/ProseMirror document on the server-side, for example in a Next.js or Nuxt.js application. This way, you can render the content of your editor to HTML before sending it to the client, which can improve the performance of your application.

Another use case is to render the content of your editor to another format like markdown, which can be useful if you want to send it to a markdown-based API.

But what makes it static? The static renderer doesn't require a browser or a DOM to render the content. It's a pure JavaScript function that takes a document (as JSON or Prosemirror Node instance) and returns the target format back.

## Example

Render a Tiptap document to an HTML string:

```js
import StarterKit from '@tiptap/starter-kit'
import { renderToHTMLString } from '@tiptap/static-renderer'

renderToHTMLString({
extensions: [StarterKit], // using your extensions
// we can map nodes and marks to HTML elements
options: {
nodeMapping: {
// custom node mappings
},
markMapping: {
// custom mark mappings
},
unhandledNode: ({ node }) => {
// handle unhandled nodes
return `[unknown node ${node.type.name}]`
},
unhandledMark: ({ mark }) => {
// handle unhandled marks
return `[unknown node ${mark.type.name}]`
},
},
// the source content to render
content: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Hello World!',
},
],
},
],
},
})
// returns: '<p>Hello World!</p>'
```

Render to a React component:

```js
import StarterKit from '@tiptap/starter-kit'
import { renderToReactElement } from '@tiptap/static-renderer'

renderToReactElement({
extensions: [StarterKit], // using your extensions
// we can map nodes and marks to HTML elements
options: {
nodeMapping: {
// custom node mappings
},
markMapping: {
// custom mark mappings
},
unhandledNode: ({ node }) => {
// handle unhandled nodes
return `[unknown node ${node.type.name}]`
},
unhandledMark: ({ mark }) => {
// handle unhandled marks
return `[unknown node ${mark.type.name}]`
},
},
// the source content to render
content: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Hello World!',
},
],
},
],
},
})
// returns a react node that, when evaluated, would be equivalent to: '<p>Hello World!</p>'
```

There are a number of options available to customize the output, like custom node and mark mappings, or handling unhandled nodes and marks.

## API

### `renderToHTMLString`

```ts
function renderToHTMLString(options: {
extensions: Extension[],
content: ProsemirrorNode | JSONContent,
options?: TiptapHTMLStaticRendererOptions,
}): string
```

#### `renderToHTMLString` Options

- `extensions`: An array of Tiptap extensions that are used to render the content.
- `content`: The content to render. Can be a Prosemirror Node instance or a JSON representation of a Prosemirror document.
- `options`: An object with additional options.
- `options.nodeMapping`: An object that maps Prosemirror nodes to HTML strings.
- `options.markMapping`: An object that maps Prosemirror marks to HTML strings.
- `options.unhandledNode`: A function that is called when an unhandled node is encountered.
- `options.unhandledMark`: A function that is called when an unhandled mark is encountered.

### `renderToReactElement`

```ts
function renderToReactElement(options: {
extensions: Extension[],
content: ProsemirrorNode | JSONContent,
options?: TiptapReactStaticRendererOptions,
}): ReactElement
```

#### `renderToReactElement` Options

- `extensions`: An array of Tiptap extensions that are used to render the content.
- `content`: The content to render. Can be a Prosemirror Node instance or a JSON representation of a Prosemirror document.
- `options`: An object with additional options.
- `options.nodeMapping`: An object that maps Prosemirror nodes to React components.
- `options.markMapping`: An object that maps Prosemirror marks to React components.
- `options.unhandledNode`: A function that is called when an unhandled node is encountered.
- `options.unhandledMark`: A function that is called when an unhandled mark is encountered.

## How does it work?

Each Tiptap node/mark extension can define a `renderHTML` method which is used to generate default mappings of Prosemirror nodes/marks to the target format. These can be overridden by providing custom mappings in the options. One thing to note is that the static renderer doesn't support node views automatically, so you need to provide a mapping for each node type that you want rendered as a node view. Here is an example of how you can render a node view as a React component:

```js
import { Node } from '@tiptap/core'
import { ReactNodeViewRenderer } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
import { renderToReactElement } from '@tiptap/static-renderer'

// This component does not have a NodeViewContent, so it does not render it's children's rich text content
function MyCustomComponentWithoutContent() {
const [count, setCount] = React.useState(200)

return (
<div className='custom-component-without-content' onClick={() => setCount(a => a + 1)}>
{count} This is a react component!
</div>
)
}

const CustomNodeExtensionWithoutContent = Node.create({
name: 'customNodeExtensionWithoutContent',
atom: true,
renderHTML() {
return ['div', { class: 'my-custom-component-without-content' }] as const
},
addNodeView() {
return ReactNodeViewRenderer(MyCustomComponentWithoutContent)
},
})

renderToReactElement({
extensions: [StarterKit, CustomNodeExtensionWithoutContent],
options: {
nodeMapping: {
// render the custom node with the intended node view React component
customNodeExtensionWithoutContent: MyCustomComponentWithoutContent,
},
},
content: {
type: 'doc',
content: [
{
type: 'customNodeExtensionWithoutContent',
},
],
},
})
// returns: <div class="my-custom-component-without-content">200 This is a react component!</div>
```

But what if you want to render the rich text content of the node view? You can do that by providing a `NodeViewContent` component as a child of the node view component:

```js
import { Node } from '@tiptap/core'
import {
NodeViewContent,
ReactNodeViewContentProvider,
ReactNodeViewRenderer
} from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
import { renderToReactElement } from '@tiptap/static-renderer'


// This component does have a NodeViewContent, so it will render it's children's rich text content
function MyCustomComponentWithContent() {
return (
<div className="custom-component-with-content">
Custom component with content in React!
<NodeViewContent />
</div>
)
}


const CustomNodeExtensionWithContent = Node.create({
name: 'customNodeExtensionWithContent',
content: 'text*',
group: 'block',
renderHTML() {
return ['div', { class: 'my-custom-component-with-content' }, 0] as const
},
addNodeView() {
return ReactNodeViewRenderer(MyCustomComponentWithContent)
},
})


renderToReactElement({
extensions: [StarterKit, CustomNodeExtensionWithContent],
options: {
nodeMapping: {
customNodeExtensionWithContent: ({ children }) => {
// To pass the content down into the NodeViewContent component, we need to wrap the custom component with the ReactNodeViewContentProvider
return (
<ReactNodeViewContentProvider content={children}>
<MyCustomComponentWithContent />
</ReactNodeViewContentProvider>
)
},
},
},
content: {
type: 'doc',
content: [
{
type: 'customNodeExtensionWithContent',
// rich text content
content: [
{
type: 'text',
text: 'Hello, world!',
},
],
},
],
},
})

// returns: <div class="custom-component-with-content">Custom component with content in React!<div data-node-view-content="" style="white-space:pre-wrap">Hello, world!</div></div>
// Note: The NodeViewContent component is rendered as a div with the attribute data-node-view-content, and the rich text content is rendered inside of it
```
5 changes: 5 additions & 0 deletions .changeset/chilled-candles-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tiptap/pm': patch
---

Fix prosemirror history build
Loading
Loading