@modusoperandi/licit 1.4.0 → 1.4.2
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 +1 -1
- package/LinkTooltipPlugin.js +1 -1
- package/TableBackgroundColorCommand.js +1 -1
- package/TableBackgroundColorCommand.js.flow +2 -2
- package/TableBorderColorCommand.js +35 -3
- package/TableBorderColorCommand.js.flow +31 -4
- package/TableCellColorCommand.js +1 -1
- package/TableCellColorCommand.js.flow +3 -3
- package/TableNodesSpecs.js +55 -0
- package/TableNodesSpecs.js.flow +55 -0
- package/bom.xml +36727 -30036
- package/client/Licit.js +20 -4
- package/client/Licit.js.flow +18 -6
- package/package.json +6 -6
- package/ui/Icon.js +1 -1
- package/ui/LinkURLEditor.js +12 -12
- package/ui/LinkURLEditor.js.flow +8 -8
- package/ui/czi-editor.css +5 -0
- package/ui/czi-table.css +4 -1
package/client/Licit.js
CHANGED
|
@@ -133,9 +133,9 @@ var Licit = /*#__PURE__*/function (_React$Component) {
|
|
|
133
133
|
// Only need to call if there is any difference in collab mode OR always in non-collab mode.
|
|
134
134
|
_this._connector.onEdit(transaction, _this._editorView);
|
|
135
135
|
}
|
|
136
|
-
if (transaction.docChanged) {
|
|
137
|
-
var _docJson$attrs;
|
|
138
|
-
var docJson =
|
|
136
|
+
if (transaction.docChanged || !isSameState) {
|
|
137
|
+
var _this$_editorView, _docJson$attrs;
|
|
138
|
+
var docJson = (_this$_editorView = _this._editorView) === null || _this$_editorView === void 0 || (_this$_editorView = _this$_editorView.state) === null || _this$_editorView === void 0 || (_this$_editorView = _this$_editorView.doc) === null || _this$_editorView === void 0 ? void 0 : _this$_editorView.toJSON();
|
|
139
139
|
if (!Object.isFrozen(docJson === null || docJson === void 0 || (_docJson$attrs = docJson.attrs) === null || _docJson$attrs === void 0 ? void 0 : _docJson$attrs.objectMetaData)) {
|
|
140
140
|
docJson.attrs.objectMetaData = _objectSpread(_objectSpread({}, docJson.attrs.objectMetaData), {}, {
|
|
141
141
|
lastEditedOn: new Date().toISOString().replace('Z', '+00:00')
|
|
@@ -172,7 +172,23 @@ var Licit = /*#__PURE__*/function (_React$Component) {
|
|
|
172
172
|
_this._editorView = editorView;
|
|
173
173
|
var tr = state.tr;
|
|
174
174
|
dispatch(tr.scrollIntoView());
|
|
175
|
-
|
|
175
|
+
if (!_this._editorView.editable) {
|
|
176
|
+
var _tr = _this._editorView.state.tr;
|
|
177
|
+
var modified = false;
|
|
178
|
+
_this._editorView.state.doc.descendants(function (node, pos) {
|
|
179
|
+
if (node.type.name === 'table') {
|
|
180
|
+
var _tr2;
|
|
181
|
+
// Apply setNodeMarkup with same type and attrs to force a refresh
|
|
182
|
+
_tr = (_tr2 = _tr) === null || _tr2 === void 0 ? void 0 : _tr2.setNodeMarkup(pos, undefined, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
183
|
+
Id: pos
|
|
184
|
+
}));
|
|
185
|
+
modified = true;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
if (modified) {
|
|
189
|
+
_this._editorView.dispatch(_tr);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
176
192
|
// [FS] IRAD-1578 2021-09-27
|
|
177
193
|
// In collab mode, fire onRead only after getting the response from collab server.
|
|
178
194
|
if (_this.state.onReadyCB && _this.state.docID === '') {
|
package/client/Licit.js.flow
CHANGED
|
@@ -77,7 +77,7 @@ class Licit extends React.Component<any, any> {
|
|
|
77
77
|
this._editorView = null;
|
|
78
78
|
this._skipSCU = true;
|
|
79
79
|
|
|
80
|
-
const noop = function () {
|
|
80
|
+
const noop = function () {};
|
|
81
81
|
|
|
82
82
|
// [FS] IRAD-981 2020-06-10
|
|
83
83
|
// Component's configurations.
|
|
@@ -508,14 +508,13 @@ class Licit extends React.Component<any, any> {
|
|
|
508
508
|
this._connector.onEdit(transaction, this._editorView);
|
|
509
509
|
}
|
|
510
510
|
|
|
511
|
-
if (transaction.docChanged) {
|
|
512
|
-
const docJson =
|
|
511
|
+
if (transaction.docChanged || !isSameState) {
|
|
512
|
+
const docJson = this._editorView?.state?.doc?.toJSON();
|
|
513
513
|
if (!Object.isFrozen(docJson?.attrs?.objectMetaData)) {
|
|
514
514
|
docJson.attrs.objectMetaData = {
|
|
515
515
|
...docJson.attrs.objectMetaData,
|
|
516
|
-
lastEditedOn: new Date().toISOString().replace('Z', '+00:00')
|
|
516
|
+
lastEditedOn: new Date().toISOString().replace('Z', '+00:00'),
|
|
517
517
|
};
|
|
518
|
-
|
|
519
518
|
}
|
|
520
519
|
let isEmpty = false;
|
|
521
520
|
if (docJson.content && docJson.content.length === 1) {
|
|
@@ -560,7 +559,20 @@ class Licit extends React.Component<any, any> {
|
|
|
560
559
|
this._editorView = editorView;
|
|
561
560
|
const tr = state.tr;
|
|
562
561
|
dispatch(tr.scrollIntoView());
|
|
563
|
-
|
|
562
|
+
if (!this._editorView.editable) {
|
|
563
|
+
let _tr = this._editorView.state.tr;
|
|
564
|
+
let modified = false;
|
|
565
|
+
this._editorView.state.doc.descendants((node, pos) => {
|
|
566
|
+
if (node.type.name === 'table') {
|
|
567
|
+
// Apply setNodeMarkup with same type and attrs to force a refresh
|
|
568
|
+
_tr = _tr?.setNodeMarkup(pos, undefined, { ...node.attrs, Id: pos });
|
|
569
|
+
modified = true;
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
if (modified) {
|
|
573
|
+
this._editorView.dispatch(_tr);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
564
576
|
// [FS] IRAD-1578 2021-09-27
|
|
565
577
|
// In collab mode, fire onRead only after getting the response from collab server.
|
|
566
578
|
if (this.state.onReadyCB && this.state.docID === '') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modusoperandi/licit",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"subversion": "1",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"@babel/preset-env": "^7.19.4",
|
|
72
72
|
"@babel/preset-flow": "^7.10.4",
|
|
73
73
|
"@babel/preset-react": "^7.18.6",
|
|
74
|
-
"@cyclonedx/cyclonedx-npm": "^
|
|
75
|
-
"babel-jest": "^
|
|
74
|
+
"@cyclonedx/cyclonedx-npm": "^4.0.0",
|
|
75
|
+
"babel-jest": "^30.0.2",
|
|
76
76
|
"babel-loader": "^10.0.0",
|
|
77
77
|
"babel-plugin-flow-react-proptypes": "^26.0.0",
|
|
78
78
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
"css-loader": "^7.1.1",
|
|
85
85
|
"eslint": "^9.20.1",
|
|
86
86
|
"eslint-config-prettier": "^10.0.1",
|
|
87
|
-
"eslint-plugin-jest": "^
|
|
87
|
+
"eslint-plugin-jest": "^29.0.1",
|
|
88
88
|
"eslint-plugin-prettier": "^5.1.3",
|
|
89
89
|
"eslint-plugin-react": "^7.33.2",
|
|
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.276.0",
|
|
94
94
|
"flow-copy-source": "^2.0.9",
|
|
95
95
|
"flow-typed": "^4.0.0",
|
|
96
96
|
"flow-webpack-plugin": "^1.2.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"husky": "^9.0.10",
|
|
103
103
|
"identity-obj-proxy": "^3.0.0",
|
|
104
104
|
"jest": "^29.2.0",
|
|
105
|
-
"jest-environment-jsdom": "^
|
|
105
|
+
"jest-environment-jsdom": "^30.0.0",
|
|
106
106
|
"jest-junit": "^16.0.0",
|
|
107
107
|
"jest-prosemirror": "^3.0.0",
|
|
108
108
|
"jest-sonar-reporter": "^2.0.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 _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) && (
|
|
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) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = 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
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); }
|
|
17
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); }
|
|
18
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); }); }; }
|
package/ui/LinkURLEditor.js
CHANGED
|
@@ -103,8 +103,8 @@ var LinkURLEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
105
|
return TOCselectedNode_.some(function (item) {
|
|
106
|
-
var _item$
|
|
107
|
-
return (
|
|
106
|
+
var _item$content$;
|
|
107
|
+
return (item === null || item === void 0 || (_item$content$ = item.content[0]) === null || _item$content$ === void 0 || (_item$content$ = _item$content$.text) === null || _item$content$ === void 0 ? void 0 : _item$content$.trim()) !== '';
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
110
|
var isValid = isTOCValid();
|
|
@@ -179,27 +179,27 @@ var LinkURLEditor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
179
179
|
action: "#"
|
|
180
180
|
}, /*#__PURE__*/React.createElement("label", null, "Select the Inner Link"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("select", {
|
|
181
181
|
defaultValue: TOCselectedNode_.some(function (res) {
|
|
182
|
-
var _res$
|
|
183
|
-
return (
|
|
182
|
+
var _res$content$;
|
|
183
|
+
return (res === null || res === void 0 || (_res$content$ = res.content[0]) === null || _res$content$ === void 0 ? void 0 : _res$content$.text) === url;
|
|
184
184
|
}) ? url : null,
|
|
185
185
|
id: "toc",
|
|
186
186
|
name: "toccontents",
|
|
187
187
|
size: "3"
|
|
188
188
|
}, TOCselectedNode_ === null || TOCselectedNode_ === void 0 ? void 0 : TOCselectedNode_.filter(function (res) {
|
|
189
|
-
var _res$
|
|
190
|
-
return (
|
|
189
|
+
var _res$content$2;
|
|
190
|
+
return (res === null || res === void 0 || (_res$content$2 = res.content[0]) === null || _res$content$2 === void 0 || (_res$content$2 = _res$content$2.text) === null || _res$content$2 === void 0 ? void 0 : _res$content$2.trim()) !== '';
|
|
191
191
|
}).map(function (res, index) {
|
|
192
|
-
var _res$
|
|
192
|
+
var _res$content$3, _res$content$5, _res$content$6;
|
|
193
193
|
return /*#__PURE__*/React.createElement("option", {
|
|
194
|
-
"data-tooltip-content":
|
|
194
|
+
"data-tooltip-content": res === null || res === void 0 || (_res$content$3 = res.content[0]) === null || _res$content$3 === void 0 ? void 0 : _res$content$3.text,
|
|
195
195
|
"data-tooltip-id": "select-toc-tooltip",
|
|
196
196
|
key: index,
|
|
197
197
|
onClick: function onClick() {
|
|
198
|
-
var _res$
|
|
199
|
-
_this2.handleOptionChange(
|
|
198
|
+
var _res$content$4;
|
|
199
|
+
_this2.handleOptionChange(res === null || res === void 0 || (_res$content$4 = res.content[0]) === null || _res$content$4 === void 0 ? void 0 : _res$content$4.text, res === null || res === void 0 ? void 0 : res.attrs.selectionId);
|
|
200
200
|
},
|
|
201
|
-
value:
|
|
202
|
-
},
|
|
201
|
+
value: res === null || res === void 0 || (_res$content$5 = res.content[0]) === null || _res$content$5 === void 0 ? void 0 : _res$content$5.text
|
|
202
|
+
}, res === null || res === void 0 || (_res$content$6 = res.content[0]) === null || _res$content$6 === void 0 ? void 0 : _res$content$6.text);
|
|
203
203
|
})), /*#__PURE__*/React.createElement(ReactTooltip, {
|
|
204
204
|
effect: "solid",
|
|
205
205
|
id: "select-toc-tooltip",
|
package/ui/LinkURLEditor.js.flow
CHANGED
|
@@ -69,7 +69,7 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return TOCselectedNode_.some(
|
|
72
|
-
(item) => item
|
|
72
|
+
(item) => item?.content[0]?.text?.trim() !== ''
|
|
73
73
|
);
|
|
74
74
|
};
|
|
75
75
|
const isValid = isTOCValid();
|
|
@@ -146,7 +146,7 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
146
146
|
<select
|
|
147
147
|
defaultValue={
|
|
148
148
|
TOCselectedNode_.some(
|
|
149
|
-
(res) => res
|
|
149
|
+
(res) => res?.content[0]?.text === url
|
|
150
150
|
)
|
|
151
151
|
? url
|
|
152
152
|
: null
|
|
@@ -156,21 +156,21 @@ class LinkURLEditor extends React.PureComponent<any, any> {
|
|
|
156
156
|
size="3"
|
|
157
157
|
>
|
|
158
158
|
{TOCselectedNode_?.filter(
|
|
159
|
-
(res) => res
|
|
159
|
+
(res) => res?.content[0]?.text?.trim() !== ''
|
|
160
160
|
).map((res, index) => (
|
|
161
161
|
<option
|
|
162
|
-
data-tooltip-content={res
|
|
162
|
+
data-tooltip-content={res?.content[0]?.text}
|
|
163
163
|
data-tooltip-id="select-toc-tooltip"
|
|
164
164
|
key={index}
|
|
165
165
|
onClick={() => {
|
|
166
166
|
this.handleOptionChange(
|
|
167
|
-
res
|
|
168
|
-
res
|
|
167
|
+
res?.content[0]?.text,
|
|
168
|
+
res?.attrs.selectionId
|
|
169
169
|
);
|
|
170
170
|
}}
|
|
171
|
-
value={res
|
|
171
|
+
value={res?.content[0]?.text}
|
|
172
172
|
>
|
|
173
|
-
{res
|
|
173
|
+
{res?.content[0]?.text}
|
|
174
174
|
</option>
|
|
175
175
|
))}
|
|
176
176
|
</select>
|
package/ui/czi-editor.css
CHANGED
package/ui/czi-table.css
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
height: 12px;
|
|
10
10
|
}
|
|
11
11
|
.ProseMirror table {
|
|
12
|
+
border: 1px solid var(--czi-table-border-color);
|
|
12
13
|
border-collapse:collapse;
|
|
13
14
|
border-spacing: 0;
|
|
14
|
-
border:
|
|
15
|
+
border-width: 0 thin thin 0;
|
|
15
16
|
margin: 0;
|
|
16
17
|
overflow: hidden;
|
|
17
18
|
page-break-inside: avoid;
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
.ProseMirror th {
|
|
24
25
|
background-color: #fff;
|
|
25
26
|
border: 1px solid var(--czi-table-border-color);
|
|
27
|
+
border-width: thin 0 0 thin;
|
|
26
28
|
box-sizing: border-box;
|
|
27
29
|
min-width: 1em;
|
|
28
30
|
padding: 8px;
|
|
@@ -79,6 +81,7 @@ Rezie cursor position issue fixed. */
|
|
|
79
81
|
z-index: 2;
|
|
80
82
|
}
|
|
81
83
|
|
|
84
|
+
|
|
82
85
|
@media only print {
|
|
83
86
|
.ProseMirror table {
|
|
84
87
|
width: 100% !important;
|