@modusoperandi/licit 0.13.25 → 0.14.0

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 (200) hide show
  1. package/.eslintrc.js +1 -1
  2. package/README.md +1 -0
  3. package/dist/BlockquoteInsertNewLineCommand.js +3 -23
  4. package/dist/BlockquoteNodeSpec.js +3 -13
  5. package/dist/BlockquoteToggleCommand.js +3 -16
  6. package/dist/BookmarkNodeSpec.js +0 -6
  7. package/dist/BulletListNodeSpec.js +2 -16
  8. package/dist/CZIProseMirror.js +3 -27
  9. package/dist/CodeBlockCommand.js +3 -19
  10. package/dist/CodeBlockNodeSpec.js +3 -4
  11. package/dist/CodeMarkSpec.js +0 -4
  12. package/dist/ContentPlaceholderPlugin.js +6 -58
  13. package/dist/CursorPlaceholderPlugin.js +2 -32
  14. package/dist/DocLayoutCommand.js +5 -28
  15. package/dist/DocNodeSpec.js +0 -9
  16. package/dist/EMMarkSpec.js +0 -4
  17. package/dist/EditorCommands.js +5 -33
  18. package/dist/EditorKeyMap.js +4 -18
  19. package/dist/EditorMarks.js +2 -26
  20. package/dist/EditorNodes.js +4 -22
  21. package/dist/EditorPageLayoutPlugin.js +3 -15
  22. package/dist/EditorPlugins.js +0 -4
  23. package/dist/EditorSchema.js +0 -5
  24. package/dist/EditorState.js +0 -2
  25. package/dist/FontSizeMarkSpec.js +0 -12
  26. package/dist/FontTypeMarkSpec.js +15 -19
  27. package/dist/HTMLMutator.js +5 -24
  28. package/dist/HardBreakNodeSpec.js +0 -2
  29. package/dist/HeadingNodeSpec.js +6 -15
  30. package/dist/HistoryRedoCommand.js +3 -11
  31. package/dist/HistoryUndoCommand.js +3 -11
  32. package/dist/HorizontalRuleCommand.js +3 -22
  33. package/dist/HorizontalRuleNodeSpec.js +0 -10
  34. package/dist/ImageFromURLCommand.js +0 -9
  35. package/dist/ImageNodeSpec.js +2 -14
  36. package/dist/ImageSourceCommand.js +3 -39
  37. package/dist/ImageUploadCommand.js +3 -21
  38. package/dist/ImageUploadPlaceholderPlugin.js +10 -48
  39. package/dist/LinkMarkSpec.js +0 -4
  40. package/dist/LinkSetURLCommand.js +3 -28
  41. package/dist/LinkTooltipPlugin.js +6 -52
  42. package/dist/ListItemInsertNewLineCommand.js +3 -23
  43. package/dist/ListItemMergeCommand.js +15 -66
  44. package/dist/ListItemNodeSpec.js +0 -11
  45. package/dist/ListSplitCommand.js +3 -14
  46. package/dist/ListToggleCommand.js +5 -26
  47. package/dist/MarksClearCommand.js +6 -17
  48. package/dist/MathEditCommand.js +3 -38
  49. package/dist/MathNodeSpec.js +0 -10
  50. package/dist/OrderedListNodeSpec.js +0 -24
  51. package/dist/ParagraphNodeSpec.js +5 -26
  52. package/dist/ParagraphSpacingCommand.js +3 -32
  53. package/dist/PrintCommand.js +3 -13
  54. package/dist/SelectionPlaceholderPlugin.js +2 -31
  55. package/dist/SpacerMarkSpec.js +2 -6
  56. package/dist/StrikeMarkSpec.js +0 -4
  57. package/dist/StrongMarkSpec.js +2 -5
  58. package/dist/StyleView.js +1 -7
  59. package/dist/TableBackgroundColorCommand.js +3 -24
  60. package/dist/TableBorderColorCommand.js +3 -24
  61. package/dist/TableCellColorCommand.js +3 -23
  62. package/dist/TableCellMenuPlugin.js +9 -45
  63. package/dist/TableInsertCommand.js +7 -39
  64. package/dist/TableMergeCellsCommand.js +5 -30
  65. package/dist/TableNodesSpecs.js +4 -23
  66. package/dist/TablePlugins.js +0 -5
  67. package/dist/TableResizePlugin.js +54 -138
  68. package/dist/TextColorMarkSpec.js +0 -9
  69. package/dist/TextHighlightMarkSpec.js +0 -8
  70. package/dist/TextInsertTabSpaceCommand.js +3 -28
  71. package/dist/TextNoWrapMarkSpec.js +0 -4
  72. package/dist/TextSelectionMarkSpec.js +0 -5
  73. package/dist/TextSubMarkSpec.js +0 -4
  74. package/dist/TextSuperMarkSpec.js +0 -4
  75. package/dist/TextUnderlineMarkSpec.js +0 -4
  76. package/dist/Types.js +0 -6
  77. package/dist/WebFontLoader.js +3 -8
  78. package/dist/blockQuoteInputRule.js +0 -13
  79. package/dist/bom.xml +1492 -1645
  80. package/dist/buildEditorPlugins.js +5 -27
  81. package/dist/buildInputRules.js +12 -24
  82. package/dist/client/CollabConnector.js +6 -30
  83. package/dist/client/EditorConnection.js +23 -69
  84. package/dist/client/Licit.js +79 -163
  85. package/dist/client/Licit.js.flow +16 -2
  86. package/dist/client/Licit.test.js +6 -13
  87. package/dist/client/Reporter.js +1 -8
  88. package/dist/client/SimpleConnector.js +6 -26
  89. package/dist/client/http.js +8 -15
  90. package/dist/client/throttle.js +0 -2
  91. package/dist/convertFromDOMElement.js +2 -10
  92. package/dist/convertFromHTML.js +0 -5
  93. package/dist/convertFromJSON.js +3 -13
  94. package/dist/convertToCSSPTValue.js +0 -6
  95. package/dist/convertToJSON.js +0 -2
  96. package/dist/createCommand.js +3 -11
  97. package/dist/createEditorKeyMap.js +0 -13
  98. package/dist/createEmptyEditorState.js +0 -7
  99. package/dist/createTableResizingPlugin.js +5 -16
  100. package/dist/findActionableCell.js +0 -19
  101. package/dist/findActiveMark.js +0 -11
  102. package/dist/hyphenize.js +2 -4
  103. package/dist/index.js +0 -9
  104. package/dist/insertTable.js +0 -16
  105. package/dist/isEditorStateEmpty.js +0 -6
  106. package/dist/isTableNode.js +0 -3
  107. package/dist/joinDown.js +0 -7
  108. package/dist/joinListNode.js +0 -15
  109. package/dist/joinUp.js +0 -9
  110. package/dist/keymaps.js +0 -15
  111. package/dist/lookUpElement.js +0 -3
  112. package/dist/nodeAt.js +0 -3
  113. package/dist/normalizeHTML.js +9 -25
  114. package/dist/patchAnchorElements.js +5 -12
  115. package/dist/patchBreakElements.js +0 -6
  116. package/dist/patchElementInlineStyles.js +5 -15
  117. package/dist/patchListElements.js +20 -54
  118. package/dist/patchMathElements.js +11 -21
  119. package/dist/patchParagraphElements.js +0 -5
  120. package/dist/patchStyleElements.js +12 -41
  121. package/dist/patchTableElements.js +9 -37
  122. package/dist/rebaseDocWithSteps.js +0 -6
  123. package/dist/sanitizeURL.js +0 -3
  124. package/dist/splitListItem.js +12 -43
  125. package/dist/toClosestFontPtSize.js +1 -5
  126. package/dist/toSafeHTMLDocument.js +0 -1
  127. package/dist/toggleBlockquote.js +2 -19
  128. package/dist/toggleCodeBlock.js +2 -22
  129. package/dist/ui/AlertInfo.js +6 -22
  130. package/dist/ui/BookmarkNodeView.js +7 -28
  131. package/dist/ui/CommandButton.js +3 -19
  132. package/dist/ui/CommandMenu.js +3 -25
  133. package/dist/ui/CommandMenuButton.js +3 -36
  134. package/dist/ui/CustomEditorView.js +3 -16
  135. package/dist/ui/CustomMenu.js +0 -8
  136. package/dist/ui/CustomMenuItem.js +4 -18
  137. package/dist/ui/CustomNodeView.js +21 -67
  138. package/dist/ui/CustomRadioButton.js +14 -33
  139. package/dist/ui/DocLayoutEditor.js +5 -27
  140. package/dist/ui/Editor.js +18 -79
  141. package/dist/ui/EditorFrameset.js +3 -18
  142. package/dist/ui/EditorToolbar.js +10 -46
  143. package/dist/ui/EditorToolbarConfig.js +10 -20
  144. package/dist/ui/FontSizeCommandMenuButton.js +5 -19
  145. package/dist/ui/FontTypeCommandMenuButton.js +5 -22
  146. package/dist/ui/Frag.js +0 -7
  147. package/dist/ui/Icon.js +5 -25
  148. package/dist/ui/ImageAlignEditor.js +3 -16
  149. package/dist/ui/ImageInlineEditor.js +3 -16
  150. package/dist/ui/ImageNodeView.js +20 -109
  151. package/dist/ui/ImageResizeBox.js +3 -53
  152. package/dist/ui/ImageURLEditor.js +3 -28
  153. package/dist/ui/ImageUploadEditor.js +3 -35
  154. package/dist/ui/LinkTooltip.js +5 -25
  155. package/dist/ui/LinkURLEditor.js +3 -29
  156. package/dist/ui/ListItemNodeView.js +15 -30
  157. package/dist/ui/ListTypeButton.js +5 -37
  158. package/dist/ui/ListTypeCommandButton.js +3 -19
  159. package/dist/ui/ListTypeMenu.js +4 -25
  160. package/dist/ui/LoadingIndicator.js +0 -7
  161. package/dist/ui/MathEditor.js +3 -24
  162. package/dist/ui/MathInlineEditor.js +3 -26
  163. package/dist/ui/MathNodeView.js +9 -59
  164. package/dist/ui/PasteMenu.js +4 -20
  165. package/dist/ui/ResizeObserver.js +0 -18
  166. package/dist/ui/RichTextEditor.js +5 -27
  167. package/dist/ui/SelectionObserver.js +3 -29
  168. package/dist/ui/TableCellMenu.js +3 -18
  169. package/dist/ui/TableGridSizeEditor.js +5 -51
  170. package/dist/ui/TableNodeView.js +0 -11
  171. package/dist/ui/bindScrollHandler.js +2 -9
  172. package/dist/ui/canUseCSSFont.js +2 -8
  173. package/dist/ui/czi-icon.css +4 -4
  174. package/dist/ui/findActiveFontSize.js +2 -18
  175. package/dist/ui/findActiveFontType.js +0 -12
  176. package/dist/ui/handleEditorDrop.js +0 -9
  177. package/dist/ui/handleEditorKeyDown.js +0 -7
  178. package/dist/ui/handleEditorPaste.js +0 -9
  179. package/dist/ui/htmlElementToRect.js +0 -4
  180. package/dist/ui/injectStyleSheet.js +0 -10
  181. package/dist/ui/isElementFullyVisible.js +2 -8
  182. package/dist/ui/isOffline.js +0 -2
  183. package/dist/ui/isReactClass.js +0 -4
  184. package/dist/ui/mathquill-editor/MathQuillEditor.js +9 -44
  185. package/dist/ui/mathquill-editor/MathQuillEditorSymbols.js +1 -3
  186. package/dist/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +3 -16
  187. package/dist/ui/mathquill-editor/mathquill-import-kludge.js +5 -7
  188. package/dist/ui/renderLaTeXAsHTML.js +2 -13
  189. package/dist/ui/resolveImage.js +7 -32
  190. package/dist/ui/toCSSColor.js +0 -14
  191. package/dist/ui/toCSSLineSpacing.js +10 -11
  192. package/dist/ui/toHexColor.js +0 -8
  193. package/dist/ui/uuid.js +0 -2
  194. package/dist/uuid.js +0 -2
  195. package/package-lock.json.old +32889 -0
  196. package/package.json +45 -69
  197. package/src/client/Licit.js +16 -2
  198. package/src/ui/czi-icon.css +4 -4
  199. package/utils/build_web_server.js +1 -7
  200. package/webpack.config.js +3 -3
@@ -4,78 +4,51 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  require("./czi-math-view.css");
9
-
10
8
  var _CustomNodeView = _interopRequireWildcard(require("./CustomNodeView"));
11
-
12
9
  var _MathInlineEditor = _interopRequireDefault(require("./MathInlineEditor"));
13
-
14
10
  var React = _interopRequireWildcard(require("react"));
15
-
16
11
  var _licitUiCommands = require("@modusoperandi/licit-ui-commands");
17
-
18
12
  var _classnames = _interopRequireDefault(require("classnames"));
19
-
20
13
  var _renderLaTeXAsHTML = _interopRequireDefault(require("./renderLaTeXAsHTML"));
21
-
22
14
  var _uuid = _interopRequireDefault(require("./uuid"));
23
-
24
15
  var _prosemirrorView = require("prosemirror-view");
25
-
26
16
  var _EditorFrameset = require("./EditorFrameset");
27
-
28
17
  var _prosemirrorModel = require("prosemirror-model");
29
-
30
18
  var _prosemirrorState = require("prosemirror-state");
31
-
32
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
-
34
20
  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); }
35
-
36
21
  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; }
37
-
38
22
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
39
-
40
23
  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; }
41
-
42
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
43
-
24
+ 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; }
25
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
26
+ 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); }
44
27
  const EMPTY_SRC = 'data:image/gif;base64,' + 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
45
-
46
28
  class MathViewBody extends React.PureComponent {
47
29
  constructor() {
48
30
  super(...arguments);
49
-
50
31
  _defineProperty(this, "props", void 0);
51
-
52
32
  _defineProperty(this, "state", {
53
33
  isEditing: false
54
34
  });
55
-
56
35
  _defineProperty(this, "_inlineEditor", null);
57
-
58
36
  _defineProperty(this, "_id", (0, _uuid.default)());
59
-
60
37
  _defineProperty(this, "_mounted", false);
61
-
62
38
  _defineProperty(this, "_onEditStart", () => {
63
39
  this.setState({
64
40
  isEditing: true
65
41
  });
66
42
  });
67
-
68
43
  _defineProperty(this, "_onEditEnd", () => {
69
44
  this.setState({
70
45
  isEditing: false
71
46
  });
72
47
  });
73
-
74
48
  _defineProperty(this, "_onChange", value => {
75
49
  if (!this._mounted) {
76
50
  return;
77
51
  }
78
-
79
52
  const align = value ? value.align : null;
80
53
  const latex = value ? value.latex : null;
81
54
  const {
@@ -84,41 +57,33 @@ class MathViewBody extends React.PureComponent {
84
57
  editorView
85
58
  } = this.props;
86
59
  const pos = getPos();
87
-
88
60
  const attrs = _objectSpread(_objectSpread({}, node.attrs), {}, {
89
61
  latex,
90
62
  align
91
63
  });
92
-
93
64
  let tr = editorView.state.tr;
94
65
  const {
95
66
  selection
96
67
  } = editorView.state;
97
- tr = tr.setNodeMarkup(pos, null, attrs); // [FS] IRAD-1005 2020-07-23
68
+ tr = tr.setNodeMarkup(pos, null, attrs);
69
+ // [FS] IRAD-1005 2020-07-23
98
70
  // Upgrade outdated packages.
99
71
  // reset selection to original using the latest doc.
100
-
101
72
  const origSelection = _prosemirrorState.NodeSelection.create(tr.doc, selection.from);
102
-
103
73
  tr = tr.setSelection(origSelection);
104
74
  editorView.dispatch(tr);
105
75
  });
106
76
  }
107
-
108
77
  componentDidMount() {
109
78
  this._mounted = true;
110
-
111
79
  this._renderInlineEditor();
112
80
  }
113
-
114
81
  componentWillUnmount() {
115
82
  this._mounted = false;
116
83
  }
117
-
118
84
  componentDidUpdate(prevProps) {
119
85
  this._renderInlineEditor();
120
86
  }
121
-
122
87
  render() {
123
88
  // TODO: Resolve `readOnly`;
124
89
  const readOnly = false;
@@ -160,15 +125,12 @@ class MathViewBody extends React.PureComponent {
160
125
  }
161
126
  }));
162
127
  }
163
-
164
128
  _renderInlineEditor() {
165
129
  const el = document.getElementById(this._id);
166
-
167
130
  if (!el || el.getAttribute('data-active') !== 'true') {
168
131
  this._inlineEditor && this._inlineEditor.close();
169
132
  return;
170
133
  }
171
-
172
134
  const {
173
135
  node
174
136
  } = this.props;
@@ -178,7 +140,6 @@ class MathViewBody extends React.PureComponent {
178
140
  onEditStart: this._onEditStart,
179
141
  onEditEnd: this._onEditEnd
180
142
  };
181
-
182
143
  if (this._inlineEditor) {
183
144
  this._inlineEditor.update(editorProps);
184
145
  } else {
@@ -193,48 +154,37 @@ class MathViewBody extends React.PureComponent {
193
154
  });
194
155
  }
195
156
  }
196
-
197
157
  }
198
-
199
158
  class MathNodeView extends _CustomNodeView.default {
200
159
  // @override
201
160
  createDOMElement() {
202
161
  const el = document.createElement('span');
203
162
  el.className = 'czi-math-view';
204
-
205
163
  this._updateDOM(el);
206
-
207
164
  return el;
208
- } // @override
209
-
165
+ }
210
166
 
167
+ // @override
211
168
  update(node, decorations) {
212
169
  super.update(node, decorations);
213
-
214
170
  this._updateDOM(this.dom);
215
-
216
171
  return true;
217
- } // @override
218
-
172
+ }
219
173
 
174
+ // @override
220
175
  renderReactComponent() {
221
176
  return /*#__PURE__*/React.createElement(MathViewBody, this.props);
222
177
  }
223
-
224
178
  _updateDOM(el) {
225
179
  const {
226
180
  align
227
181
  } = this.props.node.attrs;
228
182
  let className = 'czi-math-view';
229
-
230
183
  if (align) {
231
184
  className += ' align-' + align;
232
185
  }
233
-
234
186
  el.className = className;
235
187
  }
236
-
237
188
  }
238
-
239
189
  var _default = MathNodeView;
240
190
  exports.default = _default;
@@ -4,48 +4,34 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var React = _interopRequireWildcard(require("react"));
9
-
10
8
  var _licitDocAttrsStep = require("@modusoperandi/licit-doc-attrs-step");
11
-
12
9
  var _prosemirrorView = require("prosemirror-view");
13
-
14
10
  var _uuid = _interopRequireDefault(require("./uuid"));
15
-
16
11
  require("./listType.css");
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
13
  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); }
21
-
22
14
  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; }
23
-
24
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
-
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
+ 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); }
26
18
  // [FS] IRAD-1076 2020-10-15
27
19
  // Popup menu UI with paste options.
20
+
28
21
  class PasteMenu extends React.PureComponent {
29
22
  constructor() {
30
23
  super(...arguments);
31
-
32
24
  _defineProperty(this, "_activeCommand", null);
33
-
34
25
  _defineProperty(this, "props", void 0);
35
-
36
26
  _defineProperty(this, "_menu", null);
37
-
38
27
  _defineProperty(this, "_id", (0, _uuid.default)());
39
-
40
28
  _defineProperty(this, "state", {
41
29
  expanded: false
42
30
  });
43
-
44
31
  _defineProperty(this, "_onUIEnter", id => {
45
32
  this.props.close(id);
46
33
  });
47
34
  }
48
-
49
35
  render() {
50
36
  const children = [];
51
37
  children.push( /*#__PURE__*/React.createElement("button", {
@@ -66,8 +52,6 @@ class PasteMenu extends React.PureComponent {
66
52
  className: "container"
67
53
  }, children);
68
54
  }
69
-
70
55
  }
71
-
72
56
  var _default = PasteMenu;
73
57
  exports.default = _default;
@@ -6,15 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = exports.bpfrpt_proptype_ResizeObserverEntry = void 0;
7
7
  exports.observe = observe;
8
8
  exports.unobserve = unobserve;
9
-
10
9
  var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
11
-
12
10
  var _nullthrows = _interopRequireDefault(require("nullthrows"));
13
-
14
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
13
  var bpfrpt_proptype_ResizeObserverEntry = {
19
14
  "target": function () {
20
15
  return (typeof Element === "function" ? _propTypes.default.instanceOf(Element).isRequired : _propTypes.default.any.isRequired).apply(this, arguments);
@@ -33,24 +28,18 @@ var bpfrpt_proptype_ResizeObserverEntry = {
33
28
  exports.bpfrpt_proptype_ResizeObserverEntry = bpfrpt_proptype_ResizeObserverEntry;
34
29
  let instance = null;
35
30
  const nodesObserving = new Map();
36
-
37
31
  function onResizeObserve(entries) {
38
32
  entries.forEach(handleResizeObserverEntry);
39
33
  }
40
-
41
34
  function handleResizeObserverEntry(entry) {
42
35
  const node = entry.target;
43
36
  const callbacks = nodesObserving.get(node);
44
-
45
37
  const executeCallback = cb => cb(entry);
46
-
47
38
  callbacks && callbacks.forEach(executeCallback);
48
39
  }
49
-
50
40
  function observe(node, callback) {
51
41
  const el = node;
52
42
  const observer = instance || (instance = new _resizeObserverPolyfill.default(onResizeObserve));
53
-
54
43
  if (nodesObserving.has(el)) {
55
44
  // Already observing node.
56
45
  const callbacks = (0, _nullthrows.default)(nodesObserving.get(el));
@@ -61,22 +50,17 @@ function observe(node, callback) {
61
50
  observer.observe(el);
62
51
  }
63
52
  }
64
-
65
53
  function unobserve(node, callback) {
66
54
  const observer = instance;
67
-
68
55
  if (!observer) {
69
56
  return;
70
57
  }
71
-
72
58
  const el = node;
73
59
  observer.unobserve(el);
74
-
75
60
  if (callback) {
76
61
  // Remove the passed in callback from the callbacks of the observed node
77
62
  // And, if no more callbacks then stop observing the node
78
63
  const callbacks = nodesObserving.has(el) ? (0, _nullthrows.default)(nodesObserving.get(el)).filter(cb => cb !== callback) : null;
79
-
80
64
  if (callbacks && callbacks.length) {
81
65
  nodesObserving.set(el, callbacks);
82
66
  } else {
@@ -86,7 +70,6 @@ function unobserve(node, callback) {
86
70
  // Delete all callbacks for the node.
87
71
  nodesObserving.delete(el);
88
72
  }
89
-
90
73
  if (!nodesObserving.size) {
91
74
  // We have nothing to observe. Stop observing, which stops the
92
75
  // ResizeObserver instance from receiving notifications of
@@ -97,7 +80,6 @@ function unobserve(node, callback) {
97
80
  instance = null;
98
81
  }
99
82
  }
100
-
101
83
  var _default = {
102
84
  observe,
103
85
  unobserve
@@ -4,53 +4,36 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _prosemirrorTransform = require("prosemirror-transform");
9
-
10
8
  var _prosemirrorView = require("prosemirror-view");
11
-
12
9
  var React = _interopRequireWildcard(require("react"));
13
-
14
10
  var _createEmptyEditorState = _interopRequireDefault(require("../createEmptyEditorState"));
15
-
16
11
  var _Editor = _interopRequireWildcard(require("./Editor"));
17
-
18
12
  var _EditorFrameset = _interopRequireWildcard(require("./EditorFrameset"));
19
-
20
13
  var _EditorToolbar = _interopRequireDefault(require("./EditorToolbar"));
21
-
22
14
  var _Frag = _interopRequireDefault(require("./Frag"));
23
-
24
15
  var _uuid = _interopRequireDefault(require("./uuid"));
25
-
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
17
  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); }
29
-
30
18
  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; }
31
-
32
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
-
19
+ 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; }
20
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
21
+ 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); }
34
22
  const EMPTY_EDITOR_RUNTIME = {};
35
-
36
23
  class RichTextEditor extends React.PureComponent {
37
24
  constructor(props, context) {
38
25
  super(props, context);
39
-
40
26
  _defineProperty(this, "props", void 0);
41
-
42
27
  _defineProperty(this, "state", void 0);
43
-
44
28
  _defineProperty(this, "_id", void 0);
45
-
46
29
  _defineProperty(this, "_dispatchTransaction", tr => {
47
30
  const {
48
31
  onChange,
49
32
  editorState
50
- } = this.props; // [FS] IRAD-1171 2021-02-04
33
+ } = this.props;
34
+ // [FS] IRAD-1171 2021-02-04
51
35
  // To bring selection on editor in read-only mode.
52
36
  // Removed force return when readOnly flag is true
53
-
54
37
  if (onChange) {
55
38
  // [FS-AFQ][20-FEB-2020]
56
39
  // Collaboration
@@ -60,7 +43,6 @@ class RichTextEditor extends React.PureComponent {
60
43
  });
61
44
  }
62
45
  });
63
-
64
46
  _defineProperty(this, "_onReady", editorView => {
65
47
  if (editorView !== this.state.editorView) {
66
48
  this.setState({
@@ -72,7 +54,6 @@ class RichTextEditor extends React.PureComponent {
72
54
  onReady && onReady(editorView);
73
55
  }
74
56
  });
75
-
76
57
  this._id = (0, _uuid.default)();
77
58
  this.state = {
78
59
  contentHeight: NaN,
@@ -80,7 +61,6 @@ class RichTextEditor extends React.PureComponent {
80
61
  editorView: null
81
62
  };
82
63
  }
83
-
84
64
  render() {
85
65
  const {
86
66
  autoFocus,
@@ -136,8 +116,6 @@ class RichTextEditor extends React.PureComponent {
136
116
  width: width
137
117
  });
138
118
  }
139
-
140
119
  }
141
-
142
120
  var _default = RichTextEditor;
143
121
  exports.default = _default;
@@ -4,60 +4,48 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
-
7
+ 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; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
9
+ 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); }
10
10
  const EMPTY_SELECTION_VALUE = Object.freeze({
11
11
  from: 0,
12
12
  to: 0
13
13
  });
14
-
15
14
  function resolveSelectionValue(el) {
16
15
  if (!window.getSelection) {
17
16
  console.warn('window.getSelection() is not supported');
18
17
  return EMPTY_SELECTION_VALUE;
19
18
  }
20
-
21
19
  const selection = window.getSelection();
22
-
23
20
  if (!selection.containsNode) {
24
21
  console.warn('selection.containsNode() is not supported');
25
22
  return EMPTY_SELECTION_VALUE;
26
23
  }
27
-
28
24
  if (!selection.rangeCount) {
29
25
  return EMPTY_SELECTION_VALUE;
30
26
  }
31
-
32
27
  const range = selection.getRangeAt(0);
33
-
34
28
  if (!range) {
35
29
  return EMPTY_SELECTION_VALUE;
36
30
  }
37
-
38
31
  const {
39
32
  startContainer,
40
33
  endContainer,
41
34
  startOffset,
42
35
  endOffset
43
36
  } = range;
44
-
45
37
  if (startContainer === el || endContainer === el || startContainer && el.contains(startContainer) || endContainer && el.contains(endContainer)) {
46
38
  return {
47
39
  from: startOffset,
48
40
  to: endOffset
49
41
  };
50
42
  }
51
-
52
43
  return EMPTY_SELECTION_VALUE;
53
44
  }
54
-
55
45
  class SelectionObserver {
56
46
  constructor(_callback) {
57
47
  _defineProperty(this, "_observables", []);
58
-
59
48
  _defineProperty(this, "_callback", null);
60
-
61
49
  _defineProperty(this, "_onClick", () => {
62
50
  const callback = this._callback;
63
51
  this._observables = this._observables.map(obj => {
@@ -71,7 +59,6 @@ class SelectionObserver {
71
59
  });
72
60
  callback && callback(this.takeRecords(), this);
73
61
  });
74
-
75
62
  _defineProperty(this, "_check", () => {
76
63
  let changed = false;
77
64
  const callback = this._callback;
@@ -81,15 +68,12 @@ class SelectionObserver {
81
68
  selection
82
69
  } = obj;
83
70
  const $selection = resolveSelectionValue(target);
84
-
85
71
  if (selection === $selection) {
86
72
  return obj;
87
73
  }
88
-
89
74
  if (selection.from === $selection.from && selection.to === $selection.to) {
90
75
  return obj;
91
76
  }
92
-
93
77
  changed = true;
94
78
  return {
95
79
  target,
@@ -98,45 +82,35 @@ class SelectionObserver {
98
82
  });
99
83
  changed && callback && callback(this.takeRecords(), this);
100
84
  });
101
-
102
85
  this._callback = _callback;
103
86
  }
104
-
105
87
  disconnect() {
106
88
  this._observables.forEach(obj => {
107
89
  const el = obj.target;
108
90
  el.removeEventListener('click', this._check, false);
109
91
  el.removeEventListener('selectionchange', this._check, false);
110
92
  });
111
-
112
93
  this._observables = [];
113
94
  }
114
-
115
95
  observe(el) {
116
96
  if (!window.getSelection) {
117
97
  console.warn('window.getSelection() is not supported');
118
98
  return;
119
99
  }
120
-
121
100
  if (this._observables.some(obj => obj.target === el)) {
122
101
  // Already observed.
123
102
  return;
124
103
  }
125
-
126
104
  const obj = {
127
105
  target: el,
128
106
  selection: resolveSelectionValue(el)
129
107
  };
130
108
  el.addEventListener('click', this._check, false);
131
109
  el.addEventListener('selectionchange', this._check, false);
132
-
133
110
  this._observables.push(obj);
134
111
  }
135
-
136
112
  takeRecords() {
137
113
  return this._observables.slice(0);
138
114
  }
139
-
140
115
  }
141
-
142
116
  exports.default = SelectionObserver;
@@ -4,38 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _prosemirrorState = require("prosemirror-state");
9
-
10
8
  var _prosemirrorView = require("prosemirror-view");
11
-
12
9
  var React = _interopRequireWildcard(require("react"));
13
-
14
10
  var _CommandMenuButton = _interopRequireDefault(require("./CommandMenuButton"));
15
-
16
11
  var _EditorToolbarConfig = require("./EditorToolbarConfig");
17
-
18
12
  var _Icon = _interopRequireDefault(require("./Icon"));
19
-
20
13
  require("./czi-table-cell-menu.css");
21
-
22
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
24
15
  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); }
25
-
26
16
  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; }
27
-
28
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
-
17
+ 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; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
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); }
30
20
  class TableCellMenu extends React.PureComponent {
31
21
  constructor() {
32
22
  super(...arguments);
33
-
34
23
  _defineProperty(this, "_menu", null);
35
-
36
24
  _defineProperty(this, "props", void 0);
37
25
  }
38
-
39
26
  render() {
40
27
  const {
41
28
  editorState,
@@ -51,8 +38,6 @@ class TableCellMenu extends React.PureComponent {
51
38
  title: "Edit"
52
39
  });
53
40
  }
54
-
55
41
  }
56
-
57
42
  var _default = TableCellMenu;
58
43
  exports.default = _default;