@fileverse-dev/fortune-core 1.3.10-yjs-4 → 1.3.10-yjs-5

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.
@@ -23,14 +23,35 @@ function getNullData(rlen, clen) {
23
23
  return arr;
24
24
  }
25
25
  function updateMoreCell(r, c, dataMatrix, ctx) {
26
+ var _a;
26
27
  if (ctx.allowEdit === false) return;
27
28
  var flowdata = (0, _context.getFlowdata)(ctx);
29
+ var cellChanges = [];
28
30
  dataMatrix.forEach(function (datas, i) {
29
31
  datas.forEach(function (data, j) {
32
+ var _a, _b, _c;
30
33
  var v = dataMatrix[i][j];
31
34
  (0, _cell.setCellValue)(ctx, r + i, c + j, flowdata, v);
35
+ if ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _a === void 0 ? void 0 : _a.updateCellYdoc) {
36
+ var rr = r + i;
37
+ var cc = c + j;
38
+ cellChanges.push({
39
+ sheetId: ctx.currentSheetId,
40
+ path: ["celldata"],
41
+ value: {
42
+ r: rr,
43
+ c: cc,
44
+ v: (_c = (_b = flowdata === null || flowdata === void 0 ? void 0 : flowdata[rr]) === null || _b === void 0 ? void 0 : _b[cc]) !== null && _c !== void 0 ? _c : null
45
+ },
46
+ key: "".concat(rr, "_").concat(cc),
47
+ type: "update"
48
+ });
49
+ }
32
50
  });
33
51
  });
52
+ if (cellChanges.length > 0 && ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _a === void 0 ? void 0 : _a.updateCellYdoc)) {
53
+ ctx.hooks.updateCellYdoc(cellChanges);
54
+ }
34
55
  }
35
56
  function getRegStr(regStr, splitSymbols) {
36
57
  regStr = "";
@@ -429,7 +429,8 @@ function activeFormulaInput(cellInput, fxInput, ctx, row_index, col_index, rowh,
429
429
  });
430
430
  }
431
431
  function backFormulaInput(d, r, c, rowh, columnh, formula, ctx) {
432
- var _a;
432
+ var _a, _b, _c;
433
+ var _d;
433
434
  var f = "=".concat(formula.toUpperCase(), "(").concat((0, _cell.getRangetxt)(ctx, ctx.currentSheetId, {
434
435
  row: rowh,
435
436
  column: columnh
@@ -440,7 +441,20 @@ function backFormulaInput(d, r, c, rowh, columnh, formula, ctx) {
440
441
  f: v[2]
441
442
  };
442
443
  (0, _cell.setCellValue)(ctx, r, c, d, value);
443
- (_a = ctx.formulaCache).execFunctionExist || (_a.execFunctionExist = []);
444
+ if ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _a === void 0 ? void 0 : _a.updateCellYdoc) {
445
+ ctx.hooks.updateCellYdoc([{
446
+ sheetId: ctx.currentSheetId,
447
+ path: ["celldata"],
448
+ value: {
449
+ r: r,
450
+ c: c,
451
+ v: (_c = (_b = d === null || d === void 0 ? void 0 : d[r]) === null || _b === void 0 ? void 0 : _b[c]) !== null && _c !== void 0 ? _c : null
452
+ },
453
+ key: "".concat(r, "_").concat(c),
454
+ type: "update"
455
+ }]);
456
+ }
457
+ (_d = ctx.formulaCache).execFunctionExist || (_d.execFunctionExist = []);
444
458
  ctx.formulaCache.execFunctionExist.push({
445
459
  r: r,
446
460
  c: c,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.3.10-yjs-4",
3
+ "version": "1.3.10-yjs-5",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",