@fileverse-dev/fortune-react 1.1.10-live-query-v6 → 1.1.10-live-query-v8

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.
@@ -1,5 +1,5 @@
1
1
  import React, { useRef, useEffect, useContext, useCallback } from "react";
2
- import { Canvas, updateContextWithCanvas, updateContextWithSheetData, handleGlobalWheel, initFreeze } from "@fileverse-dev/fortune-core";
2
+ import { Canvas, updateContextWithCanvas, updateContextWithSheetData, handleGlobalWheel, initFreeze, cellFadeAnimator } from "@fileverse-dev/fortune-core";
3
3
  import "./index.css";
4
4
  import WorkbookContext from "../../context";
5
5
  import SheetOverlay from "../SheetOverlay";
@@ -45,103 +45,109 @@ var Sheet = function Sheet(_a) {
45
45
  initFreeze(context, refs.globalCache, context.currentSheetId);
46
46
  }, [refs.globalCache, sheet.frozen, context.currentSheetId, context.visibledatacolumn, context.visibledatarow]);
47
47
  useEffect(function () {
48
- var _a, _b, _c, _d, _e;
49
48
  if (context.groupValuesRefreshData.length > 0) {
50
49
  return;
51
50
  }
52
51
  var tableCanvas = new Canvas(refs.canvas.current, context);
53
- if (tableCanvas == null) return;
54
- var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[sheet.id];
55
- 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)) {
56
- var horizontalData = (_d = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _d === void 0 ? void 0 : _d.freezenhorizontaldata;
57
- var verticallData = (_e = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _e === void 0 ? void 0 : _e.freezenverticaldata;
58
- if (horizontalData && verticallData) {
59
- var horizontalPx = horizontalData[0],
60
- horizontalScrollTop = horizontalData[2];
61
- var verticalPx = verticallData[0],
62
- verticalScrollWidth = verticallData[2];
63
- tableCanvas.drawMain({
64
- scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
65
- scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
66
- offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth,
67
- offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
68
- clear: true
69
- });
70
- tableCanvas.drawMain({
71
- scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
72
- scrollHeight: horizontalScrollTop,
73
- drawHeight: horizontalPx,
74
- offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
75
- });
76
- tableCanvas.drawMain({
77
- scrollWidth: verticalScrollWidth,
78
- scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
79
- drawWidth: verticalPx,
80
- offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight
81
- });
82
- tableCanvas.drawMain({
83
- scrollWidth: verticalScrollWidth,
84
- scrollHeight: horizontalScrollTop,
85
- drawWidth: verticalPx,
86
- drawHeight: horizontalPx
87
- });
88
- tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
89
- tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
90
- tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
91
- tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
92
- tableCanvas.drawFreezeLine({
93
- horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2,
94
- verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
95
- });
96
- } else if (horizontalData) {
97
- var horizontalPx = horizontalData[0],
98
- horizontalScrollTop = horizontalData[2];
52
+ var repaint = function repaint() {
53
+ var _a, _b, _c, _d, _e;
54
+ var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[sheet.id];
55
+ 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)) {
56
+ var horizontalData = (_d = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _d === void 0 ? void 0 : _d.freezenhorizontaldata;
57
+ var verticallData = (_e = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _e === void 0 ? void 0 : _e.freezenverticaldata;
58
+ if (horizontalData && verticallData) {
59
+ var horizontalPx = horizontalData[0],
60
+ horizontalScrollTop = horizontalData[2];
61
+ var verticalPx = verticallData[0],
62
+ verticalScrollWidth = verticallData[2];
63
+ tableCanvas.drawMain({
64
+ scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
65
+ scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
66
+ offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth,
67
+ offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
68
+ clear: true
69
+ });
70
+ tableCanvas.drawMain({
71
+ scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
72
+ scrollHeight: horizontalScrollTop,
73
+ drawHeight: horizontalPx,
74
+ offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
75
+ });
76
+ tableCanvas.drawMain({
77
+ scrollWidth: verticalScrollWidth,
78
+ scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
79
+ drawWidth: verticalPx,
80
+ offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight
81
+ });
82
+ tableCanvas.drawMain({
83
+ scrollWidth: verticalScrollWidth,
84
+ scrollHeight: horizontalScrollTop,
85
+ drawWidth: verticalPx,
86
+ drawHeight: horizontalPx
87
+ });
88
+ tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
89
+ tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
90
+ tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
91
+ tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
92
+ tableCanvas.drawFreezeLine({
93
+ horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2,
94
+ verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
95
+ });
96
+ } else if (horizontalData) {
97
+ var horizontalPx = horizontalData[0],
98
+ horizontalScrollTop = horizontalData[2];
99
+ tableCanvas.drawMain({
100
+ scrollWidth: context.scrollLeft,
101
+ scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
102
+ offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
103
+ clear: true
104
+ });
105
+ tableCanvas.drawMain({
106
+ scrollWidth: context.scrollLeft,
107
+ scrollHeight: horizontalScrollTop,
108
+ drawHeight: horizontalPx
109
+ });
110
+ tableCanvas.drawColumnHeader(context.scrollLeft);
111
+ tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
112
+ tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
113
+ tableCanvas.drawFreezeLine({
114
+ horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2
115
+ });
116
+ } else if (verticallData) {
117
+ var verticalPx = verticallData[0],
118
+ verticalScrollWidth = verticallData[2];
119
+ tableCanvas.drawMain({
120
+ scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
121
+ scrollHeight: context.scrollTop,
122
+ offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
123
+ });
124
+ tableCanvas.drawMain({
125
+ scrollWidth: verticalScrollWidth,
126
+ scrollHeight: context.scrollTop,
127
+ drawWidth: verticalPx
128
+ });
129
+ tableCanvas.drawRowHeader(context.scrollTop);
130
+ tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
131
+ tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
132
+ tableCanvas.drawFreezeLine({
133
+ verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
134
+ });
135
+ }
136
+ } else {
99
137
  tableCanvas.drawMain({
100
138
  scrollWidth: context.scrollLeft,
101
- scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
102
- offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
139
+ scrollHeight: context.scrollTop,
103
140
  clear: true
104
141
  });
105
- tableCanvas.drawMain({
106
- scrollWidth: context.scrollLeft,
107
- scrollHeight: horizontalScrollTop,
108
- drawHeight: horizontalPx
109
- });
110
142
  tableCanvas.drawColumnHeader(context.scrollLeft);
111
- tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
112
- tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
113
- tableCanvas.drawFreezeLine({
114
- horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2
115
- });
116
- } else if (verticallData) {
117
- var verticalPx = verticallData[0],
118
- verticalScrollWidth = verticallData[2];
119
- tableCanvas.drawMain({
120
- scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
121
- scrollHeight: context.scrollTop,
122
- offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
123
- });
124
- tableCanvas.drawMain({
125
- scrollWidth: verticalScrollWidth,
126
- scrollHeight: context.scrollTop,
127
- drawWidth: verticalPx
128
- });
129
143
  tableCanvas.drawRowHeader(context.scrollTop);
130
- tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
131
- tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
132
- tableCanvas.drawFreezeLine({
133
- verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
134
- });
135
144
  }
136
- } else {
137
- tableCanvas.drawMain({
138
- scrollWidth: context.scrollLeft,
139
- scrollHeight: context.scrollTop,
140
- clear: true
141
- });
142
- tableCanvas.drawColumnHeader(context.scrollLeft);
143
- tableCanvas.drawRowHeader(context.scrollTop);
144
- }
145
+ };
146
+ repaint();
147
+ cellFadeAnimator.setOnTick(repaint);
148
+ return function () {
149
+ return cellFadeAnimator.setOnTick(null);
150
+ };
145
151
  }, [context, refs.canvas, refs.globalCache.freezen, setContext, sheet.id]);
146
152
  var onWheel = useCallback(function (e) {
147
153
  var _a, _b;
@@ -1,6 +1,6 @@
1
1
  import _ from "lodash";
2
2
  import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
3
- import { Popover, PopoverTrigger, PopoverContent, LucideIcon, Button } from '@fileverse/ui';
3
+ import { Popover, PopoverTrigger, PopoverContent, LucideIcon, Button } from "@fileverse/ui";
4
4
  import { useMediaQuery } from "usehooks-ts";
5
5
  import { updateCell, addSheet, calcSelectionInfo } from "@fileverse-dev/fortune-core";
6
6
  import WorkbookContext from "../../context";
@@ -9,30 +9,30 @@ import "./index.css";
9
9
  import SheetItem from "./SheetItem";
10
10
  import ZoomControl from "../ZoomControl";
11
11
  var STATS = [{
12
- label: "Average",
13
- value: 'average'
12
+ label: "Avg",
13
+ value: "average"
14
14
  }, {
15
15
  label: "Count",
16
- value: 'count'
16
+ value: "count"
17
17
  }, {
18
18
  label: "Max",
19
- value: 'max'
19
+ value: "max"
20
20
  }, {
21
21
  label: "Min",
22
- value: 'min'
22
+ value: "min"
23
23
  }, {
24
- label: "Number of Cells",
25
- value: 'numberC'
24
+ label: "Cells",
25
+ value: "numberC"
26
26
  }, {
27
27
  label: "Sum",
28
- value: 'sum'
28
+ value: "sum"
29
29
  }];
30
30
  var STATS_LABELS = {
31
- average: "Average",
31
+ average: "Avg",
32
32
  count: "Count",
33
33
  max: "Max",
34
34
  min: "Min",
35
- numberC: "Number of Cells",
35
+ numberC: "Cells",
36
36
  sum: "Sum"
37
37
  };
38
38
  var SheetTab = function SheetTab() {
@@ -63,7 +63,7 @@ var SheetTab = function SheetTab() {
63
63
  }),
64
64
  calInfo = _d[0],
65
65
  setCalInfo = _d[1];
66
- var _e = useState('sum'),
66
+ var _e = useState("sum"),
67
67
  selectedStat = _e[0],
68
68
  setSelectedStat = _e[1];
69
69
  var scrollDelta = 150;
@@ -82,13 +82,10 @@ var SheetTab = function SheetTab() {
82
82
  useEffect(function () {
83
83
  var selection = context.luckysheet_select_save;
84
84
  if (selection) {
85
- var re = calcSelectionInfo(context, 'en');
85
+ var re = calcSelectionInfo(context, "en");
86
86
  setCalInfo(re);
87
87
  }
88
88
  }, [context.luckysheet_select_save]);
89
- useEffect(function () {
90
- console.log(calInfo, "calInfo");
91
- }, [calInfo]);
92
89
  useEffect(function () {
93
90
  var tabCurrent = tabContainerRef.current;
94
91
  if (!tabCurrent) return;
@@ -242,35 +239,54 @@ var SheetTab = function SheetTab() {
242
239
  }, /*#__PURE__*/React.createElement(Button, {
243
240
  variant: "ghost",
244
241
  className: "w-full h-8 rounded p-2 m-1 text-left flex items-center justify-center transition mr-2"
245
- }, calInfo.count > 0 && /*#__PURE__*/React.createElement("p", {
242
+ }, calInfo.count > 0 && (/*#__PURE__*/React.createElement("p", {
246
243
  className: "text-body-sm"
247
- }, STATS_LABELS[selectedStat], ": ", calInfo[selectedStat]))), /*#__PURE__*/React.createElement(PopoverContent, {
244
+ }, STATS_LABELS[selectedStat], ":", " ", calInfo[selectedStat])))), /*#__PURE__*/React.createElement(PopoverContent, {
248
245
  align: "end",
249
246
  alignOffset: 0,
250
- className: "w-72 export-content color-border-default shadow-elevation-3",
247
+ className: "stats-content color-border-default shadow-elevation-3",
248
+ style: {
249
+ width: "fit-content!important"
250
+ },
251
251
  elevation: 2,
252
252
  side: "bottom",
253
253
  sideOffset: 4
254
254
  }, /*#__PURE__*/React.createElement("div", {
255
- className: "p-2 color-text-default color-border-default"
256
- }, /*#__PURE__*/React.createElement("h1", {
257
- className: "text-helper-text-sm color-text-secondary pl-2 mb-2"
258
- }, "Sort By"), STATS.map(function (option) {
255
+ className: "p-2 color-text-default color-border-default",
256
+ style: {
257
+ paddingRight: "15px"
258
+ }
259
+ }, STATS.map(function (option) {
259
260
  return /*#__PURE__*/React.createElement(Button, {
260
261
  variant: "ghost",
261
262
  key: option.value,
262
- className: "w-full h-8 rounded p-2 m-1 text-left flex items-center justify-between transition ".concat(selectedStat === option.value && 'bg-[#F8F9FA]'),
263
+ className: "w-full h-8 rounded p-2 m-1 text-left flex items-center justify-between transition mr-2 min-w-[50px] ".concat(selectedStat === option.value && "bg-[#F8F9FA]"),
263
264
  onClick: function onClick() {
264
265
  return setSelectedStat(option.value);
265
266
  }
266
267
  }, /*#__PURE__*/React.createElement("div", {
267
- className: "flex gap-2 items-center"
268
- }, selectedStat === option.value && (/*#__PURE__*/React.createElement(LucideIcon, {
268
+ className: "flex gap-2 items-center w-full"
269
+ }, selectedStat === option.value && (/*#__PURE__*/React.createElement("div", {
270
+ className: "w-[20px] h-[20px]"
271
+ }, /*#__PURE__*/React.createElement(LucideIcon, {
269
272
  name: "Check",
270
273
  size: "sm"
271
- })), /*#__PURE__*/React.createElement("p", {
272
- className: "text-body-sm"
273
- }, option.label, ": ", calInfo[option.value])));
274
+ }))), /*#__PURE__*/React.createElement("p", {
275
+ className: "text-body-sm color-text-secondary",
276
+ style: {
277
+ marginLeft: selectedStat === option.value ? 0 : '24px',
278
+ fontSize: "14px"
279
+ }
280
+ }, option.label, ":", " "), /*#__PURE__*/React.createElement("div", {
281
+ className: "flex w-full justify-end"
282
+ }, /*#__PURE__*/React.createElement("p", {
283
+ className: "font-body-sm-bold color-text-default",
284
+ style: {
285
+ marginLeft: selectedStat === option.value ? 0 : '24px',
286
+ fontSize: "14px",
287
+ fontWeight: 500
288
+ }
289
+ }, calInfo[option.value]))));
274
290
  })))), /*#__PURE__*/React.createElement(ZoomControl, null))));
275
291
  };
276
292
  export default SheetTab;
@@ -1,4 +1,4 @@
1
- import { api, Cell, Context, Op, Range, Selection, Presence, Settings, SingleRange, Sheet, CellMatrix, CellWithRowAndCol, GlobalCache } from "@fileverse-dev/fortune-core";
1
+ import { api, Cell, Context, Op, Range, Selection, Presence, Settings, SingleRange, Sheet, CellMatrix, CellWithRowAndCol, GlobalCache, LiveQueryData } from "@fileverse-dev/fortune-core";
2
2
  import { getCryptoPrice } from "../../utils/cryptoApi";
3
3
  import { SetContextOptions } from "../../context";
4
4
  export declare function generateAPIs(context: Context, setContext: (recipe: (ctx: Context) => void, options?: SetContextOptions) => void, handleUndo: () => void, handleRedo: () => void, settings: Required<Settings>, cellInput: HTMLDivElement | null, scrollbarX: HTMLDivElement | null, scrollbarY: HTMLDivElement | null, globalCache: GlobalCache | null): {
@@ -9,6 +9,8 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
9
9
  }) => any;
10
10
  onboardingActiveCell: (functionName: string) => void;
11
11
  initializeComment: (row: number, column: number) => void;
12
+ updateSheetLiveQueryList: (subsheetIndex: number, _data: LiveQueryData) => void;
13
+ removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
12
14
  setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
13
15
  type?: keyof Cell;
14
16
  }) => void;
@@ -109,6 +111,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
109
111
  column_focus: number;
110
112
  } | undefined;
111
113
  } | undefined;
114
+ liveQueryList?: Record<string, LiveQueryData> | undefined;
112
115
  };
113
116
  addSheet: () => void;
114
117
  deleteSheet: (options?: api.CommonOptions) => void;
@@ -1,3 +1,13 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6
+ }
7
+ return t;
8
+ };
9
+ return __assign.apply(this, arguments);
10
+ };
1
11
  import { addSheet, api, deleteRowCol, deleteSheet, insertRowCol, opToPatch, createFilterOptions, getSheetIndex, locale, setCaretPosition, newComment } from "@fileverse-dev/fortune-core";
2
12
  import { applyPatches } from "immer";
3
13
  import _ from "lodash";
@@ -103,6 +113,24 @@ export function generateAPIs(context, setContext, handleUndo, handleRedo, settin
103
113
  newComment(ctx, undefined, row, column);
104
114
  });
105
115
  },
116
+ updateSheetLiveQueryList: function updateSheetLiveQueryList(subsheetIndex, _data) {
117
+ setContext(function (ctx) {
118
+ var _a;
119
+ var previousLiveQuery = ctx.luckysheetfile[subsheetIndex].liveQueryList;
120
+ ctx.luckysheetfile[subsheetIndex] = __assign(__assign({}, ctx.luckysheetfile[subsheetIndex]), {
121
+ liveQueryList: __assign(__assign({}, previousLiveQuery), (_a = {}, _a["".concat(_data.data.id)] = _data, _a))
122
+ });
123
+ });
124
+ },
125
+ removeFromLiveQueryList: function removeFromLiveQueryList(subSheetIndex, id) {
126
+ setContext(function (ctx) {
127
+ var previousLiveQuery = __assign({}, ctx.luckysheetfile[subSheetIndex].liveQueryList);
128
+ previousLiveQuery === null || previousLiveQuery === void 0 ? true : delete previousLiveQuery[id];
129
+ ctx.luckysheetfile[subSheetIndex] = __assign(__assign({}, ctx.luckysheetfile[subSheetIndex]), {
130
+ liveQueryList: previousLiveQuery
131
+ });
132
+ });
133
+ },
106
134
  setCellValue: function setCellValue(row, column, value, options) {
107
135
  if (options === void 0) {
108
136
  options = {};
@@ -16,6 +16,8 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
16
16
  }) => any;
17
17
  onboardingActiveCell: (functionName: string) => void;
18
18
  initializeComment: (row: number, column: number) => void;
19
+ updateSheetLiveQueryList: (subsheetIndex: number, _data: import("@fileverse-dev/fortune-core").LiveQueryData) => void;
20
+ removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
19
21
  setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
20
22
  type?: "rt" | "m" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
21
23
  }) => void;
@@ -116,6 +118,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
116
118
  column_focus: number;
117
119
  } | undefined;
118
120
  } | undefined;
121
+ liveQueryList?: Record<string, import("@fileverse-dev/fortune-core").LiveQueryData> | undefined;
119
122
  };
120
123
  addSheet: () => void;
121
124
  deleteSheet: (options?: api.CommonOptions) => void;
@@ -2,4 +2,5 @@ import Workbook from "./Workbook";
2
2
  export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from "@fileverse-dev/formulajs/crypto-constants";
3
3
  export { Workbook };
4
4
  export type { WorkbookInstance } from "./Workbook";
5
- export type { Cell, Sheet } from "@fileverse-dev/fortune-core";
5
+ export type { Cell, Sheet, LiveQueryData } from "@fileverse-dev/fortune-core";
6
+ export { markCellChanged as animateChangedCell } from "@fileverse-dev/fortune-core";
@@ -1,3 +1,4 @@
1
1
  import Workbook from "./Workbook";
2
2
  export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY } from "@fileverse-dev/formulajs/crypto-constants";
3
- export { Workbook };
3
+ export { Workbook };
4
+ export { markCellChanged as animateChangedCell } from "@fileverse-dev/fortune-core";
@@ -54,103 +54,109 @@ var Sheet = function Sheet(_a) {
54
54
  (0, _fortuneCore.initFreeze)(context, refs.globalCache, context.currentSheetId);
55
55
  }, [refs.globalCache, sheet.frozen, context.currentSheetId, context.visibledatacolumn, context.visibledatarow]);
56
56
  (0, _react.useEffect)(function () {
57
- var _a, _b, _c, _d, _e;
58
57
  if (context.groupValuesRefreshData.length > 0) {
59
58
  return;
60
59
  }
61
60
  var tableCanvas = new _fortuneCore.Canvas(refs.canvas.current, context);
62
- if (tableCanvas == null) return;
63
- var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[sheet.id];
64
- 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)) {
65
- var horizontalData = (_d = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _d === void 0 ? void 0 : _d.freezenhorizontaldata;
66
- var verticallData = (_e = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _e === void 0 ? void 0 : _e.freezenverticaldata;
67
- if (horizontalData && verticallData) {
68
- var horizontalPx = horizontalData[0],
69
- horizontalScrollTop = horizontalData[2];
70
- var verticalPx = verticallData[0],
71
- verticalScrollWidth = verticallData[2];
72
- tableCanvas.drawMain({
73
- scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
74
- scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
75
- offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth,
76
- offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
77
- clear: true
78
- });
79
- tableCanvas.drawMain({
80
- scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
81
- scrollHeight: horizontalScrollTop,
82
- drawHeight: horizontalPx,
83
- offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
84
- });
85
- tableCanvas.drawMain({
86
- scrollWidth: verticalScrollWidth,
87
- scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
88
- drawWidth: verticalPx,
89
- offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight
90
- });
91
- tableCanvas.drawMain({
92
- scrollWidth: verticalScrollWidth,
93
- scrollHeight: horizontalScrollTop,
94
- drawWidth: verticalPx,
95
- drawHeight: horizontalPx
96
- });
97
- tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
98
- tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
99
- tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
100
- tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
101
- tableCanvas.drawFreezeLine({
102
- horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2,
103
- verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
104
- });
105
- } else if (horizontalData) {
106
- var horizontalPx = horizontalData[0],
107
- horizontalScrollTop = horizontalData[2];
61
+ var repaint = function repaint() {
62
+ var _a, _b, _c, _d, _e;
63
+ var freeze = (_a = refs.globalCache.freezen) === null || _a === void 0 ? void 0 : _a[sheet.id];
64
+ 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)) {
65
+ var horizontalData = (_d = freeze === null || freeze === void 0 ? void 0 : freeze.horizontal) === null || _d === void 0 ? void 0 : _d.freezenhorizontaldata;
66
+ var verticallData = (_e = freeze === null || freeze === void 0 ? void 0 : freeze.vertical) === null || _e === void 0 ? void 0 : _e.freezenverticaldata;
67
+ if (horizontalData && verticallData) {
68
+ var horizontalPx = horizontalData[0],
69
+ horizontalScrollTop = horizontalData[2];
70
+ var verticalPx = verticallData[0],
71
+ verticalScrollWidth = verticallData[2];
72
+ tableCanvas.drawMain({
73
+ scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
74
+ scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
75
+ offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth,
76
+ offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
77
+ clear: true
78
+ });
79
+ tableCanvas.drawMain({
80
+ scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
81
+ scrollHeight: horizontalScrollTop,
82
+ drawHeight: horizontalPx,
83
+ offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
84
+ });
85
+ tableCanvas.drawMain({
86
+ scrollWidth: verticalScrollWidth,
87
+ scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
88
+ drawWidth: verticalPx,
89
+ offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight
90
+ });
91
+ tableCanvas.drawMain({
92
+ scrollWidth: verticalScrollWidth,
93
+ scrollHeight: horizontalScrollTop,
94
+ drawWidth: verticalPx,
95
+ drawHeight: horizontalPx
96
+ });
97
+ tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
98
+ tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
99
+ tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
100
+ tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
101
+ tableCanvas.drawFreezeLine({
102
+ horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2,
103
+ verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
104
+ });
105
+ } else if (horizontalData) {
106
+ var horizontalPx = horizontalData[0],
107
+ horizontalScrollTop = horizontalData[2];
108
+ tableCanvas.drawMain({
109
+ scrollWidth: context.scrollLeft,
110
+ scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
111
+ offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
112
+ clear: true
113
+ });
114
+ tableCanvas.drawMain({
115
+ scrollWidth: context.scrollLeft,
116
+ scrollHeight: horizontalScrollTop,
117
+ drawHeight: horizontalPx
118
+ });
119
+ tableCanvas.drawColumnHeader(context.scrollLeft);
120
+ tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
121
+ tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
122
+ tableCanvas.drawFreezeLine({
123
+ horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2
124
+ });
125
+ } else if (verticallData) {
126
+ var verticalPx = verticallData[0],
127
+ verticalScrollWidth = verticallData[2];
128
+ tableCanvas.drawMain({
129
+ scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
130
+ scrollHeight: context.scrollTop,
131
+ offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
132
+ });
133
+ tableCanvas.drawMain({
134
+ scrollWidth: verticalScrollWidth,
135
+ scrollHeight: context.scrollTop,
136
+ drawWidth: verticalPx
137
+ });
138
+ tableCanvas.drawRowHeader(context.scrollTop);
139
+ tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
140
+ tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
141
+ tableCanvas.drawFreezeLine({
142
+ verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
143
+ });
144
+ }
145
+ } else {
108
146
  tableCanvas.drawMain({
109
147
  scrollWidth: context.scrollLeft,
110
- scrollHeight: context.scrollTop + horizontalPx - horizontalScrollTop,
111
- offsetTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight,
148
+ scrollHeight: context.scrollTop,
112
149
  clear: true
113
150
  });
114
- tableCanvas.drawMain({
115
- scrollWidth: context.scrollLeft,
116
- scrollHeight: horizontalScrollTop,
117
- drawHeight: horizontalPx
118
- });
119
151
  tableCanvas.drawColumnHeader(context.scrollLeft);
120
- tableCanvas.drawRowHeader(context.scrollTop + horizontalPx - horizontalScrollTop, undefined, horizontalPx - horizontalScrollTop + context.columnHeaderHeight);
121
- tableCanvas.drawRowHeader(horizontalScrollTop, horizontalPx);
122
- tableCanvas.drawFreezeLine({
123
- horizontalTop: horizontalPx - horizontalScrollTop + context.columnHeaderHeight - 2
124
- });
125
- } else if (verticallData) {
126
- var verticalPx = verticallData[0],
127
- verticalScrollWidth = verticallData[2];
128
- tableCanvas.drawMain({
129
- scrollWidth: context.scrollLeft + verticalPx - verticalScrollWidth,
130
- scrollHeight: context.scrollTop,
131
- offsetLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth
132
- });
133
- tableCanvas.drawMain({
134
- scrollWidth: verticalScrollWidth,
135
- scrollHeight: context.scrollTop,
136
- drawWidth: verticalPx
137
- });
138
152
  tableCanvas.drawRowHeader(context.scrollTop);
139
- tableCanvas.drawColumnHeader(context.scrollLeft + verticalPx - verticalScrollWidth, undefined, verticalPx - verticalScrollWidth + context.rowHeaderWidth);
140
- tableCanvas.drawColumnHeader(verticalScrollWidth, verticalPx);
141
- tableCanvas.drawFreezeLine({
142
- verticalLeft: verticalPx - verticalScrollWidth + context.rowHeaderWidth - 2
143
- });
144
153
  }
145
- } else {
146
- tableCanvas.drawMain({
147
- scrollWidth: context.scrollLeft,
148
- scrollHeight: context.scrollTop,
149
- clear: true
150
- });
151
- tableCanvas.drawColumnHeader(context.scrollLeft);
152
- tableCanvas.drawRowHeader(context.scrollTop);
153
- }
154
+ };
155
+ repaint();
156
+ _fortuneCore.cellFadeAnimator.setOnTick(repaint);
157
+ return function () {
158
+ return _fortuneCore.cellFadeAnimator.setOnTick(null);
159
+ };
154
160
  }, [context, refs.canvas, refs.globalCache.freezen, setContext, sheet.id]);
155
161
  var onWheel = (0, _react.useCallback)(function (e) {
156
162
  var _a, _b;
@@ -18,30 +18,30 @@ var _ZoomControl = _interopRequireDefault(require("../ZoomControl"));
18
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
19
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
20
  var STATS = [{
21
- label: "Average",
22
- value: 'average'
21
+ label: "Avg",
22
+ value: "average"
23
23
  }, {
24
24
  label: "Count",
25
- value: 'count'
25
+ value: "count"
26
26
  }, {
27
27
  label: "Max",
28
- value: 'max'
28
+ value: "max"
29
29
  }, {
30
30
  label: "Min",
31
- value: 'min'
31
+ value: "min"
32
32
  }, {
33
- label: "Number of Cells",
34
- value: 'numberC'
33
+ label: "Cells",
34
+ value: "numberC"
35
35
  }, {
36
36
  label: "Sum",
37
- value: 'sum'
37
+ value: "sum"
38
38
  }];
39
39
  var STATS_LABELS = {
40
- average: "Average",
40
+ average: "Avg",
41
41
  count: "Count",
42
42
  max: "Max",
43
43
  min: "Min",
44
- numberC: "Number of Cells",
44
+ numberC: "Cells",
45
45
  sum: "Sum"
46
46
  };
47
47
  var SheetTab = function SheetTab() {
@@ -72,7 +72,7 @@ var SheetTab = function SheetTab() {
72
72
  }),
73
73
  calInfo = _d[0],
74
74
  setCalInfo = _d[1];
75
- var _e = (0, _react.useState)('sum'),
75
+ var _e = (0, _react.useState)("sum"),
76
76
  selectedStat = _e[0],
77
77
  setSelectedStat = _e[1];
78
78
  var scrollDelta = 150;
@@ -91,13 +91,10 @@ var SheetTab = function SheetTab() {
91
91
  (0, _react.useEffect)(function () {
92
92
  var selection = context.luckysheet_select_save;
93
93
  if (selection) {
94
- var re = (0, _fortuneCore.calcSelectionInfo)(context, 'en');
94
+ var re = (0, _fortuneCore.calcSelectionInfo)(context, "en");
95
95
  setCalInfo(re);
96
96
  }
97
97
  }, [context.luckysheet_select_save]);
98
- (0, _react.useEffect)(function () {
99
- console.log(calInfo, "calInfo");
100
- }, [calInfo]);
101
98
  (0, _react.useEffect)(function () {
102
99
  var tabCurrent = tabContainerRef.current;
103
100
  if (!tabCurrent) return;
@@ -251,35 +248,54 @@ var SheetTab = function SheetTab() {
251
248
  }, /*#__PURE__*/_react.default.createElement(_ui.Button, {
252
249
  variant: "ghost",
253
250
  className: "w-full h-8 rounded p-2 m-1 text-left flex items-center justify-center transition mr-2"
254
- }, calInfo.count > 0 && /*#__PURE__*/_react.default.createElement("p", {
251
+ }, calInfo.count > 0 && (/*#__PURE__*/_react.default.createElement("p", {
255
252
  className: "text-body-sm"
256
- }, STATS_LABELS[selectedStat], ": ", calInfo[selectedStat]))), /*#__PURE__*/_react.default.createElement(_ui.PopoverContent, {
253
+ }, STATS_LABELS[selectedStat], ":", " ", calInfo[selectedStat])))), /*#__PURE__*/_react.default.createElement(_ui.PopoverContent, {
257
254
  align: "end",
258
255
  alignOffset: 0,
259
- className: "w-72 export-content color-border-default shadow-elevation-3",
256
+ className: "stats-content color-border-default shadow-elevation-3",
257
+ style: {
258
+ width: "fit-content!important"
259
+ },
260
260
  elevation: 2,
261
261
  side: "bottom",
262
262
  sideOffset: 4
263
263
  }, /*#__PURE__*/_react.default.createElement("div", {
264
- className: "p-2 color-text-default color-border-default"
265
- }, /*#__PURE__*/_react.default.createElement("h1", {
266
- className: "text-helper-text-sm color-text-secondary pl-2 mb-2"
267
- }, "Sort By"), STATS.map(function (option) {
264
+ className: "p-2 color-text-default color-border-default",
265
+ style: {
266
+ paddingRight: "15px"
267
+ }
268
+ }, STATS.map(function (option) {
268
269
  return /*#__PURE__*/_react.default.createElement(_ui.Button, {
269
270
  variant: "ghost",
270
271
  key: option.value,
271
- className: "w-full h-8 rounded p-2 m-1 text-left flex items-center justify-between transition ".concat(selectedStat === option.value && 'bg-[#F8F9FA]'),
272
+ className: "w-full h-8 rounded p-2 m-1 text-left flex items-center justify-between transition mr-2 min-w-[50px] ".concat(selectedStat === option.value && "bg-[#F8F9FA]"),
272
273
  onClick: function onClick() {
273
274
  return setSelectedStat(option.value);
274
275
  }
275
276
  }, /*#__PURE__*/_react.default.createElement("div", {
276
- className: "flex gap-2 items-center"
277
- }, selectedStat === option.value && (/*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
277
+ className: "flex gap-2 items-center w-full"
278
+ }, selectedStat === option.value && (/*#__PURE__*/_react.default.createElement("div", {
279
+ className: "w-[20px] h-[20px]"
280
+ }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
278
281
  name: "Check",
279
282
  size: "sm"
280
- })), /*#__PURE__*/_react.default.createElement("p", {
281
- className: "text-body-sm"
282
- }, option.label, ": ", calInfo[option.value])));
283
+ }))), /*#__PURE__*/_react.default.createElement("p", {
284
+ className: "text-body-sm color-text-secondary",
285
+ style: {
286
+ marginLeft: selectedStat === option.value ? 0 : '24px',
287
+ fontSize: "14px"
288
+ }
289
+ }, option.label, ":", " "), /*#__PURE__*/_react.default.createElement("div", {
290
+ className: "flex w-full justify-end"
291
+ }, /*#__PURE__*/_react.default.createElement("p", {
292
+ className: "font-body-sm-bold color-text-default",
293
+ style: {
294
+ marginLeft: selectedStat === option.value ? 0 : '24px',
295
+ fontSize: "14px",
296
+ fontWeight: 500
297
+ }
298
+ }, calInfo[option.value]))));
283
299
  })))), /*#__PURE__*/_react.default.createElement(_ZoomControl.default, null))));
284
300
  };
285
301
  var _default = exports.default = SheetTab;
@@ -1,4 +1,4 @@
1
- import { api, Cell, Context, Op, Range, Selection, Presence, Settings, SingleRange, Sheet, CellMatrix, CellWithRowAndCol, GlobalCache } from "@fileverse-dev/fortune-core";
1
+ import { api, Cell, Context, Op, Range, Selection, Presence, Settings, SingleRange, Sheet, CellMatrix, CellWithRowAndCol, GlobalCache, LiveQueryData } from "@fileverse-dev/fortune-core";
2
2
  import { getCryptoPrice } from "../../utils/cryptoApi";
3
3
  import { SetContextOptions } from "../../context";
4
4
  export declare function generateAPIs(context: Context, setContext: (recipe: (ctx: Context) => void, options?: SetContextOptions) => void, handleUndo: () => void, handleRedo: () => void, settings: Required<Settings>, cellInput: HTMLDivElement | null, scrollbarX: HTMLDivElement | null, scrollbarY: HTMLDivElement | null, globalCache: GlobalCache | null): {
@@ -9,6 +9,8 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
9
9
  }) => any;
10
10
  onboardingActiveCell: (functionName: string) => void;
11
11
  initializeComment: (row: number, column: number) => void;
12
+ updateSheetLiveQueryList: (subsheetIndex: number, _data: LiveQueryData) => void;
13
+ removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
12
14
  setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
13
15
  type?: keyof Cell;
14
16
  }) => void;
@@ -109,6 +111,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
109
111
  column_focus: number;
110
112
  } | undefined;
111
113
  } | undefined;
114
+ liveQueryList?: Record<string, LiveQueryData> | undefined;
112
115
  };
113
116
  addSheet: () => void;
114
117
  deleteSheet: (options?: api.CommonOptions) => void;
@@ -9,6 +9,16 @@ var _immer = require("immer");
9
9
  var _lodash = _interopRequireDefault(require("lodash"));
10
10
  var _cryptoApi = require("../../utils/cryptoApi");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ var __assign = void 0 && (void 0).__assign || function () {
13
+ __assign = Object.assign || function (t) {
14
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
15
+ s = arguments[i];
16
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
17
+ }
18
+ return t;
19
+ };
20
+ return __assign.apply(this, arguments);
21
+ };
12
22
  function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY, globalCache) {
13
23
  return {
14
24
  applyOp: function applyOp(ops) {
@@ -110,6 +120,24 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
110
120
  (0, _fortuneCore.newComment)(ctx, undefined, row, column);
111
121
  });
112
122
  },
123
+ updateSheetLiveQueryList: function updateSheetLiveQueryList(subsheetIndex, _data) {
124
+ setContext(function (ctx) {
125
+ var _a;
126
+ var previousLiveQuery = ctx.luckysheetfile[subsheetIndex].liveQueryList;
127
+ ctx.luckysheetfile[subsheetIndex] = __assign(__assign({}, ctx.luckysheetfile[subsheetIndex]), {
128
+ liveQueryList: __assign(__assign({}, previousLiveQuery), (_a = {}, _a["".concat(_data.data.id)] = _data, _a))
129
+ });
130
+ });
131
+ },
132
+ removeFromLiveQueryList: function removeFromLiveQueryList(subSheetIndex, id) {
133
+ setContext(function (ctx) {
134
+ var previousLiveQuery = __assign({}, ctx.luckysheetfile[subSheetIndex].liveQueryList);
135
+ previousLiveQuery === null || previousLiveQuery === void 0 ? true : delete previousLiveQuery[id];
136
+ ctx.luckysheetfile[subSheetIndex] = __assign(__assign({}, ctx.luckysheetfile[subSheetIndex]), {
137
+ liveQueryList: previousLiveQuery
138
+ });
139
+ });
140
+ },
113
141
  setCellValue: function setCellValue(row, column, value, options) {
114
142
  if (options === void 0) {
115
143
  options = {};
@@ -16,6 +16,8 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
16
16
  }) => any;
17
17
  onboardingActiveCell: (functionName: string) => void;
18
18
  initializeComment: (row: number, column: number) => void;
19
+ updateSheetLiveQueryList: (subsheetIndex: number, _data: import("@fileverse-dev/fortune-core").LiveQueryData) => void;
20
+ removeFromLiveQueryList: (subSheetIndex: number, id: string) => void;
19
21
  setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
20
22
  type?: "rt" | "m" | "v" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "baseValue" | "baseCurrency" | "baseCurrencyPrice" | "isDataBlockFormula" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
21
23
  }) => void;
@@ -116,6 +118,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
116
118
  column_focus: number;
117
119
  } | undefined;
118
120
  } | undefined;
121
+ liveQueryList?: Record<string, import("@fileverse-dev/fortune-core").LiveQueryData> | undefined;
119
122
  };
120
123
  addSheet: () => void;
121
124
  deleteSheet: (options?: api.CommonOptions) => void;
@@ -2,4 +2,5 @@ import Workbook from "./Workbook";
2
2
  export { ERROR_MESSAGES_FLAG, SERVICES_API_KEY, } from "@fileverse-dev/formulajs/crypto-constants";
3
3
  export { Workbook };
4
4
  export type { WorkbookInstance } from "./Workbook";
5
- export type { Cell, Sheet } from "@fileverse-dev/fortune-core";
5
+ export type { Cell, Sheet, LiveQueryData } from "@fileverse-dev/fortune-core";
6
+ export { markCellChanged as animateChangedCell } from "@fileverse-dev/fortune-core";
@@ -21,6 +21,13 @@ Object.defineProperty(exports, "Workbook", {
21
21
  return _Workbook.default;
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "animateChangedCell", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _fortuneCore.markCellChanged;
28
+ }
29
+ });
24
30
  var _Workbook = _interopRequireDefault(require("./Workbook"));
25
31
  var _cryptoConstants = require("@fileverse-dev/formulajs/crypto-constants");
32
+ var _fortuneCore = require("@fileverse-dev/fortune-core");
26
33
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.1.10-live-query-v6",
3
+ "version": "1.1.10-live-query-v8",
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.1.10-live-query-v6",
19
+ "@fileverse-dev/fortune-core": "1.1.10-live-query-v8",
20
20
  "@fileverse/ui": "^4.1.7-patch-21",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",