@seafile/sdoc-editor 0.3.9 → 0.3.10-beta

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.
@@ -8,7 +8,7 @@
8
8
  width: 280px;
9
9
  }
10
10
 
11
- .sdoc-comments-participants-popover .selected-participants {
11
+ .sdoc-comments-participants-popover .sdoc-selected-participants {
12
12
  background-color: #f6f6f6;
13
13
  padding: 5px;
14
14
  border-bottom: 1px solid #dde2ea;
@@ -16,7 +16,7 @@
16
16
  min-height: 34px;
17
17
  }
18
18
 
19
- .sdoc-comments-participants-popover .selected-participant {
19
+ .sdoc-comments-participants-popover .sdoc-selected-participant {
20
20
  display: inline-flex;
21
21
  align-items: center;
22
22
  height: 20px;
@@ -27,20 +27,20 @@
27
27
  background: #eaeaea;
28
28
  }
29
29
 
30
- .sdoc-comments-participants-popover .selected-participant img {
30
+ .sdoc-comments-participants-popover .sdoc-selected-participant img {
31
31
  width: 16px;
32
32
  height: 16px;
33
33
  border-radius: 50%;
34
34
  vertical-align: middle;
35
35
  }
36
36
 
37
- .sdoc-comments-participants-popover .selected-participant .selected-participant-name {
37
+ .sdoc-comments-participants-popover .sdoc-selected-participant .sdoc-selected-participant-name {
38
38
  margin-left: 4px;
39
39
  flex: 1 1;
40
40
  color: #16181b;
41
41
  }
42
42
 
43
- .sdoc-comments-participants-popover .selected-participant .selected-participant-delete {
43
+ .sdoc-comments-participants-popover .sdoc-selected-participant .sdoc-selected-participant-delete {
44
44
  width: 20px;
45
45
  height: 20px;
46
46
  display: flex;
@@ -50,25 +50,25 @@
50
50
  cursor: pointer;
51
51
  }
52
52
 
53
- .sdoc-comments-participants-popover .selected-participant .selected-participant-delete .sdocfont {
53
+ .sdoc-comments-participants-popover .sdoc-selected-participant .sdoc-selected-participant-delete .sdocfont {
54
54
  display: inline-block;
55
55
  font-size: 12px;
56
56
  color: #909090;
57
57
  }
58
58
 
59
- .sdoc-comments-participants-popover .selected-participant .selected-participant-delete:hover .sdocfont {
59
+ .sdoc-comments-participants-popover .sdoc-selected-participant .sdoc-selected-participant-delete:hover .sdocfont {
60
60
  color: #5a5a5a;
61
61
  }
62
62
 
63
- .sdoc-comments-participants-popover .search-collaborators {
63
+ .sdoc-comments-participants-popover .sdoc-search-collaborators {
64
64
  padding: 10px;
65
65
  }
66
66
 
67
- .sdoc-comments-participants-popover .search-collaborators input {
67
+ .sdoc-comments-participants-popover .sdoc-search-collaborators input {
68
68
  height: 28px;
69
69
  }
70
70
 
71
- .sdoc-comments-participants-popover .searched-collaborators {
71
+ .sdoc-comments-participants-popover .sdoc-searched-collaborators {
72
72
  display: flex;
73
73
  flex-direction: column;
74
74
  align-items: center;
@@ -77,13 +77,13 @@
77
77
  overflow: auto;
78
78
  }
79
79
 
80
- .sdoc-comments-participants-popover .searched-collaborators.empty-tip {
80
+ .sdoc-comments-participants-popover .sdoc-searched-collaborators.sdoc-searched-collaborators-empty-tip {
81
81
  opacity: .5;
82
82
  font-size: 14px;
83
83
  align-items: flex-start;
84
84
  }
85
85
 
86
- .sdoc-comments-participants-popover .searched-collaborator {
86
+ .sdoc-comments-participants-popover .sdoc-searched-collaborator {
87
87
  display: flex;
88
88
  align-items: center;
89
89
  width: 100%;
@@ -96,12 +96,12 @@
96
96
  font-size: 14px;
97
97
  }
98
98
 
99
- .sdoc-comments-participants-popover .searched-collaborator:hover {
99
+ .sdoc-comments-participants-popover .sdoc-searched-collaborator:hover {
100
100
  cursor: pointer;
101
101
  background-color: #f8f9fa;
102
102
  }
103
103
 
104
- .sdoc-comments-participants-popover .searched-collaborator img {
104
+ .sdoc-comments-participants-popover .sdoc-searched-collaborator img {
105
105
  width: 16px;
106
106
  height: 16px;
107
107
  margin-left: 10px;
@@ -109,7 +109,7 @@
109
109
  vertical-align: middle;
110
110
  }
111
111
 
112
- .sdoc-comments-participants-popover .searched-collaborator .selected-participant-name {
112
+ .sdoc-comments-participants-popover .sdoc-searched-collaborator .sdoc-selected-participant-name {
113
113
  flex: 1;
114
114
  overflow: hidden;
115
115
  text-overflow: ellipsis;
@@ -118,7 +118,7 @@
118
118
  color: #16181b;
119
119
  }
120
120
 
121
- .sdoc-comments-participants-popover .searched-collaborator .searched-collaborator-operation {
121
+ .sdoc-comments-participants-popover .sdoc-searched-collaborator .sdoc-searched-collaborator-operation {
122
122
  width: 20px;
123
123
  height: 20px;
124
124
  display: flex;
@@ -126,7 +126,7 @@
126
126
  justify-content: center;
127
127
  }
128
128
 
129
- .sdoc-comments-participants-popover .searched-collaborator .searched-collaborator-operation .sdocfont {
129
+ .sdoc-comments-participants-popover .sdoc-searched-collaborator .sdoc-searched-collaborator-operation .sdocfont {
130
130
  font-size: 12px;
131
131
  color: #798d99;
132
132
  }
@@ -46,7 +46,7 @@ const CommentParticipantsEditor = forwardRef((_ref, ref) => {
46
46
  className: "sdoc-comments-participants-editor-container",
47
47
  onClick: event => eventStopPropagation(event)
48
48
  }, /*#__PURE__*/React.createElement(SelectedParticipants, null), /*#__PURE__*/React.createElement("div", {
49
- className: "search-collaborators"
49
+ className: "sdoc-search-collaborators"
50
50
  }, /*#__PURE__*/React.createElement("input", {
51
51
  className: "form-control",
52
52
  type: "text",
@@ -24,11 +24,11 @@ const SearchedCollaborators = _ref => {
24
24
  }, [deleteParticipant, addParticipants]);
25
25
  if (!Array.isArray(collaborators) || collaborators.length === 0) {
26
26
  return /*#__PURE__*/React.createElement("div", {
27
- className: "searched-collaborators empty-tip"
27
+ className: "sdoc-searched-collaborators sdoc-searched-collaborators-empty-tip"
28
28
  }, t('No_collaborators_available'));
29
29
  }
30
30
  return /*#__PURE__*/React.createElement("div", {
31
- className: "searched-collaborators"
31
+ className: "sdoc-searched-collaborators"
32
32
  }, collaborators.map(collaborator => {
33
33
  const {
34
34
  name,
@@ -38,15 +38,15 @@ const SearchedCollaborators = _ref => {
38
38
  const isSelected = participants.find(participant => participant.username === username);
39
39
  return /*#__PURE__*/React.createElement("div", {
40
40
  key: username,
41
- className: "searched-collaborator",
41
+ className: "sdoc-searched-collaborator",
42
42
  onClick: event => onSelectParticipant(event, collaborator, isSelected)
43
43
  }, /*#__PURE__*/React.createElement("img", {
44
44
  src: avatar_url,
45
45
  alt: ""
46
46
  }), /*#__PURE__*/React.createElement("div", {
47
- className: "selected-participant-name"
47
+ className: "sdoc-selected-participant-name"
48
48
  }, name), /*#__PURE__*/React.createElement("div", {
49
- className: "searched-collaborator-operation"
49
+ className: "sdoc-searched-collaborator-operation"
50
50
  }, isSelected && /*#__PURE__*/React.createElement("i", {
51
51
  className: "sdocfont sdoc-check-mark"
52
52
  })));
@@ -14,7 +14,7 @@ const SelectedParticipants = () => {
14
14
  }, [deleteParticipant]);
15
15
  if (!Array.isArray(participants) || participants.length === 0) return null;
16
16
  return /*#__PURE__*/React.createElement("div", {
17
- className: "selected-participants"
17
+ className: "sdoc-selected-participants"
18
18
  }, participants.map(participant => {
19
19
  const {
20
20
  name,
@@ -23,14 +23,14 @@ const SelectedParticipants = () => {
23
23
  } = participant;
24
24
  return /*#__PURE__*/React.createElement("div", {
25
25
  key: username,
26
- className: "selected-participant"
26
+ className: "sdoc-selected-participant"
27
27
  }, /*#__PURE__*/React.createElement("img", {
28
28
  src: avatar_url,
29
29
  alt: ""
30
30
  }), /*#__PURE__*/React.createElement("div", {
31
- className: "selected-participant-name"
31
+ className: "sdoc-selected-participant-name"
32
32
  }, name), /*#__PURE__*/React.createElement("div", {
33
- className: "selected-participant-delete",
33
+ className: "sdoc-selected-participant-delete",
34
34
  onClick: () => onDeleteParticipant(participant),
35
35
  title: t('Delete')
36
36
  }, /*#__PURE__*/React.createElement("i", {
@@ -26,7 +26,7 @@ const CommentTypeDropdownItem = _ref => {
26
26
  };
27
27
  const GlobalCommentBodyHeader = _ref2 => {
28
28
  let {
29
- commentList,
29
+ commentList = [],
30
30
  commentType,
31
31
  setCommentType
32
32
  } = _ref2;
@@ -140,7 +140,7 @@ const GlobalComment = _ref => {
140
140
  }, /*#__PURE__*/React.createElement("div", {
141
141
  id: "global-comment-list-container",
142
142
  className: "sdoc-comment-list-container"
143
- }, commentList.map(comment => {
143
+ }, Array.isArray(commentList) && commentList.map(comment => {
144
144
  const elementId = comment.detail.element_id;
145
145
  const element = getNodeById(editor.children, elementId);
146
146
  if (!element && elementId !== DOC_COMMENT_ELEMENT_ID) return null;
@@ -33,10 +33,10 @@ class CheckListItem extends React.PureComponent {
33
33
  textAlign: align
34
34
  };
35
35
  return /*#__PURE__*/React.createElement("div", Object.assign({
36
- className: "sdoc-checkbox-container",
37
36
  "data-id": id,
38
37
  "data-root": "true"
39
38
  }, attributes, {
39
+ className: "sdoc-checkbox-container ".concat(attributes.className),
40
40
  style: style
41
41
  }), /*#__PURE__*/React.createElement("span", {
42
42
  className: "sdoc-checkbox-input-wrapper",
@@ -14,10 +14,10 @@ export const renderTitle = (props, editor) => {
14
14
  textAlign: element.align
15
15
  };
16
16
  return /*#__PURE__*/React.createElement("div", Object.assign({
17
- className: "sdoc-header-title",
18
17
  "data-id": element.id,
19
18
  "data-root": "true"
20
19
  }, attributes, {
20
+ className: "sdoc-header-title ".concat(attributes.className),
21
21
  style: _objectSpread({}, style)
22
22
  }), children);
23
23
  };
@@ -33,10 +33,10 @@ export const renderSubtitle = (props, editor) => {
33
33
  textAlign: element.align
34
34
  };
35
35
  return /*#__PURE__*/React.createElement("div", Object.assign({
36
- className: "sdoc-header-subtitle",
37
36
  "data-id": element.id,
38
37
  "data-root": "true"
39
38
  }, attributes, {
39
+ className: "sdoc-header-subtitle ".concat(attributes.className),
40
40
  style: _objectSpread({}, style)
41
41
  }), children);
42
42
  };
@@ -63,12 +63,12 @@ export const renderHeader = (props, editor) => {
63
63
  isShowPlaceHolder = true;
64
64
  }
65
65
  return /*#__PURE__*/React.createElement("div", Object.assign({
66
- className: "sdoc-header-".concat(level),
67
66
  "data-id": element.id,
68
67
  id: element.id // used for click left outline item, page scroll this element
69
68
  ,
70
69
  "data-root": "true"
71
70
  }, attributes, {
71
+ className: "sdoc-header-".concat(level, " ").concat(attributes.className),
72
72
  style: _objectSpread({
73
73
  position: isShowPlaceHolder ? 'relative' : ''
74
74
  }, style)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.3.9",
3
+ "version": "0.3.10beta",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",