@seafile/sdoc-editor 2.0.33-alph-0.0.1 → 2.0.34-alph-0.0.1

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.
@@ -3,12 +3,13 @@
3
3
  width: 100%;
4
4
  height: 100%;
5
5
  display: flex;
6
- flex-direction: column;
6
+ flex-direction: row;
7
7
  align-items: center;
8
8
  justify-content: center;
9
- top: 0;
9
+ bottom: 0;
10
10
  left: 0;
11
- background-color: 'rgba(0, 0, 0, 0.5)'
11
+ background-color: rgba(0, 0, 0, 0.5);
12
+ min-height: 28px;
12
13
  }
13
14
 
14
15
  @keyframes spin {
@@ -33,5 +34,7 @@
33
34
  }
34
35
 
35
36
  .sdoc-image-process-container .copyright {
36
- margin-top: 4px;
37
+ margin-left: 15px;
38
+ display: inline-block;
39
+ white-space: nowrap;
37
40
  }
@@ -209,8 +209,8 @@ const Image = _ref => {
209
209
  }
210
210
  }, [data, editor]);
211
211
  const onImageLoaded = (0, _react.useCallback)(() => {
212
- if ((0, _helpers.isImagUrlIsFromCopy)(data.src)) {
213
- setCopyImageLoading(true);
212
+ if (!(0, _helpers.isImagUrlIsFromCopy)(data.src)) {
213
+ setCopyImageLoading(false);
214
214
  }
215
215
  }, [data.src, setCopyImageLoading]);
216
216
  const onImageLoadError = (0, _react.useCallback)(() => {
@@ -35,7 +35,7 @@ const useImageUpload = _ref => {
35
35
  const {
36
36
  is_copy_error = false
37
37
  } = data;
38
- const [isLoading, setIsLoading] = (0, _react.useState)(false);
38
+ const [isLoading, setIsLoading] = (0, _react.useState)(true);
39
39
  const [isCopyError, setIsCopyError] = (0, _react.useState)(is_copy_error);
40
40
  (0, _react.useEffect)(() => {
41
41
  const {
@@ -1,6 +1,5 @@
1
1
  .seatable-rows-select-dialog {
2
- max-width: 620px;
3
- height: 520px;
2
+ max-width: 520px;
4
3
  }
5
4
 
6
5
  .seatable-rows-select-dialog .sdoc-seatable-rows-select-footer {
@@ -36,8 +35,10 @@
36
35
  padding: 0 !important;
37
36
  }
38
37
 
39
- .seatable-rows-select-dialog .modal-body .form-group {
40
- margin: 0 !important;
38
+ .seatable-rows-select-dialog .modal-body .form-label {
39
+ margin: 1rem 1rem 0;
40
+ padding-bottom: 1rem;
41
+ border-bottom: 1px solid #e2e2e2;
41
42
  }
42
43
 
43
44
  .seatable-rows-close-dialog {
@@ -60,10 +61,10 @@
60
61
  }
61
62
 
62
63
  .seatable-rows-select-dialog .seatable-table-wrapper {
63
- height: 382px;
64
+ height: 280px;
64
65
  overflow-x: auto;
65
66
  overflow-y: hidden;
66
- /* border: 2px solid transparent; */
67
+ border: 2px solid transparent;
67
68
  }
68
69
 
69
70
  .seatable-rows-select-dialog .row-card-container {
@@ -84,10 +85,6 @@
84
85
  align-items: center;
85
86
  }
86
87
 
87
- .row-card-header {
88
- border-bottom: 1px solid #e9ecef;
89
- }
90
-
91
88
  .row-card-header .row-card-column-names {
92
89
  padding: 8px 32px;
93
90
  width: 100%;
@@ -156,14 +153,12 @@
156
153
  }
157
154
 
158
155
  .seatable-rows-select-dialog .row-card-container .row-card-list {
159
- height: calc(100% - 46px);
156
+ height: calc(100% - 40px);
160
157
  width: 100%;
161
158
  min-width: 100%;
162
- padding: 12px 20px 10px;
159
+ padding: 10px 20px;
163
160
  overflow-y: auto;
164
- margin: 0 !important;
165
- /* margin-top: 1px; */
166
- background-color: #f5f5f5;
161
+ margin-top: 3px;
167
162
  }
168
163
 
169
164
  .row-card-list .no-records-tips {
@@ -205,7 +200,7 @@
205
200
  }
206
201
 
207
202
  .row-card-item:last-child {
208
- margin-bottom: 0 !important;
203
+ margin-bottom: 10px;
209
204
  }
210
205
 
211
206
  .row-card-item:hover {
@@ -246,7 +241,7 @@
246
241
  .row-card-item .row-card-item-name {
247
242
  height: 100%;
248
243
  flex: 1 1;
249
- font-weight: 500;
244
+ font-weight: 400;
250
245
  }
251
246
 
252
247
  .row-card-item .row-card-item-check {
@@ -56,7 +56,7 @@ const AddSeatableRowDialog = _ref => {
56
56
  onClick: closeDialog
57
57
  })), /*#__PURE__*/_react.default.createElement(_reactstrap.ModalBody, null, /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
58
58
  className: "form-group"
59
- }, /*#__PURE__*/_react.default.createElement(_seatableTableRecord.default, {
59
+ }, /*#__PURE__*/_react.default.createElement(_reactstrap.Label, null, table.name), /*#__PURE__*/_react.default.createElement(_seatableTableRecord.default, {
60
60
  table: table,
61
61
  setSelectedRow: setSelectedRow
62
62
  }), rowRecordsErrorMessage && /*#__PURE__*/_react.default.createElement(_reactstrap.Alert, {
@@ -71,6 +71,6 @@ const AddSeatableRowDialog = _ref => {
71
71
  color: "primary",
72
72
  disabled: false,
73
73
  onClick: submit
74
- }, t('Submit'))));
74
+ }, t('Add_row_record'))));
75
75
  };
76
76
  var _default = exports.default = AddSeatableRowDialog;
@@ -11,20 +11,14 @@ var _utils = require("../../../utils");
11
11
  var _eventBus = _interopRequireDefault(require("../../../../utils/event-bus"));
12
12
  var _constants = require("../../../../constants");
13
13
  var _constants2 = require("../../../constants");
14
- var _reactstrap = require("reactstrap");
15
- var _reactI18next = require("react-i18next");
16
14
  const SeaTableList = _ref => {
17
15
  let {
18
16
  editor,
19
17
  toggle
20
18
  } = _ref;
21
- const {
22
- t
23
- } = (0, _reactI18next.useTranslation)('sdoc-editor');
24
19
  const seatableRef = (0, _react.useRef)(null);
25
- const isComposingRef = (0, _react.useRef)(null);
26
20
  const [computedStyle, setComputedStyle] = (0, _react.useState)({});
27
- const [tables, setTables] = (0, _react.useState)(editor.tables || []);
21
+ const tables = editor.tables;
28
22
  (0, _react.useEffect)(() => {
29
23
  if (seatableRef.current) {
30
24
  // bottom overflow
@@ -39,16 +33,6 @@ const SeaTableList = _ref => {
39
33
  });
40
34
  }
41
35
  }, []);
42
- const onChange = (0, _react.useCallback)(event => {
43
- if (isComposingRef.current) return;
44
- const value = event.target.value.trim().toUpperCase();
45
- if (value) {
46
- const list = editor.tables.filter(item => item.name.toUpperCase().includes(value));
47
- setTables(list);
48
- } else {
49
- setTables(editor.tables);
50
- }
51
- }, [editor.tables]);
52
36
  const openSelectSeatableTableDialog = (0, _react.useCallback)(item => {
53
37
  const eventBus = _eventBus.default.getInstance();
54
38
  eventBus.dispatch(_constants.INTERNAL_EVENT.INSERT_ELEMENT, {
@@ -61,26 +45,11 @@ const SeaTableList = _ref => {
61
45
 
62
46
  // eslint-disable-next-line react-hooks/exhaustive-deps
63
47
  }, [toggle]);
64
- const onCompositionStart = (0, _react.useCallback)(() => {
65
- isComposingRef.current = true;
66
- }, []);
67
- const onCompositionEnd = (0, _react.useCallback)(e => {
68
- isComposingRef.current = false;
69
- onChange(e);
70
- }, [onChange]);
71
48
  return /*#__PURE__*/_react.default.createElement("div", {
72
49
  ref: seatableRef,
73
50
  className: "sdoc-dropdown-menu-container sdoc-seatable-selected-table-list-wrapper",
74
51
  style: computedStyle
75
52
  }, /*#__PURE__*/_react.default.createElement("div", {
76
- className: "sdoc-seatable-list-search-wrapper"
77
- }, /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
78
- placeholder: t('Search_action'),
79
- onChange: onChange,
80
- autoFocus: true,
81
- onCompositionStart: onCompositionStart,
82
- onCompositionEnd: onCompositionEnd
83
- })), /*#__PURE__*/_react.default.createElement("div", {
84
53
  className: "sdoc-seatable-list-wrapper"
85
54
  }, tables.map(item => {
86
55
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -42,6 +42,7 @@ const RowRecord = _ref => {
42
42
  (0, _react.useEffect)(() => {
43
43
  async function initTableData() {
44
44
  const table = await editor.getTableById(table_id);
45
+ setRowRecordName(table.rows[0]['0000']);
45
46
  if (!tableInfoRef.current) {
46
47
  tableInfoRef.current = {};
47
48
  }
@@ -56,7 +57,6 @@ const RowRecord = _ref => {
56
57
  }
57
58
  const shownRecord = table.rows.filter(item => row_id === item._id);
58
59
  setShownRecord(shownRecord);
59
- setRowRecordName(shownRecord[0]['0000']);
60
60
  const updatedColumnWidthMap = Object.fromEntries(Object.entries(columnWidthMap).map(_ref2 => {
61
61
  let [key, value] = _ref2;
62
62
  return [key, value];
@@ -121,6 +121,7 @@ class TableContextMenu extends _react.default.Component {
121
121
  t,
122
122
  readonly
123
123
  } = this.props;
124
+ if (readonly) return;
124
125
  const currentTable = (0, _core.getSelectedNodeByType)(editor, _constants.ELEMENT_TYPE.TABLE);
125
126
  if (!currentTable) return null;
126
127
  const currentRow = (0, _core.getSelectedNodeByType)(editor, _constants.ELEMENT_TYPE.TABLE_ROW);
@@ -25,7 +25,6 @@ var _menu = _interopRequireDefault(require("../../plugins/seatable-column/menu")
25
25
  var _menu2 = _interopRequireDefault(require("../../plugins/seatable-tables/menu"));
26
26
  var _helper = require("../../plugins/callout/helper");
27
27
  var _helper2 = require("../../plugins/multi-column/helper");
28
- var _menu3 = _interopRequireDefault(require("../../plugins/seatable-row/menu"));
29
28
  const InsertBlockMenu = _ref => {
30
29
  let {
31
30
  insertPosition = _constants.INSERT_POSITION.CURRENT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.33-alph-0.0.1",
3
+ "version": "2.0.34-alph-0.0.1",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",