@fileverse-dev/fortune-react 1.3.10-input → 1.3.10-yjs
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.
- package/es/components/DataVerification/ColorPicker.js +1 -1
- package/es/components/SheetOverlay/drag_and_drop/column-helpers.js +22 -1
- package/es/components/SheetOverlay/drag_and_drop/row-helpers.js +23 -2
- package/lib/components/DataVerification/ColorPicker.js +1 -1
- package/lib/components/SheetOverlay/drag_and_drop/column-helpers.js +22 -1
- package/lib/components/SheetOverlay/drag_and_drop/row-helpers.js +23 -2
- package/package.json +2 -2
|
@@ -211,7 +211,7 @@ export var useColumnDragAndDrop = function useColumnDragAndDrop(containerRef, se
|
|
|
211
211
|
var sheetIdx_1 = getSheetIndex(context, context.currentSheetId);
|
|
212
212
|
if (sheetIdx_1 != null && sourceIndex_1 >= 0 && Number.isFinite(finalInsertionIndex_1) && finalInsertionIndex_1 >= 0) {
|
|
213
213
|
setContext(function (draft) {
|
|
214
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
214
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
215
215
|
var _sheet = draft.luckysheetfile[sheetIdx_1];
|
|
216
216
|
if (!(_sheet === null || _sheet === void 0 ? void 0 : _sheet.data)) return;
|
|
217
217
|
var rows = _sheet.data;
|
|
@@ -374,6 +374,27 @@ export var useColumnDragAndDrop = function useColumnDragAndDrop(containerRef, se
|
|
|
374
374
|
}
|
|
375
375
|
});
|
|
376
376
|
(_g = window === null || window === void 0 ? void 0 : window.updateDataBlockCalcFunctionAfterRowDrag) === null || _g === void 0 ? void 0 : _g.call(window, selectedSourceCol, selectedTargetCol, "column", context.currentSheetId, sourceIndex_1, targetIndex);
|
|
377
|
+
var cellChanges = [];
|
|
378
|
+
rows.forEach(function (row, r) {
|
|
379
|
+
row === null || row === void 0 ? void 0 : row.forEach(function (cell, c) {
|
|
380
|
+
if (cell != null) {
|
|
381
|
+
cellChanges.push({
|
|
382
|
+
sheetId: draft.currentSheetId,
|
|
383
|
+
path: ["celldata"],
|
|
384
|
+
value: {
|
|
385
|
+
r: r,
|
|
386
|
+
c: c,
|
|
387
|
+
v: cell
|
|
388
|
+
},
|
|
389
|
+
key: "".concat(r, "_").concat(c),
|
|
390
|
+
type: "update"
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
if (cellChanges.length > 0 && ((_h = draft.hooks) === null || _h === void 0 ? void 0 : _h.updateCellYdoc)) {
|
|
396
|
+
draft.hooks.updateCellYdoc(cellChanges);
|
|
397
|
+
}
|
|
377
398
|
var rowLen = (d === null || d === void 0 ? void 0 : d.length) || 0;
|
|
378
399
|
api.setSelection(draft, [{
|
|
379
400
|
row: [0, rowLen],
|
|
@@ -207,7 +207,7 @@ export var useRowDragAndDrop = function useRowDragAndDrop(containerRef, selected
|
|
|
207
207
|
var sheetIdx_1 = getSheetIndex(context, context.currentSheetId);
|
|
208
208
|
if (sheetIdx_1 != null && sourceIndex_1 >= 0 && Number.isFinite(finalInsertionIndex_1) && finalInsertionIndex_1 >= 0) {
|
|
209
209
|
setContext(function (draft) {
|
|
210
|
-
var _a, _b, _c, _d, _e, _f;
|
|
210
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
211
211
|
var _sheet = draft.luckysheetfile[sheetIdx_1];
|
|
212
212
|
if (!(_sheet === null || _sheet === void 0 ? void 0 : _sheet.data)) return;
|
|
213
213
|
var rows = _sheet.data;
|
|
@@ -364,7 +364,28 @@ export var useRowDragAndDrop = function useRowDragAndDrop(containerRef, selected
|
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
366
|
(_e = window === null || window === void 0 ? void 0 : window.updateDataBlockCalcFunctionAfterRowDrag) === null || _e === void 0 ? void 0 : _e.call(window, sourceIndex_1, targetIndex, "row", context.currentSheetId);
|
|
367
|
-
var
|
|
367
|
+
var cellChanges = [];
|
|
368
|
+
rows.forEach(function (row, r) {
|
|
369
|
+
row === null || row === void 0 ? void 0 : row.forEach(function (cell, c) {
|
|
370
|
+
if (cell != null) {
|
|
371
|
+
cellChanges.push({
|
|
372
|
+
sheetId: draft.currentSheetId,
|
|
373
|
+
path: ["celldata"],
|
|
374
|
+
value: {
|
|
375
|
+
r: r,
|
|
376
|
+
c: c,
|
|
377
|
+
v: cell
|
|
378
|
+
},
|
|
379
|
+
key: "".concat(r, "_").concat(c),
|
|
380
|
+
type: "update"
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
if (cellChanges.length > 0 && ((_f = draft.hooks) === null || _f === void 0 ? void 0 : _f.updateCellYdoc)) {
|
|
386
|
+
draft.hooks.updateCellYdoc(cellChanges);
|
|
387
|
+
}
|
|
388
|
+
var colLen = ((_g = d === null || d === void 0 ? void 0 : d[0]) === null || _g === void 0 ? void 0 : _g.length) || 0;
|
|
368
389
|
api.setSelection(draft, [{
|
|
369
390
|
row: [selectedTargetRow[0], selectedTargetRow[selectedTargetRow.length - 1]],
|
|
370
391
|
column: [0, colLen]
|
|
@@ -219,7 +219,7 @@ var useColumnDragAndDrop = exports.useColumnDragAndDrop = function useColumnDrag
|
|
|
219
219
|
var sheetIdx_1 = (0, _fortuneCore.getSheetIndex)(context, context.currentSheetId);
|
|
220
220
|
if (sheetIdx_1 != null && sourceIndex_1 >= 0 && Number.isFinite(finalInsertionIndex_1) && finalInsertionIndex_1 >= 0) {
|
|
221
221
|
setContext(function (draft) {
|
|
222
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
222
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
223
223
|
var _sheet = draft.luckysheetfile[sheetIdx_1];
|
|
224
224
|
if (!(_sheet === null || _sheet === void 0 ? void 0 : _sheet.data)) return;
|
|
225
225
|
var rows = _sheet.data;
|
|
@@ -382,6 +382,27 @@ var useColumnDragAndDrop = exports.useColumnDragAndDrop = function useColumnDrag
|
|
|
382
382
|
}
|
|
383
383
|
});
|
|
384
384
|
(_g = window === null || window === void 0 ? void 0 : window.updateDataBlockCalcFunctionAfterRowDrag) === null || _g === void 0 ? void 0 : _g.call(window, selectedSourceCol, selectedTargetCol, "column", context.currentSheetId, sourceIndex_1, targetIndex);
|
|
385
|
+
var cellChanges = [];
|
|
386
|
+
rows.forEach(function (row, r) {
|
|
387
|
+
row === null || row === void 0 ? void 0 : row.forEach(function (cell, c) {
|
|
388
|
+
if (cell != null) {
|
|
389
|
+
cellChanges.push({
|
|
390
|
+
sheetId: draft.currentSheetId,
|
|
391
|
+
path: ["celldata"],
|
|
392
|
+
value: {
|
|
393
|
+
r: r,
|
|
394
|
+
c: c,
|
|
395
|
+
v: cell
|
|
396
|
+
},
|
|
397
|
+
key: "".concat(r, "_").concat(c),
|
|
398
|
+
type: "update"
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
if (cellChanges.length > 0 && ((_h = draft.hooks) === null || _h === void 0 ? void 0 : _h.updateCellYdoc)) {
|
|
404
|
+
draft.hooks.updateCellYdoc(cellChanges);
|
|
405
|
+
}
|
|
385
406
|
var rowLen = (d === null || d === void 0 ? void 0 : d.length) || 0;
|
|
386
407
|
_fortuneCore.api.setSelection(draft, [{
|
|
387
408
|
row: [0, rowLen],
|
|
@@ -214,7 +214,7 @@ var useRowDragAndDrop = exports.useRowDragAndDrop = function useRowDragAndDrop(c
|
|
|
214
214
|
var sheetIdx_1 = (0, _fortuneCore.getSheetIndex)(context, context.currentSheetId);
|
|
215
215
|
if (sheetIdx_1 != null && sourceIndex_1 >= 0 && Number.isFinite(finalInsertionIndex_1) && finalInsertionIndex_1 >= 0) {
|
|
216
216
|
setContext(function (draft) {
|
|
217
|
-
var _a, _b, _c, _d, _e, _f;
|
|
217
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
218
218
|
var _sheet = draft.luckysheetfile[sheetIdx_1];
|
|
219
219
|
if (!(_sheet === null || _sheet === void 0 ? void 0 : _sheet.data)) return;
|
|
220
220
|
var rows = _sheet.data;
|
|
@@ -371,7 +371,28 @@ var useRowDragAndDrop = exports.useRowDragAndDrop = function useRowDragAndDrop(c
|
|
|
371
371
|
}
|
|
372
372
|
});
|
|
373
373
|
(_e = window === null || window === void 0 ? void 0 : window.updateDataBlockCalcFunctionAfterRowDrag) === null || _e === void 0 ? void 0 : _e.call(window, sourceIndex_1, targetIndex, "row", context.currentSheetId);
|
|
374
|
-
var
|
|
374
|
+
var cellChanges = [];
|
|
375
|
+
rows.forEach(function (row, r) {
|
|
376
|
+
row === null || row === void 0 ? void 0 : row.forEach(function (cell, c) {
|
|
377
|
+
if (cell != null) {
|
|
378
|
+
cellChanges.push({
|
|
379
|
+
sheetId: draft.currentSheetId,
|
|
380
|
+
path: ["celldata"],
|
|
381
|
+
value: {
|
|
382
|
+
r: r,
|
|
383
|
+
c: c,
|
|
384
|
+
v: cell
|
|
385
|
+
},
|
|
386
|
+
key: "".concat(r, "_").concat(c),
|
|
387
|
+
type: "update"
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
if (cellChanges.length > 0 && ((_f = draft.hooks) === null || _f === void 0 ? void 0 : _f.updateCellYdoc)) {
|
|
393
|
+
draft.hooks.updateCellYdoc(cellChanges);
|
|
394
|
+
}
|
|
395
|
+
var colLen = ((_g = d === null || d === void 0 ? void 0 : d[0]) === null || _g === void 0 ? void 0 : _g.length) || 0;
|
|
375
396
|
_fortuneCore.api.setSelection(draft, [{
|
|
376
397
|
row: [selectedTargetRow[0], selectedTargetRow[selectedTargetRow.length - 1]],
|
|
377
398
|
column: [0, colLen]
|
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.10-yjs",
|
|
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.10-yjs",
|
|
20
20
|
"@fileverse/ui": "5.0.0",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|