@leankylin-sheet/react 3.1.26 → 3.1.27

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/index.esm.js CHANGED
@@ -2195,6 +2195,25 @@ var NotationBoxes = function NotationBoxes() {
2195
2195
  overflow: "hidden",
2196
2196
  display: "flex",
2197
2197
  flexDirection: "column"
2198
+ },
2199
+ onWheel: function onWheel(e) {
2200
+ return e.stopPropagation();
2201
+ },
2202
+ id: "".concat(commentId, "-editor"),
2203
+ onMouseUp: function onMouseUp(e) {
2204
+ var el = e.target.querySelector(".luckysheet-comment-editor");
2205
+ e.target.scrollTop = e.target.scrollHeight;
2206
+ if (el) {
2207
+ var selection = window.getSelection();
2208
+ if (selection) {
2209
+ var range = document.createRange();
2210
+ range.setStartAfter(el.lastChild || el);
2211
+ range.setEndAfter(el.lastChild || el);
2212
+ selection.removeAllRanges();
2213
+ selection.addRange(range);
2214
+ }
2215
+ el.focus();
2216
+ }
2198
2217
  }
2199
2218
  }, (_context$hooks$commen = (_context$hooks = context.hooks).commentsPreRender) === null || _context$hooks$commen === void 0 ? void 0 : _context$hooks$commen.call(_context$hooks, r, c), /*#__PURE__*/React.createElement(ContentEditable, {
2200
2219
  id: "comment-editor-".concat(rc),
@@ -2217,6 +2236,10 @@ var NotationBoxes = function NotationBoxes() {
2217
2236
  },
2218
2237
  onBlur: function onBlur() {
2219
2238
  var _context$hooks$afterU2, _context$hooks3, _flowdata$r2, _flowdata$r2$c;
2239
+ var el = document.querySelector("#".concat(commentId, "-editor"));
2240
+ if (el) {
2241
+ el.scrollTop = 0;
2242
+ }
2220
2243
  (_context$hooks$afterU2 = (_context$hooks3 = context.hooks).afterUpdateComment) === null || _context$hooks$afterU2 === void 0 ? void 0 : _context$hooks$afterU2.call(_context$hooks3, r, c, flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : (_flowdata$r2$c = _flowdata$r2[c]) === null || _flowdata$r2$c === void 0 ? void 0 : _flowdata$r2$c.ps, true);
2221
2244
  },
2222
2245
  allowEdit: context.allowEdit,
package/dist/index.js CHANGED
@@ -2205,6 +2205,25 @@ var NotationBoxes = function NotationBoxes() {
2205
2205
  overflow: "hidden",
2206
2206
  display: "flex",
2207
2207
  flexDirection: "column"
2208
+ },
2209
+ onWheel: function onWheel(e) {
2210
+ return e.stopPropagation();
2211
+ },
2212
+ id: "".concat(commentId, "-editor"),
2213
+ onMouseUp: function onMouseUp(e) {
2214
+ var el = e.target.querySelector(".luckysheet-comment-editor");
2215
+ e.target.scrollTop = e.target.scrollHeight;
2216
+ if (el) {
2217
+ var selection = window.getSelection();
2218
+ if (selection) {
2219
+ var range = document.createRange();
2220
+ range.setStartAfter(el.lastChild || el);
2221
+ range.setEndAfter(el.lastChild || el);
2222
+ selection.removeAllRanges();
2223
+ selection.addRange(range);
2224
+ }
2225
+ el.focus();
2226
+ }
2208
2227
  }
2209
2228
  }, (_context$hooks$commen = (_context$hooks = context.hooks).commentsPreRender) === null || _context$hooks$commen === void 0 ? void 0 : _context$hooks$commen.call(_context$hooks, r, c), /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
2210
2229
  id: "comment-editor-".concat(rc),
@@ -2227,6 +2246,10 @@ var NotationBoxes = function NotationBoxes() {
2227
2246
  },
2228
2247
  onBlur: function onBlur() {
2229
2248
  var _context$hooks$afterU2, _context$hooks3, _flowdata$r2, _flowdata$r2$c;
2249
+ var el = document.querySelector("#".concat(commentId, "-editor"));
2250
+ if (el) {
2251
+ el.scrollTop = 0;
2252
+ }
2230
2253
  (_context$hooks$afterU2 = (_context$hooks3 = context.hooks).afterUpdateComment) === null || _context$hooks$afterU2 === void 0 ? void 0 : _context$hooks$afterU2.call(_context$hooks3, r, c, flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : (_flowdata$r2$c = _flowdata$r2[c]) === null || _flowdata$r2$c === void 0 ? void 0 : _flowdata$r2$c.ps, true);
2231
2254
  },
2232
2255
  allowEdit: context.allowEdit,
package/dist/index.umd.js CHANGED
@@ -105241,6 +105241,25 @@
105241
105241
  overflow: "hidden",
105242
105242
  display: "flex",
105243
105243
  flexDirection: "column"
105244
+ },
105245
+ onWheel: function onWheel(e) {
105246
+ return e.stopPropagation();
105247
+ },
105248
+ id: "".concat(commentId, "-editor"),
105249
+ onMouseUp: function onMouseUp(e) {
105250
+ var el = e.target.querySelector(".luckysheet-comment-editor");
105251
+ e.target.scrollTop = e.target.scrollHeight;
105252
+ if (el) {
105253
+ var selection = window.getSelection();
105254
+ if (selection) {
105255
+ var range = document.createRange();
105256
+ range.setStartAfter(el.lastChild || el);
105257
+ range.setEndAfter(el.lastChild || el);
105258
+ selection.removeAllRanges();
105259
+ selection.addRange(range);
105260
+ }
105261
+ el.focus();
105262
+ }
105244
105263
  }
105245
105264
  }, (_context$hooks$commen = (_context$hooks = context.hooks).commentsPreRender) === null || _context$hooks$commen === void 0 ? void 0 : _context$hooks$commen.call(_context$hooks, r, c), /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
105246
105265
  id: "comment-editor-".concat(rc),
@@ -105263,6 +105282,10 @@
105263
105282
  },
105264
105283
  onBlur: function onBlur() {
105265
105284
  var _context$hooks$afterU2, _context$hooks3, _flowdata$r2, _flowdata$r2$c;
105285
+ var el = document.querySelector("#".concat(commentId, "-editor"));
105286
+ if (el) {
105287
+ el.scrollTop = 0;
105288
+ }
105266
105289
  (_context$hooks$afterU2 = (_context$hooks3 = context.hooks).afterUpdateComment) === null || _context$hooks$afterU2 === void 0 ? void 0 : _context$hooks$afterU2.call(_context$hooks3, r, c, flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : (_flowdata$r2$c = _flowdata$r2[c]) === null || _flowdata$r2$c === void 0 ? void 0 : _flowdata$r2$c.ps, true);
105267
105290
  },
105268
105291
  allowEdit: context.allowEdit,