diff --git a/wax-prosemirror-components/package.json b/wax-prosemirror-components/package.json index 591526e9122566fbd98b0d75d30d0b840f829bf5..1d120e4e3ccd212a670bb1ba78fb1d1466b91677 100644 --- a/wax-prosemirror-components/package.json +++ b/wax-prosemirror-components/package.json @@ -4,7 +4,7 @@ "version": "0.0.42", "description": "Wax prosemirror UI components", "license": "MIT", - "main": "index.js", + "main": "dist/index.js", "files": [ "dist" ], diff --git a/wax-prosemirror-components/src/components/comments/ConnectedComment.js b/wax-prosemirror-components/src/components/comments/ConnectedComment.js index acb054b8940b4152e8bccea7de2a67356d9fe3d4..ccbd8e6a738479dcac30f048a042ce11affb105d 100644 --- a/wax-prosemirror-components/src/components/comments/ConnectedComment.js +++ b/wax-prosemirror-components/src/components/comments/ConnectedComment.js @@ -74,14 +74,16 @@ export default ({ comment, top, commentId, recalculateTops }) => { allCommentsWithSameId.forEach(singleComment => { dispatch( - tr.addMark( - singleComment.pos, - singleComment.pos + singleComment.nodeSize, - commentMark.create({ - ...((comment && comment.attrs) || {}), - conversation: comment.attrs.conversation, - }), - ), + tr + .addMark( + singleComment.pos, + singleComment.pos + singleComment.nodeSize, + commentMark.create({ + ...((comment && comment.attrs) || {}), + conversation: comment.attrs.conversation, + }), + ) + .setMeta('forceUpdate', true), ); }); activeView.focus(); diff --git a/wax-prosemirror-components/src/ui/tabs/Tabs.js b/wax-prosemirror-components/src/ui/tabs/Tabs.js index 531e93d23b683df57a5200184e3cc87a1a611a35..1abd8c6284bf7aed59882690f1a4a6e5dd2d78d6 100644 --- a/wax-prosemirror-components/src/ui/tabs/Tabs.js +++ b/wax-prosemirror-components/src/ui/tabs/Tabs.js @@ -21,6 +21,7 @@ const activeTab = css` `; const disabledTab = css` + display: none; cursor: not-allowed; opacity: 0.4; `; diff --git a/wax-prosemirror-core/package.json b/wax-prosemirror-core/package.json index 9c567257e7d3966c51a147181b9ee06eae439a87..a62b2a8164d3ed9525a6b7f6eb7db17444ab9755 100644 --- a/wax-prosemirror-core/package.json +++ b/wax-prosemirror-core/package.json @@ -4,7 +4,7 @@ "version": "0.0.42", "description": "Wax prosemirror core", "license": "MIT", - "main": "index.js", + "main": "dist/index.js", "files": [ "dist" ], diff --git a/wax-prosemirror-core/src/WaxView.js b/wax-prosemirror-core/src/WaxView.js index b195a3a641ec5b3c501102474cd78341887b4b8f..d468079711d0fd7e563ffb39db783891366bd2ba 100644 --- a/wax-prosemirror-core/src/WaxView.js +++ b/wax-prosemirror-core/src/WaxView.js @@ -10,12 +10,13 @@ import { trackedTransaction } from 'wax-prosemirror-services'; import { WaxContext } from './WaxContext'; import transformPasted from './helpers/TransformPasted'; +let previousDoc; + export default props => { const { readonly, onBlur, options, debug, autoFocus, user } = props; const editorRef = useRef(); let view; const context = useContext(WaxContext); - const setEditorRef = useCallback( node => { if (editorRef.current) { @@ -75,6 +76,7 @@ export default props => { ? trackedTransaction(transaction, view.state, user) : transaction; + previousDoc = view.state.doc; const state = view.state.apply(tr); view.updateState(state); @@ -90,8 +92,8 @@ export default props => { 'main', ); } - - props.onChange(state.doc.content); + if (view.state.doc !== previousDoc || tr.getMeta('forceUpdate')) + props.onChange(state.doc.content); }; const editor = <div ref={setEditorRef} />; diff --git a/wax-prosemirror-core/src/plugins/placeholder.js b/wax-prosemirror-core/src/plugins/placeholder.js index 9a1595255314421161ae17a4222cffdf09e491a2..de3fd8058b9735f9951aa71c2bc5cb74a75b28a1 100644 --- a/wax-prosemirror-core/src/plugins/placeholder.js +++ b/wax-prosemirror-core/src/plugins/placeholder.js @@ -1,7 +1,7 @@ -import { Plugin, PluginKey } from "prosemirror-state"; -import { Decoration, DecorationSet } from "prosemirror-view"; +import { Plugin, PluginKey } from 'prosemirror-state'; +import { Decoration, DecorationSet } from 'prosemirror-view'; -const placeHolderText = new PluginKey("placeHolderText"); +const placeHolderText = new PluginKey('placeHolderText'); export default props => { return new Plugin({ @@ -17,16 +17,16 @@ export default props => { ) { decorations.push( Decoration.node(pos, pos + node.nodeSize, { - class: "empty-node", - "data-content": props.content - }) + class: 'empty-node', + 'data-content': props.content, + }), ); } }; state.doc.descendants(decorate); return DecorationSet.create(state.doc, decorations); - } - } + }, + }, }); }; diff --git a/wax-prosemirror-plugins/package.json b/wax-prosemirror-plugins/package.json index 932bdabecb6a0fac82f2b8d2684d00381343664e..1c7f813eddd961844cbbf5935a1e8b64d3bd3c19 100644 --- a/wax-prosemirror-plugins/package.json +++ b/wax-prosemirror-plugins/package.json @@ -4,7 +4,7 @@ "version": "0.0.42", "description": "Wax prosemirror plugins", "license": "MIT", - "main": "index.js", + "main": "dist/index.js", "files": [ "dist" ], diff --git a/wax-prosemirror-schema/package.json b/wax-prosemirror-schema/package.json index aff9089eee97a17dd8b32b8d2fa746e89db64a27..0b8d338fb427e2e6f724c4ebe7d6d81bb42790b5 100644 --- a/wax-prosemirror-schema/package.json +++ b/wax-prosemirror-schema/package.json @@ -4,7 +4,7 @@ "version": "0.0.42", "description": "Wax prosemirror schema", "license": "MIT", - "main": "index.js", + "main": "dist/index.js", "files": [ "dist" ], diff --git a/wax-prosemirror-services/package.json b/wax-prosemirror-services/package.json index 84ffa498050b9fda0142f86ad59e6a007a60069e..f9491b3e2fa82ac9439d237d78169e10010ae303 100644 --- a/wax-prosemirror-services/package.json +++ b/wax-prosemirror-services/package.json @@ -4,7 +4,7 @@ "version": "0.0.42", "description": "Wax prosemirror services", "license": "MIT", - "main": "index.js", + "main": "dist/index.js", "files": [ "dist" ], diff --git a/wax-prosemirror-utilities/package.json b/wax-prosemirror-utilities/package.json index 603640748cc47787237ac2e3cd624d30803b4a5c..8374e65e94074277a24dabc297918af37bfc16db 100644 --- a/wax-prosemirror-utilities/package.json +++ b/wax-prosemirror-utilities/package.json @@ -4,7 +4,7 @@ "version": "0.0.42", "description": "Wax prosemirror utilities", "license": "MIT", - "main": "index.js", + "main": "dist/index.js", "files": [ "dist" ],