@fileverse-dev/fortune-react 1.2.86-pinyin-7 → 1.2.86-pinyin-8

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.
@@ -258,16 +258,12 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
258
258
  return result;
259
259
  });
260
260
  }, [emitOp]);
261
- var handleUndo = useCallback(function () {
261
+ var handleUndo = function handleUndo() {
262
+ console.log("undo poo");
262
263
  var history = globalCache.current.undoList.pop();
263
264
  if (history) {
264
265
  setContext(function (ctx_) {
265
266
  var _a, _b, _c, _d, _e, _f, _g;
266
- history.inversePatches.map(function (onePatch, index) {
267
- if (!onePatch.value) {
268
- onePatch.value = history.patches[index].value;
269
- }
270
- });
271
267
  var isBorderUndo = history.patches.some(function (onePatch) {
272
268
  var _a;
273
269
  return (_a = onePatch.value) === null || _a === void 0 ? void 0 : _a.borderInfo;
@@ -313,20 +309,15 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
313
309
  })
314
310
  });
315
311
  }
316
- return nw;
312
+ return isBorderUndo ? nw : newContext;
317
313
  });
318
314
  }
319
- }, [emitOp]);
320
- var handleRedo = useCallback(function () {
315
+ };
316
+ var handleRedo = function handleRedo() {
321
317
  var history = globalCache.current.redoList.pop();
322
318
  if (history) {
323
319
  setContext(function (ctx_) {
324
320
  var _a, _b, _c;
325
- history.inversePatches.map(function (onePatch, index) {
326
- if (!onePatch.value) {
327
- onePatch.value = history.patches[index].value;
328
- }
329
- });
330
321
  var newContext = applyPatches(ctx_, history.patches);
331
322
  var isBorderUndo = history.patches.some(function (onePatch) {
332
323
  var _a;
@@ -343,10 +334,10 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
343
334
  })
344
335
  });
345
336
  }
346
- return nw;
337
+ return isBorderUndo ? nw : newContext;
347
338
  });
348
339
  }
349
- }, [emitOp]);
340
+ };
350
341
  useEffect(function () {
351
342
  var _a, _b;
352
343
  (_b = (_a = mergedSettings.hooks) === null || _a === void 0 ? void 0 : _a.afterActivateSheet) === null || _b === void 0 ? void 0 : _b.call(_a, context.currentSheetId);
@@ -267,16 +267,12 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
267
267
  return result;
268
268
  });
269
269
  }, [emitOp]);
270
- var handleUndo = (0, _react.useCallback)(function () {
270
+ var handleUndo = function handleUndo() {
271
+ console.log("undo poo");
271
272
  var history = globalCache.current.undoList.pop();
272
273
  if (history) {
273
274
  setContext(function (ctx_) {
274
275
  var _a, _b, _c, _d, _e, _f, _g;
275
- history.inversePatches.map(function (onePatch, index) {
276
- if (!onePatch.value) {
277
- onePatch.value = history.patches[index].value;
278
- }
279
- });
280
276
  var isBorderUndo = history.patches.some(function (onePatch) {
281
277
  var _a;
282
278
  return (_a = onePatch.value) === null || _a === void 0 ? void 0 : _a.borderInfo;
@@ -322,20 +318,15 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
322
318
  })
323
319
  });
324
320
  }
325
- return nw;
321
+ return isBorderUndo ? nw : newContext;
326
322
  });
327
323
  }
328
- }, [emitOp]);
329
- var handleRedo = (0, _react.useCallback)(function () {
324
+ };
325
+ var handleRedo = function handleRedo() {
330
326
  var history = globalCache.current.redoList.pop();
331
327
  if (history) {
332
328
  setContext(function (ctx_) {
333
329
  var _a, _b, _c;
334
- history.inversePatches.map(function (onePatch, index) {
335
- if (!onePatch.value) {
336
- onePatch.value = history.patches[index].value;
337
- }
338
- });
339
330
  var newContext = (0, _immer.applyPatches)(ctx_, history.patches);
340
331
  var isBorderUndo = history.patches.some(function (onePatch) {
341
332
  var _a;
@@ -352,10 +343,10 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
352
343
  })
353
344
  });
354
345
  }
355
- return nw;
346
+ return isBorderUndo ? nw : newContext;
356
347
  });
357
348
  }
358
- }, [emitOp]);
349
+ };
359
350
  (0, _react.useEffect)(function () {
360
351
  var _a, _b;
361
352
  (_b = (_a = mergedSettings.hooks) === null || _a === void 0 ? void 0 : _a.afterActivateSheet) === null || _b === void 0 ? void 0 : _b.call(_a, context.currentSheetId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.86-pinyin-7",
3
+ "version": "1.2.86-pinyin-8",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.2.86-pinyin-7",
19
+ "@fileverse-dev/fortune-core": "1.2.86-pinyin-8",
20
20
  "@fileverse/ui": "^4.1.7-patch-40",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",