@manuscripts/body-editor 1.5.16 → 1.6.1

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 (80) hide show
  1. package/dist/cjs/commands.js +53 -132
  2. package/dist/cjs/components/outline/DraggableTree.js +33 -25
  3. package/dist/cjs/components/toolbar/OrderListSelector.js +3 -11
  4. package/dist/cjs/configs/editor-plugins.js +2 -2
  5. package/dist/cjs/configs/editor-views.js +4 -6
  6. package/dist/cjs/lib/context-menu.js +6 -5
  7. package/dist/cjs/node-type-icons.js +0 -1
  8. package/dist/cjs/plugins/bibliography/bibliography-utils.js +60 -47
  9. package/dist/cjs/plugins/bibliography/index.js +48 -63
  10. package/dist/cjs/plugins/comment_annotation.js +2 -2
  11. package/dist/cjs/plugins/footnotes/index.js +19 -10
  12. package/dist/cjs/plugins/persist.js +21 -31
  13. package/dist/cjs/plugins/sections.js +1 -2
  14. package/dist/cjs/plugins/toc.js +28 -23
  15. package/dist/cjs/useEditor.js +1 -3
  16. package/dist/cjs/views/bibliography_element.js +20 -38
  17. package/dist/cjs/views/citation.js +29 -26
  18. package/dist/cjs/views/citation_editable.js +25 -44
  19. package/dist/cjs/views/{contributors_section.js → contributors.js} +4 -4
  20. package/dist/cjs/views/cross_reference.js +7 -36
  21. package/dist/cjs/views/cross_reference_editable.js +6 -14
  22. package/dist/cjs/views/editable_block.js +2 -2
  23. package/dist/cjs/views/{meta_section.js → empty.js} +3 -3
  24. package/dist/cjs/views/section_title.js +1 -16
  25. package/dist/es/commands.js +55 -110
  26. package/dist/es/components/outline/DraggableTree.js +33 -25
  27. package/dist/es/components/toolbar/OrderListSelector.js +4 -12
  28. package/dist/es/configs/editor-plugins.js +2 -2
  29. package/dist/es/configs/editor-views.js +4 -6
  30. package/dist/es/lib/context-menu.js +7 -6
  31. package/dist/es/node-type-icons.js +0 -1
  32. package/dist/es/plugins/bibliography/bibliography-utils.js +56 -45
  33. package/dist/es/plugins/bibliography/index.js +49 -65
  34. package/dist/es/plugins/comment_annotation.js +2 -2
  35. package/dist/es/plugins/footnotes/index.js +20 -11
  36. package/dist/es/plugins/persist.js +22 -32
  37. package/dist/es/plugins/sections.js +2 -3
  38. package/dist/es/plugins/toc.js +29 -24
  39. package/dist/es/useEditor.js +2 -4
  40. package/dist/es/views/bibliography_element.js +21 -39
  41. package/dist/es/views/citation.js +31 -28
  42. package/dist/es/views/citation_editable.js +28 -47
  43. package/dist/es/views/{contributors_section.js → contributors.js} +2 -2
  44. package/dist/es/views/cross_reference.js +7 -33
  45. package/dist/es/views/cross_reference_editable.js +6 -14
  46. package/dist/es/views/editable_block.js +3 -3
  47. package/dist/es/views/{meta_section.js → empty.js} +3 -3
  48. package/dist/es/views/section_title.js +0 -14
  49. package/dist/types/commands.d.ts +1 -2
  50. package/dist/types/components/outline/DraggableTree.d.ts +1 -2
  51. package/dist/types/configs/ManuscriptsEditor.d.ts +1 -10
  52. package/dist/types/configs/editor-plugins.d.ts +1 -5
  53. package/dist/types/configs/editor-views.d.ts +5 -6
  54. package/dist/types/lib/context-menu.d.ts +0 -1
  55. package/dist/types/plugins/bibliography/bibliography-utils.d.ts +10 -7
  56. package/dist/types/plugins/bibliography/index.d.ts +21 -3
  57. package/dist/types/views/bibliography_element.d.ts +1 -0
  58. package/dist/types/views/citation.d.ts +3 -4
  59. package/dist/types/views/citation_editable.d.ts +2 -8
  60. package/dist/types/views/{contributors_section.d.ts → contributors.d.ts} +3 -3
  61. package/dist/types/views/cross_reference.d.ts +0 -5
  62. package/dist/types/views/{meta_section.d.ts → empty.d.ts} +2 -2
  63. package/dist/types/views/section_title.d.ts +0 -2
  64. package/package.json +4 -22
  65. package/styles/AdvancedEditor.css +30 -34
  66. package/dist/cjs/plugins/auxiliary_object_order.js +0 -49
  67. package/dist/cjs/plugins/bibliography/types.js +0 -17
  68. package/dist/cjs/plugins/footnotes/footnotes-utils.js +0 -52
  69. package/dist/cjs/views/bibliography_item.js +0 -138
  70. package/dist/cjs/views/bibliography_item_editable.js +0 -20
  71. package/dist/es/plugins/auxiliary_object_order.js +0 -46
  72. package/dist/es/plugins/bibliography/types.js +0 -16
  73. package/dist/es/plugins/footnotes/footnotes-utils.js +0 -46
  74. package/dist/es/views/bibliography_item.js +0 -131
  75. package/dist/es/views/bibliography_item_editable.js +0 -18
  76. package/dist/types/plugins/auxiliary_object_order.d.ts +0 -12
  77. package/dist/types/plugins/bibliography/types.d.ts +0 -40
  78. package/dist/types/plugins/footnotes/footnotes-utils.d.ts +0 -25
  79. package/dist/types/views/bibliography_item.d.ts +0 -34
  80. package/dist/types/views/bibliography_item_editable.d.ts +0 -18
@@ -14,8 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import 'prosemirror-view/style/prosemirror.css';
17
- import { BibliographyItem, CommentAnnotation, Manuscript, Model, UserProfile } from '@manuscripts/json-schema';
18
- import { CitationProvider } from '@manuscripts/library';
17
+ import { CommentAnnotation, Manuscript, Model, UserProfile } from '@manuscripts/json-schema';
19
18
  import { Capabilities, FileAttachment, FileManagement } from '@manuscripts/style-guide';
20
19
  import { Build, ManuscriptNode } from '@manuscripts/transform';
21
20
  import { History } from 'history';
@@ -51,19 +50,11 @@ export interface EditorProps {
51
50
  components: Record<string, React.ComponentType<any>>;
52
51
  getCapabilities: () => Capabilities;
53
52
  cslProps: CSLProps;
54
- getCitationProvider: () => CitationProvider | undefined;
55
- getLibraryItem: (id: string) => BibliographyItem | undefined;
56
- setLibraryItem: (item: BibliographyItem) => void;
57
- matchLibraryItemByIdentifier: (item: BibliographyItem) => BibliographyItem | undefined;
58
- filterLibraryItems: (query: string) => Promise<BibliographyItem[]>;
59
- removeLibraryItem: (id: string) => void;
60
53
  setComment: (comment?: CommentAnnotation) => void;
61
54
  setSelectedComment: (id?: string) => void;
62
55
  setEditorSelectedSuggestion: (id?: string) => void;
63
56
  retrySync: (componentIDs: string[]) => Promise<void>;
64
57
  environment?: string;
65
- setCiteprocCitations: (citations: Map<string, string>) => void;
66
- getCiteprocCitations: () => Map<string, string>;
67
58
  }
68
59
  declare const _default: {
69
60
  createState: (props: EditorProps) => EditorState;
@@ -15,8 +15,7 @@
15
15
  */
16
16
  import 'prosemirror-gapcursor/style/gapcursor.css';
17
17
  import 'prosemirror-tables/style/tables.css';
18
- import { BibliographyItem, CommentAnnotation, Manuscript, Model } from '@manuscripts/json-schema';
19
- import { CitationProvider } from '@manuscripts/library';
18
+ import { CommentAnnotation, Manuscript, Model } from '@manuscripts/json-schema';
20
19
  import { Capabilities } from '@manuscripts/style-guide';
21
20
  import { Build, ManuscriptSchema } from '@manuscripts/transform';
22
21
  import { Plugin } from 'prosemirror-state';
@@ -27,8 +26,6 @@ interface PluginProps {
27
26
  getManuscript: () => Manuscript;
28
27
  saveModel: <T extends Model>(model: T | Build<T> | Partial<T>) => Promise<T>;
29
28
  deleteModel: (id: string) => Promise<string>;
30
- getCitationProvider: () => CitationProvider | undefined;
31
- getLibraryItem: (id: string) => BibliographyItem | undefined;
32
29
  setComment: (comment?: CommentAnnotation) => void;
33
30
  setSelectedComment: (id?: string) => void;
34
31
  setEditorSelectedSuggestion?: (id?: string) => void;
@@ -36,7 +33,6 @@ interface PluginProps {
36
33
  plugins?: Plugin<ManuscriptSchema>[];
37
34
  cslProps: CSLProps;
38
35
  popper: PopperManager;
39
- setCiteprocCitations: (citations: Map<string, string>) => void;
40
36
  }
41
37
  declare const _default: (props: PluginProps) => any[];
42
38
  export default _default;
@@ -15,16 +15,15 @@
15
15
  */
16
16
  import { DefaultTheme } from 'styled-components';
17
17
  import { Dispatch } from '../commands';
18
- import { CitationEditableProps } from '../views/citation_editable';
18
+ import { CitationViewProps } from '../views/citation';
19
19
  import { EditableBlockProps } from '../views/editable_block';
20
20
  import { FigureProps } from '../views/figure_editable';
21
21
  import { KeywordsElementProps } from '../views/keywords_element';
22
- type EditorProps = EditableBlockProps & CitationEditableProps & FigureProps & KeywordsElementProps & {
22
+ type EditorProps = EditableBlockProps & CitationViewProps & FigureProps & KeywordsElementProps & {
23
23
  theme: DefaultTheme;
24
24
  };
25
25
  declare const _default: (props: EditorProps, dispatch: Dispatch) => {
26
26
  title: import("../types").NodeViewCreator<import("../views/title").TitleView<any>>;
27
- bibliography_item: import("../types").NodeViewCreator<import("../views/bibliography_item").BibliographyItemView<any>>;
28
27
  bibliography_element: import("../types").NodeViewCreator<{
29
28
  gutterButtons: () => HTMLElement[];
30
29
  actionGutterButtons: () => HTMLElement[];
@@ -141,7 +140,7 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
141
140
  } & import("../views/bullet_list").BulletListView<any>>;
142
141
  citation: import("../types").NodeViewCreator<import("../views/citation_editable").CitationEditableView>;
143
142
  cross_reference: import("../types").NodeViewCreator<import("../views/cross_reference_editable").CrossReferenceEditableView>;
144
- contributors_section: import("../types").NodeViewCreator<import("../views/contributors_section").ContributorsSectionView<any>>;
143
+ contributors: import("../types").NodeViewCreator<import("../views/contributors").ContributorsView<any>>;
145
144
  equation: import("../types").NodeViewCreator<import("../views/equation_editable").EquationEditableView>;
146
145
  equation_element: import("../types").NodeViewCreator<{
147
146
  gutterButtons: () => HTMLElement[];
@@ -571,8 +570,8 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
571
570
  updateNodeAttrs: (attrs: import("prosemirror-model").Attrs) => void;
572
571
  deleteNode: (id: string) => void;
573
572
  } & import("../views/toc_element").TOCElementView<any>>;
574
- meta_section: () => {
575
- dom: HTMLElement;
573
+ comments: () => {
574
+ dom: HTMLDivElement;
576
575
  };
577
576
  };
578
577
  export default _default;
@@ -39,7 +39,6 @@ export declare class ContextMenu {
39
39
  private resolvePos;
40
40
  private splitSection;
41
41
  private toggleNodeAttr;
42
- private isListType;
43
42
  private buildSuppressOptions;
44
43
  private addPopperEventListeners;
45
44
  private trimTitle;
@@ -13,12 +13,15 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Model } from '@manuscripts/json-schema';
17
- import { CitationNodes } from '@manuscripts/library';
18
- import { ManuscriptNode } from '@manuscripts/transform';
16
+ import { BibliographyItem, Citation } from '@manuscripts/json-schema';
17
+ import { BibliographyItemNode, CitationNode, ManuscriptNode } from '@manuscripts/transform';
18
+ import CiteProc from 'citeproc';
19
19
  import { Decoration } from 'prosemirror-view';
20
- import { PopperManager } from '../../lib/popper';
20
+ import { PluginState } from './index';
21
21
  export declare const isBibliographyElement: (node: ManuscriptNode) => boolean;
22
- export declare const buildDecorations: (doc: ManuscriptNode, citationNodes: CitationNodes, popper: PopperManager, referencesModelMap: Map<string, Model>, triggerUpdate?: boolean) => Decoration[];
23
- export declare const getNodeModel: <T extends Model>(node: ManuscriptNode, excludeDeletedNode?: boolean) => T | undefined;
24
- export declare const getReferencesModelMap: (doc: ManuscriptNode, excludeDeletedNode?: boolean) => Map<string, Model>;
22
+ export type CitationNodes = [CitationNode, number][];
23
+ export declare const buildDecorations: (state: PluginState, doc: ManuscriptNode) => Decoration[];
24
+ export declare const getCitation: (node: CitationNode) => Citation | undefined;
25
+ export declare const getBibliographyItem: (node: BibliographyItemNode) => BibliographyItem | undefined;
26
+ export declare const getBibliographyItemModelMap: (doc: ManuscriptNode) => Map<string, BibliographyItem>;
27
+ export declare const buildCitations: (citations: CitationNodes) => CiteProc.Citation[];
@@ -13,8 +13,26 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Plugin, PluginKey } from 'prosemirror-state';
17
- import { BibliographyProps, PluginState } from './types';
18
- export declare const bibliographyKey: PluginKey<any>;
16
+ import { BibliographyItem } from '@manuscripts/json-schema';
17
+ import { CitationProvider } from '@manuscripts/library';
18
+ import CiteProc from 'citeproc';
19
+ import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
20
+ import { CSLProps } from '../../configs/ManuscriptsEditor';
21
+ import { PopperManager } from '../../lib/popper';
22
+ import { CitationNodes } from './bibliography-utils';
23
+ export declare const bibliographyKey: PluginKey<PluginState>;
24
+ export interface PluginState {
25
+ citationNodes: CitationNodes;
26
+ citations: CiteProc.Citation[];
27
+ bibliographyItems: Map<string, BibliographyItem>;
28
+ renderedCitations: Map<string, string>;
29
+ provider: CitationProvider;
30
+ refresh?: boolean;
31
+ }
32
+ export interface BibliographyProps {
33
+ cslProps: CSLProps;
34
+ popper: PopperManager;
35
+ }
19
36
  declare const _default: (props: BibliographyProps) => Plugin<PluginState>;
20
37
  export default _default;
38
+ export declare const getBibliographyPluginState: (state: EditorState) => PluginState;
@@ -25,6 +25,7 @@ interface BibliographyElementViewProps extends BaseNodeProps {
25
25
  export declare class BibliographyElementBlockView<PropsType extends BibliographyElementViewProps & EditableBlockProps> extends BlockView<PropsType> {
26
26
  container: HTMLElement;
27
27
  popperContainer?: HTMLDivElement;
28
+ gutterButtons: () => HTMLElement[];
28
29
  showPopper: (referenceID: string) => void;
29
30
  stopEvent: () => boolean;
30
31
  ignoreMutation: () => boolean;
@@ -13,15 +13,13 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BibliographyItem, Citation } from '@manuscripts/json-schema';
16
+ import { BibliographyItem } from '@manuscripts/json-schema';
17
17
  import { ManuscriptNodeView } from '@manuscripts/transform';
18
18
  import React from 'react';
19
19
  import { BaseNodeProps, BaseNodeView } from './base_node_view';
20
20
  export interface CitationViewProps extends BaseNodeProps {
21
21
  components: Record<string, React.ComponentType<any>>;
22
- getLibraryItem: (id: string) => BibliographyItem | undefined;
23
22
  projectID: string;
24
- getCiteprocCitations: () => Map<string, string>;
25
23
  }
26
24
  export declare class CitationView<PropsType extends CitationViewProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
27
25
  protected popperContainer?: HTMLDivElement;
@@ -33,7 +31,8 @@ export declare class CitationView<PropsType extends CitationViewProps> extends B
33
31
  initialise: () => this;
34
32
  updateContents: () => void;
35
33
  renderTrackChangesReview: () => HTMLSpanElement;
36
- getCitation: () => Citation;
34
+ getCitation: () => import("@manuscripts/json-schema").Citation;
35
+ getBibliographyItems: () => BibliographyItem[];
37
36
  }
38
37
  declare const _default: (props: BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<CitationView<any>>;
39
38
  export default _default;
@@ -13,15 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BibliographyItem } from '@manuscripts/json-schema';
17
16
  import { CitationView, CitationViewProps } from './citation';
18
17
  import { EditableBlockProps } from './editable_block';
19
- export interface CitationEditableProps extends CitationViewProps {
20
- matchLibraryItemByIdentifier: (item: BibliographyItem) => BibliographyItem | undefined;
21
- setCiteprocCitations: (citations: Map<string, string>) => void;
22
- getCiteprocCitations: () => Map<string, string>;
23
- }
24
- export declare class CitationEditableView extends CitationView<CitationEditableProps & EditableBlockProps> {
18
+ export declare class CitationEditableView extends CitationView<CitationViewProps & EditableBlockProps> {
25
19
  showPopper: () => void;
26
20
  private handleClose;
27
21
  private handleCancel;
@@ -30,7 +24,7 @@ export declare class CitationEditableView extends CitationView<CitationEditableP
30
24
  private handleCite;
31
25
  private insertBibliographyNode;
32
26
  private importItems;
33
- private updateInlineNode;
27
+ private updateNode;
34
28
  }
35
29
  declare const _default: (props: EditableBlockProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<CitationEditableView>;
36
30
  export default _default;
@@ -2,16 +2,16 @@ import { ManuscriptNodeView } from '@manuscripts/transform';
2
2
  import React from 'react';
3
3
  import { BaseNodeView } from './base_node_view';
4
4
  import { EditableBlockProps } from './editable_block';
5
- export interface ContributorsSectionProps extends EditableBlockProps {
5
+ export interface ContributorsProps extends EditableBlockProps {
6
6
  components: Record<string, React.ComponentType<unknown>>;
7
7
  subscribeStore: unknown;
8
8
  }
9
- export declare class ContributorsSectionView<PropsType extends ContributorsSectionProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
9
+ export declare class ContributorsView<PropsType extends ContributorsProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
10
10
  private metadata;
11
11
  initialise: () => void;
12
12
  protected createDOM: () => void;
13
13
  ignoreMutation: () => boolean;
14
14
  stopEvent: () => boolean;
15
15
  }
16
- declare const _default: (props: import("./base_node_view").BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<ContributorsSectionView<any>>;
16
+ declare const _default: (props: import("./base_node_view").BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<ContributorsView<any>>;
17
17
  export default _default;
@@ -13,24 +13,19 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { AuxiliaryObjectReference } from '@manuscripts/json-schema';
17
16
  import { ManuscriptNodeView } from '@manuscripts/transform';
18
17
  import { History } from 'history';
19
- import React from 'react';
20
18
  import { BaseNodeProps, BaseNodeView } from './base_node_view';
21
19
  export interface CrossReferenceViewProps extends BaseNodeProps {
22
20
  history: History;
23
- components: Record<string, React.ComponentType<any>>;
24
21
  }
25
22
  export declare class CrossReferenceView<PropsType extends CrossReferenceViewProps> extends BaseNodeView<PropsType> implements ManuscriptNodeView {
26
23
  protected popperContainer?: HTMLDivElement;
27
24
  selectNode: () => void;
28
25
  handleClick: () => void;
29
- showPopper: (referencedObjects: string[]) => void;
30
26
  updateContents: () => void;
31
27
  initialise: () => void;
32
28
  ignoreMutation: () => boolean;
33
- getAuxiliaryObjectReference: (id: string) => AuxiliaryObjectReference;
34
29
  createDOM: () => void;
35
30
  }
36
31
  declare const _default: (props: BaseNodeProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<CrossReferenceView<any>>;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- declare const _default: () => {
17
- dom: HTMLElement;
16
+ declare const _default: (type: string) => () => {
17
+ dom: HTMLDivElement;
18
18
  };
19
19
  export default _default;
@@ -13,10 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Node as ProsemirrorNode } from 'prosemirror-model';
17
16
  import { BaseNodeProps } from './base_node_view';
18
17
  import BlockView from './block_view';
19
- export declare const isSpecialSection: (node: ProsemirrorNode) => boolean | undefined;
20
18
  export declare class SectionTitleView<PropsType extends BaseNodeProps> extends BlockView<PropsType> {
21
19
  contentDOM: HTMLElement;
22
20
  elementType: string;
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.5.16",
4
+ "version": "1.6.1",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -29,11 +29,10 @@
29
29
  "@iarna/word-count": "^1.1.2",
30
30
  "@manuscripts/assets": "^0.6.4",
31
31
  "@manuscripts/json-schema": "2.2.1",
32
- "@manuscripts/library": "1.2.2",
33
- "@manuscripts/style-guide": "1.4.6",
34
- "@manuscripts/title-editor": "^1.1.0",
32
+ "@manuscripts/library": "1.3.0",
33
+ "@manuscripts/style-guide": "1.5.0",
35
34
  "@manuscripts/track-changes-plugin": "^1.7.4",
36
- "@manuscripts/transform": "1.5.8",
35
+ "@manuscripts/transform": "2.0.0",
37
36
  "astrocite-eutils": "^0.16.4",
38
37
  "axios": "^1.2.2",
39
38
  "codemirror": "^5.58.1",
@@ -124,23 +123,6 @@
124
123
  "styled-components": "^5.2.0",
125
124
  "typescript": "^4.0.5"
126
125
  },
127
- "peerDependencies": {
128
- "prosemirror-commands": "^1.5.0",
129
- "prosemirror-dropcursor": "^1.6.1",
130
- "prosemirror-history": "^1.3.0",
131
- "prosemirror-inputrules": "^1.2.0",
132
- "prosemirror-keymap": "^1.2.0",
133
- "prosemirror-model": "^1.18.3",
134
- "prosemirror-schema-list": "^1.2.2",
135
- "prosemirror-state": "^1.4.2",
136
- "prosemirror-tables": "^1.3.0",
137
- "prosemirror-transform": "^1.7.0",
138
- "prosemirror-utils": "^0.9.6",
139
- "prosemirror-view": "^1.29.1",
140
- "react": ">=16.11.0",
141
- "react-dom": ">=16.11.0",
142
- "react-modal": "^3.11.2"
143
- },
144
126
  "resolutions": {
145
127
  "@types/react": "^17.0.2"
146
128
  }
@@ -3,11 +3,11 @@
3
3
  This level is actually hidden in the editor
4
4
  Next levels are shifted 'up' by 1
5
5
  */
6
- .ProseMirror > section:not(.toc) {
6
+ .ProseMirror > div.body > section:not(.toc) {
7
7
  counter-increment: level_1 0;
8
8
  }
9
9
 
10
- .ProseMirror > section > .block-section_title > h1 {
10
+ .ProseMirror > div > .block-section_title > h1 {
11
11
  font-size: 16pt !important;
12
12
  font-style: normal !important;
13
13
  font-weight: bold !important;
@@ -21,11 +21,11 @@ Next levels are shifted 'up' by 1
21
21
  }
22
22
 
23
23
  /* LVL 2 */
24
- .ProseMirror > section > section:not(.toc) {
24
+ .ProseMirror > div.body > section:not(.toc) {
25
25
  counter-increment: level_1;
26
26
  counter-reset: level_2;
27
27
  }
28
- .ProseMirror > section > section > .block-section_title > h1 {
28
+ .ProseMirror > div > section > .block-section_title > h1 {
29
29
  font-size: 15.75pt !important;
30
30
  font-style: normal !important;
31
31
  font-weight: bold !important;
@@ -37,26 +37,26 @@ Next levels are shifted 'up' by 1
37
37
  text-indent: 0pt;
38
38
  display: inline;
39
39
  }
40
- .ProseMirror > section[data-category="MPSectionCategory:body"] {
40
+ .ProseMirror > div.body {
41
41
  counter-reset: level_1;
42
42
  }
43
- .ProseMirror > section[data-category="MPSectionCategory:body"] > section:not(.toc) > .block-section_title > h1::before {
43
+ .ProseMirror > div.body > section:not(.toc) > .block-section_title > h1::before {
44
44
  content: counter(level_1, decimal) '. ';
45
45
  }
46
46
 
47
47
  .ProseMirror
48
- > section
48
+ > div.body
49
49
  > section:not(.toc)
50
50
  > .block-section_title
51
51
  > h1.empty-node[data-placeholder]::before {
52
52
  content: counter(level_1, decimal) '. ' attr(data-placeholder);
53
53
  }
54
54
  /* LVL 3 */
55
- .ProseMirror > section > section > section:not(.toc) {
55
+ .ProseMirror > div.body > section > section:not(.toc) {
56
56
  counter-increment: level_2;
57
57
  counter-reset: level_3;
58
58
  }
59
- .ProseMirror > section > section > section > .block-section_title > h1 {
59
+ .ProseMirror > div > section > section > .block-section_title > h1 {
60
60
  font-size: 13.5pt !important;
61
61
  font-style: normal !important;
62
62
  font-weight: 700 !important;
@@ -69,7 +69,7 @@ Next levels are shifted 'up' by 1
69
69
  display: inline;
70
70
  }
71
71
  .ProseMirror
72
- > section
72
+ > div.body
73
73
  > section
74
74
  > section:not(.toc)
75
75
  > .block-section_title
@@ -77,7 +77,7 @@ Next levels are shifted 'up' by 1
77
77
  content: counter(level_1, decimal) '.' counter(level_2, decimal) '. ';
78
78
  }
79
79
  .ProseMirror
80
- > section
80
+ > div.body
81
81
  > section
82
82
  > section:not(.toc)
83
83
  > .block-section_title
@@ -86,12 +86,12 @@ Next levels are shifted 'up' by 1
86
86
  attr(data-placeholder);
87
87
  }
88
88
  /* LVL 4 */
89
- .ProseMirror > section > section > section > section:not(.toc) {
89
+ .ProseMirror > div.body > section > section > section:not(.toc) {
90
90
  counter-increment: level_3;
91
91
  counter-reset: level_4;
92
92
  }
93
93
  .ProseMirror
94
- > section
94
+ > div
95
95
  > section
96
96
  > section
97
97
  > section
@@ -109,7 +109,7 @@ Next levels are shifted 'up' by 1
109
109
  display: inline;
110
110
  }
111
111
  .ProseMirror
112
- > section
112
+ > div.body
113
113
  > section
114
114
  > section
115
115
  > section:not(.toc)
@@ -120,7 +120,7 @@ Next levels are shifted 'up' by 1
120
120
  }
121
121
 
122
122
  .ProseMirror
123
- > section
123
+ > div.body
124
124
  > section
125
125
  > section
126
126
  > section:not(.toc)
@@ -130,13 +130,13 @@ Next levels are shifted 'up' by 1
130
130
  counter(level_3, decimal) '. ' attr(data-placeholder);
131
131
  }
132
132
  /* LVL 5 */
133
- .ProseMirror > section > section > section > section > section:not(.toc) {
133
+ .ProseMirror > div.body > section > section > section > section:not(.toc) {
134
134
  counter-increment: level_4;
135
135
  counter-reset: level_5;
136
136
  }
137
137
 
138
138
  .ProseMirror
139
- > section
139
+ > div
140
140
  > section
141
141
  > section
142
142
  > section
@@ -155,7 +155,7 @@ Next levels are shifted 'up' by 1
155
155
  display: inline;
156
156
  }
157
157
  .ProseMirror
158
- > section
158
+ > div.body
159
159
  > section
160
160
  > section
161
161
  > section
@@ -166,7 +166,7 @@ Next levels are shifted 'up' by 1
166
166
  counter(level_3, decimal) '.' counter(level_4, decimal) '. ';
167
167
  }
168
168
  .ProseMirror
169
- > section
169
+ > div.body
170
170
  > section
171
171
  > section
172
172
  > section
@@ -179,7 +179,7 @@ Next levels are shifted 'up' by 1
179
179
  }
180
180
  /* LVL 6 */
181
181
  .ProseMirror
182
- > section
182
+ > div.body
183
183
  > section
184
184
  > section
185
185
  > section
@@ -189,7 +189,7 @@ Next levels are shifted 'up' by 1
189
189
  counter-reset: level_6;
190
190
  }
191
191
  .ProseMirror
192
- > section
192
+ > div
193
193
  > section
194
194
  > section
195
195
  > section
@@ -209,7 +209,7 @@ Next levels are shifted 'up' by 1
209
209
  display: inline;
210
210
  }
211
211
  .ProseMirror
212
- > section
212
+ > div.body
213
213
  > section
214
214
  > section
215
215
  > section
@@ -222,7 +222,7 @@ Next levels are shifted 'up' by 1
222
222
  counter(level_5, decimal) '. ';
223
223
  }
224
224
  .ProseMirror
225
- > section
225
+ > div.body
226
226
  > section
227
227
  > section
228
228
  > section
@@ -236,7 +236,7 @@ Next levels are shifted 'up' by 1
236
236
  }
237
237
  /* LVL 7 */
238
238
  .ProseMirror
239
- > section
239
+ > div.body
240
240
  > section
241
241
  > section
242
242
  > section
@@ -247,7 +247,7 @@ Next levels are shifted 'up' by 1
247
247
  counter-reset: level_7;
248
248
  }
249
249
  .ProseMirror
250
- > section
250
+ > div
251
251
  > section
252
252
  > section
253
253
  > section
@@ -267,7 +267,7 @@ Next levels are shifted 'up' by 1
267
267
  display: inline;
268
268
  }
269
269
  .ProseMirror
270
- > section
270
+ > div.body
271
271
  > section
272
272
  > section
273
273
  > section
@@ -281,7 +281,7 @@ Next levels are shifted 'up' by 1
281
281
  counter(level_5, decimal) '.' counter(level_6, decimal) '. ';
282
282
  }
283
283
  .ProseMirror
284
- > section
284
+ > div.body
285
285
  > section
286
286
  > section
287
287
  > section
@@ -295,14 +295,14 @@ Next levels are shifted 'up' by 1
295
295
  counter(level_5, decimal) '.' counter(level_6, decimal) '. '
296
296
  attr(data-placeholder);
297
297
  }
298
- [data-category="MPSectionCategory:backmatter"]::before {
298
+ .ProseMirror div.backmatter::before {
299
299
  content: '';
300
300
  border-bottom: 1px dashed #C9C9C9;
301
301
  display: block;
302
302
  margin: 11pt 49pt;
303
303
 
304
304
  }
305
- .ProseMirror section[data-category="MPSectionCategory:backmatter"] .block-section_title > h1 {
305
+ .ProseMirror div.backmatter .block-section_title > h1 {
306
306
  font-size: 13.5pt !important;
307
307
  color: #6E6E6E !important;
308
308
  }
@@ -550,14 +550,9 @@ Next levels are shifted 'up' by 1
550
550
  }
551
551
 
552
552
  .keywords h1 {
553
- color: #353535;
554
- font-family: Lato, sans-serif;
555
553
  font-size: 12px;
556
554
  font-style: italic;
557
555
  font-weight: 400;
558
- line-height: 16px;
559
- margin: 0 0 4px;
560
- padding: 0;
561
556
  }
562
557
 
563
558
  .keywords-list {
@@ -577,6 +572,7 @@ Next levels are shifted 'up' by 1
577
572
  border: 1px solid #f2f2f2;
578
573
  border-radius: 6px;
579
574
  position: relative;
575
+ cursor: default;
580
576
  }
581
577
 
582
578
  .keywords-list span.keyword.no-tracking {
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.modelsKey = void 0;
4
- const json_schema_1 = require("@manuscripts/json-schema");
5
- const transform_1 = require("@manuscripts/transform");
6
- const lodash_es_1 = require("lodash-es");
7
- const prosemirror_state_1 = require("prosemirror-state");
8
- const models_1 = require("./models");
9
- exports.modelsKey = new prosemirror_state_1.PluginKey('auxiliary_elements_order');
10
- exports.default = (props) => new prosemirror_state_1.Plugin({
11
- key: exports.modelsKey,
12
- state: {
13
- init: () => getAuxiliaryObjects(props.getModelMap()),
14
- apply: (tr, value, oldState, newState) => {
15
- const state = exports.modelsKey.getState(newState);
16
- if (!state) {
17
- return getAuxiliaryObjects(props.getModelMap());
18
- }
19
- return state;
20
- },
21
- },
22
- appendTransaction(transactions, oldState, newState) {
23
- if (!transactions.some((transaction) => transaction.docChanged)) {
24
- return null;
25
- }
26
- let state = exports.modelsKey.getState(newState);
27
- if (!state) {
28
- state = getAuxiliaryObjects(props.getModelMap());
29
- }
30
- const elementsOrder = (0, transform_1.getElementsOrder)(newState.doc).reduce((elements, obj) => (Object.assign(Object.assign({}, elements), { [obj.elementType]: obj.elements })), {});
31
- const stateElementsOrder = Object.values(state).reduce((elements, obj) => (Object.assign(Object.assign({}, elements), { [obj.elementType]: obj.elements })), {});
32
- if (!(0, lodash_es_1.isEqual)(stateElementsOrder, elementsOrder)) {
33
- let tr;
34
- Object.entries(elementsOrder).map(([key, elements]) => {
35
- const model = state[key] ||
36
- (0, transform_1.buildElementsOrder)(key);
37
- if (!(0, lodash_es_1.isEqual)(model.elements, elements)) {
38
- tr = (tr || newState.tr).setMeta(models_1.modelsKey, {
39
- ['UPDATE']: [Object.assign(Object.assign({}, model), { elements })],
40
- });
41
- }
42
- });
43
- tr === null || tr === void 0 ? void 0 : tr.setMeta('origin', exports.modelsKey);
44
- return tr;
45
- }
46
- return null;
47
- },
48
- });
49
- const getAuxiliaryObjects = (modelMap) => (0, transform_1.getModelsByType)(modelMap, json_schema_1.ObjectTypes.ElementsOrder).reduce((obj, value) => (Object.assign(Object.assign({}, obj), { [value.elementType]: value })), {});
@@ -1,17 +0,0 @@
1
- "use strict";
2
- /*!
3
- * © 2019 Atypon Systems LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });