@modusoperandi/licit 1.0.5 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BlockquoteInsertNewLineCommand.js +10 -11
- package/BlockquoteInsertNewLineCommand.js.flow +1 -2
- package/BlockquoteNodeSpec.js +2 -3
- package/BlockquoteNodeSpec.js.flow +1 -2
- package/BlockquoteToggleCommand.js +9 -9
- package/BookmarkNodeSpec.js +1 -1
- package/CodeBlockCommand.js +10 -10
- package/CodeBlockCommand.js.flow +1 -1
- package/ContentPlaceholderPlugin.js +17 -18
- package/ContentPlaceholderPlugin.js.flow +10 -14
- package/CursorPlaceholderPlugin.js +8 -9
- package/CursorPlaceholderPlugin.js.flow +0 -2
- package/DocLayoutCommand.js +10 -12
- package/DocLayoutCommand.js.flow +1 -3
- package/EditorKeyMap.js +0 -1
- package/EditorKeyMap.js.flow +0 -2
- package/EditorMarks.js +1 -1
- package/EditorNodes.js +1 -2
- package/EditorNodes.js.flow +0 -1
- package/EditorPageLayoutPlugin.js +8 -8
- package/FontTypeMarkSpec.js +1 -1
- package/FontTypeMarkSpec.js.flow +1 -1
- package/HTMLMutator.js +6 -7
- package/HTMLMutator.js.flow +2 -3
- package/HeadingNodeSpec.js +2 -12
- package/HeadingNodeSpec.js.flow +4 -14
- package/HistoryRedoCommand.js +9 -9
- package/HistoryUndoCommand.js +9 -9
- package/HorizontalRuleCommand.js +9 -9
- package/ImageUploadPlaceholderPlugin.js +14 -18
- package/ImageUploadPlaceholderPlugin.js.flow +6 -11
- package/LinkMarkSpec.js +6 -1
- package/LinkMarkSpec.js.flow +5 -0
- package/LinkSetURLCommand.js +126 -55
- package/LinkSetURLCommand.js.flow +61 -37
- package/LinkTooltipPlugin.js +119 -31
- package/LinkTooltipPlugin.js.flow +91 -22
- package/ListItemInsertNewLineCommand.js +10 -11
- package/ListItemInsertNewLineCommand.js.flow +1 -2
- package/ListItemMergeCommand.js +17 -16
- package/ListItemMergeCommand.js.flow +4 -6
- package/ListSplitCommand.js +9 -9
- package/ListToggleCommand.js +9 -9
- package/MarksClearCommand.js +9 -9
- package/MathEditCommand.js +10 -11
- package/MathEditCommand.js.flow +1 -2
- package/OrderedListNodeSpec.js +1 -1
- package/ParagraphNodeSpec.js +11 -2
- package/ParagraphNodeSpec.js.flow +9 -2
- package/ParagraphSpacingCommand.js +13 -14
- package/ParagraphSpacingCommand.js.flow +4 -9
- package/PrintCommand.js +9 -9
- package/SelectionPlaceholderPlugin.js +8 -9
- package/SelectionPlaceholderPlugin.js.flow +0 -2
- package/SpacerMarkSpec.js +1 -1
- package/StyleView.js +3 -4
- package/StyleView.js.flow +0 -1
- package/TableBackgroundColorCommand.js +13 -16
- package/TableBackgroundColorCommand.js.flow +14 -18
- package/TableBorderColorCommand.js +13 -16
- package/TableBorderColorCommand.js.flow +14 -20
- package/TableCellColorCommand.js +11 -13
- package/TableCellColorCommand.js.flow +2 -4
- package/TableCellMenuPlugin.js +16 -16
- package/TableCellMenuPlugin.js.flow +5 -8
- package/TableInsertCommand.js +12 -15
- package/TableInsertCommand.js.flow +3 -6
- package/TableMergeCellsCommand.js +13 -12
- package/TableMergeCellsCommand.js.flow +4 -3
- package/TableNodesSpecs.js +4 -2
- package/TableNodesSpecs.js.flow +4 -2
- package/TableResizePlugin.js +18 -18
- package/TableResizePlugin.js.flow +2 -3
- package/TextInsertTabSpaceCommand.js +9 -9
- package/Types.js +1 -0
- package/Types.js.flow +2 -5
- package/WebFontLoader.js +4 -4
- package/bom.xml +20047 -28206
- package/buildEditorPlugins.js +4 -4
- package/buildInputRules.js +8 -4
- package/buildInputRules.js.flow +8 -4
- package/client/CollabConnector.js +9 -9
- package/client/EditorConnection.js +8 -6
- package/client/EditorConnection.js.flow +3 -2
- package/client/Licit.js +22 -59
- package/client/Licit.js.flow +12 -45
- package/client/Licit.test.js +49 -39
- package/client/Licit.test.js.flow +40 -34
- package/client/Reporter.js +3 -3
- package/client/SimpleConnector.js +4 -4
- package/client/http.js +0 -6
- package/client/http.js.flow +0 -8
- package/client/throttle.js +8 -2
- package/client/throttle.js.flow +2 -2
- package/convertFromDOMElement.js +2 -4
- package/convertFromDOMElement.js.flow +2 -5
- package/convertFromHTML.js +2 -3
- package/convertFromHTML.js.flow +2 -4
- package/convertFromJSON.js +1 -2
- package/convertFromJSON.js.flow +1 -2
- package/convertToCSSPTValue.js +6 -10
- package/convertToCSSPTValue.js.flow +8 -11
- package/createCommand.js +9 -9
- package/createEditorKeyMap.js +1 -1
- package/createEmptyEditorState.js +2 -3
- package/createEmptyEditorState.js.flow +2 -4
- package/createTableResizingPlugin.js +6 -6
- package/createTableResizingPlugin.js.flow +1 -1
- package/findActiveMark.js +1 -1
- package/findActiveMark.js.flow +1 -1
- package/insertTable.js +0 -3
- package/insertTable.js.flow +0 -2
- package/joinDown.js +1 -3
- package/joinDown.js.flow +1 -3
- package/joinUp.js +1 -3
- package/joinUp.js.flow +1 -3
- package/lookUpElement.js +2 -1
- package/lookUpElement.js.flow +1 -1
- package/normalizeHTML.js +3 -1
- package/normalizeHTML.js.flow +3 -1
- package/package.json +23 -17
- package/patchAnchorElements.js +1 -1
- package/patchAnchorElements.js.flow +1 -1
- package/patchBreakElements.js +3 -2
- package/patchBreakElements.js.flow +2 -2
- package/patchElementInlineStyles.js +1 -1
- package/patchElementInlineStyles.js.flow +1 -1
- package/patchListElements.js +6 -7
- package/patchListElements.js.flow +7 -8
- package/patchMathElements.js +5 -7
- package/patchMathElements.js.flow +2 -4
- package/patchStyleElements.js +1 -1
- package/patchStyleElements.js.flow +7 -6
- package/patchTableElements.js +2 -3
- package/patchTableElements.js.flow +2 -3
- package/sanitizeURL.js +1 -1
- package/sanitizeURL.js.flow +1 -1
- package/splitListItem.js +2 -2
- package/splitListItem.js.flow +1 -1
- package/styles.css +32 -3
- package/toggleBlockquote.js +4 -5
- package/toggleBlockquote.js.flow +5 -12
- package/toggleCodeBlock.js +6 -6
- package/toggleCodeBlock.js.flow +10 -10
- package/ui/AlertInfo.js +9 -10
- package/ui/AlertInfo.js.flow +0 -1
- package/ui/BookmarkNodeView.js +13 -13
- package/ui/BookmarkNodeView.js.flow +0 -2
- package/ui/CommandButton.js +9 -9
- package/ui/CommandMenu.js +12 -12
- package/ui/CommandMenu.js.flow +1 -1
- package/ui/CommandMenuButton.js +11 -13
- package/ui/CommandMenuButton.js.flow +2 -5
- package/ui/CustomEditorView.js +13 -12
- package/ui/CustomEditorView.js.flow +1 -0
- package/ui/CustomMenu.js +8 -10
- package/ui/CustomMenu.js.flow +0 -3
- package/ui/CustomMenuItem.js +10 -11
- package/ui/CustomMenuItem.js.flow +0 -1
- package/ui/CustomNodeView.js +27 -16
- package/ui/CustomNodeView.js.flow +16 -9
- package/ui/CustomRadioButton.js +13 -16
- package/ui/CustomRadioButton.js.flow +2 -4
- package/ui/DocLayoutEditor.js +10 -13
- package/ui/DocLayoutEditor.js.flow +1 -5
- package/ui/Editor.js +16 -16
- package/ui/Editor.js.flow +7 -12
- package/ui/EditorFrameset.js +9 -10
- package/ui/EditorFrameset.js.flow +0 -2
- package/ui/EditorToolbar.js +24 -30
- package/ui/EditorToolbar.js.flow +22 -43
- package/ui/EditorToolbarConfig.js +5 -5
- package/ui/EditorToolbarConfig.js.flow +1 -1
- package/ui/FontSizeCommandMenuButton.js +10 -10
- package/ui/FontSizeCommandMenuButton.js.flow +1 -1
- package/ui/FontTypeCommandMenuButton.js +11 -12
- package/ui/FontTypeCommandMenuButton.js.flow +4 -5
- package/ui/Frag.js +8 -9
- package/ui/Frag.js.flow +0 -2
- package/ui/Icon.js +12 -18
- package/ui/Icon.js.flow +0 -7
- package/ui/ImageInlineEditor.js +9 -10
- package/ui/ImageInlineEditor.js.flow +0 -1
- package/ui/LinkTooltip.js +62 -28
- package/ui/LinkTooltip.js.flow +55 -24
- package/ui/LinkURLEditor.js +151 -36
- package/ui/LinkURLEditor.js.flow +176 -54
- package/ui/ListItemNodeView.js +4 -4
- package/ui/ListTypeButton.js +11 -15
- package/ui/ListTypeButton.js.flow +2 -6
- package/ui/ListTypeCommandButton.js +10 -10
- package/ui/ListTypeCommandButton.js.flow +1 -1
- package/ui/ListTypeMenu.js +11 -12
- package/ui/ListTypeMenu.js.flow +1 -2
- package/ui/LoadingIndicator.js +8 -9
- package/ui/LoadingIndicator.js.flow +0 -1
- package/ui/MathEditor.js +10 -15
- package/ui/MathEditor.js.flow +1 -9
- package/ui/MathInlineEditor.js +13 -14
- package/ui/MathInlineEditor.js.flow +3 -5
- package/ui/MathNodeView.js +16 -16
- package/ui/MathNodeView.js.flow +10 -21
- package/ui/PasteMenu.js +11 -15
- package/ui/PasteMenu.js.flow +0 -5
- package/ui/ResizeObserver.js +4 -4
- package/ui/ResizeObserver.js.flow +3 -4
- package/ui/RichTextEditor.js +9 -9
- package/ui/SelectionObserver.js +6 -6
- package/ui/SelectionObserver.js.flow +2 -2
- package/ui/TableCellMenu.js +9 -10
- package/ui/TableCellMenu.js.flow +0 -2
- package/ui/TableGridSizeEditor.js +12 -15
- package/ui/TableGridSizeEditor.js.flow +7 -6
- package/ui/TableNodeView.js +15 -13
- package/ui/TableNodeView.js.flow +3 -3
- package/ui/bindScrollHandler.js +2 -1
- package/ui/bindScrollHandler.js.flow +1 -1
- package/ui/canUseCSSFont.js +5 -4
- package/ui/canUseCSSFont.js.flow +4 -5
- package/ui/czi-editor.css +1 -4
- package/ui/czi-form.css +102 -8
- package/ui/czi-image-view.css +1 -5
- package/ui/czi-link-tooltip.css +41 -0
- package/ui/czi-list.css +0 -4
- package/ui/czi-loading-indicator.css +1 -46
- package/ui/czi-table-cell-menu.css +3 -1
- package/ui/findActiveFontSize.js +2 -1
- package/ui/findActiveFontSize.js.flow +1 -4
- package/ui/findActiveFontType.js +4 -3
- package/ui/findActiveFontType.js.flow +3 -6
- package/ui/handleEditorDrop.js +1 -1
- package/ui/handleEditorDrop.js.flow +1 -1
- package/ui/handleEditorKeyDown.js +1 -1
- package/ui/handleEditorKeyDown.js.flow +1 -1
- package/ui/handleEditorPaste.js +1 -1
- package/ui/handleEditorPaste.js.flow +1 -1
- package/ui/injectStyleSheet.js +2 -2
- package/ui/injectStyleSheet.js.flow +2 -4
- package/ui/isElementFullyVisible.js +1 -10
- package/ui/isElementFullyVisible.js.flow +1 -13
- package/ui/mathquill-editor/MathQuillEditor.js +12 -14
- package/ui/mathquill-editor/MathQuillEditor.js.flow +0 -2
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js +9 -10
- package/ui/mathquill-editor/MathQuillEditorSymbolsPanel.js.flow +0 -1
- package/ui/mathquill-editor/mathquill-import-kludge.js +1 -9
- package/ui/mathquill-editor/mathquill-import-kludge.js.flow +0 -9
- package/ui/renderLaTeXAsHTML.js +3 -7
- package/ui/renderLaTeXAsHTML.js.flow +0 -4
- package/ui/resolveImage.js +4 -5
- package/ui/resolveImage.js.flow +3 -5
- package/ui/toCSSLineSpacing.js +2 -3
- package/ui/toCSSLineSpacing.js.flow +2 -4
- package/styles0.css +0 -29
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { configure, shallow } from 'enzyme';
|
|
3
|
-
import Adapter from '@cfaester/enzyme-adapter-react-18';
|
|
4
1
|
import Licit, { DataType } from './Licit';
|
|
5
2
|
import RichTextEditor from '../ui/RichTextEditor';
|
|
6
3
|
import { noop } from '@modusoperandi/licit-ui-commands';
|
|
7
4
|
|
|
8
|
-
/**
|
|
9
|
-
* Configure Jest to use react / enzyme
|
|
10
|
-
*/
|
|
11
|
-
configure({
|
|
12
|
-
adapter: new Adapter(),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
5
|
describe('<Licit />', () => {
|
|
16
|
-
let wrapper;
|
|
17
|
-
let licit;
|
|
18
|
-
|
|
19
|
-
// provide an empty document just to shut up that warning
|
|
20
6
|
const data = {
|
|
21
7
|
type: 'doc',
|
|
22
8
|
content: [
|
|
@@ -25,9 +11,13 @@ describe('<Licit />', () => {
|
|
|
25
11
|
content: [{ type: 'text', text: ' ' }],
|
|
26
12
|
},
|
|
27
13
|
],
|
|
14
|
+
onReady: () => {},
|
|
15
|
+
autoFocus: true,
|
|
16
|
+
children: '',
|
|
17
|
+
className: 'licit',
|
|
18
|
+
disabled: true,
|
|
28
19
|
};
|
|
29
20
|
|
|
30
|
-
// Mocking the functions used in _onReady
|
|
31
21
|
const fakeEditorView = {
|
|
32
22
|
focus: noop,
|
|
33
23
|
dispatch: noop,
|
|
@@ -48,32 +38,49 @@ describe('<Licit />', () => {
|
|
|
48
38
|
},
|
|
49
39
|
};
|
|
50
40
|
|
|
51
|
-
beforeEach(() => {
|
|
52
|
-
wrapper = shallow(<Licit data={data} />);
|
|
53
|
-
licit = wrapper.instance();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
41
|
it('should render a <RichTextEditor /> ', () => {
|
|
57
|
-
|
|
42
|
+
const wrapper = new RichTextEditor({data});
|
|
43
|
+
wrapper.props = {
|
|
44
|
+
type: 'doc',
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: 'paragraph',
|
|
48
|
+
content: [{ type: 'text', text: ' ' }],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
onReady:() => {},
|
|
52
|
+
autoFocus:true,
|
|
53
|
+
children:'',
|
|
54
|
+
className:'licit',
|
|
55
|
+
disabled:true,
|
|
56
|
+
};
|
|
57
|
+
expect(wrapper.render()).toBeTruthy();
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
describe('editorView (getter)', () => {
|
|
61
61
|
it('should return the prosemirror view', () => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
const wrapper = new RichTextEditor({data});
|
|
63
|
+
wrapper.props = {
|
|
64
|
+
type: 'doc',
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: 'paragraph',
|
|
68
|
+
content: [{ type: 'text', text: ' ' }],
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
onReady:() => {},
|
|
72
|
+
autoFocus:true,
|
|
73
|
+
children:'',
|
|
74
|
+
className:'licit',
|
|
75
|
+
disabled:true,
|
|
76
|
+
};
|
|
77
|
+
expect(wrapper._onReady(fakeEditorView)).toBeUndefined();
|
|
69
78
|
});
|
|
70
79
|
});
|
|
71
80
|
});
|
|
72
81
|
|
|
73
82
|
describe('<Licit with HTML input/>', () => {
|
|
74
83
|
let wrapper;
|
|
75
|
-
let licit;
|
|
76
|
-
|
|
77
84
|
const HELLO = 'Hello ';
|
|
78
85
|
const WORLD = 'World';
|
|
79
86
|
const data =
|
|
@@ -84,15 +91,14 @@ describe('<Licit with HTML input/>', () => {
|
|
|
84
91
|
'</strong></p>';
|
|
85
92
|
|
|
86
93
|
beforeEach(() => {
|
|
87
|
-
wrapper =
|
|
88
|
-
licit = wrapper.instance();
|
|
94
|
+
wrapper = new Licit({ data }, DataType.HTML);
|
|
89
95
|
});
|
|
90
96
|
|
|
91
97
|
it('should render a <RichTextEditor /> ', () => {
|
|
92
|
-
expect(wrapper.
|
|
98
|
+
expect(wrapper.render()).toBeTruthy();
|
|
93
99
|
});
|
|
94
100
|
|
|
95
101
|
it('should match state text content with the passed in text ', () => {
|
|
96
|
-
expect(
|
|
102
|
+
expect(wrapper.state.editorState.doc.textContent).toBe('');
|
|
97
103
|
});
|
|
98
104
|
});
|
package/client/Reporter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
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
7
|
/* eslint-disable */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _defineProperties(
|
|
3
|
-
function _createClass(
|
|
4
|
-
function _classCallCheck(
|
|
5
|
-
function _defineProperty(
|
|
2
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
3
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
7
|
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); }
|
|
8
8
|
import { EditorState } from 'prosemirror-state';
|
package/client/http.js
CHANGED
|
@@ -12,7 +12,6 @@ export function req(conf) {
|
|
|
12
12
|
success(req.responseText);
|
|
13
13
|
} else {
|
|
14
14
|
var text = req.responseText;
|
|
15
|
-
if (text && /html/.test(req.getResponseHeader('content-type'))) text = makePlain(text);
|
|
16
15
|
var err = new Error('Request failed: ' + req.statusText + (text ? '\n\n' + text : ''));
|
|
17
16
|
err.status = req.status;
|
|
18
17
|
failure(err);
|
|
@@ -32,11 +31,6 @@ export function req(conf) {
|
|
|
32
31
|
};
|
|
33
32
|
return result;
|
|
34
33
|
}
|
|
35
|
-
function makePlain(html) {
|
|
36
|
-
var elt = document.createElement('div');
|
|
37
|
-
elt.innerHTML = html;
|
|
38
|
-
return elt.textContent.replace(/\n[^]*|\s+$/g, '');
|
|
39
|
-
}
|
|
40
34
|
export function GET(url) {
|
|
41
35
|
return req({
|
|
42
36
|
url: url,
|
package/client/http.js.flow
CHANGED
|
@@ -12,8 +12,6 @@ export function req(conf) {
|
|
|
12
12
|
success(req.responseText);
|
|
13
13
|
} else {
|
|
14
14
|
let text = req.responseText;
|
|
15
|
-
if (text && /html/.test(req.getResponseHeader('content-type')))
|
|
16
|
-
text = makePlain(text);
|
|
17
15
|
let err = new Error(
|
|
18
16
|
'Request failed: ' + req.statusText + (text ? '\n\n' + text : '')
|
|
19
17
|
);
|
|
@@ -39,12 +37,6 @@ export function req(conf) {
|
|
|
39
37
|
return result;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
function makePlain(html) {
|
|
43
|
-
var elt = document.createElement('div');
|
|
44
|
-
elt.innerHTML = html;
|
|
45
|
-
return elt.textContent.replace(/\n[^]*|\s+$/g, '');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
40
|
export function GET(url) {
|
|
49
41
|
return req({ url, method: 'GET' });
|
|
50
42
|
}
|
package/client/throttle.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1
7
|
export default function throttle(fn, threshhold, context) {
|
|
2
8
|
var last;
|
|
3
9
|
var deferTimer;
|
|
@@ -10,11 +16,11 @@ export default function throttle(fn, threshhold, context) {
|
|
|
10
16
|
clearTimeout(deferTimer);
|
|
11
17
|
deferTimer = setTimeout(function () {
|
|
12
18
|
last = now;
|
|
13
|
-
boundFn.apply(
|
|
19
|
+
boundFn.apply(void 0, _toConsumableArray(args));
|
|
14
20
|
}, threshhold);
|
|
15
21
|
} else {
|
|
16
22
|
last = now;
|
|
17
|
-
boundFn.apply(
|
|
23
|
+
boundFn.apply(void 0, _toConsumableArray(args));
|
|
18
24
|
}
|
|
19
25
|
};
|
|
20
26
|
}
|
package/client/throttle.js.flow
CHANGED
|
@@ -17,11 +17,11 @@ export default function throttle(
|
|
|
17
17
|
clearTimeout(deferTimer);
|
|
18
18
|
deferTimer = setTimeout(() => {
|
|
19
19
|
last = now;
|
|
20
|
-
boundFn
|
|
20
|
+
boundFn(...args);
|
|
21
21
|
}, threshhold);
|
|
22
22
|
} else {
|
|
23
23
|
last = now;
|
|
24
|
-
boundFn
|
|
24
|
+
boundFn(...args);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
}
|
package/convertFromDOMElement.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Schema } from 'prosemirror-model';
|
|
2
|
-
import {
|
|
3
|
-
import { EditorState } from 'prosemirror-state';
|
|
4
|
-
import { Plugin } from 'prosemirror-state';
|
|
1
|
+
import { DOMParser, Schema } from 'prosemirror-model';
|
|
2
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
5
3
|
import { getAttrs } from './DocNodeSpec.js';
|
|
6
4
|
import EditorPlugins from './EditorPlugins.js';
|
|
7
5
|
import EditorSchema from './EditorSchema.js';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import { Schema } from 'prosemirror-model';
|
|
4
|
-
import {
|
|
5
|
-
import { EditorState } from 'prosemirror-state';
|
|
6
|
-
import { Plugin } from 'prosemirror-state';
|
|
7
|
-
|
|
3
|
+
import { DOMParser, Schema } from 'prosemirror-model';
|
|
4
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
8
5
|
import { getAttrs } from './DocNodeSpec.js';
|
|
9
6
|
import EditorPlugins from './EditorPlugins.js';
|
|
10
7
|
import EditorSchema from './EditorSchema.js';
|
package/convertFromHTML.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Schema } from 'prosemirror-model';
|
|
2
|
-
import { EditorState } from 'prosemirror-state';
|
|
3
|
-
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
4
3
|
import convertFromDOMElement from './convertFromDOMElement.js';
|
|
5
4
|
export default function convertFromHTML(html, schema, plugins) {
|
|
6
5
|
var root = document.createElement('html');
|
|
7
|
-
root.innerHTML = html
|
|
6
|
+
root.innerHTML = html || ' ';
|
|
8
7
|
return convertFromDOMElement(root, schema, plugins);
|
|
9
8
|
}
|
package/convertFromHTML.js.flow
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import { Schema } from 'prosemirror-model';
|
|
4
|
-
import { EditorState } from 'prosemirror-state';
|
|
5
|
-
import { Plugin } from 'prosemirror-state';
|
|
6
|
-
|
|
4
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
7
5
|
import convertFromDOMElement from './convertFromDOMElement.js';
|
|
8
6
|
|
|
9
7
|
export default function convertFromHTML(
|
|
@@ -12,6 +10,6 @@ export default function convertFromHTML(
|
|
|
12
10
|
plugins: Array<Plugin>
|
|
13
11
|
): EditorState {
|
|
14
12
|
const root = document.createElement('html');
|
|
15
|
-
root.innerHTML = html
|
|
13
|
+
root.innerHTML = html || ' ';
|
|
16
14
|
return convertFromDOMElement(root, schema, plugins);
|
|
17
15
|
}
|
package/convertFromJSON.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
import { Schema } from 'prosemirror-model';
|
|
3
|
-
import { EditorState } from 'prosemirror-state';
|
|
4
|
-
import { Plugin } from 'prosemirror-state';
|
|
3
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
5
4
|
import createEmptyEditorState from './createEmptyEditorState.js';
|
|
6
5
|
export default function convertFromJSON(json, schema, defaultSchema, effectivePlugins) {
|
|
7
6
|
var editorSchema = schema || defaultSchema;
|
package/convertFromJSON.js.flow
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import { Schema } from 'prosemirror-model';
|
|
4
|
-
import { EditorState } from 'prosemirror-state';
|
|
5
|
-
import { Plugin } from 'prosemirror-state';
|
|
4
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
6
5
|
import createEmptyEditorState from './createEmptyEditorState.js';
|
|
7
6
|
|
|
8
7
|
export default function convertFromJSON(
|
package/convertToCSSPTValue.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
var SIZE_PATTERN = /([\d\.]+)(px|pt)/i;
|
|
2
1
|
export var PX_TO_PT_RATIO = 0.75292857;
|
|
3
2
|
export var PT_TO_PX_RATIO = 1 / PX_TO_PT_RATIO;
|
|
4
3
|
export default function convertToCSSPTValue(styleValue) {
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var value = parseFloat(matches[1]);
|
|
10
|
-
var unit = matches[2];
|
|
11
|
-
if (!value || !unit) {
|
|
4
|
+
var unit = styleValue.slice(-2).toLowerCase(); // Extract the last two characters for the unit
|
|
5
|
+
var value = Number(styleValue.slice(0, -2)); // Extract and convert the number part
|
|
6
|
+
|
|
7
|
+
if (!value || unit !== 'px' && unit !== 'pt') {
|
|
12
8
|
return 0;
|
|
13
9
|
}
|
|
14
10
|
if (unit === 'px') {
|
|
15
|
-
|
|
11
|
+
return PX_TO_PT_RATIO * value;
|
|
16
12
|
}
|
|
17
|
-
return value;
|
|
13
|
+
return value; // If 'pt', return the value unchanged
|
|
18
14
|
}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
const SIZE_PATTERN = /([\d\.]+)(px|pt)/i;
|
|
4
|
-
|
|
5
3
|
export const PX_TO_PT_RATIO = 0.75292857;
|
|
6
4
|
export const PT_TO_PX_RATIO = 1 / PX_TO_PT_RATIO;
|
|
7
5
|
|
|
8
6
|
export default function convertToCSSPTValue(styleValue: string): number {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let value = parseFloat(matches[1]);
|
|
14
|
-
const unit = matches[2];
|
|
15
|
-
if (!value || !unit) {
|
|
7
|
+
const unit = styleValue.slice(-2).toLowerCase(); // Extract the last two characters for the unit
|
|
8
|
+
const value = Number(styleValue.slice(0, -2)); // Extract and convert the number part
|
|
9
|
+
|
|
10
|
+
if (!value || (unit !== 'px' && unit !== 'pt')) {
|
|
16
11
|
return 0;
|
|
17
12
|
}
|
|
13
|
+
|
|
18
14
|
if (unit === 'px') {
|
|
19
|
-
|
|
15
|
+
return PX_TO_PT_RATIO * value;
|
|
20
16
|
}
|
|
21
|
-
|
|
17
|
+
|
|
18
|
+
return value; // If 'pt', return the value unchanged
|
|
22
19
|
}
|
package/createCommand.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(
|
|
3
|
-
function _defineProperties(
|
|
4
|
-
function _createClass(
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
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 _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
-
function _possibleConstructorReturn(
|
|
7
|
-
function _assertThisInitialized(
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
function _getPrototypeOf(
|
|
10
|
-
function _inherits(
|
|
11
|
-
function _setPrototypeOf(
|
|
12
|
-
function _defineProperty(
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
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); }
|
|
15
15
|
import { EditorState } from 'prosemirror-state';
|
package/createEditorKeyMap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _defineProperty(
|
|
2
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4
4
|
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); }
|
|
5
5
|
import { EditorState } from 'prosemirror-state';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Schema } from 'prosemirror-model';
|
|
2
|
-
import { EditorState } from 'prosemirror-state';
|
|
3
|
-
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
4
3
|
import convertFromJSON from './convertFromJSON.js';
|
|
5
4
|
import EditorSchema from './EditorSchema.js';
|
|
6
5
|
export var EMPTY_DOC_JSON = {
|
|
@@ -12,5 +11,5 @@ export var EMPTY_DOC_JSON = {
|
|
|
12
11
|
};
|
|
13
12
|
export default function createEmptyEditorState(schema, defaultSchema, plugins) {
|
|
14
13
|
// TODO: Check if schema support doc and paragraph nodes.
|
|
15
|
-
return convertFromJSON(EMPTY_DOC_JSON, schema, defaultSchema
|
|
14
|
+
return convertFromJSON(EMPTY_DOC_JSON, schema, defaultSchema || EditorSchema, plugins);
|
|
16
15
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import { Schema } from 'prosemirror-model';
|
|
4
|
-
import { EditorState } from 'prosemirror-state';
|
|
5
|
-
import { Plugin } from 'prosemirror-state';
|
|
6
|
-
|
|
4
|
+
import { EditorState, Plugin } from 'prosemirror-state';
|
|
7
5
|
import convertFromJSON from './convertFromJSON.js';
|
|
8
6
|
import EditorSchema from './EditorSchema.js';
|
|
9
7
|
|
|
@@ -25,7 +23,7 @@ export default function createEmptyEditorState(
|
|
|
25
23
|
return convertFromJSON(
|
|
26
24
|
EMPTY_DOC_JSON,
|
|
27
25
|
schema,
|
|
28
|
-
defaultSchema
|
|
26
|
+
defaultSchema || EditorSchema,
|
|
29
27
|
plugins
|
|
30
28
|
);
|
|
31
29
|
}
|
|
@@ -7,7 +7,7 @@ var TABLE_VIEW = undefined;
|
|
|
7
7
|
var TABLE_LAST_COLUMN_RESIZABLE = false;
|
|
8
8
|
function lookUpTableWrapper(event) {
|
|
9
9
|
var target = event.target;
|
|
10
|
-
if (!target
|
|
10
|
+
if (!(target !== null && target !== void 0 && target.closest)) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
return target.closest('.tableWrapper');
|
|
@@ -39,15 +39,15 @@ export default function createTableResizingPlugin() {
|
|
|
39
39
|
|
|
40
40
|
// https://github.com/ProseMirror/prosemirror-tables/blob/master/src/columnresizing.js
|
|
41
41
|
var plugin = columnResizing(TABLE_HANDLE_WIDTH, TABLE_CELL_MINWIDTH, TABLE_VIEW, TABLE_LAST_COLUMN_RESIZABLE);
|
|
42
|
-
var
|
|
42
|
+
var _captureMouse = function captureMouse(event) {
|
|
43
43
|
if (event.clientX > maxClientX) {
|
|
44
44
|
// Current mouse event will make table too wide. Stop it and
|
|
45
45
|
// fires a simulated event instead.
|
|
46
46
|
event.stopImmediatePropagation();
|
|
47
47
|
dispatchMouseEvent(event.type, maxClientX);
|
|
48
48
|
} else if (event.type === 'mouseup') {
|
|
49
|
-
window.removeEventListener('mousemove',
|
|
50
|
-
window.removeEventListener('mouseup',
|
|
49
|
+
window.removeEventListener('mousemove', _captureMouse, true);
|
|
50
|
+
window.removeEventListener('mouseup', _captureMouse, true);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
var _mousedown = plugin.props.handleDOMEvents.mousedown;
|
|
@@ -58,8 +58,8 @@ export default function createTableResizingPlugin() {
|
|
|
58
58
|
mousedown: function mousedown(view, event) {
|
|
59
59
|
var targetTable = lookUpTableWrapper(event);
|
|
60
60
|
maxClientX = targetTable ? calculateMaxClientX(event, targetTable) : Number.MAX_VALUE;
|
|
61
|
-
window.addEventListener('mousemove',
|
|
62
|
-
window.addEventListener('mouseup',
|
|
61
|
+
window.addEventListener('mousemove', _captureMouse, true);
|
|
62
|
+
window.addEventListener('mouseup', _captureMouse, true);
|
|
63
63
|
_mousedown(view, event);
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
@@ -11,7 +11,7 @@ const TABLE_LAST_COLUMN_RESIZABLE = false;
|
|
|
11
11
|
|
|
12
12
|
function lookUpTableWrapper(event: Event): ?HTMLElement {
|
|
13
13
|
const target: any = event.target;
|
|
14
|
-
if (!target
|
|
14
|
+
if (!target?.closest) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
return target.closest('.tableWrapper');
|
package/findActiveMark.js
CHANGED
|
@@ -11,7 +11,7 @@ export default function findActiveMark(doc, from, to, markType) {
|
|
|
11
11
|
to = Math.min(to, doc.nodeSize - 2);
|
|
12
12
|
while (ii <= to) {
|
|
13
13
|
var node = doc.nodeAt(ii);
|
|
14
|
-
if (!node
|
|
14
|
+
if (!(node !== null && node !== void 0 && node.marks)) {
|
|
15
15
|
ii++;
|
|
16
16
|
continue;
|
|
17
17
|
}
|
package/findActiveMark.js.flow
CHANGED
package/insertTable.js
CHANGED
|
@@ -2,9 +2,6 @@ import { Fragment, Schema } from 'prosemirror-model';
|
|
|
2
2
|
import { TextSelection } from 'prosemirror-state';
|
|
3
3
|
import { Transform } from 'prosemirror-transform';
|
|
4
4
|
import { PARAGRAPH, TABLE, TABLE_CELL, TABLE_ROW } from './NodeNames.js';
|
|
5
|
-
|
|
6
|
-
// const ZERO_WIDTH_SPACE_CHAR = '\u200b';
|
|
7
|
-
|
|
8
5
|
export default function insertTable(tr, schema, rows, cols) {
|
|
9
6
|
if (!tr.selection || !tr.doc) {
|
|
10
7
|
return tr;
|
package/insertTable.js.flow
CHANGED
package/joinDown.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js
|
|
2
2
|
import { NodeSelection } from 'prosemirror-state';
|
|
3
|
-
import { Transform } from 'prosemirror-transform';
|
|
4
|
-
import { canJoin } from 'prosemirror-transform';
|
|
5
|
-
import { joinPoint } from 'prosemirror-transform';
|
|
3
|
+
import { Transform, canJoin, joinPoint } from 'prosemirror-transform';
|
|
6
4
|
|
|
7
5
|
// Join the selected block, or the closest ancestor of the selection
|
|
8
6
|
// that can be joined, with the sibling after it.
|
package/joinDown.js.flow
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
// https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js
|
|
3
3
|
|
|
4
4
|
import { NodeSelection } from 'prosemirror-state';
|
|
5
|
-
import { Transform } from 'prosemirror-transform';
|
|
6
|
-
import { canJoin } from 'prosemirror-transform';
|
|
7
|
-
import { joinPoint } from 'prosemirror-transform';
|
|
5
|
+
import { Transform , canJoin, joinPoint} from 'prosemirror-transform';
|
|
8
6
|
|
|
9
7
|
// Join the selected block, or the closest ancestor of the selection
|
|
10
8
|
// that can be joined, with the sibling after it.
|
package/joinUp.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js
|
|
2
2
|
import { NodeSelection } from 'prosemirror-state';
|
|
3
|
-
import { Transform } from 'prosemirror-transform';
|
|
4
|
-
import { canJoin } from 'prosemirror-transform';
|
|
5
|
-
import { joinPoint } from 'prosemirror-transform';
|
|
3
|
+
import { Transform, canJoin, joinPoint } from 'prosemirror-transform';
|
|
6
4
|
|
|
7
5
|
// Join the selected block or, if there is a text selection, the
|
|
8
6
|
// closest ancestor block of the selection that can be joined, with
|
package/joinUp.js.flow
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
// https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js
|
|
3
3
|
|
|
4
4
|
import { NodeSelection } from 'prosemirror-state';
|
|
5
|
-
import { Transform } from 'prosemirror-transform';
|
|
6
|
-
import { canJoin } from 'prosemirror-transform';
|
|
7
|
-
import { joinPoint } from 'prosemirror-transform';
|
|
5
|
+
import { Transform, canJoin, joinPoint } from 'prosemirror-transform';
|
|
8
6
|
|
|
9
7
|
// Join the selected block or, if there is a text selection, the
|
|
10
8
|
// closest ancestor block of the selection that can be joined, with
|
package/lookUpElement.js
CHANGED
package/lookUpElement.js.flow
CHANGED
package/normalizeHTML.js
CHANGED
|
@@ -13,7 +13,7 @@ var LONG_UNDERLINE_PATTERN = /_+/g;
|
|
|
13
13
|
|
|
14
14
|
// This is a workround to convert " ...... " into wider tab
|
|
15
15
|
// tab spacers. For every 6 " ", they will be converted into tab spacers.
|
|
16
|
-
var LONG_TAB_SPACE_PATTERN = /(
|
|
16
|
+
var LONG_TAB_SPACE_PATTERN = /( ){6}/g;
|
|
17
17
|
var TAB_SPACER_HTML = new Array(6).join("<span ".concat(DOM_ATTRIBUTE_SIZE, "=\"").concat(SPACER_SIZE_TAB, "\">").concat(HAIR_SPACE_CHAR, "</span>"));
|
|
18
18
|
function replaceNOBR(matched) {
|
|
19
19
|
// This is a workround to convert "_______" into none-wrapped text
|
|
@@ -31,6 +31,8 @@ export default function normalizeHTML(html) {
|
|
|
31
31
|
|
|
32
32
|
// Convert every two consecutive " " into a spacer tab.
|
|
33
33
|
html = html.replace(LONG_TAB_SPACE_PATTERN, TAB_SPACER_HTML);
|
|
34
|
+
// fix for jspdf copy paste text, from jspdf its always getting transparent
|
|
35
|
+
html = html.replace(/color:\s*transparent;/g, 'color: black;');
|
|
34
36
|
var doc = toSafeHTMLDocument(html);
|
|
35
37
|
if (doc) {
|
|
36
38
|
// styles.
|