@modusoperandi/licit 1.0.5 → 1.0.8
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 -18
- package/ContentPlaceholderPlugin.js.flow +10 -14
- package/CursorPlaceholderPlugin.js +8 -9
- package/CursorPlaceholderPlugin.js.flow +0 -2
- 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 +6 -7
- package/HTMLMutator.js.flow +2 -3
- 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 +14 -18
- package/ImageUploadPlaceholderPlugin.js.flow +6 -11
- 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 -31
- package/LinkTooltipPlugin.js.flow +91 -22
- package/ListItemInsertNewLineCommand.js +10 -11
- package/ListItemInsertNewLineCommand.js.flow +1 -2
- package/ListItemMergeCommand.js +17 -16
- package/ListItemMergeCommand.js.flow +4 -6
- 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 -9
- package/SelectionPlaceholderPlugin.js.flow +0 -2
- package/SpacerMarkSpec.js +1 -1
- package/StyleView.js +3 -4
- package/StyleView.js.flow +0 -1
- package/TableBackgroundColorCommand.js +13 -16
- package/TableBackgroundColorCommand.js.flow +14 -18
- package/TableBorderColorCommand.js +13 -16
- package/TableBorderColorCommand.js.flow +14 -20
- package/TableCellColorCommand.js +11 -13
- package/TableCellColorCommand.js.flow +2 -4
- package/TableCellMenuPlugin.js +16 -16
- package/TableCellMenuPlugin.js.flow +5 -8
- package/TableInsertCommand.js +12 -15
- package/TableInsertCommand.js.flow +3 -6
- 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 +18 -18
- package/TableResizePlugin.js.flow +2 -3
- package/TextInsertTabSpaceCommand.js +9 -9
- package/Types.js +1 -0
- package/Types.js.flow +2 -5
- package/WebFontLoader.js +4 -4
- package/bom.xml +20047 -28206
- 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 -59
- package/client/Licit.js.flow +12 -45
- 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 +23 -17
- 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 +6 -7
- package/patchListElements.js.flow +7 -8
- 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/styles.css +32 -3
- 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 -10
- package/ui/AlertInfo.js.flow +0 -1
- package/ui/BookmarkNodeView.js +13 -13
- package/ui/BookmarkNodeView.js.flow +0 -2
- package/ui/CommandButton.js +9 -9
- package/ui/CommandMenu.js +12 -12
- package/ui/CommandMenu.js.flow +1 -1
- package/ui/CommandMenuButton.js +11 -13
- package/ui/CommandMenuButton.js.flow +2 -5
- package/ui/CustomEditorView.js +13 -12
- package/ui/CustomEditorView.js.flow +1 -0
- package/ui/CustomMenu.js +8 -10
- package/ui/CustomMenu.js.flow +0 -3
- package/ui/CustomMenuItem.js +10 -11
- package/ui/CustomMenuItem.js.flow +0 -1
- package/ui/CustomNodeView.js +27 -16
- package/ui/CustomNodeView.js.flow +16 -9
- package/ui/CustomRadioButton.js +13 -16
- package/ui/CustomRadioButton.js.flow +2 -4
- package/ui/DocLayoutEditor.js +10 -13
- package/ui/DocLayoutEditor.js.flow +1 -5
- package/ui/Editor.js +16 -16
- package/ui/Editor.js.flow +7 -12
- package/ui/EditorFrameset.js +9 -10
- package/ui/EditorFrameset.js.flow +0 -2
- package/ui/EditorToolbar.js +24 -30
- package/ui/EditorToolbar.js.flow +22 -43
- 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 -9
- package/ui/Frag.js.flow +0 -2
- package/ui/Icon.js +12 -18
- package/ui/Icon.js.flow +0 -7
- package/ui/ImageInlineEditor.js +9 -10
- package/ui/ImageInlineEditor.js.flow +0 -1
- package/ui/LinkTooltip.js +62 -28
- package/ui/LinkTooltip.js.flow +55 -24
- package/ui/LinkURLEditor.js +151 -36
- package/ui/LinkURLEditor.js.flow +176 -54
- package/ui/ListItemNodeView.js +4 -4
- package/ui/ListTypeButton.js +11 -15
- package/ui/ListTypeButton.js.flow +2 -6
- package/ui/ListTypeCommandButton.js +10 -10
- package/ui/ListTypeCommandButton.js.flow +1 -1
- package/ui/ListTypeMenu.js +11 -12
- package/ui/ListTypeMenu.js.flow +1 -2
- package/ui/LoadingIndicator.js +8 -9
- package/ui/LoadingIndicator.js.flow +0 -1
- package/ui/MathEditor.js +10 -15
- package/ui/MathEditor.js.flow +1 -9
- package/ui/MathInlineEditor.js +13 -14
- package/ui/MathInlineEditor.js.flow +3 -5
- package/ui/MathNodeView.js +16 -16
- package/ui/MathNodeView.js.flow +10 -21
- package/ui/PasteMenu.js +11 -15
- package/ui/PasteMenu.js.flow +0 -5
- package/ui/ResizeObserver.js +4 -4
- package/ui/ResizeObserver.js.flow +3 -4
- package/ui/RichTextEditor.js +9 -9
- package/ui/SelectionObserver.js +6 -6
- package/ui/SelectionObserver.js.flow +2 -2
- package/ui/TableCellMenu.js +9 -10
- package/ui/TableCellMenu.js.flow +0 -2
- package/ui/TableGridSizeEditor.js +12 -15
- package/ui/TableGridSizeEditor.js.flow +7 -6
- 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 -14
- package/ui/mathquill-editor/MathQuillEditor.js.flow +0 -2
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +9 -10
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +0 -1
- package/ui/mathquill-editor/mathquill-import-kludge.js +1 -9
- package/ui/mathquill-editor/mathquill-import-kludge.js.flow +0 -9
- package/ui/renderLaTeXAsHTML.js +3 -7
- package/ui/renderLaTeXAsHTML.js.flow +0 -4
- 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/styles0.css +0 -29
package/HTMLMutator.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
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(
|
|
5
|
-
function _defineProperty(
|
|
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
|
+
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') {
|
package/HeadingNodeSpec.js
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
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 _defineProperty(
|
|
4
|
+
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; }
|
|
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
|
import { Node } from 'prosemirror-model';
|
|
8
|
-
import ParagraphNodeSpec from './ParagraphNodeSpec';
|
|
9
|
-
import { getParagraphNodeAttrs, toParagraphDOM } from './ParagraphNodeSpec';
|
|
10
|
-
// const TAG_NAME_TO_LEVEL = {
|
|
11
|
-
// H1: 1,
|
|
12
|
-
// H2: 2,
|
|
13
|
-
// H3: 3,
|
|
14
|
-
// H4: 4,
|
|
15
|
-
// H5: 5,
|
|
16
|
-
// H6: 6,
|
|
17
|
-
// };
|
|
18
|
-
|
|
8
|
+
import ParagraphNodeSpec, { getParagraphNodeAttrs, toParagraphDOM } from './ParagraphNodeSpec';
|
|
19
9
|
// https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js
|
|
20
10
|
// :: NodeSpec A plain paragraph textblock. Represented in the DOM
|
|
21
11
|
// as a `<p>` element.
|
package/HeadingNodeSpec.js.flow
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import { Node } from 'prosemirror-model';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import ParagraphNodeSpec, {
|
|
5
|
+
getParagraphNodeAttrs,
|
|
6
|
+
toParagraphDOM,
|
|
7
|
+
} from './ParagraphNodeSpec';
|
|
8
8
|
import type { NodeSpec } from './Types';
|
|
9
9
|
|
|
10
|
-
// const TAG_NAME_TO_LEVEL = {
|
|
11
|
-
// H1: 1,
|
|
12
|
-
// H2: 2,
|
|
13
|
-
// H3: 3,
|
|
14
|
-
// H4: 4,
|
|
15
|
-
// H5: 5,
|
|
16
|
-
// H6: 6,
|
|
17
|
-
// };
|
|
18
|
-
|
|
19
10
|
// https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js
|
|
20
11
|
// :: NodeSpec A plain paragraph textblock. Represented in the DOM
|
|
21
12
|
// as a `<p>` element.
|
|
@@ -23,7 +14,6 @@ const HeadingNodeSpec: NodeSpec = {
|
|
|
23
14
|
...ParagraphNodeSpec,
|
|
24
15
|
attrs: {
|
|
25
16
|
...ParagraphNodeSpec.attrs,
|
|
26
|
-
// level: { default: 1 },
|
|
27
17
|
},
|
|
28
18
|
defining: true,
|
|
29
19
|
parseDOM: [
|
package/HistoryRedoCommand.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 { redo } from 'prosemirror-history';
|
package/HistoryUndoCommand.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 { undo } from 'prosemirror-history';
|
package/HorizontalRuleCommand.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 { Fragment, Schema } from 'prosemirror-model';
|
|
@@ -1,25 +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 _defineProperties(
|
|
3
|
-
function _createClass(
|
|
2
|
+
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); } }
|
|
3
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
5
|
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); }
|
|
6
|
-
function _classCallCheck(
|
|
6
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
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
|
-
import
|
|
15
|
-
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
16
|
-
import { EditorState, TextSelection } from 'prosemirror-state';
|
|
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
|
+
import { EditorState, TextSelection, Plugin, PluginKey } from 'prosemirror-state';
|
|
17
15
|
import { Transform } from 'prosemirror-transform';
|
|
18
|
-
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
19
|
-
import { EditorView } from 'prosemirror-view';
|
|
16
|
+
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
|
|
20
17
|
import { IMAGE } from './NodeNames.js';
|
|
21
18
|
import uuid from './ui/uuid.js';
|
|
22
|
-
import './ui/czi-image-upload-placeholder.css';
|
|
23
19
|
var IMAGE_FILE_TYLES = new Set(['image/jpeg', 'image/gif', 'image/png', 'image/jpg']);
|
|
24
20
|
var TITLE = 'Uploading...';
|
|
25
21
|
var INNER_HTML = new Array(4).join('<div class="czi-image-upload-placeholder-child"></div>');
|
|
@@ -48,7 +44,7 @@ export function uploadImageFiles(view, files, coords) {
|
|
|
48
44
|
disabled = view.disabled;
|
|
49
45
|
var schema = state.schema,
|
|
50
46
|
plugins = state.plugins;
|
|
51
|
-
if (readOnly || disabled || !runtime
|
|
47
|
+
if (readOnly || disabled || !(runtime !== null && runtime !== void 0 && runtime.canUploadImage)) {
|
|
52
48
|
return false;
|
|
53
49
|
}
|
|
54
50
|
var imageType = schema.nodes[IMAGE];
|
|
@@ -96,7 +92,7 @@ export function uploadImageFiles(view, files, coords) {
|
|
|
96
92
|
}
|
|
97
93
|
view.dispatch(trNext);
|
|
98
94
|
};
|
|
99
|
-
var ff =
|
|
95
|
+
var ff = imageFiles === null || imageFiles === void 0 ? void 0 : imageFiles.shift();
|
|
100
96
|
uploadImage(ff).then(done)["catch"](done.bind(null, {
|
|
101
97
|
src: null
|
|
102
98
|
}));
|
|
@@ -150,7 +146,7 @@ var ImageUploadPlaceholderPlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
150
146
|
set = set.map(tr.mapping, tr.doc);
|
|
151
147
|
// See if the transaction adds or removes any placeholders
|
|
152
148
|
var action = tr.getMeta(this);
|
|
153
|
-
if (action && action.add) {
|
|
149
|
+
if (action !== null && action !== void 0 && action.add) {
|
|
154
150
|
var el = document.createElement('div');
|
|
155
151
|
el.title = TITLE;
|
|
156
152
|
el.className = 'czi-image-upload-placeholder';
|
|
@@ -159,7 +155,7 @@ var ImageUploadPlaceholderPlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
159
155
|
id: action.add.id
|
|
160
156
|
});
|
|
161
157
|
set = set.add(tr.doc, [deco]);
|
|
162
|
-
} else if (action && action.remove) {
|
|
158
|
+
} else if (action !== null && action !== void 0 && action.remove) {
|
|
163
159
|
var finder = function finder(spec) {
|
|
164
160
|
return spec.id == action.remove.id;
|
|
165
161
|
};
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
5
|
-
import { EditorState, TextSelection } from 'prosemirror-state';
|
|
3
|
+
import { EditorState, TextSelection, Plugin, PluginKey } from 'prosemirror-state';
|
|
6
4
|
import { Transform } from 'prosemirror-transform';
|
|
7
|
-
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
8
|
-
import { EditorView } from 'prosemirror-view';
|
|
5
|
+
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
|
|
9
6
|
|
|
10
7
|
import { IMAGE } from './NodeNames.js';
|
|
11
8
|
import uuid from './ui/uuid.js';
|
|
12
9
|
|
|
13
|
-
import './ui/czi-image-upload-placeholder.css';
|
|
14
|
-
|
|
15
10
|
const IMAGE_FILE_TYLES = new Set([
|
|
16
11
|
'image/jpeg',
|
|
17
12
|
'image/gif',
|
|
@@ -56,7 +51,7 @@ export function uploadImageFiles(
|
|
|
56
51
|
): boolean {
|
|
57
52
|
const { runtime, state, readOnly, disabled } = view;
|
|
58
53
|
const { schema, plugins } = state;
|
|
59
|
-
if (readOnly || disabled || !runtime
|
|
54
|
+
if (readOnly || disabled || !runtime?.canUploadImage) {
|
|
60
55
|
return false;
|
|
61
56
|
}
|
|
62
57
|
|
|
@@ -104,7 +99,7 @@ export function uploadImageFiles(
|
|
|
104
99
|
}
|
|
105
100
|
view.dispatch(trNext);
|
|
106
101
|
};
|
|
107
|
-
const ff =
|
|
102
|
+
const ff = imageFiles?.shift();
|
|
108
103
|
uploadImage(ff)
|
|
109
104
|
.then(done)
|
|
110
105
|
.catch(done.bind(null, { src: null }));
|
|
@@ -162,7 +157,7 @@ class ImageUploadPlaceholderPlugin extends Plugin {
|
|
|
162
157
|
set = set.map(tr.mapping, tr.doc);
|
|
163
158
|
// See if the transaction adds or removes any placeholders
|
|
164
159
|
const action = tr.getMeta(this);
|
|
165
|
-
if (action
|
|
160
|
+
if (action?.add) {
|
|
166
161
|
const el = document.createElement('div');
|
|
167
162
|
el.title = TITLE;
|
|
168
163
|
el.className = 'czi-image-upload-placeholder';
|
|
@@ -173,7 +168,7 @@ class ImageUploadPlaceholderPlugin extends Plugin {
|
|
|
173
168
|
});
|
|
174
169
|
|
|
175
170
|
set = set.add(tr.doc, [deco]);
|
|
176
|
-
} else if (action
|
|
171
|
+
} else if (action?.remove) {
|
|
177
172
|
const finder = (spec) => spec.id == action.remove.id;
|
|
178
173
|
set = set.remove(set.find(null, null, finder));
|
|
179
174
|
}
|
package/LinkMarkSpec.js
CHANGED
|
@@ -11,6 +11,9 @@ var LinkMarkSpec = {
|
|
|
11
11
|
},
|
|
12
12
|
title: {
|
|
13
13
|
"default": null
|
|
14
|
+
},
|
|
15
|
+
selectionId: {
|
|
16
|
+
"default": null
|
|
14
17
|
}
|
|
15
18
|
},
|
|
16
19
|
inclusive: false,
|
|
@@ -19,10 +22,12 @@ var LinkMarkSpec = {
|
|
|
19
22
|
getAttrs: function getAttrs(dom) {
|
|
20
23
|
var href = dom.getAttribute('href');
|
|
21
24
|
var target = href && href.indexOf('#') === 0 ? '' : 'blank';
|
|
25
|
+
var selectionId = dom.getAttribute('selectionId') || '';
|
|
22
26
|
return {
|
|
23
27
|
href: dom.getAttribute('href'),
|
|
24
28
|
title: dom.getAttribute('title'),
|
|
25
|
-
target: target
|
|
29
|
+
target: target,
|
|
30
|
+
selectionId: selectionId
|
|
26
31
|
};
|
|
27
32
|
}
|
|
28
33
|
}],
|
package/LinkMarkSpec.js.flow
CHANGED
|
@@ -8,6 +8,9 @@ const LinkMarkSpec: MarkSpec = {
|
|
|
8
8
|
rel: { default: 'noopener noreferrer nofollow' },
|
|
9
9
|
target: { default: 'blank' },
|
|
10
10
|
title: { default: null },
|
|
11
|
+
selectionId: {
|
|
12
|
+
default: null,
|
|
13
|
+
},
|
|
11
14
|
},
|
|
12
15
|
inclusive: false,
|
|
13
16
|
parseDOM: [
|
|
@@ -16,10 +19,12 @@ const LinkMarkSpec: MarkSpec = {
|
|
|
16
19
|
getAttrs: (dom) => {
|
|
17
20
|
const href = dom.getAttribute('href');
|
|
18
21
|
const target = href && href.indexOf('#') === 0 ? '' : 'blank';
|
|
22
|
+
const selectionId = dom.getAttribute('selectionId') || '';
|
|
19
23
|
return {
|
|
20
24
|
href: dom.getAttribute('href'),
|
|
21
25
|
title: dom.getAttribute('title'),
|
|
22
26
|
target,
|
|
27
|
+
selectionId,
|
|
23
28
|
};
|
|
24
29
|
},
|
|
25
30
|
},
|