@seafile/seafile-editor 0.3.115 → 0.3.117
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/assets/editor/seatable-editor.css +77 -0
- package/dist/components/select/field-setting.js +11 -14
- package/dist/components/select/index.js +14 -5
- package/dist/components/select/style.css +39 -44
- package/dist/editor/seatable-editor.js +2 -2
- package/dist/utils/slate2markdown/serialize.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.seatable-simple-editor {
|
|
2
|
+
flex: 1;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
height: 100%;
|
|
6
|
+
min-width: 768px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
border: 1px solid #e5e5e5;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.seatable-simple-editor .seafile-editor-topbar {
|
|
12
|
+
width: 100%;
|
|
13
|
+
background-color: #fff;
|
|
14
|
+
border-bottom: 1px solid #e5e5e5;
|
|
15
|
+
box-shadow: 0 3px 2px -2px rgba(200,200,200,.15);
|
|
16
|
+
user-select: none;
|
|
17
|
+
position: relative;
|
|
18
|
+
z-index: 3;
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.seatable-simple-editor .seafile-editor-topbar .use-help-icon {
|
|
24
|
+
background-color: #fff;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.seatable-simple-editor .seafile-editor-topbar .editor-btn-group {
|
|
29
|
+
height: 100%;
|
|
30
|
+
padding: 5px 0 5px 5px;
|
|
31
|
+
font-size: 0.75rem;
|
|
32
|
+
border-right: 1px solid #e5e5e5;
|
|
33
|
+
color: #555555;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.seatable-simple-editor .header-list-container {
|
|
37
|
+
border-left: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.seatable-simple-editor .editor {
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 10px;
|
|
43
|
+
height: 100%;
|
|
44
|
+
border: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/*set scroll bar*/
|
|
48
|
+
.editor-container::-webkit-scrollbar{
|
|
49
|
+
width: 8px;
|
|
50
|
+
height: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.editor-container::-webkit-scrollbar-button {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.editor-container::-webkit-scrollbar-thumb {
|
|
58
|
+
background-color: rgb(206, 206, 212);
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.editor-container {
|
|
63
|
+
/* this container is needed to show the scroll bar */
|
|
64
|
+
height: 100%;
|
|
65
|
+
overflow-y: auto;
|
|
66
|
+
flex: 1 1 auto;
|
|
67
|
+
position: relative;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.editor {
|
|
71
|
+
min-height: calc(100% - 40px);
|
|
72
|
+
background: #fff;
|
|
73
|
+
padding: 40px 60px;
|
|
74
|
+
margin: 20px 40px;
|
|
75
|
+
border: 1px solid rgb(230,230,221);
|
|
76
|
+
overflow-x: hidden;
|
|
77
|
+
}
|
|
@@ -20,18 +20,8 @@ var FieldSetting = /*#__PURE__*/function (_React$Component) {
|
|
|
20
20
|
|
|
21
21
|
_this = _super.call(this, props);
|
|
22
22
|
|
|
23
|
-
_this.
|
|
23
|
+
_this.onMouseEnter = function () {
|
|
24
24
|
if (!_this.props.option) return;
|
|
25
|
-
var isShowMenu = _this.state.isShowMenu;
|
|
26
|
-
|
|
27
|
-
if (isShowMenu) {
|
|
28
|
-
_this.setState({
|
|
29
|
-
isShowMenu: false
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
25
|
var container = _this.settingRef;
|
|
36
26
|
|
|
37
27
|
var _container$getBoundin = container.getBoundingClientRect(),
|
|
@@ -49,6 +39,12 @@ var FieldSetting = /*#__PURE__*/function (_React$Component) {
|
|
|
49
39
|
});
|
|
50
40
|
};
|
|
51
41
|
|
|
42
|
+
_this.onMouseLeave = function () {
|
|
43
|
+
_this.setState({
|
|
44
|
+
isShowMenu: false
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
52
48
|
_this.onBoldClick = function (event) {
|
|
53
49
|
event.stopPropagation();
|
|
54
50
|
var option = _this.props.option;
|
|
@@ -98,14 +94,15 @@ var FieldSetting = /*#__PURE__*/function (_React$Component) {
|
|
|
98
94
|
isItalic = _ref.italic;
|
|
99
95
|
|
|
100
96
|
var isShowMenu = this.state.isShowMenu;
|
|
101
|
-
var className = "
|
|
97
|
+
var className = "field-setting ".concat(isDisable ? 'disable' : '', " option-item");
|
|
102
98
|
return /*#__PURE__*/React.createElement("span", {
|
|
103
99
|
ref: this.setSettingRef,
|
|
104
100
|
className: className,
|
|
105
|
-
|
|
101
|
+
onMouseEnter: this.onMouseEnter,
|
|
102
|
+
onMouseLeave: this.onMouseLeave
|
|
106
103
|
}, /*#__PURE__*/React.createElement(TextIcon, {
|
|
107
104
|
width: "14",
|
|
108
|
-
color:
|
|
105
|
+
color: '#aaa'
|
|
109
106
|
}), /*#__PURE__*/React.createElement("span", {
|
|
110
107
|
className: "label"
|
|
111
108
|
}, t('Font_style')), /*#__PURE__*/React.createElement("span", {
|
|
@@ -38,8 +38,15 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
_this.onSelectToggle = function (event) {
|
|
41
|
+
var isShowSelector = _this.state.isShowSelector;
|
|
42
|
+
var newValue = !isShowSelector;
|
|
43
|
+
|
|
44
|
+
if (newValue) {
|
|
45
|
+
_this.dropdownContainerHasInit = false;
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
_this.setState({
|
|
42
|
-
isShowSelector:
|
|
49
|
+
isShowSelector: newValue
|
|
43
50
|
});
|
|
44
51
|
};
|
|
45
52
|
|
|
@@ -137,14 +144,16 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
137
144
|
}, /*#__PURE__*/React.createElement("i", {
|
|
138
145
|
className: "iconfont icon-drop-down arrow"
|
|
139
146
|
}))), isShowSelector && /*#__PURE__*/React.createElement("span", {
|
|
140
|
-
|
|
141
|
-
className: "value-container"
|
|
147
|
+
className: "select-popover"
|
|
142
148
|
}, /*#__PURE__*/React.createElement(FieldSetting, {
|
|
143
149
|
option: currentOption,
|
|
144
150
|
onUpdateOption: this.onUpdateOption
|
|
145
151
|
}), /*#__PURE__*/React.createElement("span", {
|
|
146
152
|
className: "option-item-divider"
|
|
147
|
-
}),
|
|
153
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
154
|
+
className: "option-item-wrapper",
|
|
155
|
+
ref: this.setContainerRef
|
|
156
|
+
}, options.map(function (option) {
|
|
148
157
|
var isActive = option.value === (currentOption && currentOption.value);
|
|
149
158
|
return /*#__PURE__*/React.createElement(Option, {
|
|
150
159
|
key: option.value,
|
|
@@ -153,7 +162,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
153
162
|
option: option,
|
|
154
163
|
onOptionChanged: _this2.onChange
|
|
155
164
|
});
|
|
156
|
-
})));
|
|
165
|
+
}))));
|
|
157
166
|
}
|
|
158
167
|
}]);
|
|
159
168
|
|
|
@@ -55,14 +55,12 @@
|
|
|
55
55
|
color: #666;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.select-container .
|
|
58
|
+
.select-container .select-popover {
|
|
59
59
|
position: absolute;
|
|
60
60
|
left: 0;
|
|
61
61
|
display: flex;
|
|
62
62
|
min-width: 80px;
|
|
63
|
-
max-height:
|
|
64
|
-
overflow-x: hidden;
|
|
65
|
-
overflow-y: auto;
|
|
63
|
+
max-height: 265px;
|
|
66
64
|
margin-top: 4px;
|
|
67
65
|
padding: 8px 0;
|
|
68
66
|
flex-direction: column;
|
|
@@ -71,15 +69,41 @@
|
|
|
71
69
|
border-radius: 4px;
|
|
72
70
|
background: #fff;
|
|
73
71
|
z-index: 10;
|
|
74
|
-
scrollbar-width: none;
|
|
75
|
-
-ms-overflow-style: none;
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
.select-
|
|
79
|
-
|
|
74
|
+
.select-popover .option-item-divider {
|
|
75
|
+
margin-top: 8px;
|
|
76
|
+
border-top: 1px solid #EFEFEF;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.select-popover .field-setting {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
position: relative;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.select-popover .field-setting .icon-container {
|
|
86
|
+
position: absolute;
|
|
87
|
+
right: 10px;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
80
91
|
}
|
|
81
92
|
|
|
82
|
-
.select-
|
|
93
|
+
.select-popover .field-setting .op-icon {
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
transform: rotate(90deg);
|
|
96
|
+
color: #aaa;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.select-popover .option-item-wrapper {
|
|
100
|
+
flex: 1;
|
|
101
|
+
min-height: 0;
|
|
102
|
+
min-width: 0;
|
|
103
|
+
overflow: auto;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.select-popover .option-item {
|
|
83
107
|
flex-shrink: 0;
|
|
84
108
|
display: flex;
|
|
85
109
|
align-items: center;
|
|
@@ -91,59 +115,30 @@
|
|
|
91
115
|
white-space: nowrap;
|
|
92
116
|
}
|
|
93
117
|
|
|
94
|
-
.select-
|
|
118
|
+
.select-popover .option-item:hover {
|
|
95
119
|
background-color: #F5F5F5;
|
|
96
120
|
}
|
|
97
121
|
|
|
98
|
-
.select-
|
|
122
|
+
.select-popover .option-item.active {
|
|
99
123
|
background-color: #39A0FF;
|
|
100
124
|
color: #fff;
|
|
101
125
|
}
|
|
102
126
|
|
|
103
|
-
.select-
|
|
127
|
+
.select-popover .option-item.disable {
|
|
104
128
|
color: #aaa;
|
|
105
129
|
cursor: default;
|
|
106
130
|
}
|
|
107
131
|
|
|
108
|
-
.select-
|
|
132
|
+
.select-popover .option-item .item-icon {
|
|
109
133
|
font-size: 14px;
|
|
110
134
|
color: rgb(170, 170, 170);
|
|
111
135
|
cursor: default;
|
|
112
136
|
}
|
|
113
137
|
|
|
114
|
-
.select-
|
|
138
|
+
.select-popover .option-item.active .item-icon {
|
|
115
139
|
color: #fff;
|
|
116
140
|
}
|
|
117
141
|
|
|
118
|
-
.select-
|
|
142
|
+
.select-popover .option-item .label {
|
|
119
143
|
margin: 0 5px;
|
|
120
144
|
}
|
|
121
|
-
|
|
122
|
-
.option-item.field-setting {
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
position: relative;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.option-item.field-setting .icon-container {
|
|
129
|
-
position: absolute;
|
|
130
|
-
right: 10px;
|
|
131
|
-
display: flex;
|
|
132
|
-
align-items: center;
|
|
133
|
-
justify-content: center;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.option-item.field-setting .op-icon {
|
|
137
|
-
font-size: 12px;
|
|
138
|
-
transform: rotate(90deg);
|
|
139
|
-
color: #aaa;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.option-item.active.field-setting .op-icon {
|
|
143
|
-
color: #FFF;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.value-container .option-item-divider {
|
|
147
|
-
margin-top: 8px;
|
|
148
|
-
border-top: 1px solid #EFEFEF;
|
|
149
|
-
}
|
|
@@ -18,7 +18,7 @@ import EditorBuilder from './editor-builder';
|
|
|
18
18
|
import AddLinkDialog from '../components/add-link-dialog';
|
|
19
19
|
import ErrorBoundary from '../components/error-boundary';
|
|
20
20
|
import './code-highlight-package';
|
|
21
|
-
import '../assets/editor/
|
|
21
|
+
import '../assets/editor/seatable-editor.css';
|
|
22
22
|
import '../assets/css/image.css';
|
|
23
23
|
import '../assets/css/link.css';
|
|
24
24
|
import '../assets/css/navbar-imgbutton.css';
|
|
@@ -171,7 +171,7 @@ var SeatableEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
171
171
|
var supportInsertColumn = canInsertColumn && columns.length > 0;
|
|
172
172
|
var selectionCollapsed = isRangeCollapsed(editor.selection);
|
|
173
173
|
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement("div", {
|
|
174
|
-
className: "
|
|
174
|
+
className: "seatable-simple-editor"
|
|
175
175
|
}, /*#__PURE__*/React.createElement("div", {
|
|
176
176
|
className: "seafile-editor-topbar"
|
|
177
177
|
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
@@ -367,6 +367,15 @@ function _slateNodeToMD(node) {
|
|
|
367
367
|
value: data.formula
|
|
368
368
|
};
|
|
369
369
|
|
|
370
|
+
case 'column':
|
|
371
|
+
{
|
|
372
|
+
var _data = node.data;
|
|
373
|
+
var newNode = {
|
|
374
|
+
text: "{".concat(_data.name, "}")
|
|
375
|
+
};
|
|
376
|
+
return _text2MdNodes(newNode);
|
|
377
|
+
}
|
|
378
|
+
|
|
370
379
|
default:
|
|
371
380
|
// turn the block to paragraph default when it`s type is unknown
|
|
372
381
|
mdNodes = parseChildren(node);
|