@manuscripts/body-editor 3.7.18 → 3.7.19

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.
@@ -89,8 +89,12 @@ exports.default = () => new prosemirror_state_1.Plugin({
89
89
  else if (node.type === node.type.schema.nodes.section_title) {
90
90
  const $pos = state.doc.resolve(pos);
91
91
  let placeholderText = 'Type heading here';
92
- if ((0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, transform_1.schema.nodes.box_element)) {
93
- placeholderText = 'Optional box title...';
92
+ const boxElement = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, transform_1.schema.nodes.box_element);
93
+ if (boxElement) {
94
+ const section = (0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, transform_1.schema.nodes.section);
95
+ if (section && section.depth === boxElement.depth + 1) {
96
+ placeholderText = 'Optional box title...';
97
+ }
94
98
  }
95
99
  if ((0, prosemirror_utils_1.findParentNodeOfTypeClosestToPos)($pos, transform_1.schema.nodes.supplements)) {
96
100
  placeholderText = 'Supplements';
@@ -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 = '3.7.18';
4
+ exports.VERSION = '3.7.19';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -87,8 +87,12 @@ export default () => new Plugin({
87
87
  else if (node.type === node.type.schema.nodes.section_title) {
88
88
  const $pos = state.doc.resolve(pos);
89
89
  let placeholderText = 'Type heading here';
90
- if (findParentNodeOfTypeClosestToPos($pos, schema.nodes.box_element)) {
91
- placeholderText = 'Optional box title...';
90
+ const boxElement = findParentNodeOfTypeClosestToPos($pos, schema.nodes.box_element);
91
+ if (boxElement) {
92
+ const section = findParentNodeOfTypeClosestToPos($pos, schema.nodes.section);
93
+ if (section && section.depth === boxElement.depth + 1) {
94
+ placeholderText = 'Optional box title...';
95
+ }
92
96
  }
93
97
  if (findParentNodeOfTypeClosestToPos($pos, schema.nodes.supplements)) {
94
98
  placeholderText = 'Supplements';
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.7.18';
1
+ export const VERSION = '3.7.19';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.7.18";
1
+ export declare const VERSION = "3.7.19";
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.7.18",
4
+ "version": "3.7.19",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",