@modusoperandi/licit 1.0.7 → 1.0.9
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/ContentPlaceholderPlugin.js +0 -1
- package/ContentPlaceholderPlugin.js.flow +0 -2
- package/CursorPlaceholderPlugin.js +0 -1
- package/CursorPlaceholderPlugin.js.flow +0 -2
- package/HTMLMutator.js +2 -3
- package/HTMLMutator.js.flow +2 -3
- package/ImageUploadPlaceholderPlugin.js +1 -3
- package/ImageUploadPlaceholderPlugin.js.flow +1 -4
- package/LinkTooltipPlugin.js +0 -1
- package/LinkTooltipPlugin.js.flow +0 -2
- package/ListItemMergeCommand.js +2 -2
- package/ListItemMergeCommand.js.flow +1 -2
- package/SelectionPlaceholderPlugin.js +0 -1
- package/SelectionPlaceholderPlugin.js.flow +0 -2
- package/TableBackgroundColorCommand.js +1 -2
- package/TableBackgroundColorCommand.js.flow +12 -13
- package/TableBorderColorCommand.js +1 -2
- package/TableBorderColorCommand.js.flow +12 -13
- package/TableCellColorCommand.js +1 -2
- package/TableCellColorCommand.js.flow +1 -2
- package/TableCellMenuPlugin.js +0 -1
- package/TableCellMenuPlugin.js.flow +0 -1
- package/TableInsertCommand.js +1 -2
- package/TableInsertCommand.js.flow +1 -2
- package/TableResizePlugin.js +1 -2
- package/TableResizePlugin.js.flow +1 -2
- package/bom.xml +7852 -9122
- package/client/Licit.js +0 -1
- package/client/Licit.js.flow +0 -1
- package/package.json +8 -7
- package/patchListElements.js +2 -3
- package/patchListElements.js.flow +2 -3
- package/styles.css +32 -3
- package/ui/AlertInfo.js +0 -1
- package/ui/AlertInfo.js.flow +0 -1
- package/ui/BookmarkNodeView.js +0 -1
- package/ui/BookmarkNodeView.js.flow +0 -2
- package/ui/CommandMenuButton.js +0 -1
- package/ui/CommandMenuButton.js.flow +0 -2
- package/ui/CustomMenu.js +0 -2
- package/ui/CustomMenu.js.flow +0 -3
- package/ui/CustomMenuItem.js +0 -1
- package/ui/CustomMenuItem.js.flow +0 -1
- package/ui/CustomRadioButton.js +0 -1
- package/ui/CustomRadioButton.js.flow +0 -1
- package/ui/DocLayoutEditor.js +0 -2
- package/ui/DocLayoutEditor.js.flow +0 -3
- package/ui/Editor.js +0 -3
- package/ui/Editor.js.flow +0 -4
- package/ui/EditorFrameset.js +0 -1
- package/ui/EditorFrameset.js.flow +0 -2
- package/ui/EditorToolbar.js +0 -1
- package/ui/EditorToolbar.js.flow +0 -2
- package/ui/Frag.js +0 -1
- package/ui/Frag.js.flow +0 -2
- package/ui/Icon.js +0 -6
- package/ui/Icon.js.flow +0 -7
- package/ui/ImageInlineEditor.js +0 -1
- package/ui/ImageInlineEditor.js.flow +0 -1
- package/ui/LinkTooltip.js +0 -1
- package/ui/LinkTooltip.js.flow +0 -2
- package/ui/LinkURLEditor.js +0 -3
- package/ui/LinkURLEditor.js.flow +0 -4
- package/ui/ListTypeButton.js +0 -1
- package/ui/ListTypeButton.js.flow +0 -1
- package/ui/ListTypeMenu.js +0 -1
- package/ui/ListTypeMenu.js.flow +0 -1
- package/ui/LoadingIndicator.js +0 -1
- package/ui/LoadingIndicator.js.flow +0 -1
- package/ui/MathEditor.js +0 -1
- package/ui/MathEditor.js.flow +0 -2
- package/ui/MathInlineEditor.js +0 -1
- package/ui/MathInlineEditor.js.flow +0 -1
- package/ui/MathNodeView.js +0 -1
- package/ui/MathNodeView.js.flow +0 -1
- package/ui/PasteMenu.js +0 -1
- package/ui/PasteMenu.js.flow +0 -1
- package/ui/ResizeObserver.js +3 -3
- package/ui/ResizeObserver.js.flow +2 -3
- package/ui/TableCellMenu.js +0 -1
- package/ui/TableCellMenu.js.flow +0 -2
- package/ui/TableGridSizeEditor.js +1 -3
- package/ui/TableGridSizeEditor.js.flow +1 -3
- package/ui/mathquill-editor/MathQuillEditor.js +0 -1
- package/ui/mathquill-editor/MathQuillEditor.js.flow +0 -1
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +0 -1
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +0 -1
- package/ui/mathquill-editor/mathquill-import-kludge.js +0 -1
- package/ui/mathquill-editor/mathquill-import-kludge.js.flow +0 -2
- package/ui/renderLaTeXAsHTML.js +0 -4
- package/ui/renderLaTeXAsHTML.js.flow +0 -4
- package/styles0.css +0 -29
|
@@ -17,7 +17,6 @@ import { EditorView } from 'prosemirror-view';
|
|
|
17
17
|
import * as React from 'react';
|
|
18
18
|
import ReactDOM from 'react-dom';
|
|
19
19
|
import isEditorStateEmpty from './isEditorStateEmpty.js';
|
|
20
|
-
import './ui/czi-editor.css';
|
|
21
20
|
var CLASS_NAME_HAS_PLACEHOLDER = 'czi-has-placeholder';
|
|
22
21
|
var ContentPlaceholderView = /*#__PURE__*/function () {
|
|
23
22
|
function ContentPlaceholderView(editorView) {
|
|
@@ -14,7 +14,6 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
14
14
|
import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
15
15
|
import { Transform } from 'prosemirror-transform';
|
|
16
16
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
17
|
-
import './ui/czi-cursor-placeholder.css';
|
|
18
17
|
var PLACE_HOLDER_ID = {
|
|
19
18
|
name: 'CursorPlaceholderPlugin'
|
|
20
19
|
};
|
|
@@ -4,8 +4,6 @@ import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
|
4
4
|
import { Transform } from 'prosemirror-transform';
|
|
5
5
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
6
6
|
|
|
7
|
-
import './ui/czi-cursor-placeholder.css';
|
|
8
|
-
|
|
9
7
|
const PLACE_HOLDER_ID = { name: 'CursorPlaceholderPlugin' };
|
|
10
8
|
|
|
11
9
|
let singletonInstance = null;
|
package/HTMLMutator.js
CHANGED
|
@@ -5,7 +5,6 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
5
5
|
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; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
7
|
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); }
|
|
8
|
-
import nullthrows from 'nullthrows';
|
|
9
8
|
import uuid from './ui/uuid.js';
|
|
10
9
|
|
|
11
10
|
// Utility Class that allows developer to insert HTML snippets then updates
|
|
@@ -32,7 +31,7 @@ var HTMLMutator = /*#__PURE__*/function () {
|
|
|
32
31
|
key: "execute",
|
|
33
32
|
value: function execute() {
|
|
34
33
|
var doc = this._doc;
|
|
35
|
-
var root =
|
|
34
|
+
var root = (doc === null || doc === void 0 ? void 0 : doc.body) || (doc === null || doc === void 0 ? void 0 : doc.documentElement);
|
|
36
35
|
var newHtml = root.innerHTML;
|
|
37
36
|
this._htmls.forEach(function (html, token) {
|
|
38
37
|
newHtml = newHtml.replace(token, html);
|
|
@@ -50,7 +49,7 @@ var HTMLMutator = /*#__PURE__*/function () {
|
|
|
50
49
|
// later.
|
|
51
50
|
var token = "\u200B_HTMLMutator_token_".concat(uuid(), "_\u200B");
|
|
52
51
|
var node = this._doc.createComment(token);
|
|
53
|
-
var parentElement =
|
|
52
|
+
var parentElement = el === null || el === void 0 ? void 0 : el.parentElement;
|
|
54
53
|
if (position === 'before') {
|
|
55
54
|
parentElement.insertBefore(node, el);
|
|
56
55
|
} else if (position === 'after') {
|
package/HTMLMutator.js.flow
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import nullthrows from 'nullthrows';
|
|
4
3
|
import uuid from './ui/uuid.js';
|
|
5
4
|
|
|
6
5
|
// Utility Class that allows developer to insert HTML snippets then updates
|
|
@@ -24,7 +23,7 @@ export default class HTMLMutator {
|
|
|
24
23
|
|
|
25
24
|
execute(): void {
|
|
26
25
|
const doc = this._doc;
|
|
27
|
-
const root =
|
|
26
|
+
const root = doc?.body || doc?.documentElement;
|
|
28
27
|
let newHtml = root.innerHTML;
|
|
29
28
|
this._htmls.forEach((html, token) => {
|
|
30
29
|
newHtml = newHtml.replace(token, html);
|
|
@@ -45,7 +44,7 @@ export default class HTMLMutator {
|
|
|
45
44
|
// later.
|
|
46
45
|
const token = `\u200b_HTMLMutator_token_${uuid()}_\u200b`;
|
|
47
46
|
const node = this._doc.createComment(token);
|
|
48
|
-
const parentElement =
|
|
47
|
+
const parentElement = el?.parentElement;
|
|
49
48
|
if (position === 'before') {
|
|
50
49
|
parentElement.insertBefore(node, el);
|
|
51
50
|
} else if (position === 'after') {
|
|
@@ -11,13 +11,11 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
11
11
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
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
13
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
-
import nullthrows from 'nullthrows';
|
|
15
14
|
import { EditorState, TextSelection, Plugin, PluginKey } from 'prosemirror-state';
|
|
16
15
|
import { Transform } from 'prosemirror-transform';
|
|
17
16
|
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
|
|
18
17
|
import { IMAGE } from './NodeNames.js';
|
|
19
18
|
import uuid from './ui/uuid.js';
|
|
20
|
-
import './ui/czi-image-upload-placeholder.css';
|
|
21
19
|
var IMAGE_FILE_TYLES = new Set(['image/jpeg', 'image/gif', 'image/png', 'image/jpg']);
|
|
22
20
|
var TITLE = 'Uploading...';
|
|
23
21
|
var INNER_HTML = new Array(4).join('<div class="czi-image-upload-placeholder-child"></div>');
|
|
@@ -94,7 +92,7 @@ export function uploadImageFiles(view, files, coords) {
|
|
|
94
92
|
}
|
|
95
93
|
view.dispatch(trNext);
|
|
96
94
|
};
|
|
97
|
-
var ff =
|
|
95
|
+
var ff = imageFiles === null || imageFiles === void 0 ? void 0 : imageFiles.shift();
|
|
98
96
|
uploadImage(ff).then(done)["catch"](done.bind(null, {
|
|
99
97
|
src: null
|
|
100
98
|
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import nullthrows from 'nullthrows';
|
|
4
3
|
import { EditorState, TextSelection, Plugin, PluginKey } from 'prosemirror-state';
|
|
5
4
|
import { Transform } from 'prosemirror-transform';
|
|
6
5
|
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
|
|
@@ -8,8 +7,6 @@ import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
|
|
|
8
7
|
import { IMAGE } from './NodeNames.js';
|
|
9
8
|
import uuid from './ui/uuid.js';
|
|
10
9
|
|
|
11
|
-
import './ui/czi-image-upload-placeholder.css';
|
|
12
|
-
|
|
13
10
|
const IMAGE_FILE_TYLES = new Set([
|
|
14
11
|
'image/jpeg',
|
|
15
12
|
'image/gif',
|
|
@@ -102,7 +99,7 @@ export function uploadImageFiles(
|
|
|
102
99
|
}
|
|
103
100
|
view.dispatch(trNext);
|
|
104
101
|
};
|
|
105
|
-
const ff =
|
|
102
|
+
const ff = imageFiles?.shift();
|
|
106
103
|
uploadImage(ff)
|
|
107
104
|
.then(done)
|
|
108
105
|
.catch(done.bind(null, { src: null }));
|
package/LinkTooltipPlugin.js
CHANGED
|
@@ -24,7 +24,6 @@ import lookUpElement from './lookUpElement.js';
|
|
|
24
24
|
import LinkTooltip from './ui/LinkTooltip.js';
|
|
25
25
|
import LinkURLEditor from './ui/LinkURLEditor.js';
|
|
26
26
|
import { INNER_LINK } from './Types.js';
|
|
27
|
-
import '@modusoperandi/licit-ui-commands/ui/czi-pop-up.css';
|
|
28
27
|
|
|
29
28
|
// https://prosemirror.net/examples/tooltip/
|
|
30
29
|
var SPEC = {
|
|
@@ -21,8 +21,6 @@ import LinkTooltip from './ui/LinkTooltip.js';
|
|
|
21
21
|
import LinkURLEditor from './ui/LinkURLEditor.js';
|
|
22
22
|
import { INNER_LINK } from './Types.js';
|
|
23
23
|
|
|
24
|
-
import '@modusoperandi/licit-ui-commands/ui/czi-pop-up.css';
|
|
25
|
-
|
|
26
24
|
// https://prosemirror.net/examples/tooltip/
|
|
27
25
|
const SPEC = {
|
|
28
26
|
// [FS] IRAD-1005 2020-07-07
|
package/ListItemMergeCommand.js
CHANGED
|
@@ -12,7 +12,6 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
12
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
|
-
import nullthrows from 'nullthrows';
|
|
16
15
|
import { Fragment, Schema } from 'prosemirror-model';
|
|
17
16
|
import { EditorState, TextSelection } from 'prosemirror-state';
|
|
18
17
|
import { Transform } from 'prosemirror-transform';
|
|
@@ -121,8 +120,9 @@ function mergeListItemDown(tr, schema) {
|
|
|
121
120
|
switch (nextNode.type) {
|
|
122
121
|
case listItem:
|
|
123
122
|
{
|
|
123
|
+
var _nextNode;
|
|
124
124
|
// List item should only have one child (paragraph).
|
|
125
|
-
var paragraphNode =
|
|
125
|
+
var paragraphNode = (_nextNode = nextNode) === null || _nextNode === void 0 ? void 0 : _nextNode.firstChild;
|
|
126
126
|
nextContent = Fragment.from(paragraphNode.content);
|
|
127
127
|
break;
|
|
128
128
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import nullthrows from 'nullthrows';
|
|
4
3
|
import { Fragment, Schema } from 'prosemirror-model';
|
|
5
4
|
import { EditorState, TextSelection } from 'prosemirror-state';
|
|
6
5
|
import { Transform } from 'prosemirror-transform';
|
|
@@ -110,7 +109,7 @@ function mergeListItemDown(tr: Transform, schema: Schema): Transform {
|
|
|
110
109
|
switch (nextNode.type) {
|
|
111
110
|
case listItem: {
|
|
112
111
|
// List item should only have one child (paragraph).
|
|
113
|
-
const paragraphNode =
|
|
112
|
+
const paragraphNode = nextNode?.firstChild;
|
|
114
113
|
nextContent = Fragment.from(paragraphNode.content);
|
|
115
114
|
break;
|
|
116
115
|
}
|
|
@@ -14,7 +14,6 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
14
14
|
import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
15
15
|
import { Transform } from 'prosemirror-transform';
|
|
16
16
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
17
|
-
import './ui/czi-selection-placeholder.css';
|
|
18
17
|
var PLACE_HOLDER_ID = {
|
|
19
18
|
name: 'SelectionPlaceholderPlugin'
|
|
20
19
|
};
|
|
@@ -4,8 +4,6 @@ import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
|
4
4
|
import { Transform } from 'prosemirror-transform';
|
|
5
5
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
6
6
|
|
|
7
|
-
import './ui/czi-selection-placeholder.css';
|
|
8
|
-
|
|
9
7
|
const PLACE_HOLDER_ID = { name: 'SelectionPlaceholderPlugin' };
|
|
10
8
|
|
|
11
9
|
let singletonInstance = null;
|
|
@@ -12,7 +12,6 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
12
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
|
-
import nullthrows from 'nullthrows';
|
|
16
15
|
import { EditorState } from 'prosemirror-state';
|
|
17
16
|
import { setCellAttr } from 'prosemirror-tables';
|
|
18
17
|
import { Transform } from 'prosemirror-transform';
|
|
@@ -40,7 +39,7 @@ var TableBackgroundColorCommand = /*#__PURE__*/function (_UICommand) {
|
|
|
40
39
|
if (_this._popUp) {
|
|
41
40
|
return Promise.resolve(undefined);
|
|
42
41
|
}
|
|
43
|
-
var target =
|
|
42
|
+
var target = event === null || event === void 0 ? void 0 : event.currentTarget;
|
|
44
43
|
if (!(target instanceof HTMLElement)) {
|
|
45
44
|
return Promise.resolve(undefined);
|
|
46
45
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import nullthrows from 'nullthrows';
|
|
4
3
|
import { EditorState } from 'prosemirror-state';
|
|
5
4
|
import { setCellAttr } from 'prosemirror-tables';
|
|
6
5
|
import { Transform } from 'prosemirror-transform';
|
|
@@ -31,7 +30,7 @@ class TableBackgroundColorCommand extends UICommand {
|
|
|
31
30
|
if (this._popUp) {
|
|
32
31
|
return Promise.resolve(undefined);
|
|
33
32
|
}
|
|
34
|
-
const target =
|
|
33
|
+
const target = event?.currentTarget;
|
|
35
34
|
if (!(target instanceof HTMLElement)) {
|
|
36
35
|
return Promise.resolve(undefined);
|
|
37
36
|
}
|
|
@@ -43,18 +42,18 @@ class TableBackgroundColorCommand extends UICommand {
|
|
|
43
42
|
const hex = result ? result.mark.attrs.color : null;
|
|
44
43
|
|
|
45
44
|
return new Promise((resolve) => {
|
|
46
|
-
this._popUp = createPopUp(ColorEditor,{ hex, runtime: view.runtime },
|
|
45
|
+
this._popUp = createPopUp(ColorEditor, { hex, runtime: view.runtime },
|
|
47
46
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
anchor,
|
|
48
|
+
autoDismiss: false,
|
|
49
|
+
position: atAnchorRight,
|
|
50
|
+
onClose: (val) => {
|
|
51
|
+
if (this._popUp) {
|
|
52
|
+
this._popUp = null;
|
|
53
|
+
resolve(val);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
});
|
|
58
57
|
});
|
|
59
58
|
};
|
|
60
59
|
|
|
@@ -12,7 +12,6 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
12
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
|
-
import nullthrows from 'nullthrows';
|
|
16
15
|
import { EditorState } from 'prosemirror-state';
|
|
17
16
|
import { setCellAttr } from 'prosemirror-tables';
|
|
18
17
|
import { Transform } from 'prosemirror-transform';
|
|
@@ -40,7 +39,7 @@ var TableBorderColorCommand = /*#__PURE__*/function (_UICommand) {
|
|
|
40
39
|
if (_this._popUp) {
|
|
41
40
|
return Promise.resolve(undefined);
|
|
42
41
|
}
|
|
43
|
-
var target =
|
|
42
|
+
var target = event === null || event === void 0 ? void 0 : event.currentTarget;
|
|
44
43
|
if (!(target instanceof HTMLElement)) {
|
|
45
44
|
return Promise.resolve(undefined);
|
|
46
45
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import nullthrows from 'nullthrows';
|
|
4
3
|
import { EditorState } from 'prosemirror-state';
|
|
5
4
|
import { setCellAttr } from 'prosemirror-tables';
|
|
6
5
|
import { Transform } from 'prosemirror-transform';
|
|
@@ -31,7 +30,7 @@ class TableBorderColorCommand extends UICommand {
|
|
|
31
30
|
if (this._popUp) {
|
|
32
31
|
return Promise.resolve(undefined);
|
|
33
32
|
}
|
|
34
|
-
const target =
|
|
33
|
+
const target = event?.currentTarget;
|
|
35
34
|
if (!(target instanceof HTMLElement)) {
|
|
36
35
|
return Promise.resolve(undefined);
|
|
37
36
|
}
|
|
@@ -44,18 +43,18 @@ class TableBorderColorCommand extends UICommand {
|
|
|
44
43
|
const hex = result ? result.mark.attrs.color : null;
|
|
45
44
|
|
|
46
45
|
return new Promise((resolve) => {
|
|
47
|
-
this._popUp = createPopUp(ColorEditor,{ hex, runtime: view.runtime },
|
|
46
|
+
this._popUp = createPopUp(ColorEditor, { hex, runtime: view.runtime },
|
|
48
47
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
anchor,
|
|
49
|
+
autoDismiss: false,
|
|
50
|
+
position: atAnchorRight,
|
|
51
|
+
onClose: (val) => {
|
|
52
|
+
if (this._popUp) {
|
|
53
|
+
this._popUp = null;
|
|
54
|
+
resolve(val);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
});
|
|
59
58
|
});
|
|
60
59
|
};
|
|
61
60
|
|
package/TableCellColorCommand.js
CHANGED
|
@@ -12,7 +12,6 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
12
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
|
-
import nullthrows from 'nullthrows';
|
|
16
15
|
import { EditorState } from 'prosemirror-state';
|
|
17
16
|
import { setCellAttr } from 'prosemirror-tables';
|
|
18
17
|
import { Transform } from 'prosemirror-transform';
|
|
@@ -40,7 +39,7 @@ var TableCellColorCommand = /*#__PURE__*/function (_UICommand) {
|
|
|
40
39
|
if (_this._popUp) {
|
|
41
40
|
return Promise.resolve(undefined);
|
|
42
41
|
}
|
|
43
|
-
var target =
|
|
42
|
+
var target = event === null || event === void 0 ? void 0 : event.currentTarget;
|
|
44
43
|
if (!(target instanceof HTMLElement)) {
|
|
45
44
|
return Promise.resolve(undefined);
|
|
46
45
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import nullthrows from 'nullthrows';
|
|
4
3
|
import { EditorState } from 'prosemirror-state';
|
|
5
4
|
import { setCellAttr } from 'prosemirror-tables';
|
|
6
5
|
import { Transform } from 'prosemirror-transform';
|
|
@@ -31,7 +30,7 @@ class TableCellColorCommand extends UICommand {
|
|
|
31
30
|
if (this._popUp) {
|
|
32
31
|
return Promise.resolve(undefined);
|
|
33
32
|
}
|
|
34
|
-
const target =
|
|
33
|
+
const target = event?.currentTarget;
|
|
35
34
|
if (!(target instanceof HTMLElement)) {
|
|
36
35
|
return Promise.resolve(undefined);
|
|
37
36
|
}
|
package/TableCellMenuPlugin.js
CHANGED
|
@@ -21,7 +21,6 @@ import { atAnchorTopRight, createPopUp } from '@modusoperandi/licit-ui-commands'
|
|
|
21
21
|
import TableCellMenu from './ui/TableCellMenu.js';
|
|
22
22
|
import bindScrollHandler from './ui/bindScrollHandler.js';
|
|
23
23
|
import isElementFullyVisible from './ui/isElementFullyVisible.js';
|
|
24
|
-
import '@modusoperandi/licit-ui-commands/ui/czi-pop-up.css';
|
|
25
24
|
import { CellSelection } from 'prosemirror-tables';
|
|
26
25
|
var TableCellTooltipView = /*#__PURE__*/function () {
|
|
27
26
|
function TableCellTooltipView(editorView) {
|
|
@@ -10,7 +10,6 @@ import { atAnchorTopRight, createPopUp } from '@modusoperandi/licit-ui-commands'
|
|
|
10
10
|
import TableCellMenu from './ui/TableCellMenu.js';
|
|
11
11
|
import bindScrollHandler from './ui/bindScrollHandler.js';
|
|
12
12
|
import isElementFullyVisible from './ui/isElementFullyVisible.js';
|
|
13
|
-
import '@modusoperandi/licit-ui-commands/ui/czi-pop-up.css';
|
|
14
13
|
import { CellSelection } from 'prosemirror-tables';
|
|
15
14
|
|
|
16
15
|
class TableCellTooltipView {
|
package/TableInsertCommand.js
CHANGED
|
@@ -12,7 +12,6 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
12
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
|
-
import nullthrows from 'nullthrows';
|
|
16
15
|
import { EditorState, TextSelection } from 'prosemirror-state';
|
|
17
16
|
import { Transform } from 'prosemirror-transform';
|
|
18
17
|
import { EditorView } from 'prosemirror-view';
|
|
@@ -58,7 +57,7 @@ var TableInsertCommand = /*#__PURE__*/function (_UICommand) {
|
|
|
58
57
|
if (_this._popUp) {
|
|
59
58
|
return Promise.resolve(undefined);
|
|
60
59
|
}
|
|
61
|
-
var target =
|
|
60
|
+
var target = event === null || event === void 0 ? void 0 : event.currentTarget;
|
|
62
61
|
if (!(target instanceof HTMLElement)) {
|
|
63
62
|
return Promise.resolve(undefined);
|
|
64
63
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import nullthrows from 'nullthrows';
|
|
4
3
|
import { EditorState, TextSelection } from 'prosemirror-state';
|
|
5
4
|
import { Transform } from 'prosemirror-transform';
|
|
6
5
|
import { EditorView } from 'prosemirror-view';
|
|
@@ -53,7 +52,7 @@ class TableInsertCommand extends UICommand {
|
|
|
53
52
|
if (this._popUp) {
|
|
54
53
|
return Promise.resolve(undefined);
|
|
55
54
|
}
|
|
56
|
-
const target =
|
|
55
|
+
const target = event?.currentTarget;
|
|
57
56
|
if (!(target instanceof HTMLElement)) {
|
|
58
57
|
return Promise.resolve(undefined);
|
|
59
58
|
}
|
package/TableResizePlugin.js
CHANGED
|
@@ -45,7 +45,6 @@ import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
|
45
45
|
import { Transform } from 'prosemirror-transform';
|
|
46
46
|
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
|
|
47
47
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
48
|
-
import nullthrows from 'nullthrows';
|
|
49
48
|
import { cellAround, pointsAtCell, tableNodeTypes, TableMap, TableView } from 'prosemirror-tables';
|
|
50
49
|
var PLUGIN_KEY = new PluginKey('tableColumnResizing');
|
|
51
50
|
|
|
@@ -299,7 +298,7 @@ function handleDragEnd(view, event) {
|
|
|
299
298
|
marginLeft: marginLeft
|
|
300
299
|
});
|
|
301
300
|
var tableLookup = findParentNodeOfTypeClosestToPos($cell, view.state.schema.nodes[nodeType.name]);
|
|
302
|
-
var tablePos =
|
|
301
|
+
var tablePos = tableLookup && (tableLookup === null || tableLookup === void 0 ? void 0 : tableLookup.pos);
|
|
303
302
|
tr = tr.setNodeMarkup(tablePos, nodeType, _attrs);
|
|
304
303
|
}
|
|
305
304
|
if (tr.docChanged) {
|
|
@@ -35,7 +35,6 @@ import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
|
35
35
|
import { Transform } from 'prosemirror-transform';
|
|
36
36
|
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
|
|
37
37
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
38
|
-
import nullthrows from 'nullthrows';
|
|
39
38
|
import {
|
|
40
39
|
cellAround,
|
|
41
40
|
pointsAtCell,
|
|
@@ -359,7 +358,7 @@ function handleDragEnd(view: EditorView, event: any): void {
|
|
|
359
358
|
$cell,
|
|
360
359
|
view.state.schema.nodes[nodeType.name]
|
|
361
360
|
);
|
|
362
|
-
const tablePos =
|
|
361
|
+
const tablePos = tableLookup && tableLookup?.pos;
|
|
363
362
|
tr = tr.setNodeMarkup(tablePos, nodeType, attrs);
|
|
364
363
|
}
|
|
365
364
|
|