@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
|
@@ -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
|
// [FS] IRAD-1039 2020-09-23
|
|
@@ -73,7 +73,7 @@ var ListTypeCommandButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
73
73
|
// [FS] IRAD-1317 2021-05-06
|
|
74
74
|
// To disable the list menu when select an image
|
|
75
75
|
disabled = hasImageNode(editorState);
|
|
76
|
-
disabled = editorView.disabled || disabled
|
|
76
|
+
disabled = editorView.disabled || disabled;
|
|
77
77
|
}
|
|
78
78
|
return /*#__PURE__*/React.createElement(ListTypeButton, {
|
|
79
79
|
className: "width-50 czi-icon format_list_numbered",
|
|
@@ -66,7 +66,7 @@ class ListTypeCommandButton extends React.PureComponent<any, any> {
|
|
|
66
66
|
// To disable the list menu when select an image
|
|
67
67
|
disabled =
|
|
68
68
|
hasImageNode(editorState);
|
|
69
|
-
|
|
69
|
+
disabled = editorView.disabled || disabled;
|
|
70
70
|
}
|
|
71
71
|
return (
|
|
72
72
|
<ListTypeButton
|
package/ui/ListTypeMenu.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 * as React from 'react';
|
|
@@ -49,7 +49,7 @@ var ListTypeMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
49
49
|
editorView = _this$props.editorView,
|
|
50
50
|
onCommand = _this$props.onCommand;
|
|
51
51
|
if (command.execute(editorState, dispatch, editorView, e)) {
|
|
52
|
-
onCommand
|
|
52
|
+
onCommand === null || onCommand === void 0 || onCommand();
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
return _this;
|
|
@@ -64,7 +64,7 @@ var ListTypeMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
64
64
|
commandGroups.forEach(function (group, ii) {
|
|
65
65
|
Object.keys(group).forEach(function (label) {
|
|
66
66
|
var command = group[label];
|
|
67
|
-
children.push(
|
|
67
|
+
children.push(/*#__PURE__*/React.createElement("button", {
|
|
68
68
|
className: "buttonsize",
|
|
69
69
|
id: label,
|
|
70
70
|
key: label,
|
package/ui/ListTypeMenu.js.flow
CHANGED
|
@@ -62,7 +62,7 @@ class ListTypeMenu extends React.PureComponent<any, any> {
|
|
|
62
62
|
_execute = (command, e) => {
|
|
63
63
|
const { dispatch, editorState, editorView, onCommand } = this.props;
|
|
64
64
|
if (command.execute(editorState, dispatch, editorView, e)) {
|
|
65
|
-
onCommand
|
|
65
|
+
onCommand?.();
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
package/ui/LoadingIndicator.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 './czi-loading-indicator.css';
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
|
package/ui/MathEditor.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
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 * as React from 'react';
|
|
16
16
|
import PropTypes from 'prop-types';
|
|
17
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
17
|
+
import { CustomButton, preventEventDefault } from '@modusoperandi/licit-ui-commands';
|
|
18
18
|
import MathQuillEditor from './mathquill-editor/MathQuillEditor.js';
|
|
19
|
-
import { preventEventDefault } from '@modusoperandi/licit-ui-commands';
|
|
20
|
-
import uuid from './uuid.js';
|
|
21
19
|
import './czi-form.css';
|
|
22
20
|
var MathEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
23
21
|
function MathEditor() {
|
|
@@ -31,8 +29,6 @@ var MathEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
31
29
|
initialValue: _this.props.initialValue,
|
|
32
30
|
value: _this.props.initialValue || ''
|
|
33
31
|
});
|
|
34
|
-
_defineProperty(_this, "_id", uuid());
|
|
35
|
-
_defineProperty(_this, "_unmounted", false);
|
|
36
32
|
_defineProperty(_this, "_onChange", function (value) {
|
|
37
33
|
_this.setState({
|
|
38
34
|
value: value
|
package/ui/MathEditor.js.flow
CHANGED
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
|
|
6
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
5
|
+
import { CustomButton, preventEventDefault } from '@modusoperandi/licit-ui-commands';
|
|
7
6
|
import MathQuillEditor from './mathquill-editor/MathQuillEditor.js';
|
|
8
|
-
import { preventEventDefault } from '@modusoperandi/licit-ui-commands';
|
|
9
|
-
import uuid from './uuid.js';
|
|
10
7
|
|
|
11
8
|
import './czi-form.css';
|
|
12
9
|
|
|
@@ -36,9 +33,6 @@ class MathEditor extends React.PureComponent<any, any> {
|
|
|
36
33
|
value: this.props.initialValue || '',
|
|
37
34
|
};
|
|
38
35
|
|
|
39
|
-
_id = uuid();
|
|
40
|
-
_unmounted = false;
|
|
41
|
-
|
|
42
36
|
render(): React.Element<any> {
|
|
43
37
|
const { initialValue, value } = this.state;
|
|
44
38
|
return (
|
package/ui/MathInlineEditor.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
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 './czi-inline-editor.css';
|
|
18
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
18
|
+
import { CustomButton, createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
19
19
|
import CustomEditorView from './CustomEditorView.js';
|
|
20
20
|
import MathEditor from './MathEditor.js';
|
|
21
21
|
import * as React from 'react';
|
|
22
|
-
import { createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
23
22
|
var MathAlignValues = {
|
|
24
23
|
NONE: {
|
|
25
24
|
value: null,
|
|
@@ -59,7 +58,7 @@ var MathInlineEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
59
58
|
value = _this$props.value;
|
|
60
59
|
var props = {
|
|
61
60
|
runtime: editorView ? editorView.runtime : null,
|
|
62
|
-
initialValue: value
|
|
61
|
+
initialValue: (value === null || value === void 0 ? void 0 : value.latex) || ''
|
|
63
62
|
};
|
|
64
63
|
_this._popUp = createPopUp(MathEditor, props, {
|
|
65
64
|
autoDismiss: false,
|
|
@@ -85,7 +84,8 @@ var MathInlineEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
85
84
|
return _createClass(MathInlineEditor, [{
|
|
86
85
|
key: "componentWillUnmount",
|
|
87
86
|
value: function componentWillUnmount() {
|
|
88
|
-
|
|
87
|
+
var _this$_popUp;
|
|
88
|
+
(_this$_popUp = this._popUp) === null || _this$_popUp === void 0 || _this$_popUp.close();
|
|
89
89
|
}
|
|
90
90
|
}, {
|
|
91
91
|
key: "render",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import './czi-inline-editor.css';
|
|
4
|
-
import { CustomButton } from '@modusoperandi/licit-ui-commands';
|
|
4
|
+
import { CustomButton, createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
5
5
|
import CustomEditorView from './CustomEditorView.js';
|
|
6
6
|
import MathEditor from './MathEditor.js';
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
import { createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
9
8
|
|
|
10
9
|
const MathAlignValues = {
|
|
11
10
|
NONE: {
|
|
@@ -35,7 +34,7 @@ class MathInlineEditor extends React.PureComponent<any, any> {
|
|
|
35
34
|
_popUp = null;
|
|
36
35
|
|
|
37
36
|
componentWillUnmount(): void {
|
|
38
|
-
this._popUp
|
|
37
|
+
this._popUp?.close();
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
render(): React.Element<any> {
|
|
@@ -79,7 +78,7 @@ class MathInlineEditor extends React.PureComponent<any, any> {
|
|
|
79
78
|
const { editorView, value } = this.props;
|
|
80
79
|
const props = {
|
|
81
80
|
runtime: editorView ? editorView.runtime : null,
|
|
82
|
-
initialValue: (value
|
|
81
|
+
initialValue: (value?.latex) || '',
|
|
83
82
|
};
|
|
84
83
|
this._popUp = createPopUp(MathEditor, props, {
|
|
85
84
|
autoDismiss: false,
|
package/ui/MathNodeView.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
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
|
|
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; }
|
|
4
5
|
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; }
|
|
5
6
|
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; }
|
|
6
|
-
function _classCallCheck(
|
|
7
|
-
function _defineProperties(
|
|
8
|
-
function _createClass(
|
|
7
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
8
|
+
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); } }
|
|
9
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
9
10
|
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(
|
|
11
|
+
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); }
|
|
12
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
12
13
|
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(
|
|
16
|
-
function _defineProperty(
|
|
14
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
15
|
+
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); }
|
|
16
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
17
|
+
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; }
|
|
17
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
19
|
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); }
|
|
19
20
|
import './czi-math-view.css';
|
|
20
21
|
import CustomNodeView from './CustomNodeView.js';
|
|
21
22
|
import MathInlineEditor from './MathInlineEditor.js';
|
|
22
23
|
import * as React from 'react';
|
|
23
|
-
import { createPopUp } from '@modusoperandi/licit-ui-commands';
|
|
24
|
+
import { createPopUp, atAnchorBottomCenter } from '@modusoperandi/licit-ui-commands';
|
|
24
25
|
import cx from 'classnames';
|
|
25
26
|
import renderLaTeXAsHTML from './renderLaTeXAsHTML.js';
|
|
26
27
|
import uuid from './uuid.js';
|
|
27
28
|
import { Decoration } from 'prosemirror-view';
|
|
28
29
|
import { FRAMESET_BODY_CLASSNAME } from './EditorFrameset.js';
|
|
29
30
|
import { Node } from 'prosemirror-model';
|
|
30
|
-
import { atAnchorBottomCenter } from '@modusoperandi/licit-ui-commands';
|
|
31
31
|
import { NodeSelection } from 'prosemirror-state';
|
|
32
32
|
var EMPTY_SRC = 'data:image/gif;base64,' + 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
|
33
33
|
var MathViewBody = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -141,7 +141,8 @@ var MathViewBody = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
141
141
|
var _this2 = this;
|
|
142
142
|
var el = document.getElementById(this._id);
|
|
143
143
|
if (!el || el.getAttribute('data-active') !== 'true') {
|
|
144
|
-
|
|
144
|
+
var _this$_inlineEditor;
|
|
145
|
+
(_this$_inlineEditor = this._inlineEditor) === null || _this$_inlineEditor === void 0 || _this$_inlineEditor.close();
|
|
145
146
|
return;
|
|
146
147
|
}
|
|
147
148
|
var node = this.props.node;
|
|
@@ -188,7 +189,7 @@ var MathNodeView = /*#__PURE__*/function (_CustomNodeView) {
|
|
|
188
189
|
}, {
|
|
189
190
|
key: "update",
|
|
190
191
|
value: function update(node, decorations) {
|
|
191
|
-
|
|
192
|
+
_superPropGet(MathNodeView, "update", this, 3)([node, decorations]);
|
|
192
193
|
this._updateDOM(this.dom);
|
|
193
194
|
return true;
|
|
194
195
|
}
|
package/ui/MathNodeView.js.flow
CHANGED
|
@@ -4,29 +4,19 @@ import './czi-math-view.css';
|
|
|
4
4
|
import CustomNodeView from './CustomNodeView.js';
|
|
5
5
|
import MathInlineEditor from './MathInlineEditor.js';
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createPopUp,
|
|
9
|
+
atAnchorBottomCenter,
|
|
10
|
+
} from '@modusoperandi/licit-ui-commands';
|
|
8
11
|
import cx from 'classnames';
|
|
9
12
|
import renderLaTeXAsHTML from './renderLaTeXAsHTML.js';
|
|
10
13
|
import uuid from './uuid.js';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
} from 'prosemirror-
|
|
14
|
-
import {
|
|
15
|
-
FRAMESET_BODY_CLASSNAME
|
|
16
|
-
} from './EditorFrameset.js';
|
|
17
|
-
import {
|
|
18
|
-
Node
|
|
19
|
-
} from 'prosemirror-model';
|
|
20
|
-
import {
|
|
21
|
-
atAnchorBottomCenter
|
|
22
|
-
} from '@modusoperandi/licit-ui-commands';
|
|
23
|
-
import {
|
|
24
|
-
NodeSelection
|
|
25
|
-
} from 'prosemirror-state';
|
|
14
|
+
import { Decoration } from 'prosemirror-view';
|
|
15
|
+
import { FRAMESET_BODY_CLASSNAME } from './EditorFrameset.js';
|
|
16
|
+
import { Node } from 'prosemirror-model';
|
|
17
|
+
import { NodeSelection } from 'prosemirror-state';
|
|
26
18
|
|
|
27
|
-
import type {
|
|
28
|
-
NodeViewProps
|
|
29
|
-
} from './CustomNodeView.js';
|
|
19
|
+
import type { NodeViewProps } from './CustomNodeView.js';
|
|
30
20
|
const EMPTY_SRC =
|
|
31
21
|
'data:image/gif;base64,' +
|
|
32
22
|
'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
|
@@ -91,7 +81,7 @@ class MathViewBody extends React.PureComponent<any, any> {
|
|
|
91
81
|
_renderInlineEditor(): void {
|
|
92
82
|
const el = document.getElementById(this._id);
|
|
93
83
|
if (!el || el.getAttribute('data-active') !== 'true') {
|
|
94
|
-
this._inlineEditor
|
|
84
|
+
this._inlineEditor?.close();
|
|
95
85
|
return;
|
|
96
86
|
}
|
|
97
87
|
const { node } = this.props;
|
package/ui/PasteMenu.js
CHANGED
|
@@ -1,20 +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 _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 * as React from 'react';
|
|
16
|
-
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
17
|
-
import { EditorView } from 'prosemirror-view';
|
|
18
16
|
import uuid from './uuid';
|
|
19
17
|
import './listType.css';
|
|
20
18
|
|
|
@@ -28,7 +26,6 @@ var PasteMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
28
26
|
args[_key] = arguments[_key];
|
|
29
27
|
}
|
|
30
28
|
_this = _callSuper(this, PasteMenu, [].concat(args));
|
|
31
|
-
_defineProperty(_this, "_activeCommand", null);
|
|
32
29
|
_defineProperty(_this, "props", void 0);
|
|
33
30
|
_defineProperty(_this, "_menu", null);
|
|
34
31
|
_defineProperty(_this, "_id", uuid());
|
|
@@ -46,7 +43,7 @@ var PasteMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
46
43
|
value: function render() {
|
|
47
44
|
var _this2 = this;
|
|
48
45
|
var children = [];
|
|
49
|
-
children.push(
|
|
46
|
+
children.push(/*#__PURE__*/React.createElement("button", {
|
|
50
47
|
className: "pastemenu",
|
|
51
48
|
id: "paste",
|
|
52
49
|
key: "paste",
|
|
@@ -55,7 +52,7 @@ var PasteMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
55
52
|
},
|
|
56
53
|
value: "paste"
|
|
57
54
|
}, "Paste"));
|
|
58
|
-
children.push(
|
|
55
|
+
children.push(/*#__PURE__*/React.createElement("button", {
|
|
59
56
|
className: "pastemenu",
|
|
60
57
|
id: "keepTextOnly",
|
|
61
58
|
key: "keepTextOnly",
|
package/ui/PasteMenu.js.flow
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
4
2
|
import uuid from './uuid';
|
|
5
3
|
import './listType.css';
|
|
6
4
|
|
|
@@ -8,9 +6,7 @@ import './listType.css';
|
|
|
8
6
|
// Popup menu UI with paste options.
|
|
9
7
|
|
|
10
8
|
class PasteMenu extends React.PureComponent<any, any> {
|
|
11
|
-
_activeCommand: ?UICommand = null;
|
|
12
9
|
props: {
|
|
13
|
-
view: EditorView,
|
|
14
10
|
close: (?string) => void,
|
|
15
11
|
};
|
|
16
12
|
|
package/ui/ResizeObserver.js
CHANGED
|
@@ -62,7 +62,7 @@ export function unobserve(node, callback) {
|
|
|
62
62
|
var callbacks = nodesObserving.has(el) ? nullthrows(nodesObserving.get(el)).filter(function (cb) {
|
|
63
63
|
return cb !== callback;
|
|
64
64
|
}) : null;
|
|
65
|
-
if (callbacks && callbacks.length) {
|
|
65
|
+
if (callbacks !== null && callbacks !== void 0 && callbacks.length) {
|
|
66
66
|
nodesObserving.set(el, callbacks);
|
|
67
67
|
} else {
|
|
68
68
|
nodesObserving["delete"](el);
|
|
@@ -79,7 +79,7 @@ export function unobserve(node: HTMLElement, callback?: ResizeCallback): void {
|
|
|
79
79
|
const callbacks = nodesObserving.has(el)
|
|
80
80
|
? nullthrows(nodesObserving.get(el)).filter((cb) => cb !== callback)
|
|
81
81
|
: null;
|
|
82
|
-
if (callbacks
|
|
82
|
+
if (callbacks?.length) {
|
|
83
83
|
nodesObserving.set(el, callbacks);
|
|
84
84
|
} else {
|
|
85
85
|
nodesObserving.delete(el);
|