@manuscripts/article-editor 3.1.10-LEAN-3842.1 → 3.1.10
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/CategoryInput.js +1 -1
- package/dist/cjs/components/projects/CategoryInput.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 +24 -120
- 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 +12 -5
- 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 +28 -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 -6
- 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 +9 -9
- 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 +17 -26
- package/dist/cjs/postgres-data/buildData.js.map +1 -1
- package/dist/cjs/postgres-data/buildUtilities.js +4 -44
- package/dist/cjs/postgres-data/buildUtilities.js.map +1 -1
- package/dist/cjs/quarterback/api/loadDoc.js +108 -0
- package/dist/cjs/quarterback/api/loadDoc.js.map +1 -0
- package/dist/cjs/store/DataSourceStrategy.js.map +1 -1
- package/dist/cjs/store/Store.js +0 -1
- 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/CategoryInput.js +2 -2
- package/dist/es/components/projects/CategoryInput.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 +24 -97
- 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 +12 -5
- 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 +25 -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 -6
- 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 +7 -7
- 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 +18 -27
- package/dist/es/postgres-data/buildData.js.map +1 -1
- package/dist/es/postgres-data/buildUtilities.js +4 -44
- package/dist/es/postgres-data/buildUtilities.js.map +1 -1
- package/dist/es/quarterback/api/loadDoc.js +81 -0
- package/dist/es/quarterback/api/loadDoc.js.map +1 -0
- package/dist/es/store/DataSourceStrategy.js.map +1 -1
- package/dist/es/store/Store.js +0 -1
- 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 +4 -4
- package/dist/types/postgres-data/PsSource.d.ts +1 -1
- 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/DataSourceStrategy.d.ts +1 -1
- package/dist/types/store/Store.d.ts +14 -15
- package/dist/types/store/useStore.d.ts +1 -0
- package/package.json +4 -4
- 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 -109
- 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 -82
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildData.js","sourceRoot":"","sources":["../../../src/postgres-data/buildData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"buildData.js","sourceRoot":"","sources":["../../../src/postgres-data/buildData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,WAAW,GAGZ,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG9C,MAAM,WAAW,GAAG,KAAK,EACvB,GAAQ,EACR,SAAiB,EACjB,YAAoB,EACpB,EAAE;IACF,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;IAC/D,IAAI,OAA4B,CAAA;IAChC,IAAI,UAAkC,CAAA;IACtC,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;KACrC;IACD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI,KAAK,CAAC,UAAU,KAAK,WAAW,CAAC,OAAO,EAAE;YAC5C,OAAO,GAAG,KAAgB,CAAA;SAC3B;QACD,IAAI,KAAK,CAAC,UAAU,KAAK,WAAW,CAAC,UAAU,EAAE;YAC/C,UAAU,GAAG,KAAmB,CAAA;SACjC;KACF;IACD,OAAO,CAAC,OAAO,EAAE,UAAU,CAA0B,CAAA;AACvD,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,KAAK,EAAE,GAAQ,EAAE,SAAiB,EAAE,EAAE;IAC9D,MAAM,IAAI,GAAmB,EAAE,CAAA;IAC/B,MAAM,CAAC,iBAAiB,EAAE,SAAS,EAAE,QA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CAAA;KACV;IAED,MAAM,cAAc,GAAG,GAA2B,CAAA;IAClD,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAC1E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,CAAA;IAC7E,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC/D,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;IAErD,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,IAAI;QACd,GAAG,KAAK;QACR,GAAG,KAAK;QACR,OAAO;QACP,UAAU;QACV,SAAS,EAAE,IAAI,SAAS,EAAE;KAC3B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -13,10 +13,6 @@ import { manuscriptIDTypes, ObjectTypes, } from '@manuscripts/json-schema';
|
|
|
13
13
|
import { encode } from '@manuscripts/transform';
|
|
14
14
|
import { getUserRole } from '../lib/roles';
|
|
15
15
|
export const buildUtilities = (projectID, manuscriptID, getState, updateState, api) => {
|
|
16
|
-
const nonPMModelsTypes = new Set([
|
|
17
|
-
ObjectTypes.Manuscript,
|
|
18
|
-
ObjectTypes.Project,
|
|
19
|
-
]);
|
|
20
16
|
const updateContainerIDs = (model) => {
|
|
21
17
|
const containerIDs = {
|
|
22
18
|
containerID: projectID,
|
|
@@ -42,25 +38,12 @@ export const buildUtilities = (projectID, manuscriptID, getState, updateState, a
|
|
|
42
38
|
return false;
|
|
43
39
|
}
|
|
44
40
|
};
|
|
45
|
-
const
|
|
41
|
+
const saveModels = async (models) => {
|
|
46
42
|
const state = getState();
|
|
47
|
-
if (!state.
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
return state.modelMap.get(id);
|
|
51
|
-
};
|
|
52
|
-
const saveModels = async (models, excludeIDs) => {
|
|
53
|
-
const state = getState();
|
|
54
|
-
if (!state.modelMap) {
|
|
43
|
+
if (!state.project || !state.manuscript) {
|
|
55
44
|
throw new Error('Unable to save due to incomplete data');
|
|
56
45
|
}
|
|
57
46
|
const modelMap = new Map();
|
|
58
|
-
for (const [id, model] of state.modelMap) {
|
|
59
|
-
const type = model.objectType;
|
|
60
|
-
if (nonPMModelsTypes.has(type) || (excludeIDs && !excludeIDs.has(id))) {
|
|
61
|
-
modelMap.set(id, model);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
47
|
for (const model of models) {
|
|
65
48
|
if (!model._id) {
|
|
66
49
|
throw new Error('Model ID required');
|
|
@@ -68,6 +51,8 @@ export const buildUtilities = (projectID, manuscriptID, getState, updateState, a
|
|
|
68
51
|
const updated = updateContainerIDs(model);
|
|
69
52
|
modelMap.set(model._id, updated);
|
|
70
53
|
}
|
|
54
|
+
modelMap.set(state.project._id, state.project);
|
|
55
|
+
modelMap.set(state.manuscript._id, state.manuscript);
|
|
71
56
|
updateState({
|
|
72
57
|
savingProcess: 'saving',
|
|
73
58
|
preventUnload: true,
|
|
@@ -78,26 +63,6 @@ export const buildUtilities = (projectID, manuscriptID, getState, updateState, a
|
|
|
78
63
|
preventUnload: false,
|
|
79
64
|
});
|
|
80
65
|
};
|
|
81
|
-
const saveModel = async (model) => {
|
|
82
|
-
await saveModels([model]);
|
|
83
|
-
//is this actually needed?
|
|
84
|
-
return model;
|
|
85
|
-
};
|
|
86
|
-
const deleteModel = async (id) => {
|
|
87
|
-
await saveModels([], new Set([id]));
|
|
88
|
-
return id;
|
|
89
|
-
};
|
|
90
|
-
const saveManuscript = async (manuscript) => {
|
|
91
|
-
const state = getState();
|
|
92
|
-
if (!state.modelMap) {
|
|
93
|
-
throw new Error('Unable to save manuscript due to incomplete data');
|
|
94
|
-
}
|
|
95
|
-
const previous = state.modelMap.get(manuscriptID);
|
|
96
|
-
await saveModel({
|
|
97
|
-
...previous,
|
|
98
|
-
...manuscript,
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
66
|
const saveDoc = async (doc) => {
|
|
102
67
|
const models = encode(doc);
|
|
103
68
|
await saveModels([...models.values()]);
|
|
@@ -136,11 +101,6 @@ export const buildUtilities = (projectID, manuscriptID, getState, updateState, a
|
|
|
136
101
|
});
|
|
137
102
|
};
|
|
138
103
|
return {
|
|
139
|
-
saveModel,
|
|
140
|
-
deleteModel,
|
|
141
|
-
saveManuscript,
|
|
142
|
-
getModel,
|
|
143
|
-
saveModels,
|
|
144
104
|
saveDoc,
|
|
145
105
|
createSnapshot,
|
|
146
106
|
refreshProject,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildUtilities.js","sourceRoot":"","sources":["../../../src/postgres-data/buildUtilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"buildUtilities.js","sourceRoot":"","sources":["../../../src/postgres-data/buildUtilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,iBAAiB,EAEjB,WAAW,GAEZ,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAS,MAAM,EAAkB,MAAM,wBAAwB,CAAA;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,SAAiB,EACjB,YAAoB,EACpB,QAA8B,EAC9B,WAA4C,EAC5C,GAAQ,EACQ,EAAE;IAClB,MAAM,kBAAkB,GAAG,CAAC,KAAY,EAAE,EAAE;QAC1C,MAAM,YAAY,GAAiB;YACjC,WAAW,EAAE,SAAS;SACvB,CAAA;QAED,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;SACrC;QAED,IAAI,iBAAiB,CAAC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C,CAAA;IAED,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;QAChC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;QACxB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;QAC3B,IAAI,CAAC,MAAM,EAAE;YACX,OAAM;SACP;QACD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;QAC/D,IAAI,CAAC,MAAM,EAAE;YACX,OAAM;SACP;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAC3B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,WAAW,CAAC,OAAO,CAC5C,CAAC,CAAC,CAAY,CAAA;QACf,IAAI,CAAC,OAAO,EAAE;YACZ,OAAM;SACP;QACD,WAAW,CAAC;YACV,OAAO;YACP,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC;SACvC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO;QACL,OAAO;QACP,cAAc;QACd,cAAc;KACf,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
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) 2022 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
import { getVersion, schema } from '@manuscripts/transform';
|
|
13
|
+
import { updateDocument } from './document';
|
|
14
|
+
import * as docApi from './document';
|
|
15
|
+
export async function loadDoc(manuscriptID, projectID, authToken, existingDoc) {
|
|
16
|
+
const resp = await docApi.getTransformVersion(authToken);
|
|
17
|
+
if ('data' in resp && resp.data.transformVersion !== getVersion()) {
|
|
18
|
+
console.warn(`Warning! Manuscripts-transform (Frontend: ${getVersion()}) version is different on manuscripts-api (${resp.data.transformVersion})`);
|
|
19
|
+
}
|
|
20
|
+
const found = await docApi.getDocument(projectID, manuscriptID, authToken);
|
|
21
|
+
let doc;
|
|
22
|
+
let version = 0;
|
|
23
|
+
let snapshots = [];
|
|
24
|
+
if ('data' in found) {
|
|
25
|
+
let empty = true;
|
|
26
|
+
for (const _ in found.data.doc) {
|
|
27
|
+
empty = false;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
if (empty) {
|
|
31
|
+
if (!existingDoc) {
|
|
32
|
+
throw new Error('Unable to produce valid doc as neither model based verions nor history have a valid version');
|
|
33
|
+
}
|
|
34
|
+
await docApi.updateDocument(projectID, manuscriptID, authToken, {
|
|
35
|
+
doc: existingDoc.toJSON(),
|
|
36
|
+
schema_version: getVersion(),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
snapshots = found.data.snapshots;
|
|
40
|
+
doc = found.data.doc;
|
|
41
|
+
version = found.data.version;
|
|
42
|
+
}
|
|
43
|
+
else if ('err' in found && found.code === 404) {
|
|
44
|
+
// Create an empty doc that will be replaced with whatever document is currently being edited
|
|
45
|
+
const res = await docApi.createDocument({
|
|
46
|
+
manuscript_model_id: manuscriptID,
|
|
47
|
+
project_model_id: projectID,
|
|
48
|
+
doc: {},
|
|
49
|
+
schema_version: getVersion(),
|
|
50
|
+
}, authToken);
|
|
51
|
+
if ('data' in res) {
|
|
52
|
+
doc = res.data.doc;
|
|
53
|
+
version = res.data.version;
|
|
54
|
+
snapshots = res.data.snapshots;
|
|
55
|
+
}
|
|
56
|
+
if ('err' in res) {
|
|
57
|
+
console.error('Unable to create new document: ' + res.err);
|
|
58
|
+
}
|
|
59
|
+
const update = await updateDocument(projectID, manuscriptID, authToken, {
|
|
60
|
+
doc: existingDoc?.toJSON(),
|
|
61
|
+
schema_version: getVersion(),
|
|
62
|
+
});
|
|
63
|
+
if ('err' in update) {
|
|
64
|
+
console.error('Unable to create new document: ' + update.err);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const found = await docApi.getDocument(projectID, manuscriptID, authToken);
|
|
68
|
+
if ('data' in found && found.data.doc && found.data.version >= 0) {
|
|
69
|
+
doc = found.data.doc;
|
|
70
|
+
version = found.data.version;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (doc !== null &&
|
|
75
|
+
typeof doc === 'object' &&
|
|
76
|
+
Object.keys(doc).length !== 0) {
|
|
77
|
+
return { doc: schema.nodeFromJSON(doc), version, snapshots };
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=loadDoc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadDoc.js","sourceRoot":"","sources":["../../../../src/quarterback/api/loadDoc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAkB,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,YAAY,CAAA;AAEpC,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,YAAoB,EACpB,SAAiB,EACjB,SAAiB,EACjB,WAA4B;IAE5B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,SA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GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAA;KAC7D;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceStrategy.js","sourceRoot":"","sources":["../../../src/store/DataSourceStrategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"DataSourceStrategy.js","sourceRoot":"","sources":["../../../src/store/DataSourceStrategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAoBH,MAAM,OAAO,WAAW;IAEtB,YACE,cAA8B,EAC9B,SAAiB,EACjB,YAAoB,EACpB,KAAuB,EACvB,gBAA0B,EAC1B,MAA2B,EAC3B,SAA8B;QAahC,UAAK,GAAc,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACjC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QACxB,CAAC,CAAA;QAbC,IAAI,CAAC,IAAI,GAAG;YACV,cAAc;YACd,SAAS;YACT,YAAY;YACZ,KAAK;YACL,gBAAgB;YAChB,MAAM;YACN,SAAS;SACV,CAAA;IACH,CAAC;CAKF"}
|
package/dist/es/store/Store.js
CHANGED
|
@@ -53,7 +53,6 @@ export class GenericStore {
|
|
|
53
53
|
this.dispatchAction = this.dispatchAction.bind(this);
|
|
54
54
|
this.setState = this.setState.bind(this);
|
|
55
55
|
this.getState = this.getState.bind(this);
|
|
56
|
-
// this.state = buildStateFromSources(source)
|
|
57
56
|
}
|
|
58
57
|
getState() {
|
|
59
58
|
return this.state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH,O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AAC,CAAA;SACrE;QACD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,EAAW,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAA;IACxB,CAAC;CACF"}
|
|
@@ -22,7 +22,7 @@ export const GenericStoreProvider = ({ children, store }) => {
|
|
|
22
22
|
return () => store.unmount();
|
|
23
23
|
}, [store]);
|
|
24
24
|
if (store) {
|
|
25
|
-
return (React.createElement(GenericStoreContext.Provider, { value: store }, store.state?.
|
|
25
|
+
return (React.createElement(GenericStoreContext.Provider, { value: store }, store.state?.doc ? children : React.createElement("p", null, "Project was not found")));
|
|
26
26
|
}
|
|
27
27
|
return null;
|
|
28
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreContext.js","sourceRoot":"","sources":["../../../src/store/StoreContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEnE,OAAO,EAAE,YAAY,EAA2B,MAAM,GAAG,CAAA;AAEzD,MAAM,mBAAmB,GAAG,aAAa,CAAe,IAAI,YAAY,EAAE,CAAC,CAAA;AAE3E,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,OAAkC,EAAE,EAAE;IACtE,MAAM,KAAK,GAAG,IAAI,YAAY,EAAE,CAAA;IAChC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACzB,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAOD,MAAM,CAAC,MAAM,oBAAoB,GAAoB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAA;IAC9B,CAAC,EAAE,CAAC,KAAK,CAAC,CA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18,9 @@ export const useStore = (selector) => {
|
|
|
18
18
|
const state = useSyncExternalStoreWithSelector(store.subscribe, () => store.getState(), undefined, init, deeperEqual);
|
|
19
19
|
return [state, store.dispatchAction, store.getState, store.subscribe];
|
|
20
20
|
};
|
|
21
|
+
// Allows to get store's state on demand rather than subscribing to it
|
|
22
|
+
export const useGetState = () => {
|
|
23
|
+
const store = useGenericStore();
|
|
24
|
+
return store.getState;
|
|
25
|
+
};
|
|
21
26
|
//# sourceMappingURL=useStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStore.js","sourceRoot":"","sources":["../../../src/store/useStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAA;AAExF,OAAO,WAAW,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIhD,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,QAAsB,EACiC,EAAE;IACzD,MAAM,KAAK,GAAG,eAAe,EAAE,CAAA;IAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAA;IACxE,MAAM,KAAK,GAAG,gCAAgC,CAC5C,KAAK,CAAC,SAAS,EACf,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,EACtB,SAAS,EACT,IAAI,EACJ,WAAW,CACZ,CAAA;IAED,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;AACvE,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"useStore.js","sourceRoot":"","sources":["../../../src/store/useStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAA;AAExF,OAAO,WAAW,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIhD,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,QAAsB,EACiC,EAAE;IACzD,MAAM,KAAK,GAAG,eAAe,EAAE,CAAA;IAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAA;IACxE,MAAM,KAAK,GAAG,gCAAgC,CAC5C,KAAK,CAAC,SAAS,EACf,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,EACtB,SAAS,EACT,IAAI,EACJ,WAAW,CACZ,CAAA;IAED,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;AACvE,CAAC,CAAA;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,KAAK,GAAG,eAAe,EAAE,CAAA;IAC/B,OAAO,KAAK,CAAC,QAAQ,CAAA;AACvB,CAAC,CAAA"}
|
|
@@ -9,11 +9,9 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import { Project } from '@manuscripts/json-schema';
|
|
13
12
|
import React from 'react';
|
|
14
13
|
export declare const Main: import("styled-components").StyledComponent<"main", import("styled-components").DefaultTheme, {}, never>;
|
|
15
14
|
export declare const Centered: import("styled-components").StyledComponent<"main", import("styled-components").DefaultTheme, {}, never>;
|
|
16
|
-
export declare const Page: React.
|
|
15
|
+
export declare const Page: React.FC<{
|
|
17
16
|
children: React.ReactNode;
|
|
18
|
-
project?: Project;
|
|
19
17
|
}>;
|
|
@@ -1,22 +1,8 @@
|
|
|
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 { Section } from '@manuscripts/json-schema';
|
|
13
1
|
import { SectionNode } from '@manuscripts/transform';
|
|
14
2
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
15
3
|
import React from 'react';
|
|
16
4
|
export declare const SectionInspector: React.FC<{
|
|
17
5
|
dispatchNodeAttrs: (id: string, attrs: Record<string, unknown>, nodispatch?: boolean) => Transaction | undefined;
|
|
18
|
-
section:
|
|
19
|
-
sectionNode?: SectionNode;
|
|
6
|
+
section: SectionNode;
|
|
20
7
|
state: EditorState;
|
|
21
|
-
dispatch: (tr: Transaction) => EditorState | void;
|
|
22
8
|
}>;
|
|
@@ -1,18 +1,3 @@
|
|
|
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) 2021 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { useEditor } from '@manuscripts/body-editor';
|
|
13
1
|
import React from 'react';
|
|
14
|
-
|
|
15
|
-
editor: ReturnType<typeof useEditor>;
|
|
16
|
-
}
|
|
17
|
-
declare const EditorElement: React.FC<Props>;
|
|
2
|
+
declare const EditorElement: React.FC;
|
|
18
3
|
export default EditorElement;
|
|
@@ -10,9 +10,5 @@
|
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2023 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
-
|
|
14
|
-
interface Props {
|
|
15
|
-
editor: ReturnType<typeof useCreateEditor>;
|
|
16
|
-
}
|
|
17
|
-
declare const Inspector: React.FC<Props>;
|
|
13
|
+
declare const Inspector: React.FC;
|
|
18
14
|
export default Inspector;
|
|
@@ -9,10 +9,5 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import { useEditor } from '@manuscripts/body-editor';
|
|
13
12
|
import React from 'react';
|
|
14
|
-
|
|
15
|
-
editor: ReturnType<typeof useEditor>;
|
|
16
|
-
}
|
|
17
|
-
export declare const ManuscriptMenus: React.FC<ApplicationMenusProps>;
|
|
18
|
-
export {};
|
|
13
|
+
export declare const ManuscriptMenus: React.FC;
|
|
@@ -14,7 +14,7 @@ import '@manuscripts/body-editor/styles/AdvancedEditor.css';
|
|
|
14
14
|
import '@manuscripts/body-editor/styles/popper.css';
|
|
15
15
|
import '@reach/tabs/styles.css';
|
|
16
16
|
import React from 'react';
|
|
17
|
+
declare const ManuscriptPageContainer: React.FC;
|
|
17
18
|
export declare const ManuscriptMenusContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
19
|
export declare const ManuscriptMenusContainerInner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
-
declare const ManuscriptPageContainer: React.FC;
|
|
20
20
|
export default ManuscriptPageContainer;
|
|
@@ -9,14 +9,6 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import { useEditor } from '@manuscripts/body-editor';
|
|
13
|
-
import { Manuscript } from '@manuscripts/json-schema';
|
|
14
|
-
import { ManuscriptEditorView } from '@manuscripts/transform';
|
|
15
12
|
import React from 'react';
|
|
16
|
-
|
|
17
|
-
state: ReturnType<typeof useEditor>['state'];
|
|
18
|
-
manuscript: Manuscript;
|
|
19
|
-
view?: ManuscriptEditorView;
|
|
20
|
-
}
|
|
21
|
-
declare const ManuscriptSidebar: React.FC<Props>;
|
|
13
|
+
declare const ManuscriptSidebar: React.FC;
|
|
22
14
|
export default ManuscriptSidebar;
|
|
@@ -9,14 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import { ManuscriptEditorState, ManuscriptEditorView } from '@manuscripts/transform';
|
|
13
|
-
import { Transaction } from 'prosemirror-state';
|
|
14
12
|
import React from 'react';
|
|
15
13
|
export declare const ToolbarItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
16
14
|
export declare const ToolbarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
17
15
|
export declare const ToolbarGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
|
-
export declare const ManuscriptToolbar: React.FC
|
|
19
|
-
state: ManuscriptEditorState;
|
|
20
|
-
dispatch: (tr: Transaction) => void;
|
|
21
|
-
view?: ManuscriptEditorView;
|
|
22
|
-
}>;
|
|
16
|
+
export declare const ManuscriptToolbar: React.FC;
|
|
@@ -21,6 +21,6 @@ export interface SuggestionListProps {
|
|
|
21
21
|
onReject(change: TrackedChange): void;
|
|
22
22
|
onReset(change: TrackedChange): void;
|
|
23
23
|
onAcceptAll?(): void;
|
|
24
|
-
onSelect(change: TrackedChange): void;
|
|
24
|
+
onSelect?(change: TrackedChange): void;
|
|
25
25
|
}
|
|
26
26
|
export declare const SuggestionList: React.FC<SuggestionListProps>;
|
|
@@ -9,5 +9,9 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
import { CHANGE_STATUS, TrackedChange } from '@manuscripts/track-changes-plugin';
|
|
13
|
+
import { Command } from 'prosemirror-state';
|
|
14
|
+
import { EditorView } from 'prosemirror-view';
|
|
15
|
+
import { state } from '../../store';
|
|
16
|
+
export declare const setSelectedSuggestion: (suggestion: TrackedChange, getState: () => state) => void;
|
|
17
|
+
export declare const setChangeStatus: (change: TrackedChange, status: CHANGE_STATUS, execCmd: (cmd: Command, hookView?: EditorView) => void) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const useConnectEditor: () => {
|
|
2
|
+
state: import("prosemirror-state").EditorState;
|
|
3
|
+
onRender: (el: HTMLDivElement | null) => void;
|
|
4
|
+
isCommandValid: (command: import("prosemirror-state").Command) => boolean;
|
|
5
|
+
doCommand: (command: import("prosemirror-state").Command) => boolean;
|
|
6
|
+
replaceState: (state: import("prosemirror-state").EditorState) => void;
|
|
7
|
+
view: import("prosemirror-view").EditorView | undefined;
|
|
8
|
+
dispatch: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").EditorState;
|
|
9
|
+
};
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2023 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
12
|
import { FileAttachment } from '@manuscripts/body-editor';
|
|
13
|
-
import { Affiliation, BibliographyItem, Footnote } from '@manuscripts/json-schema';
|
|
14
13
|
import { NodeAttrChange } from '@manuscripts/track-changes-plugin';
|
|
15
|
-
import { ManuscriptNode } from '@manuscripts/transform';
|
|
14
|
+
import { AffiliationNode, BibliographyItemNode, FootnoteNode, ManuscriptNode } from '@manuscripts/transform';
|
|
16
15
|
/**
|
|
17
16
|
* Filter PN node attributes to show for comparing them with old change
|
|
18
17
|
* @param attrsChange
|
|
19
18
|
*/
|
|
20
|
-
export declare const filterAttrsChange: (modelOfChange: ManuscriptNode, attrsChange: NodeAttrChange, files: FileAttachment[], affiliations:
|
|
19
|
+
export declare const filterAttrsChange: (modelOfChange: ManuscriptNode, attrsChange: NodeAttrChange, files: FileAttachment[], affiliations: AffiliationNode[], references: BibliographyItemNode[], footnotes: FootnoteNode[]) => {
|
|
21
20
|
newAttrs: Record<string, {
|
|
22
21
|
label: string;
|
|
23
22
|
value: string;
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
declare const deeperEqual: (
|
|
12
|
+
declare const deeperEqual: (next: any, prev: any) => boolean;
|
|
13
13
|
export default deeperEqual;
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2020 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
import { ManuscriptNode } from '@manuscripts/transform';
|
|
12
|
+
import { SectionCategory } from '@manuscripts/json-schema';
|
|
13
|
+
import { ManuscriptNode, SectionNode } from '@manuscripts/transform';
|
|
14
14
|
export declare const uneditableSectionCategories: string[];
|
|
15
15
|
export declare const uniqueSectionCategories: string[];
|
|
16
16
|
export declare const isEditableSectionCategoryID: (id: string) => boolean;
|
|
17
17
|
export declare const isEditableSectionCategory: (sectionCategory: SectionCategory) => boolean;
|
|
18
18
|
export declare const sortSectionCategories: (sectionCategories: SectionCategory[]) => SectionCategory[];
|
|
19
|
-
export declare const chooseSectionCategory: (section:
|
|
19
|
+
export declare const chooseSectionCategory: (section: SectionNode, isSubSection?: boolean) => string;
|
|
20
20
|
export declare const isUnique: (categoryId: string) => boolean;
|
|
21
21
|
export declare const isUniqueCurrent: (categoryId: string, currentCategoryId: string) => boolean;
|
|
22
22
|
export declare const isUniquePresent: (cat: SectionCategory, existingCats: {
|
|
23
23
|
[key: string]: number;
|
|
24
24
|
}) => boolean;
|
|
25
25
|
export declare const isBackMatterSection: (groupId: string) => boolean;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const backMatterSectionCategoryExist: (parent: ManuscriptNode, category: string) => boolean;
|
|
@@ -19,7 +19,7 @@ export default class PsSource implements StoreDataSourceStrategy {
|
|
|
19
19
|
utilities: Partial<state>;
|
|
20
20
|
files: FileAttachment[];
|
|
21
21
|
constructor(files: FileAttachment[]);
|
|
22
|
-
updateState:
|
|
22
|
+
updateState: stateSetter;
|
|
23
23
|
build: builderFn;
|
|
24
24
|
afterAction: (state: state) => void;
|
|
25
25
|
updateStore: (setState: stateSetter) => void;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { ManuscriptNode } from '@manuscripts/transform';
|
|
1
2
|
import Api from './Api';
|
|
2
|
-
export declare const buildData: (projectID: string, manuscriptID: string, api: Api) => Promise<{}>;
|
|
3
|
+
export declare const buildData: (projectID: string, manuscriptID: string, doc: ManuscriptNode, api: Api) => Promise<{}>;
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2022 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
12
|
import { ManuscriptNode } from '@manuscripts/transform';
|
|
13
|
-
import { SnapshotLabel } from '
|
|
14
|
-
export declare
|
|
13
|
+
import { SnapshotLabel } from '../types';
|
|
14
|
+
export declare function loadDoc(manuscriptID: string, projectID: string, authToken: string, existingDoc?: ManuscriptNode): Promise<{
|
|
15
15
|
doc: import("prosemirror-model").Node;
|
|
16
16
|
version: number;
|
|
17
17
|
snapshots: SnapshotLabel[];
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { FileAttachment, FileManagement } from '@manuscripts/body-editor';
|
|
13
13
|
import { builderFn, GenericStore, state } from '.';
|
|
14
|
-
export type stateSetter = (
|
|
14
|
+
export type stateSetter = (set: Partial<state> | ((state: state) => state)) => void;
|
|
15
15
|
export interface StoreDataSourceStrategy {
|
|
16
16
|
build: builderFn;
|
|
17
17
|
unmount?: () => void;
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
11
|
*/
|
|
12
12
|
import { CommentKey, FileAttachment, FileManagement } from '@manuscripts/body-editor';
|
|
13
|
-
import { Manuscript,
|
|
13
|
+
import { Manuscript, Project, SectionCategory, UserProfile } from '@manuscripts/json-schema';
|
|
14
14
|
import { TrackChangesState } from '@manuscripts/track-changes-plugin';
|
|
15
|
-
import {
|
|
15
|
+
import { ManuscriptEditorView, ManuscriptNode } from '@manuscripts/transform';
|
|
16
16
|
import { useCreateEditor } from '../hooks/use-create-editor';
|
|
17
|
+
import { ProjectRole } from '../lib/roles';
|
|
17
18
|
import { ManuscriptSnapshot, SnapshotLabel } from '../quarterback/types';
|
|
18
19
|
import { StoreDataSourceStrategy } from '.';
|
|
19
20
|
import { TokenData } from './TokenData';
|
|
@@ -26,33 +27,26 @@ export interface ContainerIDs {
|
|
|
26
27
|
manuscriptID?: string;
|
|
27
28
|
templateID?: string;
|
|
28
29
|
}
|
|
30
|
+
export type PMEditor = ReturnType<typeof useCreateEditor>;
|
|
29
31
|
export type state = {
|
|
30
|
-
[key: string]: any;
|
|
31
32
|
manuscriptID: string;
|
|
32
33
|
projectID: string;
|
|
33
34
|
userID?: string;
|
|
34
|
-
project: Project;
|
|
35
35
|
manuscript: Manuscript;
|
|
36
|
+
refreshProject: () => Promise<void>;
|
|
37
|
+
project: Project;
|
|
36
38
|
user: UserProfile;
|
|
37
|
-
editor:
|
|
39
|
+
editor: PMEditor;
|
|
38
40
|
doc: ManuscriptNode;
|
|
41
|
+
trackState?: TrackChangesState;
|
|
42
|
+
view: ManuscriptEditorView;
|
|
39
43
|
initialDocVersion: number;
|
|
40
|
-
modelMap: Map<string, Model>;
|
|
41
|
-
saveModel: <T extends Model>(model: T | Build<T> | Partial<T>) => Promise<T>;
|
|
42
|
-
deleteModel: (id: string) => Promise<string>;
|
|
43
|
-
saveModels: (models: Model[]) => Promise<void>;
|
|
44
|
-
saveManuscript: (data: Partial<Manuscript>) => Promise<void>;
|
|
45
|
-
saveTrackModel: <T extends Model>(model: T | Build<T> | Partial<T>) => Promise<T>;
|
|
46
|
-
trackModelMap: Map<string, Model>;
|
|
47
|
-
deleteTrackModel: (id: string) => Promise<string>;
|
|
48
44
|
fileManagement: FileManagement;
|
|
49
45
|
files: FileAttachment[];
|
|
50
46
|
authToken: string;
|
|
51
47
|
tokenData: TokenData;
|
|
52
48
|
collaborators: Map<string, UserProfile>;
|
|
53
49
|
collaboratorsById: Map<string, UserProfile>;
|
|
54
|
-
trackState?: TrackChangesState;
|
|
55
|
-
view: ManuscriptEditorView;
|
|
56
50
|
snapshots: SnapshotLabel[];
|
|
57
51
|
snapshotsMap: Map<string, ManuscriptSnapshot>;
|
|
58
52
|
createSnapshot: () => Promise<void>;
|
|
@@ -65,9 +59,14 @@ export type state = {
|
|
|
65
59
|
savingProcess?: 'saved' | 'saving' | 'offline' | 'failed';
|
|
66
60
|
preventUnload?: boolean;
|
|
67
61
|
beforeUnload?: () => void;
|
|
62
|
+
userRole: ProjectRole | null;
|
|
63
|
+
handleSnapshot: () => Promise<void>;
|
|
68
64
|
cslLocale?: string;
|
|
69
65
|
cslStyle?: string;
|
|
66
|
+
hasPendingSuggestions?: boolean;
|
|
70
67
|
sectionCategories: SectionCategory[];
|
|
68
|
+
saveDoc: (doc: ManuscriptNode) => Promise<void>;
|
|
69
|
+
originalPmDoc?: JSON;
|
|
71
70
|
};
|
|
72
71
|
export type reducer = (payload: any, store: state, action?: string) => state;
|
|
73
72
|
export type dispatch = (action: action) => void;
|