@manuscripts/body-editor 1.7.19 → 1.7.21

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 (101) hide show
  1. package/dist/cjs/commands.js +7 -4
  2. package/dist/cjs/components/authors/AffiliationButton.js +105 -0
  3. package/dist/cjs/components/authors/AffiliationForm.js +50 -0
  4. package/dist/cjs/components/authors/AuthorActions.js +61 -0
  5. package/dist/cjs/components/authors/AuthorAffiliations.js +116 -0
  6. package/dist/cjs/components/authors/AuthorDetailsForm.js +97 -0
  7. package/dist/cjs/components/authors/AuthorFormPlaceholder.js +57 -0
  8. package/dist/cjs/components/authors/AuthorList.js +40 -0
  9. package/dist/cjs/components/authors/AuthorsModal.js +226 -0
  10. package/dist/cjs/components/authors/ChangeHandlingForm.js +37 -0
  11. package/dist/cjs/components/authors/DeleteAuthorConfirmationDialog.js +23 -0
  12. package/dist/cjs/components/authors/DraggableAuthor.js +170 -0
  13. package/dist/cjs/components/authors/SaveAuthorConfirmationDialog.js +21 -0
  14. package/dist/cjs/lib/array-reducer.js +2 -0
  15. package/dist/cjs/lib/authors.js +43 -0
  16. package/dist/cjs/lib/context-menu.js +8 -5
  17. package/dist/cjs/lib/track-changes-utils.js +5 -1
  18. package/dist/cjs/lib/utils.js +1 -5
  19. package/dist/cjs/lib/view.js +97 -0
  20. package/dist/cjs/plugins/footnotes/index.js +3 -3
  21. package/dist/cjs/views/base_node_view.js +0 -19
  22. package/dist/cjs/views/bibliography_element.js +3 -2
  23. package/dist/cjs/views/citation_editable.js +3 -2
  24. package/dist/cjs/views/contributors.js +78 -25
  25. package/dist/cjs/views/footnote.js +12 -2
  26. package/dist/cjs/views/footnote_editable.js +1 -1
  27. package/dist/cjs/views/footnotes_element.js +2 -1
  28. package/dist/cjs/views/footnotes_element_editable.js +2 -1
  29. package/dist/cjs/views/inline_footnote.js +5 -0
  30. package/dist/es/commands.js +7 -4
  31. package/dist/es/components/authors/AffiliationButton.js +75 -0
  32. package/dist/es/components/authors/AffiliationForm.js +43 -0
  33. package/dist/es/components/authors/AuthorActions.js +31 -0
  34. package/dist/es/components/authors/AuthorAffiliations.js +85 -0
  35. package/dist/es/components/authors/AuthorDetailsForm.js +67 -0
  36. package/dist/es/components/authors/AuthorFormPlaceholder.js +50 -0
  37. package/dist/es/components/authors/AuthorList.js +33 -0
  38. package/dist/es/components/authors/AuthorsModal.js +196 -0
  39. package/dist/es/components/authors/ChangeHandlingForm.js +10 -0
  40. package/dist/es/components/authors/DeleteAuthorConfirmationDialog.js +16 -0
  41. package/dist/es/components/authors/DraggableAuthor.js +140 -0
  42. package/dist/es/components/authors/SaveAuthorConfirmationDialog.js +14 -0
  43. package/dist/es/configs/editor-views.js +2 -2
  44. package/dist/es/lib/array-reducer.js +2 -0
  45. package/dist/es/lib/authors.js +36 -0
  46. package/dist/es/lib/context-menu.js +8 -5
  47. package/dist/es/lib/track-changes-utils.js +3 -0
  48. package/dist/es/lib/utils.js +1 -4
  49. package/dist/es/lib/view.js +64 -0
  50. package/dist/es/plugins/footnotes/index.js +3 -3
  51. package/dist/es/views/base_node_view.js +0 -19
  52. package/dist/es/views/bibliography_element.js +3 -2
  53. package/dist/es/views/citation_editable.js +3 -2
  54. package/dist/es/views/contributors.js +79 -26
  55. package/dist/es/views/footnote.js +10 -1
  56. package/dist/es/views/footnote_editable.js +2 -2
  57. package/dist/es/views/footnotes_element.js +2 -1
  58. package/dist/es/views/footnotes_element_editable.js +2 -1
  59. package/dist/es/views/inline_footnote.js +5 -0
  60. package/dist/types/components/authors/AffiliationButton.d.ts +8 -0
  61. package/dist/types/components/authors/AffiliationForm.d.ts +7 -0
  62. package/dist/types/components/authors/AuthorActions.d.ts +9 -0
  63. package/dist/types/components/authors/AuthorAffiliations.d.ts +11 -0
  64. package/dist/types/components/authors/AuthorDetailsForm.d.ts +30 -0
  65. package/dist/types/components/authors/AuthorFormPlaceholder.d.ts +2 -0
  66. package/dist/types/components/authors/AuthorList.d.ts +25 -0
  67. package/dist/types/components/authors/AuthorsModal.d.ts +26 -0
  68. package/dist/types/components/authors/ChangeHandlingForm.d.ts +5 -0
  69. package/dist/types/components/authors/DeleteAuthorConfirmationDialog.d.ts +9 -0
  70. package/dist/types/components/authors/DraggableAuthor.d.ts +25 -0
  71. package/dist/types/components/authors/SaveAuthorConfirmationDialog.d.ts +7 -0
  72. package/dist/types/components/outline/DraggableTree.d.ts +1 -1
  73. package/dist/types/configs/ManuscriptsEditor.d.ts +0 -2
  74. package/dist/types/configs/editor-views.d.ts +0 -28
  75. package/dist/types/lib/array-reducer.d.ts +5 -1
  76. package/dist/types/lib/authors.d.ts +23 -0
  77. package/dist/types/lib/track-changes-utils.d.ts +1 -0
  78. package/dist/types/lib/utils.d.ts +0 -1
  79. package/dist/types/lib/view.d.ts +25 -0
  80. package/dist/types/views/base_node_view.d.ts +1 -4
  81. package/dist/types/views/bibliography_element_editable.d.ts +0 -2
  82. package/dist/types/views/blockquote_element_editable.d.ts +0 -2
  83. package/dist/types/views/bullet_list_editable.d.ts +0 -2
  84. package/dist/types/views/contributors.d.ts +25 -8
  85. package/dist/types/views/editable_block.d.ts +0 -2
  86. package/dist/types/views/equation_element_editable.d.ts +0 -2
  87. package/dist/types/views/figure_element_editable.d.ts +0 -2
  88. package/dist/types/views/footnote.d.ts +2 -0
  89. package/dist/types/views/footnote_editable.d.ts +0 -2
  90. package/dist/types/views/footnotes_element_editable.d.ts +0 -2
  91. package/dist/types/views/listing_element_editable.d.ts +0 -2
  92. package/dist/types/views/ordered_list_editable.d.ts +0 -2
  93. package/dist/types/views/paragraph_editable.d.ts +0 -2
  94. package/dist/types/views/placeholder_element_editable.d.ts +0 -2
  95. package/dist/types/views/pullquote_element_editable.d.ts +0 -2
  96. package/dist/types/views/section_title_editable.d.ts +0 -2
  97. package/dist/types/views/table_element_editable.d.ts +0 -2
  98. package/dist/types/views/toc_element_editable.d.ts +0 -2
  99. package/package.json +3 -2
  100. package/styles/AdvancedEditor.css +3 -3
  101. package/styles/Editor.css +5 -5
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface SaveAuthorConfirmationDialogProps {
3
+ isOpen: boolean;
4
+ onSave: () => void;
5
+ onCancel: () => void;
6
+ }
7
+ export declare const SaveAuthorConfirmationDialog: React.FC<SaveAuthorConfirmationDialogProps>;
@@ -59,5 +59,5 @@ declare class Tree extends React.Component<Props & ConnectedProps, State> {
59
59
  private handleContextMenu;
60
60
  private createMenu;
61
61
  }
62
- declare const DraggableTree: import("react-dnd").DndComponentClass<import("react-dnd").DndComponentClass<typeof Tree, import("react-dnd").Omit<Props & ConnectedDragSourceProps & ConnectedDropTargetProps, "itemType" | "connectDropTarget" | "isOverCurrent" | "canDrop">>, import("react-dnd").Omit<import("react-dnd").Omit<Props & ConnectedDragSourceProps & ConnectedDropTargetProps, "itemType" | "connectDropTarget" | "isOverCurrent" | "canDrop">, "item" | "connectDragSource" | "connectDragPreview" | "isDragging" | "canDrag">>;
62
+ declare const DraggableTree: import("react-dnd").DndComponentClass<import("react-dnd").DndComponentClass<typeof Tree, import("react-dnd").Omit<Props & ConnectedDragSourceProps & ConnectedDropTargetProps, "itemType" | "connectDropTarget" | "isOverCurrent" | "canDrop">>, import("react-dnd").Omit<import("react-dnd").Omit<Props & ConnectedDragSourceProps & ConnectedDropTargetProps, "itemType" | "connectDropTarget" | "isOverCurrent" | "canDrop">, "item" | "isDragging" | "connectDragSource" | "connectDragPreview" | "canDrag">>;
63
63
  export default DraggableTree;
@@ -51,8 +51,6 @@ export interface EditorProps {
51
51
  retrySync: (componentIDs: string[]) => Promise<void>;
52
52
  environment?: string;
53
53
  collabProvider?: CollabProvider;
54
- openAuthorEditing: () => void;
55
- selectAuthorForEditing: (authorId: string) => void;
56
54
  }
57
55
  export declare const createEditorState: (props: EditorProps) => EditorState;
58
56
  export declare const createEditorView: (props: EditorProps, root: HTMLElement, state: EditorState, dispatch: Dispatch) => EditorView;
@@ -57,8 +57,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
57
57
  deselectNode: () => void;
58
58
  destroy: () => void;
59
59
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
60
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
61
- deleteNode: (id: string) => void;
62
60
  } & import("../views/bibliography_element").BibliographyElementBlockView<any>>;
63
61
  blockquote_element: import("../types").NodeViewCreator<{
64
62
  gutterButtons: () => HTMLElement[];
@@ -95,8 +93,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
95
93
  deselectNode: () => void;
96
94
  destroy: () => void;
97
95
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
98
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
99
- deleteNode: (id: string) => void;
100
96
  } & import("../views/blockquote_element").BlockquoteElementView<any>>;
101
97
  bullet_list: import("../types").NodeViewCreator<{
102
98
  gutterButtons: () => HTMLElement[];
@@ -133,8 +129,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
133
129
  deselectNode: () => void;
134
130
  destroy: () => void;
135
131
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
136
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
137
- deleteNode: (id: string) => void;
138
132
  } & import("../views/bullet_list").BulletListView<any>>;
139
133
  citation: import("../types").NodeViewCreator<import("../views/citation_editable").CitationEditableView>;
140
134
  cross_reference: import("../types").NodeViewCreator<import("../views/cross_reference_editable").CrossReferenceEditableView>;
@@ -177,8 +171,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
177
171
  deselectNode: () => void;
178
172
  destroy: () => void;
179
173
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
180
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
181
- deleteNode: (id: string) => void;
182
174
  } & import("../views/equation_element").EquationElementView<any>>;
183
175
  figure: import("../types").NodeViewCreator<import("../views/figure_editable").FigureEditableView>;
184
176
  figure_element: import("../types").NodeViewCreator<{
@@ -216,8 +208,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
216
208
  deselectNode: () => void;
217
209
  destroy: () => void;
218
210
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
219
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
220
- deleteNode: (id: string) => void;
221
211
  } & import("../views/figure_element").FigureElementView>;
222
212
  footnote: import("../types").NodeViewCreator<{
223
213
  gutterButtons: () => HTMLElement[];
@@ -254,8 +244,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
254
244
  deselectNode: () => void;
255
245
  destroy: () => void;
256
246
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
257
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
258
- deleteNode: (id: string) => void;
259
247
  } & import("../views/footnote").FootnoteView<any>>;
260
248
  footnotes_element: import("../types").NodeViewCreator<import("../views/footnotes_element").FootnotesElementView<any>>;
261
249
  inline_equation: import("../types").NodeViewCreator<import("../views/inline_equation_editable").InlineEquationEditableView>;
@@ -299,8 +287,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
299
287
  deselectNode: () => void;
300
288
  destroy: () => void;
301
289
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
302
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
303
- deleteNode: (id: string) => void;
304
290
  } & import("../views/listing_element").ListingElementView<any>>;
305
291
  ordered_list: import("../types").NodeViewCreator<{
306
292
  gutterButtons: () => HTMLElement[];
@@ -337,8 +323,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
337
323
  deselectNode: () => void;
338
324
  destroy: () => void;
339
325
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
340
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
341
- deleteNode: (id: string) => void;
342
326
  } & import("../views/ordered_list").OrderedListView<any>>;
343
327
  paragraph: import("../types").NodeViewCreator<{
344
328
  gutterButtons: () => HTMLElement[];
@@ -375,8 +359,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
375
359
  deselectNode: () => void;
376
360
  destroy: () => void;
377
361
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
378
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
379
- deleteNode: (id: string) => void;
380
362
  } & import("../views/paragraph").ParagraphView<any>>;
381
363
  placeholder: import("../types").NodeViewCreator<import("../views/placeholder").PlaceholderView<any>>;
382
364
  placeholder_element: import("../types").NodeViewCreator<{
@@ -414,8 +396,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
414
396
  deselectNode: () => void;
415
397
  destroy: () => void;
416
398
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
417
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
418
- deleteNode: (id: string) => void;
419
399
  } & import("../views/placeholder_element").PlaceholderElementView<any>>;
420
400
  pullquote_element: import("../types").NodeViewCreator<{
421
401
  gutterButtons: () => HTMLElement[];
@@ -452,8 +432,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
452
432
  deselectNode: () => void;
453
433
  destroy: () => void;
454
434
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
455
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
456
- deleteNode: (id: string) => void;
457
435
  } & import("../views/pullquote_element").PullquoteElementView<any>>;
458
436
  section_title: import("../types").NodeViewCreator<{
459
437
  gutterButtons: () => HTMLElement[];
@@ -490,8 +468,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
490
468
  deselectNode: () => void;
491
469
  destroy: () => void;
492
470
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
493
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
494
- deleteNode: (id: string) => void;
495
471
  } & import("../views/section_title").SectionTitleView<any>>;
496
472
  section_label: import("../types").NodeViewCreator<import("../views/block_view").default<any>>;
497
473
  table_element: import("../types").NodeViewCreator<{
@@ -529,8 +505,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
529
505
  deselectNode: () => void;
530
506
  destroy: () => void;
531
507
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
532
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
533
- deleteNode: (id: string) => void;
534
508
  } & import("../views/table_element").TableElementView>;
535
509
  table_element_footer: import("../types").NodeViewCreator<import("../views/table_element_footer").TableElementFooterView<any>>;
536
510
  toc_element: import("../types").NodeViewCreator<{
@@ -568,8 +542,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
568
542
  deselectNode: () => void;
569
543
  destroy: () => void;
570
544
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
571
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
572
- deleteNode: (id: string) => void;
573
545
  } & import("../views/toc_element").TOCElementView<any>>;
574
546
  comments: () => {
575
547
  dom: HTMLDivElement;
@@ -21,5 +21,9 @@ export type Delete<T> = {
21
21
  type: 'delete';
22
22
  item: T;
23
23
  };
24
- export type Action<T> = Update<T> | Delete<T>;
24
+ export type Set<T> = {
25
+ type: 'set';
26
+ state: T[];
27
+ };
28
+ export type Action<T> = Update<T> | Delete<T> | Set<T>;
25
29
  export declare const arrayReducer: <T>(isEqual?: (a: T, b: T) => boolean) => (state: T[], action: Action<T>) => T[];
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { BibliographicName } from '@manuscripts/json-schema';
17
+ import { AffiliationNode, ContributorNode } from '@manuscripts/transform';
18
+ export type AffiliationAttrs = Omit<AffiliationNode['attrs'], 'addressLine2' | 'addressLine3' | 'email'>;
19
+ export type ContributorAttrs = Omit<ContributorNode['attrs'], 'userID' | 'invitationID'>;
20
+ export declare const affiliationLabel: (affiliation: AffiliationAttrs) => string;
21
+ export declare const authorLabel: (author: ContributorAttrs) => string;
22
+ export declare const initials: (name: BibliographicName) => string;
23
+ export declare const authorComparator: (a: ContributorAttrs, b: ContributorAttrs) => number;
@@ -25,3 +25,4 @@ export declare function getChangeClasses(dataTracked?: TrackedAttrs[]): string[]
25
25
  export declare function isTracked(node: ProsemirrorNode): boolean;
26
26
  export declare function getActualAttrs<T extends ManuscriptNode>(node: T): T["attrs"];
27
27
  export declare const getAttrsTrackingButton: (changeID: string) => HTMLButtonElement;
28
+ export declare function isHidden(node: ProsemirrorNode): boolean;
@@ -23,4 +23,3 @@ export declare const findParentNodeWithId: (selection: Selection) => import("pro
23
23
  export declare const findParentNodeWithIdValue: (selection: Selection) => import("prosemirror-utils").ContentNodeWithPos | undefined;
24
24
  export declare const findParentSection: (selection: Selection) => import("prosemirror-utils").ContentNodeWithPos | undefined;
25
25
  export declare const findParentElement: (selection: Selection, validIds?: string[]) => import("prosemirror-utils").ContentNodeWithPos | undefined;
26
- export declare const isMetaNode: (nodeType: string) => boolean;
@@ -0,0 +1,25 @@
1
+ /*!
2
+ * © 2024 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { ManuscriptEditorView, ManuscriptNode, ManuscriptNodeType } from '@manuscripts/transform';
17
+ import { Attrs } from 'prosemirror-model';
18
+ import * as utils from 'prosemirror-utils';
19
+ export declare const findChildByID: (view: ManuscriptEditorView, id: string) => utils.NodeWithPos | undefined;
20
+ export declare const findChildByType: (view: ManuscriptEditorView, type: ManuscriptNodeType) => utils.NodeWithPos | undefined;
21
+ export declare const findChildrenByType: (view: ManuscriptEditorView, type: ManuscriptNodeType) => utils.NodeWithPos[];
22
+ export declare const findChildrenAttrsByType: <T extends Attrs>(view: ManuscriptEditorView, type: ManuscriptNodeType) => T[];
23
+ export declare const updateNode: (view: ManuscriptEditorView, node: ManuscriptNode) => void;
24
+ export declare const updateNodeAttrs: (view: ManuscriptEditorView, type: ManuscriptNodeType, attrs: Attrs) => void;
25
+ export declare const deleteNode: (view: ManuscriptEditorView, id: string) => void;
@@ -14,7 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ManuscriptEditorView, ManuscriptNode } from '@manuscripts/transform';
17
- import { Attrs, Node } from 'prosemirror-model';
18
17
  import { Decoration, NodeView } from 'prosemirror-view';
19
18
  import { CSLProps } from '../configs/ManuscriptsEditor';
20
19
  import { PopperManager } from '../lib/popper';
@@ -35,7 +34,7 @@ export declare class BaseNodeView<PropsType extends BaseNodeProps> implements No
35
34
  syncErrors: SyncError[];
36
35
  elementType: string;
37
36
  constructor(props: PropsType, node: ManuscriptNode, view: ManuscriptEditorView, getPos: () => number, decorations: readonly Decoration[]);
38
- update: (newNode: Node, decorations: readonly Decoration[]) => boolean;
37
+ update: (newNode: ManuscriptNode, decorations: readonly Decoration[]) => boolean;
39
38
  initialise: () => void;
40
39
  updateContents: () => void;
41
40
  setDomAttrs(node: ManuscriptNode, element: HTMLElement, omit?: string[]): void;
@@ -43,6 +42,4 @@ export declare class BaseNodeView<PropsType extends BaseNodeProps> implements No
43
42
  deselectNode: () => void;
44
43
  destroy: () => void;
45
44
  handleDecorations: (decorations: readonly Decoration[]) => void;
46
- updateNodeAttrs: (attrs: Attrs) => void;
47
- deleteNode: (id: string) => void;
48
45
  }
@@ -49,7 +49,5 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & BibliographyElementBlockView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & BlockquoteElementView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & BulletListView<any>>;
55
53
  export default _default;
@@ -1,5 +1,21 @@
1
+ /*!
2
+ * © 2023 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
  import { Capabilities } from '@manuscripts/style-guide';
2
17
  import { ContributorNode } from '@manuscripts/transform';
18
+ import { AffiliationAttrs, ContributorAttrs } from '../lib/authors';
3
19
  import BlockView from './block_view';
4
20
  import { EditableBlockProps } from './editable_block';
5
21
  export interface ContributorsProps extends EditableBlockProps {
@@ -8,24 +24,25 @@ export interface ContributorsProps extends EditableBlockProps {
8
24
  selectAuthorForEditing: (authorId: string) => void;
9
25
  }
10
26
  export declare class ContributorsView<PropsType extends ContributorsProps> extends BlockView<PropsType> {
27
+ container: HTMLElement;
28
+ inner: HTMLElement;
29
+ popper?: HTMLElement;
11
30
  initialise: () => void;
12
31
  updateContents: () => void;
13
32
  buildAuthors: () => void;
14
- container: HTMLElement;
15
- inner: HTMLElement;
16
33
  buildAuthor: (node: ContributorNode, isJointFirstAuthor: boolean, selectedAuthor?: string) => HTMLButtonElement;
17
34
  createNote(text?: string, title?: string): HTMLSpanElement;
18
- initials: (given: string) => string;
19
- buildNameLiteral: ({ given, family, suffix }: {
20
- given?: string | undefined;
21
- family?: string | undefined;
22
- suffix?: string | undefined;
23
- }) => string;
24
35
  isJointFirstAuthor: (authors: ContributorNode[], index: number) => boolean;
25
36
  createElement: () => void;
26
37
  createDOM: () => void;
27
38
  createEditButton: () => void;
28
39
  createLegend: () => void;
40
+ handleClick: (e: Event) => void;
41
+ handleSaveAuthor: (author: ContributorAttrs) => void;
42
+ handleDeleteAuthor: (author: ContributorAttrs) => void;
43
+ handleSaveAffiliation: (affiliation: AffiliationAttrs) => void;
44
+ insertAuthorNode: (attrs: ContributorAttrs) => void;
45
+ insertAffiliationNode: (attrs: AffiliationAttrs) => void;
29
46
  ignoreMutation: () => boolean;
30
47
  stopEvent: () => boolean;
31
48
  }
@@ -64,8 +64,6 @@ export declare const EditableBlock: <T extends Constructor<BlockView<EditableBlo
64
64
  deselectNode: () => void;
65
65
  destroy: () => void;
66
66
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
67
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
68
- deleteNode: (id: string) => void;
69
67
  };
70
68
  } & T;
71
69
  export {};
@@ -49,7 +49,5 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & EquationElementView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & FigureElementView>;
55
53
  export default _default;
@@ -13,10 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { ManuscriptNode } from '@manuscripts/transform';
16
17
  import { BaseNodeProps } from './base_node_view';
17
18
  import BlockView from './block_view';
18
19
  export declare class FootnoteView<PropsType extends BaseNodeProps> extends BlockView<PropsType> {
19
20
  elementType: string;
20
21
  }
22
+ export declare const setTCClasses: (node: ManuscriptNode, dom: HTMLElement) => void;
21
23
  declare const _default: (props: BaseNodeProps) => import("../types").NodeViewCreator<FootnoteView<any>>;
22
24
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & FootnoteView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & FootnotesElementView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & ListingElementView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & OrderedListView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & ParagraphView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & PlaceholderElementView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./base_node_view").BaseNodeProps) => imp
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & PullquoteElementView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & SectionTitleView<any>>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & TableElementView>;
55
53
  export default _default;
@@ -49,7 +49,5 @@ declare const _default: (props: import("./editable_block").EditableBlockProps, d
49
49
  deselectNode: () => void;
50
50
  destroy: () => void;
51
51
  handleDecorations: (decorations: readonly import("prosemirror-view").Decoration[]) => void;
52
- updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
53
- deleteNode: (id: string) => void;
54
52
  } & TOCElementView<any>>;
55
53
  export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/body-editor",
3
3
  "description": "Prosemirror components for editing and viewing manuscripts",
4
- "version": "1.7.19",
4
+ "version": "1.7.21",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -31,7 +31,7 @@
31
31
  "@manuscripts/assets": "^0.6.4",
32
32
  "@manuscripts/json-schema": "^2.2.6",
33
33
  "@manuscripts/library": "^1.3.5",
34
- "@manuscripts/style-guide": "^1.7.11",
34
+ "@manuscripts/style-guide": "^1.8.0",
35
35
  "@manuscripts/track-changes-plugin": "^1.7.7",
36
36
  "@manuscripts/transform": "^2.1.6",
37
37
  "astrocite-eutils": "^0.16.4",
@@ -39,6 +39,7 @@
39
39
  "mathjax-full": "^3.2.2",
40
40
  "codemirror": "^5.58.1",
41
41
  "dompurify": "^2.4.1",
42
+ "formik": "^2.2.9",
42
43
  "grapheme-splitter": "^1.0.4",
43
44
  "history": "^4.10.1",
44
45
  "popper.js": "^1.16.1",
@@ -819,12 +819,12 @@ Next levels are shifted 'up' by 1
819
819
  display: inline-flex;
820
820
  background: transparent;
821
821
  border: 0;
822
+ font-family: 'PT Sans', sans-serif;
822
823
  font-size: 1rem;
823
824
  text-decoration: none;
824
825
  color: inherit;
825
826
  outline: none;
826
- padding: 4px 5px;
827
- margin: 0 6px;
827
+ padding: 0;
828
828
  }
829
829
 
830
830
  .contributor:not(:disabled):hover {
@@ -843,7 +843,7 @@ Next levels are shifted 'up' by 1
843
843
  .contributor:after {
844
844
  content: ', ';
845
845
  color: #353535;
846
- margin-right: -9px;
846
+ margin-right: 5px;
847
847
  }
848
848
  .contributor:last-child::after {
849
849
  content: '';
package/styles/Editor.css CHANGED
@@ -944,18 +944,18 @@
944
944
  padding-top: 8px;
945
945
  }
946
946
 
947
- .ProseMirror .table-footer .footnote-element:not(:first-child)::before {
947
+ .ProseMirror .table-footnotes-element:not(:first-child)::before {
948
948
  content: '';
949
949
  border-bottom: 1px dashed #C9C9C9;
950
950
  display: block;
951
951
  margin-bottom: 8px;
952
952
  }
953
953
 
954
- .ProseMirror .table-footer .footnote-element {
954
+ .ProseMirror .table-footnotes-element {
955
955
  counter-reset: table_footnote;
956
956
  }
957
957
 
958
- .ProseMirror .table-footer .footnote-element > div:not(:has(.unctied-table-footnote)) p::before {
958
+ .ProseMirror .table-footnotes-element > div:not(:has(.unctied-table-footnote)) p::before {
959
959
  counter-increment: table_footnote;
960
960
  content: counter(table_footnote);
961
961
  display: inline-block;
@@ -978,7 +978,7 @@
978
978
  .table-footer > div > p {
979
979
  padding-bottom: 10px;
980
980
  }
981
- .ProseMirror .table-footer .footnote-element .footnote-selected {
981
+ .ProseMirror .table-footnotes-element .footnote-selected {
982
982
  border: 1px solid #bce7f6;
983
983
  }
984
984
  .table-footer > div:has(> p.footnote-selected) > p {
@@ -998,7 +998,7 @@
998
998
  cursor: pointer;
999
999
  }
1000
1000
 
1001
- .ProseMirror .footnote-element > div:has(.unctied-table-footnote) {
1001
+ .ProseMirror .table-footnotes-element > div:has(.unctied-table-footnote) {
1002
1002
  position: relative;
1003
1003
  }
1004
1004