@fileverse-dev/fortune-react 1.2.92-ydoc-2 → 1.2.93

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
- saveHyperlink(draftCtx, r, c, linkText, linkType, linkAddress);
283
+ return 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, cellAfter?: boolean) => void;
54
+ setCellValuesByRange: (data: any[][], range: SingleRange, options?: api.CommonOptions) => 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, cellAfter) {
279
+ setCellValuesByRange: function setCellValuesByRange(data, range, options) {
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, cellAfter);
284
+ return api.setCellValuesByRange(draftCtx, data, range, cellInput, options);
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, cellAfter?: boolean | undefined) => void;
61
+ setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => 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,66 +390,6 @@ 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.dataVerificationChange) {
414
- context.hooks.dataVerificationChange();
415
- }
416
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.dataVerification]);
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.liveQueryChange) {
420
- context.hooks.liveQueryChange();
421
- }
422
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.liveQueryList]);
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.imageListChange) {
426
- context.hooks.imageListChange();
427
- }
428
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.images]);
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.iframeListChange) {
432
- context.hooks.iframeListChange();
433
- }
434
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.iframes]);
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.conditionRulesChange) {
438
- context.hooks.conditionRulesChange();
439
- }
440
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.conditionRules]);
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.conditionFormatChange) {
444
- context.hooks.conditionFormatChange();
445
- }
446
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.luckysheet_conditionformat_save]);
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.hyperlinkChange) {
450
- context.hooks.hyperlinkChange();
451
- }
452
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.hyperlink]);
453
393
  useEffect(function () {
454
394
  if (!_.isEmpty(context.luckysheetfile)) {
455
395
  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
- (0, _fortuneCore.saveHyperlink)(draftCtx, r, c, linkText, linkType, linkAddress);
292
+ return (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, cellAfter?: boolean) => void;
54
+ setCellValuesByRange: (data: any[][], range: SingleRange, options?: api.CommonOptions) => 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, cellAfter) {
286
+ setCellValuesByRange: function setCellValuesByRange(data, range, options) {
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, cellAfter);
291
+ return _fortuneCore.api.setCellValuesByRange(draftCtx, data, range, cellInput, options);
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, cellAfter?: boolean | undefined) => void;
61
+ setCellValuesByRange: (data: any[][], range: import("@fileverse-dev/fortune-core").SingleRange, options?: api.CommonOptions) => 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,66 +399,6 @@ 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.dataVerificationChange) {
423
- context.hooks.dataVerificationChange();
424
- }
425
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.dataVerification]);
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.liveQueryChange) {
429
- context.hooks.liveQueryChange();
430
- }
431
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.liveQueryList]);
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.imageListChange) {
435
- context.hooks.imageListChange();
436
- }
437
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.images]);
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.iframeListChange) {
441
- context.hooks.iframeListChange();
442
- }
443
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.iframes]);
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.conditionRulesChange) {
447
- context.hooks.conditionRulesChange();
448
- }
449
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.conditionRules]);
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.conditionFormatChange) {
453
- context.hooks.conditionFormatChange();
454
- }
455
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.luckysheet_conditionformat_save]);
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.hyperlinkChange) {
459
- context.hooks.hyperlinkChange();
460
- }
461
- }, [currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.hyperlink]);
462
402
  (0, _react.useEffect)(function () {
463
403
  if (!_lodash.default.isEmpty(context.luckysheetfile)) {
464
404
  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.92-ydoc-2",
3
+ "version": "1.2.93",
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.92-yoc-2",
19
+ "@fileverse-dev/fortune-core": "1.2.93",
20
20
  "@fileverse/ui": "5.0.0",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",