@modusoperandi/licit 1.0.5 → 1.0.7
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/BlockquoteInsertNewLineCommand.js +10 -11
- package/BlockquoteInsertNewLineCommand.js.flow +1 -2
- package/BlockquoteNodeSpec.js +2 -3
- package/BlockquoteNodeSpec.js.flow +1 -2
- package/BlockquoteToggleCommand.js +9 -9
- package/BookmarkNodeSpec.js +1 -1
- package/CodeBlockCommand.js +10 -10
- package/CodeBlockCommand.js.flow +1 -1
- package/ContentPlaceholderPlugin.js +17 -17
- package/ContentPlaceholderPlugin.js.flow +10 -12
- package/CursorPlaceholderPlugin.js +8 -8
- package/DocLayoutCommand.js +10 -12
- package/DocLayoutCommand.js.flow +1 -3
- package/EditorKeyMap.js +0 -1
- package/EditorKeyMap.js.flow +0 -2
- package/EditorMarks.js +1 -1
- package/EditorNodes.js +1 -2
- package/EditorNodes.js.flow +0 -1
- package/EditorPageLayoutPlugin.js +8 -8
- package/FontTypeMarkSpec.js +1 -1
- package/FontTypeMarkSpec.js.flow +1 -1
- package/HTMLMutator.js +4 -4
- package/HeadingNodeSpec.js +2 -12
- package/HeadingNodeSpec.js.flow +4 -14
- package/HistoryRedoCommand.js +9 -9
- package/HistoryUndoCommand.js +9 -9
- package/HorizontalRuleCommand.js +9 -9
- package/ImageUploadPlaceholderPlugin.js +13 -15
- package/ImageUploadPlaceholderPlugin.js.flow +5 -7
- package/LinkMarkSpec.js +6 -1
- package/LinkMarkSpec.js.flow +5 -0
- package/LinkSetURLCommand.js +126 -55
- package/LinkSetURLCommand.js.flow +61 -37
- package/LinkTooltipPlugin.js +119 -30
- package/LinkTooltipPlugin.js.flow +91 -20
- package/ListItemInsertNewLineCommand.js +10 -11
- package/ListItemInsertNewLineCommand.js.flow +1 -2
- package/ListItemMergeCommand.js +16 -15
- package/ListItemMergeCommand.js.flow +3 -4
- package/ListSplitCommand.js +9 -9
- package/ListToggleCommand.js +9 -9
- package/MarksClearCommand.js +9 -9
- package/MathEditCommand.js +10 -11
- package/MathEditCommand.js.flow +1 -2
- package/OrderedListNodeSpec.js +1 -1
- package/ParagraphNodeSpec.js +11 -2
- package/ParagraphNodeSpec.js.flow +9 -2
- package/ParagraphSpacingCommand.js +13 -14
- package/ParagraphSpacingCommand.js.flow +4 -9
- package/PrintCommand.js +9 -9
- package/SelectionPlaceholderPlugin.js +8 -8
- package/SpacerMarkSpec.js +1 -1
- package/StyleView.js +3 -4
- package/StyleView.js.flow +0 -1
- package/TableBackgroundColorCommand.js +12 -14
- package/TableBackgroundColorCommand.js.flow +2 -5
- package/TableBorderColorCommand.js +12 -14
- package/TableBorderColorCommand.js.flow +2 -7
- package/TableCellColorCommand.js +10 -11
- package/TableCellColorCommand.js.flow +1 -2
- package/TableCellMenuPlugin.js +16 -15
- package/TableCellMenuPlugin.js.flow +5 -7
- package/TableInsertCommand.js +11 -13
- package/TableInsertCommand.js.flow +2 -4
- package/TableMergeCellsCommand.js +13 -12
- package/TableMergeCellsCommand.js.flow +4 -3
- package/TableNodesSpecs.js +4 -2
- package/TableNodesSpecs.js.flow +4 -2
- package/TableResizePlugin.js +17 -16
- package/TableResizePlugin.js.flow +1 -1
- package/TextInsertTabSpaceCommand.js +9 -9
- package/Types.js +1 -0
- package/Types.js.flow +2 -5
- package/WebFontLoader.js +4 -4
- package/bom.xml +17623 -24512
- package/buildEditorPlugins.js +4 -4
- package/buildInputRules.js +8 -4
- package/buildInputRules.js.flow +8 -4
- package/client/CollabConnector.js +9 -9
- package/client/EditorConnection.js +8 -6
- package/client/EditorConnection.js.flow +3 -2
- package/client/Licit.js +22 -58
- package/client/Licit.js.flow +12 -44
- package/client/Licit.test.js +49 -39
- package/client/Licit.test.js.flow +40 -34
- package/client/Reporter.js +3 -3
- package/client/SimpleConnector.js +4 -4
- package/client/http.js +0 -6
- package/client/http.js.flow +0 -8
- package/client/throttle.js +8 -2
- package/client/throttle.js.flow +2 -2
- package/convertFromDOMElement.js +2 -4
- package/convertFromDOMElement.js.flow +2 -5
- package/convertFromHTML.js +2 -3
- package/convertFromHTML.js.flow +2 -4
- package/convertFromJSON.js +1 -2
- package/convertFromJSON.js.flow +1 -2
- package/convertToCSSPTValue.js +6 -10
- package/convertToCSSPTValue.js.flow +8 -11
- package/createCommand.js +9 -9
- package/createEditorKeyMap.js +1 -1
- package/createEmptyEditorState.js +2 -3
- package/createEmptyEditorState.js.flow +2 -4
- package/createTableResizingPlugin.js +6 -6
- package/createTableResizingPlugin.js.flow +1 -1
- package/findActiveMark.js +1 -1
- package/findActiveMark.js.flow +1 -1
- package/insertTable.js +0 -3
- package/insertTable.js.flow +0 -2
- package/joinDown.js +1 -3
- package/joinDown.js.flow +1 -3
- package/joinUp.js +1 -3
- package/joinUp.js.flow +1 -3
- package/lookUpElement.js +2 -1
- package/lookUpElement.js.flow +1 -1
- package/normalizeHTML.js +3 -1
- package/normalizeHTML.js.flow +3 -1
- package/package.json +21 -16
- package/patchAnchorElements.js +1 -1
- package/patchAnchorElements.js.flow +1 -1
- package/patchBreakElements.js +3 -2
- package/patchBreakElements.js.flow +2 -2
- package/patchElementInlineStyles.js +1 -1
- package/patchElementInlineStyles.js.flow +1 -1
- package/patchListElements.js +4 -4
- package/patchListElements.js.flow +5 -5
- package/patchMathElements.js +5 -7
- package/patchMathElements.js.flow +2 -4
- package/patchStyleElements.js +1 -1
- package/patchStyleElements.js.flow +7 -6
- package/patchTableElements.js +2 -3
- package/patchTableElements.js.flow +2 -3
- package/sanitizeURL.js +1 -1
- package/sanitizeURL.js.flow +1 -1
- package/splitListItem.js +2 -2
- package/splitListItem.js.flow +1 -1
- package/toggleBlockquote.js +4 -5
- package/toggleBlockquote.js.flow +5 -12
- package/toggleCodeBlock.js +6 -6
- package/toggleCodeBlock.js.flow +10 -10
- package/ui/AlertInfo.js +9 -9
- package/ui/BookmarkNodeView.js +13 -12
- package/ui/CommandButton.js +9 -9
- package/ui/CommandMenu.js +12 -12
- package/ui/CommandMenu.js.flow +1 -1
- package/ui/CommandMenuButton.js +11 -12
- package/ui/CommandMenuButton.js.flow +2 -3
- package/ui/CustomEditorView.js +13 -12
- package/ui/CustomEditorView.js.flow +1 -0
- package/ui/CustomMenu.js +8 -8
- package/ui/CustomMenuItem.js +10 -10
- package/ui/CustomNodeView.js +27 -16
- package/ui/CustomNodeView.js.flow +16 -9
- package/ui/CustomRadioButton.js +13 -15
- package/ui/CustomRadioButton.js.flow +2 -3
- package/ui/DocLayoutEditor.js +10 -11
- package/ui/DocLayoutEditor.js.flow +1 -2
- package/ui/Editor.js +16 -13
- package/ui/Editor.js.flow +7 -8
- package/ui/EditorFrameset.js +9 -9
- package/ui/EditorToolbar.js +24 -29
- package/ui/EditorToolbar.js.flow +22 -41
- package/ui/EditorToolbarConfig.js +5 -5
- package/ui/EditorToolbarConfig.js.flow +1 -1
- package/ui/FontSizeCommandMenuButton.js +10 -10
- package/ui/FontSizeCommandMenuButton.js.flow +1 -1
- package/ui/FontTypeCommandMenuButton.js +11 -12
- package/ui/FontTypeCommandMenuButton.js.flow +4 -5
- package/ui/Frag.js +8 -8
- package/ui/Icon.js +12 -12
- package/ui/ImageInlineEditor.js +9 -9
- package/ui/LinkTooltip.js +62 -27
- package/ui/LinkTooltip.js.flow +55 -22
- package/ui/LinkURLEditor.js +152 -34
- package/ui/LinkURLEditor.js.flow +177 -51
- package/ui/ListItemNodeView.js +4 -4
- package/ui/ListTypeButton.js +11 -14
- package/ui/ListTypeButton.js.flow +2 -5
- package/ui/ListTypeCommandButton.js +10 -10
- package/ui/ListTypeCommandButton.js.flow +1 -1
- package/ui/ListTypeMenu.js +11 -11
- package/ui/ListTypeMenu.js.flow +1 -1
- package/ui/LoadingIndicator.js +8 -8
- package/ui/MathEditor.js +10 -14
- package/ui/MathEditor.js.flow +1 -7
- package/ui/MathInlineEditor.js +13 -13
- package/ui/MathInlineEditor.js.flow +3 -4
- package/ui/MathNodeView.js +16 -15
- package/ui/MathNodeView.js.flow +10 -20
- package/ui/PasteMenu.js +11 -14
- package/ui/PasteMenu.js.flow +0 -4
- package/ui/ResizeObserver.js +1 -1
- package/ui/ResizeObserver.js.flow +1 -1
- package/ui/RichTextEditor.js +9 -9
- package/ui/SelectionObserver.js +6 -6
- package/ui/SelectionObserver.js.flow +2 -2
- package/ui/TableCellMenu.js +9 -9
- package/ui/TableGridSizeEditor.js +11 -12
- package/ui/TableGridSizeEditor.js.flow +6 -3
- package/ui/TableNodeView.js +15 -13
- package/ui/TableNodeView.js.flow +3 -3
- package/ui/bindScrollHandler.js +2 -1
- package/ui/bindScrollHandler.js.flow +1 -1
- package/ui/canUseCSSFont.js +5 -4
- package/ui/canUseCSSFont.js.flow +4 -5
- package/ui/czi-editor.css +1 -4
- package/ui/czi-form.css +102 -8
- package/ui/czi-image-view.css +1 -5
- package/ui/czi-link-tooltip.css +41 -0
- package/ui/czi-list.css +0 -4
- package/ui/czi-loading-indicator.css +1 -46
- package/ui/czi-table-cell-menu.css +3 -1
- package/ui/findActiveFontSize.js +2 -1
- package/ui/findActiveFontSize.js.flow +1 -4
- package/ui/findActiveFontType.js +4 -3
- package/ui/findActiveFontType.js.flow +3 -6
- package/ui/handleEditorDrop.js +1 -1
- package/ui/handleEditorDrop.js.flow +1 -1
- package/ui/handleEditorKeyDown.js +1 -1
- package/ui/handleEditorKeyDown.js.flow +1 -1
- package/ui/handleEditorPaste.js +1 -1
- package/ui/handleEditorPaste.js.flow +1 -1
- package/ui/injectStyleSheet.js +2 -2
- package/ui/injectStyleSheet.js.flow +2 -4
- package/ui/isElementFullyVisible.js +1 -10
- package/ui/isElementFullyVisible.js.flow +1 -13
- package/ui/mathquill-editor/MathQuillEditor.js +12 -13
- package/ui/mathquill-editor/MathQuillEditor.js.flow +0 -1
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +9 -9
- package/ui/mathquill-editor/mathquill-import-kludge.js +1 -8
- package/ui/mathquill-editor/mathquill-import-kludge.js.flow +0 -7
- package/ui/renderLaTeXAsHTML.js +3 -3
- package/ui/resolveImage.js +4 -5
- package/ui/resolveImage.js.flow +3 -5
- package/ui/toCSSLineSpacing.js +2 -3
- package/ui/toCSSLineSpacing.js.flow +2 -4
package/ui/BookmarkNodeView.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function
|
|
5
|
-
function
|
|
6
|
-
function
|
|
2
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
3
|
+
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
|
|
4
|
+
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
|
|
5
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
6
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
7
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _possibleConstructorReturn(
|
|
9
|
-
function _assertThisInitialized(
|
|
9
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
10
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
function _getPrototypeOf(
|
|
12
|
-
function _inherits(
|
|
13
|
-
function _setPrototypeOf(
|
|
14
|
-
function _defineProperty(
|
|
12
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
13
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
14
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
18
|
import { Node } from 'prosemirror-model';
|
|
@@ -75,7 +76,7 @@ var BookmarkNodeView = /*#__PURE__*/function (_CustomNodeView) {
|
|
|
75
76
|
}, {
|
|
76
77
|
key: "update",
|
|
77
78
|
value: function update(node, decorations) {
|
|
78
|
-
|
|
79
|
+
_superPropGet(BookmarkNodeView, "update", this, 3)([node, decorations]);
|
|
79
80
|
return true;
|
|
80
81
|
}
|
|
81
82
|
|
package/ui/CommandButton.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
-
function _possibleConstructorReturn(
|
|
7
|
-
function _assertThisInitialized(
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
function _getPrototypeOf(
|
|
10
|
-
function _inherits(
|
|
11
|
-
function _setPrototypeOf(
|
|
12
|
-
function _defineProperty(
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
import { EditorState } from 'prosemirror-state';
|
package/ui/CommandMenu.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
-
function _possibleConstructorReturn(
|
|
7
|
-
function _assertThisInitialized(
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
function _getPrototypeOf(
|
|
10
|
-
function _inherits(
|
|
11
|
-
function _setPrototypeOf(
|
|
12
|
-
function _defineProperty(
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
import { EditorState } from 'prosemirror-state';
|
|
@@ -43,7 +43,7 @@ var CommandMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
43
43
|
editorView = _this$props.editorView,
|
|
44
44
|
onCommand = _this$props.onCommand;
|
|
45
45
|
if (command.execute(editorState, dispatch, editorView, e)) {
|
|
46
|
-
onCommand
|
|
46
|
+
onCommand === null || onCommand === void 0 || onCommand();
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
return _this;
|
|
@@ -70,7 +70,7 @@ var CommandMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
70
70
|
} catch (ex) {
|
|
71
71
|
disabled = false;
|
|
72
72
|
}
|
|
73
|
-
children.push(
|
|
73
|
+
children.push(/*#__PURE__*/React.createElement(CustomMenuItem, {
|
|
74
74
|
active: command.isActive(editorState),
|
|
75
75
|
disabled: disabled,
|
|
76
76
|
key: label,
|
|
@@ -81,7 +81,7 @@ var CommandMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
81
81
|
}));
|
|
82
82
|
});
|
|
83
83
|
if (ii !== jj) {
|
|
84
|
-
children.push(
|
|
84
|
+
children.push(/*#__PURE__*/React.createElement(CustomMenuItem.Separator, {
|
|
85
85
|
key: "".concat(String(ii), "-hr")
|
|
86
86
|
}));
|
|
87
87
|
}
|
package/ui/CommandMenu.js.flow
CHANGED
|
@@ -67,7 +67,7 @@ class CommandMenu extends React.PureComponent<any, any> {
|
|
|
67
67
|
_execute = (command: UICommand, e: SyntheticEvent<>) => {
|
|
68
68
|
const { dispatch, editorState, editorView, onCommand } = this.props;
|
|
69
69
|
if (command.execute(editorState, dispatch, editorView, e)) {
|
|
70
|
-
onCommand
|
|
70
|
+
onCommand?.();
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
}
|
package/ui/CommandMenuButton.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _classCallCheck(
|
|
5
|
-
function _defineProperties(
|
|
6
|
-
function _createClass(
|
|
4
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
6
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7
7
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _possibleConstructorReturn(
|
|
9
|
-
function _assertThisInitialized(
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
function _getPrototypeOf(
|
|
12
|
-
function _inherits(
|
|
13
|
-
function _setPrototypeOf(
|
|
14
|
-
function _defineProperty(
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
import cx from 'classnames';
|
|
@@ -20,9 +20,8 @@ import { Transform } from 'prosemirror-transform';
|
|
|
20
20
|
import { EditorView } from 'prosemirror-view';
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
import CommandMenu from './CommandMenu.js';
|
|
23
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
23
|
+
import { CustomButton, createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
24
24
|
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
25
|
-
import { createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
26
25
|
import uuid from './uuid.js';
|
|
27
26
|
import './czi-custom-menu-button.css';
|
|
28
27
|
var CommandMenuButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -49,7 +48,7 @@ var CommandMenuButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
49
48
|
_defineProperty(_this, "_hideMenu", function () {
|
|
50
49
|
var menu = _this._menu;
|
|
51
50
|
_this._menu = null;
|
|
52
|
-
menu
|
|
51
|
+
menu === null || menu === void 0 || menu.close();
|
|
53
52
|
});
|
|
54
53
|
_defineProperty(_this, "_showMenu", function () {
|
|
55
54
|
var menu = _this._menu;
|
|
@@ -7,9 +7,8 @@ import { EditorView } from 'prosemirror-view';
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
import CommandMenu from './CommandMenu.js';
|
|
10
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
10
|
+
import { CustomButton, createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
11
11
|
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
12
|
-
import { createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
13
12
|
import uuid from './uuid.js';
|
|
14
13
|
|
|
15
14
|
import './czi-custom-menu-button.css';
|
|
@@ -96,7 +95,7 @@ class CommandMenuButton extends React.PureComponent<any, any> {
|
|
|
96
95
|
_hideMenu = (): void => {
|
|
97
96
|
const menu = this._menu;
|
|
98
97
|
this._menu = null;
|
|
99
|
-
menu
|
|
98
|
+
menu?.close();
|
|
100
99
|
};
|
|
101
100
|
|
|
102
101
|
_showMenu = (): void => {
|
package/ui/CustomEditorView.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
-
function _possibleConstructorReturn(
|
|
7
|
-
function _assertThisInitialized(
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
function
|
|
10
|
-
function
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
function
|
|
9
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
10
|
+
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
|
|
11
|
+
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
|
|
12
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
13
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
14
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
18
|
import { EditorView } from 'prosemirror-view';
|
|
@@ -36,7 +37,7 @@ var CustomEditorView = /*#__PURE__*/function (_EditorView) {
|
|
|
36
37
|
return _createClass(CustomEditorView, [{
|
|
37
38
|
key: "destroy",
|
|
38
39
|
value: function destroy() {
|
|
39
|
-
|
|
40
|
+
_superPropGet(CustomEditorView, "destroy", this, 3)([]);
|
|
40
41
|
this._props = {};
|
|
41
42
|
}
|
|
42
43
|
}]);
|
package/ui/CustomMenu.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _possibleConstructorReturn(
|
|
9
|
-
function _assertThisInitialized(
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
function _getPrototypeOf(
|
|
12
|
-
function _inherits(
|
|
13
|
-
function _setPrototypeOf(
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
import './czi-custom-menu.css';
|
|
16
16
|
import './czi-custom-scrollbar.css';
|
package/ui/CustomMenuItem.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
3
|
-
function _defineProperty(
|
|
4
|
-
function _classCallCheck(
|
|
5
|
-
function _defineProperties(
|
|
6
|
-
function _createClass(
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
6
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
8
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
|
-
function _possibleConstructorReturn(
|
|
11
|
-
function _assertThisInitialized(
|
|
10
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
11
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
-
function _getPrototypeOf(
|
|
14
|
-
function _inherits(
|
|
15
|
-
function _setPrototypeOf(
|
|
13
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
14
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
15
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
16
16
|
import './czi-custom-menu-item.css';
|
|
17
17
|
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
18
18
|
import * as React from 'react';
|
package/ui/CustomNodeView.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _classCallCheck(
|
|
5
|
-
function _defineProperties(
|
|
6
|
-
function _createClass(
|
|
7
|
-
function _defineProperty(
|
|
4
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
6
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
function _createForOfIteratorHelper(
|
|
11
|
-
function _unsupportedIterableToArray(
|
|
12
|
-
function _arrayLikeToArray(
|
|
13
|
-
// @xflow
|
|
14
|
-
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
13
|
import { Node } from 'prosemirror-model';
|
|
16
14
|
import { Decoration, EditorView } from 'prosemirror-view';
|
|
17
15
|
import * as React from 'react';
|
|
18
|
-
import ReactDOM from 'react-dom';
|
|
16
|
+
import ReactDOM from 'react-dom/client';
|
|
19
17
|
import SelectionObserver from './SelectionObserver.js';
|
|
20
18
|
var bpfrpt_proptype_NodeViewProps = {
|
|
21
19
|
"editorView": function editorView() {
|
|
@@ -63,7 +61,7 @@ function onMutation(mutations, observer) {
|
|
|
63
61
|
var _el = _view.dom;
|
|
64
62
|
if (!root.contains(_el)) {
|
|
65
63
|
mountedViews["delete"](_el);
|
|
66
|
-
|
|
64
|
+
_view.unmountReactComponent();
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
} catch (err) {
|
|
@@ -126,6 +124,7 @@ var CustomNodeView = /*#__PURE__*/function () {
|
|
|
126
124
|
_classCallCheck(this, CustomNodeView);
|
|
127
125
|
_defineProperty(this, "dom", void 0);
|
|
128
126
|
_defineProperty(this, "props", void 0);
|
|
127
|
+
_defineProperty(this, "reactRoot", null);
|
|
129
128
|
_defineProperty(this, "_selected", void 0);
|
|
130
129
|
this.props = {
|
|
131
130
|
decorations: decorations,
|
|
@@ -145,11 +144,11 @@ var CustomNodeView = /*#__PURE__*/function () {
|
|
|
145
144
|
// [FS] IRAD-1060 2020-09-10
|
|
146
145
|
// Observe the editorview's dom insteadof root document so that
|
|
147
146
|
// if multiple instances of editor in a page shouldn't cross-talk
|
|
148
|
-
mutationObserver.observe(
|
|
147
|
+
mutationObserver.observe(/*document*/editorView.dom, {
|
|
149
148
|
childList: true,
|
|
150
149
|
subtree: true
|
|
151
150
|
});
|
|
152
|
-
selectionObserver.observe(
|
|
151
|
+
selectionObserver.observe(/*document*/editorView.dom);
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
154
|
return _createClass(CustomNodeView, [{
|
|
@@ -198,7 +197,6 @@ var CustomNodeView = /*#__PURE__*/function () {
|
|
|
198
197
|
}, {
|
|
199
198
|
key: "renderReactComponent",
|
|
200
199
|
value: function renderReactComponent() {
|
|
201
|
-
// return <CustomNodeViewComponent {...this.props} />;
|
|
202
200
|
throw new Error('not implemented');
|
|
203
201
|
}
|
|
204
202
|
}, {
|
|
@@ -211,14 +209,16 @@ var CustomNodeView = /*#__PURE__*/function () {
|
|
|
211
209
|
// When destroying the node view, remove from the set.
|
|
212
210
|
// FIX: This solves the image missing issue.
|
|
213
211
|
pendingViews["delete"](this);
|
|
212
|
+
this.unmountReactComponent();
|
|
214
213
|
}
|
|
215
214
|
}, {
|
|
216
215
|
key: "__renderReactComponent",
|
|
217
216
|
value: function __renderReactComponent() {
|
|
217
|
+
var _editorView$state;
|
|
218
218
|
var _this$props = this.props,
|
|
219
219
|
editorView = _this$props.editorView,
|
|
220
220
|
getPos = _this$props.getPos;
|
|
221
|
-
if (editorView.state &&
|
|
221
|
+
if ((_editorView$state = editorView.state) !== null && _editorView$state !== void 0 && _editorView$state.selection) {
|
|
222
222
|
var from = editorView.state.selection.from;
|
|
223
223
|
var pos = getPos();
|
|
224
224
|
this.props.selected = this._selected;
|
|
@@ -227,7 +227,18 @@ var CustomNodeView = /*#__PURE__*/function () {
|
|
|
227
227
|
this.props.selected = false;
|
|
228
228
|
this.props.focused = false;
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
if (!this.reactRoot) {
|
|
231
|
+
this.reactRoot = ReactDOM.createRoot(this.dom);
|
|
232
|
+
}
|
|
233
|
+
this.reactRoot.render(this.renderReactComponent());
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
key: "unmountReactComponent",
|
|
237
|
+
value: function unmountReactComponent() {
|
|
238
|
+
if (this.reactRoot) {
|
|
239
|
+
this.reactRoot.unmount();
|
|
240
|
+
this.reactRoot = null;
|
|
241
|
+
}
|
|
231
242
|
}
|
|
232
243
|
}]);
|
|
233
244
|
}();
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
// @xflow
|
|
2
|
-
|
|
3
1
|
import { Node } from 'prosemirror-model';
|
|
4
2
|
import { Decoration, EditorView } from 'prosemirror-view';
|
|
5
3
|
import * as React from 'react';
|
|
6
|
-
import ReactDOM from 'react-dom';
|
|
4
|
+
import ReactDOM from 'react-dom/client';
|
|
7
5
|
|
|
8
6
|
import SelectionObserver from './SelectionObserver.js';
|
|
9
7
|
|
|
@@ -41,7 +39,7 @@ function onMutation(mutations: any, observer: MutationObserver): void {
|
|
|
41
39
|
const el = view.dom;
|
|
42
40
|
if (!root.contains(el)) {
|
|
43
41
|
mountedViews.delete(el);
|
|
44
|
-
|
|
42
|
+
view.unmountReactComponent();
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
|
|
@@ -91,9 +89,8 @@ const mutationObserver = new MutationObserver(onMutation);
|
|
|
91
89
|
// https://github.com/ProseMirror/prosemirror-view/blob/master/src/viewdesc.js#L429
|
|
92
90
|
class CustomNodeView {
|
|
93
91
|
dom: HTMLElement;
|
|
94
|
-
|
|
95
92
|
props: NodeViewProps;
|
|
96
|
-
|
|
93
|
+
reactRoot: ReactDOM.Root | null = null;
|
|
97
94
|
_selected: null;
|
|
98
95
|
|
|
99
96
|
constructor(
|
|
@@ -166,7 +163,6 @@ class CustomNodeView {
|
|
|
166
163
|
|
|
167
164
|
// This should be overwrite by subclass.
|
|
168
165
|
renderReactComponent(): React.Element<any> {
|
|
169
|
-
// return <CustomNodeViewComponent {...this.props} />;
|
|
170
166
|
throw new Error('not implemented');
|
|
171
167
|
}
|
|
172
168
|
|
|
@@ -178,12 +174,13 @@ class CustomNodeView {
|
|
|
178
174
|
// When destroying the node view, remove from the set.
|
|
179
175
|
// FIX: This solves the image missing issue.
|
|
180
176
|
pendingViews.delete(this);
|
|
177
|
+
this.unmountReactComponent();
|
|
181
178
|
}
|
|
182
179
|
|
|
183
180
|
__renderReactComponent(): void {
|
|
184
181
|
const { editorView, getPos } = this.props;
|
|
185
182
|
|
|
186
|
-
if (editorView.state
|
|
183
|
+
if (editorView.state?.selection) {
|
|
187
184
|
const { from } = editorView.state.selection;
|
|
188
185
|
const pos = getPos();
|
|
189
186
|
this.props.selected = this._selected;
|
|
@@ -193,7 +190,17 @@ class CustomNodeView {
|
|
|
193
190
|
this.props.focused = false;
|
|
194
191
|
}
|
|
195
192
|
|
|
196
|
-
|
|
193
|
+
if (!this.reactRoot) {
|
|
194
|
+
this.reactRoot = ReactDOM.createRoot(this.dom);
|
|
195
|
+
}
|
|
196
|
+
this.reactRoot.render(this.renderReactComponent());
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
unmountReactComponent(): void {
|
|
200
|
+
if (this.reactRoot) {
|
|
201
|
+
this.reactRoot.unmount();
|
|
202
|
+
this.reactRoot = null;
|
|
203
|
+
}
|
|
197
204
|
}
|
|
198
205
|
}
|
|
199
206
|
|