@manuscripts/body-editor 3.2.6 → 3.2.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.
|
@@ -279,6 +279,28 @@ class ContextMenu {
|
|
|
279
279
|
}));
|
|
280
280
|
}));
|
|
281
281
|
}
|
|
282
|
+
if (type === transform_1.schema.nodes.box_element) {
|
|
283
|
+
const tr = this.view.state.tr;
|
|
284
|
+
const boxElementNode = $pos.node($pos.depth - 1);
|
|
285
|
+
const boxStartPos = $pos.start($pos.depth - 1);
|
|
286
|
+
const figcaptions = (0, prosemirror_utils_1.findChildrenByType)(boxElementNode, transform_1.schema.nodes.figcaption);
|
|
287
|
+
const hasLabel = figcaptions.length > 0;
|
|
288
|
+
menu.insertBefore(this.createMenuItem(hasLabel ? 'Hide Label' : 'Show Label', () => {
|
|
289
|
+
if (hasLabel) {
|
|
290
|
+
const figcaptionNode = figcaptions[0].node;
|
|
291
|
+
const figcaptionPos = boxStartPos + figcaptions[0].pos;
|
|
292
|
+
tr.delete(figcaptionPos, figcaptionPos + figcaptionNode.nodeSize);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
const newFigcaption = transform_1.schema.nodes.figcaption.create({}, [
|
|
296
|
+
transform_1.schema.nodes.caption_title.create(),
|
|
297
|
+
]);
|
|
298
|
+
tr.insert(boxStartPos, newFigcaption);
|
|
299
|
+
}
|
|
300
|
+
this.view.dispatch(tr);
|
|
301
|
+
popper.destroy();
|
|
302
|
+
}), menu.firstChild);
|
|
303
|
+
}
|
|
282
304
|
popper.show(target, menu, 'right', true);
|
|
283
305
|
this.addPopperEventListeners();
|
|
284
306
|
};
|
package/dist/cjs/versions.js
CHANGED
|
@@ -275,6 +275,28 @@ export class ContextMenu {
|
|
|
275
275
|
}));
|
|
276
276
|
}));
|
|
277
277
|
}
|
|
278
|
+
if (type === schema.nodes.box_element) {
|
|
279
|
+
const tr = this.view.state.tr;
|
|
280
|
+
const boxElementNode = $pos.node($pos.depth - 1);
|
|
281
|
+
const boxStartPos = $pos.start($pos.depth - 1);
|
|
282
|
+
const figcaptions = findChildrenByType(boxElementNode, schema.nodes.figcaption);
|
|
283
|
+
const hasLabel = figcaptions.length > 0;
|
|
284
|
+
menu.insertBefore(this.createMenuItem(hasLabel ? 'Hide Label' : 'Show Label', () => {
|
|
285
|
+
if (hasLabel) {
|
|
286
|
+
const figcaptionNode = figcaptions[0].node;
|
|
287
|
+
const figcaptionPos = boxStartPos + figcaptions[0].pos;
|
|
288
|
+
tr.delete(figcaptionPos, figcaptionPos + figcaptionNode.nodeSize);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
const newFigcaption = schema.nodes.figcaption.create({}, [
|
|
292
|
+
schema.nodes.caption_title.create(),
|
|
293
|
+
]);
|
|
294
|
+
tr.insert(boxStartPos, newFigcaption);
|
|
295
|
+
}
|
|
296
|
+
this.view.dispatch(tr);
|
|
297
|
+
popper.destroy();
|
|
298
|
+
}), menu.firstChild);
|
|
299
|
+
}
|
|
278
300
|
popper.show(target, menu, 'right', true);
|
|
279
301
|
this.addPopperEventListeners();
|
|
280
302
|
};
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '3.2.
|
|
1
|
+
export const VERSION = '3.2.7';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.2.
|
|
1
|
+
export declare const VERSION = "3.2.7";
|
|
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.2.
|
|
4
|
+
"version": "3.2.7",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|