@manuscripts/body-editor 2.8.15 → 2.8.16

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.
package/README.md CHANGED
@@ -5,5 +5,3 @@ A React + ProseMirror editor for manuscripts.
5
5
  # Install
6
6
 
7
7
  `yarn add @manuscripts/body-editor`
8
-
9
- # 2
@@ -153,7 +153,7 @@ class ContextMenu {
153
153
  };
154
154
  this.showEditMenu = (target) => {
155
155
  const menu = document.createElement('div');
156
- menu.className = 'menu';
156
+ menu.className = 'menu edit-menu';
157
157
  const $pos = this.resolvePos();
158
158
  const isBox = isBoxElementSectionTitle($pos, this.node);
159
159
  const type = isBox ? transform_1.schema.nodes.box_element : this.node.type;
@@ -284,7 +284,7 @@ class ContextMenu {
284
284
  };
285
285
  this.createSubmenu = (submenuLabel, items) => {
286
286
  const submenu = document.createElement('div');
287
- submenu.classList.add('menu-section', 'context-submenu');
287
+ submenu.classList.add('context-submenu');
288
288
  submenu.append(this.createSubmenuTrigger(submenuLabel), this.createMenuSection((section) => {
289
289
  items.forEach(({ title, action, Icon, selected }) => {
290
290
  section.appendChild(this.createMenuItem(title, action, Icon, selected));
@@ -8,7 +8,7 @@ const icons_1 = require("../../icons");
8
8
  const popper_1 = require("../../lib/popper");
9
9
  const popper = new popper_1.PopperManager();
10
10
  function createMenuItem(contents, handler, isDisabled = false, isSelected = false) {
11
- const item = document.createElement('button');
11
+ const item = document.createElement('div');
12
12
  item.className = `menu-item ${isDisabled ? 'disabled' : ''} ${isSelected ? 'selected' : ''}`;
13
13
  item.textContent = contents;
14
14
  item.addEventListener('mousedown', (event) => {
@@ -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.8.15';
4
+ exports.VERSION = '2.8.16';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -149,7 +149,7 @@ export class ContextMenu {
149
149
  };
150
150
  this.showEditMenu = (target) => {
151
151
  const menu = document.createElement('div');
152
- menu.className = 'menu';
152
+ menu.className = 'menu edit-menu';
153
153
  const $pos = this.resolvePos();
154
154
  const isBox = isBoxElementSectionTitle($pos, this.node);
155
155
  const type = isBox ? schema.nodes.box_element : this.node.type;
@@ -280,7 +280,7 @@ export class ContextMenu {
280
280
  };
281
281
  this.createSubmenu = (submenuLabel, items) => {
282
282
  const submenu = document.createElement('div');
283
- submenu.classList.add('menu-section', 'context-submenu');
283
+ submenu.classList.add('context-submenu');
284
284
  submenu.append(this.createSubmenuTrigger(submenuLabel), this.createMenuSection((section) => {
285
285
  items.forEach(({ title, action, Icon, selected }) => {
286
286
  section.appendChild(this.createMenuItem(title, action, Icon, selected));
@@ -5,7 +5,7 @@ import { sectionCategoryIcon } from '../../icons';
5
5
  import { PopperManager } from '../../lib/popper';
6
6
  const popper = new PopperManager();
7
7
  function createMenuItem(contents, handler, isDisabled = false, isSelected = false) {
8
- const item = document.createElement('button');
8
+ const item = document.createElement('div');
9
9
  item.className = `menu-item ${isDisabled ? 'disabled' : ''} ${isSelected ? 'selected' : ''}`;
10
10
  item.textContent = contents;
11
11
  item.addEventListener('mousedown', (event) => {
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.8.15';
1
+ export const VERSION = '2.8.16';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.8.15";
1
+ export declare const VERSION = "2.8.16";
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": "2.8.15",
4
+ "version": "2.8.16",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -1052,28 +1052,6 @@ th:hover > .table-context-menu-button,
1052
1052
  .ProseMirror .block-container:hover .section-category-button {
1053
1053
  opacity: 1;
1054
1054
  }
1055
- .section-category.menu {
1056
- border-radius: 8px;
1057
- border: 1px solid #e2e2e2;
1058
- box-shadow: 0px 4px 9px 0px rgba(0, 0, 0, 0.3);
1059
- }
1060
-
1061
- .section-category.menu .menu-item {
1062
- padding: 7px 8px 8px 16px;
1063
- box-sizing: border-box;
1064
- min-width: 176px;
1065
- height: 37px;
1066
- padding-right: 40px;
1067
- font-family: Lato;
1068
- font-size: 14px;
1069
- font-style: normal;
1070
- font-weight: 400;
1071
- line-height: 24px;
1072
- position: relative;
1073
- background: none;
1074
- border: unset;
1075
- display: flex;
1076
- }
1077
1055
 
1078
1056
  .section-category.menu .menu-item.selected:after {
1079
1057
  top: 10.5px;
@@ -1087,12 +1065,6 @@ th:hover > .table-context-menu-button,
1087
1065
  transform: rotate(45deg);
1088
1066
  }
1089
1067
 
1090
- .section-category.menu .menu-item.disabled {
1091
- opacity: 0.5;
1092
- cursor: not-allowed;
1093
- pointer-events: none;
1094
- }
1095
-
1096
1068
  .section-category.tooltip {
1097
1069
  font-family: 'Lato, sans-serif';
1098
1070
  padding: 8px;
package/styles/popper.css CHANGED
@@ -1,7 +1,5 @@
1
1
  .popper {
2
2
  color: #353535;
3
- font-family: 'PT Sans', sans-serif;
4
- /* min-width: 100px; */
5
3
  position: absolute;
6
4
  width: auto;
7
5
  z-index: 10;
@@ -104,24 +102,54 @@
104
102
  .popper .menu {
105
103
  background: #fff;
106
104
  border: 1px solid #e2e2e2;
107
- border-radius: 4px;
105
+ border-radius: 8px;
108
106
  box-shadow: 0 4px 9px 0 rgba(84, 83, 83, 0.3);
109
- font-size: 14px;
110
107
  min-width: 208px;
111
108
  }
112
109
 
110
+ .popper .menu .menu-section {
111
+ padding: 4px 0;
112
+ }
113
+
114
+ .popper .menu .menu-section:not(:last-child) {
115
+ border-bottom: 1px solid #e2e2e2;
116
+ }
117
+
113
118
  .popper .menu-item {
119
+ position: relative;
114
120
  display: flex;
115
121
  flex-direction: row;
116
122
  justify-content: flex-start;
117
123
  align-items: center;
118
124
  gap: 4px;
119
125
  cursor: pointer;
120
- padding: 16px 8px;
126
+ box-sizing: border-box;
127
+ width: 100%;
128
+ padding: 7px 16px 6px;
129
+ font-size: 14px;
130
+ font-style: normal;
131
+ font-weight: 400;
132
+ line-height: 24px;
133
+ }
134
+ .popper .menu.edit-menu .menu-section {
135
+ padding: 0;
136
+ border-bottom: none;
137
+ }
138
+ .popper .menu.edit-menu .menu-item {
139
+ padding: 16px;
140
+ font-size: 16px;
141
+ line-height: 24px;
121
142
  }
122
- .popper .menu-item[disabled] {
123
- cursor: default;
143
+
144
+
145
+ .popper .section-category .menu-item {
146
+ padding-right: 40px;
147
+ }
148
+
149
+ .popper .menu-item[disabled],
150
+ .popper .menu-item.disabled {
124
151
  opacity: 0.4;
152
+ cursor: not-allowed;
125
153
  pointer-events: none;
126
154
  }
127
155