@modusoperandi/licit 0.14.15 → 0.14.17

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 +722 -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 +3 -3
  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
@@ -10,7 +10,6 @@ var _BookmarkNodeSpec = _interopRequireDefault(require("./BookmarkNodeSpec"));
10
10
  var _BulletListNodeSpec = _interopRequireDefault(require("./BulletListNodeSpec"));
11
11
  var _DocNodeSpec = _interopRequireDefault(require("./DocNodeSpec"));
12
12
  var _HardBreakNodeSpec = _interopRequireDefault(require("./HardBreakNodeSpec"));
13
- var _HeadingNodeSpec = _interopRequireDefault(require("./HeadingNodeSpec"));
14
13
  var _HorizontalRuleNodeSpec = _interopRequireDefault(require("./HorizontalRuleNodeSpec"));
15
14
  var _ListItemNodeSpec = _interopRequireDefault(require("./ListItemNodeSpec"));
16
15
  var _MathNodeSpec = _interopRequireDefault(require("./MathNodeSpec"));
@@ -22,6 +21,7 @@ var _TextNodeSpec = _interopRequireDefault(require("./TextNodeSpec"));
22
21
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
22
  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; }
24
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+ // import HeadingNodeSpec from './HeadingNodeSpec';
25
25
  const {
26
26
  BLOCKQUOTE,
27
27
  BOOKMARK,
@@ -42,12 +42,14 @@ const {
42
42
 
43
43
  // !! Be careful with the order of these nodes, which may effect the parsing
44
44
  // outcome.!!
45
+ // [FS-SEA][06-04-2023]
46
+ // Changed HeadingNodeSpec to ParagraphNodeSpec for HEADING to handle Header as a paragraph
45
47
  const nodes = {
46
48
  [DOC]: _DocNodeSpec.default,
47
49
  [PARAGRAPH]: _ParagraphNodeSpec.default,
48
50
  [BLOCKQUOTE]: _BlockquoteNodeSpec.default,
49
51
  [HORIZONTAL_RULE]: _HorizontalRuleNodeSpec.default,
50
- [HEADING]: _HeadingNodeSpec.default,
52
+ [HEADING]: _ParagraphNodeSpec.default,
51
53
  [TEXT]: _TextNodeSpec.default,
52
54
  [MATH]: _MathNodeSpec.default,
53
55
  [HARD_BREAK]: _HardBreakNodeSpec.default,
@@ -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,
@@ -14,24 +14,20 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
14
14
  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; }
15
15
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
16
16
  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
- const TAG_NAME_TO_LEVEL = {
18
- H1: 1,
19
- H2: 2,
20
- H3: 3,
21
- H4: 4,
22
- H5: 5,
23
- H6: 6
24
- };
17
+ // const TAG_NAME_TO_LEVEL = {
18
+ // H1: 1,
19
+ // H2: 2,
20
+ // H3: 3,
21
+ // H4: 4,
22
+ // H5: 5,
23
+ // H6: 6,
24
+ // };
25
25
 
26
26
  // https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.js
27
27
  // :: NodeSpec A plain paragraph textblock. Represented in the DOM
28
28
  // as a `<p>` element.
29
29
  const HeadingNodeSpec = _objectSpread(_objectSpread({}, _ParagraphNodeSpec.default), {}, {
30
- attrs: _objectSpread(_objectSpread({}, _ParagraphNodeSpec.default.attrs), {}, {
31
- level: {
32
- default: 1
33
- }
34
- }),
30
+ attrs: _objectSpread({}, _ParagraphNodeSpec.default.attrs),
35
31
  defining: true,
36
32
  parseDOM: [{
37
33
  tag: 'h1',
@@ -55,15 +51,13 @@ const HeadingNodeSpec = _objectSpread(_objectSpread({}, _ParagraphNodeSpec.defau
55
51
  toDOM
56
52
  });
57
53
  function toDOM(node) {
54
+ // [FS-SEA][06-04-2023]
55
+ // returns paragraph node to dom when a header node paste
58
56
  const dom = (0, _ParagraphNodeSpec.toParagraphDOM)(node);
59
- const level = node.attrs.level || 1;
60
- dom[0] = `h${level}`;
61
57
  return dom;
62
58
  }
63
59
  function getAttrs(dom) {
64
60
  const attrs = (0, _ParagraphNodeSpec.getParagraphNodeAttrs)(dom);
65
- const level = TAG_NAME_TO_LEVEL[dom.nodeName.toUpperCase()] || 1;
66
- attrs.level = level;
67
61
  return attrs;
68
62
  }
69
63
  var _default = HeadingNodeSpec;
@@ -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
 
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
  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; }
20
20
  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; }
21
21
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
22
- 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); }
22
+ 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); } // eslint-disable-next-line no-unused-vars
23
23
  function insertMath(tr, schema, latex) {
24
24
  const {
25
25
  selection
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
  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; }
20
20
  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; }
21
21
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
22
- 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); }
22
+ 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); } /* eslint-disable-next-line */
23
23
  class TableCellTooltipView {
24
24
  constructor(editorView) {
25
25
  _defineProperty(this, "_cellElement", void 0);
@@ -17,7 +17,31 @@ 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); } // Copyright (C) 2015-2016 by Marijn Haverbeke <marijnh@gmail.com> and others
21
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
22
+ // of this software and associated documentation files (the "Software"), to deal
23
+ // in the Software without restriction, including without limitation the rights
24
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
+ // copies of the Software, and to permit persons to whom the Software is
26
+ // furnished to do so, subject to the following conditions:
27
+ // The above copyright notice and this permission notice shall be included in
28
+ // all copies or substantial portions of the Software.
29
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35
+ // THE SOFTWARE.
36
+ // License about this file:
37
+ // This file is originally forked from
38
+ // https://github.com/ProseMirror/prosemirror-tables/blob/0e74c6a1761651ccf3701eb8529fa9187ad5c91d/src/columnresizing.js
39
+ // and most of the original codes had been modified to support the bevaviors
40
+ // that czi-prosemirror needs.
41
+ // The plugin provides the following behaviors:
42
+ // - Let user resize a column without changing the total width of the table.
43
+ // - Let user set the left margin of the table.
44
+ // - Let user set the right margin of the table.
21
45
  const PLUGIN_KEY = new _prosemirrorState.PluginKey('tableColumnResizing');
22
46
 
23
47
  // [FS] IRAD-949 2020-05-27