@fileverse-dev/fortune-react 1.2.95-ens-1 → 1.2.95-ydoc

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.
@@ -280,7 +280,7 @@ export var LinkEditCard = function LinkEditCard(_a) {
280
280
  if (isButtonDisabled) return;
281
281
  _.set(refs.globalCache, "linkCard.mouseEnter", false);
282
282
  setContext(function (draftCtx) {
283
- return saveHyperlink(draftCtx, r, c, linkText, linkType, linkAddress);
283
+ saveHyperlink(draftCtx, r, c, linkText, linkType, linkAddress);
284
284
  });
285
285
  }
286
286
  }, "Insert link"));
@@ -51,7 +51,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
51
51
  getCellsByRange: (range: Selection, options?: api.CommonOptions) => (Cell | null)[][];
52
52
  getHtmlByRange: (range: Range, options?: api.CommonOptions) => string | null;
53
53
  setSelection: (range: Range, options?: api.CommonOptions) => void;
54
- setCellValuesByRange: (data: any[][], range: SingleRange, options?: api.CommonOptions) => void;
54
+ setCellValuesByRange: (data: any[][], range: SingleRange, options?: api.CommonOptions, cellAfter?: boolean) => void;
55
55
  setCellFormatByRange: (attr: keyof Cell, value: any, range: Range | SingleRange, options?: api.CommonOptions) => void;
56
56
  mergeCells: (ranges: Range, type: string, options?: api.CommonOptions) => void;
57
57
  cancelMerge: (ranges: Range, options?: api.CommonOptions) => void;
@@ -276,12 +276,12 @@ export function generateAPIs(context, setContext, handleUndo, handleRedo, settin
276
276
  return api.setSelection(draftCtx, range, options);
277
277
  });
278
278
  },
279
- setCellValuesByRange: function setCellValuesByRange(data, range, options) {
279
+ setCellValuesByRange: function setCellValuesByRange(data, range, options, cellAfter) {
280
280
  if (options === void 0) {
281
281
  options = {};
282
282
  }
283
283
  return setContext(function (draftCtx) {
284
- return api.setCellValuesByRange(draftCtx, data, range, cellInput, options);
284
+ return api.setCellValuesByRange(draftCtx, data, range, cellInput, options, cellAfter);
285
285
  });
286
286
  },
287
287
  setCellFormatByRange: function setCellFormatByRange(attr, value, range, options) {
@@ -58,7 +58,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
58
58
  getCellsByRange: (range: import("@fileverse-dev/fortune-core").Selection, options?: api.CommonOptions) => (import("@fileverse-dev/fortune-core").Cell | null)[][];
59
59
  getHtmlByRange: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => string | null;
60
60
  setSelection: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
61
- setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
61
+ setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions, cellAfter?: boolean | undefined) => void;
62
62
  setCellFormatByRange: (attr: "error" | "rt" | "f" | "m" | "v" | "mc" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, range: import("@fileverse-dev/fortune-core").Range | import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
63
63
  mergeCells: (ranges: import("@fileverse-dev/fortune-core").Range, type: string, options?: api.CommonOptions) => void;
64
64
  cancelMerge: (ranges: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
@@ -390,6 +390,108 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
390
390
  refs: refs
391
391
  };
392
392
  }, [context, handleRedo, handleUndo, mergedSettings, refs, setContextWithProduce]);
393
+ useEffect(function () {
394
+ var _a;
395
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.sheetLengthChange) {
396
+ context.hooks.sheetLengthChange();
397
+ }
398
+ }, [context.luckysheetfile.length]);
399
+ var currentSheet = useMemo(function () {
400
+ var _a;
401
+ return (_a = context === null || context === void 0 ? void 0 : context.luckysheetfile) === null || _a === void 0 ? void 0 : _a.find(function (sheet) {
402
+ return sheet.id === (context === null || context === void 0 ? void 0 : context.currentSheetId);
403
+ });
404
+ }, [context === null || context === void 0 ? void 0 : context.luckysheetfile, context === null || context === void 0 ? void 0 : context.currentSheetId]);
405
+ useEffect(function () {
406
+ var _a;
407
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.calcChainChange) {
408
+ context.hooks.calcChainChange();
409
+ }
410
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.calcChain]);
411
+ useEffect(function () {
412
+ var _a;
413
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterImagesChange) {
414
+ context.hooks.afterImagesChange();
415
+ }
416
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.images]);
417
+ useEffect(function () {
418
+ var _a;
419
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterIframesChange) {
420
+ context.hooks.afterIframesChange();
421
+ }
422
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.iframes]);
423
+ useEffect(function () {
424
+ var _a;
425
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterFrozenChange) {
426
+ context.hooks.afterFrozenChange();
427
+ }
428
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.frozen]);
429
+ useEffect(function () {
430
+ var _a;
431
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterOrderChanges) {
432
+ context.hooks.afterOrderChanges();
433
+ }
434
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.order]);
435
+ useEffect(function () {
436
+ var _a;
437
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterConfigChanges) {
438
+ context.hooks.afterConfigChanges();
439
+ }
440
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.config]);
441
+ useEffect(function () {
442
+ var _a;
443
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterColRowChanges) {
444
+ context.hooks.afterColRowChanges();
445
+ }
446
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.row, currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.column]);
447
+ useEffect(function () {
448
+ var _a;
449
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterShowGridLinesChange) {
450
+ context.hooks.afterShowGridLinesChange();
451
+ }
452
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.showGridLines]);
453
+ useEffect(function () {
454
+ var _a;
455
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.dataVerificationChange) {
456
+ context.hooks.dataVerificationChange();
457
+ }
458
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.dataVerification]);
459
+ useEffect(function () {
460
+ var _a;
461
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.liveQueryChange) {
462
+ context.hooks.liveQueryChange();
463
+ }
464
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.liveQueryList]);
465
+ useEffect(function () {
466
+ var _a;
467
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.imageListChange) {
468
+ context.hooks.imageListChange();
469
+ }
470
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.images]);
471
+ useEffect(function () {
472
+ var _a;
473
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.iframeListChange) {
474
+ context.hooks.iframeListChange();
475
+ }
476
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.iframes]);
477
+ useEffect(function () {
478
+ var _a;
479
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.conditionRulesChange) {
480
+ context.hooks.conditionRulesChange();
481
+ }
482
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.conditionRules]);
483
+ useEffect(function () {
484
+ var _a;
485
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.conditionFormatChange) {
486
+ context.hooks.conditionFormatChange();
487
+ }
488
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.luckysheet_conditionformat_save]);
489
+ useEffect(function () {
490
+ var _a;
491
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.hyperlinkChange) {
492
+ context.hooks.hyperlinkChange();
493
+ }
494
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.hyperlink]);
393
495
  useEffect(function () {
394
496
  if (!_.isEmpty(context.luckysheetfile)) {
395
497
  onChange === null || onChange === void 0 ? void 0 : onChange(context.luckysheetfile);
@@ -289,7 +289,7 @@ var LinkEditCard = exports.LinkEditCard = function LinkEditCard(_a) {
289
289
  if (isButtonDisabled) return;
290
290
  _lodash.default.set(refs.globalCache, "linkCard.mouseEnter", false);
291
291
  setContext(function (draftCtx) {
292
- return (0, _fortuneCore.saveHyperlink)(draftCtx, r, c, linkText, linkType, linkAddress);
292
+ (0, _fortuneCore.saveHyperlink)(draftCtx, r, c, linkText, linkType, linkAddress);
293
293
  });
294
294
  }
295
295
  }, "Insert link"));
@@ -51,7 +51,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
51
51
  getCellsByRange: (range: Selection, options?: api.CommonOptions) => (Cell | null)[][];
52
52
  getHtmlByRange: (range: Range, options?: api.CommonOptions) => string | null;
53
53
  setSelection: (range: Range, options?: api.CommonOptions) => void;
54
- setCellValuesByRange: (data: any[][], range: SingleRange, options?: api.CommonOptions) => void;
54
+ setCellValuesByRange: (data: any[][], range: SingleRange, options?: api.CommonOptions, cellAfter?: boolean) => void;
55
55
  setCellFormatByRange: (attr: keyof Cell, value: any, range: Range | SingleRange, options?: api.CommonOptions) => void;
56
56
  mergeCells: (ranges: Range, type: string, options?: api.CommonOptions) => void;
57
57
  cancelMerge: (ranges: Range, options?: api.CommonOptions) => void;
@@ -283,12 +283,12 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
283
283
  return _fortuneCore.api.setSelection(draftCtx, range, options);
284
284
  });
285
285
  },
286
- setCellValuesByRange: function setCellValuesByRange(data, range, options) {
286
+ setCellValuesByRange: function setCellValuesByRange(data, range, options, cellAfter) {
287
287
  if (options === void 0) {
288
288
  options = {};
289
289
  }
290
290
  return setContext(function (draftCtx) {
291
- return _fortuneCore.api.setCellValuesByRange(draftCtx, data, range, cellInput, options);
291
+ return _fortuneCore.api.setCellValuesByRange(draftCtx, data, range, cellInput, options, cellAfter);
292
292
  });
293
293
  },
294
294
  setCellFormatByRange: function setCellFormatByRange(attr, value, range, options) {
@@ -58,7 +58,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
58
58
  getCellsByRange: (range: import("@fileverse-dev/fortune-core").Selection, options?: api.CommonOptions) => (import("@fileverse-dev/fortune-core").Cell | null)[][];
59
59
  getHtmlByRange: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => string | null;
60
60
  setSelection: (range: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
61
- setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
61
+ setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions, cellAfter?: boolean | undefined) => void;
62
62
  setCellFormatByRange: (attr: "error" | "rt" | "f" | "m" | "v" | "mc" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle, value: any, range: import("@fileverse-dev/fortune-core").Range | import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => void;
63
63
  mergeCells: (ranges: import("@fileverse-dev/fortune-core").Range, type: string, options?: api.CommonOptions) => void;
64
64
  cancelMerge: (ranges: import("@fileverse-dev/fortune-core").Range, options?: api.CommonOptions) => void;
@@ -399,6 +399,108 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
399
399
  refs: refs
400
400
  };
401
401
  }, [context, handleRedo, handleUndo, mergedSettings, refs, setContextWithProduce]);
402
+ (0, _react.useEffect)(function () {
403
+ var _a;
404
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.sheetLengthChange) {
405
+ context.hooks.sheetLengthChange();
406
+ }
407
+ }, [context.luckysheetfile.length]);
408
+ var currentSheet = (0, _react.useMemo)(function () {
409
+ var _a;
410
+ return (_a = context === null || context === void 0 ? void 0 : context.luckysheetfile) === null || _a === void 0 ? void 0 : _a.find(function (sheet) {
411
+ return sheet.id === (context === null || context === void 0 ? void 0 : context.currentSheetId);
412
+ });
413
+ }, [context === null || context === void 0 ? void 0 : context.luckysheetfile, context === null || context === void 0 ? void 0 : context.currentSheetId]);
414
+ (0, _react.useEffect)(function () {
415
+ var _a;
416
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.calcChainChange) {
417
+ context.hooks.calcChainChange();
418
+ }
419
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.calcChain]);
420
+ (0, _react.useEffect)(function () {
421
+ var _a;
422
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterImagesChange) {
423
+ context.hooks.afterImagesChange();
424
+ }
425
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.images]);
426
+ (0, _react.useEffect)(function () {
427
+ var _a;
428
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterIframesChange) {
429
+ context.hooks.afterIframesChange();
430
+ }
431
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.iframes]);
432
+ (0, _react.useEffect)(function () {
433
+ var _a;
434
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterFrozenChange) {
435
+ context.hooks.afterFrozenChange();
436
+ }
437
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.frozen]);
438
+ (0, _react.useEffect)(function () {
439
+ var _a;
440
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterOrderChanges) {
441
+ context.hooks.afterOrderChanges();
442
+ }
443
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.order]);
444
+ (0, _react.useEffect)(function () {
445
+ var _a;
446
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterConfigChanges) {
447
+ context.hooks.afterConfigChanges();
448
+ }
449
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.config]);
450
+ (0, _react.useEffect)(function () {
451
+ var _a;
452
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterColRowChanges) {
453
+ context.hooks.afterColRowChanges();
454
+ }
455
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.row, currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.column]);
456
+ (0, _react.useEffect)(function () {
457
+ var _a;
458
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.afterShowGridLinesChange) {
459
+ context.hooks.afterShowGridLinesChange();
460
+ }
461
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.showGridLines]);
462
+ (0, _react.useEffect)(function () {
463
+ var _a;
464
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.dataVerificationChange) {
465
+ context.hooks.dataVerificationChange();
466
+ }
467
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.dataVerification]);
468
+ (0, _react.useEffect)(function () {
469
+ var _a;
470
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.liveQueryChange) {
471
+ context.hooks.liveQueryChange();
472
+ }
473
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.liveQueryList]);
474
+ (0, _react.useEffect)(function () {
475
+ var _a;
476
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.imageListChange) {
477
+ context.hooks.imageListChange();
478
+ }
479
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.images]);
480
+ (0, _react.useEffect)(function () {
481
+ var _a;
482
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.iframeListChange) {
483
+ context.hooks.iframeListChange();
484
+ }
485
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.iframes]);
486
+ (0, _react.useEffect)(function () {
487
+ var _a;
488
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.conditionRulesChange) {
489
+ context.hooks.conditionRulesChange();
490
+ }
491
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.conditionRules]);
492
+ (0, _react.useEffect)(function () {
493
+ var _a;
494
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.conditionFormatChange) {
495
+ context.hooks.conditionFormatChange();
496
+ }
497
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.luckysheet_conditionformat_save]);
498
+ (0, _react.useEffect)(function () {
499
+ var _a;
500
+ if ((_a = context === null || context === void 0 ? void 0 : context.hooks) === null || _a === void 0 ? void 0 : _a.hyperlinkChange) {
501
+ context.hooks.hyperlinkChange();
502
+ }
503
+ }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.hyperlink]);
402
504
  (0, _react.useEffect)(function () {
403
505
  if (!_lodash.default.isEmpty(context.luckysheetfile)) {
404
506
  onChange === null || onChange === void 0 ? void 0 : onChange(context.luckysheetfile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.95-ens-1",
3
+ "version": "1.2.95-ydoc",
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.95-ens-1",
19
+ "@fileverse-dev/fortune-core": "1.2.95-ydoc",
20
20
  "@fileverse/ui": "5.0.0",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",