@fileverse-dev/fortune-react 1.2.86-pinyin-4 → 1.2.86-pinyin-6

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.
@@ -248,10 +248,15 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
248
248
  return result;
249
249
  });
250
250
  }, [emitOp]);
251
- var repaint = function repaint() {
251
+ var repaint = function repaint(context) {
252
252
  var _a, _b, _c, _d, _e;
253
- console.log("repaint");
253
+ console.log("repaint is calling", context, context.config.borderInfo);
254
254
  var tableCanvas = new Canvas(refs.canvas.current, context);
255
+ console.log(context.config.borderInfo, "global context");
256
+ setContext(function (draftCtx) {
257
+ console.log(draftCtx.config.borderInfo, "local context");
258
+ return draftCtx;
259
+ });
255
260
  var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[sheet.id];
256
261
  if (((_b = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _b === void 0 ? void 0 : _b.freezenhorizontaldata) || ((_c = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _c === void 0 ? void 0 : _c.freezenverticaldata)) {
257
262
  var horizontalData = (_d = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _d === void 0 ? void 0 : _d.freezenhorizontaldata;
@@ -382,11 +387,12 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
382
387
  delete inversedOptions.addSheet.value.data;
383
388
  }
384
389
  emitOp(newContext, history.inversePatches, inversedOptions, true);
390
+ console.log("undo", newContext);
391
+ repaint(newContext);
385
392
  return newContext;
386
393
  });
387
- repaint();
388
394
  }
389
- }, [emitOp]);
395
+ }, [emitOp, context, setContext]);
390
396
  var handleRedo = useCallback(function () {
391
397
  var history = globalCache.current.redoList.pop();
392
398
  if (history) {
@@ -257,10 +257,15 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
257
257
  return result;
258
258
  });
259
259
  }, [emitOp]);
260
- var repaint = function repaint() {
260
+ var repaint = function repaint(context) {
261
261
  var _a, _b, _c, _d, _e;
262
- console.log("repaint");
262
+ console.log("repaint is calling", context, context.config.borderInfo);
263
263
  var tableCanvas = new _fortuneCore.Canvas(refs.canvas.current, context);
264
+ console.log(context.config.borderInfo, "global context");
265
+ setContext(function (draftCtx) {
266
+ console.log(draftCtx.config.borderInfo, "local context");
267
+ return draftCtx;
268
+ });
264
269
  var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[sheet.id];
265
270
  if (((_b = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _b === void 0 ? void 0 : _b.freezenhorizontaldata) || ((_c = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _c === void 0 ? void 0 : _c.freezenverticaldata)) {
266
271
  var horizontalData = (_d = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _d === void 0 ? void 0 : _d.freezenhorizontaldata;
@@ -391,11 +396,12 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
391
396
  delete inversedOptions.addSheet.value.data;
392
397
  }
393
398
  emitOp(newContext, history.inversePatches, inversedOptions, true);
399
+ console.log("undo", newContext);
400
+ repaint(newContext);
394
401
  return newContext;
395
402
  });
396
- repaint();
397
403
  }
398
- }, [emitOp]);
404
+ }, [emitOp, context, setContext]);
399
405
  var handleRedo = (0, _react.useCallback)(function () {
400
406
  var history = globalCache.current.redoList.pop();
401
407
  if (history) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.86-pinyin-4",
3
+ "version": "1.2.86-pinyin-6",
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-4",
19
+ "@fileverse-dev/fortune-core": "1.2.86-pinyin-6",
20
20
  "@fileverse/ui": "^4.1.7-patch-40",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",