@fileverse-dev/fortune-core 1.2.90-ydoc-13 → 1.2.90-ydoc-14

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.
@@ -208,14 +208,14 @@ var handleFormulaOnPaste = function handleFormulaOnPaste(ctx, d) {
208
208
  d[r] = x;
209
209
  changes.push({
210
210
  sheetId: ctx.currentSheetId,
211
- path: ['celldata'],
211
+ path: ["celldata"],
212
212
  value: {
213
213
  r: r,
214
214
  c: c,
215
215
  v: d[r][c]
216
216
  },
217
- key: r + '_' + c,
218
- type: 'update'
217
+ key: "".concat(r, "_").concat(c),
218
+ type: "update"
219
219
  });
220
220
  }
221
221
  }
@@ -323,14 +323,14 @@ function pasteHandler(ctx, data, borderInfo) {
323
323
  }
324
324
  changes.push({
325
325
  sheetId: ctx.currentSheetId,
326
- path: ['celldata'],
326
+ path: ["celldata"],
327
327
  value: {
328
328
  r: h,
329
329
  c: c,
330
330
  v: d[h][c]
331
331
  },
332
- key: h + '_' + c,
333
- type: 'update'
332
+ key: "".concat(h, "_").concat(c),
333
+ type: "update"
334
334
  });
335
335
  }
336
336
  d[h] = x;
@@ -465,14 +465,14 @@ function pasteHandler(ctx, data, borderInfo) {
465
465
  }
466
466
  changes.push(changes.push({
467
467
  sheetId: ctx.currentSheetId,
468
- path: ['celldata'],
468
+ path: ["celldata"],
469
469
  value: {
470
470
  r: r,
471
471
  c: c,
472
472
  v: d[r][c]
473
473
  },
474
- key: r + '_' + c,
475
- type: 'update'
474
+ key: "".concat(r, "_").concat(c),
475
+ type: "update"
476
476
  }));
477
477
  }
478
478
  d[r + curR] = x;
@@ -39,6 +39,7 @@ export function getCellHyperlink(ctx, r, c) {
39
39
  return undefined;
40
40
  }
41
41
  export function saveHyperlink(ctx, r, c, linkText, linkType, linkAddress) {
42
+ var _a, _b;
42
43
  var sheetIndex = getSheetIndex(ctx, ctx.currentSheetId);
43
44
  var flowdata = getFlowdata(ctx);
44
45
  if (sheetIndex != null && flowdata != null && linkType && linkAddress) {
@@ -59,6 +60,19 @@ export function saveHyperlink(ctx, r, c, linkText, linkType, linkAddress) {
59
60
  };
60
61
  flowdata[r][c] = cell;
61
62
  ctx.linkCard = undefined;
63
+ if ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _a === void 0 ? void 0 : _a.updateCellYdoc) {
64
+ (_b = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _b === void 0 ? void 0 : _b.updateCellYdoc([{
65
+ sheetId: ctx.currentSheetId,
66
+ path: ["celldata"],
67
+ value: {
68
+ r: r,
69
+ c: c,
70
+ v: cell
71
+ },
72
+ key: "".concat(r, "_").concat(c),
73
+ type: "update"
74
+ }]);
75
+ }
62
76
  }
63
77
  }
64
78
  export function removeHyperlink(ctx, r, c) {
@@ -1559,7 +1559,7 @@ export function deleteSelectedCellText(ctx) {
1559
1559
  }
1560
1560
  changes.push({
1561
1561
  sheetId: ctx.currentSheetId,
1562
- path: ['celldata'],
1562
+ path: ["celldata"],
1563
1563
  value: {
1564
1564
  r: r,
1565
1565
  c: c,
@@ -76,14 +76,14 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
76
76
  }
77
77
  changes.push({
78
78
  sheetId: ctx.currentSheetId,
79
- path: ['celldata'],
79
+ path: ["celldata"],
80
80
  value: {
81
81
  r: r,
82
82
  c: c,
83
83
  v: d[r][c]
84
84
  },
85
- key: r + '_' + c,
86
- type: 'update'
85
+ key: "".concat(r, "_").concat(c),
86
+ type: "update"
87
87
  });
88
88
  }
89
89
  if ((_x = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _x === void 0 ? void 0 : _x.updateCellYdoc) {
@@ -215,7 +215,7 @@ export function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_
215
215
  }
216
216
  changes.push({
217
217
  sheetId: ctx.currentSheetId,
218
- path: ['celldata'],
218
+ path: ["celldata"],
219
219
  value: {
220
220
  r: r,
221
221
  c: c,
package/es/settings.d.ts CHANGED
@@ -5,7 +5,7 @@ type SheetChangePath = {
5
5
  path: string[];
6
6
  key?: string;
7
7
  value: any;
8
- type?: 'update' | 'delete';
8
+ type?: "update" | "delete";
9
9
  };
10
10
  export type Hooks = {
11
11
  calcChainChange?: () => void;
@@ -221,14 +221,14 @@ var handleFormulaOnPaste = function handleFormulaOnPaste(ctx, d) {
221
221
  d[r] = x;
222
222
  changes.push({
223
223
  sheetId: ctx.currentSheetId,
224
- path: ['celldata'],
224
+ path: ["celldata"],
225
225
  value: {
226
226
  r: r,
227
227
  c: c,
228
228
  v: d[r][c]
229
229
  },
230
- key: r + '_' + c,
231
- type: 'update'
230
+ key: "".concat(r, "_").concat(c),
231
+ type: "update"
232
232
  });
233
233
  }
234
234
  }
@@ -336,14 +336,14 @@ function pasteHandler(ctx, data, borderInfo) {
336
336
  }
337
337
  changes.push({
338
338
  sheetId: ctx.currentSheetId,
339
- path: ['celldata'],
339
+ path: ["celldata"],
340
340
  value: {
341
341
  r: h,
342
342
  c: c,
343
343
  v: d[h][c]
344
344
  },
345
- key: h + '_' + c,
346
- type: 'update'
345
+ key: "".concat(h, "_").concat(c),
346
+ type: "update"
347
347
  });
348
348
  }
349
349
  d[h] = x;
@@ -478,14 +478,14 @@ function pasteHandler(ctx, data, borderInfo) {
478
478
  }
479
479
  changes.push(changes.push({
480
480
  sheetId: ctx.currentSheetId,
481
- path: ['celldata'],
481
+ path: ["celldata"],
482
482
  value: {
483
483
  r: r,
484
484
  c: c,
485
485
  v: d[r][c]
486
486
  },
487
- key: r + '_' + c,
488
- type: 'update'
487
+ key: "".concat(r, "_").concat(c),
488
+ type: "update"
489
489
  }));
490
490
  }
491
491
  d[r + curR] = x;
@@ -55,6 +55,7 @@ function getCellHyperlink(ctx, r, c) {
55
55
  return undefined;
56
56
  }
57
57
  function saveHyperlink(ctx, r, c, linkText, linkType, linkAddress) {
58
+ var _a, _b;
58
59
  var sheetIndex = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
59
60
  var flowdata = (0, _context.getFlowdata)(ctx);
60
61
  if (sheetIndex != null && flowdata != null && linkType && linkAddress) {
@@ -75,6 +76,19 @@ function saveHyperlink(ctx, r, c, linkText, linkType, linkAddress) {
75
76
  };
76
77
  flowdata[r][c] = cell;
77
78
  ctx.linkCard = undefined;
79
+ if ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _a === void 0 ? void 0 : _a.updateCellYdoc) {
80
+ (_b = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _b === void 0 ? void 0 : _b.updateCellYdoc([{
81
+ sheetId: ctx.currentSheetId,
82
+ path: ["celldata"],
83
+ value: {
84
+ r: r,
85
+ c: c,
86
+ v: cell
87
+ },
88
+ key: "".concat(r, "_").concat(c),
89
+ type: "update"
90
+ }]);
91
+ }
78
92
  }
79
93
  }
80
94
  function removeHyperlink(ctx, r, c) {
@@ -1594,7 +1594,7 @@ function deleteSelectedCellText(ctx) {
1594
1594
  }
1595
1595
  changes.push({
1596
1596
  sheetId: ctx.currentSheetId,
1597
- path: ['celldata'],
1597
+ path: ["celldata"],
1598
1598
  value: {
1599
1599
  r: r,
1600
1600
  c: c,
@@ -109,14 +109,14 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
109
109
  }
110
110
  changes.push({
111
111
  sheetId: ctx.currentSheetId,
112
- path: ['celldata'],
112
+ path: ["celldata"],
113
113
  value: {
114
114
  r: r,
115
115
  c: c,
116
116
  v: d[r][c]
117
117
  },
118
- key: r + '_' + c,
119
- type: 'update'
118
+ key: "".concat(r, "_").concat(c),
119
+ type: "update"
120
120
  });
121
121
  }
122
122
  if ((_x = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _x === void 0 ? void 0 : _x.updateCellYdoc) {
@@ -248,7 +248,7 @@ function updateFormatCell(ctx, d, attr, foucsStatus, row_st, row_ed, col_st, col
248
248
  }
249
249
  changes.push({
250
250
  sheetId: ctx.currentSheetId,
251
- path: ['celldata'],
251
+ path: ["celldata"],
252
252
  value: {
253
253
  r: r,
254
254
  c: c,
package/lib/settings.d.ts CHANGED
@@ -5,7 +5,7 @@ type SheetChangePath = {
5
5
  path: string[];
6
6
  key?: string;
7
7
  value: any;
8
- type?: 'update' | 'delete';
8
+ type?: "update" | "delete";
9
9
  };
10
10
  export type Hooks = {
11
11
  calcChainChange?: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.2.90-ydoc-13",
3
+ "version": "1.2.90-ydoc-14",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",