@seafile/sdoc-editor 0.1.161 → 0.1.163

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.
@@ -7,7 +7,7 @@ export { DEFAULT_COLORS, STANDARD_COLORS, DEFAULT_RECENT_USED_LIST, DEFAULT_FONT
7
7
  export { FONT_SIZE, DEFAULT_FONT, FONT, GOOGLE_FONT_CLASS, RECENT_USED_FONTS_KEY, SDOC_FONT_SIZE } from './font';
8
8
  export { DIFF_TYPE, ADDED_STYLE, DELETED_STYLE } from './diff-view';
9
9
  export { KEYBOARD, MAC_HOTKEYS, WIN_HOTKEYS } from './keyboard';
10
- export { UNDO, REDO, TEXT_STYLE, TEXT_STYLE_MAP, TEXT_STYLE_MORE, TEXT_ALIGN, REMOVE_TABLE, CLEAR_FORMAT, MENUS_CONFIG_MAP, SIDE_MENUS_CONFIG } from './menus-config';
10
+ export { UNDO, REDO, TEXT_STYLE, TEXT_STYLE_MAP, TEXT_STYLE_MORE, TEXT_ALIGN, REMOVE_TABLE, CLEAR_FORMAT, MENUS_CONFIG_MAP, SIDE_TRANSFORM_MENUS_CONFIG, SIDE_INSERT_MENUS_CONFIG } from './menus-config';
11
11
  export var HEADERS = [HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6];
12
12
  export var HEADER_TITLE_MAP = (_HEADER_TITLE_MAP = {}, _defineProperty(_HEADER_TITLE_MAP, TITLE, 'Title'), _defineProperty(_HEADER_TITLE_MAP, SUBTITLE, 'Subtitle'), _defineProperty(_HEADER_TITLE_MAP, HEADER1, 'Header_one'), _defineProperty(_HEADER_TITLE_MAP, HEADER2, 'Header_two'), _defineProperty(_HEADER_TITLE_MAP, HEADER3, 'Header_three'), _defineProperty(_HEADER_TITLE_MAP, HEADER4, 'Header_four'), _defineProperty(_HEADER_TITLE_MAP, HEADER5, 'Header_five'), _defineProperty(_HEADER_TITLE_MAP, HEADER6, 'Header_six'), _defineProperty(_HEADER_TITLE_MAP, PARAGRAPH, 'Paragraph'), _HEADER_TITLE_MAP);
13
13
  export var TRANSPARENT = 'transparent';
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- var _MENUS_CONFIG_MAP;
2
+ var _MENUS_CONFIG_MAP, _SIDE_INSERT_MENUS_CO;
3
3
  import { RECENT_USED_HIGHLIGHT_COLORS_KEY, DEFAULT_LAST_USED_HIGHLIGHT_COLOR, RECENT_USED_FONT_COLORS_KEY, DEFAULT_FONT_COLOR, DEFAULT_LAST_USED_FONT_COLOR } from './color';
4
- import { BLOCKQUOTE, HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, ORDERED_LIST, UNORDERED_LIST, CHECK_LIST_ITEM, CODE_BLOCK, LINK, IMAGE, TABLE, SDOC_LINK, FILE_LINK, PARAGRAPH } from './element-type';
4
+ import { BLOCKQUOTE, HEADER, HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, ORDERED_LIST, UNORDERED_LIST, CHECK_LIST_ITEM, CODE_BLOCK, LINK, IMAGE, TABLE, SDOC_LINK, FILE_LINK, PARAGRAPH } from './element-type';
5
5
  export var UNDO = 'undo';
6
6
  export var REDO = 'redo';
7
7
  export var CLEAR_FORMAT = 'clear_format';
@@ -166,8 +166,8 @@ export var MENUS_CONFIG_MAP = (_MENUS_CONFIG_MAP = {}, _defineProperty(_MENUS_CO
166
166
  text: 'Link_file'
167
167
  }), _MENUS_CONFIG_MAP);
168
168
 
169
- // side menu config
170
- export var SIDE_MENUS_CONFIG = [{
169
+ // Side transform menu config
170
+ export var SIDE_TRANSFORM_MENUS_CONFIG = [{
171
171
  id: PARAGRAPH,
172
172
  iconClass: 'sdocfont sdoc-text',
173
173
  type: PARAGRAPH,
@@ -217,24 +217,72 @@ export var SIDE_MENUS_CONFIG = [{
217
217
  iconClass: 'sdocfont sdoc-check-square',
218
218
  type: CHECK_LIST_ITEM,
219
219
  text: 'Check_list_item'
220
- }, {
221
- id: ALIGN_LEFT,
222
- iconClass: 'sdocfont sdoc-align-left',
223
- type: 'left',
224
- text: 'Left'
225
- }, {
226
- id: ALIGN_CENTER,
227
- iconClass: 'sdocfont sdoc-align-center',
228
- type: 'center',
229
- text: 'Center'
230
- }, {
231
- id: ALIGN_RIGHT,
232
- iconClass: 'sdocfont sdoc-align-right',
233
- type: 'right',
234
- text: 'Right'
235
220
  }, {
236
221
  id: BLOCKQUOTE,
237
222
  iconClass: 'sdocfont sdoc-quote1',
238
223
  type: BLOCKQUOTE,
239
224
  text: 'Quote'
240
- }];
225
+ }];
226
+
227
+ // Side insert menu config
228
+ export var SIDE_INSERT_MENUS_CONFIG = (_SIDE_INSERT_MENUS_CO = {}, _defineProperty(_SIDE_INSERT_MENUS_CO, IMAGE, {
229
+ id: '',
230
+ iconClass: 'sdocfont sdoc-image',
231
+ type: IMAGE,
232
+ text: 'Insert_image'
233
+ }), _defineProperty(_SIDE_INSERT_MENUS_CO, TABLE, {
234
+ id: 'sdoc-side-menu-item-table',
235
+ iconClass: 'sdocfont sdoc-table',
236
+ type: TABLE,
237
+ text: 'Insert_table'
238
+ }), _defineProperty(_SIDE_INSERT_MENUS_CO, LINK, {
239
+ id: '',
240
+ iconClass: 'sdocfont sdoc-link',
241
+ type: LINK,
242
+ text: 'Insert_link'
243
+ }), _defineProperty(_SIDE_INSERT_MENUS_CO, CODE_BLOCK, {
244
+ id: '',
245
+ iconClass: 'sdocfont sdoc-code-block',
246
+ type: CODE_BLOCK,
247
+ text: 'Code_block'
248
+ }), _defineProperty(_SIDE_INSERT_MENUS_CO, ORDERED_LIST, {
249
+ id: '',
250
+ iconClass: 'sdocfont sdoc-list-ol',
251
+ type: ORDERED_LIST,
252
+ text: 'Ordered_list'
253
+ }), _defineProperty(_SIDE_INSERT_MENUS_CO, UNORDERED_LIST, {
254
+ id: '',
255
+ iconClass: 'sdocfont sdoc-list-ul',
256
+ type: UNORDERED_LIST,
257
+ text: 'Unordered_list'
258
+ }), _defineProperty(_SIDE_INSERT_MENUS_CO, CHECK_LIST_ITEM, {
259
+ id: '',
260
+ iconClass: 'sdocfont sdoc-check-square',
261
+ type: CHECK_LIST_ITEM,
262
+ text: 'Check_list_item'
263
+ }), _defineProperty(_SIDE_INSERT_MENUS_CO, PARAGRAPH, {
264
+ id: PARAGRAPH,
265
+ iconClass: 'sdocfont sdoc-text',
266
+ type: PARAGRAPH,
267
+ text: 'Paragraph'
268
+ }), _defineProperty(_SIDE_INSERT_MENUS_CO, HEADER, [{
269
+ id: HEADER1,
270
+ iconClass: 'sdocfont sdoc-header1',
271
+ type: HEADER1,
272
+ text: 'Header_one'
273
+ }, {
274
+ id: HEADER2,
275
+ iconClass: 'sdocfont sdoc-header2',
276
+ type: HEADER2,
277
+ text: 'Header_two'
278
+ }, {
279
+ id: HEADER3,
280
+ iconClass: 'sdocfont sdoc-header3',
281
+ type: HEADER3,
282
+ text: 'Header_three'
283
+ }, {
284
+ id: HEADER4,
285
+ iconClass: 'sdocfont sdoc-header4',
286
+ type: HEADER4,
287
+ text: 'Header_four'
288
+ }]), _SIDE_INSERT_MENUS_CO);
@@ -1,8 +1,8 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
3
3
  import { Transforms, Editor, Element } from '@seafile/slate';
4
- import { CHECK_LIST_ITEM, PARAGRAPH, ELEMENT_TYPE } from '../../constants';
5
- import { getSelectedNodeByType } from '../../core';
4
+ import { CHECK_LIST_ITEM, PARAGRAPH, ELEMENT_TYPE, INSERT_POSITION } from '../../constants';
5
+ import { getSelectedNodeByType, generateEmptyElement } from '../../core';
6
6
  export var isMenuDisabled = function isMenuDisabled(editor, readonly) {
7
7
  if (readonly) return true;
8
8
  if (editor.selection == null) return true;
@@ -43,7 +43,15 @@ export var getCheckListItemType = function getCheckListItemType(editor) {
43
43
  if (!node) return PARAGRAPH;
44
44
  return node.type;
45
45
  };
46
- export var setCheckListItemType = function setCheckListItemType(editor, newType) {
46
+ export var setCheckListItemType = function setCheckListItemType(editor, newType, insertPosition) {
47
+ if (insertPosition === INSERT_POSITION.AFTER) {
48
+ var p = generateEmptyElement(PARAGRAPH);
49
+ var path = Editor.path(editor, editor.selection);
50
+ Transforms.insertNodes(editor, p, {
51
+ at: [path[0] + 1]
52
+ });
53
+ Transforms.select(editor, [path[0] + 1]);
54
+ }
47
55
  Transforms.setNodes(editor, {
48
56
  type: newType
49
57
  });
@@ -1,8 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import { Node, Range, Transforms, Element, Editor } from '@seafile/slate';
4
- import { LIST_ITEM, LIST_LIC, PARAGRAPH } from '../../../constants';
5
- import { findNode, getNodeEntries, getNodeType, getSelectedNodeEntryByType, isRangeAcrossBlocks } from '../../../core';
4
+ import { LIST_ITEM, LIST_LIC, PARAGRAPH, INSERT_POSITION } from '../../../constants';
5
+ import { findNode, getNodeEntries, getNodeType, getSelectedNodeEntryByType, isRangeAcrossBlocks, generateEmptyElement } from '../../../core';
6
6
  import { getListItemEntry, getListTypes } from '../queries';
7
7
  import { unwrapList } from './unwrap-list';
8
8
  import { generateEmptyList, generateEmptyListItem } from '../model';
@@ -110,7 +110,18 @@ var wrapRangeList = function wrapRangeList(editor, type) {
110
110
  });
111
111
  });
112
112
  };
113
- var toggleList = function toggleList(editor, type) {
113
+ var toggleList = function toggleList(editor, type, insertPosition) {
114
+ if (insertPosition === INSERT_POSITION.AFTER) {
115
+ var list = generateEmptyList(type);
116
+ var p = generateEmptyElement(PARAGRAPH);
117
+ var path = Editor.path(editor, editor.selection);
118
+ Transforms.insertNodes(editor, p, {
119
+ at: [path[0] + 1]
120
+ });
121
+ Transforms.select(editor, [path[0] + 1]);
122
+ Transforms.wrapNodes(editor, list);
123
+ return;
124
+ }
114
125
  Editor.withoutNormalizing(editor, function () {
115
126
  var selection = editor.selection;
116
127
  if (!selection) return false;
@@ -120,9 +131,9 @@ var toggleList = function toggleList(editor, type) {
120
131
  if (Range.isCollapsed(selection) || !isRangeAcrossBlocks(editor)) {
121
132
  var res = getListItemEntry(editor);
122
133
  if (res) {
123
- var list = res.list;
134
+ var _list = res.list;
124
135
  // 选中内容的类型是另一个类型, 如: select_type: ordered_list, 将被切换为 unordered_list
125
- if (list[0].type !== type) {
136
+ if (_list[0].type !== type) {
126
137
  var match = function match(n) {
127
138
  return getListTypes().includes(getNodeType(n));
128
139
  };
@@ -3,7 +3,8 @@ import slugid from 'slugid';
3
3
  import { ReactEditor } from '@seafile/slate-react';
4
4
  import copy from 'copy-to-clipboard';
5
5
  import { toggleList } from '../../plugins/list/transforms';
6
- import { ORDERED_LIST, UNORDERED_LIST, PARAGRAPH, CHECK_LIST_ITEM, IMAGE, TABLE, CODE_BLOCK, LIST_ITEM, BLOCKQUOTE, LIST_ITEM_CORRELATION_TYPE, ADD_POSITION_OFFSET_TYPE } from '../../constants';
6
+ import { generateEmptyElement } from '../../core';
7
+ import { ORDERED_LIST, UNORDERED_LIST, PARAGRAPH, CHECK_LIST_ITEM, IMAGE, TABLE, CODE_BLOCK, BLOCKQUOTE, LIST_ITEM_CORRELATION_TYPE, ADD_POSITION_OFFSET_TYPE, INSERT_POSITION } from '../../constants';
7
8
  export var onSetNodeType = function onSetNodeType(editor, element, type) {
8
9
  if (!type) return;
9
10
  if ([ORDERED_LIST, UNORDERED_LIST].includes(type)) {
@@ -17,12 +18,6 @@ export var onSetNodeType = function onSetNodeType(editor, element, type) {
17
18
  });
18
19
  return;
19
20
  }
20
- if (['left', 'center', 'right'].includes(type)) {
21
- Transforms.setNodes(editor, {
22
- 'align': type
23
- });
24
- return;
25
- }
26
21
  if (type === BLOCKQUOTE && LIST_ITEM_CORRELATION_TYPE.includes(element.type)) {
27
22
  Transforms.wrapNodes(editor, {
28
23
  id: slugid.nice(),
@@ -88,4 +83,19 @@ export var isNotSupportTransform = function isNotSupportTransform(node) {
88
83
  return true;
89
84
  }
90
85
  return false;
86
+ };
87
+ export var insertElement = function insertElement(editor, type, insertPosition) {
88
+ if (insertPosition === INSERT_POSITION.AFTER) {
89
+ var p = generateEmptyElement(PARAGRAPH);
90
+ var path = Editor.path(editor, editor.selection);
91
+ Transforms.insertNodes(editor, p, {
92
+ at: [path[0] + 1]
93
+ });
94
+ Transforms.select(editor, [path[0] + 1]);
95
+ }
96
+ if (type !== PARAGRAPH) {
97
+ Transforms.setNodes(editor, {
98
+ type: type
99
+ });
100
+ }
91
101
  };
@@ -1,11 +1,15 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
1
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import React, { useCallback } from 'react';
3
4
  import { useSlateStatic } from '@seafile/slate-react';
4
5
  import { Transforms } from '@seafile/slate';
6
+ import { insertElement } from './helpers';
5
7
  import { insertTable } from '../../plugins/table/helpers';
6
8
  import TableSizePopover from '../../plugins/table/popover/table-size-popover';
7
9
  import { changeToCodeBlock } from '../../plugins/code-block/helpers';
8
- import { ELEMENT_TYPE, INSERT_POSITION, LOCAL_IMAGE, MENUS_CONFIG_MAP, LIST_ITEM } from '../../constants';
10
+ import { toggleList } from '../../plugins/list/transforms';
11
+ import { setCheckListItemType } from '../../plugins/check-list/helpers';
12
+ import { ELEMENT_TYPE, INSERT_POSITION, LOCAL_IMAGE, SIDE_INSERT_MENUS_CONFIG } from '../../constants';
9
13
  import EventBus from '../../../utils/event-bus';
10
14
  import { INTERNAL_EVENT } from '../../../constants';
11
15
  import DropdownMenuItem from '../../commons/dropdown-menu-item';
@@ -27,7 +31,7 @@ var InsertBlockMenu = function InsertBlockMenu(_ref) {
27
31
  // eslint-disable-next-line react-hooks/exhaustive-deps
28
32
  }, [editor, insertPosition]);
29
33
  var createTable = useCallback(function (size) {
30
- var newInsertPosition = slateNode.type === LIST_ITEM ? INSERT_POSITION.AFTER : insertPosition;
34
+ var newInsertPosition = slateNode.type === ELEMENT_TYPE.LIST_ITEM ? INSERT_POSITION.AFTER : insertPosition;
31
35
  insertTable(editor, size, editor.selection, newInsertPosition);
32
36
 
33
37
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -43,7 +47,7 @@ var InsertBlockMenu = function InsertBlockMenu(_ref) {
43
47
  // eslint-disable-next-line react-hooks/exhaustive-deps
44
48
  }, [insertPosition]);
45
49
  var onInsertCodeBlock = useCallback(function () {
46
- var newInsertPosition = slateNode.type === LIST_ITEM ? INSERT_POSITION.AFTER : insertPosition;
50
+ var newInsertPosition = slateNode.type === ELEMENT_TYPE.LIST_ITEM ? INSERT_POSITION.AFTER : insertPosition;
47
51
  changeToCodeBlock(editor, 'plaintext', newInsertPosition);
48
52
 
49
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -57,15 +61,23 @@ var InsertBlockMenu = function InsertBlockMenu(_ref) {
57
61
 
58
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
59
63
  }, [insertPosition]);
64
+ var onInsertList = useCallback(function (type) {
65
+ toggleList(editor, type, insertPosition);
66
+ // eslint-disable-next-line react-hooks/exhaustive-deps
67
+ }, [editor, insertPosition, slateNode]);
68
+ var onInsertCheckList = useCallback(function () {
69
+ setCheckListItemType(editor, ELEMENT_TYPE.CHECK_LIST_ITEM, insertPosition);
70
+ // eslint-disable-next-line react-hooks/exhaustive-deps
71
+ }, [editor, insertPosition, slateNode]);
72
+ var onInsert = useCallback(function (type) {
73
+ insertElement(editor, type, insertPosition);
74
+ // eslint-disable-next-line react-hooks/exhaustive-deps
75
+ }, [editor, insertPosition, slateNode]);
60
76
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DropdownMenuItem, {
61
- menuConfig: _objectSpread(_objectSpread({}, MENUS_CONFIG_MAP[ELEMENT_TYPE.IMAGE]), {}, {
62
- id: ''
63
- }),
77
+ menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.IMAGE]),
64
78
  onClick: onInsertImageToggle
65
79
  }), /*#__PURE__*/React.createElement(DropdownMenuItem, {
66
- menuConfig: _objectSpread(_objectSpread({}, MENUS_CONFIG_MAP[ELEMENT_TYPE.TABLE]), {}, {
67
- id: 'sdoc-side-menu-item-table'
68
- }),
80
+ menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.TABLE]),
69
81
  className: "pr-2"
70
82
  }, /*#__PURE__*/React.createElement("i", {
71
83
  className: "sdocfont sdoc-right-slide sdoc-dropdown-item-right-icon"
@@ -77,15 +89,32 @@ var InsertBlockMenu = function InsertBlockMenu(_ref) {
77
89
  createTable: createTable,
78
90
  openDialog: openTableDialog
79
91
  })), /*#__PURE__*/React.createElement(DropdownMenuItem, {
80
- menuConfig: _objectSpread(_objectSpread({}, MENUS_CONFIG_MAP[ELEMENT_TYPE.LINK]), {}, {
81
- id: ''
82
- }),
92
+ menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.LINK]),
83
93
  onClick: openLinkDialog
84
94
  }), /*#__PURE__*/React.createElement(DropdownMenuItem, {
85
- menuConfig: _objectSpread(_objectSpread({}, MENUS_CONFIG_MAP[ELEMENT_TYPE.CODE_BLOCK]), {}, {
86
- id: ''
87
- }),
95
+ menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.CODE_BLOCK]),
88
96
  onClick: onInsertCodeBlock
97
+ }), /*#__PURE__*/React.createElement(DropdownMenuItem, {
98
+ menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.UNORDERED_LIST]),
99
+ onClick: function onClick() {
100
+ onInsertList(ELEMENT_TYPE.UNORDERED_LIST);
101
+ }
102
+ }), /*#__PURE__*/React.createElement(DropdownMenuItem, {
103
+ menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.ORDERED_LIST]),
104
+ onClick: function onClick() {
105
+ onInsertList(ELEMENT_TYPE.ORDERED_LIST);
106
+ }
107
+ }), /*#__PURE__*/React.createElement(DropdownMenuItem, {
108
+ menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.CHECK_LIST_ITEM]),
109
+ onClick: onInsertCheckList
110
+ }), [SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.PARAGRAPH]].concat(_toConsumableArray(SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.HEADER])).map(function (item) {
111
+ return /*#__PURE__*/React.createElement(DropdownMenuItem, {
112
+ key: item.id,
113
+ menuConfig: item,
114
+ onClick: function onClick() {
115
+ return onInsert(item.type);
116
+ }
117
+ });
89
118
  }));
90
119
  };
91
120
  InsertBlockMenu.defaultProps = {
@@ -58,7 +58,7 @@ var SideMenu = function SideMenu(_ref) {
58
58
  }, /*#__PURE__*/React.createElement("div", {
59
59
  className: "sdoc-side-menu sdoc-dropdown-menu",
60
60
  ref: sideMenuRef
61
- }, /*#__PURE__*/React.createElement(React.Fragment, null, !isNotSupportTransform(slateNode) && /*#__PURE__*/React.createElement(DropdownMenuItem, {
61
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, !isNodeEmpty && !isNotSupportTransform(slateNode) && /*#__PURE__*/React.createElement(DropdownMenuItem, {
62
62
  menuConfig: {
63
63
  id: 'sdoc-side-menu-item-transform',
64
64
  text: 'Transform_to',
@@ -3,7 +3,7 @@ import { UncontrolledPopover } from 'reactstrap';
3
3
  import { withTranslation } from 'react-i18next';
4
4
  import { useSlateStatic } from '@seafile/slate-react';
5
5
  import { onSetNodeType } from './helpers';
6
- import { SIDE_MENUS_CONFIG, LIST_ITEM_SUPPORTED_TRANSFORMATION, LIST_ITEM_CORRELATION_TYPE } from '../../constants';
6
+ import { SIDE_TRANSFORM_MENUS_CONFIG, LIST_ITEM_SUPPORTED_TRANSFORMATION, LIST_ITEM_CORRELATION_TYPE } from '../../constants';
7
7
  import DropdownMenuItem from '../../commons/dropdown-menu-item';
8
8
  var TransformMenus = function TransformMenus(_ref) {
9
9
  var target = _ref.target,
@@ -16,10 +16,10 @@ var TransformMenus = function TransformMenus(_ref) {
16
16
  onReset();
17
17
  // eslint-disable-next-line react-hooks/exhaustive-deps
18
18
  }, []);
19
- var getSideMenusConfig = useCallback(function (SIDE_MENUS_CONFIG) {
20
- var newSideMenusConfig = SIDE_MENUS_CONFIG;
19
+ var getSideMenusConfig = useCallback(function (SIDE_TRANSFORM_MENUS_CONFIG) {
20
+ var newSideMenusConfig = SIDE_TRANSFORM_MENUS_CONFIG;
21
21
  if (LIST_ITEM_CORRELATION_TYPE.includes(slateNode.type)) {
22
- newSideMenusConfig = SIDE_MENUS_CONFIG.filter(function (item) {
22
+ newSideMenusConfig = SIDE_TRANSFORM_MENUS_CONFIG.filter(function (item) {
23
23
  return LIST_ITEM_SUPPORTED_TRANSFORMATION.includes(item.type);
24
24
  });
25
25
  }
@@ -36,7 +36,7 @@ var TransformMenus = function TransformMenus(_ref) {
36
36
  fade: false
37
37
  }, /*#__PURE__*/React.createElement("div", {
38
38
  className: "sdoc-dropdown-menu-container"
39
- }, getSideMenusConfig(SIDE_MENUS_CONFIG).map(function (item) {
39
+ }, getSideMenusConfig(SIDE_TRANSFORM_MENUS_CONFIG).map(function (item) {
40
40
  return /*#__PURE__*/React.createElement(DropdownMenuItem, {
41
41
  key: item.id,
42
42
  menuConfig: item,
@@ -4,6 +4,7 @@ import { withTranslation } from 'react-i18next';
4
4
  import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
5
5
  import context from '../../../../context';
6
6
  import toaster from '../../../toast';
7
+ import { REVISION_FIRST_LOAD_KEY, REVISION_FIRST_LOAD_VALUE } from '../../../../constants';
7
8
  import './index.css';
8
9
  var MoreRevisionOperations = function MoreRevisionOperations(_ref) {
9
10
  var t = _ref.t;
@@ -18,7 +19,7 @@ var MoreRevisionOperations = function MoreRevisionOperations(_ref) {
18
19
  }, []);
19
20
  var startRevise = useCallback(function () {
20
21
  context.startRevise().then(function (res) {
21
- window.location.href = "".concat(siteRoot, "lib/").concat(repoID, "/revisions/").concat(res.data.revision_id, "/");
22
+ window.location.href = "".concat(siteRoot, "lib/").concat(repoID, "/revisions/").concat(res.data.revision_id, "/?").concat(REVISION_FIRST_LOAD_KEY, "=").concat(REVISION_FIRST_LOAD_VALUE);
22
23
  }).catch(function (error) {
23
24
  toaster.danger(t('Error'));
24
25
  });
@@ -0,0 +1,4 @@
1
+ .sdoc-tip-dialog .highlight-bg-color {
2
+ background-color: #FF8000;
3
+ border-color: #FF8000;
4
+ }
@@ -1,10 +1,13 @@
1
- import React, { useCallback } from 'react';
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useCallback, useState } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
4
  import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';
4
5
  import classnames from 'classnames';
5
6
  import { TIP_TYPE, TIP_TITLE } from '../../constants';
6
7
  import TipContent from './tip-content';
7
- var NOT_CLOSE_DIALOG_TIP_TYPE = [TIP_TYPE.HAS_BEEN_REPLACED, TIP_TYPE.HAS_BEEN_PUBLISHED];
8
+ import CommonLoading from '../common-loading';
9
+ import './index.css';
10
+ var NOT_CLOSE_DIALOG_TIP_TYPE = [TIP_TYPE.HAS_BEEN_REPLACED, TIP_TYPE.HAS_BEEN_PUBLISHED, TIP_TYPE.CHECKING, TIP_TYPE.PUBLISHING];
8
11
  var TipDialog = function TipDialog(_ref) {
9
12
  var className = _ref.className,
10
13
  tipType = _ref.tipType,
@@ -12,17 +15,24 @@ var TipDialog = function TipDialog(_ref) {
12
15
  submit = _ref.submit;
13
16
  var _useTranslation = useTranslation(),
14
17
  t = _useTranslation.t;
18
+ var _useState = useState(false),
19
+ _useState2 = _slicedToArray(_useState, 2),
20
+ isSubmitting = _useState2[0],
21
+ setSubmitting = _useState2[1];
15
22
  var closeDialog = useCallback(function () {
16
23
  if (NOT_CLOSE_DIALOG_TIP_TYPE.includes(tipType)) return;
24
+ if (isSubmitting) return;
17
25
  toggle && toggle();
18
26
 
19
27
  // eslint-disable-next-line react-hooks/exhaustive-deps
20
- }, [tipType]);
28
+ }, [tipType, isSubmitting]);
21
29
  var confirmTip = useCallback(function () {
22
- submit && submit();
30
+ submit && submit(function (submitting) {
31
+ setSubmitting(submitting);
32
+ });
23
33
 
24
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
25
- }, []);
35
+ }, [tipType]);
26
36
  return /*#__PURE__*/React.createElement(Modal, {
27
37
  isOpen: true,
28
38
  autoFocus: false,
@@ -43,8 +53,13 @@ var TipDialog = function TipDialog(_ref) {
43
53
  onClick: closeDialog
44
54
  }, t('Cancel')), /*#__PURE__*/React.createElement(Button, {
45
55
  color: "primary",
46
- className: "highlight-bg-color",
47
- onClick: confirmTip
48
- }, t('Confirm'))));
56
+ className: classnames('highlight-bg-color', {
57
+ 'd-flex align-items-center': isSubmitting
58
+ }),
59
+ onClick: confirmTip,
60
+ disabled: isSubmitting
61
+ }, isSubmitting && /*#__PURE__*/React.createElement("span", {
62
+ className: "submit-loading-container mr-2"
63
+ }, /*#__PURE__*/React.createElement(CommonLoading, null)), t('Confirm'))));
49
64
  };
50
65
  export default TipDialog;
@@ -1,5 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  var _TIP_TITLE, _TIP_CONTENT;
3
+ export var REVISION_FIRST_LOAD_KEY = 'first-load';
4
+ export var REVISION_FIRST_LOAD_VALUE = '1';
3
5
  export var EXTERNAL_EVENT = {
4
6
  INTERNAL_LINK_CLICK: 'internal_link_click',
5
7
  TOGGLE_STAR: 'toggle_star',
@@ -24,7 +26,9 @@ export var TIP_TYPE = {
24
26
  HAS_BEEN_PUBLISHED: 'has_been_published',
25
27
  HAS_BEEN_REPLACED: 'has_been_merge',
26
28
  HAS_CONFLICT_BEFORE_VIEW_CHANGES: 'has_conflict_before_view_changes',
27
- HAS_BEEN_REMOVED: 'has_been_removed'
29
+ HAS_BEEN_REMOVED: 'has_been_removed',
30
+ CHECKING: 'checking',
31
+ PUBLISHING: 'publishing'
28
32
  };
29
- export var TIP_TITLE = (_TIP_TITLE = {}, _defineProperty(_TIP_TITLE, TIP_TYPE.DELETE_NO_CHANGES_REVISION, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.MERGE, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_CONFLICT_BEFORE_PUBLISH, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_BEEN_PUBLISHED, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_BEEN_REPLACED, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_CONFLICT_BEFORE_VIEW_CHANGES, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_BEEN_REMOVED, 'Tip'), _TIP_TITLE);
30
- export var TIP_CONTENT = (_TIP_CONTENT = {}, _defineProperty(_TIP_CONTENT, TIP_TYPE.DELETE_NO_CHANGES_REVISION, 'Rebase_delete_no_change_revision_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.MERGE, 'Merge_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_CONFLICT_BEFORE_PUBLISH, 'Has_conflict_before_publish_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_BEEN_PUBLISHED, 'Has_been_published_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_BEEN_REPLACED, 'Has_been_replaced_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_CONFLICT_BEFORE_VIEW_CHANGES, 'Has_conflict_before_view_changes_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_BEEN_REMOVED, 'Has_been_removed_tip'), _TIP_CONTENT);
33
+ export var TIP_TITLE = (_TIP_TITLE = {}, _defineProperty(_TIP_TITLE, TIP_TYPE.DELETE_NO_CHANGES_REVISION, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.MERGE, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_CONFLICT_BEFORE_PUBLISH, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_BEEN_PUBLISHED, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_BEEN_REPLACED, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_CONFLICT_BEFORE_VIEW_CHANGES, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.HAS_BEEN_REMOVED, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.CHECKING, 'Tip'), _defineProperty(_TIP_TITLE, TIP_TYPE.PUBLISHING, 'Tip'), _TIP_TITLE);
34
+ export var TIP_CONTENT = (_TIP_CONTENT = {}, _defineProperty(_TIP_CONTENT, TIP_TYPE.DELETE_NO_CHANGES_REVISION, 'Rebase_delete_no_change_revision_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.MERGE, 'Merge_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_CONFLICT_BEFORE_PUBLISH, 'Has_conflict_before_publish_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_BEEN_PUBLISHED, 'Has_been_published_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_BEEN_REPLACED, 'Has_been_replaced_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_CONFLICT_BEFORE_VIEW_CHANGES, 'Has_conflict_before_view_changes_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.HAS_BEEN_REMOVED, 'Has_been_removed_tip'), _defineProperty(_TIP_CONTENT, TIP_TYPE.CHECKING, 'Checking'), _defineProperty(_TIP_CONTENT, TIP_TYPE.PUBLISHING, 'Publishing'), _TIP_CONTENT);
@@ -11,7 +11,7 @@ import { generateDefaultDocContent } from '../utils';
11
11
  import context from '../context';
12
12
  import ErrorBoundary from './error-boundary';
13
13
  import TipDialog from '../components/tip-dialog';
14
- import { EXTERNAL_EVENT, MODE, TIP_TYPE } from '../constants';
14
+ import { EXTERNAL_EVENT, MODE, TIP_TYPE, REVISION_FIRST_LOAD_KEY, REVISION_FIRST_LOAD_VALUE } from '../constants';
15
15
  import { getRebase, hasConflict } from '../basic-sdk/utils/rebase';
16
16
  import toaster from '../components/toast';
17
17
  import { EventBus, SDocEditor } from '../basic-sdk';
@@ -79,6 +79,18 @@ var SimpleEditor = function SimpleEditor(_ref) {
79
79
  var originFilename = context.getSetting('originFilename');
80
80
  if (isSdocRevision) {
81
81
  window.document.getElementsByTagName('title')[0].innerText = "".concat(t('Revision'), " - ").concat(originFilename);
82
+
83
+ // show revision created success info
84
+ var url = new URL(window.location.href);
85
+ var searchParams = new URLSearchParams(url.search);
86
+ if (!searchParams.has(REVISION_FIRST_LOAD_KEY)) return;
87
+ var firstLoadValue = searchParams.get(REVISION_FIRST_LOAD_KEY);
88
+ if (firstLoadValue === REVISION_FIRST_LOAD_VALUE) {
89
+ var revisionId = context.getSetting('revisionId');
90
+ toaster.success(t('Revision_created', {
91
+ id: revisionId
92
+ }));
93
+ }
82
94
  }
83
95
 
84
96
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -195,6 +207,8 @@ var SimpleEditor = function SimpleEditor(_ref) {
195
207
  return _regeneratorRuntime().wrap(function _callee$(_context) {
196
208
  while (1) switch (_context.prev = _context.next) {
197
209
  case 0:
210
+ setTipType(TIP_TYPE.CHECKING);
211
+ setShowTip(true);
198
212
  loadDocument(function (document) {
199
213
  var revisionContent = document;
200
214
  if (hasConflict(revisionContent.children)) {
@@ -216,6 +230,7 @@ var SimpleEditor = function SimpleEditor(_ref) {
216
230
  isNeedReplaceMaster = _getRebase.isNeedReplaceMaster,
217
231
  value = _getRebase.value;
218
232
  if (canMerge && isNeedReplaceMaster) {
233
+ setTipType(TIP_TYPE.PUBLISHING);
219
234
  context.publishRevision().then(function (res) {
220
235
  setTipType(TIP_TYPE.HAS_BEEN_PUBLISHED);
221
236
  setShowTip(true);
@@ -240,7 +255,7 @@ var SimpleEditor = function SimpleEditor(_ref) {
240
255
  });
241
256
 
242
257
  // eslint-disable-next-line react-hooks/exhaustive-deps
243
- case 1:
258
+ case 3:
244
259
  case "end":
245
260
  return _context.stop();
246
261
  }
@@ -259,18 +274,22 @@ var SimpleEditor = function SimpleEditor(_ref) {
259
274
 
260
275
  // eslint-disable-next-line react-hooks/exhaustive-deps
261
276
  }, [tipType]);
262
- var tipSubmit = useCallback(function () {
277
+ var tipSubmit = useCallback(function (callback) {
263
278
  if (tipType === TIP_TYPE.DELETE_NO_CHANGES_REVISION) {
279
+ callback && callback(true);
264
280
  context.deleteSdocRevision().then(function (res) {
281
+ callback && callback(false);
265
282
  setShowTip(false);
266
283
  var originFileURL = context.getSetting('originFileURL');
267
284
  jumpToURL(originFileURL);
268
285
  }).catch(function (error) {
286
+ callback && callback(false);
269
287
  toaster.danger(t('Error'));
270
288
  });
271
289
  return;
272
290
  }
273
291
  if (tipType === TIP_TYPE.MERGE) {
292
+ callback && callback(true);
274
293
  var _context$getUserInfo = context.getUserInfo(),
275
294
  username = _context$getUserInfo.username;
276
295
  var doc = {
@@ -281,6 +300,7 @@ var SimpleEditor = function SimpleEditor(_ref) {
281
300
  last_modify_user: username
282
301
  };
283
302
  context.updateSdocRevision(doc).then(function (res) {
303
+ callback && callback(false);
284
304
  var origin_file_version = res.data.origin_file_version;
285
305
  context.updateSettings({
286
306
  'originFileVersion': origin_file_version
@@ -293,6 +313,7 @@ var SimpleEditor = function SimpleEditor(_ref) {
293
313
  editorRef.current.setLoading(false);
294
314
  setShowTip(false);
295
315
  }).catch(function (error) {
316
+ callback && callback(false);
296
317
  toaster.danger(t('Error'));
297
318
  });
298
319
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.1.161",
3
+ "version": "0.1.163",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",
@@ -347,6 +347,7 @@
347
347
  "Icon_and_text_Link": "Icon and text Link",
348
348
  "Card": "Card",
349
349
  "Select_sdoc_document": "Select sdoc document",
350
+ "Select_file": "Select file",
350
351
  "Local_file": "Local file",
351
352
  "Internal_server_exec_operations_error": "An exception occurred on the server, please refresh the page and try again",
352
353
  "Failed_to_sync_with_server_operations": "Synchronization with the server failed, please refresh the page",
@@ -362,5 +363,20 @@
362
363
  "No_changes": "No changes",
363
364
  "Title": "Název",
364
365
  "Subtitle": "Subtitle",
365
- "Link_sdoc": "Link sdoc"
366
+ "Link_sdoc": "Link sdoc",
367
+ "Link_file": "Link file",
368
+ "Keep_my_modification": "Keep my modification",
369
+ "Keep_other_modification": "Keep other's modification",
370
+ "Keep_both_modification": "Keep my modification",
371
+ "Tip": "Tip",
372
+ "Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
373
+ "Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
374
+ "Has_been_published_tip": "Revision has been published, Automatically jump to source content after {{ time }} seconds.",
375
+ "Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
376
+ "Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
377
+ "Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
378
+ "Has_been_removed_tip": "Document has been removed, please view other documents.",
379
+ "Revision_created": "Revision {{id}} created",
380
+ "Checking": "Checking...",
381
+ "Publishing": "Publishing..."
366
382
  }
@@ -347,6 +347,7 @@
347
347
  "Icon_and_text_Link": "Icon and text Link",
348
348
  "Card": "Card",
349
349
  "Select_sdoc_document": "Select sdoc document",
350
+ "Select_file": "Select file",
350
351
  "Local_file": "Local file",
351
352
  "Internal_server_exec_operations_error": "An exception occurred on the server, please refresh the page and try again",
352
353
  "Failed_to_sync_with_server_operations": "Synchronization with the server failed, please refresh the page",
@@ -362,5 +363,20 @@
362
363
  "No_changes": "No changes",
363
364
  "Title": "Titel",
364
365
  "Subtitle": "Subtitle",
365
- "Link_sdoc": "Link sdoc"
366
+ "Link_sdoc": "Link sdoc",
367
+ "Link_file": "Link file",
368
+ "Keep_my_modification": "Keep my modification",
369
+ "Keep_other_modification": "Keep other's modification",
370
+ "Keep_both_modification": "Keep my modification",
371
+ "Tip": "Tip",
372
+ "Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
373
+ "Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
374
+ "Has_been_published_tip": "Revision has been published, Automatically jump to source content after {{ time }} seconds.",
375
+ "Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
376
+ "Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
377
+ "Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
378
+ "Has_been_removed_tip": "Document has been removed, please view other documents.",
379
+ "Revision_created": "Revision {{id}} created",
380
+ "Checking": "Checking...",
381
+ "Publishing": "Publishing..."
366
382
  }
@@ -375,5 +375,8 @@
375
375
  "Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
376
376
  "Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
377
377
  "Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
378
- "Has_been_removed_tip": "Document has been removed, please view other documents."
378
+ "Has_been_removed_tip": "Document has been removed, please view other documents.",
379
+ "Revision_created": "Revision {{id}} created",
380
+ "Checking": "Checking...",
381
+ "Publishing": "Publishing..."
379
382
  }
@@ -347,6 +347,7 @@
347
347
  "Icon_and_text_Link": "Icon and text Link",
348
348
  "Card": "Card",
349
349
  "Select_sdoc_document": "Select sdoc document",
350
+ "Select_file": "Select file",
350
351
  "Local_file": "Local file",
351
352
  "Internal_server_exec_operations_error": "An exception occurred on the server, please refresh the page and try again",
352
353
  "Failed_to_sync_with_server_operations": "Synchronization with the server failed, please refresh the page",
@@ -362,5 +363,20 @@
362
363
  "No_changes": "No changes",
363
364
  "Title": "Título",
364
365
  "Subtitle": "Subtitle",
365
- "Link_sdoc": "Link sdoc"
366
+ "Link_sdoc": "Link sdoc",
367
+ "Link_file": "Link file",
368
+ "Keep_my_modification": "Keep my modification",
369
+ "Keep_other_modification": "Keep other's modification",
370
+ "Keep_both_modification": "Keep my modification",
371
+ "Tip": "Tip",
372
+ "Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
373
+ "Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
374
+ "Has_been_published_tip": "Revision has been published, Automatically jump to source content after {{ time }} seconds.",
375
+ "Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
376
+ "Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
377
+ "Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
378
+ "Has_been_removed_tip": "Document has been removed, please view other documents.",
379
+ "Revision_created": "Revision {{id}} created",
380
+ "Checking": "Checking...",
381
+ "Publishing": "Publishing..."
366
382
  }
@@ -364,5 +364,19 @@
364
364
  "Title": "Titre",
365
365
  "Subtitle": "Sous-titre",
366
366
  "Link_sdoc": "Lien sdoc",
367
- "Link_file": "Link file"
367
+ "Link_file": "Link file",
368
+ "Keep_my_modification": "Keep my modification",
369
+ "Keep_other_modification": "Keep other's modification",
370
+ "Keep_both_modification": "Keep my modification",
371
+ "Tip": "Tip",
372
+ "Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
373
+ "Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
374
+ "Has_been_published_tip": "Revision has been published, Automatically jump to source content after {{ time }} seconds.",
375
+ "Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
376
+ "Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
377
+ "Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
378
+ "Has_been_removed_tip": "Document has been removed, please view other documents.",
379
+ "Revision_created": "Revision {{id}} created",
380
+ "Checking": "Checking...",
381
+ "Publishing": "Publishing..."
368
382
  }
@@ -343,11 +343,11 @@
343
343
  "Default_font": "Default font",
344
344
  "Pending_operations_exceed_limit": "There are multiple operations not synced to the server. Please check your network.",
345
345
  "Recently_saved": "Recently saved",
346
- "Sdoc_document" : "Sdoc document",
347
346
  "Text_Link": "Text Link",
348
347
  "Icon_and_text_Link": "Icon and text Link",
349
348
  "Card": "Card",
350
349
  "Select_sdoc_document": "Select sdoc document",
350
+ "Select_file": "Select file",
351
351
  "Local_file": "Local file",
352
352
  "Internal_server_exec_operations_error": "An exception occurred on the server, please refresh the page and try again",
353
353
  "Failed_to_sync_with_server_operations": "Synchronization with the server failed, please refresh the page",
@@ -362,5 +362,21 @@
362
362
  "Changes": "Modifiche",
363
363
  "No_changes": "No changes",
364
364
  "Title": "Titolo",
365
- "SubTitle": "Subtitle"
365
+ "Subtitle": "Subtitle",
366
+ "Link_sdoc": "Link sdoc",
367
+ "Link_file": "Link file",
368
+ "Keep_my_modification": "Keep my modification",
369
+ "Keep_other_modification": "Keep other's modification",
370
+ "Keep_both_modification": "Keep my modification",
371
+ "Tip": "Tip",
372
+ "Rebase_delete_no_change_revision_tip": "Revision has not made any change compared to original document. Do you want to delete this revision?",
373
+ "Has_been_replaced_tip": "Document content has been replaced. Please refresh the page.",
374
+ "Has_been_published_tip": "Revision has been published, Automatically jump to source content after {{ time }} seconds.",
375
+ "Has_conflict_before_publish_tip": "There are conflicts in the document, please resolve it before publishing!",
376
+ "Merge_tip": "There are conflicts in the documents. Do you want to merge them?",
377
+ "Has_conflict_before_view_changes_tip": "There are conflicts in the document. Please resolve the conflict before viewing the changes!",
378
+ "Has_been_removed_tip": "Document has been removed, please view other documents.",
379
+ "Revision_created": "Revision {{id}} created",
380
+ "Checking": "Checking...",
381
+ "Publishing": "Publishing..."
366
382
  }
@@ -347,7 +347,7 @@
347
347
  "Icon_and_text_Link": "Значок и текстовая ссылка",
348
348
  "Card": "Карта",
349
349
  "Select_sdoc_document": "Выбрать документ sdoc",
350
- "Select_file": "Select file",
350
+ "Select_file": "Выбрать файл",
351
351
  "Local_file": "Заблокировать файл",
352
352
  "Internal_server_exec_operations_error": "На сервере произошло исключение. Обновите страницу и повторите попытку",
353
353
  "Failed_to_sync_with_server_operations": "Не удалось синхронизироваться с сервером, обновите страницу.",
@@ -364,5 +364,19 @@
364
364
  "Title": "Название",
365
365
  "Subtitle": "Подзаголовок",
366
366
  "Link_sdoc": "Ссылка на sdoc",
367
- "Link_file": "Link file"
367
+ "Link_file": "Ссылка на файл",
368
+ "Keep_my_modification": "Сохранить мою модификацию",
369
+ "Keep_other_modification": "Сохранить чужую модификацию",
370
+ "Keep_both_modification": "Сохранить мою модификацию",
371
+ "Tip": "Совет",
372
+ "Rebase_delete_no_change_revision_tip": "Редакция не внесла никаких изменений по сравнению с исходным документом. Вы хотите удалить эту редакцию?",
373
+ "Has_been_replaced_tip": "Содержимое документа было заменено. Обновите страницу.",
374
+ "Has_been_published_tip": "Версия опубликована. Автоматический переход к исходному контенту через {{ time }} секунд.",
375
+ "Has_conflict_before_publish_tip": "В документе есть конфликты, разрешите их перед публикацией!",
376
+ "Merge_tip": "В документах есть конфликты. Вы хотите объединить их?",
377
+ "Has_conflict_before_view_changes_tip": "В документе есть конфликты. Разрешите конфликт перед просмотром изменений!",
378
+ "Has_been_removed_tip": "Документ удален, посмотрите другие документы.",
379
+ "Revision_created": "Revision {{id}} created",
380
+ "Checking": "Checking...",
381
+ "Publishing": "Publishing..."
368
382
  }
@@ -367,11 +367,16 @@
367
367
  "Link_file": "文件链接",
368
368
  "Keep_my_modification": "保留我的更改",
369
369
  "Keep_other_modification": "保留其他的更改",
370
- "Keep_both_modification": "保留两个更改",
370
+ "Keep_both_modification": "保留我的更改",
371
+ "Tip": "提示",
371
372
  "Rebase_delete_no_change_revision_tip": "修订改没有更改,是否删除修订稿?",
372
373
  "Has_been_replaced_tip": "文档内容已经被替换,请刷新页面。",
373
374
  "Has_been_published_tip": "修订稿已经发布了,{{ time }} 秒后自动跳转到源文件。",
374
375
  "Has_conflict_before_publish_tip": "文档有冲突,请解决冲突后再发布!",
375
376
  "Merge_tip": "文档有冲突,是否合并?",
376
- "Has_conflict_before_view_changes_tip": "文档有冲突,请解决冲突后再查看更改!"
377
+ "Has_conflict_before_view_changes_tip": "文档有冲突,请解决冲突后再查看更改!",
378
+ "Has_been_removed_tip": "文档已经被删除,请查看其他文档",
379
+ "Revision_created": "已创建修订稿 {{id}}",
380
+ "Checking": "检查中...",
381
+ "Publishing": "发布中..."
377
382
  }