@manuscripts/article-editor 3.1.3 → 3.1.6-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.
Files changed (163) hide show
  1. package/dist/cjs/EditorApp.js +4 -7
  2. package/dist/cjs/EditorApp.js.map +1 -1
  3. package/dist/cjs/components/Page.js +1 -2
  4. package/dist/cjs/components/Page.js.map +1 -1
  5. package/dist/cjs/components/inspector/SectionInspector.js +43 -18
  6. package/dist/cjs/components/inspector/SectionInspector.js.map +1 -1
  7. package/dist/cjs/components/projects/CategoryInput.js +1 -1
  8. package/dist/cjs/components/projects/CategoryInput.js.map +1 -1
  9. package/dist/cjs/components/projects/ContentTab.js +35 -16
  10. package/dist/cjs/components/projects/ContentTab.js.map +1 -1
  11. package/dist/cjs/components/projects/EditorElement.js +5 -3
  12. package/dist/cjs/components/projects/EditorElement.js.map +1 -1
  13. package/dist/cjs/components/projects/Inspector.js +2 -8
  14. package/dist/cjs/components/projects/Inspector.js.map +1 -1
  15. package/dist/cjs/components/projects/ManuscriptMenus.js +9 -2
  16. package/dist/cjs/components/projects/ManuscriptMenus.js.map +1 -1
  17. package/dist/cjs/components/projects/ManuscriptPageContainer.js +22 -118
  18. package/dist/cjs/components/projects/ManuscriptPageContainer.js.map +1 -1
  19. package/dist/cjs/components/projects/ManuscriptSidebar.js +8 -2
  20. package/dist/cjs/components/projects/ManuscriptSidebar.js.map +1 -1
  21. package/dist/cjs/components/projects/ManuscriptToolbar.js +9 -1
  22. package/dist/cjs/components/projects/ManuscriptToolbar.js.map +1 -1
  23. package/dist/cjs/components/track-changes/TrackChangesPanel.js +27 -41
  24. package/dist/cjs/components/track-changes/TrackChangesPanel.js.map +1 -1
  25. package/dist/cjs/components/track-changes/TrackModal.js +20 -8
  26. package/dist/cjs/components/track-changes/TrackModal.js.map +1 -1
  27. package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js +3 -1
  28. package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
  29. package/dist/cjs/components/track-changes/suggestion-list/SuggestionList.js +1 -1
  30. package/dist/cjs/components/track-changes/suggestion-list/SuggestionList.js.map +1 -1
  31. package/dist/cjs/components/track-changes/utils.js +28 -5
  32. package/dist/cjs/components/track-changes/utils.js.map +1 -1
  33. package/dist/cjs/hooks/use-connect-editor.js +74 -0
  34. package/dist/cjs/hooks/use-connect-editor.js.map +1 -0
  35. package/dist/cjs/hooks/use-create-editor.js +7 -4
  36. package/dist/cjs/hooks/use-create-editor.js.map +1 -1
  37. package/dist/cjs/hooks/use-exec-cmd.js +6 -4
  38. package/dist/cjs/hooks/use-exec-cmd.js.map +1 -1
  39. package/dist/cjs/lib/attrs-change-filter.js +7 -7
  40. package/dist/cjs/lib/attrs-change-filter.js.map +1 -1
  41. package/dist/cjs/lib/deeper-equal.js +19 -17
  42. package/dist/cjs/lib/deeper-equal.js.map +1 -1
  43. package/dist/cjs/lib/section-categories.js +9 -9
  44. package/dist/cjs/lib/section-categories.js.map +1 -1
  45. package/dist/cjs/postgres-data/PsSource.js +19 -2
  46. package/dist/cjs/postgres-data/PsSource.js.map +1 -1
  47. package/dist/cjs/postgres-data/buildData.js +11 -27
  48. package/dist/cjs/postgres-data/buildData.js.map +1 -1
  49. package/dist/cjs/postgres-data/buildUtilities.js +0 -53
  50. package/dist/cjs/postgres-data/buildUtilities.js.map +1 -1
  51. package/dist/cjs/quarterback/api/loadDoc.js +108 -0
  52. package/dist/cjs/quarterback/api/loadDoc.js.map +1 -0
  53. package/dist/cjs/store/Store.js.map +1 -1
  54. package/dist/cjs/store/StoreContext.js +1 -1
  55. package/dist/cjs/store/StoreContext.js.map +1 -1
  56. package/dist/cjs/store/useStore.js +7 -1
  57. package/dist/cjs/store/useStore.js.map +1 -1
  58. package/dist/es/EditorApp.js +4 -7
  59. package/dist/es/EditorApp.js.map +1 -1
  60. package/dist/es/components/Page.js +1 -2
  61. package/dist/es/components/Page.js.map +1 -1
  62. package/dist/es/components/inspector/SectionInspector.js +43 -18
  63. package/dist/es/components/inspector/SectionInspector.js.map +1 -1
  64. package/dist/es/components/projects/CategoryInput.js +2 -2
  65. package/dist/es/components/projects/CategoryInput.js.map +1 -1
  66. package/dist/es/components/projects/ContentTab.js +13 -14
  67. package/dist/es/components/projects/ContentTab.js.map +1 -1
  68. package/dist/es/components/projects/EditorElement.js +5 -3
  69. package/dist/es/components/projects/EditorElement.js.map +1 -1
  70. package/dist/es/components/projects/Inspector.js +2 -8
  71. package/dist/es/components/projects/Inspector.js.map +1 -1
  72. package/dist/es/components/projects/ManuscriptMenus.js +9 -2
  73. package/dist/es/components/projects/ManuscriptMenus.js.map +1 -1
  74. package/dist/es/components/projects/ManuscriptPageContainer.js +22 -95
  75. package/dist/es/components/projects/ManuscriptPageContainer.js.map +1 -1
  76. package/dist/es/components/projects/ManuscriptSidebar.js +8 -2
  77. package/dist/es/components/projects/ManuscriptSidebar.js.map +1 -1
  78. package/dist/es/components/projects/ManuscriptToolbar.js +9 -1
  79. package/dist/es/components/projects/ManuscriptToolbar.js.map +1 -1
  80. package/dist/es/components/track-changes/TrackChangesPanel.js +28 -42
  81. package/dist/es/components/track-changes/TrackChangesPanel.js.map +1 -1
  82. package/dist/es/components/track-changes/TrackModal.js +21 -9
  83. package/dist/es/components/track-changes/TrackModal.js.map +1 -1
  84. package/dist/es/components/track-changes/suggestion-list/Suggestion.js +3 -1
  85. package/dist/es/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
  86. package/dist/es/components/track-changes/suggestion-list/SuggestionList.js +1 -1
  87. package/dist/es/components/track-changes/suggestion-list/SuggestionList.js.map +1 -1
  88. package/dist/es/components/track-changes/utils.js +25 -3
  89. package/dist/es/components/track-changes/utils.js.map +1 -1
  90. package/dist/es/hooks/use-connect-editor.js +70 -0
  91. package/dist/es/hooks/use-connect-editor.js.map +1 -0
  92. package/dist/es/hooks/use-create-editor.js +7 -4
  93. package/dist/es/hooks/use-create-editor.js.map +1 -1
  94. package/dist/es/hooks/use-exec-cmd.js +7 -5
  95. package/dist/es/hooks/use-exec-cmd.js.map +1 -1
  96. package/dist/es/lib/attrs-change-filter.js +7 -7
  97. package/dist/es/lib/attrs-change-filter.js.map +1 -1
  98. package/dist/es/lib/deeper-equal.js +19 -17
  99. package/dist/es/lib/deeper-equal.js.map +1 -1
  100. package/dist/es/lib/section-categories.js +7 -7
  101. package/dist/es/lib/section-categories.js.map +1 -1
  102. package/dist/es/postgres-data/PsSource.js +19 -2
  103. package/dist/es/postgres-data/PsSource.js.map +1 -1
  104. package/dist/es/postgres-data/buildData.js +12 -28
  105. package/dist/es/postgres-data/buildData.js.map +1 -1
  106. package/dist/es/postgres-data/buildUtilities.js +1 -54
  107. package/dist/es/postgres-data/buildUtilities.js.map +1 -1
  108. package/dist/es/quarterback/api/loadDoc.js +81 -0
  109. package/dist/es/quarterback/api/loadDoc.js.map +1 -0
  110. package/dist/es/store/Store.js.map +1 -1
  111. package/dist/es/store/StoreContext.js +1 -1
  112. package/dist/es/store/StoreContext.js.map +1 -1
  113. package/dist/es/store/useStore.js +5 -0
  114. package/dist/es/store/useStore.js.map +1 -1
  115. package/dist/types/components/Page.d.ts +1 -3
  116. package/dist/types/components/inspector/SectionInspector.d.ts +1 -15
  117. package/dist/types/components/projects/ContentTab.d.ts +1 -5
  118. package/dist/types/components/projects/EditorElement.d.ts +1 -16
  119. package/dist/types/components/projects/Inspector.d.ts +1 -5
  120. package/dist/types/components/projects/ManuscriptMenus.d.ts +1 -6
  121. package/dist/types/components/projects/ManuscriptPageContainer.d.ts +1 -1
  122. package/dist/types/components/projects/ManuscriptSidebar.d.ts +1 -9
  123. package/dist/types/components/projects/ManuscriptToolbar.d.ts +1 -7
  124. package/dist/types/components/track-changes/suggestion-list/SuggestionList.d.ts +1 -1
  125. package/dist/types/components/track-changes/utils.d.ts +6 -2
  126. package/dist/types/hooks/use-connect-editor.d.ts +9 -0
  127. package/dist/types/lib/attrs-change-filter.d.ts +2 -3
  128. package/dist/types/lib/deeper-equal.d.ts +1 -1
  129. package/dist/types/lib/section-categories.d.ts +4 -4
  130. package/dist/types/postgres-data/buildData.d.ts +2 -1
  131. package/dist/{cjs/components/inspector/StyleFields.js → types/quarterback/api/loadDoc.d.ts} +8 -8
  132. package/dist/types/store/Store.d.ts +6 -14
  133. package/dist/types/store/useStore.d.ts +1 -0
  134. package/package.json +3 -3
  135. package/dist/cjs/components/inspector/StyleFields.js.map +0 -1
  136. package/dist/cjs/lib/sort.js +0 -17
  137. package/dist/cjs/lib/sort.js.map +0 -1
  138. package/dist/cjs/quarterback/QuarterBackDataSource.js +0 -29
  139. package/dist/cjs/quarterback/QuarterBackDataSource.js.map +0 -1
  140. package/dist/cjs/tracked-models/adapt-tracked-data.js +0 -100
  141. package/dist/cjs/tracked-models/adapt-tracked-data.js.map +0 -1
  142. package/dist/cjs/tracked-models/creators.js +0 -129
  143. package/dist/cjs/tracked-models/creators.js.map +0 -1
  144. package/dist/cjs/tracked-models/use-tracked-model-management.js +0 -129
  145. package/dist/cjs/tracked-models/use-tracked-model-management.js.map +0 -1
  146. package/dist/es/components/inspector/StyleFields.js +0 -14
  147. package/dist/es/components/inspector/StyleFields.js.map +0 -1
  148. package/dist/es/lib/sort.js +0 -13
  149. package/dist/es/lib/sort.js.map +0 -1
  150. package/dist/es/quarterback/QuarterBackDataSource.js +0 -26
  151. package/dist/es/quarterback/QuarterBackDataSource.js.map +0 -1
  152. package/dist/es/tracked-models/adapt-tracked-data.js +0 -95
  153. package/dist/es/tracked-models/adapt-tracked-data.js.map +0 -1
  154. package/dist/es/tracked-models/creators.js +0 -120
  155. package/dist/es/tracked-models/creators.js.map +0 -1
  156. package/dist/es/tracked-models/use-tracked-model-management.js +0 -127
  157. package/dist/es/tracked-models/use-tracked-model-management.js.map +0 -1
  158. package/dist/types/components/inspector/StyleFields.d.ts +0 -14
  159. package/dist/types/lib/sort.d.ts +0 -17
  160. package/dist/types/quarterback/QuarterBackDataSource.d.ts +0 -23
  161. package/dist/types/tracked-models/adapt-tracked-data.d.ts +0 -13
  162. package/dist/types/tracked-models/creators.d.ts +0 -21
  163. package/dist/types/tracked-models/use-tracked-model-management.d.ts +0 -21
@@ -1,120 +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 { clearCommentSelection } from '@manuscripts/body-editor';
13
- import { skipTracking } from '@manuscripts/track-changes-plugin';
14
- import { schema } from '@manuscripts/transform';
15
- export const createContributorNode = (model, view, doc, state) => {
16
- const { tr } = state;
17
- doc.descendants((node, pos) => {
18
- if (node.type === schema.nodes.contributors) {
19
- tr.insert(pos + 1, schema.nodes.contributor.create({
20
- ...model,
21
- id: model._id,
22
- }, schema.text('_')
23
- /*
24
- quarterback as it is now works incorrectly with empty nodes and updating attributes on them is misinterpreted as deletion.
25
- We either need to update quarterback to work correctly with empty nodes attributes or provide some content for these nodes or
26
- implement a mechanism that would detect attributes updates on empty nodes and setMeta as we do for metaNodes
27
- */
28
- ));
29
- view.dispatch(tr);
30
- return false;
31
- }
32
- });
33
- };
34
- export const createAffiliationNode = (model, view, doc, state) => {
35
- const { tr } = state;
36
- doc.descendants((node, pos) => {
37
- if (node.type === schema.nodes.affiliations) {
38
- tr.insert(pos + node.nodeSize - 1, schema.nodes.affiliation.create({
39
- ...model,
40
- id: model._id,
41
- }, schema.text('_')));
42
- view.dispatch(tr);
43
- return false;
44
- }
45
- });
46
- };
47
- export const saveComment = (comment, view, doc, state, modelMap) => {
48
- const documentComment = {
49
- id: comment._id,
50
- contents: comment.contents,
51
- target: comment.target,
52
- selector: comment.selector,
53
- contributions: comment.contributions,
54
- resolved: comment.resolved,
55
- originalText: comment.originalText,
56
- };
57
- const isNewComment = !modelMap.has(comment._id);
58
- const { tr } = state;
59
- doc.descendants((node, pos) => {
60
- if (isNewComment) {
61
- /** for new comments will add comment node to the comment list node
62
- * */
63
- if (node.type === schema.nodes.comments) {
64
- skipTracking(tr.replaceWith(pos, pos + node.nodeSize, node.content.addToEnd(schema.nodes.comment.create(documentComment))));
65
- return false;
66
- }
67
- }
68
- else {
69
- if (node.attrs.id === comment._id && node.type === schema.nodes.comment) {
70
- skipTracking(tr.setNodeMarkup(pos, undefined, {
71
- ...documentComment,
72
- }));
73
- return false;
74
- }
75
- }
76
- });
77
- clearCommentSelection(tr);
78
- view.dispatch(tr);
79
- return Promise.resolve(comment);
80
- };
81
- export const deleteComment = (comment, view, doc, state) => {
82
- const { tr } = state;
83
- doc.descendants((node, pos) => {
84
- if (node.attrs.id === comment._id && node.type === schema.nodes.comment) {
85
- tr.delete(pos, pos + node.nodeSize);
86
- tr.setMeta('track-changes-skip-tracking', true);
87
- clearCommentSelection(tr);
88
- view.dispatch(tr);
89
- return false;
90
- }
91
- });
92
- return Promise.resolve(comment._id);
93
- };
94
- export const createSupplementNode = (view, supplement) => {
95
- view.state.doc.descendants((node, pos) => {
96
- if (node.type === schema.nodes.supplements) {
97
- view.dispatch(view.state.tr.insert(pos + node.nodeSize - 1, schema.nodes.supplement.create({
98
- id: supplement._id,
99
- href: supplement.href,
100
- mimeType: supplement.MIME?.split('/')[0],
101
- mimeSubType: supplement.MIME?.split('/')[1],
102
- title: supplement.title,
103
- })));
104
- return false;
105
- }
106
- });
107
- return Promise.resolve(supplement);
108
- };
109
- export const deleteSupplementNode = (view, supplement) => {
110
- const tr = view.state.tr;
111
- tr.doc.descendants((node, pos) => {
112
- if (node.type === schema.nodes.supplement &&
113
- supplement._id === node.attrs.id) {
114
- tr.delete(pos, pos + node.nodeSize);
115
- }
116
- });
117
- view.dispatch(tr);
118
- return Promise.resolve(supplement);
119
- };
120
- //# sourceMappingURL=creators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"creators.js","sourceRoot":"","sources":["../../../src/tracked-models/creators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAQhE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAK/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,KAA2B,EAC3B,IAAgB,EAChB,GAAoB,EACpB,KAAkB,EAClB,EAAE;IACF,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAA;IACpB,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAC5B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE;YAC3C,EAAE,CAAC,MAAM,CACP,GAAG,GAAG,CAAC,EACP,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAC7B;gBACE,GAAG,KAAK;gBACR,EAAE,EAAE,KAAK,CAAC,GAAG;aACd,EACD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;YAChB;;;;gBAII;aACL,CACF,CAAA;YACD,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;YACjB,OAAO,KAAK,CAAA;SACb;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,KAA2B,EAC3B,IAAgB,EAChB,GAAoB,EACpB,KAAkB,EAClB,E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B,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAC/B,IACE,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,UAAU;YACrC,UAAU,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,EAAE,EAChC;YACA,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;SACpC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEjB,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;AACpC,CAAC,CAAA"}
@@ -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.js","sourceRoot":"","sources":["../../../src/tracked-models/use-tracked-model-management.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAKL,WAAW,GAEZ,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAEL,OAAO,EACP,MAAM,EAGN,MAAM,GACP,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;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,CAAC,EAAE,CAAC,EAAE;YACpB,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;gBAC5B,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE;oBACxB,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAA;oBACpB,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;oBACnC,QAAQ,CAAC,EAAE,CAAC,CAAA;iBACb;YACH,CAAC,CAAC,CAAA;SACH;aAAM;YACL,WAAW,CAAC,EAAE,CAAC,CAAA;SAChB;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC5B,CAAC;IACD,uDAAuD;IACvD;QACE,QAAQ;QACR,iBAAiB;QACjB,GAAG;QACH,IAAI;QACJ,KAAK;QACL,QAAQ;QACR,aAAa;QACb,WAAW;KACZ,CACF,CAAA;IAED,MAAM,aAAa,GAAG,WAAW,CAC/B,CAAC,EAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAChC,CAAC,QAAQ,CAAC,CACX,CAAA;IAED,OAAO;QACL,cAAc;QACd,gBAAgB;QAChB,aAAa,EAAE,QAAQ;QACvB,aAAa;KACd,CAAA;AACH,CAAC,CAAA;AAED,eAAe,yBAAyB,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;
@@ -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;