@seafile/sdoc-editor 2.0.29 → 2.0.31

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.
@@ -124,10 +124,6 @@
124
124
  left: 8px !important;
125
125
  }
126
126
 
127
- .sdoc-sub-dropdown-menu .sdoc-insert-element-table-size-wrapper {
128
- left: 227px !important;
129
- }
130
-
131
127
  .mobile-login .sdoc-dropdown-menu {
132
128
  padding: 0 !important;
133
129
  }
@@ -3,6 +3,7 @@
3
3
  padding: 6px 0 6px 8px;
4
4
  font-size: 0.75rem;
5
5
  border-right: 1px solid #e5e6e8;
6
+ border-radius: 0 !important;
6
7
  color: #444;
7
8
  display: flex;
8
9
  align-items: center;
@@ -69,7 +69,7 @@ function AIModule(_ref) {
69
69
  const heightDiff = rect.bottom + _constants.AI_MIN_HEIGHT - window.innerHeight;
70
70
  if (heightDiff > 0) {
71
71
  scrollRef.current.scrollTo({
72
- top: scrollRef.current.scrollTop + heightDiff + 32,
72
+ top: scrollTop + rect.top - 94,
73
73
  behavior: 'smooth'
74
74
  });
75
75
  }
@@ -102,7 +102,7 @@ function AIModule(_ref) {
102
102
  const heightDiff = slateRect.bottom + _constants.AI_MIN_HEIGHT - window.innerHeight;
103
103
  if (heightDiff > 0) {
104
104
  scrollRef.current.scrollTo({
105
- top: scrollRef.current.scrollTop + heightDiff + 32,
105
+ top: scrollTop + slateRect.top - 94,
106
106
  behavior: 'smooth'
107
107
  });
108
108
  }
@@ -503,7 +503,9 @@ function AIModule(_ref) {
503
503
  className: "sdoc-ai-result"
504
504
  }, /*#__PURE__*/_react.default.createElement("div", {
505
505
  className: "sdoc-ai-result-content"
506
- }, isGenerating ? t('Processing_message') : searchResult)), /*#__PURE__*/_react.default.createElement("div", {
506
+ }, isGenerating ? t('Processing_message') : searchResult.split('\n').map((paragraph, index) => /*#__PURE__*/_react.default.createElement("p", {
507
+ key: index
508
+ }, paragraph)))), /*#__PURE__*/_react.default.createElement("div", {
507
509
  className: "sdoc-ai-search"
508
510
  }, /*#__PURE__*/_react.default.createElement(_aiIcon.default, null), /*#__PURE__*/_react.default.createElement("input", {
509
511
  placeholder: t('Ask_AI_anything'),
@@ -65,6 +65,7 @@
65
65
  box-shadow: 0 0 10px #ccc;
66
66
  background-color: #fff;
67
67
  pointer-events: all;
68
+ overflow: hidden;
68
69
  }
69
70
 
70
71
  .sdoc-ai-module-container .sdoc-ai-operations .op-type {
@@ -84,9 +85,15 @@
84
85
  }
85
86
 
86
87
  .sdoc-ai-module-container .sdoc-ai-result .sdoc-ai-result-content {
87
- white-space: pre-wrap;
88
- line-height: 33px;
89
88
  font-size: 11pt;
89
+ height: auto;
90
+ overflow-y: auto;
91
+ }
92
+
93
+ .sdoc-ai-module-container .sdoc-ai-result .sdoc-ai-result-content p {
94
+ line-height: 1.6;
95
+ padding: 5px 0;
96
+ margin-bottom: 0 !important;
90
97
  }
91
98
 
92
99
  .sdoc-ai-module-container .sdoc-ai-result .sdoc-ai-result-header {
@@ -125,4 +125,6 @@ const LANG_MENU_CONFIG = exports.LANG_MENU_CONFIG = {
125
125
  iconClass: 'sdocfont sdoc-ai-translate'
126
126
  }
127
127
  };
128
- const AI_MIN_HEIGHT = exports.AI_MIN_HEIGHT = 358;
128
+
129
+ // 358 is default height of ai menu and 300 is max-height of shown result
130
+ const AI_MIN_HEIGHT = exports.AI_MIN_HEIGHT = 358 + 300;
@@ -168,7 +168,7 @@ const InsertBlockMenu = _ref => {
168
168
  editor: editor,
169
169
  target: "sdoc-side-menu-item-table",
170
170
  trigger: "hover",
171
- placement: "left-start",
171
+ placement: "right-start",
172
172
  popperClassName: "sdoc-side-menu-table-size sdoc-insert-element-table-size-wrapper",
173
173
  createTable: createTable
174
174
  })), /*#__PURE__*/_react.default.createElement(_dropdownMenuItem.default, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.29",
3
+ "version": "2.0.31",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",