@manuscripts/body-editor 1.5.9-LEAN-2702 → 1.5.9
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/dist/cjs/commands.js +1 -1
- package/dist/cjs/configs/editor-plugins.js +1 -6
- package/dist/cjs/index.js +1 -3
- package/dist/cjs/useEditor.js +2 -41
- package/dist/es/commands.js +1 -1
- package/dist/es/components/outline/OutlineManuscript.js +1 -1
- package/dist/es/configs/editor-plugins.js +1 -6
- package/dist/es/index.js +0 -1
- package/dist/es/useEditor.js +2 -41
- package/dist/types/configs/ManuscriptsEditor.d.ts +0 -2
- package/dist/types/configs/editor-plugins.d.ts +0 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/useEditor.d.ts +1 -2
- package/dist/types/views/contributors_section.d.ts +2 -2
- package/package.json +2 -3
- package/dist/cjs/classes/collabProvider.js +0 -21
- package/dist/cjs/lib/use-do-with-debounce.js +0 -23
- package/dist/es/classes/collabProvider.js +0 -17
- package/dist/es/lib/use-do-with-debounce.js +0 -19
- package/dist/types/classes/collabProvider.d.ts +0 -27
- package/dist/types/lib/use-do-with-debounce.d.ts +0 -1
package/dist/cjs/commands.js
CHANGED
|
@@ -343,7 +343,7 @@ const insertGraphicalAbstract = (state, dispatch) => {
|
|
|
343
343
|
!(0, transform_1.isInAbstractsSection)(state.selection.$from)) {
|
|
344
344
|
return false;
|
|
345
345
|
}
|
|
346
|
-
if (
|
|
346
|
+
if (!!(0, utils_1.getMatchingDescendant)(state.doc, (node) => node.type === state.schema.nodes.graphical_abstract_section)) {
|
|
347
347
|
return false;
|
|
348
348
|
}
|
|
349
349
|
const section = state.schema.nodes.graphical_abstract_section.createAndFill({ category: 'MPSectionCategory:abstract-graphical' }, [
|
|
@@ -20,7 +20,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
require("prosemirror-gapcursor/style/gapcursor.css");
|
|
22
22
|
require("prosemirror-tables/style/tables.css");
|
|
23
|
-
const prosemirror_collab_1 = require("prosemirror-collab");
|
|
24
23
|
const prosemirror_dropcursor_1 = require("prosemirror-dropcursor");
|
|
25
24
|
const prosemirror_history_1 = require("prosemirror-history");
|
|
26
25
|
const prosemirror_tables_1 = require("prosemirror-tables");
|
|
@@ -43,7 +42,7 @@ const tracking_mark_1 = __importDefault(require("../plugins/tracking-mark"));
|
|
|
43
42
|
const rules_1 = __importDefault(require("../rules"));
|
|
44
43
|
exports.default = (props) => {
|
|
45
44
|
const plugins = props.plugins || [];
|
|
46
|
-
|
|
45
|
+
return [
|
|
47
46
|
rules_1.default,
|
|
48
47
|
...keys_1.default,
|
|
49
48
|
(0, prosemirror_dropcursor_1.dropCursor)(),
|
|
@@ -66,10 +65,6 @@ exports.default = (props) => {
|
|
|
66
65
|
(0, track_changes_ui_1.default)(props),
|
|
67
66
|
(0, tracking_mark_1.default)(),
|
|
68
67
|
];
|
|
69
|
-
if (props.collabProvider) {
|
|
70
|
-
allPlugins.push((0, prosemirror_collab_1.collab)({ version: props.collabProvider.currentVersion }));
|
|
71
|
-
}
|
|
72
|
-
return allPlugins;
|
|
73
68
|
};
|
|
74
69
|
document.execCommand('enableObjectResizing', false, 'false');
|
|
75
70
|
document.execCommand('enableInlineTableEditing', false, 'false');
|
package/dist/cjs/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.ManuscriptsEditor = exports.useEditor = exports.isHighlightComment = exports.isThereSelector = exports.commentScroll = exports.toolbar = exports.PopperManager = exports.
|
|
35
|
+
exports.ManuscriptsEditor = exports.useEditor = exports.isHighlightComment = exports.isThereSelector = exports.commentScroll = exports.toolbar = exports.PopperManager = exports.getMenus = exports.ManuscriptToolbar = exports.OutlineManuscript = exports.OutlineItemIcon = exports.ManuscriptOutline = exports.DialogNames = exports.DialogController = void 0;
|
|
36
36
|
__exportStar(require("./citation-sources"), exports);
|
|
37
37
|
__exportStar(require("./commands"), exports);
|
|
38
38
|
__exportStar(require("./components/application-menu"), exports);
|
|
@@ -49,8 +49,6 @@ var ManuscriptToolbar_1 = require("./components/toolbar/ManuscriptToolbar");
|
|
|
49
49
|
Object.defineProperty(exports, "ManuscriptToolbar", { enumerable: true, get: function () { return ManuscriptToolbar_1.ManuscriptToolbar; } });
|
|
50
50
|
var menus_1 = require("./menus");
|
|
51
51
|
Object.defineProperty(exports, "getMenus", { enumerable: true, get: function () { return __importDefault(menus_1).default; } });
|
|
52
|
-
var collabProvider_1 = require("./classes/collabProvider");
|
|
53
|
-
Object.defineProperty(exports, "CollabProvider", { enumerable: true, get: function () { return collabProvider_1.CollabProvider; } });
|
|
54
52
|
var popper_1 = require("./lib/popper");
|
|
55
53
|
Object.defineProperty(exports, "PopperManager", { enumerable: true, get: function () { return popper_1.PopperManager; } });
|
|
56
54
|
var toolbar_1 = require("./toolbar");
|
package/dist/cjs/useEditor.js
CHANGED
|
@@ -14,62 +14,23 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
|
|
28
|
-
const prosemirror_collab_1 = require("prosemirror-collab");
|
|
29
18
|
const prosemirror_state_1 = require("prosemirror-state");
|
|
30
19
|
const react_1 = require("react");
|
|
31
20
|
const react_router_dom_1 = require("react-router-dom");
|
|
32
|
-
const use_do_with_debounce_1 = require("./lib/use-do-with-debounce");
|
|
33
21
|
const bibliography_1 = require("./plugins/bibliography");
|
|
34
|
-
const useEditor = (initialState, createView
|
|
22
|
+
const useEditor = (initialState, createView) => {
|
|
35
23
|
const view = (0, react_1.useRef)();
|
|
36
24
|
const [state, setState] = (0, react_1.useState)(initialState);
|
|
37
25
|
const [viewElement, setViewElement] = (0, react_1.useState)(null);
|
|
38
26
|
const history = (0, react_router_dom_1.useHistory)();
|
|
39
|
-
const { collabProvider } = editorProps;
|
|
40
|
-
if (collabProvider) {
|
|
41
|
-
collabProvider.onNewSteps((newVersion, steps, clientIDs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
-
if (state && view.current) {
|
|
43
|
-
const localVersion = (0, prosemirror_collab_1.getVersion)(view.current.state);
|
|
44
|
-
const since = yield collabProvider.stepsSince(localVersion);
|
|
45
|
-
if ((since === null || since === void 0 ? void 0 : since.steps) && since.clientIDs) {
|
|
46
|
-
view.current.dispatch((0, prosemirror_collab_1.receiveTransaction)(view.current.state, since === null || since === void 0 ? void 0 : since.steps, since.clientIDs));
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
console.warn('Inconsistent new steps event from the authority.');
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
const debounce = (0, use_do_with_debounce_1.useDoWithDebounce)();
|
|
55
27
|
const dispatch = (0, react_1.useCallback)((tr) => {
|
|
56
28
|
if (!view.current) {
|
|
57
29
|
return state;
|
|
58
30
|
}
|
|
59
31
|
const nextState = view.current.state.apply(tr);
|
|
60
32
|
view.current.updateState(nextState);
|
|
61
|
-
|
|
62
|
-
if (collabProvider &&
|
|
63
|
-
trackState &&
|
|
64
|
-
trackState.status !== track_changes_plugin_1.TrackChangesStatus.viewSnapshots) {
|
|
65
|
-
const sendable = (0, prosemirror_collab_1.sendableSteps)(nextState);
|
|
66
|
-
if (sendable) {
|
|
67
|
-
collabProvider.sendSteps(sendable.version, sendable.steps, sendable.clientID);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
debounce(() => {
|
|
71
|
-
setState(nextState);
|
|
72
|
-
}, 1000, !tr.isGeneric);
|
|
33
|
+
setState(nextState);
|
|
73
34
|
return state;
|
|
74
35
|
}, []);
|
|
75
36
|
const replaceView = (state, createView) => {
|
package/dist/es/commands.js
CHANGED
|
@@ -301,7 +301,7 @@ export const insertGraphicalAbstract = (state, dispatch) => {
|
|
|
301
301
|
!isInAbstractsSection(state.selection.$from)) {
|
|
302
302
|
return false;
|
|
303
303
|
}
|
|
304
|
-
if (
|
|
304
|
+
if (!!getMatchingDescendant(state.doc, (node) => node.type === state.schema.nodes.graphical_abstract_section)) {
|
|
305
305
|
return false;
|
|
306
306
|
}
|
|
307
307
|
const section = state.schema.nodes.graphical_abstract_section.createAndFill({ category: 'MPSectionCategory:abstract-graphical' }, [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import OutlineIconManuscript from '@manuscripts/assets/react/OutlineIconManuscript';
|
|
17
|
-
import { nodeTitle } from '@manuscripts/transform';
|
|
17
|
+
import { nodeTitle, } from '@manuscripts/transform';
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { Outline, OutlineItem, OutlineItemArrow, OutlineItemIcon, OutlineItemLink, OutlineItemLinkText, StyledTriangleCollapsed, } from './Outline';
|
|
20
20
|
export const OutlineManuscript = ({ project, manuscript, doc, }) => (React.createElement(Outline, null,
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import 'prosemirror-gapcursor/style/gapcursor.css';
|
|
17
17
|
import 'prosemirror-tables/style/tables.css';
|
|
18
|
-
import { collab } from 'prosemirror-collab';
|
|
19
18
|
import { dropCursor } from 'prosemirror-dropcursor';
|
|
20
19
|
import { history } from 'prosemirror-history';
|
|
21
20
|
import { tableEditing } from 'prosemirror-tables';
|
|
@@ -38,7 +37,7 @@ import tracking_mark from '../plugins/tracking-mark';
|
|
|
38
37
|
import rules from '../rules';
|
|
39
38
|
export default (props) => {
|
|
40
39
|
const plugins = props.plugins || [];
|
|
41
|
-
|
|
40
|
+
return [
|
|
42
41
|
rules,
|
|
43
42
|
...keys,
|
|
44
43
|
dropCursor(),
|
|
@@ -61,10 +60,6 @@ export default (props) => {
|
|
|
61
60
|
track_changes_ui(props),
|
|
62
61
|
tracking_mark(),
|
|
63
62
|
];
|
|
64
|
-
if (props.collabProvider) {
|
|
65
|
-
allPlugins.push(collab({ version: props.collabProvider.currentVersion }));
|
|
66
|
-
}
|
|
67
|
-
return allPlugins;
|
|
68
63
|
};
|
|
69
64
|
document.execCommand('enableObjectResizing', false, 'false');
|
|
70
65
|
document.execCommand('enableInlineTableEditing', false, 'false');
|
package/dist/es/index.js
CHANGED
|
@@ -22,7 +22,6 @@ export { OutlineItemIcon } from './components/outline/Outline';
|
|
|
22
22
|
export { OutlineManuscript } from './components/outline/OutlineManuscript';
|
|
23
23
|
export { ManuscriptToolbar, } from './components/toolbar/ManuscriptToolbar';
|
|
24
24
|
export { default as getMenus } from './menus';
|
|
25
|
-
export { CollabProvider } from './classes/collabProvider';
|
|
26
25
|
export { PopperManager } from './lib/popper';
|
|
27
26
|
export { toolbar } from './toolbar';
|
|
28
27
|
export * from './plugins/highlight';
|
package/dist/es/useEditor.js
CHANGED
|
@@ -13,61 +13,22 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
import { trackChangesPluginKey, TrackChangesStatus, } from '@manuscripts/track-changes-plugin';
|
|
26
|
-
import { getVersion, receiveTransaction, sendableSteps, } from 'prosemirror-collab';
|
|
27
16
|
import { NodeSelection, TextSelection, } from 'prosemirror-state';
|
|
28
17
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
29
18
|
import { useHistory } from 'react-router-dom';
|
|
30
|
-
import { useDoWithDebounce } from './lib/use-do-with-debounce';
|
|
31
19
|
import { bibliographyKey } from './plugins/bibliography';
|
|
32
|
-
const useEditor = (initialState, createView
|
|
20
|
+
const useEditor = (initialState, createView) => {
|
|
33
21
|
const view = useRef();
|
|
34
22
|
const [state, setState] = useState(initialState);
|
|
35
23
|
const [viewElement, setViewElement] = useState(null);
|
|
36
24
|
const history = useHistory();
|
|
37
|
-
const { collabProvider } = editorProps;
|
|
38
|
-
if (collabProvider) {
|
|
39
|
-
collabProvider.onNewSteps((newVersion, steps, clientIDs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
-
if (state && view.current) {
|
|
41
|
-
const localVersion = getVersion(view.current.state);
|
|
42
|
-
const since = yield collabProvider.stepsSince(localVersion);
|
|
43
|
-
if ((since === null || since === void 0 ? void 0 : since.steps) && since.clientIDs) {
|
|
44
|
-
view.current.dispatch(receiveTransaction(view.current.state, since === null || since === void 0 ? void 0 : since.steps, since.clientIDs));
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
console.warn('Inconsistent new steps event from the authority.');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
const debounce = useDoWithDebounce();
|
|
53
25
|
const dispatch = useCallback((tr) => {
|
|
54
26
|
if (!view.current) {
|
|
55
27
|
return state;
|
|
56
28
|
}
|
|
57
29
|
const nextState = view.current.state.apply(tr);
|
|
58
30
|
view.current.updateState(nextState);
|
|
59
|
-
|
|
60
|
-
if (collabProvider &&
|
|
61
|
-
trackState &&
|
|
62
|
-
trackState.status !== TrackChangesStatus.viewSnapshots) {
|
|
63
|
-
const sendable = sendableSteps(nextState);
|
|
64
|
-
if (sendable) {
|
|
65
|
-
collabProvider.sendSteps(sendable.version, sendable.steps, sendable.clientID);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
debounce(() => {
|
|
69
|
-
setState(nextState);
|
|
70
|
-
}, 1000, !tr.isGeneric);
|
|
31
|
+
setState(nextState);
|
|
71
32
|
return state;
|
|
72
33
|
}, []);
|
|
73
34
|
const replaceView = (state, createView) => {
|
|
@@ -22,7 +22,6 @@ import { History } from 'history';
|
|
|
22
22
|
import { EditorState, Plugin } from 'prosemirror-state';
|
|
23
23
|
import React from 'react';
|
|
24
24
|
import { DefaultTheme } from 'styled-components';
|
|
25
|
-
import { CollabProvider } from '../classes/collabProvider';
|
|
26
25
|
import { PopperManager } from '../lib/popper';
|
|
27
26
|
import { CreateView } from '../useEditor';
|
|
28
27
|
export type CSLProps = {
|
|
@@ -65,7 +64,6 @@ export interface EditorProps {
|
|
|
65
64
|
environment?: string;
|
|
66
65
|
setCiteprocCitations: (citations: Map<string, string>) => void;
|
|
67
66
|
getCiteprocCitations: () => Map<string, string>;
|
|
68
|
-
collabProvider?: CollabProvider;
|
|
69
67
|
}
|
|
70
68
|
declare const _default: {
|
|
71
69
|
createState: (props: EditorProps) => EditorState;
|
|
@@ -20,7 +20,6 @@ import { CitationProvider } from '@manuscripts/library';
|
|
|
20
20
|
import { Capabilities } from '@manuscripts/style-guide';
|
|
21
21
|
import { Build, ManuscriptSchema } from '@manuscripts/transform';
|
|
22
22
|
import { Plugin } from 'prosemirror-state';
|
|
23
|
-
import { CollabProvider } from '../classes/collabProvider';
|
|
24
23
|
import { PopperManager } from '../lib/popper';
|
|
25
24
|
import { CSLProps } from './ManuscriptsEditor';
|
|
26
25
|
interface PluginProps {
|
|
@@ -38,7 +37,6 @@ interface PluginProps {
|
|
|
38
37
|
cslProps: CSLProps;
|
|
39
38
|
popper: PopperManager;
|
|
40
39
|
setCiteprocCitations: (citations: Map<string, string>) => void;
|
|
41
|
-
collabProvider?: CollabProvider;
|
|
42
40
|
}
|
|
43
41
|
declare const _default: (props: PluginProps) => any[];
|
|
44
42
|
export default _default;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export { OutlineManuscript } from './components/outline/OutlineManuscript';
|
|
|
23
23
|
export { ManuscriptToolbar, ToolbarButtonConfig, } from './components/toolbar/ManuscriptToolbar';
|
|
24
24
|
export { default as getMenus } from './menus';
|
|
25
25
|
export { ChangeReceiver } from './types';
|
|
26
|
-
export { CollabProvider } from './classes/collabProvider';
|
|
27
26
|
export { PopperManager } from './lib/popper';
|
|
28
27
|
export { toolbar } from './toolbar';
|
|
29
28
|
export * from './plugins/highlight';
|
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Command, EditorState, Transaction } from 'prosemirror-state';
|
|
17
17
|
import { EditorView } from 'prosemirror-view';
|
|
18
|
-
import { EditorProps } from './configs/ManuscriptsEditor';
|
|
19
18
|
export type CreateView = (element: HTMLDivElement, state: EditorState, dispatch: (tr: Transaction) => EditorState) => EditorView;
|
|
20
|
-
declare const useEditor: (initialState: EditorState, createView: CreateView
|
|
19
|
+
declare const useEditor: (initialState: EditorState, createView: CreateView) => {
|
|
21
20
|
state: EditorState;
|
|
22
21
|
onRender: (el: HTMLDivElement | null) => void;
|
|
23
22
|
isCommandValid: (command: Command) => boolean;
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { BaseNodeView } from './base_node_view';
|
|
4
4
|
import { EditableBlockProps } from './editable_block';
|
|
5
5
|
export interface ContributorsSectionProps extends EditableBlockProps {
|
|
6
|
-
components: Record<string, React.ComponentType<
|
|
7
|
-
subscribeStore:
|
|
6
|
+
components: Record<string, React.ComponentType<any>>;
|
|
7
|
+
subscribeStore: any;
|
|
8
8
|
}
|
|
9
9
|
export declare class ContributorsSectionView<PropsType extends ContributorsSectionProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
|
|
10
10
|
private metadata;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "1.5.9
|
|
4
|
+
"version": "1.5.9",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"lodash-es": "^4.17.21",
|
|
45
45
|
"popper.js": "^1.16.1",
|
|
46
46
|
"pretty-bytes": "^6.0.0",
|
|
47
|
-
"prosemirror-collab": "^1.3.1",
|
|
48
47
|
"prosemirror-commands": "^1.5.0",
|
|
49
48
|
"prosemirror-dropcursor": "^1.6.1",
|
|
50
49
|
"prosemirror-history": "^1.3.0",
|
|
@@ -71,8 +70,8 @@
|
|
|
71
70
|
"@babel/preset-env": "^7.20.2",
|
|
72
71
|
"@babel/preset-react": "^7.18.6",
|
|
73
72
|
"@babel/preset-typescript": "^7.18.6",
|
|
74
|
-
"@inline-svg-unique-id/react": "^1.2.3",
|
|
75
73
|
"@manuscripts/eslint-config": "^0.5.1",
|
|
74
|
+
"@inline-svg-unique-id/react": "^1.2.3",
|
|
76
75
|
"@types/codemirror": "^5.60.5",
|
|
77
76
|
"@types/dompurify": "^2.4.0",
|
|
78
77
|
"@types/enzyme": "^3.10.12",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2019 Atypon Systems LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.CollabProvider = void 0;
|
|
19
|
-
class CollabProvider {
|
|
20
|
-
}
|
|
21
|
-
exports.CollabProvider = CollabProvider;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useDoWithDebounce = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useDoWithDebounce = () => {
|
|
6
|
-
const debounced = (0, react_1.useRef)(() => undefined);
|
|
7
|
-
const timeout = (0, react_1.useRef)();
|
|
8
|
-
const doWithDebounce = (fn, interval = 1000, flush = false) => {
|
|
9
|
-
debounced.current = fn;
|
|
10
|
-
if (flush) {
|
|
11
|
-
fn();
|
|
12
|
-
debounced.current = () => undefined;
|
|
13
|
-
window.clearTimeout(timeout.current);
|
|
14
|
-
}
|
|
15
|
-
window.clearTimeout(timeout.current);
|
|
16
|
-
timeout.current = window.setTimeout(() => {
|
|
17
|
-
debounced.current();
|
|
18
|
-
timeout.current = 0;
|
|
19
|
-
}, interval);
|
|
20
|
-
};
|
|
21
|
-
return doWithDebounce;
|
|
22
|
-
};
|
|
23
|
-
exports.useDoWithDebounce = useDoWithDebounce;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export class CollabProvider {
|
|
17
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
export const useDoWithDebounce = () => {
|
|
3
|
-
const debounced = useRef(() => undefined);
|
|
4
|
-
const timeout = useRef();
|
|
5
|
-
const doWithDebounce = (fn, interval = 1000, flush = false) => {
|
|
6
|
-
debounced.current = fn;
|
|
7
|
-
if (flush) {
|
|
8
|
-
fn();
|
|
9
|
-
debounced.current = () => undefined;
|
|
10
|
-
window.clearTimeout(timeout.current);
|
|
11
|
-
}
|
|
12
|
-
window.clearTimeout(timeout.current);
|
|
13
|
-
timeout.current = window.setTimeout(() => {
|
|
14
|
-
debounced.current();
|
|
15
|
-
timeout.current = 0;
|
|
16
|
-
}, interval);
|
|
17
|
-
};
|
|
18
|
-
return doWithDebounce;
|
|
19
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2019 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { Step } from 'prosemirror-transform';
|
|
17
|
-
export declare abstract class CollabProvider {
|
|
18
|
-
currentVersion: number;
|
|
19
|
-
protected newStepsListener: (version: number, steps: Step[], clientIDs: number[]) => void;
|
|
20
|
-
abstract sendSteps(version: number, steps: readonly Step[], clientID: string | number): Promise<void>;
|
|
21
|
-
abstract onNewSteps(listener: CollabProvider['newStepsListener']): void;
|
|
22
|
-
abstract stepsSince(version: number): Promise<{
|
|
23
|
-
steps: Step[];
|
|
24
|
-
clientIDs: number[];
|
|
25
|
-
version: number;
|
|
26
|
-
} | undefined>;
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useDoWithDebounce: () => (fn: () => void, interval?: number, flush?: boolean) => void;
|