@modusoperandi/licit 1.3.6 → 1.4.0
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/LinkSetURLCommand.js +24 -44
- package/LinkSetURLCommand.js.flow +4 -18
- package/LinkTooltipPlugin.js +24 -11
- package/LinkTooltipPlugin.js.flow +13 -2
- package/ParagraphNodeSpec.js +5 -8
- package/ParagraphNodeSpec.js.flow +7 -9
- package/TableNodesSpecs.js +15 -5
- package/TableNodesSpecs.js.flow +13 -4
- package/bom.xml +1055 -927
- package/package.json +2 -2
- package/ui/Icon.js +10 -10
- package/ui/LinkURLEditor.js +16 -31
- package/ui/LinkURLEditor.js.flow +13 -31
- package/ui/TableNodeView.js +15 -5
- package/ui/TableNodeView.js.flow +14 -3
- package/ui/czi-indent.css +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modusoperandi/licit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
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.
|
|
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,8 @@ 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
|
|
15
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (c = i[4] || 3, u = i[5] === e ? i[3] : i[5], i[4] = 3, i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
16
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
|
16
17
|
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
18
|
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
19
|
import cx from 'classnames';
|
|
@@ -22,24 +23,23 @@ var VALID_CHARS = /[a-z_]+/;
|
|
|
22
23
|
var cached = {};
|
|
23
24
|
var CSS_CDN_URL = '//fonts.googleapis.com/icon?family=Material+Icons';
|
|
24
25
|
var CSS_FONT = 'Material Icons';
|
|
25
|
-
_asyncToGenerator(/*#__PURE__*/
|
|
26
|
+
_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
26
27
|
var fontSupported;
|
|
27
|
-
return
|
|
28
|
-
while (1) switch (_context.
|
|
28
|
+
return _regenerator().w(function (_context) {
|
|
29
|
+
while (1) switch (_context.n) {
|
|
29
30
|
case 0:
|
|
30
|
-
_context.
|
|
31
|
+
_context.n = 1;
|
|
31
32
|
return canUseCSSFont(CSS_FONT);
|
|
32
|
-
case
|
|
33
|
-
fontSupported = _context.
|
|
33
|
+
case 1:
|
|
34
|
+
fontSupported = _context.v;
|
|
34
35
|
if (!fontSupported) {
|
|
35
36
|
console.info('Add CSS from ', CSS_CDN_URL);
|
|
36
37
|
// [FS] IRAD-1061 2020-09-19
|
|
37
38
|
// Now loaded locally, so that it work in closed network as well.
|
|
38
39
|
//injectStyleSheet(CSS_CDN_URL);
|
|
39
40
|
}
|
|
40
|
-
case
|
|
41
|
-
|
|
42
|
-
return _context.stop();
|
|
41
|
+
case 2:
|
|
42
|
+
return _context.a(2);
|
|
43
43
|
}
|
|
44
44
|
}, _callee);
|
|
45
45
|
}))();
|
package/ui/LinkURLEditor.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
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 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
|
-
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
2
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5
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); } }
|
|
6
4
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -19,8 +17,6 @@ import PropTypes from 'prop-types';
|
|
|
19
17
|
import sanitizeURL from '../sanitizeURL.js';
|
|
20
18
|
import { CustomButton, preventEventDefault } from '@modusoperandi/licit-ui-commands';
|
|
21
19
|
import { ENTER } from './KeyCodes.js';
|
|
22
|
-
import uuid from '../uuid.js';
|
|
23
|
-
import { EditorView } from 'prosemirror-view';
|
|
24
20
|
import { INNER_LINK } from '../Types.js';
|
|
25
21
|
import { Tooltip as ReactTooltip } from 'react-tooltip';
|
|
26
22
|
var BAD_CHARACTER_PATTER = /\s/;
|
|
@@ -35,7 +31,6 @@ var LinkURLEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
35
31
|
_defineProperty(_this, "state", {
|
|
36
32
|
url: _this.props.href_,
|
|
37
33
|
TOCselectedNode_: _this.props.TOCselectedNode_,
|
|
38
|
-
view_: _this.props.view_,
|
|
39
34
|
selectionId: _this.props.selectionId_
|
|
40
35
|
});
|
|
41
36
|
_defineProperty(_this, "openForm", function (formName) {
|
|
@@ -57,23 +52,10 @@ var LinkURLEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
57
52
|
clickedButton.classList.add('active');
|
|
58
53
|
}
|
|
59
54
|
});
|
|
60
|
-
_defineProperty(_this, "handleOptionChange", function (textContent_,
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var textContent;
|
|
65
|
-
if (!(TocNode !== null && TocNode !== void 0 && (_TocNode$attrs = TocNode.attrs) !== null && _TocNode$attrs !== void 0 && _TocNode$attrs.innerLink)) {
|
|
66
|
-
var nodeUUID = uuid();
|
|
67
|
-
var texthash = '#';
|
|
68
|
-
var nodeAttrs = _objectSpread({}, TocNode.attrs);
|
|
69
|
-
var nodeconcat_UUID = texthash.concat(nodeUUID);
|
|
70
|
-
nodeAttrs.innerLink = nodeconcat_UUID;
|
|
71
|
-
tr = tr.setNodeMarkup(tocNodePosition_, undefined, nodeAttrs);
|
|
72
|
-
textContent = nodeconcat_UUID.concat(INNER_LINK, textContent_);
|
|
73
|
-
} else {
|
|
74
|
-
textContent = TocNode.attrs.innerLink.concat(INNER_LINK, textContent_);
|
|
75
|
-
}
|
|
76
|
-
view.dispatch(tr);
|
|
55
|
+
_defineProperty(_this, "handleOptionChange", function (textContent_, selectionId) {
|
|
56
|
+
var texthash = '';
|
|
57
|
+
var nodeconcat_UUID = texthash.concat(selectionId);
|
|
58
|
+
var textContent = nodeconcat_UUID.concat(INNER_LINK, textContent_);
|
|
77
59
|
_this.props.close(textContent);
|
|
78
60
|
});
|
|
79
61
|
_defineProperty(_this, "_onKeyDown", function (e) {
|
|
@@ -115,18 +97,17 @@ var LinkURLEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
115
97
|
var _this$state = this.state,
|
|
116
98
|
url = _this$state.url,
|
|
117
99
|
TOCselectedNode_ = _this$state.TOCselectedNode_,
|
|
118
|
-
view_ = _this$state.view_,
|
|
119
100
|
selectionId = _this$state.selectionId;
|
|
120
101
|
var isTOCValid = function isTOCValid() {
|
|
121
102
|
if (!TOCselectedNode_ || TOCselectedNode_.length === 0) {
|
|
122
103
|
return false;
|
|
123
104
|
}
|
|
124
105
|
return TOCselectedNode_.some(function (item) {
|
|
125
|
-
|
|
106
|
+
var _item$node_;
|
|
107
|
+
return ((_item$node_ = item.node_) === null || _item$node_ === void 0 || (_item$node_ = _item$node_.content[0]) === null || _item$node_ === void 0 || (_item$node_ = _item$node_.text) === null || _item$node_ === void 0 ? void 0 : _item$node_.trim()) !== '';
|
|
126
108
|
});
|
|
127
109
|
};
|
|
128
110
|
var isValid = isTOCValid();
|
|
129
|
-
console.log('isTOCValid:', isValid);
|
|
130
111
|
var error = url ? BAD_CHARACTER_PATTER.test(url) : false;
|
|
131
112
|
var label = 'Apply';
|
|
132
113
|
var disabled;
|
|
@@ -198,23 +179,27 @@ var LinkURLEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
198
179
|
action: "#"
|
|
199
180
|
}, /*#__PURE__*/React.createElement("label", null, "Select the Inner Link"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("select", {
|
|
200
181
|
defaultValue: TOCselectedNode_.some(function (res) {
|
|
201
|
-
|
|
182
|
+
var _res$node_;
|
|
183
|
+
return ((_res$node_ = res.node_) === null || _res$node_ === void 0 || (_res$node_ = _res$node_.content[0]) === null || _res$node_ === void 0 ? void 0 : _res$node_.text) === url;
|
|
202
184
|
}) ? url : null,
|
|
203
185
|
id: "toc",
|
|
204
186
|
name: "toccontents",
|
|
205
187
|
size: "3"
|
|
206
188
|
}, TOCselectedNode_ === null || TOCselectedNode_ === void 0 ? void 0 : TOCselectedNode_.filter(function (res) {
|
|
207
|
-
|
|
189
|
+
var _res$node_2;
|
|
190
|
+
return ((_res$node_2 = res.node_) === null || _res$node_2 === void 0 || (_res$node_2 = _res$node_2.content[0]) === null || _res$node_2 === void 0 || (_res$node_2 = _res$node_2.text) === null || _res$node_2 === void 0 ? void 0 : _res$node_2.trim()) !== '';
|
|
208
191
|
}).map(function (res, index) {
|
|
192
|
+
var _res$node_3, _res$node_6, _res$node_7;
|
|
209
193
|
return /*#__PURE__*/React.createElement("option", {
|
|
210
|
-
"data-tooltip-content": res.node_.
|
|
194
|
+
"data-tooltip-content": (_res$node_3 = res.node_) === null || _res$node_3 === void 0 || (_res$node_3 = _res$node_3.content[0]) === null || _res$node_3 === void 0 ? void 0 : _res$node_3.text,
|
|
211
195
|
"data-tooltip-id": "select-toc-tooltip",
|
|
212
196
|
key: index,
|
|
213
197
|
onClick: function onClick() {
|
|
214
|
-
|
|
198
|
+
var _res$node_4, _res$node_5;
|
|
199
|
+
_this2.handleOptionChange((_res$node_4 = res.node_) === null || _res$node_4 === void 0 || (_res$node_4 = _res$node_4.content[0]) === null || _res$node_4 === void 0 ? void 0 : _res$node_4.text, (_res$node_5 = res.node_) === null || _res$node_5 === void 0 ? void 0 : _res$node_5.attrs.selectionId);
|
|
215
200
|
},
|
|
216
|
-
value: res.node_.
|
|
217
|
-
}, res.node_.
|
|
201
|
+
value: (_res$node_6 = res.node_) === null || _res$node_6 === void 0 || (_res$node_6 = _res$node_6.content[0]) === null || _res$node_6 === void 0 ? void 0 : _res$node_6.text
|
|
202
|
+
}, (_res$node_7 = res.node_) === null || _res$node_7 === void 0 || (_res$node_7 = _res$node_7.content[0]) === null || _res$node_7 === void 0 ? void 0 : _res$node_7.text);
|
|
218
203
|
})), /*#__PURE__*/React.createElement(ReactTooltip, {
|
|
219
204
|
effect: "solid",
|
|
220
205
|
id: "select-toc-tooltip",
|
package/ui/LinkURLEditor.js.flow
CHANGED
|
@@ -9,8 +9,6 @@ import {
|
|
|
9
9
|
preventEventDefault,
|
|
10
10
|
} from '@modusoperandi/licit-ui-commands';
|
|
11
11
|
import { ENTER } from './KeyCodes.js';
|
|
12
|
-
import uuid from '../uuid.js';
|
|
13
|
-
import { EditorView } from 'prosemirror-view';
|
|
14
12
|
import { INNER_LINK } from '../Types.js';
|
|
15
13
|
import { Tooltip as ReactTooltip } from 'react-tooltip';
|
|
16
14
|
|
|
@@ -26,7 +24,6 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
26
24
|
state = {
|
|
27
25
|
url: this.props.href_,
|
|
28
26
|
TOCselectedNode_: this.props.TOCselectedNode_,
|
|
29
|
-
view_: this.props.view_,
|
|
30
27
|
selectionId: this.props.selectionId_,
|
|
31
28
|
};
|
|
32
29
|
|
|
@@ -64,7 +61,7 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
64
61
|
};
|
|
65
62
|
|
|
66
63
|
render(): React.Element<any> {
|
|
67
|
-
const { url, TOCselectedNode_,
|
|
64
|
+
const { url, TOCselectedNode_, selectionId } = this.state;
|
|
68
65
|
|
|
69
66
|
const isTOCValid = () => {
|
|
70
67
|
if (!TOCselectedNode_ || TOCselectedNode_.length === 0) {
|
|
@@ -72,12 +69,10 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
72
69
|
}
|
|
73
70
|
|
|
74
71
|
return TOCselectedNode_.some(
|
|
75
|
-
(item) => item.node_
|
|
72
|
+
(item) => item.node_?.content[0]?.text?.trim() !== ''
|
|
76
73
|
);
|
|
77
74
|
};
|
|
78
75
|
const isValid = isTOCValid();
|
|
79
|
-
console.log('isTOCValid:', isValid);
|
|
80
|
-
|
|
81
76
|
const error = url ? BAD_CHARACTER_PATTER.test(url) : false;
|
|
82
77
|
|
|
83
78
|
let label = 'Apply';
|
|
@@ -151,7 +146,7 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
151
146
|
<select
|
|
152
147
|
defaultValue={
|
|
153
148
|
TOCselectedNode_.some(
|
|
154
|
-
(res) => res.node_
|
|
149
|
+
(res) => res.node_?.content[0]?.text === url
|
|
155
150
|
)
|
|
156
151
|
? url
|
|
157
152
|
: null
|
|
@@ -161,22 +156,21 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
161
156
|
size="3"
|
|
162
157
|
>
|
|
163
158
|
{TOCselectedNode_?.filter(
|
|
164
|
-
(res) => res.node_
|
|
159
|
+
(res) => res.node_?.content[0]?.text?.trim() !== ''
|
|
165
160
|
).map((res, index) => (
|
|
166
161
|
<option
|
|
167
|
-
data-tooltip-content={res.node_
|
|
162
|
+
data-tooltip-content={res.node_?.content[0]?.text}
|
|
168
163
|
data-tooltip-id="select-toc-tooltip"
|
|
169
164
|
key={index}
|
|
170
165
|
onClick={() => {
|
|
171
166
|
this.handleOptionChange(
|
|
172
|
-
res.node_
|
|
173
|
-
res.
|
|
174
|
-
view_
|
|
167
|
+
res.node_?.content[0]?.text,
|
|
168
|
+
res.node_?.attrs.selectionId
|
|
175
169
|
);
|
|
176
170
|
}}
|
|
177
|
-
value={res.node_
|
|
171
|
+
value={res.node_?.content[0]?.text}
|
|
178
172
|
>
|
|
179
|
-
{res.node_
|
|
173
|
+
{res.node_?.content[0]?.text}
|
|
180
174
|
</option>
|
|
181
175
|
))}
|
|
182
176
|
</select>
|
|
@@ -197,22 +191,10 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
197
191
|
);
|
|
198
192
|
}
|
|
199
193
|
|
|
200
|
-
handleOptionChange = (textContent_,
|
|
201
|
-
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
if (!TocNode?.attrs?.innerLink) {
|
|
205
|
-
const nodeUUID = uuid();
|
|
206
|
-
const texthash = '#';
|
|
207
|
-
const nodeAttrs = { ...TocNode.attrs };
|
|
208
|
-
const nodeconcat_UUID = texthash.concat(nodeUUID);
|
|
209
|
-
nodeAttrs.innerLink = nodeconcat_UUID;
|
|
210
|
-
tr = tr.setNodeMarkup(tocNodePosition_, undefined, nodeAttrs);
|
|
211
|
-
textContent = nodeconcat_UUID.concat(INNER_LINK, textContent_);
|
|
212
|
-
} else {
|
|
213
|
-
textContent = TocNode.attrs.innerLink.concat(INNER_LINK, textContent_);
|
|
214
|
-
}
|
|
215
|
-
view.dispatch(tr);
|
|
194
|
+
handleOptionChange = (textContent_, selectionId) => {
|
|
195
|
+
const texthash = '';
|
|
196
|
+
const nodeconcat_UUID = texthash.concat(selectionId);
|
|
197
|
+
const textContent = nodeconcat_UUID.concat(INNER_LINK, textContent_);
|
|
216
198
|
this.props.close(textContent);
|
|
217
199
|
};
|
|
218
200
|
|
package/ui/TableNodeView.js
CHANGED
|
@@ -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.
|
|
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.
|
|
36
|
+
this._updateAttrs(node);
|
|
37
37
|
}
|
|
38
38
|
return updated;
|
|
39
39
|
}
|
|
40
40
|
}, {
|
|
41
|
-
key: "
|
|
42
|
-
value: function
|
|
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);
|
package/ui/TableNodeView.js.flow
CHANGED
|
@@ -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.
|
|
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.
|
|
14
|
+
this._updateAttrs(node);
|
|
15
15
|
}
|
|
16
16
|
return updated;
|
|
17
17
|
}
|
|
18
|
-
|
|
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
|
}
|
package/ui/czi-indent.css
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
/* Indent */
|
|
2
2
|
|
|
3
3
|
.ProseMirror p[data-indent='1'] {
|
|
4
|
-
margin-left:
|
|
4
|
+
margin-left: 15pt !important;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.ProseMirror p[data-indent='2'] {
|
|
8
|
-
margin-left:
|
|
8
|
+
margin-left: 30pt !important;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.ProseMirror p[data-indent='3'] {
|
|
12
|
-
margin-left:
|
|
12
|
+
margin-left: 45pt !important;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.ProseMirror p[data-indent='4'] {
|
|
16
|
-
margin-left:
|
|
16
|
+
margin-left: 60pt !important;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.ProseMirror p[data-indent='5'] {
|
|
20
|
-
margin-left:
|
|
20
|
+
margin-left: 75pt !important;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.ProseMirror p[data-indent='6'] {
|
|
24
|
-
margin-left:
|
|
24
|
+
margin-left: 90pt !important;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.ProseMirror p[data-indent='7'] {
|
|
28
|
-
margin-left:
|
|
28
|
+
margin-left: 105pt !important;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.ProseMirror p[data-indent='8'] {
|
|
32
|
-
margin-left:
|
|
32
|
+
margin-left: 120pt !important;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.ProseMirror p[data-indent='9'] {
|
|
36
|
-
margin-left:
|
|
36
|
+
margin-left: 135pt !important;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.ProseMirror p[data-indent='10'] {
|
|
40
|
-
margin-left:
|
|
40
|
+
margin-left: 150pt !important;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/* list item indents */
|