tiptap/docs/api/commands
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
..
blur.md remove gridsome 2021-09-16 14:41:25 +02:00
clear-content.md remove gridsome 2021-09-16 14:41:25 +02:00
clear-nodes.md remove gridsome 2021-09-16 14:41:25 +02:00
create-paragraph-near.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
delete-node.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
delete-range.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
delete-selection.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
enter.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
exit-code.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
extend-mark-range.md remove gridsome 2021-09-16 14:41:25 +02:00
focus.md docs: Typo in Focus Command Documentation of Editor (#2476) 2022-02-03 10:15:34 +01:00
for-each.md remove gridsome 2021-09-16 14:41:25 +02:00
insert-content-at.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
insert-content.md remove gridsome 2021-09-16 14:41:25 +02:00
join-backward.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
join-down.md feat(commands): add joinUp and joinDown command (#3455) 2022-11-25 20:37:25 +01:00
join-forward.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
join-up.md feat(commands): add joinUp and joinDown command (#3455) 2022-11-25 20:37:25 +01:00
keyboard-shortcut.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
lift-empty-block.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
lift-list-item.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
lift.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
newline-in-code.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
reset-attributes.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
scroll-into-view.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
select-all.md remove gridsome 2021-09-16 14:41:25 +02:00
select-node-backward.md docs: remove stray spaces in docs 2022-06-08 13:07:12 +02:00
select-node-forward.md docs: remove stray spaces in docs 2022-06-08 13:07:12 +02:00
select-parent-node.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
select-textblock-end.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
select-textblock-start.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
set-content.md remove gridsome 2021-09-16 14:41:25 +02:00
set-mark.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
set-meta.md remove gridsome 2021-09-16 14:41:25 +02:00
set-node-selection.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
set-node.md docs(docs): 📝 add missing command docs 2022-06-08 12:15:59 +02:00
set-text-selection.md remove gridsome 2021-09-16 14:41:25 +02:00
sink-list-item.md Update sink-list-item.md (#3629) 2023-01-19 10:36:53 +01:00
split-block.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
split-list-item.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
toggle-list.md Adds attributes to toggleList (#3776) 2023-03-03 09:59:45 +01:00
toggle-mark.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
toggle-node.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
toggle-wrap.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
undo-input-rule.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
unset-all-marks.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
unset-mark.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00
update-attributes.md remove gridsome 2021-09-16 14:41:25 +02:00
wrap-in-list.md docs(docs): 📝 add missing documentation for commands 2022-06-08 12:41:14 +02:00