@modusoperandi/licit 0.14.15 → 0.14.16

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.
Files changed (38) hide show
  1. package/dist/EditorNodes.js +4 -2
  2. package/dist/EditorNodes.js.flow +4 -2
  3. package/dist/HeadingNodeSpec.js +11 -17
  4. package/dist/HeadingNodeSpec.js.flow +12 -14
  5. package/dist/MathEditCommand.js +1 -1
  6. package/dist/TableCellMenuPlugin.js +1 -1
  7. package/dist/TableResizePlugin.js +25 -1
  8. package/dist/bom.xml +723 -599
  9. package/dist/client/CollabConnector.js +2 -0
  10. package/dist/client/EditorConnection.js +2 -4
  11. package/dist/client/Licit.js +18 -22
  12. package/dist/client/Licit.js.flow +1 -3
  13. package/dist/client/SimpleConnector.js +7 -4
  14. package/dist/ui/CustomNodeView.js +1 -1
  15. package/dist/ui/DocLayoutEditor.js +3 -4
  16. package/dist/ui/Editor.js +2 -0
  17. package/dist/ui/Icon.js +3 -1
  18. package/dist/ui/LinkURLEditor.js +3 -0
  19. package/dist/ui/ListItemNodeView.js +4 -6
  20. package/dist/ui/ListTypeButton.js +3 -1
  21. package/dist/ui/ListTypeCommandButton.js +3 -1
  22. package/dist/ui/ListTypeMenu.js +0 -1
  23. package/dist/ui/MathEditor.js +3 -0
  24. package/dist/ui/PasteMenu.js +0 -1
  25. package/dist/ui/ResizeObserver.js +8 -1
  26. package/dist/ui/TableNodeView.js +3 -0
  27. package/dist/ui/TableNodeView.js.flow +3 -0
  28. package/dist/ui/czi-indent.css +10 -10
  29. package/dist/ui/handleEditorPaste.js +2 -0
  30. package/dist/ui/mathquill-editor/MathQuillEditor.js +3 -1
  31. package/jest.config.js +8 -8
  32. package/package.json +1 -1
  33. package/src/EditorNodes.js +4 -2
  34. package/src/HeadingNodeSpec.js +12 -14
  35. package/src/client/Licit.js +1 -3
  36. package/src/ui/TableNodeView.js +3 -0
  37. package/src/ui/czi-indent.css +10 -10
  38. package/webpack.config.js +1 -1
@@ -49,6 +49,8 @@ class CollabConnector extends _SimpleConnector.default {
49
49
  });
50
50
  });
51
51
  });
52
+ // FS IRAD-1040 2020-09-02
53
+ // Send the modified schema to server
52
54
  _defineProperty(this, "updateSchema", (schema, data) => {
53
55
  this._connection.updateSchema(schema, data, this._dataDefined);
54
56
  });
@@ -15,7 +15,7 @@ var _flatted = require("flatted");
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
17
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // [FS] IRAD-1040 2020-09-02
19
19
  function badVersion(err) {
20
20
  return err.status == 400 && /invalid version/i.test(String(err));
21
21
  }
@@ -40,6 +40,7 @@ class EditorConnection {
40
40
  _defineProperty(this, "schema", void 0);
41
41
  _defineProperty(this, "plugins", void 0);
42
42
  _defineProperty(this, "defaultSchema", void 0);
43
+ // All state changes go through this
43
44
  _defineProperty(this, "dispatch", action => {
44
45
  let newEditState = null;
45
46
  if (action.type == 'loaded') {
@@ -113,9 +114,6 @@ class EditorConnection {
113
114
  getEffectiveSchema() {
114
115
  return null != this.schema ? this.schema : this.defaultSchema;
115
116
  }
116
-
117
- // All state changes go through this
118
-
119
117
  dispatchData(data) {
120
118
  this.report.success();
121
119
  this.backOff = 0;
@@ -57,9 +57,6 @@ const DataType = Object.freeze({
57
57
  */
58
58
  exports.DataType = DataType;
59
59
  class Licit extends React.Component {
60
- // This will be handy in updating document's content.
61
- // Flag to decide whether to skip shouldComponentUpdate
62
-
63
60
  /**
64
61
  * Provides access to prosemirror view.
65
62
  */
@@ -74,7 +71,9 @@ class Licit extends React.Component {
74
71
  _defineProperty(this, "_connector", void 0);
75
72
  _defineProperty(this, "_clientID", void 0);
76
73
  _defineProperty(this, "_editorView", void 0);
74
+ // This will be handy in updating document's content.
77
75
  _defineProperty(this, "_skipSCU", void 0);
76
+ // Flag to decide whether to skip shouldComponentUpdate
78
77
  _defineProperty(this, "_defaultEditorSchema", void 0);
79
78
  _defineProperty(this, "_defaultEditorPlugins", void 0);
80
79
  _defineProperty(this, "_pasteJSONPlugin", void 0);
@@ -178,9 +177,7 @@ class Licit extends React.Component {
178
177
  } = editorView;
179
178
  this._editorView = editorView;
180
179
  const tr = state.tr;
181
- const doc = state.doc;
182
- const trx = tr.setSelection(_prosemirrorState.TextSelection.create(doc, 0, doc.content.size));
183
- dispatch(trx.scrollIntoView());
180
+ dispatch(tr.scrollIntoView());
184
181
 
185
182
  // [FS] IRAD-1578 2021-09-27
186
183
  // In collab mode, fire onRead only after getting the response from collab server.
@@ -190,6 +187,21 @@ class Licit extends React.Component {
190
187
  }
191
188
  this.initDevTool(this.state.debug, editorView);
192
189
  });
190
+ /**
191
+ * LICIT properties:
192
+ * docID {number} [0] Collaborative Doument ID
193
+ * debug {boolean} [false] To enable/disable ProseMirror Debug Tools, available only in development.
194
+ * width {string} [100%] Width of the editor.
195
+ * height {height} [100%] Height of the editor.
196
+ * readOnly {boolean} [false] To enable/disable editing mode.
197
+ * onChange {@callback} [null] Fires after each significant change.
198
+ * @param data {JSON} Modified document data.
199
+ * onReady {@callback} [null] Fires when the editor is fully ready.
200
+ * @param ref {LICIT} Rerefence of the editor.
201
+ * data {JSON} [null] Document data to be loaded into the editor.
202
+ * disabled {boolean} [false] Disable the editor.
203
+ * embedded {boolean} [false] Disable/Enable inline behaviour.
204
+ */
193
205
  _defineProperty(this, "setProps", props => {
194
206
  // [FS] IRAD-1571 2021-10-08
195
207
  // Since the debug lies outside the editor,
@@ -604,22 +616,6 @@ class Licit extends React.Component {
604
616
  componentWillUnmount() {
605
617
  this.destroyDevTool();
606
618
  }
607
-
608
- /**
609
- * LICIT properties:
610
- * docID {number} [0] Collaborative Doument ID
611
- * debug {boolean} [false] To enable/disable ProseMirror Debug Tools, available only in development.
612
- * width {string} [100%] Width of the editor.
613
- * height {height} [100%] Height of the editor.
614
- * readOnly {boolean} [false] To enable/disable editing mode.
615
- * onChange {@callback} [null] Fires after each significant change.
616
- * @param data {JSON} Modified document data.
617
- * onReady {@callback} [null] Fires when the editor is fully ready.
618
- * @param ref {LICIT} Rerefence of the editor.
619
- * data {JSON} [null] Document data to be loaded into the editor.
620
- * disabled {boolean} [false] Disable the editor.
621
- * embedded {boolean} [false] Disable/Enable inline behaviour.
622
- */
623
619
  }
624
620
  var _default = Licit;
625
621
  exports.default = _default;
@@ -561,9 +561,7 @@ class Licit extends React.Component<any, any> {
561
561
  const { state, dispatch } = editorView;
562
562
  this._editorView = editorView;
563
563
  const tr = state.tr;
564
- const doc = state.doc;
565
- const trx = tr.setSelection(TextSelection.create(doc, 0, doc.content.size));
566
- dispatch(trx.scrollIntoView());
564
+ dispatch(tr.scrollIntoView());
567
565
 
568
566
  // [FS] IRAD-1578 2021-09-27
569
567
  // In collab mode, fire onRead only after getting the response from collab server.
@@ -17,13 +17,12 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
17
17
  var bpfrpt_proptype_SetStateCall = _propTypes.default.func;
18
18
  exports.bpfrpt_proptype_SetStateCall = bpfrpt_proptype_SetStateCall;
19
19
  class SimpleConnector {
20
- // This flag is used to deteremine if data passed in or not
21
- // If not passed in, use the data from collab server when in collab mode.
22
- // else use empty content.
23
-
24
20
  constructor(_editorState, setState) {
25
21
  _defineProperty(this, "_setState", void 0);
26
22
  _defineProperty(this, "_editorState", void 0);
23
+ // This flag is used to deteremine if data passed in or not
24
+ // If not passed in, use the data from collab server when in collab mode.
25
+ // else use empty content.
27
26
  _defineProperty(this, "_dataDefined", void 0);
28
27
  _defineProperty(this, "onEdit", (transaction, view) => {
29
28
  _reactDom.default.unstable_batchedUpdates(() => {
@@ -42,9 +41,13 @@ class SimpleConnector {
42
41
  });
43
42
  });
44
43
  });
44
+ // FS IRAD-989 2020-18-06
45
+ // updating properties should automatically render the changes
45
46
  _defineProperty(this, "getState", () => {
46
47
  return this._editorState;
47
48
  });
49
+ // FS IRAD-1040 2020-09-02
50
+ // Send the modified schema to server
48
51
  _defineProperty(this, "updateSchema", (schema, data) => {});
49
52
  _defineProperty(this, "updateContent", data => {});
50
53
  _defineProperty(this, "cleanUp", () => {});
@@ -17,7 +17,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
17
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
18
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
19
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // @xflow
21
21
  var bpfrpt_proptype_NodeViewProps = {
22
22
  "editorView": function () {
23
23
  return (typeof _prosemirrorView.EditorView === "function" ? _propTypes.default.instanceOf(_prosemirrorView.EditorView).isRequired : _propTypes.default.any.isRequired).apply(this, arguments);
@@ -23,10 +23,6 @@ var bpfrpt_proptype_DocLayoutEditorValue = {
23
23
  };
24
24
  exports.bpfrpt_proptype_DocLayoutEditorValue = bpfrpt_proptype_DocLayoutEditorValue;
25
25
  class DocLayoutEditor extends React.PureComponent {
26
- // [FS] IRAD-1005 2020-07-07
27
- // Upgrade outdated packages.
28
- // To take care of the property type declaration.
29
-
30
26
  constructor(props, context) {
31
27
  super(props, context);
32
28
  _defineProperty(this, "_unmounted", false);
@@ -125,6 +121,9 @@ class DocLayoutEditor extends React.PureComponent {
125
121
  }))));
126
122
  }
127
123
  }
124
+ // [FS] IRAD-1005 2020-07-07
125
+ // Upgrade outdated packages.
126
+ // To take care of the property type declaration.
128
127
  _defineProperty(DocLayoutEditor, "propsTypes", {
129
128
  // initialValue: PropTypes.shape({
130
129
  // layout: PropTypes.string,
package/dist/ui/Editor.js CHANGED
@@ -134,6 +134,8 @@ class Editor extends React.PureComponent {
134
134
  view.focus();
135
135
  }
136
136
  });
137
+ // [FS-AFQ][20-FEB-2020]
138
+ // Collaboration
137
139
  _defineProperty(this, "_dispatchTransaction", transaction => {
138
140
  const {
139
141
  editorState,
package/dist/ui/Icon.js CHANGED
@@ -14,7 +14,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
16
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
17
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // [FS] IRAD-1061 2020-09-19
18
+ // Now loaded locally, so that it work in closed network as well.
19
+ //import injectStyleSheet from './injectStyleSheet';
18
20
  const VALID_CHARS = /[a-z_]+/;
19
21
  const cached = {};
20
22
  const CSS_CDN_URL = '//fonts.googleapis.com/icon?family=Material+Icons';
@@ -90,6 +90,9 @@ class LinkURLEditor extends React.PureComponent {
90
90
  }))));
91
91
  }
92
92
  }
93
+ // [FS] IRAD-1005 2020-07-07
94
+ // Upgrade outdated packages.
95
+ // To take care of the property type declaration.
93
96
  _defineProperty(LinkURLEditor, "propsTypes", {
94
97
  href: _propTypes.default.string,
95
98
  close: function (props, propName) {
@@ -13,14 +13,12 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
13
13
  // This implements the `NodeView` interface
14
14
  // https://prosemirror.net/docs/ref/#view.NodeView
15
15
  class ListItemNodeView {
16
- // This implements the `NodeView` interface
17
- // The outer DOM node that represents the list item element.
18
-
19
- // This implements the `NodeView` interface.
20
- // The DOM node that should hold the node's content.
21
-
22
16
  constructor(node, editorView, getPos, decorations) {
17
+ // This implements the `NodeView` interface
18
+ // The outer DOM node that represents the list item element.
23
19
  _defineProperty(this, "dom", void 0);
20
+ // This implements the `NodeView` interface.
21
+ // The DOM node that should hold the node's content.
24
22
  _defineProperty(this, "contentDOM", void 0);
25
23
  _defineProperty(this, "_nodeUpdated", void 0);
26
24
  const dom = document.createElement('li');
@@ -21,7 +21,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
21
21
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
22
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
23
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
24
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
24
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // [FS] IRAD-1039 2020-09-23
25
+ // Command button to handle different type of list types
26
+ // Need to add Icons instead of label
25
27
  class ListTypeButton extends React.PureComponent {
26
28
  constructor() {
27
29
  super(...arguments);
@@ -15,7 +15,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
16
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
17
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // [FS] IRAD-1039 2020-09-23
19
+ // Command button to handle different type of list types
20
+ // Need to add Icons instead of label
19
21
  const LIST_TYPE_NAMES = [{
20
22
  name: 'decimal',
21
23
  label: '1.'
@@ -19,7 +19,6 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
19
19
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
20
  // [FS] IRAD-1039 2020-09-24
21
21
  // UI to show the list buttons
22
-
23
22
  class ListTypeMenu extends React.PureComponent {
24
23
  constructor() {
25
24
  super(...arguments);
@@ -63,6 +63,9 @@ class MathEditor extends React.PureComponent {
63
63
  }))));
64
64
  }
65
65
  }
66
+ // [FS] IRAD-1005 2020-07-07
67
+ // Upgrade outdated packages.
68
+ // To take care of the property type declaration.
66
69
  _defineProperty(MathEditor, "propsTypes", {
67
70
  initialValue: _propTypes.default.string,
68
71
  close: function (props, propName) {
@@ -17,7 +17,6 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
17
17
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
18
  // [FS] IRAD-1076 2020-10-15
19
19
  // Popup menu UI with paste options.
20
-
21
20
  class PasteMenu extends React.PureComponent {
22
21
  constructor() {
23
22
  super(...arguments);
@@ -10,6 +10,8 @@ var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-po
10
10
  var _nullthrows = _interopRequireDefault(require("nullthrows"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ // flow type copied from
14
+ // https://github.com/que-etc/resize-observer-polyfill/blob/master/src/index.js.flow
13
15
  var bpfrpt_proptype_ResizeObserverEntry = {
14
16
  "target": function () {
15
17
  return (typeof Element === "function" ? _propTypes.default.instanceOf(Element).isRequired : _propTypes.default.any.isRequired).apply(this, arguments);
@@ -24,7 +26,12 @@ var bpfrpt_proptype_ResizeObserverEntry = {
24
26
  bottom: _propTypes.default.number.isRequired,
25
27
  left: _propTypes.default.number.isRequired
26
28
  }).isRequired
27
- };
29
+ }; // Lightweight utilities to make observing resize of DOM element easier
30
+ // with `ResizeObserver`.
31
+ // See https://developers.google.com/web/updates/2016/10/resizeobserver
32
+ // Usage:
33
+ // `ResizeObserver.observe(element, (entry) => console.log(entry))`
34
+ // `ResizeObserver.unobserve(element)`
28
35
  exports.bpfrpt_proptype_ResizeObserverEntry = bpfrpt_proptype_ResizeObserverEntry;
29
36
  let instance = null;
30
37
  const nodesObserving = new Map();
@@ -23,6 +23,9 @@ class TableNodeView extends _prosemirrorTables.TableView {
23
23
  _updateMargin(node) {
24
24
  const marginLeft = node.attrs && node.attrs.marginLeft || 0;
25
25
  this.table.style.marginLeft = marginLeft ? `${marginLeft}px` : '';
26
+ if (node.attrs && node.attrs.vignette) {
27
+ this.table.style.border = 'none';
28
+ }
26
29
  }
27
30
  }
28
31
  exports.default = TableNodeView;
@@ -18,5 +18,8 @@ export default class TableNodeView extends TableView {
18
18
  _updateMargin(node: Node): void {
19
19
  const marginLeft = (node.attrs && node.attrs.marginLeft) || 0;
20
20
  this.table.style.marginLeft = marginLeft ? `${marginLeft}px` : '';
21
+ if(node.attrs && node.attrs.vignette){
22
+ this.table.style.border='none' ;
23
+ }
21
24
  }
22
25
  }
@@ -1,43 +1,43 @@
1
1
  /* Indent */
2
2
 
3
3
  .ProseMirror p[data-indent='1'] {
4
- margin-left: 18pt;
4
+ margin-left: 30pt !important;
5
5
  }
6
6
 
7
7
  .ProseMirror p[data-indent='2'] {
8
- margin-left: 42pt;
8
+ margin-left: 58pt !important;
9
9
  }
10
10
 
11
11
  .ProseMirror p[data-indent='3'] {
12
- margin-left: 66pt;
12
+ margin-left: 91pt !important;
13
13
  }
14
14
 
15
15
  .ProseMirror p[data-indent='4'] {
16
- margin-left: 80pt;
16
+ margin-left: 117pt !important;
17
17
  }
18
18
 
19
19
  .ProseMirror p[data-indent='5'] {
20
- margin-left: 98pt;
20
+ margin-left: 144pt !important;
21
21
  }
22
22
 
23
23
  .ProseMirror p[data-indent='6'] {
24
- margin-left: 122pt;
24
+ margin-left: 178pt !important;
25
25
  }
26
26
 
27
27
  .ProseMirror p[data-indent='7'] {
28
- margin-left: 150pt;
28
+ margin-left: 215pt !important;
29
29
  }
30
30
 
31
31
  .ProseMirror p[data-indent='8'] {
32
- margin-left: 178pt;
32
+ margin-left: 251pt !important;
33
33
  }
34
34
 
35
35
  .ProseMirror p[data-indent='9'] {
36
- margin-left: 206pt;
36
+ margin-left: 291pt !important;
37
37
  }
38
38
 
39
39
  .ProseMirror p[data-indent='10'] {
40
- margin-left: 234pt;
40
+ margin-left: 326pt !important;
41
41
  }
42
42
 
43
43
  /* list item indents */
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = handleEditorPaste;
7
7
  var _prosemirrorView = require("prosemirror-view");
8
8
  var _ImageUploadPlaceholderPlugin = require("../ImageUploadPlaceholderPlugin");
9
+ // workaround to support ClipboardEvent as a valid type.
10
+ // https://github.com/facebook/flow/issues/1856
9
11
  function handleEditorPaste(view, event) {
10
12
  const {
11
13
  clipboardData
@@ -17,7 +17,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
18
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
19
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // [FS] IRAD-1061 2020-09-19
21
+ // Now loaded locally, so that it work in closed network as well.
21
22
  const CSS_CDN_URL = '//cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1/mathquill.css';
22
23
  const CSS_FONT = 'Symbola';
23
24
  const MQ = _mathquillImportKludge.MathQuill.getInterface(2);
@@ -49,6 +50,7 @@ class MathQuillEditor extends React.PureComponent {
49
50
  constructor() {
50
51
  super(...arguments);
51
52
  _defineProperty(this, "props", void 0);
53
+ // MathJax apparently fire 4 edit events on startup.
52
54
  _defineProperty(this, "_element", null);
53
55
  _defineProperty(this, "_ignoreEditEvents", 4);
54
56
  _defineProperty(this, "_mathField", null);
package/jest.config.js CHANGED
@@ -20,9 +20,8 @@ module.exports = {
20
20
  collectCoverage: true,
21
21
 
22
22
  // An array of glob patterns indicating a set of files for which coverage information should be collected
23
- collectCoverageFrom: [
24
- '**/*.{js}'
25
- ],
23
+
24
+ collectCoverageFrom: ['**/*.{js,jsx,ts,tsx}'],
26
25
 
27
26
  // The directory where Jest should output its coverage files
28
27
  coverageDirectory: '../coverage',
@@ -37,14 +36,15 @@ module.exports = {
37
36
 
38
37
  // A list of reporter names that Jest uses when writing coverage reports
39
38
  coverageReporters: [
40
- // "json",
41
- // "text",
42
- 'lcov',
43
- // "clover"
39
+ // "json",
40
+ 'text',
41
+ 'cobertura',
42
+ 'lcov',
43
+ // "clover"
44
44
  ],
45
45
 
46
46
  // An object that configures minimum threshold enforcement for coverage results
47
- // coverageThreshold: undefined,
47
+ coverageThreshold: {global:{branches:80,functions:80,lines:80,},},
48
48
 
49
49
  // A path to a custom dependency extractor
50
50
  // dependencyExtractor: undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modusoperandi/licit",
3
- "version": "0.14.15",
3
+ "version": "0.14.16",
4
4
  "subversion": "1",
5
5
  "description": "Rich text editor built with React and ProseMirror",
6
6
  "main": "dist/index.js",
@@ -6,7 +6,7 @@ import BookmarkNodeSpec from './BookmarkNodeSpec';
6
6
  import BulletListNodeSpec from './BulletListNodeSpec';
7
7
  import DocNodeSpec from './DocNodeSpec';
8
8
  import HardBreakNodeSpec from './HardBreakNodeSpec';
9
- import HeadingNodeSpec from './HeadingNodeSpec';
9
+ // import HeadingNodeSpec from './HeadingNodeSpec';
10
10
  import HorizontalRuleNodeSpec from './HorizontalRuleNodeSpec';
11
11
  import ListItemNodeSpec from './ListItemNodeSpec';
12
12
  import MathNodeSpec from './MathNodeSpec';
@@ -36,12 +36,14 @@ const {
36
36
 
37
37
  // !! Be careful with the order of these nodes, which may effect the parsing
38
38
  // outcome.!!
39
+ // [FS-SEA][06-04-2023]
40
+ // Changed HeadingNodeSpec to ParagraphNodeSpec for HEADING to handle Header as a paragraph
39
41
  const nodes = {
40
42
  [DOC]: DocNodeSpec,
41
43
  [PARAGRAPH]: ParagraphNodeSpec,
42
44
  [BLOCKQUOTE]: BlockquoteNodeSpec,
43
45
  [HORIZONTAL_RULE]: HorizontalRuleNodeSpec,
44
- [HEADING]: HeadingNodeSpec,
46
+ [HEADING]: ParagraphNodeSpec,
45
47
  [TEXT]: TextNodeSpec,
46
48
  [MATH]: MathNodeSpec,
47
49
  [HARD_BREAK]: HardBreakNodeSpec,
@@ -7,14 +7,14 @@ import { getParagraphNodeAttrs, toParagraphDOM } from './ParagraphNodeSpec';
7
7
 
8
8
  import type { NodeSpec } from './Types';
9
9
 
10
- const TAG_NAME_TO_LEVEL = {
11
- H1: 1,
12
- H2: 2,
13
- H3: 3,
14
- H4: 4,
15
- H5: 5,
16
- H6: 6,
17
- };
10
+ // const TAG_NAME_TO_LEVEL = {
11
+ // H1: 1,
12
+ // H2: 2,
13
+ // H3: 3,
14
+ // H4: 4,
15
+ // H5: 5,
16
+ // H6: 6,
17
+ // };
18
18
 
19
19
  // https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js
20
20
  // :: NodeSpec A plain paragraph textblock. Represented in the DOM
@@ -23,7 +23,7 @@ const HeadingNodeSpec: NodeSpec = {
23
23
  ...ParagraphNodeSpec,
24
24
  attrs: {
25
25
  ...ParagraphNodeSpec.attrs,
26
- level: { default: 1 },
26
+ // level: { default: 1 },
27
27
  },
28
28
  defining: true,
29
29
  parseDOM: [
@@ -38,16 +38,14 @@ const HeadingNodeSpec: NodeSpec = {
38
38
  };
39
39
 
40
40
  function toDOM(node: Node): Array<any> {
41
+ // [FS-SEA][06-04-2023]
42
+ // returns paragraph node to dom when a header node paste
41
43
  const dom = toParagraphDOM(node);
42
- const level = node.attrs.level || 1;
43
- dom[0] = `h${level}`;
44
44
  return dom;
45
45
  }
46
46
 
47
47
  function getAttrs(dom: HTMLElement): Object {
48
- const attrs: Object = getParagraphNodeAttrs(dom);
49
- const level = TAG_NAME_TO_LEVEL[dom.nodeName.toUpperCase()] || 1;
50
- attrs.level = level;
48
+ const attrs = getParagraphNodeAttrs(dom);
51
49
  return attrs;
52
50
  }
53
51
 
@@ -561,9 +561,7 @@ class Licit extends React.Component<any, any> {
561
561
  const { state, dispatch } = editorView;
562
562
  this._editorView = editorView;
563
563
  const tr = state.tr;
564
- const doc = state.doc;
565
- const trx = tr.setSelection(TextSelection.create(doc, 0, doc.content.size));
566
- dispatch(trx.scrollIntoView());
564
+ dispatch(tr.scrollIntoView());
567
565
 
568
566
  // [FS] IRAD-1578 2021-09-27
569
567
  // In collab mode, fire onRead only after getting the response from collab server.
@@ -18,5 +18,8 @@ export default class TableNodeView extends TableView {
18
18
  _updateMargin(node: Node): void {
19
19
  const marginLeft = (node.attrs && node.attrs.marginLeft) || 0;
20
20
  this.table.style.marginLeft = marginLeft ? `${marginLeft}px` : '';
21
+ if(node.attrs && node.attrs.vignette){
22
+ this.table.style.border='none' ;
23
+ }
21
24
  }
22
25
  }
@@ -1,43 +1,43 @@
1
1
  /* Indent */
2
2
 
3
3
  .ProseMirror p[data-indent='1'] {
4
- margin-left: 18pt;
4
+ margin-left: 30pt !important;
5
5
  }
6
6
 
7
7
  .ProseMirror p[data-indent='2'] {
8
- margin-left: 42pt;
8
+ margin-left: 58pt !important;
9
9
  }
10
10
 
11
11
  .ProseMirror p[data-indent='3'] {
12
- margin-left: 66pt;
12
+ margin-left: 91pt !important;
13
13
  }
14
14
 
15
15
  .ProseMirror p[data-indent='4'] {
16
- margin-left: 80pt;
16
+ margin-left: 117pt !important;
17
17
  }
18
18
 
19
19
  .ProseMirror p[data-indent='5'] {
20
- margin-left: 98pt;
20
+ margin-left: 144pt !important;
21
21
  }
22
22
 
23
23
  .ProseMirror p[data-indent='6'] {
24
- margin-left: 122pt;
24
+ margin-left: 178pt !important;
25
25
  }
26
26
 
27
27
  .ProseMirror p[data-indent='7'] {
28
- margin-left: 150pt;
28
+ margin-left: 215pt !important;
29
29
  }
30
30
 
31
31
  .ProseMirror p[data-indent='8'] {
32
- margin-left: 178pt;
32
+ margin-left: 251pt !important;
33
33
  }
34
34
 
35
35
  .ProseMirror p[data-indent='9'] {
36
- margin-left: 206pt;
36
+ margin-left: 291pt !important;
37
37
  }
38
38
 
39
39
  .ProseMirror p[data-indent='10'] {
40
- margin-left: 234pt;
40
+ margin-left: 326pt !important;
41
41
  }
42
42
 
43
43
  /* list item indents */
package/webpack.config.js CHANGED
@@ -86,7 +86,7 @@ var options = {
86
86
  'window.jQuery': 'jquery',
87
87
  }),
88
88
  // type checker
89
- ... (isDev ? [new FlowWebpackPlugin({flowArgs: ['--show-all-errors']})] : []),
89
+ // ... (isDev ? [new FlowWebpackPlugin({flowArgs: ['--show-all-errors']})] : []),
90
90
  // clean the web folder
91
91
  new CleanWebpackPlugin(),
92
92
  // expose and write the allowed env vars on the compiled bundle