@manuscripts/body-editor 3.12.4 → 3.12.5

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 (81) hide show
  1. package/dist/cjs/commands.js +4 -5
  2. package/dist/cjs/components/affiliations/AffiliationsModal.js +1 -3
  3. package/dist/cjs/components/keywords/AddKeywordInline.js +2 -2
  4. package/dist/cjs/components/outline/DraggableTree.js +4 -4
  5. package/dist/cjs/components/toolbar/helpers.js +7 -13
  6. package/dist/cjs/components/toolbar/type-selector/TypeSelector.js +5 -5
  7. package/dist/cjs/components/views/FootnotesSelector.js +2 -2
  8. package/dist/cjs/lib/track-changes-utils.js +3 -140
  9. package/dist/cjs/lib/utils.js +1 -1
  10. package/dist/cjs/lib/view.js +2 -1
  11. package/dist/cjs/menus.js +2 -2
  12. package/dist/cjs/plugins/affiliations.js +2 -2
  13. package/dist/cjs/plugins/objects.js +3 -6
  14. package/dist/cjs/plugins/persist.js +2 -4
  15. package/dist/cjs/plugins/search-replace/lib.js +2 -2
  16. package/dist/cjs/plugins/section_category.js +10 -43
  17. package/dist/cjs/plugins/section_title/autocompletion.js +2 -2
  18. package/dist/cjs/plugins/section_title/index.js +2 -5
  19. package/dist/cjs/plugins/selected-suggestion.js +1 -2
  20. package/dist/cjs/versions.js +1 -1
  21. package/dist/cjs/views/affiliations.js +4 -4
  22. package/dist/cjs/views/award.js +2 -2
  23. package/dist/cjs/views/base_node_view.js +3 -3
  24. package/dist/cjs/views/bibliography_element.js +3 -3
  25. package/dist/cjs/views/block_view.js +2 -2
  26. package/dist/cjs/views/citation_editable.js +3 -3
  27. package/dist/cjs/views/contributors.js +4 -4
  28. package/dist/cjs/views/creators.js +2 -2
  29. package/dist/cjs/views/figure_editable.js +5 -5
  30. package/dist/cjs/views/footnote.js +5 -5
  31. package/dist/cjs/views/general_table_footnote.js +4 -4
  32. package/dist/cjs/views/inline_footnote.js +3 -3
  33. package/dist/cjs/views/keyword.js +2 -2
  34. package/dist/cjs/views/keyword_group.js +2 -2
  35. package/dist/cjs/views/link_editable.js +2 -2
  36. package/dist/cjs/views/quote_image_editable.js +4 -4
  37. package/dist/es/commands.js +1 -2
  38. package/dist/es/components/affiliations/AffiliationsModal.js +1 -3
  39. package/dist/es/components/authors/AuthorsModal.js +1 -1
  40. package/dist/es/components/keywords/AddKeywordInline.js +1 -1
  41. package/dist/es/components/outline/DraggableTree.js +1 -1
  42. package/dist/es/components/toolbar/helpers.js +4 -9
  43. package/dist/es/components/toolbar/type-selector/TypeSelector.js +1 -1
  44. package/dist/es/components/views/FootnotesSelector.js +1 -1
  45. package/dist/es/lib/track-changes-utils.js +3 -128
  46. package/dist/es/lib/utils.js +1 -1
  47. package/dist/es/lib/view.js +2 -1
  48. package/dist/es/menus.js +2 -2
  49. package/dist/es/plugins/affiliations.js +1 -1
  50. package/dist/es/plugins/objects.js +3 -6
  51. package/dist/es/plugins/persist.js +3 -5
  52. package/dist/es/plugins/search-replace/lib.js +1 -1
  53. package/dist/es/plugins/section_category.js +10 -43
  54. package/dist/es/plugins/section_title/autocompletion.js +1 -1
  55. package/dist/es/plugins/section_title/index.js +2 -5
  56. package/dist/es/plugins/selected-suggestion.js +1 -2
  57. package/dist/es/versions.js +1 -1
  58. package/dist/es/views/affiliations.js +1 -1
  59. package/dist/es/views/award.js +1 -1
  60. package/dist/es/views/base_node_view.js +1 -1
  61. package/dist/es/views/bibliography_element.js +1 -1
  62. package/dist/es/views/block_view.js +1 -1
  63. package/dist/es/views/citation_editable.js +1 -1
  64. package/dist/es/views/contributors.js +1 -1
  65. package/dist/es/views/creators.js +1 -1
  66. package/dist/es/views/figure_editable.js +1 -1
  67. package/dist/es/views/footnote.js +1 -1
  68. package/dist/es/views/general_table_footnote.js +1 -1
  69. package/dist/es/views/inline_footnote.js +1 -1
  70. package/dist/es/views/keyword.js +1 -1
  71. package/dist/es/views/keyword_group.js +1 -1
  72. package/dist/es/views/link_editable.js +1 -1
  73. package/dist/es/views/quote_image_editable.js +1 -1
  74. package/dist/types/components/toolbar/helpers.d.ts +0 -1
  75. package/dist/types/lib/track-changes-utils.d.ts +2 -15
  76. package/dist/types/lib/utils.d.ts +1 -1
  77. package/dist/types/versions.d.ts +1 -1
  78. package/package.json +3 -3
  79. package/dist/cjs/lib/filtered-document.js +0 -49
  80. package/dist/es/lib/filtered-document.js +0 -44
  81. package/dist/types/lib/filtered-document.d.ts +0 -18
@@ -15,10 +15,10 @@
15
15
  */
16
16
  import { AddKeywordInline } from '../components/keywords/AddKeywordInline';
17
17
  import { createKeyboardInteraction } from '../lib/navigation-utils';
18
- import { isDeleted } from '../lib/track-changes-utils';
19
18
  import BlockView from './block_view';
20
19
  import { createNodeView } from './creators';
21
20
  import ReactSubView from './ReactSubView';
21
+ import { isDeleted } from '@manuscripts/track-changes-plugin';
22
22
  export class KeywordGroupView extends BlockView {
23
23
  constructor() {
24
24
  super(...arguments);
@@ -16,11 +16,11 @@
16
16
  import { schema } from '@manuscripts/transform';
17
17
  import { TextSelection } from 'prosemirror-state';
18
18
  import { LinkForm, } from '../components/views/LinkForm';
19
- import { isDeleted } from '../lib/track-changes-utils';
20
19
  import { allowedHref } from '../lib/url';
21
20
  import { createEditableNodeView } from './creators';
22
21
  import { LinkView } from './link';
23
22
  import ReactSubView from './ReactSubView';
23
+ import { isDeleted } from '@manuscripts/track-changes-plugin';
24
24
  export class LinkEditableView extends LinkView {
25
25
  constructor() {
26
26
  super(...arguments);
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { addTrackChangesAttributes, addTrackChangesClassNames, isDeleted, } from '@manuscripts/track-changes-plugin';
16
17
  import { plusIcon } from '../icons';
17
- import { addTrackChangesAttributes, addTrackChangesClassNames, isDeleted, } from '../lib/track-changes-utils';
18
18
  import { createEditableNodeView } from './creators';
19
19
  import { FigureEditableView } from './figure_editable';
20
20
  export class QuoteImageEditableView extends FigureEditableView {
@@ -4,7 +4,6 @@ import { EditorState, Transaction } from 'prosemirror-state';
4
4
  import { EditorView } from 'prosemirror-view';
5
5
  import { Dispatch } from '../../commands';
6
6
  import { Option } from './type-selector/TypeSelector';
7
- export declare const shouldSkipNode: (node: Node) => boolean;
8
7
  export declare const optionName: (nodeType: ManuscriptNodeType) => string;
9
8
  export declare const titleCase: (text: string) => string;
10
9
  export declare const findSelectedOption: (options: Option[]) => Option | undefined;
@@ -13,19 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { TrackedAttrs } from '@manuscripts/track-changes-plugin';
17
- import { Attrs, Fragment, Mark, Node as ProsemirrorNode } from 'prosemirror-model';
18
- export declare function isDeleted(node: ProsemirrorNode | Mark): boolean;
19
- export declare function isShadowDelete(node: ProsemirrorNode): boolean;
20
- export declare function isPendingInsert(node: ProsemirrorNode): boolean;
21
- export declare function isPending(node: ProsemirrorNode): boolean;
22
- export declare function isPendingSetAttrs(node: ProsemirrorNode): boolean;
23
- export declare function getChangeClasses(dataTracked?: TrackedAttrs[]): string[];
24
- export declare function isTracked(node: ProsemirrorNode | Mark): boolean;
25
- export declare const getAttrsTrackingButton: (changeID: string) => HTMLButtonElement;
16
+ import { Node as ProsemirrorNode } from 'prosemirror-model';
26
17
  export declare function isHidden(node: ProsemirrorNode): boolean;
27
- export declare function isDeletedText(node: ProsemirrorNode): boolean;
28
- export declare function getActualTextContent(fragment: Fragment): string;
29
- export declare function sanitizeAttrsChange<T extends ProsemirrorNode>(newAttr: T['attrs'], currentAttrs: T['attrs']): T["attrs"];
30
- export declare const addTrackChangesAttributes: (attrs: Attrs, dom: Element) => void;
31
- export declare const addTrackChangesClassNames: (attrs: Attrs, dom: Element) => void;
18
+ export declare const getAttrsTrackingButton: (changeID: string) => HTMLButtonElement;
@@ -37,7 +37,7 @@ export declare const isEditAllowed: (state: EditorState) => boolean;
37
37
  export declare const createToggleButton: (listener: (event: MouseEvent | KeyboardEvent) => void, what: string) => HTMLButtonElement;
38
38
  export declare const getInsertPos: (type: ManuscriptNodeType, parent: ManuscriptNode, pos: number) => number;
39
39
  export declare const findInsertionPosition: (type: ManuscriptNodeType, doc: ManuscriptNode) => number;
40
- export declare const filterBlockNodes: (fragment: Fragment, predicate: (node: ProseMirrorNode) => boolean) => Fragment;
40
+ export declare const filterBlockNodes: (fragment: Fragment, predicate?: (node: ProseMirrorNode) => boolean) => Fragment;
41
41
  export declare const getLastTitleNode: (state: ManuscriptEditorState) => {
42
42
  node: ProseMirrorNode;
43
43
  pos: number;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.12.4";
1
+ export declare const VERSION = "3.12.5";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
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": "3.12.4",
4
+ "version": "3.12.5",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -38,8 +38,8 @@
38
38
  "@citation-js/plugin-ris": "0.7.18",
39
39
  "@iarna/word-count": "1.1.2",
40
40
  "@manuscripts/style-guide": "3.5.6",
41
- "@manuscripts/track-changes-plugin": "2.3.8",
42
- "@manuscripts/transform": "4.3.27",
41
+ "@manuscripts/track-changes-plugin": "2.3.9",
42
+ "@manuscripts/transform": "4.3.28",
43
43
  "@popperjs/core": "2.11.8",
44
44
  "citeproc": "2.4.63",
45
45
  "codemirror": "5.65.19",
@@ -1,49 +0,0 @@
1
- "use strict";
2
- /*!
3
- * © 2025 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 });
18
- exports.getDocWithoutMovedContent = void 0;
19
- exports.isMoved = isMoved;
20
- const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
21
- function isMoved(node) {
22
- if (node.attrs.dataTracked) {
23
- const changes = node.attrs.dataTracked;
24
- return changes.some(({ operation, status, moveNodeId }) => operation === track_changes_plugin_1.CHANGE_OPERATION.delete &&
25
- status === track_changes_plugin_1.CHANGE_STATUS.pending &&
26
- moveNodeId);
27
- }
28
- return false;
29
- }
30
- const filterMovedContent = (node) => {
31
- const nodes = [];
32
- node.forEach((child) => {
33
- const { attrs } = child;
34
- if (isMoved(child)) {
35
- return;
36
- }
37
- if (child.isText) {
38
- nodes.push(child);
39
- }
40
- else {
41
- nodes.push(child.type.create(attrs, filterMovedContent(child), child.marks));
42
- }
43
- });
44
- return nodes;
45
- };
46
- const getDocWithoutMovedContent = (doc) => {
47
- return doc.type.create(doc.attrs, filterMovedContent(doc), doc.marks);
48
- };
49
- exports.getDocWithoutMovedContent = getDocWithoutMovedContent;
@@ -1,44 +0,0 @@
1
- /*!
2
- * © 2025 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 { CHANGE_OPERATION, CHANGE_STATUS, } from '@manuscripts/track-changes-plugin';
17
- export function isMoved(node) {
18
- if (node.attrs.dataTracked) {
19
- const changes = node.attrs.dataTracked;
20
- return changes.some(({ operation, status, moveNodeId }) => operation === CHANGE_OPERATION.delete &&
21
- status === CHANGE_STATUS.pending &&
22
- moveNodeId);
23
- }
24
- return false;
25
- }
26
- const filterMovedContent = (node) => {
27
- const nodes = [];
28
- node.forEach((child) => {
29
- const { attrs } = child;
30
- if (isMoved(child)) {
31
- return;
32
- }
33
- if (child.isText) {
34
- nodes.push(child);
35
- }
36
- else {
37
- nodes.push(child.type.create(attrs, filterMovedContent(child), child.marks));
38
- }
39
- });
40
- return nodes;
41
- };
42
- export const getDocWithoutMovedContent = (doc) => {
43
- return doc.type.create(doc.attrs, filterMovedContent(doc), doc.marks);
44
- };
@@ -1,18 +0,0 @@
1
- /*!
2
- * © 2025 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 { ManuscriptNode } from '@manuscripts/transform';
17
- export declare function isMoved(node: ManuscriptNode): boolean;
18
- export declare const getDocWithoutMovedContent: (doc: ManuscriptNode) => import("prosemirror-model").Node;