@pie-lib/editable-html-tip-tap 2.1.19 → 2.1.20-beta.1
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 +0 -130
- package/lib/components/EditableHtml.js +0 -56
- package/lib/components/EditableHtml.js.map +1 -1
- package/lib/components/MenuBar.js +12 -81
- package/lib/components/MenuBar.js.map +1 -1
- package/lib/components/TiptapContainer.js +2 -2
- package/lib/components/TiptapContainer.js.map +1 -1
- package/lib/components/common/toolbar-buttons.js +5 -6
- package/lib/components/common/toolbar-buttons.js.map +1 -1
- package/lib/components/icons/TableIcons.js +1 -3
- package/lib/components/icons/TableIcons.js.map +1 -1
- package/lib/components/icons/TextAlign.js +5 -14
- package/lib/components/icons/TextAlign.js.map +1 -1
- package/lib/components/respArea/MathTemplated.js +8 -14
- package/lib/components/respArea/MathTemplated.js.map +1 -1
- package/lib/extensions/math.js +37 -19
- package/lib/extensions/math.js.map +1 -1
- package/lib/styles/editorContainerStyles.js +2 -2
- package/lib/styles/editorContainerStyles.js.map +1 -1
- package/package.json +9 -9
- package/src/components/EditableHtml.jsx +0 -52
- package/src/components/MenuBar.jsx +9 -91
- package/src/components/TiptapContainer.jsx +2 -2
- package/src/components/common/toolbar-buttons.jsx +4 -6
- package/src/components/icons/TableIcons.jsx +1 -9
- package/src/components/icons/TextAlign.jsx +5 -39
- package/src/components/respArea/MathTemplated.jsx +6 -13
- package/src/extensions/math.js +19 -11
- package/src/styles/editorContainerStyles.js +2 -2
- package/LICENSE.md +0 -5
- package/src/__tests__/EditableHtml.test.jsx +0 -668
- package/src/__tests__/constants.test.js +0 -19
- package/src/__tests__/div-to-paragraph-conversion.test.jsx +0 -125
- package/src/__tests__/editor-attributes.test.jsx +0 -77
- package/src/__tests__/extensions.test.js +0 -208
- package/src/__tests__/index.test.jsx +0 -154
- package/src/__tests__/size-utils.test.js +0 -64
- package/src/__tests__/spellcheck.test.jsx +0 -63
- package/src/__tests__/theme.test.js +0 -17
- package/src/components/__tests__/AltDialog.test.jsx +0 -147
- package/src/components/__tests__/CharacterPicker.test.jsx +0 -270
- package/src/components/__tests__/CssIcon.test.jsx +0 -46
- package/src/components/__tests__/DragInTheBlank.test.jsx +0 -255
- package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +0 -209
- package/src/components/__tests__/ImageToolbar.test.jsx +0 -128
- package/src/components/__tests__/InlineDropdown.test.jsx +0 -557
- package/src/components/__tests__/InsertImageHandler.test.js +0 -161
- package/src/components/__tests__/MediaDialog.test.jsx +0 -293
- package/src/components/__tests__/MediaToolbar.test.jsx +0 -74
- package/src/components/__tests__/MediaWrapper.test.jsx +0 -81
- package/src/components/__tests__/MenuBar.test.jsx +0 -338
- package/src/components/__tests__/RespArea.test.jsx +0 -122
- package/src/components/__tests__/TableIcons.test.jsx +0 -149
- package/src/components/__tests__/TextAlign.test.jsx +0 -167
- package/src/components/__tests__/TiptapContainer.test.jsx +0 -138
- package/src/components/__tests__/characterUtils.test.js +0 -166
- package/src/components/__tests__/choice.test.jsx +0 -171
- package/src/components/__tests__/custom-popper.test.jsx +0 -82
- package/src/components/__tests__/done-button.test.jsx +0 -54
- package/src/components/__tests__/toolbar-buttons.test.jsx +0 -247
- package/src/components/respArea/DragInTheBlank/__tests__/choice.test.jsx +0 -72
- package/src/components/respArea/__tests__/MathTemplated.test.jsx +0 -210
- package/src/extensions/__tests__/css.test.js +0 -196
- package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +0 -180
- package/src/extensions/__tests__/divNode.test.js +0 -87
- package/src/extensions/__tests__/ensure-empty-root-div.test.js +0 -57
- package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +0 -44
- package/src/extensions/__tests__/extended-list-item.test.js +0 -13
- package/src/extensions/__tests__/extended-table-cell.test.js +0 -22
- package/src/extensions/__tests__/extended-table.test.js +0 -183
- package/src/extensions/__tests__/image-component.test.jsx +0 -346
- package/src/extensions/__tests__/image.test.js +0 -237
- package/src/extensions/__tests__/math.test.js +0 -898
- package/src/extensions/__tests__/media-node-view.test.jsx +0 -298
- package/src/extensions/__tests__/media.test.js +0 -271
- package/src/extensions/__tests__/responseArea.test.js +0 -655
- package/src/utils/__tests__/helper.test.js +0 -126
- package/src/utils/__tests__/toolbar.test.js +0 -43
package/src/extensions/math.js
CHANGED
|
@@ -3,6 +3,7 @@ import ReactDOM from 'react-dom';
|
|
|
3
3
|
import { Node } from '@tiptap/core';
|
|
4
4
|
import { NodeViewWrapper, ReactNodeViewRenderer } from '@tiptap/react';
|
|
5
5
|
import { NodeSelection, Plugin, PluginKey, TextSelection } from 'prosemirror-state';
|
|
6
|
+
import { styled } from '@mui/material/styles';
|
|
6
7
|
import { MathPreview, MathToolbar } from '@pie-lib/math-toolbar';
|
|
7
8
|
import { wrapMath } from '@pie-lib/math-rendering';
|
|
8
9
|
import { setToolbarOpened } from '../utils/toolbar';
|
|
@@ -116,6 +117,21 @@ export const ZeroWidthSpaceHandlingPlugin = new Plugin({
|
|
|
116
117
|
},
|
|
117
118
|
});
|
|
118
119
|
|
|
120
|
+
const StyledMathNodeWrapper = styled(NodeViewWrapper, {
|
|
121
|
+
shouldForwardProp: (prop) => prop !== 'selected',
|
|
122
|
+
})(({ theme, selected }) => ({
|
|
123
|
+
display: 'inline-flex',
|
|
124
|
+
cursor: 'pointer',
|
|
125
|
+
margin: '0 4px',
|
|
126
|
+
'&:not(:has(.ML__latex))': {
|
|
127
|
+
border: 'solid 1px lightgrey',
|
|
128
|
+
padding: '5px',
|
|
129
|
+
},
|
|
130
|
+
...(selected && {
|
|
131
|
+
border: `solid 1px ${theme.palette.primary.main}`,
|
|
132
|
+
}),
|
|
133
|
+
}));
|
|
134
|
+
|
|
119
135
|
export const MathNode = Node.create({
|
|
120
136
|
name: 'math',
|
|
121
137
|
group: 'inline',
|
|
@@ -400,17 +416,9 @@ export const MathNodeView = (props) => {
|
|
|
400
416
|
}, [editor, showToolbar, node]);
|
|
401
417
|
|
|
402
418
|
return (
|
|
403
|
-
<
|
|
404
|
-
className={`math-node-${timestamp.current}`}
|
|
405
|
-
style={{
|
|
406
|
-
display: 'inline-flex',
|
|
407
|
-
cursor: 'pointer',
|
|
408
|
-
margin: '0 4px',
|
|
409
|
-
}}
|
|
410
|
-
data-selected={selected}
|
|
411
|
-
>
|
|
419
|
+
<StyledMathNodeWrapper className={`math-node-${timestamp.current}`} selected={selected} data-selected={selected}>
|
|
412
420
|
<div ref={nodeRef} onClick={() => setShowToolbar(true)} contentEditable={false}>
|
|
413
|
-
<MathPreview latex={latex} />
|
|
421
|
+
<MathPreview latex={latex} isSelected={selected} outlineOnWrapper />
|
|
414
422
|
</div>
|
|
415
423
|
{showToolbar &&
|
|
416
424
|
ReactDOM.createPortal(
|
|
@@ -441,6 +449,6 @@ export const MathNodeView = (props) => {
|
|
|
441
449
|
</div>,
|
|
442
450
|
editor?._tiptapContainerEl || document.body,
|
|
443
451
|
)}
|
|
444
|
-
</
|
|
452
|
+
</StyledMathNodeWrapper>
|
|
445
453
|
);
|
|
446
454
|
};
|
|
@@ -101,14 +101,14 @@ const styles = (theme) => ({
|
|
|
101
101
|
backgroundColor: color.background(),
|
|
102
102
|
},
|
|
103
103
|
'& table:not([border="1"]) tr': {
|
|
104
|
-
borderTop:
|
|
104
|
+
borderTop: '1px solid #dfe2e5',
|
|
105
105
|
},
|
|
106
106
|
'& td, th': {
|
|
107
107
|
padding: '.6em 1em',
|
|
108
108
|
textAlign: 'center',
|
|
109
109
|
},
|
|
110
110
|
'& table:not([border="1"]) td, th': {
|
|
111
|
-
border:
|
|
111
|
+
border: '1px solid #dfe2e5',
|
|
112
112
|
},
|
|
113
113
|
},
|
|
114
114
|
children: {
|
package/LICENSE.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Copyright 2019 CoreSpring Inc
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
|
-
|
|
5
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|