@fileverse-dev/fortune-react 1.3.10 → 1.3.11-input-ref-1

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.
Files changed (29) hide show
  1. package/es/components/ContextMenu/index.js +1 -1
  2. package/es/components/FxEditor/index.js +200 -52
  3. package/es/components/SheetOverlay/InputBox.js +318 -150
  4. package/es/components/SheetOverlay/drag_and_drop/column-helpers.js +25 -1
  5. package/es/components/SheetOverlay/drag_and_drop/row-helpers.js +26 -2
  6. package/es/components/SheetOverlay/helper.d.ts +7 -0
  7. package/es/components/SheetOverlay/helper.js +95 -0
  8. package/es/components/SheetOverlay/index.css +1 -1
  9. package/es/components/Workbook/index.js +141 -11
  10. package/es/hooks/useFormulaEditorHistory.d.ts +24 -0
  11. package/es/hooks/useFormulaEditorHistory.js +119 -0
  12. package/es/hooks/useRerenderOnFormulaCaret.d.ts +2 -0
  13. package/es/hooks/useRerenderOnFormulaCaret.js +26 -0
  14. package/es/utils/convertCellsToCrypto.js +17 -0
  15. package/lib/components/ContextMenu/index.js +1 -1
  16. package/lib/components/FxEditor/index.js +198 -50
  17. package/lib/components/SheetOverlay/InputBox.js +316 -148
  18. package/lib/components/SheetOverlay/drag_and_drop/column-helpers.js +25 -1
  19. package/lib/components/SheetOverlay/drag_and_drop/row-helpers.js +26 -2
  20. package/lib/components/SheetOverlay/helper.d.ts +7 -0
  21. package/lib/components/SheetOverlay/helper.js +99 -0
  22. package/lib/components/SheetOverlay/index.css +1 -1
  23. package/lib/components/Workbook/index.js +142 -12
  24. package/lib/hooks/useFormulaEditorHistory.d.ts +24 -0
  25. package/lib/hooks/useFormulaEditorHistory.js +126 -0
  26. package/lib/hooks/useRerenderOnFormulaCaret.d.ts +2 -0
  27. package/lib/hooks/useRerenderOnFormulaCaret.js +32 -0
  28. package/lib/utils/convertCellsToCrypto.js +17 -0
  29. package/package.json +2 -2
@@ -281,9 +281,12 @@ function convertCellsToCrypto(_a) {
281
281
  });
282
282
  });
283
283
  setContext(function (ctx) {
284
+ var _a;
284
285
  var d = (0, _fortuneCore.getFlowdata)(ctx);
285
286
  if (!d || !Array.isArray(d)) return;
287
+ var ydocChanges = [];
286
288
  cellUpdates.forEach(function (_a) {
289
+ var _b, _c;
287
290
  var row = _a.row,
288
291
  col = _a.col,
289
292
  baseValue = _a.baseValue,
@@ -303,7 +306,21 @@ function convertCellsToCrypto(_a) {
303
306
  cellCp.baseCurrency = baseCurrency.toLowerCase();
304
307
  cellCp.baseCurrencyPrice = baseCurrencyPrice;
305
308
  d[row][col] = cellCp;
309
+ ydocChanges.push({
310
+ sheetId: ctx.currentSheetId,
311
+ path: ["celldata"],
312
+ value: {
313
+ r: row,
314
+ c: col,
315
+ v: (_c = (_b = d[row]) === null || _b === void 0 ? void 0 : _b[col]) !== null && _c !== void 0 ? _c : null
316
+ },
317
+ key: "".concat(row, "_").concat(col),
318
+ type: "update"
319
+ });
306
320
  });
321
+ if (ydocChanges.length > 0 && ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.hooks) === null || _a === void 0 ? void 0 : _a.updateCellYdoc)) {
322
+ ctx.hooks.updateCellYdoc(ydocChanges);
323
+ }
307
324
  });
308
325
  setContext(function (ctx) {
309
326
  _fortuneCore.api.calculateSheetFromula(ctx, ctx.currentSheetId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.3.10",
3
+ "version": "1.3.11-input-ref-1",
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.3.10",
19
+ "@fileverse-dev/fortune-core": "1.3.11-input-ref-1",
20
20
  "@fileverse/ui": "5.0.0",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",