Commit Graph

83 Commits

Author SHA1 Message Date
Nick Perez
873a67c6e3
feat: in a collab setting, disable transactions that are trying to sync invalid content (#5207)
When collaborating on a document, a client may send changes which are invalid to the current client. This change makes it so that the client can be disabled from synchronizing any further changes to avoid the default behavior of stripping unknown content. This would allow the other client to continue editing on the document while still synchronizing any known changes.
2024-10-21 17:15:06 +02:00
bdbch
4efd2278a1
Fix getMarkRange not finding marks when at the start of a mark (#5717)
* fix getMarkRange to always find a mark, even if cursor is at start of mark

* added changesets

* added integration tests for getMarkRange

* remove console.logs

* added forward and backward boundary checks for tests
2024-10-11 06:44:05 +02:00
Jaap van Hoek
21df331b60
fix(table): respect resizeable columns colwidths (#4955) 2024-10-04 14:17:08 +02:00
Nick Perez
6834a7f7d6
build: type defs only emit for a single package's code (#5665) 2024-09-26 14:51:00 +02:00
Leopold Pinkernell
f805333f63
fix(core): check schema's nesting rules on contentCheck (#5500) (#5535) 2024-08-21 22:44:17 +02:00
sifat haque
a22767e9e1
fix(core): styles de-duplicate in mergeAttributes (#4610) 2024-08-21 22:39:58 +02:00
Nick Perez
593f1070a8
fix(link): respect custom protocols #5468 (#5470)
When [we fixed a XSS vuln](https://github.com/ueberdosis/tiptap/pull/5160), we inadvertently broke the ability to use custom protocols, this resolves that by allowing additional custom protocols to be considered valid and not stripped out
2024-08-15 08:57:59 +02:00
Nick Perez
d6e56c41e3
fix(extension-code-block-lowlight): use lowlight v3 and update demos (#5374) 2024-08-06 13:53:58 +02:00
Nick Perez
ae0254db97
feat(core): add ignoreWhitespace option to isNodeEmpty (#5446) 2024-08-06 10:05:50 +02:00
Nick Perez
84ebd511d2
fix(core): resolve isNodeEmpty criteria #5415 (#5419) 2024-08-01 09:02:34 +02:00
Nick Perez
b012471755
fix(core): isNodeEmpty no longer considers attributes for it's checks (#5393) 2024-07-25 15:40:07 +02:00
Arturs Vonda
4cca382695
fix(core): take atom content entirely (#5321) 2024-07-19 13:49:15 +02:00
Nick Perez
07f4c03315
fix(core): configuring extensions should add to the parent's options not replace them (#5357)
* fix(core): configuring extensions should add to the parent's options not replace them

* fix: order of tests
2024-07-17 09:06:41 +02:00
Nick Perez
c540c7d2e8
fix: apply #5147 fix to marks and nodes resolves #4704 (#5156)
* fix: apply #5147 fix to marks and nodes

* fix: resolve Issue #4704 by reverting PR #4191

* test: more robust tests for nodes and marks too
2024-06-18 08:00:28 +02:00
Daniel Pivovarov
33de6fef67
fix(horizontal-rule): fix insertion behavior (#4898) 2024-06-14 04:51:52 +02:00
Yousef
fe78faab55
fix(core): mergeDeep now can merge nulls (#4088) 2024-06-12 08:36:44 +02:00
Nick Perez
74bfdc5bef
feat: error handling of invalid content for a schema (#5178)
This change introduces two new top-level options to the editor: `enableContentCheck` & `onContentError` for dealing with content supplied that does not match the prose-mirror schema generated by the set of tiptap extensions.

`enableContentCheck` allows the app developer to opt into the behavior to check for invalid schemas (this change is otherwise backwards compatible).
When true, this will try to parse the document, and any content that does not match the schema will emit a `contentError` which can be listened to via the `onContentError` callback.
2024-06-04 09:32:54 +02:00
Nick the Sick
738c436a9f
fix: disable parsing javascript: links, add tests 2024-05-16 17:10:15 +02:00
Christofer Roth
980b54f62b fix(extension-link): use whitelist for allowed href values 2024-05-16 09:05:42 +02:00
Nick Perez
4db463c6bb
fix(core): configure should use the parent of the current instance, to avoid duplication (#5147) 2024-05-14 14:45:03 +02:00
Myles J
d6c71a838d
fix: unexpected renderText() for contentful nodes (#3410) 2024-04-06 01:29:46 +02:00
Lukas Hirt
099e10df92
fix: mark nocookie youtube url as valid when parsing html (#4883) 2024-02-19 10:32:57 +01:00
Cameron Hessler
e6947bad2d fix(extension-youtube) fix lint 2023-11-20 18:48:22 +01:00
Cameron Hessler
1bd714a408 fix(extension-youtube) change regex to disallow non-youtube domains 2023-11-20 18:48:22 +01:00
Cameron Hessler
7debf2baf0 fix(extension-youtube) Add fix for link too 2023-11-20 18:48:22 +01:00
Cameron Hessler
04a11355a7 fix(extension-youtube) XSS risk with src tag
Fixes risks outline in #4600 by verifying that any src urls are valid
youtube URLs before rendering as HTML. My thoughts are that this attack
vector would be difficult to use because the attacker would have to have
a way to manipualte the TipTap payload in a manner that bypasses the
youtube extension's `setYoutubeVideo` command, which already checks for
valid URLs.
2023-11-20 18:48:22 +01:00
Cameron Hessler
26610cdff3
fix(core) Nested chain not preserving dispatch state (#4152)
* Fix nested chain not preserving dispatch state

* Change test to read as sentence
2023-07-07 11:20:29 +02:00
Dominik
f387ad3dd4
feat(pm): new prosemirror package for dependency resolving
* chore:(core): migrate to tsup

* chore: migrate blockquote and bold to tsup

* chore: migrated bubble-menu and bullet-list to tsup

* chore: migrated more packages to tsup

* chore: migrate code and character extensions to tsup

* chore: update package.json to simplify build for all packages

* chore: move all packages to tsup as a build process

* chore: change ci build task

* feat(pm): add prosemirror meta package

* rfix: resolve issues with build paths & export mappings

* docs: update documentation to include notes for @tiptap/pm

* chore(pm): update tsconfig

* chore(packages): update packages

* fix(pm): add package export infos & fix dependencies

* chore(general): start moving to pm package as deps

* chore: move to tiptap pm package internally

* fix(demos): fix demos working with new pm package

* fix(tables): fix tables package

* fix(tables): fix tables package

* chore(demos): pinned typescript version

* chore: remove unnecessary tsconfig

* chore: fix netlify build

* fix(demos): fix package resolving for pm packages

* fix(tests): fix package resolving for pm packages

* fix(tests): fix package resolving for pm packages

* chore(tests): fix tests not running correctly after pm package

* chore(pm): add files to files array

* chore: update build workflow

* chore(tests): increase timeout time back to 12s

* chore(docs): update docs

* chore(docs): update installation guides & pm information to docs

* chore(docs): add link to prosemirror docs

* fix(vue-3): add missing build step

* chore(docs): comment out cdn link

* chore(docs): remove semicolons from docs

* chore(docs): remove unnecessary installation note

* chore(docs): remove unnecessary installation note
2023-02-02 17:37:33 +01:00
tomi-bigpi
d3aeac4afa
Fix #3435 - CommonJS and ESM loading confusion (#3436)
* Fix TipTap getting loaded as CommonJS when the intent is to use the ES Module version.
* `package.json` change also makes explicit exports required
* Update `core` utilities exports to include all utilities
* Update tests to use exported utilities
2022-11-24 16:06:42 +01:00
Cameron Hessler
17a41da5a7
fix(core): Can() does not work for setting marks (#3223)
Previously, setting marks did no schema validation checks for dry runs
(like the `.can()` command). The `setMark` raw command will now properly
check if the mark is possible to be set given the editor node/mark
schema.

Co-authored-by: Cameron Hessler <cameron.hessler@buildertrend.com>
2022-09-26 14:56:25 +02:00
Sven Adlung
348383b96c
fix(tests): fix failing cypress tests and update cypress
* test: update cypress and migrate configs

* test: fix codeBlockLowlight test

* test: bump cypress actions
2022-09-26 11:06:01 +02:00
Asherah Connor
574cd69e06
fix(core): isNodeSelection, isTextSelection not always false (#3089)
Fixes #2979.  Since the ProseMirror TypeScript upgrade, these have
always returned false, since the Selection type tree are all classes
now.
2022-08-22 13:05:53 +02:00
Dominik
8c6751f0c6
add precommit hook for linting and automatic eslint fixes + update eslint packages (#2862)
* chore: add precommit hook for eslint fixes, fix linting issues
* chore: add eslint import sort plugin
2022-06-08 14:10:25 +02:00
Enrique Alcántara
39f5e4c31e
Declare lowlight as a peerDependency (#2625)
Declare lowlight as a peerDependency to delegate
the control of which version of lowlight is used
to the client application

Co-authored-by: Enrique Alcantara <ealcantara@gitlab.com>
2022-06-06 19:33:52 +02:00
Philipp Kühn
e07a5b625d
refactor: Use named exports instead of default exports (#2238)
* use named exports instead of default exports

* fix tests

Co-authored-by: Philipp Kühn <philippkuehn@MacBook-Pro-von-Philipp.local>
2021-12-06 12:00:09 +01:00
Philipp Kühn
40a9404c94 add newline-after-var rule to eslint config 2021-12-03 00:03:39 +01:00
Philipp Kühn
20b6d79f33 fix: remove defaultOptions fallback, fix #2219 2021-12-02 20:04:45 +01:00
Philipp Kühn
5da313a548 fix: fix a bug when parsing attributes if no parseHTML method is provided, fix #2058 2021-11-08 21:27:46 +01:00
Philipp Kühn
9afadeb7fe
feat!: Replace defaultOptions with addOptions (#2088)
* add new addOptions option

* replace defaultOptions with addOptions for all extensions

* replace defaultOptions with addOptions for all demos

* replace defaultOptions with addOptions in docs

* refactoring

* refactoring

* drop object support for addOptions

* fix optional options

* fix tests
2021-10-26 18:31:13 +02:00
Philipp Kühn
723b955cec
feat: Integrate input rules and paste rules into the core (#1997)
* refactoring

* improve link regex

* WIP: add new markPasteRule und linkify to image mark

* move copy of inputrule to core

* trigger codeblock inputrule on enter

* refactoring

* add regex match to markpasterulematch

* refactoring

* improve link regex

* WIP: add new markPasteRule und linkify to image mark

* move copy of inputrule to core

* trigger codeblock inputrule on enter

* refactoring

* add regex match to markpasterulematch

* update linkify

* wip

* wip

* log

* wip

* remove debug code

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* rename matcher

* add data to ExtendedRegExpMatchArray

* remove logging

* add code option to marks, prevent inputrules in code mark

* remove link regex

* fix codeblock inputrule on enter

* refactoring

* refactoring

* refactoring

* refactoring

* fix position bug

* add test

* export InputRule and PasteRule

* clean up link demo

* fix types
2021-10-08 15:02:09 +02:00
Philipp Kühn
f8efdf797a fix: fix order of executed plugins, fix #1547 2021-10-03 18:55:33 +02:00
Enrique Alcántara
54be0e570e
fix: Allow extending code-block-lowlight (#1917)
Use the extension name when initializing the
LowlightPlugin. In this way, several extensions
can make use of the same plugin

Co-authored-by: Enrique Alcantara <ealcantara@gitlab.com>
2021-09-21 09:26:11 +02:00
Philipp Kühn
64409cad66 feat: allow wildcards when checking attributes in isActive, fix #1752 2021-08-20 10:51:46 +02:00
Philipp Kühn
80296aa8d0 refactoring 2021-08-09 17:24:18 +02:00
Robert van Hoesel
e6f67caef3
fix: fix updating editorProps via setOptions (#1540), fix #1518 2021-08-09 17:19:50 +02:00
sibiraj-s
aac0193050 Fix lint errors 2021-07-20 13:49:55 +02:00
sibiraj-s
656a80fc3f Update hostic-dom to fix style attributes 2021-07-20 13:49:55 +02:00
Philipp Kühn
d037c5656a fix: fix merging options on configure for multiple extension instances 2021-06-03 13:13:43 +02:00
Philipp Kühn
7b74d5849f fix lint errors 2021-05-28 15:16:33 +02:00
Philipp Kühn
ff7dd9b919 feat: add support for checking for attributes in extendMarkRange 2021-05-17 13:00:54 +02:00