@modusoperandi/licit 1.3.5 → 1.3.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 +1 -7
- package/BlockquoteInsertNewLineCommand.js.flow +1 -7
- package/EditorCommands.js +4 -4
- package/EditorCommands.js.flow +4 -4
- package/EditorKeyMap.js +2 -11
- package/EditorKeyMap.js.flow +3 -15
- package/LinkSetURLCommand.js +1 -1
- package/LinkTooltipPlugin.js +1 -1
- package/TableNodesSpecs.js +15 -5
- package/TableNodesSpecs.js.flow +13 -4
- package/bom.xml +1095 -1257
- package/createEditorKeyMap.js +4 -4
- package/createEditorKeyMap.js.flow +4 -11
- package/keymaps.js +1 -3
- package/keymaps.js.flow +0 -10
- package/package.json +2 -2
- package/ui/Icon.js +1 -1
- package/ui/TableNodeView.js +15 -5
- package/ui/TableNodeView.js.flow +14 -3
|
@@ -15,10 +15,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
15
15
|
import { Fragment, Schema } from 'prosemirror-model';
|
|
16
16
|
import { EditorState, TextSelection } from 'prosemirror-state';
|
|
17
17
|
import { Transform } from 'prosemirror-transform';
|
|
18
|
-
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
19
18
|
import { EditorView } from 'prosemirror-view';
|
|
20
19
|
import * as React from 'react';
|
|
21
|
-
import {
|
|
20
|
+
import { HARD_BREAK } from './NodeNames';
|
|
22
21
|
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
23
22
|
|
|
24
23
|
// This handles the case when user press SHIFT + ENTER key to insert a new line
|
|
@@ -38,11 +37,6 @@ function insertNewLine(tr, schema) {
|
|
|
38
37
|
if (!br) {
|
|
39
38
|
return tr;
|
|
40
39
|
}
|
|
41
|
-
var blockquote = schema.nodes[BLOCKQUOTE];
|
|
42
|
-
var result = findParentNodeOfType(blockquote)(selection);
|
|
43
|
-
if (!result) {
|
|
44
|
-
return tr;
|
|
45
|
-
}
|
|
46
40
|
tr = tr.insert(from, Fragment.from(br.create()));
|
|
47
41
|
tr = tr.setSelection(TextSelection.create(tr.doc, from + 1, from + 1));
|
|
48
42
|
return tr;
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
import { Fragment, Schema } from 'prosemirror-model';
|
|
4
4
|
import { EditorState, TextSelection } from 'prosemirror-state';
|
|
5
5
|
import { Transform } from 'prosemirror-transform';
|
|
6
|
-
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
7
6
|
import { EditorView } from 'prosemirror-view';
|
|
8
7
|
import * as React from 'react';
|
|
9
|
-
import {
|
|
8
|
+
import { HARD_BREAK } from './NodeNames';
|
|
10
9
|
import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
|
|
11
10
|
|
|
12
11
|
// This handles the case when user press SHIFT + ENTER key to insert a new line
|
|
@@ -24,11 +23,6 @@ function insertNewLine(tr: Transform, schema: Schema): Transform {
|
|
|
24
23
|
if (!br) {
|
|
25
24
|
return tr;
|
|
26
25
|
}
|
|
27
|
-
const blockquote = schema.nodes[BLOCKQUOTE];
|
|
28
|
-
const result = findParentNodeOfType(blockquote)(selection);
|
|
29
|
-
if (!result) {
|
|
30
|
-
return tr;
|
|
31
|
-
}
|
|
32
26
|
tr = tr.insert(from, Fragment.from(br.create()));
|
|
33
27
|
tr = tr.setSelection(TextSelection.create(tr.doc, from + 1, from + 1));
|
|
34
28
|
return tr;
|
package/EditorCommands.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as ProsemirrorTables from 'prosemirror-tables';
|
|
2
2
|
// [FS][07-MAY-2020][IRAD-956]
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import BlockquoteInsertNewLineCommand from './BlockquoteInsertNewLineCommand.js';
|
|
4
|
+
import BlockquoteToggleCommand from './BlockquoteToggleCommand.js';
|
|
5
5
|
import DocLayoutCommand from './DocLayoutCommand.js';
|
|
6
6
|
import HistoryRedoCommand from './HistoryRedoCommand.js';
|
|
7
7
|
import HistoryUndoCommand from './HistoryUndoCommand.js';
|
|
@@ -47,8 +47,8 @@ var MARK_STRONG = MarkNames.MARK_STRONG,
|
|
|
47
47
|
document.execCommand('enableObjectResizing', false, 'false');
|
|
48
48
|
document.execCommand('enableInlineTableEditing', false, 'false');
|
|
49
49
|
// [FS][07-MAY-2020][IRAD-956]
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
export var BLOCKQUOTE_TOGGLE = new BlockquoteToggleCommand();
|
|
51
|
+
export var BLOCKQUOTE_INSERT_NEW_LINE = new BlockquoteInsertNewLineCommand();
|
|
52
52
|
export var CLEAR_FORMAT = new MarksClearCommand();
|
|
53
53
|
export var DOC_LAYOUT = new DocLayoutCommand();
|
|
54
54
|
export var EM = new MarkToggleCommand(MARK_EM);
|
package/EditorCommands.js.flow
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as ProsemirrorTables from 'prosemirror-tables';
|
|
4
4
|
// [FS][07-MAY-2020][IRAD-956]
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import BlockquoteInsertNewLineCommand from './BlockquoteInsertNewLineCommand.js';
|
|
6
|
+
import BlockquoteToggleCommand from './BlockquoteToggleCommand.js';
|
|
7
7
|
import DocLayoutCommand from './DocLayoutCommand.js';
|
|
8
8
|
import HistoryRedoCommand from './HistoryRedoCommand.js';
|
|
9
9
|
import HistoryUndoCommand from './HistoryUndoCommand.js';
|
|
@@ -69,8 +69,8 @@ const {
|
|
|
69
69
|
document.execCommand('enableObjectResizing', false, 'false');
|
|
70
70
|
document.execCommand('enableInlineTableEditing', false, 'false');
|
|
71
71
|
// [FS][07-MAY-2020][IRAD-956]
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
export const BLOCKQUOTE_TOGGLE = new BlockquoteToggleCommand();
|
|
73
|
+
export const BLOCKQUOTE_INSERT_NEW_LINE = new BlockquoteInsertNewLineCommand();
|
|
74
74
|
export const CLEAR_FORMAT = new MarksClearCommand();
|
|
75
75
|
export const DOC_LAYOUT = new DocLayoutCommand();
|
|
76
76
|
export const EM = new MarkToggleCommand(MARK_EM);
|
package/EditorKeyMap.js
CHANGED
|
@@ -24,13 +24,7 @@ export function findShortcutByKeymap(keymap) {
|
|
|
24
24
|
export var KEY_BACK_DELETE = makeKeyMapWithCommon('', 'Backspace');
|
|
25
25
|
export var KEY_FORWARD_DELETE = makeKeyMapWithCommon('', 'Delete');
|
|
26
26
|
export var KEY_INSERT_HORIZONTAL_RULE = makeKeyMapWithCommon('Insert horizontal rule', 'Mod-Shift--');
|
|
27
|
-
export var
|
|
28
|
-
// [FS][07-MAY-2020][IRAD-956]
|
|
29
|
-
// export const KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon(
|
|
30
|
-
// 'Insert new line in blockquote',
|
|
31
|
-
// 'Shift-Enter'
|
|
32
|
-
// );
|
|
33
|
-
export var KEY_INSERT_NEW_LINE_IN_LIST_ITEM = makeKeyMapWithCommon('Insert new line in list item', 'Shift-Enter');
|
|
27
|
+
export var KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon('Insert new line in blockquote', 'Shift-Enter');
|
|
34
28
|
export var KEY_REDO = makeKeyMapWithCommon('Redo', 'Mod-Shift-z');
|
|
35
29
|
export var KEY_SET_NORMAL_TEXT = makeKeyMap('Normal text', 'Ctrl-0', 'Cmd-Alt-0');
|
|
36
30
|
export var KEY_SHIFT_BACKSPACE = makeKeyMapWithCommon('Shift Backspace', 'Shift-Backspace');
|
|
@@ -54,10 +48,7 @@ export var KEY_TOGGLE_ORDERED_LIST = makeKeyMapWithCommon('Toggle ordered list',
|
|
|
54
48
|
export var KEY_TOGGLE_STRIKETHROUGH = makeKeyMapWithCommon('Toggle strikethrough', 'Mod-Shift-s');
|
|
55
49
|
export var KEY_TOGGLE_UNDERLINE = makeKeyMapWithCommon('Toggle underline', 'Mod-u');
|
|
56
50
|
export var KEY_UNDO = makeKeyMapWithCommon('Undo', 'Mod-z');
|
|
57
|
-
export var ALL_KEYS = [KEY_BACK_DELETE, KEY_FORWARD_DELETE, KEY_INSERT_HORIZONTAL_RULE,
|
|
58
|
-
// [FS][07-MAY-2020][IRAD-956]
|
|
59
|
-
// KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
|
|
60
|
-
KEY_INSERT_NEW_LINE_IN_LIST_ITEM, KEY_SET_NORMAL_TEXT, KEY_SHIFT_BACKSPACE, KEY_SPLIT_LIST_ITEM, KEY_TAB_SHIFT, KEY_TAB, KEY_TOGGLE_BLOCK_QUOTE, KEY_TOGGLE_BOLD, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_CODE_BLOCK, KEY_TOGGLE_HEADING_1, KEY_TOGGLE_HEADING_2, KEY_TOGGLE_HEADING_3, KEY_TOGGLE_HEADING_4, KEY_TOGGLE_HEADING_5, KEY_TOGGLE_HEADING_6, KEY_TOGGLE_ITALIC, KEY_TOGGLE_MONOSPACE, KEY_TOGGLE_ORDERED_LIST, KEY_TOGGLE_STRIKETHROUGH, KEY_TOGGLE_UNDERLINE, KEY_UNDO];
|
|
51
|
+
export var ALL_KEYS = [KEY_BACK_DELETE, KEY_FORWARD_DELETE, KEY_INSERT_HORIZONTAL_RULE, KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE, KEY_SET_NORMAL_TEXT, KEY_SHIFT_BACKSPACE, KEY_SPLIT_LIST_ITEM, KEY_TAB_SHIFT, KEY_TAB, KEY_TOGGLE_BLOCK_QUOTE, KEY_TOGGLE_BOLD, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_BULLET_LIST, KEY_TOGGLE_CODE_BLOCK, KEY_TOGGLE_HEADING_1, KEY_TOGGLE_HEADING_2, KEY_TOGGLE_HEADING_3, KEY_TOGGLE_HEADING_4, KEY_TOGGLE_HEADING_5, KEY_TOGGLE_HEADING_6, KEY_TOGGLE_ITALIC, KEY_TOGGLE_MONOSPACE, KEY_TOGGLE_ORDERED_LIST, KEY_TOGGLE_STRIKETHROUGH, KEY_TOGGLE_UNDERLINE, KEY_UNDO];
|
|
61
52
|
export function findKeymapByDescription(description) {
|
|
62
53
|
var matches = ALL_KEYS.filter(function (keymap) {
|
|
63
54
|
return keymap.description.toUpperCase() === description.toUpperCase();
|
package/EditorKeyMap.js.flow
CHANGED
|
@@ -40,17 +40,8 @@ export const KEY_INSERT_HORIZONTAL_RULE = makeKeyMapWithCommon(
|
|
|
40
40
|
'Insert horizontal rule',
|
|
41
41
|
'Mod-Shift--'
|
|
42
42
|
);
|
|
43
|
-
export const
|
|
44
|
-
'Insert new line',
|
|
45
|
-
'Shift-Enter'
|
|
46
|
-
);
|
|
47
|
-
// [FS][07-MAY-2020][IRAD-956]
|
|
48
|
-
// export const KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon(
|
|
49
|
-
// 'Insert new line in blockquote',
|
|
50
|
-
// 'Shift-Enter'
|
|
51
|
-
// );
|
|
52
|
-
export const KEY_INSERT_NEW_LINE_IN_LIST_ITEM = makeKeyMapWithCommon(
|
|
53
|
-
'Insert new line in list item',
|
|
43
|
+
export const KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon(
|
|
44
|
+
'Insert new line in blockquote',
|
|
54
45
|
'Shift-Enter'
|
|
55
46
|
);
|
|
56
47
|
export const KEY_REDO = makeKeyMapWithCommon('Redo', 'Mod-Shift-z');
|
|
@@ -141,10 +132,7 @@ export const ALL_KEYS = [
|
|
|
141
132
|
KEY_BACK_DELETE,
|
|
142
133
|
KEY_FORWARD_DELETE,
|
|
143
134
|
KEY_INSERT_HORIZONTAL_RULE,
|
|
144
|
-
|
|
145
|
-
// [FS][07-MAY-2020][IRAD-956]
|
|
146
|
-
// KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
|
|
147
|
-
KEY_INSERT_NEW_LINE_IN_LIST_ITEM,
|
|
135
|
+
KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
|
|
148
136
|
KEY_SET_NORMAL_TEXT,
|
|
149
137
|
KEY_SHIFT_BACKSPACE,
|
|
150
138
|
KEY_SPLIT_LIST_ITEM,
|
package/LinkSetURLCommand.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) {
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c(GeneratorFunctionPrototype, u, GeneratorFunction.displayName = "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
|
|
3
3
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
4
4
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
5
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); } }
|
package/LinkTooltipPlugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) {
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c(GeneratorFunctionPrototype, u, GeneratorFunction.displayName = "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
|
|
3
3
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
4
4
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
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; }
|
package/TableNodesSpecs.js
CHANGED
|
@@ -47,18 +47,23 @@ var TableNodeSpec = Object.assign({}, TableNodesSpecs.table, {
|
|
|
47
47
|
attrs: {
|
|
48
48
|
marginLeft: {
|
|
49
49
|
"default": null
|
|
50
|
+
},
|
|
51
|
+
dirty: {
|
|
52
|
+
"default": false
|
|
50
53
|
}
|
|
51
54
|
},
|
|
52
55
|
parseDOM: [{
|
|
53
56
|
tag: 'table',
|
|
54
57
|
getAttrs: function getAttrs(dom) {
|
|
58
|
+
var dirty = dom.getAttribute('dirty') || false;
|
|
55
59
|
var marginLeft = dom.style.marginLeft;
|
|
60
|
+
var attrs = {
|
|
61
|
+
dirty: dirty
|
|
62
|
+
};
|
|
56
63
|
if (marginLeft && /\d+px/.test(marginLeft)) {
|
|
57
|
-
|
|
58
|
-
marginLeft: parseFloat(marginLeft)
|
|
59
|
-
};
|
|
64
|
+
attrs.marginLeft = parseFloat(marginLeft);
|
|
60
65
|
}
|
|
61
|
-
return
|
|
66
|
+
return attrs;
|
|
62
67
|
}
|
|
63
68
|
}],
|
|
64
69
|
toDOM: function toDOM(node) {
|
|
@@ -66,11 +71,16 @@ var TableNodeSpec = Object.assign({}, TableNodesSpecs.table, {
|
|
|
66
71
|
// `TableNodeView`. This method is only called when user selects a
|
|
67
72
|
// table node and copies it, which triggers the "serialize to HTML" flow
|
|
68
73
|
// that calles this method.
|
|
69
|
-
var
|
|
74
|
+
var _node$attrs = node.attrs,
|
|
75
|
+
marginLeft = _node$attrs.marginLeft,
|
|
76
|
+
dirty = _node$attrs.dirty;
|
|
70
77
|
var domAttrs = {};
|
|
71
78
|
if (marginLeft) {
|
|
72
79
|
domAttrs.style = "margin-left: ".concat(marginLeft, "px");
|
|
73
80
|
}
|
|
81
|
+
if (dirty) {
|
|
82
|
+
domAttrs.dirty = dirty;
|
|
83
|
+
}
|
|
74
84
|
return ['table', domAttrs, 0];
|
|
75
85
|
}
|
|
76
86
|
});
|
package/TableNodesSpecs.js.flow
CHANGED
|
@@ -38,7 +38,8 @@ const TableNodesSpecs = tableNodes({
|
|
|
38
38
|
setDOMAttr(value, attrs) {
|
|
39
39
|
if (value) {
|
|
40
40
|
const colorValue = String(value);
|
|
41
|
-
attrs.style =
|
|
41
|
+
attrs.style =
|
|
42
|
+
(attrs.style || '') + `;background-color: ${colorValue};`;
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
45
|
},
|
|
@@ -49,16 +50,21 @@ const TableNodesSpecs = tableNodes({
|
|
|
49
50
|
const TableNodeSpec = Object.assign({}, TableNodesSpecs.table, {
|
|
50
51
|
attrs: {
|
|
51
52
|
marginLeft: { default: null },
|
|
53
|
+
dirty: { default: false },
|
|
52
54
|
},
|
|
53
55
|
parseDOM: [
|
|
54
56
|
{
|
|
55
57
|
tag: 'table',
|
|
56
58
|
getAttrs(dom: HTMLElement): ?Object {
|
|
59
|
+
const dirty = dom.getAttribute('dirty') || false;
|
|
57
60
|
const { marginLeft } = dom.style;
|
|
61
|
+
const attrs = { dirty };
|
|
62
|
+
|
|
58
63
|
if (marginLeft && /\d+px/.test(marginLeft)) {
|
|
59
|
-
|
|
64
|
+
attrs.marginLeft = parseFloat(marginLeft);
|
|
60
65
|
}
|
|
61
|
-
|
|
66
|
+
|
|
67
|
+
return attrs;
|
|
62
68
|
},
|
|
63
69
|
},
|
|
64
70
|
],
|
|
@@ -67,11 +73,14 @@ const TableNodeSpec = Object.assign({}, TableNodesSpecs.table, {
|
|
|
67
73
|
// `TableNodeView`. This method is only called when user selects a
|
|
68
74
|
// table node and copies it, which triggers the "serialize to HTML" flow
|
|
69
75
|
// that calles this method.
|
|
70
|
-
const { marginLeft } = node.attrs;
|
|
76
|
+
const { marginLeft, dirty } = node.attrs;
|
|
71
77
|
const domAttrs = {};
|
|
72
78
|
if (marginLeft) {
|
|
73
79
|
domAttrs.style = `margin-left: ${marginLeft}px`;
|
|
74
80
|
}
|
|
81
|
+
if (dirty) {
|
|
82
|
+
domAttrs.dirty = dirty;
|
|
83
|
+
}
|
|
75
84
|
return ['table', domAttrs, 0];
|
|
76
85
|
},
|
|
77
86
|
});
|