@modusoperandi/licit 1.1.1 → 1.1.3
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/LinkTooltipPlugin.js +0 -4
- package/LinkTooltipPlugin.js.flow +0 -5
- package/bom.xml +1422 -1768
- package/client/Reporter.js +0 -1
- package/client/Reporter.js.flow +0 -2
- package/client/http.js +2 -3
- package/client/http.js.flow +5 -7
- package/convertFromJSON.js +1 -1
- package/convertFromJSON.js.flow +3 -7
- package/package.json +20 -30
- package/ui/CommandMenu.js +1 -1
- package/ui/CommandMenu.js.flow +1 -1
- package/ui/CommandMenuButton.js +1 -1
- package/ui/CommandMenuButton.js.flow +1 -1
- package/ui/LinkTooltip.js +3 -2
- package/ui/LinkTooltip.js.flow +11 -2
- package/ui/ListTypeButton.js +1 -1
- package/ui/ListTypeButton.js.flow +3 -9
- package/ui/czi-editor.css +3 -0
- package/ui/toCSSColor.js +1 -1
- package/ui/toCSSColor.js.flow +1 -1
- package/ui/toHexColor.js +1 -1
- package/ui/toHexColor.js.flow +1 -1
package/client/Reporter.js
CHANGED
|
@@ -4,7 +4,6 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
4
4
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
/* eslint-disable */
|
|
8
7
|
var Reporter = /*#__PURE__*/function () {
|
|
9
8
|
function Reporter() {
|
|
10
9
|
_classCallCheck(this, Reporter);
|
package/client/Reporter.js.flow
CHANGED
package/client/http.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); }
|
|
3
2
|
// A simple wrapper for XHR.
|
|
4
3
|
export function req(conf) {
|
|
5
4
|
var req = new XMLHttpRequest(),
|
|
@@ -26,7 +25,7 @@ export function req(conf) {
|
|
|
26
25
|
result.abort = function () {
|
|
27
26
|
if (!aborted) {
|
|
28
27
|
req.abort();
|
|
29
|
-
aborted
|
|
28
|
+
true, _readOnlyError("aborted");
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
return result;
|
package/client/http.js.flow
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
1
|
// A simple wrapper for XHR.
|
|
4
2
|
export function req(conf) {
|
|
5
|
-
|
|
3
|
+
const req = new XMLHttpRequest(),
|
|
6
4
|
aborted = false;
|
|
7
|
-
|
|
5
|
+
const result = new Promise((success, failure) => {
|
|
8
6
|
req.open(conf.method, conf.url, true);
|
|
9
7
|
req.addEventListener('load', () => {
|
|
10
8
|
if (aborted) return;
|
|
11
9
|
if (req.status < 400) {
|
|
12
10
|
success(req.responseText);
|
|
13
11
|
} else {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const text = req.responseText;
|
|
13
|
+
const err = new Error(
|
|
16
14
|
'Request failed: ' + req.statusText + (text ? '\n\n' + text : '')
|
|
17
15
|
);
|
|
18
16
|
err.status = req.status;
|
|
@@ -24,7 +22,7 @@ export function req(conf) {
|
|
|
24
22
|
if (!aborted) failure(new Error('Network error'));
|
|
25
23
|
});
|
|
26
24
|
if (conf.headers)
|
|
27
|
-
for (
|
|
25
|
+
for (const header in conf.headers)
|
|
28
26
|
req.setRequestHeader(header, conf.headers[header]);
|
|
29
27
|
req.send(conf.body || null);
|
|
30
28
|
});
|
package/convertFromJSON.js
CHANGED
package/convertFromJSON.js.flow
CHANGED
|
@@ -27,14 +27,10 @@ export default function convertFromJSON(
|
|
|
27
27
|
error = true;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
if(error) {
|
|
30
|
+
if (error) {
|
|
31
31
|
// [FS] IRAD-1455 2021-06-16
|
|
32
32
|
// Use the effectivePlugins, editor hangs, b'coz of missing default core plugins
|
|
33
|
-
return createEmptyEditorState(
|
|
34
|
-
schema,
|
|
35
|
-
defaultSchema,
|
|
36
|
-
effectivePlugins
|
|
37
|
-
);
|
|
33
|
+
return createEmptyEditorState(schema, defaultSchema, effectivePlugins);
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
// [FS] IRAD-1067 2020-09-19
|
|
@@ -43,7 +39,7 @@ export default function convertFromJSON(
|
|
|
43
39
|
|
|
44
40
|
try {
|
|
45
41
|
doc = editorSchema.nodeFromJSON(json);
|
|
46
|
-
} catch
|
|
42
|
+
} catch {
|
|
47
43
|
return null;
|
|
48
44
|
}
|
|
49
45
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modusoperandi/licit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"subversion": "1",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"build:licit": "node utils/build_bin.js",
|
|
27
27
|
"ci:bom": "cyclonedx-npm --ignore-npm-errors --short-PURLs --output-format XML --output-file dist/bom.xml",
|
|
28
28
|
"ci:build": "npm run build:clean && npm run build:babel && npm run build:flow && npm run build:css && npm run build:fonts && npm run build:bom && copyfiles --up 1 \"src/**/*.d.ts\" dist/ && copyfiles --up 1 \"src/**/*.css\" dist && copyfiles package.json LICENSE dist",
|
|
29
|
-
"flow": "flow --show-all-errors",
|
|
30
29
|
"lint:css": "stylelint \"**/*.css\"",
|
|
31
30
|
"lint:js": "eslint \"src/**/*.js\"",
|
|
32
31
|
"lint": "npm run lint:css & npm run lint:js",
|
|
@@ -35,6 +34,21 @@
|
|
|
35
34
|
"build:style-service-docker": "docker build . -f style-service.Dockerfile -t style-service:latest",
|
|
36
35
|
"verify": "npm run lint -- --fix && npm run ci:build && npm run test:coverage && echo 'All Tests Passed!'"
|
|
37
36
|
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@modusoperandi/licit-ui-commands": "^1.0.8",
|
|
39
|
+
"prosemirror-collab": "^1.2.2",
|
|
40
|
+
"prosemirror-tables": "^1.2.5"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@modusoperandi/color-picker": "^1.0.4",
|
|
44
|
+
"browserkeymap": "^2.0.2",
|
|
45
|
+
"flatted": "^3.1.0",
|
|
46
|
+
"react-tooltip": "^5.28.0",
|
|
47
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
48
|
+
"smooth-scroll-into-view-if-needed": "^2.0.2",
|
|
49
|
+
"url": "^0.11.0",
|
|
50
|
+
"webfontloader": "^1.6.28"
|
|
51
|
+
},
|
|
38
52
|
"devDependencies": {
|
|
39
53
|
"@babel/cli": "^7.19.3",
|
|
40
54
|
"@babel/core": "^7.19.3",
|
|
@@ -68,7 +82,7 @@
|
|
|
68
82
|
"copyfiles": "^2.4.1",
|
|
69
83
|
"cors": "^2.8.5",
|
|
70
84
|
"css-loader": "^7.1.1",
|
|
71
|
-
"eslint": "^
|
|
85
|
+
"eslint": "^9.20.1",
|
|
72
86
|
"eslint-config-prettier": "^10.0.1",
|
|
73
87
|
"eslint-plugin-jest": "^28.2.0",
|
|
74
88
|
"eslint-plugin-prettier": "^5.1.3",
|
|
@@ -81,12 +95,12 @@
|
|
|
81
95
|
"flow-typed": "^4.0.0",
|
|
82
96
|
"flow-webpack-plugin": "^1.2.0",
|
|
83
97
|
"formidable": "^3.5.1",
|
|
98
|
+
"globals": "^16.0.0",
|
|
84
99
|
"html-loader": "^5.0.0",
|
|
85
100
|
"html-webpack-inline-source-plugin": "1.0.0-beta.2",
|
|
86
101
|
"html-webpack-plugin": "^5.5.0",
|
|
87
102
|
"husky": "^9.0.10",
|
|
88
103
|
"identity-obj-proxy": "^3.0.0",
|
|
89
|
-
"invariant": "^2.2.4",
|
|
90
104
|
"jest": "^29.2.0",
|
|
91
105
|
"jest-environment-jsdom": "^29.3.1",
|
|
92
106
|
"jest-junit": "^16.0.0",
|
|
@@ -98,7 +112,7 @@
|
|
|
98
112
|
"prettier": "^3.2.5",
|
|
99
113
|
"style-loader": "^4.0.0",
|
|
100
114
|
"stylelint": "^16.2.1",
|
|
101
|
-
"stylelint-config-standard": "^
|
|
115
|
+
"stylelint-config-standard": "^37.0.0",
|
|
102
116
|
"stylelint-prettier": "^5.0.0",
|
|
103
117
|
"terser-webpack-plugin": "^5.3.10",
|
|
104
118
|
"ts-jest": "^29.1.2",
|
|
@@ -110,32 +124,8 @@
|
|
|
110
124
|
"webpack-dev-server": "^5.0.2",
|
|
111
125
|
"write-file-webpack-plugin": "^4.5.1"
|
|
112
126
|
},
|
|
113
|
-
"dependencies": {
|
|
114
|
-
"@modusoperandi/color-picker": "^1.0.4",
|
|
115
|
-
"body-parser": "^1.19.0",
|
|
116
|
-
"browserkeymap": "^2.0.2",
|
|
117
|
-
"flatted": "^3.1.0",
|
|
118
|
-
"flow-typed": "^4.0.0",
|
|
119
|
-
"formidable": "^3.5.1",
|
|
120
|
-
"invariant": "^2.2.4",
|
|
121
|
-
"jquery": "^3.5.1",
|
|
122
|
-
"react-tooltip": "^5.28.0",
|
|
123
|
-
"resize-observer-polyfill": "^1.5.1",
|
|
124
|
-
"smooth-scroll-into-view-if-needed": "^2.0.2",
|
|
125
|
-
"style-loader": "^4.0.0",
|
|
126
|
-
"url": "^0.11.0",
|
|
127
|
-
"webfontloader": "^1.6.28"
|
|
128
|
-
},
|
|
129
|
-
"peerDependencies": {
|
|
130
|
-
"@modusoperandi/licit-ui-commands": "^1.0.8",
|
|
131
|
-
"jquery": "^3.5.1",
|
|
132
|
-
"prosemirror-collab": "^1.2.2",
|
|
133
|
-
"prosemirror-tables": "^1.2.5"
|
|
134
|
-
},
|
|
135
127
|
"overrides": {
|
|
136
|
-
"libxmljs2": "^1.0.0"
|
|
137
|
-
"react": "^18.3.1",
|
|
138
|
-
"react-dom": "^18.3.1"
|
|
128
|
+
"libxmljs2": "^1.0.0"
|
|
139
129
|
},
|
|
140
130
|
"importSort": {
|
|
141
131
|
".js": {
|
package/ui/CommandMenu.js
CHANGED
|
@@ -67,7 +67,7 @@ var CommandMenu = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
67
67
|
// [FS] IRAD-1053 2020-10-22
|
|
68
68
|
// Disable the Clear style menu when no styles applied to a paragraph
|
|
69
69
|
disabled = !editorView || !command.isEnabled(editorState, editorView, label);
|
|
70
|
-
} catch (
|
|
70
|
+
} catch (_unused) {
|
|
71
71
|
disabled = false;
|
|
72
72
|
}
|
|
73
73
|
children.push(/*#__PURE__*/React.createElement(CustomMenuItem, {
|
package/ui/CommandMenu.js.flow
CHANGED
|
@@ -34,7 +34,7 @@ class CommandMenu extends React.PureComponent<any, any> {
|
|
|
34
34
|
// Disable the Clear style menu when no styles applied to a paragraph
|
|
35
35
|
disabled =
|
|
36
36
|
!editorView || !command.isEnabled(editorState, editorView, label);
|
|
37
|
-
} catch
|
|
37
|
+
} catch {
|
|
38
38
|
disabled = false;
|
|
39
39
|
}
|
|
40
40
|
children.push(
|
package/ui/CommandMenuButton.js
CHANGED
|
@@ -98,7 +98,7 @@ var CommandMenuButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
98
98
|
var disabledVal = true;
|
|
99
99
|
try {
|
|
100
100
|
disabledVal = !editorView || !command.isEnabled(editorState, editorView, label);
|
|
101
|
-
} catch (
|
|
101
|
+
} catch (_unused) {
|
|
102
102
|
disabledVal = false;
|
|
103
103
|
}
|
|
104
104
|
return !disabledVal;
|
package/ui/LinkTooltip.js
CHANGED
|
@@ -102,6 +102,7 @@ var LinkTooltip = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
102
102
|
onRemove = _this$props2.onRemove,
|
|
103
103
|
tocItemPos_ = _this$props2.tocItemPos_,
|
|
104
104
|
selectionId_ = _this$props2.selectionId_;
|
|
105
|
+
var canEdit = editorView.editable;
|
|
105
106
|
// [FS] IRAD-1013 2020-07-09
|
|
106
107
|
var getLabel = function getLabel() {
|
|
107
108
|
if (tocItemPos_ && selectionId_) {
|
|
@@ -131,11 +132,11 @@ var LinkTooltip = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
131
132
|
target: "new",
|
|
132
133
|
title: label,
|
|
133
134
|
value: label
|
|
134
|
-
}), /*#__PURE__*/React.createElement(CustomButton, {
|
|
135
|
+
}), canEdit && /*#__PURE__*/React.createElement(CustomButton, {
|
|
135
136
|
label: "Change",
|
|
136
137
|
onClick: onEdit,
|
|
137
138
|
value: editorView
|
|
138
|
-
}), /*#__PURE__*/React.createElement(CustomButton, {
|
|
139
|
+
}), canEdit && /*#__PURE__*/React.createElement(CustomButton, {
|
|
139
140
|
label: "Remove",
|
|
140
141
|
onClick: onRemove,
|
|
141
142
|
value: editorView
|
package/ui/LinkTooltip.js.flow
CHANGED
|
@@ -24,6 +24,7 @@ class LinkTooltip extends React.PureComponent<any, any> {
|
|
|
24
24
|
render(): React.Element<any> {
|
|
25
25
|
const { href, editorView, onEdit, onRemove, tocItemPos_, selectionId_ } =
|
|
26
26
|
this.props;
|
|
27
|
+
const canEdit = editorView.editable;
|
|
27
28
|
// [FS] IRAD-1013 2020-07-09
|
|
28
29
|
const getLabel = () => {
|
|
29
30
|
if (tocItemPos_ && selectionId_) {
|
|
@@ -53,8 +54,16 @@ class LinkTooltip extends React.PureComponent<any, any> {
|
|
|
53
54
|
title={label}
|
|
54
55
|
value={label}
|
|
55
56
|
/>
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
{canEdit && (
|
|
58
|
+
<CustomButton label="Change" onClick={onEdit} value={editorView} />
|
|
59
|
+
)}
|
|
60
|
+
{canEdit && (
|
|
61
|
+
<CustomButton
|
|
62
|
+
label="Remove"
|
|
63
|
+
onClick={onRemove}
|
|
64
|
+
value={editorView}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
58
67
|
</div>
|
|
59
68
|
</div>
|
|
60
69
|
</div>
|
package/ui/ListTypeButton.js
CHANGED
|
@@ -36,14 +36,8 @@ class ListTypeButton extends React.PureComponent<any, any> {
|
|
|
36
36
|
render(): React.Element<any> {
|
|
37
37
|
// editorState,
|
|
38
38
|
// editorView,
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
-
label,
|
|
42
|
-
commandGroups,
|
|
43
|
-
icon,
|
|
44
|
-
disabled,
|
|
45
|
-
title,
|
|
46
|
-
} = this.props;
|
|
39
|
+
const { className, label, commandGroups, icon, disabled, title } =
|
|
40
|
+
this.props;
|
|
47
41
|
const enabled =
|
|
48
42
|
!disabled &&
|
|
49
43
|
commandGroups.some((group, ii) => {
|
|
@@ -51,7 +45,7 @@ class ListTypeButton extends React.PureComponent<any, any> {
|
|
|
51
45
|
let disabledVal = true;
|
|
52
46
|
try {
|
|
53
47
|
disabledVal = false;
|
|
54
|
-
} catch
|
|
48
|
+
} catch {
|
|
55
49
|
disabledVal = false;
|
|
56
50
|
}
|
|
57
51
|
return !disabledVal;
|
package/ui/czi-editor.css
CHANGED
package/ui/toCSSColor.js
CHANGED
|
@@ -34,7 +34,7 @@ export function toCSSColor(source) {
|
|
|
34
34
|
hex = Color(source).hex().toLowerCase();
|
|
35
35
|
ColorMaping[source] = hex;
|
|
36
36
|
} catch (ex) {
|
|
37
|
-
console.warn('unable to convert to hex', source);
|
|
37
|
+
console.warn('unable to convert to hex', source, ex);
|
|
38
38
|
ColorMaping[source] = '';
|
|
39
39
|
}
|
|
40
40
|
return hex;
|
package/ui/toCSSColor.js.flow
CHANGED
|
@@ -42,7 +42,7 @@ export function toCSSColor(source: any): string {
|
|
|
42
42
|
hex = Color(source).hex().toLowerCase();
|
|
43
43
|
ColorMaping[source] = hex;
|
|
44
44
|
} catch (ex) {
|
|
45
|
-
console.warn('unable to convert to hex', source);
|
|
45
|
+
console.warn('unable to convert to hex', source, ex);
|
|
46
46
|
ColorMaping[source] = '';
|
|
47
47
|
}
|
|
48
48
|
return hex;
|
package/ui/toHexColor.js
CHANGED
|
@@ -15,7 +15,7 @@ export default function toHexColor(source) {
|
|
|
15
15
|
hex = Color(source).hex().toLowerCase();
|
|
16
16
|
ColorMaping[source] = hex;
|
|
17
17
|
} catch (ex) {
|
|
18
|
-
console.warn('unable to convert to hex', source);
|
|
18
|
+
console.warn('unable to convert to hex', source, ex);
|
|
19
19
|
ColorMaping[source] = '';
|
|
20
20
|
}
|
|
21
21
|
return hex;
|
package/ui/toHexColor.js.flow
CHANGED
|
@@ -19,7 +19,7 @@ export default function toHexColor(source: any): string {
|
|
|
19
19
|
hex = Color(source).hex().toLowerCase();
|
|
20
20
|
ColorMaping[source] = hex;
|
|
21
21
|
} catch (ex) {
|
|
22
|
-
console.warn('unable to convert to hex', source);
|
|
22
|
+
console.warn('unable to convert to hex', source, ex);
|
|
23
23
|
ColorMaping[source] = '';
|
|
24
24
|
}
|
|
25
25
|
return hex;
|