@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.
@@ -10,7 +10,7 @@ import * as EditorKeyMap from './EditorKeyMap.js';
10
10
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
11
11
  var KEY_BACK_DELETE = EditorKeyMap.KEY_BACK_DELETE,
12
12
  KEY_FORWARD_DELETE = EditorKeyMap.KEY_FORWARD_DELETE,
13
- KEY_INSERT_NEW_LINE_IN_LIST_ITEM = EditorKeyMap.KEY_INSERT_NEW_LINE_IN_LIST_ITEM,
13
+ KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = EditorKeyMap.KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
14
14
  KEY_REDO = EditorKeyMap.KEY_REDO,
15
15
  KEY_SPLIT_LIST_ITEM = EditorKeyMap.KEY_SPLIT_LIST_ITEM,
16
16
  KEY_TAB_SHIFT = EditorKeyMap.KEY_TAB_SHIFT,
@@ -19,12 +19,12 @@ var KEY_BACK_DELETE = EditorKeyMap.KEY_BACK_DELETE,
19
19
  KEY_TOGGLE_ITALIC = EditorKeyMap.KEY_TOGGLE_ITALIC,
20
20
  KEY_TOGGLE_UNDERLINE = EditorKeyMap.KEY_TOGGLE_UNDERLINE,
21
21
  KEY_UNDO = EditorKeyMap.KEY_UNDO;
22
- var EM = EditorCommands.EM,
22
+ var BLOCKQUOTE_INSERT_NEW_LINE = EditorCommands.BLOCKQUOTE_INSERT_NEW_LINE,
23
+ EM = EditorCommands.EM,
23
24
  HISTORY_REDO = EditorCommands.HISTORY_REDO,
24
25
  HISTORY_UNDO = EditorCommands.HISTORY_UNDO,
25
26
  INDENT_LESS = EditorCommands.INDENT_LESS,
26
27
  INDENT_MORE = EditorCommands.INDENT_MORE,
27
- LIST_ITEM_INSERT_NEW_LINE = EditorCommands.LIST_ITEM_INSERT_NEW_LINE,
28
28
  LIST_ITEM_MERGE_DOWN = EditorCommands.LIST_ITEM_MERGE_DOWN,
29
29
  LIST_ITEM_MERGE_UP = EditorCommands.LIST_ITEM_MERGE_UP,
30
30
  LIST_SPLIT = EditorCommands.LIST_SPLIT,
@@ -49,6 +49,6 @@ function bindCommands() {
49
49
  }
50
50
  export default function createEditorKeyMap() {
51
51
  var _result;
52
- var result = (_result = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_result, KEY_BACK_DELETE.common, LIST_ITEM_MERGE_UP.execute), KEY_FORWARD_DELETE.common, LIST_ITEM_MERGE_DOWN.execute), KEY_REDO.common, HISTORY_REDO.execute), KEY_SPLIT_LIST_ITEM.common, LIST_SPLIT.execute), KEY_TAB.common, bindCommands(TABLE_MOVE_TO_NEXT_CELL, TEXT_INSERT_TAB_SPACE, INDENT_MORE)), KEY_TAB_SHIFT.common, bindCommands(TABLE_MOVE_TO_PREV_CELL, TEXT_INSERT_TAB_SPACE, INDENT_LESS)), KEY_TOGGLE_BOLD.common, STRONG.execute), KEY_TOGGLE_ITALIC.common, EM.execute), KEY_TOGGLE_UNDERLINE.common, UNDERLINE.execute), KEY_UNDO.common, HISTORY_UNDO.execute), _defineProperty(_result, KEY_INSERT_NEW_LINE_IN_LIST_ITEM.common, LIST_ITEM_INSERT_NEW_LINE.execute));
52
+ var result = (_result = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_result, KEY_BACK_DELETE.common, LIST_ITEM_MERGE_UP.execute), KEY_FORWARD_DELETE.common, LIST_ITEM_MERGE_DOWN.execute), KEY_REDO.common, HISTORY_REDO.execute), KEY_SPLIT_LIST_ITEM.common, LIST_SPLIT.execute), KEY_TAB.common, bindCommands(TABLE_MOVE_TO_NEXT_CELL, TEXT_INSERT_TAB_SPACE, INDENT_MORE)), KEY_TAB_SHIFT.common, bindCommands(TABLE_MOVE_TO_PREV_CELL, TEXT_INSERT_TAB_SPACE, INDENT_LESS)), KEY_TOGGLE_BOLD.common, STRONG.execute), KEY_TOGGLE_ITALIC.common, EM.execute), KEY_TOGGLE_UNDERLINE.common, UNDERLINE.execute), KEY_UNDO.common, HISTORY_UNDO.execute), _defineProperty(_result, KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE.common, BLOCKQUOTE_INSERT_NEW_LINE.execute));
53
53
  return result;
54
54
  }
@@ -15,9 +15,7 @@ import type {
15
15
  const {
16
16
  KEY_BACK_DELETE,
17
17
  KEY_FORWARD_DELETE,
18
- // [FS][07-MAY-2020][IRAD-956]
19
- // KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
20
- KEY_INSERT_NEW_LINE_IN_LIST_ITEM,
18
+ KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
21
19
  KEY_REDO,
22
20
  KEY_SPLIT_LIST_ITEM,
23
21
  KEY_TAB_SHIFT,
@@ -29,14 +27,12 @@ const {
29
27
  } = EditorKeyMap;
30
28
 
31
29
  const {
32
- // [FS][07-MAY-2020][IRAD-956]
33
- // BLOCKQUOTE_INSERT_NEW_LINE,
30
+ BLOCKQUOTE_INSERT_NEW_LINE,
34
31
  EM,
35
32
  HISTORY_REDO,
36
33
  HISTORY_UNDO,
37
34
  INDENT_LESS,
38
35
  INDENT_MORE,
39
- LIST_ITEM_INSERT_NEW_LINE,
40
36
  LIST_ITEM_MERGE_DOWN,
41
37
  LIST_ITEM_MERGE_UP,
42
38
  LIST_SPLIT,
@@ -83,11 +79,8 @@ export default function createEditorKeyMap(): UserKeyMap {
83
79
  [KEY_TOGGLE_ITALIC.common]: EM.execute,
84
80
  [KEY_TOGGLE_UNDERLINE.common]: UNDERLINE.execute,
85
81
  [KEY_UNDO.common]: HISTORY_UNDO.execute,
86
- // [FS][07-MAY-2020][IRAD-956]
87
- // [KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE.common]:
88
- // BLOCKQUOTE_INSERT_NEW_LINE.execute,
89
- [KEY_INSERT_NEW_LINE_IN_LIST_ITEM.common]:
90
- LIST_ITEM_INSERT_NEW_LINE.execute,
82
+ [KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE.common]:
83
+ BLOCKQUOTE_INSERT_NEW_LINE.execute,
91
84
  };
92
85
 
93
86
  return result;
package/keymaps.js CHANGED
@@ -19,9 +19,7 @@ export function tooltip(keymap) {
19
19
  export var KEY_BACK_DELETE = makeKeyMapWithCommon('', 'Backspace');
20
20
  export var KEY_FORWARD_DELETE = makeKeyMapWithCommon('', 'Delete');
21
21
  export var KEY_INSERT_HORIZONTAL_RULE = makeKeyMapWithCommon('Insert horizontal rule', 'Mod-Shift--');
22
- export var KEY_INSERT_NEW_LINE = makeKeyMapWithCommon('Insert new line', 'Shift-Enter');
23
22
  export var KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon('Insert new line in blockquote', 'Shift-Enter');
24
- export var KEY_INSERT_NEW_LINE_IN_LIST_ITEM = makeKeyMapWithCommon('Insert new line in list item', 'Shift-Enter');
25
23
  export var KEY_REDO = makeKeyMapWithCommon('Redo', 'Mod-Shift-z');
26
24
  export var KEY_SET_NORMAL_TEXT = makeKeyMap('Normal text', 'Ctrl-0', 'Cmd-Alt-0');
27
25
  export var KEY_SHIFT_BACKSPACE = makeKeyMapWithCommon('Shift Backspace', 'Shift-Backspace');
@@ -45,7 +43,7 @@ export var KEY_TOGGLE_ORDERED_LIST = makeKeyMapWithCommon('Toggle ordered list',
45
43
  export var KEY_TOGGLE_STRIKETHROUGH = makeKeyMapWithCommon('Toggle strikethrough', 'Mod-Shift-s');
46
44
  export var KEY_TOGGLE_UNDERLINE = makeKeyMapWithCommon('Toggle underline', 'Mod-u');
47
45
  export var KEY_UNDO = makeKeyMapWithCommon('Undo', 'Mod-z');
48
- export var ALL_KEYS = [KEY_BACK_DELETE, KEY_FORWARD_DELETE, KEY_INSERT_HORIZONTAL_RULE, KEY_INSERT_NEW_LINE, KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE, 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];
46
+ 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];
49
47
  export function findKeymapByDescription(description) {
50
48
  var matches = ALL_KEYS.filter(function (keymap) {
51
49
  return keymap.description.toUpperCase() === description.toUpperCase();
package/keymaps.js.flow CHANGED
@@ -34,18 +34,10 @@ export const KEY_INSERT_HORIZONTAL_RULE = makeKeyMapWithCommon(
34
34
  'Insert horizontal rule',
35
35
  'Mod-Shift--'
36
36
  );
37
- export const KEY_INSERT_NEW_LINE = makeKeyMapWithCommon(
38
- 'Insert new line',
39
- 'Shift-Enter'
40
- );
41
37
  export const KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE = makeKeyMapWithCommon(
42
38
  'Insert new line in blockquote',
43
39
  'Shift-Enter'
44
40
  );
45
- export const KEY_INSERT_NEW_LINE_IN_LIST_ITEM = makeKeyMapWithCommon(
46
- 'Insert new line in list item',
47
- 'Shift-Enter'
48
- );
49
41
  export const KEY_REDO = makeKeyMapWithCommon('Redo', 'Mod-Shift-z');
50
42
  export const KEY_SET_NORMAL_TEXT = makeKeyMap(
51
43
  'Normal text',
@@ -134,9 +126,7 @@ export const ALL_KEYS = [
134
126
  KEY_BACK_DELETE,
135
127
  KEY_FORWARD_DELETE,
136
128
  KEY_INSERT_HORIZONTAL_RULE,
137
- KEY_INSERT_NEW_LINE,
138
129
  KEY_INSERT_NEW_LINE_IN_BLOCKQUOTE,
139
- KEY_INSERT_NEW_LINE_IN_LIST_ITEM,
140
130
  KEY_SET_NORMAL_TEXT,
141
131
  KEY_SHIFT_BACKSPACE,
142
132
  KEY_SPLIT_LIST_ITEM,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modusoperandi/licit",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "subversion": "1",
@@ -90,7 +90,7 @@
90
90
  "exports-loader": "^5.0.0",
91
91
  "express": "^5.1.0",
92
92
  "file-loader": "^6.2.0",
93
- "flow-bin": "^0.269.1",
93
+ "flow-bin": "^0.272.1",
94
94
  "flow-copy-source": "^2.0.9",
95
95
  "flow-typed": "^4.0.0",
96
96
  "flow-webpack-plugin": "^1.2.0",
package/ui/Icon.js CHANGED
@@ -12,7 +12,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
12
12
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
13
13
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
14
14
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
15
- function _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) { return 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), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "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; }
15
+ 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; }
16
16
  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); }
17
17
  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); }); }; }
18
18
  import cx from 'classnames';
@@ -24,7 +24,7 @@ var TableNodeView = /*#__PURE__*/function (_TableView) {
24
24
  var _this;
25
25
  _classCallCheck(this, TableNodeView);
26
26
  _this = _callSuper(this, TableNodeView, [node, colMinWidth, view]);
27
- _this._updateMargin(node);
27
+ _this._updateAttrs(node);
28
28
  return _this;
29
29
  }
30
30
  _inherits(TableNodeView, _TableView);
@@ -33,19 +33,29 @@ var TableNodeView = /*#__PURE__*/function (_TableView) {
33
33
  value: function update(node) {
34
34
  var updated = _superPropGet(TableNodeView, "update", this, 3)([node]);
35
35
  if (updated) {
36
- this._updateMargin(node);
36
+ this._updateAttrs(node);
37
37
  }
38
38
  return updated;
39
39
  }
40
40
  }, {
41
- key: "_updateMargin",
42
- value: function _updateMargin(node) {
43
- var _node$attrs, _node$attrs2;
41
+ key: "_updateAttrs",
42
+ value: function _updateAttrs(node) {
43
+ var _node$attrs, _node$attrs2, _node$attrs3;
44
+ // Handle marginLeft
44
45
  var marginLeft = ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.marginLeft) || 0;
45
46
  this.table.style.marginLeft = marginLeft ? "".concat(marginLeft, "px") : '';
47
+
48
+ // Handle vignette
46
49
  if ((_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.vignette) {
47
50
  this.table.style.border = 'none';
48
51
  }
52
+
53
+ // Handle dirty -> sets a data attribute for DOM/state sync
54
+ if ((_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.dirty) {
55
+ this.table.setAttribute('dirty', 'true');
56
+ } else {
57
+ this.table.removeAttribute('dirty');
58
+ }
49
59
  }
50
60
  }]);
51
61
  }(TableView);
@@ -6,20 +6,31 @@ import { TableView } from 'prosemirror-tables';
6
6
  export default class TableNodeView extends TableView {
7
7
  constructor(node: Node, colMinWidth: number, view: EditorView) {
8
8
  super(node, colMinWidth, view);
9
- this._updateMargin(node);
9
+ this._updateAttrs(node);
10
10
  }
11
11
  update(node: Node): boolean {
12
12
  const updated = super.update(node);
13
13
  if (updated) {
14
- this._updateMargin(node);
14
+ this._updateAttrs(node);
15
15
  }
16
16
  return updated;
17
17
  }
18
- _updateMargin(node: Node): void {
18
+
19
+ _updateAttrs(node: Node): void {
20
+ // Handle marginLeft
19
21
  const marginLeft = node.attrs?.marginLeft || 0;
20
22
  this.table.style.marginLeft = marginLeft ? `${marginLeft}px` : '';
23
+
24
+ // Handle vignette
21
25
  if (node.attrs?.vignette) {
22
26
  this.table.style.border = 'none';
23
27
  }
28
+
29
+ // Handle dirty -> sets a data attribute for DOM/state sync
30
+ if (node.attrs?.dirty) {
31
+ this.table.setAttribute('dirty', 'true');
32
+ } else {
33
+ this.table.removeAttribute('dirty');
34
+ }
24
35
  }
25
36
  }