@manuscripts/article-editor 3.2.19-LEAN-3958.2 → 3.2.19-LEAN-3933.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js +3 -3
  2. package/dist/cjs/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
  3. package/dist/cjs/components/track-changes/suggestion-list/SuggestionSnippet.js +118 -26
  4. package/dist/cjs/components/track-changes/suggestion-list/SuggestionSnippet.js.map +1 -1
  5. package/dist/cjs/lib/fonts.js +0 -3
  6. package/dist/cjs/lib/fonts.js.map +1 -1
  7. package/dist/cjs/lib/footnotes.js +49 -0
  8. package/dist/cjs/lib/footnotes.js.map +1 -0
  9. package/dist/cjs/lib/tracking.js +0 -3
  10. package/dist/cjs/lib/tracking.js.map +1 -1
  11. package/dist/cjs/lib/utils.js +28 -11
  12. package/dist/cjs/lib/utils.js.map +1 -1
  13. package/dist/es/components/track-changes/suggestion-list/Suggestion.js +3 -3
  14. package/dist/es/components/track-changes/suggestion-list/Suggestion.js.map +1 -1
  15. package/dist/es/components/track-changes/suggestion-list/SuggestionSnippet.js +119 -27
  16. package/dist/es/components/track-changes/suggestion-list/SuggestionSnippet.js.map +1 -1
  17. package/dist/es/lib/fonts.js +0 -3
  18. package/dist/es/lib/fonts.js.map +1 -1
  19. package/dist/es/lib/footnotes.js +43 -0
  20. package/dist/es/lib/footnotes.js.map +1 -0
  21. package/dist/es/lib/tracking.js +0 -3
  22. package/dist/es/lib/tracking.js.map +1 -1
  23. package/dist/es/lib/utils.js +25 -10
  24. package/dist/es/lib/utils.js.map +1 -1
  25. package/dist/types/lib/fonts.d.ts +0 -3
  26. package/dist/types/{components/track-changes/suggestion-list/SnippetContent.d.ts → lib/footnotes.d.ts} +5 -8
  27. package/dist/types/lib/utils.d.ts +8 -1
  28. package/package.json +3 -3
  29. package/dist/cjs/components/track-changes/suggestion-list/SnippetContent.js +0 -72
  30. package/dist/cjs/components/track-changes/suggestion-list/SnippetContent.js.map +0 -1
  31. package/dist/cjs/lib/change-handlers.js +0 -123
  32. package/dist/cjs/lib/change-handlers.js.map +0 -1
  33. package/dist/cjs/lib/node-content-retriever.js +0 -130
  34. package/dist/cjs/lib/node-content-retriever.js.map +0 -1
  35. package/dist/es/components/track-changes/suggestion-list/SnippetContent.js +0 -44
  36. package/dist/es/components/track-changes/suggestion-list/SnippetContent.js.map +0 -1
  37. package/dist/es/lib/change-handlers.js +0 -117
  38. package/dist/es/lib/change-handlers.js.map +0 -1
  39. package/dist/es/lib/node-content-retriever.js +0 -123
  40. package/dist/es/lib/node-content-retriever.js.map +0 -1
  41. package/dist/types/lib/change-handlers.d.ts +0 -22
  42. package/dist/types/lib/node-content-retriever.d.ts +0 -37
@@ -12,7 +12,4 @@
12
12
  import '@fontsource/lato';
13
13
  import '@fontsource/pt-sans';
14
14
  import '@fontsource/pt-serif';
15
- import '@fontsource/lato/300.css';
16
- import '@fontsource/lato/400.css';
17
- import '@fontsource/lato/700.css';
18
15
  //# sourceMappingURL=fonts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../src/lib/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,kBAAkB,CAAA;AACzB,OAAO,qBAAqB,CAAA;AAC5B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,0BAA0B,CAAA;AACjC,OAAO,0BAA0B,CAAA;AACjC,OAAO,0BAA0B,CAAA"}
1
+ {"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../src/lib/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,kBAAkB,CAAA;AACzB,OAAO,qBAAqB,CAAA;AAC5B,OAAO,sBAAsB,CAAA"}
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
+ *
4
+ * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
+ *
6
+ * The Original Code is manuscripts-frontend.
7
+ *
8
+ * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
+ *
10
+ * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
+ */
12
+ import { findPluginByKey, getNodeTextContent } from './utils';
13
+ export const findFootnoteById = (doc, id) => {
14
+ let footnoteNode = null;
15
+ doc.descendants((node) => {
16
+ if (node.type.name === 'footnote' && node.attrs.id === id) {
17
+ footnoteNode = node;
18
+ return false; // stop traversal
19
+ }
20
+ if (footnoteNode) {
21
+ return false;
22
+ }
23
+ return true; // continue traversal
24
+ });
25
+ return footnoteNode;
26
+ };
27
+ export const getInlineFootnoteContent = (doc, attrs) => {
28
+ let footnote = null;
29
+ if (attrs.rids && attrs.rids.length > 0) {
30
+ footnote = findFootnoteById(doc, attrs.rids[0]);
31
+ }
32
+ return `<sup class="footnote-decoration">${attrs.contents ? attrs.contents : ''}</sup>${footnote ? footnote.textContent : ''}`;
33
+ };
34
+ export const getFootnoteText = (state, node) => {
35
+ const footnotesPlugin = findPluginByKey(state, 'footnotes');
36
+ const pluginState = footnotesPlugin?.getState(state);
37
+ let decorationText = '';
38
+ if (pluginState) {
39
+ decorationText = pluginState.labels.get(node.attrs.id);
40
+ }
41
+ return `<sup class="footnote-decoration">${decorationText ? decorationText : ''}</sup>${getNodeTextContent(node)}`;
42
+ };
43
+ //# sourceMappingURL=footnotes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footnotes.js","sourceRoot":"","s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CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;IAC3D,MAAM,WAAW,GAAG,eAAe,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;IACpD,IAAI,cAAc,GAAG,EAAE,CAAA;IACvB,IAAI,WAAW,EAAE;QACf,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;KACvD;IACD,OAAO,oCACL,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EACpC,SAAS,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAA;AACrC,CAAC,CAAA"}
@@ -31,9 +31,6 @@ export const changeOperationAlias = (operation) => {
31
31
  case 'set_attrs': {
32
32
  return 'Updated';
33
33
  }
34
- case 'wrap_with_node': {
35
- return 'Inserted';
36
- }
37
34
  default: {
38
35
  return 'null';
39
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/lib/tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqBH,MAAM,CAAC,MAAM,UAAU,GAAe,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,IAAI,MAAM,CAAC,EAAE,EAAE;QACb,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,OAAO;YAChB,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;KACH;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAiB,EAAU,EAAE;IAChE,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ,CAAC,CAAC;YACb,OAAO,SAAS,CAAA;SACjB;QACD,KAAK,QAAQ,CAAC,CAAC;YACb,OAAO,UAAU,CAAA;SAClB;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,SAAS,CAAA;SACjB;QACD,KAAK,gBAAgB,CAAC,CAAC;YACrB,OAAO,UAAU,CAAA;SAClB;QACD,OAAO,CAAC,CAAC;YACP,OAAO,MAAM,CAAA;SACd;KACF;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/lib/tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqBH,MAAM,CAAC,MAAM,UAAU,GAAe,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,IAAI,MAAM,CAAC,EAAE,EAAE;QACb,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,OAAO;YAChB,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;KACH;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAiB,EAAU,EAAE;IAChE,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ,CAAC,CAAC;YACb,OAAO,SAAS,CAAA;SACjB;QACD,KAAK,QAAQ,CAAC,CAAC;YACb,OAAO,UAAU,CAAA;SAClB;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,SAAS,CAAA;SACjB;QACD,OAAO,CAAC,CAAC;YACP,OAAO,MAAM,CAAA;SACd;KACF;AACH,CAAC,CAAA"}
@@ -1,17 +1,32 @@
1
+ export const getNodeTextContent = (node) => {
2
+ let textContent = '';
3
+ // Traverse the node and its descendants
4
+ node.forEach((child) => {
5
+ if (child.isText) {
6
+ // If the child is a text node, add its text content
7
+ textContent += child.text;
8
+ }
9
+ else {
10
+ // If the child is not a text node, recursively collect text content
11
+ textContent += getNodeTextContent(child);
12
+ }
13
+ });
14
+ return textContent;
15
+ };
16
+ export const findPluginByKey = (state, keyName) => {
17
+ for (let i = 0; i < state.plugins.length; i++) {
18
+ const plugin = state.plugins[i];
19
+ if (plugin.key === keyName + '$') {
20
+ return plugin;
21
+ }
22
+ }
23
+ return null;
24
+ };
1
25
  export const getParentNode = (state, pos) => {
2
26
  const resolvedPos = state.doc.resolve(pos);
3
27
  for (let depth = resolvedPos.depth; depth > 0; depth--) {
4
28
  const parent = resolvedPos.node(depth);
5
- if (parent.isText === false) {
6
- if (parent.type == state.schema.nodes.paragraph) {
7
- const grandParent = resolvedPos.node(depth - 1);
8
- if (grandParent.type == state.schema.nodes.footnote) {
9
- return grandParent;
10
- }
11
- else {
12
- return parent;
13
- }
14
- }
29
+ if (parent.isTextblock === false) {
15
30
  return parent;
16
31
  }
17
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAkB,EAAE,GAAW,EAAE,EAAE;IAC/D,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAE1C,KAAK,IAAI,KAAK,GAAG,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE;QACtD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtC,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE;YAC3B,IAAI,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE;gBAC/C,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;gBAC/C,IAAI,WAAW,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE;oBACnD,OAAO,WAAW,CAAA;iBACnB;qBAAM;oBACL,OAAO,MA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AG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtC,IAAI,MAAM,CAAC,WAAW,KAAK,KAAK,EAAE;YAChC,OAAO,MAAM,CAAA;SACd;KACF;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
@@ -12,6 +12,3 @@
12
12
  import '@fontsource/lato';
13
13
  import '@fontsource/pt-sans';
14
14
  import '@fontsource/pt-serif';
15
- import '@fontsource/lato/300.css';
16
- import '@fontsource/lato/400.css';
17
- import '@fontsource/lato/700.css';
@@ -7,12 +7,9 @@
7
7
  *
8
8
  * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
9
  *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
10
+ * All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
11
11
  */
12
- import React from 'react';
13
- interface ContentProps {
14
- content: string;
15
- isEquation?: boolean;
16
- }
17
- declare const SnippetContent: React.FC<ContentProps>;
18
- export default SnippetContent;
12
+ import { ManuscriptEditorState, ManuscriptNode } from '@manuscripts/transform';
13
+ export declare const findFootnoteById: (doc: ManuscriptNode, id: string) => ManuscriptNode | null;
14
+ export declare const getInlineFootnoteContent: (doc: ManuscriptNode, attrs: Record<any, any>) => string;
15
+ export declare const getFootnoteText: (state: ManuscriptEditorState, node: ManuscriptNode) => string;
@@ -9,5 +9,12 @@
9
9
  *
10
10
  * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
11
11
  */
12
- import { EditorState } from 'prosemirror-state';
12
+ import { ManuscriptEditorState, ManuscriptNode } from '@manuscripts/transform';
13
+ import { EditorState, Plugin } from 'prosemirror-state';
14
+ interface ExtendedPlugin extends Plugin {
15
+ key: string;
16
+ }
17
+ export declare const getNodeTextContent: (node: ManuscriptNode) => string;
18
+ export declare const findPluginByKey: (state: ManuscriptEditorState, keyName: string) => ExtendedPlugin | null;
13
19
  export declare const getParentNode: (state: EditorState, pos: number) => import("prosemirror-model").Node | null;
20
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manuscripts/article-editor",
3
- "version": "3.2.19-LEAN-3958.2",
3
+ "version": "3.2.19-LEAN-3933.0",
4
4
  "license": "CPAL-1.0",
5
5
  "description": "React components for editing and viewing manuscripts",
6
6
  "repository": "github:Atypon-OpenSource/manuscripts-article-editor",
@@ -35,12 +35,12 @@
35
35
  "@fontsource/lato": "^4.5.10",
36
36
  "@fontsource/pt-sans": "^4.5.11",
37
37
  "@fontsource/pt-serif": "^4.5.11",
38
- "@manuscripts/body-editor": "2.2.20-LEAN-3958.0",
38
+ "@manuscripts/body-editor": "2.2.20-LEAN-3933.0",
39
39
  "@manuscripts/json-schema": "2.2.11",
40
40
  "@manuscripts/library": "1.3.11",
41
41
  "@manuscripts/style-guide": "2.0.21",
42
42
  "@manuscripts/track-changes-plugin": "1.7.23",
43
- "@manuscripts/transform": "3.0.5-LEAN-3958.0",
43
+ "@manuscripts/transform": "3.0.5-LEAN-3933.1",
44
44
  "@popperjs/core": "^2.11.8",
45
45
  "@reach/tabs": "^0.18.0",
46
46
  "@types/use-sync-external-store": "^0.0.6",
@@ -1,72 +0,0 @@
1
- "use strict";
2
- /*!
3
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
4
- *
5
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
6
- *
7
- * The Original Code is manuscripts-frontend.
8
- *
9
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
10
- *
11
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
12
- */
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const body_editor_1 = require("@manuscripts/body-editor");
41
- const dompurify_1 = __importDefault(require("dompurify"));
42
- const react_1 = __importStar(require("react"));
43
- const styled_components_1 = __importDefault(require("styled-components"));
44
- const SnippetContent = ({ content, isEquation }) => {
45
- const contentRef = (0, react_1.useRef)(null);
46
- (0, react_1.useEffect)(() => {
47
- if (contentRef.current && content) {
48
- contentRef.current.innerHTML = dompurify_1.default.sanitize(': ' + content) || '';
49
- if (isEquation) {
50
- (0, body_editor_1.renderMath)(contentRef.current);
51
- }
52
- }
53
- }, [content, isEquation]);
54
- return react_1.default.createElement(StyledContent, { ref: contentRef, "data-mathjax": isEquation });
55
- };
56
- exports.default = SnippetContent;
57
- const StyledContent = styled_components_1.default.span `
58
- color: #353535;
59
- font-family: Lato, sans-serif;
60
- font-size: 12px;
61
- font-weight: 400;
62
- line-height: 16px;
63
-
64
- &[data-mathjax='true'] {
65
- text-overflow: unset;
66
- }
67
-
68
- .inspector-list-item::after {
69
- content: '...';
70
- }
71
- `;
72
- //# sourceMappingURL=SnippetContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SnippetContent.js","sourceRoot":"","sources":["../../../../../src/components/track-changes/suggestion-list/SnippetContent.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0DAAqD;AACrD,0DAA8B;AAC9B,+CAAgD;AAChD,0EAAsC;AAOtC,MAAM,cAAc,GAA2B,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;IACzE,MAAM,UAAU,GAAG,IAAA,cAAM,EAAkB,IAAI,CAAC,CAAA;IAEhD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,UAAU,CAAC,OAAO,IAAI,OAAO,EAAE;YACjC,UAAU,CAAC,OAAO,CAAC,SAAS,GAAG,mBAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAA;YACpE,IAAI,UAAU,EAAE;gBACd,IAAA,wBAAU,EAAC,UAAU,CAAC,OAAO,CAAC,CAAA;aAC/B;SACF;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAA;IAEzB,OAAO,8BAAC,aAAa,IAAC,GAAG,EAAE,UAAU,kBAAgB,UAAU,GAAI,CAAA;AACrE,CAAC,CAAA;AAED,kBAAe,cAAc,CAAA;AAE7B,MAAM,aAAa,GAAG,2BAAM,CAAC,IAAI,CAAA;;;;;;;;;;;;;;CAchC,CAAA"}
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleUnknownChange = exports.handleNodeChange = exports.handleTextChange = void 0;
4
- const transform_1 = require("@manuscripts/transform");
5
- const node_content_retriever_1 = require("./node-content-retriever");
6
- const tracking_1 = require("./tracking");
7
- const utils_1 = require("./utils");
8
- const handleTextChange = (suggestion, view, dataTracked) => {
9
- const parentNodeType = (0, utils_1.getParentNode)(view.state, suggestion.from)?.type;
10
- let nodeName;
11
- if (parentNodeType) {
12
- const parentNodeName = transform_1.nodeNames.get(parentNodeType) || parentNodeType?.name;
13
- nodeName =
14
- parentNodeType === transform_1.schema.nodes.paragraph
15
- ? 'text'
16
- : parentNodeName + ' text';
17
- }
18
- return {
19
- operation: (0, tracking_1.changeOperationAlias)(dataTracked.operation),
20
- nodeName: nodeName || suggestion.nodeType.name,
21
- content: suggestion.text,
22
- };
23
- };
24
- exports.handleTextChange = handleTextChange;
25
- const handleNodeChange = (suggestion, view, doc, dataTracked) => {
26
- const nodeContentRetriever = new node_content_retriever_1.NodeTextContentRetriever(view.state);
27
- const { node } = suggestion;
28
- const operation = (0, tracking_1.changeOperationAlias)(dataTracked.operation);
29
- const nodeName = transform_1.nodeNames.get(node.type) || node.type.name;
30
- switch (node.type) {
31
- case transform_1.schema.nodes.inline_footnote: {
32
- return {
33
- operation,
34
- nodeName,
35
- content: nodeContentRetriever.getInlineFootnoteContent(doc, node.attrs),
36
- };
37
- }
38
- case transform_1.schema.nodes.footnote: {
39
- return {
40
- operation,
41
- nodeName,
42
- content: nodeContentRetriever.getFootnoteContent(node),
43
- };
44
- }
45
- case transform_1.schema.nodes.contributor: {
46
- const contributorTextContent = `${node.attrs.bibliographicName.given} ${node.attrs.bibliographicName.family}`;
47
- return {
48
- operation,
49
- nodeName,
50
- content: contributorTextContent,
51
- };
52
- }
53
- case transform_1.schema.nodes.affiliation: {
54
- const affiliationTextContent = node.attrs.institution;
55
- return {
56
- operation,
57
- nodeName,
58
- content: affiliationTextContent,
59
- };
60
- }
61
- case transform_1.schema.nodes.citation: {
62
- return {
63
- operation,
64
- nodeName,
65
- content: nodeContentRetriever.getContentFromBibliography(node.attrs.id, node),
66
- };
67
- }
68
- case transform_1.schema.nodes.bibliography_item: {
69
- return {
70
- operation,
71
- nodeName,
72
- content: nodeContentRetriever.getContentFromBibliography(node.attrs.id, node),
73
- };
74
- }
75
- case transform_1.schema.nodes.figure_element:
76
- case transform_1.schema.nodes.table_element:
77
- return {
78
- operation,
79
- nodeName,
80
- content: nodeContentRetriever.getFigureLabel(node),
81
- };
82
- case transform_1.schema.nodes.inline_equation:
83
- case transform_1.schema.nodes.equation_element:
84
- return {
85
- operation,
86
- nodeName,
87
- content: nodeContentRetriever.getEquationContent(node),
88
- isEquation: true,
89
- };
90
- case transform_1.schema.nodes.section: {
91
- const nodeName = node.attrs.category === 'MPSectionCategory:subsection'
92
- ? 'Subsection'
93
- : 'Section';
94
- return {
95
- operation,
96
- nodeName,
97
- content: nodeContentRetriever.getFirstChildContent(node),
98
- };
99
- }
100
- case transform_1.schema.nodes.list:
101
- return {
102
- operation,
103
- nodeName,
104
- content: `<span class="inspector-list-item">${nodeContentRetriever.getFirstChildContent(node)}</span>`,
105
- };
106
- default:
107
- return {
108
- operation,
109
- nodeName,
110
- content: nodeContentRetriever.getNodeTextContent(node),
111
- };
112
- }
113
- };
114
- exports.handleNodeChange = handleNodeChange;
115
- const handleUnknownChange = () => {
116
- return {
117
- operation: '',
118
- nodeName: '',
119
- content: 'Unknown change!',
120
- };
121
- };
122
- exports.handleUnknownChange = handleUnknownChange;
123
- //# sourceMappingURL=change-handlers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"change-handlers.js","sourceRoot":"","sources":["../../../src/lib/change-handlers.ts"],"names":[],"mappings":";;;AAgBA,sDAA0D;AAE1D,qEAAmE;AACnE,yCAAiD;AACjD,mCAAuC;AAShC,MAAM,gBAAgB,GAAG,CAC9B,UAAsB,EACtB,IAAS,EACT,WAAgB,EACI,EAAE;IACtB,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,C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C;QAClC,KAAK,kBAAM,CAAC,KAAK,CAAC,gBAAgB;YAChC,OAAO;gBACL,SAAS;gBACT,QAAQ;gBACR,OAAO,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,IAAI,CAAC;gBACtD,UAAU,EAAE,IAAI;aACjB,CAAA;QACH,KAAK,kBAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACzB,MAAM,QAAQ,GACZ,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,8BAA8B;gBACpD,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,SAAS,CAAA;YACf,OAAO;gBACL,SAAS;gBACT,QAAQ;gBACR,OAAO,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,CAAC;aACzD,CAAA;SACF;QACD,KAAK,kBAAM,CAAC,KAAK,CAAC,IAAI;YACpB,OAAO;gBACL,SAAS;gBACT,QAAQ;gBACR,OAAO,EAAE,qCAAqC,oBAAoB,CAAC,oBAAoB,CACrF,IAAI,CACL,SAAS;aACX,CAAA;QACH;YACE,OAAO;gBACL,SAAS;gBACT,QAAQ;gBACR,OAAO,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,IAAI,CAAC;aACvD,CAAA;KACJ;AACH,CAAC,CAAA;AAvGY,QAAA,gBAAgB,oBAuG5B;AAEM,MAAM,mBAAmB,GAAG,GAAgB,EAAE;IACnD,OAAO;QACL,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,iBAAiB;KAC3B,CAAA;AACH,CAAC,CAAA;AANY,QAAA,mBAAmB,uBAM/B"}
@@ -1,130 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NodeTextContentRetriever = void 0;
7
- /*!
8
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
9
- *
10
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
11
- *
12
- * The Original Code is manuscripts-frontend.
13
- *
14
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
15
- *
16
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
17
- */
18
- const body_editor_1 = require("@manuscripts/body-editor");
19
- const transform_1 = require("@manuscripts/transform");
20
- const dompurify_1 = __importDefault(require("dompurify"));
21
- class NodeTextContentRetriever {
22
- constructor(state) {
23
- this.state = state;
24
- }
25
- /**
26
- * Recursively retrieves text content from a ManuscriptNode.
27
- */
28
- getNodeTextContent(node) {
29
- let textContent = '';
30
- if (!(0, transform_1.isElementNodeType)(node.type)) {
31
- node.forEach((child) => {
32
- if (child.isText) {
33
- textContent += child.text;
34
- }
35
- else {
36
- textContent += this.getNodeTextContent(child);
37
- }
38
- });
39
- }
40
- return textContent;
41
- }
42
- /**
43
- * Retrieves the text content of the first child node.
44
- */
45
- getFirstChildContent(node) {
46
- return node.firstChild ? node.firstChild.textContent : '';
47
- }
48
- /**
49
- * Retrieves the text content from a bibliography node.
50
- */
51
- getContentFromBibliography(id, node) {
52
- const bibPlugin = body_editor_1.bibliographyPluginKey.get(this.state);
53
- const bib = bibPlugin?.getState(this.state);
54
- if (!bib) {
55
- return '';
56
- }
57
- if (node.type === transform_1.schema.nodes.citation) {
58
- const text = bib?.renderedCitations.get(id);
59
- const citation = dompurify_1.default.sanitize(text && text !== '[NO_PRINTED_FORM]' ? text : ' ', {
60
- ALLOWED_TAGS: ['i', 'b', 'span', 'sup', 'sub', '#text'],
61
- });
62
- return citation ? citation.replace(/<[^>]*>/g, '') : '';
63
- }
64
- else {
65
- const [meta, bibliography] = bib.provider.makeBibliography();
66
- const selectedBib = meta.entry_ids.findIndex((entry) => entry[0] === id);
67
- if (selectedBib === -1) {
68
- return `<span> ${node.attrs.title || 'untitled'} </span> ${(0, body_editor_1.metadata)(node.attrs)}`;
69
- }
70
- const parser = new DOMParser();
71
- const textContent = parser.parseFromString(bibliography[selectedBib], 'text/html').body.textContent;
72
- return textContent || '';
73
- }
74
- }
75
- /**
76
- * Retrieves the content of an equation node.
77
- */
78
- getEquationContent(node) {
79
- if (node.firstChild && node.type === transform_1.schema.nodes.equation_element) {
80
- return node.firstChild.attrs.contents;
81
- }
82
- else if (node) {
83
- return node.attrs.contents;
84
- }
85
- return '';
86
- }
87
- /**
88
- * Retrieves the label of a figure node.
89
- */
90
- getFigureLabel(node) {
91
- const objectsPlugin = body_editor_1.objectsPluginKey.get(this.state);
92
- const pluginState = objectsPlugin?.getState(this.state);
93
- const target = pluginState?.get(node.attrs.id);
94
- return target?.label || '';
95
- }
96
- /**
97
- * Finds a footnote node by its ID.
98
- */
99
- findFootnoteById(doc, id) {
100
- let footnoteNode = null;
101
- doc.descendants((node) => {
102
- if (node.type === transform_1.schema.nodes.footnote && node.attrs.id === id) {
103
- footnoteNode = node;
104
- return false;
105
- }
106
- return !footnoteNode;
107
- });
108
- return footnoteNode;
109
- }
110
- /**
111
- * Retrieves the inline footnote content.
112
- */
113
- getInlineFootnoteContent(doc, attrs) {
114
- const footnote = attrs.rids && attrs.rids.length > 0
115
- ? this.findFootnoteById(doc, attrs.rids[0])
116
- : null;
117
- return `<sup class="footnote-decoration">${attrs.contents || ''}</sup>${footnote ? footnote.textContent : ''}`;
118
- }
119
- /**
120
- * Retrieves the text content of a footnote node with decoration.
121
- */
122
- getFootnoteContent(node) {
123
- const footnotesPlugin = body_editor_1.footnotesPluginKey.get(this.state);
124
- const pluginState = footnotesPlugin?.getState(this.state);
125
- const decorationText = pluginState?.labels.get(node.attrs.id) || '';
126
- return `<sup class="footnote-decoration">${decorationText}</sup>${this.getNodeTextContent(node)}`;
127
- }
128
- }
129
- exports.NodeTextContentRetriever = NodeTextContentRetriever;
130
- //# sourceMappingURL=node-content-retriever.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-content-retriever.js","sourceRoot":"","sources":["../../../src/lib/node-content-retriever.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAMiC;AACjC,sDAK+B;AAC/B,0DAAiC;AACjC,MAAa,wBAAwB;IAGnC,YAAY,KAA4B;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED;;OAEG;IACI,kBAAkB,CAAC,IAAoB;QAC5C,IAAI,WAAW,GAAG,EAAE,CAAA;QACpB,IAAI,CAAC,IAAA,6BAAiB,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACjC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACrB,IAAI,KAAK,CAAC,MAAM,EAAE;oBAChB,WAAW,IAAI,KAAK,CAAC,IAAI,CAAA;iBAC1B;qBAAM;oBACL,WAAW,IAAI,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;iBAC9C;YACH,CAAC,CAAC,CAAA;SACH;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,IAAoB;QAC9C,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAA;IAC3D,CAAC;IAED;;OAEG;IACI,0BAA0B,CAAC,EAAU,EAAE,IAAoB;QAChE,MAAM,SAAS,GAAG,mCAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACvD,MAAM,GAAG,GAAG,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3C,IAAI,C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C,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC3C,CAAC,CAAC,IAAI,CAAA;QAEV,OAAO,oCAAoC,KAAK,CAAC,QAAQ,IAAI,EAAE,SAC7D,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EACpC,EAAE,CAAA;IACJ,CAAC;IAED;;OAEG;IACI,kBAAkB,CAAC,IAAoB;QAC5C,MAAM,eAAe,GAAG,gCAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC1D,MAAM,WAAW,GAAG,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACzD,MAAM,cAAc,GAAG,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QAEnE,OAAO,oCAAoC,cAAc,SAAS,IAAI,CAAC,kBAAkB,CACvF,IAAI,CACL,EAAE,CAAA;IACL,CAAC;CACF;AA5ID,4DA4IC"}
@@ -1,44 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { renderMath } from '@manuscripts/body-editor';
13
- import purify from 'dompurify';
14
- import React, { useEffect, useRef } from 'react';
15
- import styled from 'styled-components';
16
- const SnippetContent = ({ content, isEquation }) => {
17
- const contentRef = useRef(null);
18
- useEffect(() => {
19
- if (contentRef.current && content) {
20
- contentRef.current.innerHTML = purify.sanitize(': ' + content) || '';
21
- if (isEquation) {
22
- renderMath(contentRef.current);
23
- }
24
- }
25
- }, [content, isEquation]);
26
- return React.createElement(StyledContent, { ref: contentRef, "data-mathjax": isEquation });
27
- };
28
- export default SnippetContent;
29
- const StyledContent = styled.span `
30
- color: #353535;
31
- font-family: Lato, sans-serif;
32
- font-size: 12px;
33
- font-weight: 400;
34
- line-height: 16px;
35
-
36
- &[data-mathjax='true'] {
37
- text-overflow: unset;
38
- }
39
-
40
- .inspector-list-item::after {
41
- content: '...';
42
- }
43
- `;
44
- //# sourceMappingURL=SnippetContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SnippetContent.js","sourceRoot":"","sources":["../../../../../src/components/track-changes/suggestion-list/SnippetContent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAOtC,MAAM,cAAc,GAA2B,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;IACzE,MAAM,UAAU,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAA;IAEhD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,CAAC,OAAO,IAAI,OAAO,EAAE;YACjC,UAAU,CAAC,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAA;YACpE,IAAI,UAAU,EAAE;gBACd,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;aAC/B;SACF;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAA;IAEzB,OAAO,oBAAC,aAAa,IAAC,GAAG,EAAE,UAAU,kBAAgB,UAAU,GAAI,CAAA;AACrE,CAAC,CAAA;AAED,eAAe,cAAc,CAAA;AAE7B,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;;;;;;;;CAchC,CAAA"}