@pie-lib/editable-html-tip-tap 1.2.0-next.0 → 1.2.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -22
- package/lib/components/CharacterPicker.js +4 -4
- package/lib/components/CharacterPicker.js.map +1 -1
- package/lib/components/EditableHtml.js +22 -5
- package/lib/components/EditableHtml.js.map +1 -1
- package/lib/components/MenuBar.js +30 -12
- package/lib/components/MenuBar.js.map +1 -1
- package/lib/components/TiptapContainer.js +10 -5
- package/lib/components/TiptapContainer.js.map +1 -1
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +8 -3
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +1 -1
- package/lib/components/respArea/DragInTheBlank/choice.js +13 -6
- package/lib/components/respArea/DragInTheBlank/choice.js.map +1 -1
- package/lib/components/respArea/MathTemplated.js +130 -0
- package/lib/components/respArea/MathTemplated.js.map +1 -0
- package/lib/extensions/image-component.js +4 -4
- package/lib/extensions/image-component.js.map +1 -1
- package/lib/extensions/index.js +7 -4
- package/lib/extensions/index.js.map +1 -1
- package/lib/extensions/media.js +14 -11
- package/lib/extensions/media.js.map +1 -1
- package/lib/extensions/responseArea.js +11 -8
- package/lib/extensions/responseArea.js.map +1 -1
- package/package.json +12 -14
- package/src/__tests__/EditableHtml.test.jsx +3 -0
- package/src/components/CharacterPicker.jsx +1 -1
- package/src/components/EditableHtml.jsx +28 -5
- package/src/components/MenuBar.jsx +37 -6
- package/src/components/TiptapContainer.jsx +6 -4
- package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +7 -2
- package/src/components/respArea/DragInTheBlank/choice.jsx +31 -4
- package/src/components/respArea/MathTemplated.jsx +124 -0
- package/src/components/respArea/__tests__/MathTemplated.test.jsx +210 -0
- package/src/extensions/__tests__/media-node-view.test.jsx +296 -0
- package/src/extensions/__tests__/media.test.js +1 -0
- package/src/extensions/image-component.jsx +1 -1
- package/src/extensions/index.js +4 -1
- package/src/extensions/media.js +17 -14
- package/src/extensions/responseArea.js +3 -7
|
@@ -5,6 +5,7 @@ import { Node, ReactNodeViewRenderer } from '@tiptap/react';
|
|
|
5
5
|
import ExplicitConstructedResponse from '../components/respArea/ExplicitConstructedResponse';
|
|
6
6
|
import DragInTheBlank from '../components/respArea/DragInTheBlank/DragInTheBlank';
|
|
7
7
|
import InlineDropdown from '../components/respArea/InlineDropdown';
|
|
8
|
+
import MathTemplated from '../components/respArea/MathTemplated';
|
|
8
9
|
|
|
9
10
|
const lastIndexMap = {};
|
|
10
11
|
|
|
@@ -187,14 +188,9 @@ export const ResponseAreaExtension = Extension.create({
|
|
|
187
188
|
// tr.setSelection(NodeSelection.create(tr.doc, usedPos))
|
|
188
189
|
|
|
189
190
|
// --- Cursor move behavior for certain types (Slate: moveFocusTo next text) ---
|
|
190
|
-
if (
|
|
191
|
-
['math_templated', 'inline_dropdown', 'drag_in_the_blank', 'explicit_constructed_response'].includes(
|
|
192
|
-
typeName,
|
|
193
|
-
)
|
|
194
|
-
) {
|
|
191
|
+
if (['math_templated', 'inline_dropdown', 'explicit_constructed_response'].includes(typeName)) {
|
|
195
192
|
tr.setSelection(NodeSelection.create(tr.doc, usedPos));
|
|
196
193
|
} else {
|
|
197
|
-
// Default: put cursor after inserted node
|
|
198
194
|
const after = usedPos + newInline.nodeSize;
|
|
199
195
|
tr.setSelection(selectionAfterPos(tr.doc, after));
|
|
200
196
|
}
|
|
@@ -305,7 +301,7 @@ export const MathTemplatedNode = Node.create({
|
|
|
305
301
|
];
|
|
306
302
|
},
|
|
307
303
|
addNodeView() {
|
|
308
|
-
return ReactNodeViewRenderer(() => <
|
|
304
|
+
return ReactNodeViewRenderer((props) => <MathTemplated {...{ ...props, options: this.options }} />);
|
|
309
305
|
},
|
|
310
306
|
});
|
|
311
307
|
|