@manuscripts/body-editor 1.7.19 → 1.7.20

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 (83) hide show
  1. package/dist/cjs/components/authors/AffiliationButton.js +105 -0
  2. package/dist/cjs/components/authors/AffiliationForm.js +50 -0
  3. package/dist/cjs/components/authors/AuthorActions.js +61 -0
  4. package/dist/cjs/components/authors/AuthorAffiliations.js +116 -0
  5. package/dist/cjs/components/authors/AuthorDetailsForm.js +97 -0
  6. package/dist/cjs/components/authors/AuthorFormPlaceholder.js +57 -0
  7. package/dist/cjs/components/authors/AuthorList.js +40 -0
  8. package/dist/cjs/components/authors/AuthorsModal.js +226 -0
  9. package/dist/cjs/components/authors/ChangeHandlingForm.js +37 -0
  10. package/dist/cjs/components/authors/DeleteAuthorConfirmationDialog.js +23 -0
  11. package/dist/cjs/components/authors/DraggableAuthor.js +170 -0
  12. package/dist/cjs/components/authors/SaveAuthorConfirmationDialog.js +21 -0
  13. package/dist/cjs/lib/array-reducer.js +2 -0
  14. package/dist/cjs/lib/authors.js +43 -0
  15. package/dist/cjs/lib/track-changes-utils.js +5 -1
  16. package/dist/cjs/lib/utils.js +1 -5
  17. package/dist/cjs/lib/view.js +97 -0
  18. package/dist/cjs/views/base_node_view.js +0 -19
  19. package/dist/cjs/views/bibliography_element.js +3 -2
  20. package/dist/cjs/views/citation_editable.js +3 -2
  21. package/dist/cjs/views/contributors.js +78 -25
  22. package/dist/es/components/authors/AffiliationButton.js +75 -0
  23. package/dist/es/components/authors/AffiliationForm.js +43 -0
  24. package/dist/es/components/authors/AuthorActions.js +31 -0
  25. package/dist/es/components/authors/AuthorAffiliations.js +85 -0
  26. package/dist/es/components/authors/AuthorDetailsForm.js +67 -0
  27. package/dist/es/components/authors/AuthorFormPlaceholder.js +50 -0
  28. package/dist/es/components/authors/AuthorList.js +33 -0
  29. package/dist/es/components/authors/AuthorsModal.js +196 -0
  30. package/dist/es/components/authors/ChangeHandlingForm.js +10 -0
  31. package/dist/es/components/authors/DeleteAuthorConfirmationDialog.js +16 -0
  32. package/dist/es/components/authors/DraggableAuthor.js +140 -0
  33. package/dist/es/components/authors/SaveAuthorConfirmationDialog.js +14 -0
  34. package/dist/es/configs/editor-views.js +2 -2
  35. package/dist/es/lib/array-reducer.js +2 -0
  36. package/dist/es/lib/authors.js +36 -0
  37. package/dist/es/lib/track-changes-utils.js +3 -0
  38. package/dist/es/lib/utils.js +1 -4
  39. package/dist/es/lib/view.js +64 -0
  40. package/dist/es/views/base_node_view.js +0 -19
  41. package/dist/es/views/bibliography_element.js +3 -2
  42. package/dist/es/views/citation_editable.js +3 -2
  43. package/dist/es/views/contributors.js +79 -26
  44. package/dist/types/components/authors/AffiliationButton.d.ts +8 -0
  45. package/dist/types/components/authors/AffiliationForm.d.ts +7 -0
  46. package/dist/types/components/authors/AuthorActions.d.ts +9 -0
  47. package/dist/types/components/authors/AuthorAffiliations.d.ts +11 -0
  48. package/dist/types/components/authors/AuthorDetailsForm.d.ts +30 -0
  49. package/dist/types/components/authors/AuthorFormPlaceholder.d.ts +2 -0
  50. package/dist/types/components/authors/AuthorList.d.ts +25 -0
  51. package/dist/types/components/authors/AuthorsModal.d.ts +26 -0
  52. package/dist/types/components/authors/ChangeHandlingForm.d.ts +5 -0
  53. package/dist/types/components/authors/DeleteAuthorConfirmationDialog.d.ts +9 -0
  54. package/dist/types/components/authors/DraggableAuthor.d.ts +25 -0
  55. package/dist/types/components/authors/SaveAuthorConfirmationDialog.d.ts +7 -0
  56. package/dist/types/components/outline/DraggableTree.d.ts +1 -1
  57. package/dist/types/configs/ManuscriptsEditor.d.ts +0 -2
  58. package/dist/types/configs/editor-views.d.ts +0 -28
  59. package/dist/types/lib/array-reducer.d.ts +5 -1
  60. package/dist/types/lib/authors.d.ts +23 -0
  61. package/dist/types/lib/track-changes-utils.d.ts +1 -0
  62. package/dist/types/lib/utils.d.ts +0 -1
  63. package/dist/types/lib/view.d.ts +25 -0
  64. package/dist/types/views/base_node_view.d.ts +1 -4
  65. package/dist/types/views/bibliography_element_editable.d.ts +0 -2
  66. package/dist/types/views/blockquote_element_editable.d.ts +0 -2
  67. package/dist/types/views/bullet_list_editable.d.ts +0 -2
  68. package/dist/types/views/contributors.d.ts +25 -8
  69. package/dist/types/views/editable_block.d.ts +0 -2
  70. package/dist/types/views/equation_element_editable.d.ts +0 -2
  71. package/dist/types/views/figure_element_editable.d.ts +0 -2
  72. package/dist/types/views/footnote_editable.d.ts +0 -2
  73. package/dist/types/views/footnotes_element_editable.d.ts +0 -2
  74. package/dist/types/views/listing_element_editable.d.ts +0 -2
  75. package/dist/types/views/ordered_list_editable.d.ts +0 -2
  76. package/dist/types/views/paragraph_editable.d.ts +0 -2
  77. package/dist/types/views/placeholder_element_editable.d.ts +0 -2
  78. package/dist/types/views/pullquote_element_editable.d.ts +0 -2
  79. package/dist/types/views/section_title_editable.d.ts +0 -2
  80. package/dist/types/views/table_element_editable.d.ts +0 -2
  81. package/dist/types/views/toc_element_editable.d.ts +0 -2
  82. package/package.json +4 -3
  83. package/styles/AdvancedEditor.css +3 -3
@@ -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;
@@ -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.20",
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",
@@ -110,4 +111,4 @@
110
111
  "resolutions": {
111
112
  "@types/react": "^17.0.2"
112
113
  }
113
- }
114
+ }
@@ -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: '';