Commit Graph

13 Commits

Author SHA1 Message Date
René Eschke
b2ec51374d
Adds attributes to toggleList (#3776)
* Adds attributes to toggleList

When dealing with different variants of bullet lists, I wanted to adopt the same technique I used for different paragraph variants. Since `wrapInList` is capable of receiving attributes, just like `setNode` is, I don't see any reason why `toggleList` should not be capable of the same. 

Here's my bullet list extension in action that is in need of attributes support.

```js
export const CustomBulletList = BulletList.extend({
  content: 'listItem*',

  addAttributes() {
    return {
      variant: {
        default: DEFAULT_LIST,

        renderHTML: attributes => {
          return {
            class: `list-${attributes.variant}`,
          };
        },
      },
    };
  },

  addCommands() {
    return {
      toggleBulletList: attributes => (c) => {
        return c.commands.toggleListCustom(this.name, this.options.itemTypeName, attributes);
      },
    };
  },
});
```

* Update toggle-list.md

* Update toggle-list.md
2023-03-03 09:59:45 +01:00
Au
acca921184
Update sink-list-item.md (#3629)
correct text copy
2023-01-19 10:36:53 +01:00
Dominik
343ce756a8
feat(commands): add joinUp and joinDown command (#3455) 2022-11-25 20:37:25 +01:00
Dominik Biedebach
e426e096f0 docs: remove stray spaces in docs 2022-06-08 13:07:12 +02:00
Dominik Biedebach
4abd7c8827 docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
Dominik Biedebach
43f8843c3e docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
Angad Sethi
e9926438ea
docs: Typo in Focus Command Documentation of Editor (#2476)
A pretty small fix. The word `boolean` was misspelled.
2022-02-03 10:15:34 +01:00
Philipp Kühn
0aa39f93cb feat: add selectTextblockStart and selectTextblockEnd commands 2022-01-25 10:35:39 +01:00
Philipp Kühn
e0f64904b6 feat: add scrollIntoView option to focus command, fix #2172 2021-11-25 17:18:30 +01:00
Philipp Kühn
3c571c9a3f feat: add 'all' option to focus command, fix #2181 2021-11-22 10:17:06 +01:00
Hans Pagel
f45c8d0ca7 docs: use regular case for Tiptap 2021-10-19 22:30:45 +02:00
Philipp Kühn
569aa15c4f Merge branch 'main' of https://github.com/ueberdosis/tiptap into docs/remove-gridsome
# Conflicts:
#	docs/experiments/collaboration-annotation.md
#	docs/experiments/global-drag-handle.md
2021-09-17 23:45:04 +02:00
Philipp Kühn
2f15a11572 remove gridsome 2021-09-16 14:41:25 +02:00