diff --git a/editors/demo/src/HHMI/MultipleChoiceQuestionService/MultipleChoiceQuestion.js b/editors/demo/src/HHMI/MultipleChoiceQuestionService/MultipleChoiceQuestion.js index 8f34f7f0b9d06c3c6625b0a7081a30f5d22d3101..99c378f1bc0a3733c143e69340622150989d6af0 100644 --- a/editors/demo/src/HHMI/MultipleChoiceQuestionService/MultipleChoiceQuestion.js +++ b/editors/demo/src/HHMI/MultipleChoiceQuestionService/MultipleChoiceQuestion.js @@ -29,11 +29,11 @@ class MultipleChoiceQuestion extends Tools { $to.parentOffset, ); - const footnote = state.config.schema.nodes.multiple_choice.create( + const answerOption = state.config.schema.nodes.multiple_choice.create( { id: uuidv4() }, content, ); - dispatch(tr.replaceSelectionWith(footnote)); + dispatch(tr.replaceSelectionWith(answerOption)); } else { tr.setBlockType( from, @@ -52,11 +52,11 @@ class MultipleChoiceQuestion extends Tools { $to.parentOffset, ); - const footnote = state.config.schema.nodes.multiple_choice.create( + const answerOption = state.config.schema.nodes.multiple_choice.create( { id: uuidv4() }, content, ); - dispatch(tr.replaceSelectionWith(footnote)); + dispatch(tr.replaceSelectionWith(answerOption)); // dispatch(state.tr.replaceSelectionWith(footnote)); } }); diff --git a/editors/demo/src/HHMI/MultipleChoiceQuestionService/MultipleChoiceQuestionService.js b/editors/demo/src/HHMI/MultipleChoiceQuestionService/MultipleChoiceQuestionService.js index af9f3bff657ddc3cdf05417a2930966bcb4f3a59..589f9e4b78efccbda6cd364619d42910488c9f76 100644 --- a/editors/demo/src/HHMI/MultipleChoiceQuestionService/MultipleChoiceQuestionService.js +++ b/editors/demo/src/HHMI/MultipleChoiceQuestionService/MultipleChoiceQuestionService.js @@ -18,7 +18,7 @@ class MultipleChoiceQuestionService extends Service { createNode({ question_wrapper: { group: 'block', - atom: true, + // atom: true, content: 'inline*', attrs: { class: { default: 'paragraph' }, diff --git a/wax-prosemirror-components/src/components/EditorInfo/CounterInfo/EditorInfoTool.js b/wax-prosemirror-components/src/components/EditorInfo/CounterInfo/EditorInfoTool.js index a29e7c0e73ba091867f20b69601d22a4f261405b..1b2b6f6e6732b74bf77031625df41150c419bb20 100644 --- a/wax-prosemirror-components/src/components/EditorInfo/CounterInfo/EditorInfoTool.js +++ b/wax-prosemirror-components/src/components/EditorInfo/CounterInfo/EditorInfoTool.js @@ -175,12 +175,12 @@ const EditorInfoTool = ({ view: { state }, item }) => { } }); setBlockLevelNodes(blockLevelCount); - allBlockNodes.forEach(value => { - value.node.forEach(imgs => { - if (imgs.type.name === 'image') { + allBlockNodes.forEach(nodes => { + nodes.node.forEach(node => { + if (node.type.name === 'image') { imgCounts += 1; } - if (imgs.type.name === 'footnote') { + if (node.type.groups.includes('notes')) { footNoteCount += 1; } }); diff --git a/wax-prosemirror-schema/src/nodes/footNoteNode.js b/wax-prosemirror-schema/src/nodes/footNoteNode.js index 625f0b44c28519f5bb8132c47cfdc962086a460a..38b81a21152e0da673594aed101e39f5805db182 100644 --- a/wax-prosemirror-schema/src/nodes/footNoteNode.js +++ b/wax-prosemirror-schema/src/nodes/footNoteNode.js @@ -1,5 +1,5 @@ const footnote = { - group: 'inline', + group: 'notes, inline', content: 'inline*', inline: true, atom: true, diff --git a/wax-prosemirror-utilities/src/commands/Commands.js b/wax-prosemirror-utilities/src/commands/Commands.js index d57270a90ea8027b3fc7628ee608e6f79caefddc..533dd89cf8a9d4f9d72d9d415675ba32cb999888 100644 --- a/wax-prosemirror-utilities/src/commands/Commands.js +++ b/wax-prosemirror-utilities/src/commands/Commands.js @@ -133,7 +133,7 @@ const createComment = (state, dispatch, group, viewid) => { let footnote = false; let footnoteNode; state.doc.nodesBetween($from.pos, $to.pos, (node, from) => { - if (node.type.name === 'footnote') { + if (node.type.groups.includes('notes')) { footnote = true; footnoteNode = node; } @@ -204,7 +204,7 @@ const createCommentOnFootnote = (state, dispatch, group, viewid) => { ranges.push({ start, end, - footnote: contentNode.type.name === 'footnote', + footnote: contentNode.type.groups.includes('notes'), }); }); diff --git a/wax-prosemirror-utilities/src/document/DocumentHelpers.js b/wax-prosemirror-utilities/src/document/DocumentHelpers.js index 563f74f869adfd2ded213e643ab9b8ebcff2e8f6..8014665be31e56a5a762b4c7428b187dcb5e3114 100644 --- a/wax-prosemirror-utilities/src/document/DocumentHelpers.js +++ b/wax-prosemirror-utilities/src/document/DocumentHelpers.js @@ -208,7 +208,7 @@ export const findMatches = (doc, searchValue, matchCase) => { }); eachRight(allNodes, (node, index) => { - if (node.node.type.name === 'footnote') { + if (node.node.type.groups.includes('notes')) { allNodes.splice(index + 1, node.node.childCount); } });