@manuscripts/article-editor 1.13.26 → 1.13.27-LEAN-3304.0

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 (55) hide show
  1. package/dist/cjs/components/projects/CommentList.js +4 -4
  2. package/dist/cjs/components/projects/CommentList.js.map +1 -1
  3. package/dist/cjs/components/projects/CommentsTab.js +1 -1
  4. package/dist/cjs/components/projects/CommentsTab.js.map +1 -1
  5. package/dist/cjs/hooks/use-create-editor.js +1 -4
  6. package/dist/cjs/hooks/use-create-editor.js.map +1 -1
  7. package/dist/cjs/hooks/use-handle-snapshot.js +25 -45
  8. package/dist/cjs/hooks/use-handle-snapshot.js.map +1 -1
  9. package/dist/cjs/postgres-data/Api.js +4 -24
  10. package/dist/cjs/postgres-data/Api.js.map +1 -1
  11. package/dist/cjs/postgres-data/PsSource.js +5 -43
  12. package/dist/cjs/postgres-data/PsSource.js.map +1 -1
  13. package/dist/cjs/postgres-data/buildData.js +34 -159
  14. package/dist/cjs/postgres-data/buildData.js.map +1 -1
  15. package/dist/cjs/postgres-data/buildUtilities.js +84 -229
  16. package/dist/cjs/postgres-data/buildUtilities.js.map +1 -1
  17. package/dist/cjs/postgres-data/savingUtilities.js +2 -21
  18. package/dist/cjs/postgres-data/savingUtilities.js.map +1 -1
  19. package/dist/cjs/quarterback/api/methods.js.map +1 -1
  20. package/dist/cjs/store/Store.js.map +1 -1
  21. package/dist/es/components/projects/CommentList.js +4 -4
  22. package/dist/es/components/projects/CommentList.js.map +1 -1
  23. package/dist/es/components/projects/CommentsTab.js +1 -1
  24. package/dist/es/components/projects/CommentsTab.js.map +1 -1
  25. package/dist/es/hooks/use-create-editor.js +1 -4
  26. package/dist/es/hooks/use-create-editor.js.map +1 -1
  27. package/dist/es/hooks/use-handle-snapshot.js +25 -45
  28. package/dist/es/hooks/use-handle-snapshot.js.map +1 -1
  29. package/dist/es/postgres-data/Api.js +4 -24
  30. package/dist/es/postgres-data/Api.js.map +1 -1
  31. package/dist/es/postgres-data/PsSource.js +4 -19
  32. package/dist/es/postgres-data/PsSource.js.map +1 -1
  33. package/dist/es/postgres-data/buildData.js +34 -157
  34. package/dist/es/postgres-data/buildData.js.map +1 -1
  35. package/dist/es/postgres-data/buildUtilities.js +84 -231
  36. package/dist/es/postgres-data/buildUtilities.js.map +1 -1
  37. package/dist/es/postgres-data/savingUtilities.js +1 -19
  38. package/dist/es/postgres-data/savingUtilities.js.map +1 -1
  39. package/dist/es/quarterback/api/methods.js.map +1 -1
  40. package/dist/es/store/Store.js.map +1 -1
  41. package/dist/types/postgres-data/Api.d.ts +3 -6
  42. package/dist/types/postgres-data/PsSource.d.ts +2 -3
  43. package/dist/types/postgres-data/buildData.d.ts +1 -16
  44. package/dist/types/postgres-data/buildUtilities.d.ts +2 -30
  45. package/dist/types/postgres-data/savingUtilities.d.ts +0 -11
  46. package/dist/types/quarterback/api/document.d.ts +36 -6
  47. package/dist/types/quarterback/api/methods.d.ts +8 -1
  48. package/dist/types/store/Store.d.ts +5 -38
  49. package/dist/types/store/buildStateFromSources.d.ts +1 -1
  50. package/package.json +2 -2
  51. package/dist/cjs/lib/collaborators.js +0 -24
  52. package/dist/cjs/lib/collaborators.js.map +0 -1
  53. package/dist/es/lib/collaborators.js +0 -20
  54. package/dist/es/lib/collaborators.js.map +0 -1
  55. package/dist/types/lib/collaborators.d.ts +0 -13
@@ -1,8 +1,38 @@
1
1
  import { AppliedStepsResponse, ICreateDocRequest, IUpdateDocumentRequest, ManuscriptDocWithSnapshots, StepsPayload, StepsSinceResponse } from '../types';
2
- export declare const getDocument: (projectID: string, manuscriptID: string, authToken: string) => Promise<import("../../postgres-data/savingUtilities").Maybe<ManuscriptDocWithSnapshots>>;
3
- export declare const createDocument: (payload: ICreateDocRequest, authToken: string) => Promise<import("../../postgres-data/savingUtilities").Maybe<ManuscriptDocWithSnapshots>>;
4
- export declare const updateDocument: (projectID: string, manuscriptID: string, authToken: string, payload: IUpdateDocumentRequest) => Promise<import("../../postgres-data/savingUtilities").Maybe<boolean>>;
5
- export declare const deleteDocument: (projectID: string, manuscriptID: string, authToken: string) => Promise<import("../../postgres-data/savingUtilities").Maybe<boolean>>;
6
- export declare const applySteps: (projectId: string, docId: string, authToken: string, payload: StepsPayload) => Promise<import("../../postgres-data/savingUtilities").Maybe<AppliedStepsResponse>>;
7
- export declare const stepsSince: (projectId: string, docId: string, version: number, authToken: string) => Promise<import("../../postgres-data/savingUtilities").Maybe<StepsSinceResponse>>;
2
+ export declare const getDocument: (projectID: string, manuscriptID: string, authToken: string) => Promise<{
3
+ err: string;
4
+ code: number;
5
+ } | {
6
+ data: ManuscriptDocWithSnapshots;
7
+ }>;
8
+ export declare const createDocument: (payload: ICreateDocRequest, authToken: string) => Promise<{
9
+ err: string;
10
+ code: number;
11
+ } | {
12
+ data: ManuscriptDocWithSnapshots;
13
+ }>;
14
+ export declare const updateDocument: (projectID: string, manuscriptID: string, authToken: string, payload: IUpdateDocumentRequest) => Promise<{
15
+ err: string;
16
+ code: number;
17
+ } | {
18
+ data: boolean;
19
+ }>;
20
+ export declare const deleteDocument: (projectID: string, manuscriptID: string, authToken: string) => Promise<{
21
+ err: string;
22
+ code: number;
23
+ } | {
24
+ data: boolean;
25
+ }>;
26
+ export declare const applySteps: (projectId: string, docId: string, authToken: string, payload: StepsPayload) => Promise<{
27
+ err: string;
28
+ code: number;
29
+ } | {
30
+ data: AppliedStepsResponse;
31
+ }>;
32
+ export declare const stepsSince: (projectId: string, docId: string, version: number, authToken: string) => Promise<{
33
+ err: string;
34
+ code: number;
35
+ } | {
36
+ data: StepsSinceResponse;
37
+ }>;
8
38
  export declare const listenStepUpdates: (projectID: string, manuscriptID: string, dataListener: (version: number, steps: unknown[], clientIDs: number[]) => void, authToken: string) => void;
@@ -10,7 +10,14 @@
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 { EventSourceMessage } from '@microsoft/fetch-event-source';
13
- import { Maybe } from '../../postgres-data/savingUtilities';
13
+ type Ok<T> = {
14
+ data: T;
15
+ };
16
+ type Error = {
17
+ err: string;
18
+ code: number;
19
+ };
20
+ type Maybe<T> = Ok<T> | Error;
14
21
  type FetchOptions = {
15
22
  method: string;
16
23
  headers: Record<string, string>;
@@ -9,38 +9,22 @@
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 { BibliographyItem, Bundle, CommentAnnotation, ContainerInvitation, ContributorRole, LibraryCollection, Manuscript, ManuscriptNote, ManuscriptTemplate, Model, Project, ProjectInvitation, SectionCategory, Tag, UserProfile } from '@manuscripts/json-schema';
12
+ import { CommentAnnotation, Manuscript, ManuscriptNote, Model, Project, SectionCategory, UserProfile } from '@manuscripts/json-schema';
13
13
  import { FileAttachment, FileManagement } from '@manuscripts/style-guide';
14
14
  import { TrackChangesState } from '@manuscripts/track-changes-plugin';
15
- import { Build, ContainedModel, ManuscriptEditorView, ManuscriptNode, ModelAttachment } from '@manuscripts/transform';
15
+ import { Build, ManuscriptEditorView, ManuscriptNode } from '@manuscripts/transform';
16
16
  import { useCreateEditor } from '../hooks/use-create-editor';
17
17
  import { ManuscriptSnapshot, SnapshotLabel } from '../quarterback/types';
18
18
  import { StoreDataSourceStrategy } from '.';
19
19
  import { TokenData } from './TokenData';
20
- export interface TokenActions {
21
- delete: () => void;
22
- update: (token: string) => void;
23
- }
24
20
  export type action = {
25
21
  action?: string;
26
22
  [key: string]: any;
27
23
  };
28
- export type ImportError = {
29
- error: boolean;
30
- message: string;
31
- };
32
- export type ImportOk = {
33
- ok: boolean;
34
- };
35
- export type bulkCreate = <T>(models: Array<Build<T> & ContainerIDs & ModelAttachment>) => Promise<Array<ImportError | ImportOk>>;
36
24
  export interface ContainerIDs {
37
- containerID?: string;
38
- manuscriptID?: string;
39
- templateID?: string;
40
- }
41
- export interface ContainedIDs {
42
25
  containerID: string;
43
26
  manuscriptID?: string;
27
+ templateID?: string;
44
28
  }
45
29
  export type state = {
46
30
  [key: string]: any;
@@ -49,17 +33,14 @@ export type state = {
49
33
  userID?: string;
50
34
  project: Project;
51
35
  manuscript: Manuscript;
52
- manuscripts?: Manuscript[];
53
36
  user: UserProfile;
54
37
  editor: ReturnType<typeof useCreateEditor>;
55
38
  doc: ManuscriptNode;
56
39
  initialDocVersion: number;
57
- ancestorDoc: ManuscriptNode;
58
- authorsPopupOn?: boolean;
59
40
  modelMap: Map<string, Model>;
60
41
  saveModel: <T extends Model>(model: T | Build<T> | Partial<T>) => Promise<T>;
61
42
  deleteModel: (id: string) => Promise<string>;
62
- bulkUpdate: (models: ContainedModel[]) => Promise<void>;
43
+ saveModels: (models: Model[]) => Promise<void>;
63
44
  saveManuscript: (data: Partial<Manuscript>) => Promise<void>;
64
45
  saveTrackModel: <T extends Model>(model: T | Build<T> | Partial<T>) => Promise<T>;
65
46
  trackModelMap: Map<string, Model>;
@@ -68,23 +49,15 @@ export type state = {
68
49
  files: FileAttachment[];
69
50
  authToken: string;
70
51
  tokenData: TokenData;
71
- projectInvitations?: ProjectInvitation[];
72
- containerInvitations?: ContainerInvitation[];
73
- getInvitation?: (invitingUserID: string, invitedEmail: string) => Promise<ContainerInvitation>;
74
- tokenActions: TokenActions;
75
- snapshotID: string | null;
76
- handleSnapshot?: () => Promise<void>;
77
- comments?: CommentAnnotation[];
78
52
  newComments: Map<string, CommentAnnotation>;
79
53
  collaborators?: Map<string, UserProfile>;
80
- collaboratorsProfiles?: Map<string, UserProfile>;
81
54
  collaboratorsById?: Map<string, UserProfile>;
82
55
  notes?: ManuscriptNote[];
83
- tags?: Tag[];
84
56
  trackState?: TrackChangesState;
85
57
  view: ManuscriptEditorView;
86
58
  snapshots: SnapshotLabel[];
87
59
  snapshotsMap: Map<string, ManuscriptSnapshot>;
60
+ createSnapshot: () => Promise<void>;
88
61
  inspectedSnapshotId: string;
89
62
  permittedActions: string[];
90
63
  selectedSuggestion?: string;
@@ -93,15 +66,9 @@ export type state = {
93
66
  savingProcess?: 'saved' | 'saving' | 'offline' | 'failed';
94
67
  preventUnload?: boolean;
95
68
  beforeUnload?: () => void;
96
- library: Map<string, BibliographyItem>;
97
- projectLibraryCollections: Map<string, LibraryCollection>;
98
- template?: ManuscriptTemplate;
99
- bundle?: Bundle;
100
69
  cslLocale?: string;
101
70
  cslStyle?: string;
102
- citeprocCitations: Map<string, string>;
103
71
  sectionCategories: SectionCategory[];
104
- contributorRoles: ContributorRole[];
105
72
  };
106
73
  export type reducer = (payload: any, store: state, action?: string) => state;
107
74
  export type dispatch = (action: action) => void;
@@ -12,4 +12,4 @@
12
12
  import { state, StoreDataSourceStrategy } from '.';
13
13
  import { stateSetter } from './DataSourceStrategy';
14
14
  export type builderFn = (boundState: Partial<state>, next: (resultState: Partial<state>) => void, setState: stateSetter) => void;
15
- export declare function buildStateFromSources(builders: StoreDataSourceStrategy[], setState: stateSetter): Partial<state>;
15
+ export declare function buildStateFromSources(builders: StoreDataSourceStrategy[], setState: stateSetter): Promise<Partial<state>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manuscripts/article-editor",
3
- "version": "1.13.26",
3
+ "version": "1.13.27-LEAN-3304.0",
4
4
  "license": "CPAL-1.0",
5
5
  "description": "React components for editing and viewing manuscripts",
6
6
  "repository": "github:Atypon-OpenSource/manuscripts-article-editor",
@@ -109,4 +109,4 @@
109
109
  "resolutions": {
110
110
  "@types/react": "^17.0.2"
111
111
  }
112
- }
112
+ }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- /*!
3
- * 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.
4
- *
5
- * 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.
6
- *
7
- * The Original Code is manuscripts-frontend.
8
- *
9
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
10
- *
11
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
12
- */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.buildCollaboratorProfiles = void 0;
15
- const buildCollaboratorProfiles = (collaborators, user, key = 'userID') => {
16
- const profiles = new Map();
17
- for (const collaborator of collaborators.values()) {
18
- profiles.set(collaborator[key], collaborator);
19
- }
20
- profiles.set(user[key], user);
21
- return profiles;
22
- };
23
- exports.buildCollaboratorProfiles = buildCollaboratorProfiles;
24
- //# sourceMappingURL=collaborators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collaborators.js","sourceRoot":"","sources":["../../../src/lib/collaborators.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAII,MAAM,yBAAyB,GAAG,CACvC,aAAuC,EACvC,IAAiB,EACjB,MAAyB,QAAQ,EACjC,EAAE;IACF,MAAM,QAAQ,GAA6B,IAAI,GAAG,EAAE,CAAA;IAEpD,KAAK,MAAM,YAAY,IAAI,aAAa,CAAC,MAAM,EAAE,EAAE;QACjD,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAW,EAAE,YAAY,CAAC,CAAA;KACxD;IACD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAW,EAAE,IAAI,CAAC,CAAA;IACvC,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAZY,QAAA,yBAAyB,6BAYrC"}
@@ -1,20 +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 const buildCollaboratorProfiles = (collaborators, user, key = 'userID') => {
13
- const profiles = new Map();
14
- for (const collaborator of collaborators.values()) {
15
- profiles.set(collaborator[key], collaborator);
16
- }
17
- profiles.set(user[key], user);
18
- return profiles;
19
- };
20
- //# sourceMappingURL=collaborators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collaborators.js","sourceRoot":"","sources":["../../../src/lib/collaborators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,aAAuC,EACvC,IAAiB,EACjB,MAAyB,QAAQ,EACjC,EAAE;IACF,MAAM,QAAQ,GAA6B,IAAI,GAAG,EAAE,CAAA;IAEpD,KAAK,MAAM,YAAY,IAAI,aAAa,CAAC,MAAM,EAAE,EAAE;QACjD,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAW,EAAE,YAAY,CAAC,CAAA;KACxD;IACD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAW,EAAE,IAAI,CAAC,CAAA;IACvC,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
@@ -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
- import { UserProfile } from '@manuscripts/json-schema';
13
- export declare const buildCollaboratorProfiles: (collaborators: Map<string, UserProfile>, user: UserProfile, key?: keyof UserProfile) => Map<string, UserProfile>;