Commit Graph

52 Commits

Author SHA1 Message Date
Kartikeya Choudhary
ae711abe32
fix(mention): update priority #5680 (#5687) 2024-10-20 05:51:03 +02:00
bdbch
da8fcf373e
Use parent window for cross-frame instantiation (#5534)
* Add cross-iframe JS support to mention extension

* added changeset

---------

Co-authored-by: Taylor Ermolov <taylor@nermolov.com>
2024-08-21 14:51:32 +02:00
Steven DeMartini
f55171fb43
fix: types for Suggestion command, allowing generic overrides (#4136)
* Fix typing for Suggestion `command` with new MentionAttrs generic

As of
7cae9673f0,
new generics were added for Suggestion options and props. However,
there is a subtle bug in the current typing: the object selected with
the suggestion `command` need not have the same types as the `items` in
the suggestion options. For instance, in Tiptap's official demo
https://tiptap.dev/api/nodes/mention, the suggestion `items` are all
`string`s, but the selected Mention is of type `{id: string}` (which are
the attributes of the Mention node, as the Mention extension requires):

```ts
  const selectItem = index => {
    const item = props.items[index]

    if (item) {
      props.command({ id: item })
    }
  }
```

i.e., there should be no restriction that when you select something with
the suggestion `command`, it must use the identical structure as the
suggested items. When using the suggestion plugin with the Mention
extension, for instance, the value passed to the SuggestionProps
`props.command()` function must be a `Record<string, any>`, as it's
directly/exclusively used to set the `attrs` of a `Node` via
`insertContentAt` (and you need not use that shape for suggestion
options, as in the Tiptap example above):
44996d60be/packages/extension-mention/src/mention.ts (L42)
f869507396/packages/core/src/types.ts (L79)

This fixes the typing so that suggestions can correctly refer separately
to their own items (of any type), while ensuring the `command`ed item be
of whatever type is necessary (and so in the Mention context, could be
restricted further).

* Add generics to override selected suggestion type

---------

Co-authored-by: Steven DeMartini <sjdemartini@users.noreply.github.com>
2024-05-17 05:12:04 +02:00
bdbch
b941eea6da
feat: added jsdocs (#4356)
* added JSDocs for almost all extensions

* start adding commands jsdocs

* add jsdocs for rest of extensions

* add jsdocs for Extensions

* add js docs for all extensions

* add more jsdocs

* add js docs for node spec definitions
2024-05-11 14:30:44 +02:00
Tommy-Sun
ee645c1eca
Optionally delete full mention chip (#3341)
* Optionally delete full mention chip

* Added documentation for deleteOnBackspace

* rename all references of deleteOnBackspace to deleteTriggerWithBackspace
2024-04-06 00:26:48 +02:00
MOHAMMAD RASIM
cc41c4c2d2 fix for data attributes not rendering after pr #4082 (#4980) 2024-04-05 23:55:44 +02:00
Mohammad Rasim
d43c477249 fix an issue of duplicate span elements 2023-11-22 20:47:35 +01:00
Mohammad Rasim
6058a53330 warn if user is using the deprecated renderLabel 2023-11-22 20:47:35 +01:00
Mohammad Rasim
865f0be05e Allow the mention extension to have custom renderHTML 2023-11-22 20:47:35 +01:00
Ben Asher
e97630c639
Require file extensions for imports and exports (#4001)
* Require .js endings

* add extension alias for cypress to resolve ts files with js endings
2023-06-30 21:03:49 +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
Dominik Biedebach
163de4e187 fix(extension/mention): collapse selection to end after suggestion insertion to fix chrome selection issue with mouse 2022-06-27 07:50:57 +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
Philipp Kühn
55fa220899 fix: fixes an error when using the mention extension and pasting text ending with "@", fix #2413 2022-01-21 09:29:36 +01:00
Philipp Kühn
6c34dec33a fix: remove some magic strings 2021-12-02 14:58:15 +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
5e652c94a7 fix: fix check for showing mention suggestion 2021-10-22 10:09:28 +02:00
Philipp Kühn
8a3b47a529 feat: parseHTML for attributes should return the value instead of an object now, fix #1863 2021-09-08 23:53:44 +02:00
Philipp Kühn
b7d22bf0dc check for simple space only 2021-08-20 21:02:54 +02:00
Philipp Kühn
3f7e6b219b fix: prevent multiple space characters after mention node, fix #1703 2021-08-20 09:33:16 +02:00
Philipp Kühn
7cf3350a83 fix: add pluginKey option to suggestion plugin, fix #1282 2021-08-13 13:14:54 +02:00
philippkuehn
1b723ea57c ci: fix code style linting errors 2021-06-15 06:11:08 +00:00
shadow-light
5178172864
fix: Fix parsing of mention nodes (#1471) 2021-06-15 08:10:17 +02:00
Philipp Kühn
3b78af44a0 feat: add renderLabel option to mention extension, see #1322 2021-06-14 16:40:17 +02:00
Philipp Kühn
c64761a9e5 BREAKING CHANGE: data-mention is not used to parse a mention id or label anymore 2021-06-14 16:22:09 +02:00
Philipp Kühn
299580a77d code style 2021-06-14 16:17:13 +02:00
philippkuehn
88329c8567 ci: fix code style linting errors 2021-06-14 14:14:00 +00:00
Tom Hartley
c3afe880ae
feat: add label attribute to mention extension (#1322) 2021-06-14 16:13:06 +02:00
Philipp Kühn
e9c9176032 refactoring 2021-05-05 20:50:08 +02:00
Philipp Kühn
63b4e15b0c refactoring 2021-05-05 14:14:09 +02:00
Philipp Kühn
63902d4bdb remove replaceRange from mention node 2021-05-05 13:49:32 +02:00
Philipp Kühn
1c8ca95de2 refactor: remove AnyObject type 2021-04-21 09:43:31 +02:00
Philipp Kühn
b8d9b7d4c7 feat: add insertContent() command, deprecate insertText(), insertHTML() and insertNode() 2021-04-07 11:53:37 +02:00
Philipp Kühn
215c26748b improve options interface 2021-02-10 18:25:08 +01:00
Philipp Kühn
48234cf751 refactoring 2021-02-10 14:53:46 +01:00
Philipp Kühn
c5d6b19d1b Merge branch 'feature/allow-option-for-suggestions' into feature/remove-inferred-commands 2021-02-10 14:52:20 +01:00
Philipp Kühn
290ff76e37 add Commands interface 2021-02-10 09:59:35 +01:00
Philipp Kühn
33773c01f3 add allow option to suggestion extension 2021-02-07 20:38:33 +01:00
Philipp Kühn
319eb83303 rename suggestion command argument 2021-01-21 12:28:58 +01:00
Philipp Kühn
55d767d94c add replaceRange command 2021-01-20 20:37:53 +01:00
Philipp Kühn
1880b43e37 add backspace handler to mentions 2021-01-20 20:17:17 +01:00
Hans Pagel
271f77f6f4 docs: update content 2021-01-20 16:56:25 +01:00
Philipp Kühn
ba0d379101 add editor to suggestion command props 2021-01-20 09:23:44 +01:00
Philipp Kühn
4256de7cde refactoring 2021-01-19 20:42:15 +01:00
Philipp Kühn
563f37d74b fix copying mentions as plain text 2021-01-19 20:27:51 +01:00
Philipp Kühn
7e88257a45 refactoring 2021-01-19 12:50:09 +01:00
Philipp Kühn
7712325ba9 fix mention rendering 2021-01-19 12:03:38 +01:00
Philipp Kühn
c13d65c842 refactoring 2021-01-19 10:09:32 +01:00
Philipp Kühn
aaa0832883 refactoring 2021-01-18 23:41:38 +01:00
Philipp Kühn
f96dff1f0f add tippy 2021-01-18 12:40:13 +01:00