@modusoperandi/licit 1.1.2 → 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.
@@ -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);
@@ -1,5 +1,3 @@
1
- /* eslint-disable */
2
-
3
1
  class Reporter {
4
2
  constructor() {
5
3
  this.setAt = 0;
package/client/http.js CHANGED
@@ -1,5 +1,4 @@
1
- /* eslint-disable */
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 = true;
28
+ true, _readOnlyError("aborted");
30
29
  }
31
30
  };
32
31
  return result;
@@ -1,18 +1,16 @@
1
- /* eslint-disable */
2
-
3
1
  // A simple wrapper for XHR.
4
2
  export function req(conf) {
5
- let req = new XMLHttpRequest(),
3
+ const req = new XMLHttpRequest(),
6
4
  aborted = false;
7
- let result = new Promise((success, failure) => {
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
- let text = req.responseText;
15
- let err = new Error(
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 (let header in conf.headers)
25
+ for (const header in conf.headers)
28
26
  req.setRequestHeader(header, conf.headers[header]);
29
27
  req.send(conf.body || null);
30
28
  });
@@ -28,7 +28,7 @@ export default function convertFromJSON(json, schema, defaultSchema, effectivePl
28
28
  var doc = null;
29
29
  try {
30
30
  doc = editorSchema.nodeFromJSON(json);
31
- } catch (error) {
31
+ } catch (_unused) {
32
32
  return null;
33
33
  }
34
34
  return EditorState.create({
@@ -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 (error) {
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.2",
3
+ "version": "1.1.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "subversion": "1",
@@ -43,7 +43,6 @@
43
43
  "@modusoperandi/color-picker": "^1.0.4",
44
44
  "browserkeymap": "^2.0.2",
45
45
  "flatted": "^3.1.0",
46
- "jquery": "^3.5.1",
47
46
  "react-tooltip": "^5.28.0",
48
47
  "resize-observer-polyfill": "^1.5.1",
49
48
  "smooth-scroll-into-view-if-needed": "^2.0.2",
@@ -83,7 +82,7 @@
83
82
  "copyfiles": "^2.4.1",
84
83
  "cors": "^2.8.5",
85
84
  "css-loader": "^7.1.1",
86
- "eslint": "^8.0.0",
85
+ "eslint": "^9.20.1",
87
86
  "eslint-config-prettier": "^10.0.1",
88
87
  "eslint-plugin-jest": "^28.2.0",
89
88
  "eslint-plugin-prettier": "^5.1.3",
@@ -96,6 +95,7 @@
96
95
  "flow-typed": "^4.0.0",
97
96
  "flow-webpack-plugin": "^1.2.0",
98
97
  "formidable": "^3.5.1",
98
+ "globals": "^16.0.0",
99
99
  "html-loader": "^5.0.0",
100
100
  "html-webpack-inline-source-plugin": "1.0.0-beta.2",
101
101
  "html-webpack-plugin": "^5.5.0",
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 (ex) {
70
+ } catch (_unused) {
71
71
  disabled = false;
72
72
  }
73
73
  children.push(/*#__PURE__*/React.createElement(CustomMenuItem, {
@@ -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 (ex) {
37
+ } catch {
38
38
  disabled = false;
39
39
  }
40
40
  children.push(
@@ -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 (ex) {
101
+ } catch (_unused) {
102
102
  disabledVal = false;
103
103
  }
104
104
  return !disabledVal;
@@ -52,7 +52,7 @@ class CommandMenuButton extends React.PureComponent<any, any> {
52
52
  try {
53
53
  disabledVal =
54
54
  !editorView || !command.isEnabled(editorState, editorView, label);
55
- } catch (ex) {
55
+ } catch {
56
56
  disabledVal = false;
57
57
  }
58
58
  return !disabledVal;
@@ -100,7 +100,7 @@ var ListTypeButton = /*#__PURE__*/function (_React$PureComponent) {
100
100
  var disabledVal = true;
101
101
  try {
102
102
  disabledVal = false;
103
- } catch (ex) {
103
+ } catch (_unused) {
104
104
  disabledVal = false;
105
105
  }
106
106
  return !disabledVal;
@@ -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
- className,
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 (ex) {
48
+ } catch {
55
49
  disabledVal = false;
56
50
  }
57
51
  return !disabledVal;
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;
@@ -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;
@@ -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;