diff options
author | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-03-10 01:06:59 +0300 |
---|---|---|
committer | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-03-14 17:38:28 +0300 |
commit | 0bc2bbbc5e7989eb3f0ceba702255c552dbdac47 (patch) | |
tree | a084ef3597498c53e068e446dd61560170dac9e9 /src/nodes | |
parent | e1863ef939b01a22e3efcfd908e8339dbdbf36ea (diff) |
🚚 (#2184): use callout instead of callout-container
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Diffstat (limited to 'src/nodes')
-rw-r--r-- | src/nodes/Callouts.js (renamed from src/nodes/CalloutsContainer.js) | 18 | ||||
-rw-r--r-- | src/nodes/index.js | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/nodes/CalloutsContainer.js b/src/nodes/Callouts.js index 47374b7f9..afc68b0e2 100644 --- a/src/nodes/CalloutsContainer.js +++ b/src/nodes/Callouts.js @@ -21,11 +21,11 @@ */ import { Node, mergeAttributes, isNodeActive } from '@tiptap/core' -import { typesAvailable } from '../markdownit/containers' +import { typesAvailable } from '../markdownit/callouts' export default Node.create({ - name: 'calloutContainer', + name: 'callout', content: 'paragraph+', @@ -37,7 +37,7 @@ export default Node.create({ return { types: typesAvailable, HTMLAttributes: { - class: 'callout-container', + class: 'callout', }, } }, @@ -51,7 +51,7 @@ export default Node.create({ renderHTML: attributes => { return { 'data-callout': attributes.type, - class: `callout-container-${attributes.type}`, + class: `callout-${attributes.type}`, } }, }, @@ -87,21 +87,21 @@ export default Node.create({ addCommands() { return { - setCalloutCustomContainer: attributes => ({ commands }) => { + setCallout: attributes => ({ commands }) => { return commands.wrapIn(this.name, attributes) }, - toggleCalloutCustomContainer: attributes => ({ commands, state }) => { + toggleCallout: attributes => ({ commands, state }) => { if (!isNodeActive(state, this.name)) { - return commands.setCalloutCustomContainer(attributes) + return commands.setCallout(attributes) } if (!isNodeActive(state, this.name, attributes)) { return commands.updateAttributes(this.name, attributes) } - return commands.unsetCalloutCustomContainer() + return commands.unsetCallout() }, - unsetCalloutCustomContainer: () => ({ commands }) => { + unsetCallout: () => ({ commands }) => { return commands.lift(this.name) }, } diff --git a/src/nodes/index.js b/src/nodes/index.js index 89ad98c26..0f8e70a43 100644 --- a/src/nodes/index.js +++ b/src/nodes/index.js @@ -27,7 +27,7 @@ import TaskItem from './TaskItem' import TaskList from './TaskList' import TrailingNode from './TrailingNode' import Heading from './Heading' -import CalloutContainer from './CalloutsContainer' +import Callout from './Callouts' export { Image, @@ -37,5 +37,5 @@ export { TaskList, TrailingNode, Heading, - CalloutContainer, + Callout, } |