@seafile/sdoc-editor 1.0.63 → 1.0.65
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/basic-sdk/assets/css/sdoc-editor-plugins.css +1 -0
- package/dist/basic-sdk/extension/plugins/image/hover-menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/image/render-elem.js +1 -1
- package/dist/basic-sdk/extension/plugins/seatable-tables/render-element/seatable-table.js +104 -101
- package/package.json +1 -1
- package/public/locales/cs/sdoc-editor.json +1 -1
- package/public/locales/de/sdoc-editor.json +1 -1
- package/public/locales/en/sdoc-editor.json +1 -1
- package/public/locales/es/sdoc-editor.json +1 -1
- package/public/locales/es_AR/sdoc-editor.json +1 -1
- package/public/locales/es_MX/sdoc-editor.json +1 -1
- package/public/locales/fr/sdoc-editor.json +1 -1
- package/public/locales/it/sdoc-editor.json +1 -1
- package/public/locales/ru/sdoc-editor.json +2 -2
- package/public/locales/zh_CN/sdoc-editor.json +1 -1
|
@@ -225,7 +225,7 @@ const ImageHoverMenu = _ref => {
|
|
|
225
225
|
target: "sdoc_image_caption",
|
|
226
226
|
placement: "top",
|
|
227
227
|
fade: true
|
|
228
|
-
}, t('
|
|
228
|
+
}, t('Caption')))), /*#__PURE__*/_react.default.createElement("span", {
|
|
229
229
|
className: "op-group-item"
|
|
230
230
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
231
231
|
id: "sdoc_image_full_screen_mode",
|
|
@@ -261,7 +261,7 @@ const Image = _ref => {
|
|
|
261
261
|
style: {
|
|
262
262
|
width: (data === null || data === void 0 ? void 0 : data.width) || ((_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 ? void 0 : _imageRef$current2.clientWidth)
|
|
263
263
|
},
|
|
264
|
-
placeholder: t('
|
|
264
|
+
placeholder: t('Caption'),
|
|
265
265
|
autoComplete: "off",
|
|
266
266
|
value: caption,
|
|
267
267
|
onBlur: onSetCaption,
|
|
@@ -72,116 +72,119 @@ function SeaTableTable(_ref) {
|
|
|
72
72
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
73
|
}, [column_width]);
|
|
74
74
|
(0, _react.useEffect)(() => {
|
|
75
|
-
|
|
76
|
-
table_id
|
|
77
|
-
} = element;
|
|
78
|
-
const table = editor.getTableById(table_id);
|
|
79
|
-
if (!tableInfoRef.current) {
|
|
80
|
-
tableInfoRef.current = {};
|
|
81
|
-
}
|
|
82
|
-
if (!tableInfoRef.current[table_id]) {
|
|
83
|
-
tableInfoRef.current[table_id] = {
|
|
84
|
-
formulaRows: editor.getTableFormulaResults(table, table.rows),
|
|
85
|
-
idRowMap: table.rows.reduce((result, item) => {
|
|
86
|
-
result[item._id] = item;
|
|
87
|
-
return result;
|
|
88
|
-
}, {})
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// filter rows
|
|
93
|
-
let validRecords = table.rows;
|
|
94
|
-
const {
|
|
95
|
-
idRowMap,
|
|
96
|
-
formulaRows
|
|
97
|
-
} = tableInfoRef.current[table_id];
|
|
98
|
-
if (element.filters && Array.isArray(element.filters) && element.filters.length > 0) {
|
|
99
|
-
const {
|
|
100
|
-
filter_conjunction,
|
|
101
|
-
filters
|
|
102
|
-
} = element;
|
|
103
|
-
const {
|
|
104
|
-
username,
|
|
105
|
-
userId,
|
|
106
|
-
userDepartmentIdsMap
|
|
107
|
-
} = window.seafile || window.seafileConfig;
|
|
108
|
-
const optionalParams = {
|
|
109
|
-
formulaRows,
|
|
110
|
-
username,
|
|
111
|
-
userId,
|
|
112
|
-
userDepartmentIdsMap
|
|
113
|
-
};
|
|
114
|
-
const {
|
|
115
|
-
row_ids
|
|
116
|
-
} = (0, _dtableUtils.getFilteredRowsWithoutFormulaCalculation)(filter_conjunction, filters, validRecords, table, optionalParams);
|
|
117
|
-
validRecords = row_ids.map(rowId => {
|
|
118
|
-
const row = idRowMap[rowId];
|
|
119
|
-
return row;
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// sort rows
|
|
124
|
-
if (element.sorts && Array.isArray(element.sorts) && element.sorts.length > 0) {
|
|
75
|
+
async function initTableData() {
|
|
125
76
|
const {
|
|
126
|
-
|
|
77
|
+
table_id
|
|
127
78
|
} = element;
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const shownRecords = readOnly ? validRecords.slice(0, 200) : validRecords.slice(0, 10);
|
|
142
|
-
setIsShowTipMessage(isShowTipMessage);
|
|
143
|
-
setRecords(validRecords);
|
|
144
|
-
setShownRecords(shownRecords);
|
|
79
|
+
const table = await editor.getTableById(table_id);
|
|
80
|
+
if (!tableInfoRef.current) {
|
|
81
|
+
tableInfoRef.current = {};
|
|
82
|
+
}
|
|
83
|
+
if (!tableInfoRef.current[table_id]) {
|
|
84
|
+
tableInfoRef.current[table_id] = {
|
|
85
|
+
formulaRows: editor.getTableFormulaResults(table, table.rows),
|
|
86
|
+
idRowMap: table.rows.reduce((result, item) => {
|
|
87
|
+
result[item._id] = item;
|
|
88
|
+
return result;
|
|
89
|
+
}, {})
|
|
90
|
+
};
|
|
91
|
+
}
|
|
145
92
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (element.shown_column_keys && Array.isArray(element.shown_column_keys) && element.shown_column_keys.length > 0) {
|
|
93
|
+
// filter rows
|
|
94
|
+
let validRecords = table.rows;
|
|
149
95
|
const {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
// formatted columns
|
|
155
|
-
validColumns = validColumns.map(column => {
|
|
156
|
-
const {
|
|
157
|
-
type
|
|
158
|
-
} = column;
|
|
159
|
-
if (type === _dtableUtils.CellType.LINK) {
|
|
96
|
+
idRowMap,
|
|
97
|
+
formulaRows
|
|
98
|
+
} = tableInfoRef.current[table_id];
|
|
99
|
+
if (element.filters && Array.isArray(element.filters) && element.filters.length > 0) {
|
|
160
100
|
const {
|
|
161
|
-
|
|
162
|
-
|
|
101
|
+
filter_conjunction,
|
|
102
|
+
filters
|
|
103
|
+
} = element;
|
|
163
104
|
const {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
} =
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
105
|
+
username,
|
|
106
|
+
userId,
|
|
107
|
+
userDepartmentIdsMap
|
|
108
|
+
} = window.seafile || window.seafileConfig;
|
|
109
|
+
const optionalParams = {
|
|
110
|
+
formulaRows,
|
|
111
|
+
username,
|
|
112
|
+
userId,
|
|
113
|
+
userDepartmentIdsMap
|
|
172
114
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
115
|
+
const {
|
|
116
|
+
row_ids
|
|
117
|
+
} = (0, _dtableUtils.getFilteredRowsWithoutFormulaCalculation)(filter_conjunction, filters, validRecords, table, optionalParams);
|
|
118
|
+
validRecords = row_ids.map(rowId => {
|
|
119
|
+
const row = idRowMap[rowId];
|
|
120
|
+
return row;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// sort rows
|
|
125
|
+
if (element.sorts && Array.isArray(element.sorts) && element.sorts.length > 0) {
|
|
126
|
+
const {
|
|
127
|
+
sorts
|
|
128
|
+
} = element;
|
|
129
|
+
const value = {
|
|
130
|
+
collaborators: editor.collaborators
|
|
179
131
|
};
|
|
132
|
+
const row_ids = (0, _dtableUtils.sortTableRows)(sorts, validRecords, table.columns, {
|
|
133
|
+
formulaRows,
|
|
134
|
+
value
|
|
135
|
+
});
|
|
136
|
+
validRecords = row_ids.map(rowId => {
|
|
137
|
+
const row = idRowMap[rowId];
|
|
138
|
+
return row;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
const isShowTipMessage = readOnly ? validRecords.length > 200 : validRecords.length > 10;
|
|
142
|
+
const shownRecords = readOnly ? validRecords.slice(0, 200) : validRecords.slice(0, 10);
|
|
143
|
+
setIsShowTipMessage(isShowTipMessage);
|
|
144
|
+
setRecords(validRecords);
|
|
145
|
+
setShownRecords(shownRecords);
|
|
146
|
+
|
|
147
|
+
// filter columns
|
|
148
|
+
let validColumns = table.columns;
|
|
149
|
+
if (element.shown_column_keys && Array.isArray(element.shown_column_keys) && element.shown_column_keys.length > 0) {
|
|
150
|
+
const {
|
|
151
|
+
shown_column_keys
|
|
152
|
+
} = element;
|
|
153
|
+
validColumns = table.columns.filter(item => shown_column_keys.includes(item.key));
|
|
180
154
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
155
|
+
// formatted columns
|
|
156
|
+
validColumns = validColumns.map(column => {
|
|
157
|
+
const {
|
|
158
|
+
type
|
|
159
|
+
} = column;
|
|
160
|
+
if (type === _dtableUtils.CellType.LINK) {
|
|
161
|
+
const {
|
|
162
|
+
data
|
|
163
|
+
} = column;
|
|
164
|
+
const {
|
|
165
|
+
display_column_key,
|
|
166
|
+
array_type,
|
|
167
|
+
array_data
|
|
168
|
+
} = data;
|
|
169
|
+
const display_column = {
|
|
170
|
+
key: display_column_key || '0000',
|
|
171
|
+
type: array_type || _dtableUtils.CellType.TEXT,
|
|
172
|
+
data: array_data || null
|
|
173
|
+
};
|
|
174
|
+
return {
|
|
175
|
+
...column,
|
|
176
|
+
data: {
|
|
177
|
+
...data,
|
|
178
|
+
display_column
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return column;
|
|
183
|
+
});
|
|
184
|
+
setColumns(validColumns);
|
|
185
|
+
setIsLoading(false);
|
|
186
|
+
}
|
|
187
|
+
initTableData();
|
|
185
188
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
186
189
|
}, [element, readOnly]);
|
|
187
190
|
const handleScroll = (0, _react.useCallback)(e => {
|
package/package.json
CHANGED
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Zveřejněné",
|
|
398
398
|
"Delete_Successfully": "Delete Successfully",
|
|
399
399
|
"Delete_failed": "Smazání se nezdařilo",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "No_collaborators_available",
|
|
402
402
|
"Search_collaborator": "Search collaborator",
|
|
403
403
|
"Doc_comments": "Document comments",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Veröffentlicht",
|
|
398
398
|
"Delete_Successfully": "Delete Successfully",
|
|
399
399
|
"Delete_failed": "Löschen fehlgeschlagen",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "No_collaborators_available",
|
|
402
402
|
"Search_collaborator": "Search collaborator",
|
|
403
403
|
"Doc_comments": "Document comments",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Published",
|
|
398
398
|
"Delete_Successfully": "Delete Successfully",
|
|
399
399
|
"Delete_failed": "Delete failed",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "No_collaborators_available",
|
|
402
402
|
"Search_collaborator": "Search collaborator",
|
|
403
403
|
"Doc_comments": "Document comments",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Publicado",
|
|
398
398
|
"Delete_Successfully": "Delete Successfully",
|
|
399
399
|
"Delete_failed": "Eliminar falló",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "No_collaborators_available",
|
|
402
402
|
"Search_collaborator": "Search collaborator",
|
|
403
403
|
"Doc_comments": "Document comments",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Publicado",
|
|
398
398
|
"Delete_Successfully": "Delete Successfully",
|
|
399
399
|
"Delete_failed": "Eliminar falló",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "No_collaborators_available",
|
|
402
402
|
"Search_collaborator": "Search collaborator",
|
|
403
403
|
"Doc_comments": "Document comments",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Publicado",
|
|
398
398
|
"Delete_Successfully": "Delete Successfully",
|
|
399
399
|
"Delete_failed": "Eliminar falló",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "No_collaborators_available",
|
|
402
402
|
"Search_collaborator": "Search collaborator",
|
|
403
403
|
"Doc_comments": "Document comments",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Publié",
|
|
398
398
|
"Delete_Successfully": "Delete Successfully",
|
|
399
399
|
"Delete_failed": "Échec de la suppression",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "No_collaborators_available",
|
|
402
402
|
"Search_collaborator": "Search collaborator",
|
|
403
403
|
"Doc_comments": "Document comments",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Pubblicato",
|
|
398
398
|
"Delete_Successfully": "Delete Successfully",
|
|
399
399
|
"Delete_failed": "Rimozione fallita",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "No_collaborators_available",
|
|
402
402
|
"Search_collaborator": "Search collaborator",
|
|
403
403
|
"Doc_comments": "Document comments",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"Published": "Опубликовано",
|
|
398
398
|
"Delete_Successfully": "Удалено",
|
|
399
399
|
"Delete_failed": "Не удалось удалить",
|
|
400
|
-
"
|
|
400
|
+
"Caption": "Caption",
|
|
401
401
|
"No_collaborators_available": "Нет доступных соавторов",
|
|
402
402
|
"Search_collaborator": "Поиск соавтора",
|
|
403
403
|
"Doc_comments": "Комментарии к документу",
|
|
@@ -562,5 +562,5 @@
|
|
|
562
562
|
"the_past_year": "в прошлом году",
|
|
563
563
|
"the_next_numbers_of_days": "ближайшее количество дней",
|
|
564
564
|
"the_past_numbers_of_days": "прошедшее количество дней",
|
|
565
|
-
"Double_click_to_enter_edit_mode_and_adjust_field_width" : "
|
|
565
|
+
"Double_click_to_enter_edit_mode_and_adjust_field_width" : "Дважды щелкните, чтобы войти в режим редактирования и отрегулировать ширину поля"
|
|
566
566
|
}
|