@manuscripts/body-editor 2.7.7-LEAN-4218.0 → 2.7.7

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 (37) hide show
  1. package/dist/cjs/commands.js +1 -16
  2. package/dist/cjs/components/outline/DraggableTree.js +1 -0
  3. package/dist/cjs/components/views/LinkForm.js +7 -7
  4. package/dist/cjs/configs/editor-views.js +0 -2
  5. package/dist/cjs/lib/helpers.js +0 -5
  6. package/dist/cjs/menus.js +0 -8
  7. package/dist/cjs/node-type-icons.js +0 -1
  8. package/dist/cjs/versions.js +1 -1
  9. package/dist/cjs/views/footnote.js +1 -5
  10. package/dist/cjs/views/inline_footnote.js +5 -9
  11. package/dist/es/commands.js +0 -13
  12. package/dist/es/components/outline/DraggableTree.js +1 -0
  13. package/dist/es/components/views/LinkForm.js +2 -2
  14. package/dist/es/configs/editor-views.js +0 -2
  15. package/dist/es/lib/helpers.js +1 -6
  16. package/dist/es/menus.js +0 -8
  17. package/dist/es/node-type-icons.js +1 -2
  18. package/dist/es/versions.js +1 -1
  19. package/dist/es/views/footnote.js +2 -6
  20. package/dist/es/views/inline_footnote.js +5 -9
  21. package/dist/types/commands.d.ts +0 -1
  22. package/dist/types/components/views/LinkForm.d.ts +0 -2
  23. package/dist/types/configs/editor-views.d.ts +0 -1
  24. package/dist/types/versions.d.ts +1 -1
  25. package/dist/types/views/inline_footnote.d.ts +1 -1
  26. package/package.json +3 -4
  27. package/styles/AdvancedEditor.css +2 -23
  28. package/styles/Editor.css +10 -28
  29. package/dist/cjs/components/toolbar/InsertEmbedDialog.js +0 -159
  30. package/dist/cjs/lib/oembed.js +0 -93
  31. package/dist/cjs/views/embed.js +0 -84
  32. package/dist/es/components/toolbar/InsertEmbedDialog.js +0 -127
  33. package/dist/es/lib/oembed.js +0 -85
  34. package/dist/es/views/embed.js +0 -77
  35. package/dist/types/components/toolbar/InsertEmbedDialog.d.ts +0 -29
  36. package/dist/types/lib/oembed.d.ts +0 -8
  37. package/dist/types/views/embed.d.ts +0 -30
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.addColumns = exports.addHeaderRow = exports.addRows = exports.addInlineComment = exports.addNodeComment = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreMetaNodeBackspaceCommand = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.insertTOCSection = exports.insertBibliographySection = exports.insertList = exports.insertKeywords = exports.insertAward = exports.insertAffiliation = exports.insertContributors = exports.insertAbstract = exports.insertBackmatterSection = exports.insertSection = exports.insertGraphicalAbstract = exports.insertBoxElement = exports.insertInlineFootnote = exports.insertFootnotesElement = exports.insertTableElementFooter = exports.insertInlineEquation = exports.insertCrossReference = exports.insertInlineCitation = exports.insertLink = exports.insertSectionLabel = exports.findPosBeforeFirstSubsection = exports.insertBreak = exports.deleteBlock = exports.insertBlock = exports.insertSupplement = exports.insertTable = exports.insertFigure = exports.insertGeneralTableFootnote = exports.insertInlineTableFootnote = exports.insertEmbed = exports.createBlock = exports.createSelection = exports.canInsert = exports.blockActive = exports.isNodeSelection = exports.markActive = exports.addToStart = void 0;
19
- exports.autoComplete = void 0;
18
+ exports.autoComplete = exports.addColumns = exports.addHeaderRow = exports.addRows = exports.addInlineComment = exports.addNodeComment = exports.createAndFillTableElement = exports.selectAllIsolating = exports.ignoreAtomBlockNodeForward = exports.isAtEndOfTextBlock = exports.ignoreMetaNodeBackspaceCommand = exports.ignoreAtomBlockNodeBackward = exports.isTextSelection = exports.isAtStartOfTextBlock = exports.insertTOCSection = exports.insertBibliographySection = exports.insertList = exports.insertKeywords = exports.insertAward = exports.insertAffiliation = exports.insertContributors = exports.insertAbstract = exports.insertBackmatterSection = exports.insertSection = exports.insertGraphicalAbstract = exports.insertBoxElement = exports.insertInlineFootnote = exports.insertFootnotesElement = exports.insertTableElementFooter = exports.insertInlineEquation = exports.insertCrossReference = exports.insertInlineCitation = exports.insertLink = exports.insertSectionLabel = exports.findPosBeforeFirstSubsection = exports.insertBreak = exports.deleteBlock = exports.insertBlock = exports.insertSupplement = exports.insertTable = exports.insertFigure = exports.insertGeneralTableFootnote = exports.insertInlineTableFootnote = exports.createBlock = exports.createSelection = exports.canInsert = exports.blockActive = exports.isNodeSelection = exports.markActive = exports.addToStart = void 0;
20
19
  const json_schema_1 = require("@manuscripts/json-schema");
21
20
  const track_changes_plugin_1 = require("@manuscripts/track-changes-plugin");
22
21
  const transform_1 = require("@manuscripts/transform");
@@ -151,11 +150,6 @@ const createBlock = (nodeType, position, state, dispatch, attrs) => {
151
150
  state.schema.nodes.equation.create(),
152
151
  ]);
153
152
  break;
154
- case state.schema.nodes.embed:
155
- node = state.schema.nodes.embed.create(attrs, [
156
- createAndFillFigcaptionElement(state),
157
- ]);
158
- break;
159
153
  default:
160
154
  node = nodeType.createAndFill(attrs);
161
155
  }
@@ -166,15 +160,6 @@ const createBlock = (nodeType, position, state, dispatch, attrs) => {
166
160
  }
167
161
  };
168
162
  exports.createBlock = createBlock;
169
- const insertEmbed = (state, dispatch, attrs) => {
170
- const position = findBlockInsertPosition(state);
171
- if (position === null) {
172
- return false;
173
- }
174
- (0, exports.createBlock)(transform_1.schema.nodes.embed, position, state, dispatch, attrs);
175
- return true;
176
- };
177
- exports.insertEmbed = insertEmbed;
178
163
  const insertInlineTableFootnote = (state, dispatch) => {
179
164
  const $pos = state.selection.$to;
180
165
  const table = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, transform_1.schema.nodes.table);
@@ -44,6 +44,7 @@ const excludedTypes = [
44
44
  transform_1.schema.nodes.contributors,
45
45
  transform_1.schema.nodes.author_notes,
46
46
  transform_1.schema.nodes.title,
47
+ transform_1.schema.nodes.embed,
47
48
  transform_1.schema.nodes.image_element,
48
49
  ];
49
50
  const childrenExcludedTypes = [
@@ -41,7 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  return (mod && mod.__esModule) ? mod : { "default": mod };
42
42
  };
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.LinkForm = exports.Open = exports.FieldHeading = void 0;
44
+ exports.LinkForm = void 0;
45
45
  const style_guide_1 = require("@manuscripts/style-guide");
46
46
  const react_1 = __importStar(require("react"));
47
47
  const styled_components_1 = __importDefault(require("styled-components"));
@@ -66,7 +66,7 @@ const ActionGroup = styled_components_1.default.span `
66
66
  const Field = styled_components_1.default.div `
67
67
  margin-bottom: ${(props) => props.theme.grid.unit * 4}px;
68
68
  `;
69
- exports.FieldHeading = styled_components_1.default.div `
69
+ const FieldHeading = styled_components_1.default.div `
70
70
  display: flex;
71
71
  align-items: center;
72
72
  justify-content: space-between;
@@ -78,7 +78,7 @@ const Label = styled_components_1.default.label `
78
78
  color: ${(props) => props.theme.colors.text.tertiary};
79
79
  font-size: ${(props) => props.theme.font.size.normal};
80
80
  `;
81
- exports.Open = styled_components_1.default.a `
81
+ const Open = styled_components_1.default.a `
82
82
  display: inline-block;
83
83
  margin-left: ${(props) => props.theme.grid.unit * 2}px;
84
84
  text-transform: uppercase;
@@ -101,16 +101,16 @@ const LinkForm = ({ onCancel, onRemove, onSave, value, }) => {
101
101
  }, [href, text, title, onSave]);
102
102
  return (react_1.default.createElement(Form, { onSubmit: handleSubmit },
103
103
  react_1.default.createElement(Field, null,
104
- react_1.default.createElement(exports.FieldHeading, null,
104
+ react_1.default.createElement(FieldHeading, null,
105
105
  react_1.default.createElement(Label, null, "URL"),
106
- href && (0, url_1.allowedHref)(href) && (react_1.default.createElement(exports.Open, { href: href, target: '_blank', rel: 'noopener' }))),
106
+ href && (0, url_1.allowedHref)(href) && (react_1.default.createElement(Open, { href: href, target: '_blank', rel: 'noopener' }))),
107
107
  react_1.default.createElement(style_guide_1.TextField, { type: 'url', name: 'href', value: href, autoComplete: 'off', autoFocus: true, required: true, onChange: (e) => setHref(e.target.value) })),
108
108
  react_1.default.createElement(Field, null,
109
- react_1.default.createElement(exports.FieldHeading, null,
109
+ react_1.default.createElement(FieldHeading, null,
110
110
  react_1.default.createElement(Label, null, "Text")),
111
111
  react_1.default.createElement(style_guide_1.TextField, { type: 'text', name: 'text', value: text, autoComplete: 'off', required: true, onChange: (e) => setText(e.target.value) })),
112
112
  react_1.default.createElement(Field, null,
113
- react_1.default.createElement(exports.FieldHeading, null,
113
+ react_1.default.createElement(FieldHeading, null,
114
114
  react_1.default.createElement(Label, null, "Title (optional)")),
115
115
  react_1.default.createElement(style_guide_1.TextField, { type: 'text', name: 'title', value: title, autoComplete: 'off', required: false, onChange: (e) => setTitle(e.target.value) })),
116
116
  react_1.default.createElement(Actions, null,
@@ -28,7 +28,6 @@ const box_element_1 = __importDefault(require("../views/box_element"));
28
28
  const citation_editable_1 = __importDefault(require("../views/citation_editable"));
29
29
  const contributors_1 = __importDefault(require("../views/contributors"));
30
30
  const cross_reference_editable_1 = __importDefault(require("../views/cross_reference_editable"));
31
- const embed_1 = __importDefault(require("../views/embed"));
32
31
  const empty_1 = __importDefault(require("../views/empty"));
33
32
  const equation_editable_1 = __importDefault(require("../views/equation_editable"));
34
33
  const equation_element_editable_1 = __importDefault(require("../views/equation_element_editable"));
@@ -65,7 +64,6 @@ exports.default = (props, dispatch) => {
65
64
  cross_reference: (0, cross_reference_editable_1.default)(props, dispatch),
66
65
  contributors: (0, contributors_1.default)(props, dispatch),
67
66
  affiliations: (0, affiliations_1.default)(props, dispatch),
68
- embed: (0, embed_1.default)(props),
69
67
  equation: (0, equation_editable_1.default)(props),
70
68
  equation_element: (0, equation_element_editable_1.default)(props),
71
69
  figure: (0, figure_editable_1.default)(props, dispatch),
@@ -75,11 +75,6 @@ const handleScrollToSelectedTarget = (view) => {
75
75
  behavior: 'smooth',
76
76
  block: blockAlignment,
77
77
  });
78
- if ((0, transform_1.isInlineFootnoteNode)(node)) {
79
- const fn = target;
80
- fn.classList.add('highlight-footnote-marker');
81
- setTimeout(() => fn.classList.remove('highlight-footnote-marker'), 3000);
82
- }
83
78
  return true;
84
79
  };
85
80
  exports.handleScrollToSelectedTarget = handleScrollToSelectedTarget;
package/dist/cjs/menus.js CHANGED
@@ -20,7 +20,6 @@ const transform_1 = require("@manuscripts/transform");
20
20
  const prosemirror_commands_1 = require("prosemirror-commands");
21
21
  const prosemirror_history_1 = require("prosemirror-history");
22
22
  const commands_1 = require("./commands");
23
- const InsertEmbedDialog_1 = require("./components/toolbar/InsertEmbedDialog");
24
23
  const InsertTableDialog_1 = require("./components/toolbar/InsertTableDialog");
25
24
  const ListMenuItem_1 = require("./components/toolbar/ListMenuItem");
26
25
  const hierarchy_1 = require("./lib/hierarchy");
@@ -212,13 +211,6 @@ const getEditorMenus = (editor) => {
212
211
  {
213
212
  role: 'separator',
214
213
  },
215
- {
216
- id: 'insert-embed-media',
217
- label: 'Embedded Media',
218
- isActive: (0, commands_1.blockActive)(transform_1.schema.nodes.embed)(state),
219
- isEnabled: isCommandValid((0, commands_1.canInsert)(transform_1.schema.nodes.embed)),
220
- run: () => (0, InsertEmbedDialog_1.openEmbedDialog)(editor.view),
221
- },
222
214
  {
223
215
  id: 'insert-link',
224
216
  label: 'Link',
@@ -28,7 +28,6 @@ const icons = new Map([
28
28
  [nodes.bibliography_section, style_guide_1.OutlineSectionIcon],
29
29
  [nodes.blockquote_element, style_guide_1.OutlineBlockQuoteIcon],
30
30
  [nodes.equation_element, style_guide_1.OutlineEquationIcon],
31
- [nodes.embed, style_guide_1.OutlineEmbedIcon],
32
31
  [nodes.figure_element, style_guide_1.OutlineFigureIcon],
33
32
  [nodes.paragraph, style_guide_1.OutlineParagraphIcon],
34
33
  [nodes.pullquote_element, style_guide_1.OutlinePullQuoteIcon],
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MATHJAX_VERSION = exports.VERSION = void 0;
4
- exports.VERSION = '2.7.7-LEAN-4218.0';
4
+ exports.VERSION = '2.7.7';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -115,7 +115,6 @@ class FootnoteView extends base_node_view_1.BaseNodeView {
115
115
  super.updateContents();
116
116
  const id = this.node.attrs.id;
117
117
  const fn = (0, footnotes_1.getFootnotesElementState)(this.view.state, id);
118
- const pos = this.getPos();
119
118
  if (!fn) {
120
119
  return;
121
120
  }
@@ -128,11 +127,8 @@ class FootnoteView extends base_node_view_1.BaseNodeView {
128
127
  marker.classList.add('footnote-marker');
129
128
  marker.innerText = fn.labels.get(id) || '';
130
129
  }
131
- const container = (0, footnotes_1.findFootnotesContainerNode)(this.view.state.doc, pos);
132
130
  let scrollBtn = null;
133
- if (container.node.type !== transform_1.schema.nodes.table_element) {
134
- scrollBtn = this.createButton('scroll-icon', icons_1.scrollIcon, this.handleMarkerClick);
135
- }
131
+ scrollBtn = this.createButton('scroll-icon', icons_1.scrollIcon, this.handleMarkerClick);
136
132
  const deleteBtn = this.createButton('delete-icon', icons_1.deleteIcon, this.handleDeleteClick);
137
133
  this.dom.innerHTML = '';
138
134
  scrollBtn && this.dom.appendChild(scrollBtn);
@@ -20,7 +20,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.InlineFootnoteView = void 0;
22
22
  const style_guide_1 = require("@manuscripts/style-guide");
23
- const transform_1 = require("@manuscripts/transform");
24
23
  const prosemirror_state_1 = require("prosemirror-state");
25
24
  const FootnotesSelector_1 = require("../components/views/FootnotesSelector");
26
25
  const footnotes_1 = require("../lib/footnotes");
@@ -65,12 +64,7 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
65
64
  if ((0, track_changes_utils_1.isDeleted)(this.node)) {
66
65
  return;
67
66
  }
68
- if (this.isTableFootnote) {
69
- this.showFootnotesSelector();
70
- }
71
- else {
72
- this.showContextMenu();
73
- }
67
+ this.showContextMenu();
74
68
  };
75
69
  this.scrollToReferencedFootnote = () => {
76
70
  const state = this.view.state;
@@ -120,10 +114,9 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
120
114
  this.dom.classList.add('footnote-marker');
121
115
  this.dom.addEventListener('click', this.handleClick);
122
116
  this.updateContents();
123
- const container = (0, footnotes_1.findFootnotesContainerNode)(this.view.state.doc, this.getPos());
124
- this.isTableFootnote = (0, transform_1.isTableElementNode)(container.node);
125
117
  };
126
118
  this.selectNode = () => {
119
+ this.dom.classList.add('footnote-marker-selected');
127
120
  if (!this.node.attrs.rids.length) {
128
121
  this.showFootnotesSelector();
129
122
  }
@@ -195,6 +188,9 @@ class InlineFootnoteView extends base_node_view_1.BaseNodeView {
195
188
  }
196
189
  this.dom.innerText = fn.labels.get(this.node.attrs.id) || '';
197
190
  }
191
+ deselectNode() {
192
+ this.dom.classList.remove('footnote-marker-selected');
193
+ }
198
194
  }
199
195
  exports.InlineFootnoteView = InlineFootnoteView;
200
196
  exports.default = (0, creators_1.createNodeView)(InlineFootnoteView);
@@ -141,11 +141,6 @@ export const createBlock = (nodeType, position, state, dispatch, attrs) => {
141
141
  state.schema.nodes.equation.create(),
142
142
  ]);
143
143
  break;
144
- case state.schema.nodes.embed:
145
- node = state.schema.nodes.embed.create(attrs, [
146
- createAndFillFigcaptionElement(state),
147
- ]);
148
- break;
149
144
  default:
150
145
  node = nodeType.createAndFill(attrs);
151
146
  }
@@ -155,14 +150,6 @@ export const createBlock = (nodeType, position, state, dispatch, attrs) => {
155
150
  dispatch(tr.setSelection(selection).scrollIntoView());
156
151
  }
157
152
  };
158
- export const insertEmbed = (state, dispatch, attrs) => {
159
- const position = findBlockInsertPosition(state);
160
- if (position === null) {
161
- return false;
162
- }
163
- createBlock(schema.nodes.embed, position, state, dispatch, attrs);
164
- return true;
165
- };
166
153
  export const insertInlineTableFootnote = (state, dispatch) => {
167
154
  const $pos = state.selection.$to;
168
155
  const table = findParentNodeOfTypeClosestToPos($pos, schema.nodes.table);
@@ -18,6 +18,7 @@ const excludedTypes = [
18
18
  schema.nodes.contributors,
19
19
  schema.nodes.author_notes,
20
20
  schema.nodes.title,
21
+ schema.nodes.embed,
21
22
  schema.nodes.image_element,
22
23
  ];
23
24
  const childrenExcludedTypes = [
@@ -37,7 +37,7 @@ const ActionGroup = styled.span `
37
37
  const Field = styled.div `
38
38
  margin-bottom: ${(props) => props.theme.grid.unit * 4}px;
39
39
  `;
40
- export const FieldHeading = styled.div `
40
+ const FieldHeading = styled.div `
41
41
  display: flex;
42
42
  align-items: center;
43
43
  justify-content: space-between;
@@ -49,7 +49,7 @@ const Label = styled.label `
49
49
  color: ${(props) => props.theme.colors.text.tertiary};
50
50
  font-size: ${(props) => props.theme.font.size.normal};
51
51
  `;
52
- export const Open = styled.a `
52
+ const Open = styled.a `
53
53
  display: inline-block;
54
54
  margin-left: ${(props) => props.theme.grid.unit * 2}px;
55
55
  text-transform: uppercase;
@@ -23,7 +23,6 @@ import boxElement from '../views/box_element';
23
23
  import citation from '../views/citation_editable';
24
24
  import contributors from '../views/contributors';
25
25
  import crossReference from '../views/cross_reference_editable';
26
- import embed from '../views/embed';
27
26
  import empty from '../views/empty';
28
27
  import equation from '../views/equation_editable';
29
28
  import equationElement from '../views/equation_element_editable';
@@ -60,7 +59,6 @@ export default (props, dispatch) => {
60
59
  cross_reference: crossReference(props, dispatch),
61
60
  contributors: contributors(props, dispatch),
62
61
  affiliations: affiliations(props, dispatch),
63
- embed: embed(props),
64
62
  equation: equation(props),
65
63
  equation_element: equationElement(props),
66
64
  figure: figure(props, dispatch),
@@ -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
- import { isInlineFootnoteNode, schema, } from '@manuscripts/transform';
16
+ import { schema, } from '@manuscripts/transform';
17
17
  export const isNodeOfType = (...type) => (node) => {
18
18
  const [head, ...tail] = type;
19
19
  if (node.type === node.type.schema.nodes[head]) {
@@ -69,11 +69,6 @@ export const handleScrollToSelectedTarget = (view) => {
69
69
  behavior: 'smooth',
70
70
  block: blockAlignment,
71
71
  });
72
- if (isInlineFootnoteNode(node)) {
73
- const fn = target;
74
- fn.classList.add('highlight-footnote-marker');
75
- setTimeout(() => fn.classList.remove('highlight-footnote-marker'), 3000);
76
- }
77
72
  return true;
78
73
  };
79
74
  export const findWordBoundaries = (state, position) => {
package/dist/es/menus.js CHANGED
@@ -17,7 +17,6 @@ import { getGroupCateogries, schema, } from '@manuscripts/transform';
17
17
  import { toggleMark } from 'prosemirror-commands';
18
18
  import { redo, undo } from 'prosemirror-history';
19
19
  import { addInlineComment, blockActive, canInsert, insertAbstract, insertAffiliation, insertAward, insertBackmatterSection, insertBlock, insertBoxElement, insertContributors, insertCrossReference, insertGraphicalAbstract, insertInlineCitation, insertInlineEquation, insertInlineFootnote, insertKeywords, insertLink, insertList, insertSection, markActive, } from './commands';
20
- import { openEmbedDialog } from './components/toolbar/InsertEmbedDialog';
21
20
  import { openInsertTableDialog } from './components/toolbar/InsertTableDialog';
22
21
  import { ListMenuItem } from './components/toolbar/ListMenuItem';
23
22
  import { deleteClosestParentElement, findClosestParentElementNodeName, } from './lib/hierarchy';
@@ -209,13 +208,6 @@ export const getEditorMenus = (editor) => {
209
208
  {
210
209
  role: 'separator',
211
210
  },
212
- {
213
- id: 'insert-embed-media',
214
- label: 'Embedded Media',
215
- isActive: blockActive(schema.nodes.embed)(state),
216
- isEnabled: isCommandValid(canInsert(schema.nodes.embed)),
217
- run: () => openEmbedDialog(editor.view),
218
- },
219
211
  {
220
212
  id: 'insert-link',
221
213
  label: 'Link',
@@ -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
- import { OutlineBlockQuoteIcon, OutlineEquationIcon, OutlineEmbedIcon, OutlineFigureIcon, OutlineManuscriptIcon, OutlineOrderedListIcon, OutlineParagraphIcon, OutlinePullQuoteIcon, OutlineSectionIcon, OutlineTableIcon, OutlineUnorderedListIcon, } from '@manuscripts/style-guide';
16
+ import { OutlineBlockQuoteIcon, OutlineEquationIcon, OutlineFigureIcon, OutlineManuscriptIcon, OutlineOrderedListIcon, OutlineParagraphIcon, OutlinePullQuoteIcon, OutlineSectionIcon, OutlineTableIcon, OutlineUnorderedListIcon, } from '@manuscripts/style-guide';
17
17
  import { schema } from '@manuscripts/transform';
18
18
  import React from 'react';
19
19
  const { nodes } = schema;
@@ -22,7 +22,6 @@ const icons = new Map([
22
22
  [nodes.bibliography_section, OutlineSectionIcon],
23
23
  [nodes.blockquote_element, OutlineBlockQuoteIcon],
24
24
  [nodes.equation_element, OutlineEquationIcon],
25
- [nodes.embed, OutlineEmbedIcon],
26
25
  [nodes.figure_element, OutlineFigureIcon],
27
26
  [nodes.paragraph, OutlineParagraphIcon],
28
27
  [nodes.pullquote_element, OutlinePullQuoteIcon],
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.7.7-LEAN-4218.0';
1
+ export const VERSION = '2.7.7';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -19,7 +19,7 @@ import { NodeSelection } from 'prosemirror-state';
19
19
  import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
20
20
  import { DeleteFootnoteDialog, } from '../components/views/DeleteFootnoteDialog';
21
21
  import { alertIcon, deleteIcon, scrollIcon } from '../icons';
22
- import { findFootnotesContainerNode, getFootnotesElementState, } from '../lib/footnotes';
22
+ import { getFootnotesElementState } from '../lib/footnotes';
23
23
  import { isDeleted } from '../lib/track-changes-utils';
24
24
  import { BaseNodeView } from './base_node_view';
25
25
  import { createNodeView } from './creators';
@@ -109,7 +109,6 @@ export class FootnoteView extends BaseNodeView {
109
109
  super.updateContents();
110
110
  const id = this.node.attrs.id;
111
111
  const fn = getFootnotesElementState(this.view.state, id);
112
- const pos = this.getPos();
113
112
  if (!fn) {
114
113
  return;
115
114
  }
@@ -122,11 +121,8 @@ export class FootnoteView extends BaseNodeView {
122
121
  marker.classList.add('footnote-marker');
123
122
  marker.innerText = fn.labels.get(id) || '';
124
123
  }
125
- const container = findFootnotesContainerNode(this.view.state.doc, pos);
126
124
  let scrollBtn = null;
127
- if (container.node.type !== schema.nodes.table_element) {
128
- scrollBtn = this.createButton('scroll-icon', scrollIcon, this.handleMarkerClick);
129
- }
125
+ scrollBtn = this.createButton('scroll-icon', scrollIcon, this.handleMarkerClick);
130
126
  const deleteBtn = this.createButton('delete-icon', deleteIcon, this.handleDeleteClick);
131
127
  this.dom.innerHTML = '';
132
128
  scrollBtn && this.dom.appendChild(scrollBtn);
@@ -14,7 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ContextMenu } from '@manuscripts/style-guide';
17
- import { isTableElementNode, } from '@manuscripts/transform';
18
17
  import { NodeSelection, TextSelection } from 'prosemirror-state';
19
18
  import { FootnotesSelector, } from '../components/views/FootnotesSelector';
20
19
  import { createFootnote, findFootnotesContainerNode, getFootnotesElementState, } from '../lib/footnotes';
@@ -59,12 +58,7 @@ export class InlineFootnoteView extends BaseNodeView {
59
58
  if (isDeleted(this.node)) {
60
59
  return;
61
60
  }
62
- if (this.isTableFootnote) {
63
- this.showFootnotesSelector();
64
- }
65
- else {
66
- this.showContextMenu();
67
- }
61
+ this.showContextMenu();
68
62
  };
69
63
  this.scrollToReferencedFootnote = () => {
70
64
  const state = this.view.state;
@@ -114,10 +108,9 @@ export class InlineFootnoteView extends BaseNodeView {
114
108
  this.dom.classList.add('footnote-marker');
115
109
  this.dom.addEventListener('click', this.handleClick);
116
110
  this.updateContents();
117
- const container = findFootnotesContainerNode(this.view.state.doc, this.getPos());
118
- this.isTableFootnote = isTableElementNode(container.node);
119
111
  };
120
112
  this.selectNode = () => {
113
+ this.dom.classList.add('footnote-marker-selected');
121
114
  if (!this.node.attrs.rids.length) {
122
115
  this.showFootnotesSelector();
123
116
  }
@@ -189,5 +182,8 @@ export class InlineFootnoteView extends BaseNodeView {
189
182
  }
190
183
  this.dom.innerText = fn.labels.get(this.node.attrs.id) || '';
191
184
  }
185
+ deselectNode() {
186
+ this.dom.classList.remove('footnote-marker-selected');
187
+ }
192
188
  }
193
189
  export default createNodeView(InlineFootnoteView);
@@ -27,7 +27,6 @@ export declare const blockActive: (type: ManuscriptNodeType) => (state: Manuscri
27
27
  export declare const canInsert: (type: ManuscriptNodeType) => (state: ManuscriptEditorState) => boolean;
28
28
  export declare const createSelection: (nodeType: ManuscriptNodeType, position: number, doc: ManuscriptNode) => Selection;
29
29
  export declare const createBlock: (nodeType: ManuscriptNodeType, position: number, state: ManuscriptEditorState, dispatch?: Dispatch, attrs?: Attrs) => void;
30
- export declare const insertEmbed: (state: ManuscriptEditorState, dispatch?: Dispatch, attrs?: Attrs) => boolean;
31
30
  export declare const insertInlineTableFootnote: (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
32
31
  export declare const insertGeneralTableFootnote: (element: [ManuscriptNode, number], state: ManuscriptEditorState, dispatch?: Dispatch) => boolean | undefined;
33
32
  export declare const insertFigure: (file: FileAttachment, state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
@@ -14,8 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import React from 'react';
17
- export declare const FieldHeading: import("styled-components").StyledComponent<"div", any, {}, never>;
18
- export declare const Open: import("styled-components").StyledComponent<"a", any, {}, never>;
19
17
  export interface LinkValue {
20
18
  text: string;
21
19
  href: string;
@@ -49,7 +49,6 @@ declare const _default: (props: EditorProps, dispatch: Dispatch) => {
49
49
  cross_reference: import("../types").NodeViewCreator<import("../views/cross_reference_editable").CrossReferenceEditableView>;
50
50
  contributors: import("../types").NodeViewCreator<import("../views/contributors").ContributorsView>;
51
51
  affiliations: import("../types").NodeViewCreator<import("../views/affiliations").AffiliationsView>;
52
- embed: import("../types").NodeViewCreator<import("../views/embed").EmbedMediaView>;
53
52
  equation: import("../types").NodeViewCreator<import("../views/equation_editable").EquationEditableView>;
54
53
  equation_element: import("../types").NodeViewCreator<{
55
54
  gutterButtons(): HTMLElement[];
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.7.7-LEAN-4218.0";
1
+ export declare const VERSION = "2.7.7";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
@@ -18,7 +18,6 @@ import { Trackable } from '../types';
18
18
  import { BaseNodeView } from './base_node_view';
19
19
  export declare class InlineFootnoteView extends BaseNodeView<Trackable<InlineFootnoteNode>> implements ManuscriptNodeView {
20
20
  protected popperContainer: HTMLDivElement;
21
- isTableFootnote: boolean;
22
21
  showContextMenu: () => void;
23
22
  handleClick: () => void;
24
23
  scrollToReferencedFootnote: () => void;
@@ -26,6 +25,7 @@ export declare class InlineFootnoteView extends BaseNodeView<Trackable<InlineFoo
26
25
  updateContents(): void;
27
26
  initialise: () => void;
28
27
  selectNode: () => void;
28
+ deselectNode(): void;
29
29
  ignoreMutation: () => boolean;
30
30
  createDOM: () => HTMLSpanElement;
31
31
  destroy: () => void;
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": "2.7.7-LEAN-4218.0",
4
+ "version": "2.7.7",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -32,9 +32,9 @@
32
32
  "@iarna/word-count": "^1.1.2",
33
33
  "@manuscripts/json-schema": "2.2.11",
34
34
  "@manuscripts/library": "1.3.11",
35
- "@manuscripts/style-guide": "2.0.30-LEAN-4218.1",
35
+ "@manuscripts/style-guide": "2.0.29",
36
36
  "@manuscripts/track-changes-plugin": "1.9.1",
37
- "@manuscripts/transform": "3.0.36-LEAN-4218.0",
37
+ "@manuscripts/transform": "3.0.35",
38
38
  "@popperjs/core": "^2.11.8",
39
39
  "astrocite-eutils": "^0.16.4",
40
40
  "codemirror": "^5.58.1",
@@ -43,7 +43,6 @@
43
43
  "grapheme-splitter": "^1.0.4",
44
44
  "history": "^4.10.1",
45
45
  "mathjax": "3.2.2",
46
- "oembed-providers": "^1.0.20241022",
47
46
  "prosemirror-collab": "^1.3.1",
48
47
  "prosemirror-commands": "^1.5.0",
49
48
  "prosemirror-dropcursor": "^1.6.1",
@@ -559,7 +559,7 @@ span.comment-marker {
559
559
 
560
560
  .selected-suggestion:not(.block-container):not(.graphical-abstract):not(
561
561
  .keywords
562
- ):not(figure):not(figure .equation) {
562
+ ):not(figure):not(figure .equation), .footnote-marker-selected {
563
563
  border-width: 2px 0 2px 0 !important;
564
564
  border-style: solid !important;
565
565
  }
@@ -1074,25 +1074,4 @@ th:hover > .table-context-menu-button,
1074
1074
  .ProseMirror .block-contributors .action-gutter {
1075
1075
  right: 15px;
1076
1076
  pointer-events: none;
1077
- }
1078
-
1079
- .ProseMirror .block-embed {
1080
- grid-template-columns: none;
1081
- }
1082
-
1083
- .ProseMirror .block-embed .block {
1084
- text-align: center;
1085
- margin: 0 52px;
1086
- }
1087
-
1088
- .tracking-visible .ProseMirror .block-embed[data-track-status='pending'][data-track-op='delete'] .block > * {
1089
- opacity: 0.5
1090
- }
1091
-
1092
- .ProseMirror .block-embed .tools-panel {
1093
- position: relative;
1094
- }
1095
-
1096
- .ProseMirror .block-embed .block-gutter, .block-embed .action-gutter {
1097
- display: none;
1098
- }
1077
+ }
package/styles/Editor.css CHANGED
@@ -982,14 +982,15 @@
982
982
  }
983
983
 
984
984
  .ProseMirror .footnote-marker {
985
- vertical-align: super;
985
+ margin: 0 5px;
986
986
  font-size: 75%;
987
- margin-bottom: 10px;
988
987
  color: #0d79d0;
989
- margin: 0 5px;
988
+ cursor: pointer;
990
989
  position: relative;
990
+ margin-bottom: 10px;
991
+ vertical-align: super;
991
992
  display: inline-block;
992
- cursor: pointer;
993
+ border-color: transparent;
993
994
  }
994
995
 
995
996
  .ProseMirror .footnote .footnote-marker {
@@ -997,30 +998,6 @@
997
998
  cursor: default;
998
999
  margin-right: 2px;
999
1000
  }
1000
- .ProseMirror .block-container:not(.block-footnotes_element) .footnote-marker::before, .ProseMirror .block-container:not(.block-footnotes_element) .footnote-marker::after {
1001
- content: '';
1002
- opacity: 0;
1003
- z-index: -1;
1004
- height: 30px;
1005
- margin: 0 12px;
1006
- position: absolute;
1007
- background: #E2E2E2;
1008
- pointer-events: none;
1009
- }
1010
- .ProseMirror .block-container:not(.block-footnotes_element) .footnote-marker::before {
1011
- left: 0;
1012
- }
1013
- .ProseMirror .block-container:not(.block-footnotes_element) .footnote-marker::after {
1014
- right:-100px;
1015
- }
1016
- .ProseMirror .footnote-marker.highlight-footnote-marker::before, .ProseMirror .footnote-marker.highlight-footnote-marker::after {
1017
- opacity: 1 !important;
1018
- width: 45vw;
1019
- transition: opacity 0.3s ease-in-out;
1020
- }
1021
- .ProseMirror .block-container > .block:has(.highlight-footnote-marker.footnote-marker) {
1022
- overflow-x: hidden;
1023
- }
1024
1001
  .ProseMirror .footnote {
1025
1002
  display: flex;
1026
1003
  align-items: center;
@@ -1051,6 +1028,11 @@
1051
1028
  background-color: #f2fbfc;
1052
1029
  border: 1px solid #bce7f6;
1053
1030
  }
1031
+ .ProseMirror .footnote-marker-selected:not(.selected-suggestion) {
1032
+ text-decoration: underline;
1033
+ background-color: #f2fbfc;
1034
+ border-color: #0d79d0;
1035
+ }
1054
1036
  .ProseMirror .table-footer p {
1055
1037
  margin-bottom: 0;
1056
1038
  margin-top: 0;