@manuscripts/article-editor 3.0.0 → 3.0.1-JSR
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/EditorApp.js +4 -7
- package/dist/cjs/EditorApp.js.map +1 -1
- package/dist/cjs/components/Page.js +1 -2
- package/dist/cjs/components/Page.js.map +1 -1
- package/dist/cjs/components/inspector/SectionInspector.js +43 -18
- package/dist/cjs/components/inspector/SectionInspector.js.map +1 -1
- package/dist/cjs/components/projects/ContentTab.js +35 -16
- package/dist/cjs/components/projects/ContentTab.js.map +1 -1
- package/dist/cjs/components/projects/EditorElement.js +5 -3
- package/dist/cjs/components/projects/EditorElement.js.map +1 -1
- package/dist/cjs/components/projects/Inspector.js +2 -8
- package/dist/cjs/components/projects/Inspector.js.map +1 -1
- package/dist/cjs/components/projects/ManuscriptMenus.js +9 -2
- package/dist/cjs/components/projects/ManuscriptMenus.js.map +1 -1
- package/dist/cjs/components/projects/ManuscriptPageContainer.js +22 -118
- package/dist/cjs/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/cjs/components/projects/ManuscriptSidebar.js +8 -2
- package/dist/cjs/components/projects/ManuscriptSidebar.js.map +1 -1
- package/dist/cjs/components/projects/ManuscriptToolbar.js +8 -1
- package/dist/cjs/components/projects/ManuscriptToolbar.js.map +1 -1
- package/dist/cjs/components/track-changes/TrackChangesPanel.js +27 -41
- package/dist/cjs/components/track-changes/TrackChangesPanel.js.map +1 -1
- package/dist/cjs/components/track-changes/TrackModal.js +20 -8
- package/dist/cjs/components/track-changes/TrackModal.js.map +1 -1
- package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js +3 -1
- package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
- package/dist/cjs/components/track-changes/suggestion-list/SuggestionList.js +1 -1
- package/dist/cjs/components/track-changes/suggestion-list/SuggestionList.js.map +1 -1
- package/dist/cjs/components/track-changes/utils.js +27 -5
- package/dist/cjs/components/track-changes/utils.js.map +1 -1
- package/dist/cjs/hooks/use-connect-editor.js +74 -0
- package/dist/cjs/hooks/use-connect-editor.js.map +1 -0
- package/dist/cjs/hooks/use-create-editor.js +7 -4
- package/dist/cjs/hooks/use-create-editor.js.map +1 -1
- package/dist/cjs/hooks/use-exec-cmd.js +6 -4
- package/dist/cjs/hooks/use-exec-cmd.js.map +1 -1
- package/dist/cjs/lib/attrs-change-filter.js +7 -7
- package/dist/cjs/lib/attrs-change-filter.js.map +1 -1
- package/dist/cjs/lib/deeper-equal.js +19 -17
- package/dist/cjs/lib/deeper-equal.js.map +1 -1
- package/dist/cjs/lib/section-categories.js +6 -6
- package/dist/cjs/lib/section-categories.js.map +1 -1
- package/dist/cjs/postgres-data/PsSource.js +19 -2
- package/dist/cjs/postgres-data/PsSource.js.map +1 -1
- package/dist/cjs/postgres-data/buildData.js +11 -27
- package/dist/cjs/postgres-data/buildData.js.map +1 -1
- package/dist/cjs/postgres-data/buildUtilities.js +0 -53
- package/dist/cjs/postgres-data/buildUtilities.js.map +1 -1
- package/dist/cjs/quarterback/api/loadDoc.js +104 -0
- package/dist/cjs/quarterback/api/loadDoc.js.map +1 -0
- package/dist/cjs/store/Store.js.map +1 -1
- package/dist/cjs/store/StoreContext.js +1 -1
- package/dist/cjs/store/StoreContext.js.map +1 -1
- package/dist/cjs/store/useStore.js +7 -1
- package/dist/cjs/store/useStore.js.map +1 -1
- package/dist/es/EditorApp.js +4 -7
- package/dist/es/EditorApp.js.map +1 -1
- package/dist/es/components/Page.js +1 -2
- package/dist/es/components/Page.js.map +1 -1
- package/dist/es/components/inspector/SectionInspector.js +43 -18
- package/dist/es/components/inspector/SectionInspector.js.map +1 -1
- package/dist/es/components/projects/ContentTab.js +13 -14
- package/dist/es/components/projects/ContentTab.js.map +1 -1
- package/dist/es/components/projects/EditorElement.js +5 -3
- package/dist/es/components/projects/EditorElement.js.map +1 -1
- package/dist/es/components/projects/Inspector.js +2 -8
- package/dist/es/components/projects/Inspector.js.map +1 -1
- package/dist/es/components/projects/ManuscriptMenus.js +9 -2
- package/dist/es/components/projects/ManuscriptMenus.js.map +1 -1
- package/dist/es/components/projects/ManuscriptPageContainer.js +22 -95
- package/dist/es/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/es/components/projects/ManuscriptSidebar.js +8 -2
- package/dist/es/components/projects/ManuscriptSidebar.js.map +1 -1
- package/dist/es/components/projects/ManuscriptToolbar.js +8 -1
- package/dist/es/components/projects/ManuscriptToolbar.js.map +1 -1
- package/dist/es/components/track-changes/TrackChangesPanel.js +28 -42
- package/dist/es/components/track-changes/TrackChangesPanel.js.map +1 -1
- package/dist/es/components/track-changes/TrackModal.js +21 -9
- package/dist/es/components/track-changes/TrackModal.js.map +1 -1
- package/dist/es/components/track-changes/suggestion-list/Suggestion.js +3 -1
- package/dist/es/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
- package/dist/es/components/track-changes/suggestion-list/SuggestionList.js +1 -1
- package/dist/es/components/track-changes/suggestion-list/SuggestionList.js.map +1 -1
- package/dist/es/components/track-changes/utils.js +24 -3
- package/dist/es/components/track-changes/utils.js.map +1 -1
- package/dist/es/hooks/use-connect-editor.js +70 -0
- package/dist/es/hooks/use-connect-editor.js.map +1 -0
- package/dist/es/hooks/use-create-editor.js +7 -4
- package/dist/es/hooks/use-create-editor.js.map +1 -1
- package/dist/es/hooks/use-exec-cmd.js +7 -5
- package/dist/es/hooks/use-exec-cmd.js.map +1 -1
- package/dist/es/lib/attrs-change-filter.js +7 -7
- package/dist/es/lib/attrs-change-filter.js.map +1 -1
- package/dist/es/lib/deeper-equal.js +19 -17
- package/dist/es/lib/deeper-equal.js.map +1 -1
- package/dist/es/lib/section-categories.js +6 -6
- package/dist/es/lib/section-categories.js.map +1 -1
- package/dist/es/postgres-data/PsSource.js +19 -2
- package/dist/es/postgres-data/PsSource.js.map +1 -1
- package/dist/es/postgres-data/buildData.js +12 -28
- package/dist/es/postgres-data/buildData.js.map +1 -1
- package/dist/es/postgres-data/buildUtilities.js +1 -54
- package/dist/es/postgres-data/buildUtilities.js.map +1 -1
- package/dist/es/quarterback/api/loadDoc.js +77 -0
- package/dist/es/quarterback/api/loadDoc.js.map +1 -0
- package/dist/es/store/Store.js.map +1 -1
- package/dist/es/store/StoreContext.js +1 -1
- package/dist/es/store/StoreContext.js.map +1 -1
- package/dist/es/store/useStore.js +5 -0
- package/dist/es/store/useStore.js.map +1 -1
- package/dist/types/components/Page.d.ts +1 -3
- package/dist/types/components/inspector/SectionInspector.d.ts +1 -15
- package/dist/types/components/projects/ContentTab.d.ts +1 -5
- package/dist/types/components/projects/EditorElement.d.ts +1 -16
- package/dist/types/components/projects/Inspector.d.ts +1 -5
- package/dist/types/components/projects/ManuscriptMenus.d.ts +1 -6
- package/dist/types/components/projects/ManuscriptPageContainer.d.ts +1 -1
- package/dist/types/components/projects/ManuscriptSidebar.d.ts +1 -9
- package/dist/types/components/projects/ManuscriptToolbar.d.ts +1 -7
- package/dist/types/components/track-changes/suggestion-list/SuggestionList.d.ts +1 -1
- package/dist/types/components/track-changes/utils.d.ts +6 -2
- package/dist/types/hooks/use-connect-editor.d.ts +9 -0
- package/dist/types/lib/attrs-change-filter.d.ts +2 -3
- package/dist/types/lib/deeper-equal.d.ts +1 -1
- package/dist/types/lib/section-categories.d.ts +3 -2
- package/dist/types/postgres-data/buildData.d.ts +2 -1
- package/dist/types/quarterback/{useLoadDoc.d.ts → api/loadDoc.d.ts} +2 -2
- package/dist/types/store/Store.d.ts +4 -12
- package/dist/types/store/useStore.d.ts +1 -0
- package/package.json +5 -5
- package/dist/cjs/components/inspector/StyleFields.js +0 -18
- package/dist/cjs/components/inspector/StyleFields.js.map +0 -1
- package/dist/cjs/lib/sort.js +0 -17
- package/dist/cjs/lib/sort.js.map +0 -1
- package/dist/cjs/quarterback/QuarterBackDataSource.js +0 -29
- package/dist/cjs/quarterback/QuarterBackDataSource.js.map +0 -1
- package/dist/cjs/quarterback/useLoadDoc.js +0 -106
- package/dist/cjs/quarterback/useLoadDoc.js.map +0 -1
- package/dist/cjs/tracked-models/adapt-tracked-data.js +0 -100
- package/dist/cjs/tracked-models/adapt-tracked-data.js.map +0 -1
- package/dist/cjs/tracked-models/creators.js +0 -129
- package/dist/cjs/tracked-models/creators.js.map +0 -1
- package/dist/cjs/tracked-models/use-tracked-model-management.js +0 -129
- package/dist/cjs/tracked-models/use-tracked-model-management.js.map +0 -1
- package/dist/es/components/inspector/StyleFields.js +0 -14
- package/dist/es/components/inspector/StyleFields.js.map +0 -1
- package/dist/es/lib/sort.js +0 -13
- package/dist/es/lib/sort.js.map +0 -1
- package/dist/es/quarterback/QuarterBackDataSource.js +0 -26
- package/dist/es/quarterback/QuarterBackDataSource.js.map +0 -1
- package/dist/es/quarterback/useLoadDoc.js +0 -79
- package/dist/es/quarterback/useLoadDoc.js.map +0 -1
- package/dist/es/tracked-models/adapt-tracked-data.js +0 -95
- package/dist/es/tracked-models/adapt-tracked-data.js.map +0 -1
- package/dist/es/tracked-models/creators.js +0 -120
- package/dist/es/tracked-models/creators.js.map +0 -1
- package/dist/es/tracked-models/use-tracked-model-management.js +0 -127
- package/dist/es/tracked-models/use-tracked-model-management.js.map +0 -1
- package/dist/types/components/inspector/StyleFields.d.ts +0 -14
- package/dist/types/lib/sort.d.ts +0 -17
- package/dist/types/quarterback/QuarterBackDataSource.d.ts +0 -23
- package/dist/types/tracked-models/adapt-tracked-data.d.ts +0 -13
- package/dist/types/tracked-models/creators.d.ts +0 -21
- package/dist/types/tracked-models/use-tracked-model-management.d.ts +0 -21
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { ObjectTypes, } from '@manuscripts/json-schema';
|
|
13
|
-
import { Decoder, encode, schema, } from '@manuscripts/transform';
|
|
14
|
-
import { useCallback, useMemo } from 'react';
|
|
15
|
-
import { setNodeAttrs } from '../lib/node-attrs';
|
|
16
|
-
import { useStore } from '../store';
|
|
17
|
-
import { adaptTrackedData } from './adapt-tracked-data';
|
|
18
|
-
import { createAffiliationNode, createContributorNode, createSupplementNode, deleteComment, deleteSupplementNode, saveComment, } from './creators';
|
|
19
|
-
const useTrackedModelManagement = (doc, view, state, dispatch, saveModel, deleteModel, finalModelMap) => {
|
|
20
|
-
const modelMap = useMemo(() => {
|
|
21
|
-
const adaptedDoc = adaptTrackedData(doc.toJSON());
|
|
22
|
-
return encode(schema.nodeFromJSON(adaptedDoc));
|
|
23
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
-
}, [doc, finalModelMap]);
|
|
25
|
-
const [, dispatchStore] = useStore();
|
|
26
|
-
const saveCommentNode = useCallback((comment, view) => saveComment(comment, view, doc, state, modelMap), [doc, modelMap, state]);
|
|
27
|
-
const deleteCommentNode = useCallback((comment, view) => deleteComment(comment, view, doc, state), [doc, state]);
|
|
28
|
-
const saveTrackModel = useCallback((model) => {
|
|
29
|
-
if (!view) {
|
|
30
|
-
throw Error('View not available');
|
|
31
|
-
}
|
|
32
|
-
if (model.objectType === ObjectTypes.CommentAnnotation) {
|
|
33
|
-
return saveCommentNode(model, view);
|
|
34
|
-
}
|
|
35
|
-
if (model.objectType === ObjectTypes.Supplement) {
|
|
36
|
-
return createSupplementNode(view, model);
|
|
37
|
-
}
|
|
38
|
-
if (model._id) {
|
|
39
|
-
const currentModel = modelMap.get(model._id);
|
|
40
|
-
if (currentModel) {
|
|
41
|
-
modelMap.set(model._id, { ...currentModel, ...model });
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
modelMap.set(model._id, model);
|
|
45
|
-
}
|
|
46
|
-
let foundInDoc = false;
|
|
47
|
-
if (view) {
|
|
48
|
-
doc.descendants((node, pos) => {
|
|
49
|
-
if (node.attrs.id === model._id) {
|
|
50
|
-
const decoder = new Decoder(modelMap, true); // as node ids are unique it will always occur just once (or never) so it's safe to keep in the loop
|
|
51
|
-
const newDoc = decoder.createArticleNode();
|
|
52
|
-
newDoc.descendants((newNode, pos) => {
|
|
53
|
-
if (newNode.attrs.id === node.attrs.id) {
|
|
54
|
-
setNodeAttrs(view.state, view.dispatch, node.attrs.id, {
|
|
55
|
-
...newNode.attrs,
|
|
56
|
-
id: node.attrs.id,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
foundInDoc = true;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (!foundInDoc) {
|
|
65
|
-
if (model.objectType === ObjectTypes.Contributor) {
|
|
66
|
-
createContributorNode(model, view, doc, state);
|
|
67
|
-
}
|
|
68
|
-
else if (model.objectType === ObjectTypes.Affiliation) {
|
|
69
|
-
createAffiliationNode(model, view, doc, state);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
// ...that is if there is no node in the prosemirror doc for that id,
|
|
73
|
-
// that update final model.
|
|
74
|
-
// This is needed until we move all the data into prosemirror
|
|
75
|
-
saveModel(model);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return Promise.resolve(model);
|
|
80
|
-
},
|
|
81
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
82
|
-
[modelMap, saveModel, doc, view]);
|
|
83
|
-
const deleteTrackModel = useCallback((id) => {
|
|
84
|
-
if (!view) {
|
|
85
|
-
throw Error('View not available');
|
|
86
|
-
}
|
|
87
|
-
if (modelMap.get(id)?.objectType === ObjectTypes.CommentAnnotation) {
|
|
88
|
-
return deleteCommentNode(modelMap.get(id), view);
|
|
89
|
-
}
|
|
90
|
-
if (modelMap.get(id)?.objectType === ObjectTypes.Supplement) {
|
|
91
|
-
return deleteSupplementNode(view, modelMap.get(id));
|
|
92
|
-
}
|
|
93
|
-
if (modelMap.has(id)) {
|
|
94
|
-
doc.descendants((node, pos) => {
|
|
95
|
-
if (node.attrs.id === id) {
|
|
96
|
-
const { tr } = state;
|
|
97
|
-
tr.delete(pos, pos + node.nodeSize);
|
|
98
|
-
dispatch(tr);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
deleteModel(id);
|
|
104
|
-
}
|
|
105
|
-
return Promise.resolve(id);
|
|
106
|
-
},
|
|
107
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
|
-
[
|
|
109
|
-
modelMap,
|
|
110
|
-
deleteCommentNode,
|
|
111
|
-
doc,
|
|
112
|
-
view,
|
|
113
|
-
state,
|
|
114
|
-
dispatch,
|
|
115
|
-
dispatchStore,
|
|
116
|
-
deleteModel,
|
|
117
|
-
]);
|
|
118
|
-
const getTrackModel = useCallback((id) => modelMap.get(id), [modelMap]);
|
|
119
|
-
return {
|
|
120
|
-
saveTrackModel,
|
|
121
|
-
deleteTrackModel,
|
|
122
|
-
trackModelMap: modelMap,
|
|
123
|
-
getTrackModel,
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
export default useTrackedModelManagement;
|
|
127
|
-
//# sourceMappingURL=use-tracked-model-management.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-tracked-model-management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yB,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { Model } from '@manuscripts/json-schema';
|
|
13
|
-
export type SaveModel = <T extends Model>(model: Partial<T>) => Promise<T>;
|
|
14
|
-
export declare const valueOrDefault: <T extends string | number | boolean>(value: T | undefined, defaultValue: T) => T;
|
package/dist/types/lib/sort.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { Model } from '@manuscripts/json-schema';
|
|
13
|
-
type ModelWithPriority = Model & {
|
|
14
|
-
priority?: number;
|
|
15
|
-
};
|
|
16
|
-
export declare const ascendingPriority: (a: ModelWithPriority, b: ModelWithPriority) => number;
|
|
17
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { ManuscriptNode } from '@manuscripts/transform';
|
|
13
|
-
import { builderFn, StoreDataSourceStrategy } from '../store';
|
|
14
|
-
import { SnapshotLabel } from './types';
|
|
15
|
-
export default class QuarterbackDataSource implements StoreDataSourceStrategy {
|
|
16
|
-
loadDoc: (manuscriptID: string, projectID: string, doc: ManuscriptNode | undefined) => Promise<{
|
|
17
|
-
doc: ManuscriptNode;
|
|
18
|
-
version: number;
|
|
19
|
-
snapshots: SnapshotLabel[];
|
|
20
|
-
} | undefined>;
|
|
21
|
-
constructor(loadDoc: QuarterbackDataSource['loadDoc']);
|
|
22
|
-
build: builderFn;
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
export declare const filterNodesWithTrackingData: (node: any) => any;
|
|
13
|
-
export declare const adaptTrackedData: (docJSONed: unknown) => {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { Affiliation, CommentAnnotation, Contributor, Model, Supplement } from '@manuscripts/json-schema';
|
|
13
|
-
import { Node as ProsemirrorNode } from 'prosemirror-model';
|
|
14
|
-
import { EditorState } from 'prosemirror-state';
|
|
15
|
-
import { EditorView } from 'prosemirror-view';
|
|
16
|
-
export declare const createContributorNode: (model: Partial<Contributor>, view: EditorView, doc: ProsemirrorNode, state: EditorState) => void;
|
|
17
|
-
export declare const createAffiliationNode: (model: Partial<Affiliation>, view: EditorView, doc: ProsemirrorNode, state: EditorState) => void;
|
|
18
|
-
export declare const saveComment: (comment: CommentAnnotation, view: EditorView, doc: ProsemirrorNode, state: EditorState, modelMap: Map<string, Model>) => Promise<Model>;
|
|
19
|
-
export declare const deleteComment: (comment: CommentAnnotation, view: EditorView, doc: ProsemirrorNode, state: EditorState) => Promise<string>;
|
|
20
|
-
export declare const createSupplementNode: (view: EditorView, supplement: Supplement) => Promise<Supplement>;
|
|
21
|
-
export declare const deleteSupplementNode: (view: EditorView, supplement: Supplement) => Promise<Supplement>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { Model, Supplement } from '@manuscripts/json-schema';
|
|
13
|
-
import { Build, ManuscriptEditorView, ManuscriptNode } from '@manuscripts/transform';
|
|
14
|
-
import { EditorState, Transaction } from 'prosemirror-state';
|
|
15
|
-
declare const useTrackedModelManagement: (doc: ManuscriptNode, view: ManuscriptEditorView | undefined, state: EditorState, dispatch: (tr: Transaction) => EditorState, saveModel: <T extends Model>(model: T | Build<T> | Partial<T>) => Promise<T>, deleteModel: (id: string) => Promise<string>, finalModelMap: Map<string, Model>) => {
|
|
16
|
-
saveTrackModel: <T_1 extends Model>(model: T_1 | Build<T_1> | Partial<T_1>) => Promise<Model> | Promise<Awaited<T_1> | Awaited<Build<T_1>> | Awaited<Partial<T_1>>>;
|
|
17
|
-
deleteTrackModel: (id: string) => Promise<string> | Promise<Supplement>;
|
|
18
|
-
trackModelMap: Map<string, Model>;
|
|
19
|
-
getTrackModel: (id: string) => Model | undefined;
|
|
20
|
-
};
|
|
21
|
-
export default useTrackedModelManagement;
|