@seafile/seafile-editor 3.0.35 → 3.0.36
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/dist/extension/commons/dropdown-menu-item/index.css +1 -11
- package/dist/extension/commons/dropdown-menu-item/index.js +1 -0
- package/dist/extension/{plugins/image/menu/index.css → commons/dropdown-menu-item/menu.css} +12 -11
- package/dist/extension/commons/menu/menu.css +2 -2
- package/dist/extension/commons/select/menu/menu.js +1 -1
- package/dist/extension/commons/select/menu/style.css +2 -1
- package/dist/extension/commons/select/style.css +4 -12
- package/dist/extension/plugins/header/menu/index.js +11 -1
- package/dist/extension/plugins/header/menu/style.css +5 -4
- package/dist/extension/plugins/image/menu/index.js +0 -1
- package/dist/extension/plugins/table/context-menu/horizontal-align-popover/index.js +5 -10
- package/dist/extension/plugins/table/context-menu/horizontal-align-popover/style.css +10 -9
- package/dist/extension/plugins/table/context-menu/style.css +4 -12
- package/dist/extension/plugins/table/menu/index.js +12 -12
- package/dist/extension/plugins/table/menu/style.css +9 -8
- package/dist/extension/plugins/table/menu/table-size-selector.js +3 -4
- package/dist/extension/toolbar/header-toolbar/insert-toolbar/style.css +0 -4
- package/package.json +1 -1
|
@@ -21,16 +21,6 @@
|
|
|
21
21
|
padding: 3px 12px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.sf-dropdown-menu .sf-dropdown-menu-item {
|
|
25
|
-
align-items: center;
|
|
26
|
-
display: flex;
|
|
27
|
-
height: 30px;
|
|
28
|
-
-webkit-user-select: none;
|
|
29
|
-
-ms-user-select: none;
|
|
30
|
-
user-select: none;
|
|
31
|
-
width: 100%
|
|
32
|
-
}
|
|
33
|
-
|
|
34
24
|
.sf-dropdown-menu .sf-dropdown-menu-item .sf-dropdown-item-content {
|
|
35
25
|
align-items: center;
|
|
36
26
|
display: flex;
|
|
@@ -48,6 +38,6 @@
|
|
|
48
38
|
}
|
|
49
39
|
|
|
50
40
|
.sf-dropdown-menu .sf-dropdown-item-content .sf-dropdown-item-content-icon {
|
|
51
|
-
margin-right:
|
|
41
|
+
margin-right: 12px;
|
|
52
42
|
vertical-align: 1px;
|
|
53
43
|
}
|
|
@@ -11,6 +11,7 @@ var _reactI18next = require("react-i18next");
|
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _constants = require("../../../constants");
|
|
13
13
|
var _menuShortcutIndicator = _interopRequireDefault(require("../menu-shortcut-indicator"));
|
|
14
|
+
require("./menu.css");
|
|
14
15
|
require("./index.css");
|
|
15
16
|
const DropdownMenuItem = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
16
17
|
const {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
.sf-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
.sf-dropdown-menu,
|
|
2
|
+
.sf-dropdown-menu .sf-dropdown-menu-container {
|
|
3
|
+
width: fit-content;
|
|
4
|
+
min-width: 200px;
|
|
5
|
+
max-width: 240px;
|
|
6
|
+
max-height: 600px;
|
|
7
|
+
overflow: visible;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.sf-dropdown-menu .sf-dropdown-menu-container {
|
|
10
|
-
|
|
11
|
-
z-index: 1500;
|
|
11
|
+
padding: 8px;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.sf-sub-dropdown-menu .popover {
|
|
15
|
-
left:
|
|
15
|
+
left: 0px !important;
|
|
16
16
|
z-index: 1070;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.sf-dropdown-menu .sf-dropdown-menu-item {
|
|
24
|
-
height:
|
|
24
|
+
height: 32px;
|
|
25
25
|
width: 100%;
|
|
26
26
|
padding: 3px 12px;
|
|
27
27
|
user-select: none;
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
.sf-sub-dropdown-menu:hover,
|
|
33
33
|
.sf-dropdown-menu .sf-dropdown-menu-item:hover {
|
|
34
|
-
background-color:
|
|
34
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
35
|
+
border-radius: 4px;
|
|
35
36
|
cursor: pointer;
|
|
36
37
|
}
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
align-items: flex-start;
|
|
92
92
|
z-index: 1000;
|
|
93
93
|
align-items: center;
|
|
94
|
-
padding: 8px
|
|
94
|
+
padding: 8px;
|
|
95
95
|
background-color: #fff;
|
|
96
96
|
border: 1px solid #e5e6e8;
|
|
97
|
-
border-radius:
|
|
97
|
+
border-radius: 8px;
|
|
98
98
|
box-shadow: 0 0 10px #ccc;
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
width: 150px;
|
|
6
|
-
padding: 8px
|
|
6
|
+
padding: 8px;
|
|
7
7
|
min-width: 80px;
|
|
8
8
|
overflow-y: auto;
|
|
9
9
|
overflow-x: hidden;
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
.sf-menu-container .sf-menu-item:hover {
|
|
28
28
|
background-color: #f5f5f5;
|
|
29
|
+
border-radius: 4px;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
.sf-menu-container .sf-menu-item .menu-item-icon {
|
|
@@ -62,17 +62,17 @@
|
|
|
62
62
|
min-width: 120px;
|
|
63
63
|
max-height: 265px;
|
|
64
64
|
margin-top: 4px;
|
|
65
|
-
padding: 8px
|
|
65
|
+
padding: 8px;
|
|
66
66
|
flex-direction: column;
|
|
67
67
|
border: 1px solid #e5e5e5;
|
|
68
68
|
box-shadow: 0 4px 10px #eee;
|
|
69
|
-
border-radius:
|
|
69
|
+
border-radius: 8px;
|
|
70
70
|
background: #fff;
|
|
71
71
|
z-index: 10;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.select-popover .option-item-divider {
|
|
75
|
-
margin
|
|
75
|
+
margin: 8px 0;
|
|
76
76
|
border-top: 1px solid #EFEFEF;
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -122,11 +122,7 @@
|
|
|
122
122
|
|
|
123
123
|
.select-popover .option-item:hover {
|
|
124
124
|
background-color: #F5F5F5;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
.select-popover .option-item.active {
|
|
128
|
-
background-color: #39A0FF;
|
|
129
|
-
color: #fff;
|
|
125
|
+
border-radius: 4px;
|
|
130
126
|
}
|
|
131
127
|
|
|
132
128
|
.select-popover .option-item.disable {
|
|
@@ -140,10 +136,6 @@
|
|
|
140
136
|
cursor: default;
|
|
141
137
|
}
|
|
142
138
|
|
|
143
|
-
.select-popover .option-item.active .item-icon {
|
|
144
|
-
color: #fff;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
139
|
.select-popover .option-item .label {
|
|
148
140
|
margin: 0 5px;
|
|
149
141
|
}
|
|
@@ -14,6 +14,8 @@ var _tooltip = _interopRequireDefault(require("../../../commons/tooltip"));
|
|
|
14
14
|
var _keyboard = require("../../../constants/keyboard");
|
|
15
15
|
var _constants = require("../../../constants");
|
|
16
16
|
var _constants2 = require("../../../../constants");
|
|
17
|
+
var _core = require("../../../core");
|
|
18
|
+
var _elementTypes = require("../../../constants/element-types");
|
|
17
19
|
require("./style.css");
|
|
18
20
|
const headerPopoverShowerList = [_constants.ELementTypes.PARAGRAPH, ..._constants.HEADERS];
|
|
19
21
|
const HeaderMenu = _ref => {
|
|
@@ -27,7 +29,15 @@ const HeaderMenu = _ref => {
|
|
|
27
29
|
const {
|
|
28
30
|
t
|
|
29
31
|
} = (0, _reactI18next.useTranslation)(_constants2.TRANSLATE_NAMESPACE);
|
|
30
|
-
const
|
|
32
|
+
const getCurrentType = () => {
|
|
33
|
+
let type = (0, _helper.getHeaderType)(editor);
|
|
34
|
+
if (!type) {
|
|
35
|
+
const selectNode = (0, _core.getSelectedNodeByType)(editor, _elementTypes.PARAGRAPH);
|
|
36
|
+
type = selectNode && selectNode.type;
|
|
37
|
+
}
|
|
38
|
+
return type;
|
|
39
|
+
};
|
|
40
|
+
const currentHeaderType = getCurrentType();
|
|
31
41
|
const isDisabled = (0, _helper.isMenuDisabled)(editor, readonly);
|
|
32
42
|
const onHideHeaderMenu = (0, _react.useCallback)(e => {
|
|
33
43
|
const menu = headerPopoverRef.current;
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
position: absolute;
|
|
74
74
|
top: 32px;
|
|
75
75
|
left: 8px;
|
|
76
|
-
padding: 8px
|
|
76
|
+
padding: 8px;
|
|
77
77
|
width: 100%;
|
|
78
78
|
background-color: #fff;
|
|
79
79
|
border: 1px solid #e5e6e8;
|
|
80
|
-
border-radius:
|
|
80
|
+
border-radius: 8px;
|
|
81
81
|
box-shadow: 0 0 10px #ccc;
|
|
82
82
|
display: flex;
|
|
83
83
|
flex-direction: column;
|
|
@@ -88,18 +88,19 @@
|
|
|
88
88
|
.sf-header-menu .sf-header-popover .sf-dropdown-menu-item {
|
|
89
89
|
font-size: 14px;
|
|
90
90
|
height: auto;
|
|
91
|
-
padding: 9px 16px 9px
|
|
91
|
+
padding: 9px 16px 9px 38px;
|
|
92
92
|
width: 100%;
|
|
93
93
|
line-height: 1;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.sf-header-menu .sf-header-popover .sf-dropdown-menu-item:hover {
|
|
97
97
|
background-color: #EFEFEF;
|
|
98
|
+
border-radius: 4px;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
.sf-header-menu .sf-header-popover .sf-dropdown-menu-item .md-check-mark {
|
|
101
102
|
position: absolute;
|
|
102
|
-
left:
|
|
103
|
+
left: 12px;
|
|
103
104
|
color: #666;
|
|
104
105
|
font-size: 14px;
|
|
105
106
|
}
|
|
@@ -14,7 +14,6 @@ var _dropdownMenuItem = _interopRequireDefault(require("../../../commons/dropdow
|
|
|
14
14
|
var _reactstrap = require("reactstrap");
|
|
15
15
|
var _reactI18next = require("react-i18next");
|
|
16
16
|
var _constants = require("../../../../constants");
|
|
17
|
-
require("./index.css");
|
|
18
17
|
const menuConfig = _menusConfig.MENUS_CONFIG_MAP[_elementTypes.IMAGE];
|
|
19
18
|
const ImageMenu = _ref => {
|
|
20
19
|
var _editor$api;
|
|
@@ -41,38 +41,33 @@ const HorizontalAlignPopover = _ref => {
|
|
|
41
41
|
placement: "right-start",
|
|
42
42
|
hideArrow: true,
|
|
43
43
|
fade: false,
|
|
44
|
-
offset: [0,
|
|
44
|
+
offset: [0, 8],
|
|
45
|
+
popperClassName: "sf-table-alignment-popover"
|
|
45
46
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
46
47
|
className: "sf-dropdown-menu sf-table-alignment-menu"
|
|
47
48
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
48
49
|
className: "sf-dropdown-menu-item",
|
|
49
50
|
onMouseDown: () => setTextAlignStyle('left')
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
-
className: "sf-checked"
|
|
52
51
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
53
52
|
className: (0, _classnames.default)('mdfont md-check-mark', {
|
|
54
53
|
active: !horizontalAlign || horizontalAlign === 'left'
|
|
55
54
|
})
|
|
56
|
-
})
|
|
55
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
57
56
|
className: "active"
|
|
58
57
|
}, t('Left'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
59
58
|
className: "sf-dropdown-menu-item",
|
|
60
59
|
onMouseDown: () => setTextAlignStyle('center')
|
|
61
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
-
className: "sf-checked"
|
|
63
60
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
64
61
|
className: (0, _classnames.default)('mdfont md-check-mark', {
|
|
65
62
|
active: horizontalAlign === 'center'
|
|
66
63
|
})
|
|
67
|
-
})
|
|
64
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, t('Center'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
68
65
|
className: "sf-dropdown-menu-item",
|
|
69
66
|
onMouseDown: () => setTextAlignStyle('right')
|
|
70
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
-
className: "sf-checked"
|
|
72
67
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
73
68
|
className: (0, _classnames.default)('mdfont md-check-mark', {
|
|
74
69
|
active: horizontalAlign === 'right'
|
|
75
70
|
})
|
|
76
|
-
})
|
|
71
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, t('Right')))));
|
|
77
72
|
};
|
|
78
73
|
var _default = exports.default = HorizontalAlignPopover;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
.sf-context-menu .sf-dropdown-menu {
|
|
2
4
|
display: flex;
|
|
3
5
|
flex-direction: column;
|
|
4
6
|
}
|
|
7
|
+
.sf-table-alignment-popover {
|
|
8
|
+
z-index: 2000;
|
|
5
9
|
|
|
10
|
+
}
|
|
6
11
|
.sf-table-alignment-menu {
|
|
7
|
-
padding: 8px
|
|
12
|
+
padding: 8px;
|
|
13
|
+
min-width: 80px;
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
.sf-table-alignment-menu .sf-dropdown-menu-item {
|
|
11
|
-
padding: 4px
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.sf-table-alignment-menu .sf-dropdown-menu-item .sf-checked {
|
|
15
|
-
margin-right: 6px;
|
|
16
|
-
height: 21px;
|
|
17
|
-
line-height: 21px;
|
|
18
|
-
width: 12px;
|
|
17
|
+
padding: 4px 12px 4px 38px !important;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
.sf-table-alignment-menu .sf-dropdown-menu-item .md-check-mark {
|
|
21
|
+
position: absolute;
|
|
22
|
+
left: 20px;
|
|
22
23
|
color: #666;
|
|
23
24
|
display: none;
|
|
24
25
|
font-size: 12px !important;
|
|
@@ -63,12 +63,6 @@
|
|
|
63
63
|
transition: none;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
.sf-context-menu .sf-context-menu-item:hover .insert-number-input {
|
|
67
|
-
background-color: transparent;
|
|
68
|
-
border: 1px solid #fff;
|
|
69
|
-
color: #fff;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
66
|
.sf-context-menu .sf-context-menu-item:disabled .insert-number-input {
|
|
73
67
|
color: #adb5bd;
|
|
74
68
|
}
|
|
@@ -81,13 +75,11 @@
|
|
|
81
75
|
.side-extendable .md-arrow-right {
|
|
82
76
|
color: #666;
|
|
83
77
|
font-size: 12px;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.side-extendable:hover .md-arrow-right {
|
|
87
|
-
color: #fff;
|
|
78
|
+
line-height: 12px;
|
|
88
79
|
}
|
|
89
80
|
|
|
90
81
|
.sf-context-menu .sf-dropdown-menu-item:hover {
|
|
91
|
-
color:
|
|
92
|
-
|
|
82
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
83
|
+
border-radius: 4px;
|
|
84
|
+
cursor: pointer;
|
|
93
85
|
}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactstrap = require("reactstrap");
|
|
10
11
|
var _constants = require("../../../constants");
|
|
11
12
|
var _elementTypes = require("../../../constants/element-types");
|
|
12
13
|
var _helper = require("../helper");
|
|
@@ -20,26 +21,25 @@ const TableMenu = _ref => {
|
|
|
20
21
|
readonly,
|
|
21
22
|
toggle
|
|
22
23
|
} = _ref;
|
|
23
|
-
const [isOpenTableSizeSelector, setIsOpenTableSizeSelector] = (0, _react.useState)(false);
|
|
24
24
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
25
|
const disabled = (0, _react.useMemo)(() => (0, _helper.isDisabled)(editor, readonly), [editor.selection, readonly]);
|
|
26
|
-
|
|
27
|
-
const handleMouseEnter = () => setIsOpenTableSizeSelector(true);
|
|
28
|
-
const handleMouseLeave = () => setIsOpenTableSizeSelector(false);
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
-
className: "table-menu-container",
|
|
31
|
-
onMouseEnter: handleMouseEnter,
|
|
32
|
-
onMouseLeave: handleMouseLeave
|
|
33
|
-
}, /*#__PURE__*/_react.default.createElement(_dropdownMenuItem.default, {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_dropdownMenuItem.default, {
|
|
34
27
|
disabled: disabled,
|
|
35
28
|
menuConfig: menuConfig,
|
|
36
29
|
className: "pr-2"
|
|
37
30
|
}, !disabled && /*#__PURE__*/_react.default.createElement("i", {
|
|
38
31
|
className: "mdfont md-arrow-right sf-dropdown-item-right-icon"
|
|
39
|
-
})), !disabled &&
|
|
40
|
-
|
|
32
|
+
})), !disabled && /*#__PURE__*/_react.default.createElement(_reactstrap.UncontrolledPopover, {
|
|
33
|
+
target: menuConfig.id,
|
|
34
|
+
trigger: "hover",
|
|
35
|
+
className: "sf-dropdown-menu sf-sub-dropdown-menu sf-table-size-selector-popover",
|
|
36
|
+
placement: "right-start",
|
|
37
|
+
hideArrow: true,
|
|
38
|
+
fade: false,
|
|
39
|
+
offset: [0, 8]
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_tableSizeSelector.default, {
|
|
41
41
|
editor: editor,
|
|
42
42
|
onHideSelector: toggle
|
|
43
|
-
}));
|
|
43
|
+
})));
|
|
44
44
|
};
|
|
45
45
|
var _default = exports.default = TableMenu;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
.sf-table-
|
|
2
|
-
|
|
1
|
+
.sf-table-size-selector-popover {
|
|
2
|
+
min-width: auto !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.sf-table-size-selector-popover .popover {
|
|
6
|
+
max-width: none;
|
|
7
|
+
border-radius: 8px;
|
|
3
8
|
}
|
|
4
9
|
|
|
5
10
|
.sf-table-size-selector-card {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
top: 30px;
|
|
9
|
-
padding: 5px 12px;
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
padding: 8px 12px;
|
|
10
13
|
background-color: #fff;
|
|
11
|
-
border: 1px solid #0028641f;
|
|
12
|
-
left: 100%;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
.sf-table-size-selector-card .sf-table-grid-info {
|
|
@@ -10,7 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _helper = require("../helper");
|
|
12
12
|
require("./style.css");
|
|
13
|
-
const TableSizeSelector =
|
|
13
|
+
const TableSizeSelector = _ref => {
|
|
14
14
|
let {
|
|
15
15
|
editor,
|
|
16
16
|
onHideSelector
|
|
@@ -81,10 +81,9 @@ const TableSizeSelector = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
|
|
|
81
81
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
82
82
|
const tableGridElement = (0, _react.useMemo)(() => generateTableGrid(showingGridInfo.row, showingGridInfo.column), [generateTableGrid]);
|
|
83
83
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
84
|
-
className: "sf-table-size-selector-card"
|
|
85
|
-
ref: ref
|
|
84
|
+
className: "sf-table-size-selector-card"
|
|
86
85
|
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
87
86
|
className: "sf-table-grid-info"
|
|
88
87
|
}, "".concat(selectedGridInfo.row, " x ").concat(selectedGridInfo.column)), tableGridElement);
|
|
89
|
-
}
|
|
88
|
+
};
|
|
90
89
|
var _default = exports.default = TableSizeSelector;
|