@fileverse-dev/fortune-react 1.1.98 → 1.1.99-patch-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.
@@ -241,6 +241,9 @@ var DynamicInputList = function DynamicInputList(_a) {
241
241
  e.target.focus();
242
242
  },
243
243
  key: item.id,
244
+ onKeyDown: function onKeyDown(e) {
245
+ e.stopPropagation();
246
+ },
244
247
  className: "w-full",
245
248
  placeholder: "Option ".concat(index + 1),
246
249
  value: item.value,
@@ -495,7 +495,7 @@ var InputBox = function InputBox() {
495
495
  minHeight: firstSelection.height
496
496
  }, inputBoxStyle) : {}
497
497
  }, /*#__PURE__*/React.createElement(ContentEditable, {
498
- onMouseUp: function onMouseUp(e) {
498
+ onMouseUp: function onMouseUp() {
499
499
  var currentCommaCount = countCommasBeforeCursor(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
500
500
  setCommaCount(currentCommaCount);
501
501
  },
@@ -272,24 +272,26 @@ export var useColumnDragAndDrop = function useColumnDragAndDrop(containerRef, se
272
272
  }
273
273
  });
274
274
  });
275
- var newDataVerification = {};
276
- Object.keys(_sheet.dataVerification).forEach(function (item) {
277
- var _a;
278
- var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
279
- var colRow = item.split("_");
280
- if (colRow.length !== 2) return;
281
- var presentcol = parseInt(colRow[1], 10);
282
- var updatedCol = presentcol;
283
- if (presentcol === sourceIndex_1) {
284
- updatedCol = targetIndex;
285
- } else if (presentcol > sourceIndex_1 && presentcol < targetIndex) {
286
- updatedCol -= 1;
287
- } else if (presentcol < sourceIndex_1 && presentcol >= targetIndex) {
288
- updatedCol += 1;
289
- }
290
- newDataVerification["".concat(colRow[0], "_").concat(updatedCol)] = itemData;
291
- });
292
- _sheet.dataVerification = newDataVerification;
275
+ if (_sheet.dataVerification) {
276
+ var newDataVerification_1 = {};
277
+ Object.keys(_sheet.dataVerification).forEach(function (item) {
278
+ var _a;
279
+ var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
280
+ var colRow = item.split("_");
281
+ if (colRow.length !== 2) return;
282
+ var presentcol = parseInt(colRow[1], 10);
283
+ var updatedCol = presentcol;
284
+ if (presentcol === sourceIndex_1) {
285
+ updatedCol = targetIndex;
286
+ } else if (presentcol > sourceIndex_1 && presentcol < targetIndex) {
287
+ updatedCol -= 1;
288
+ } else if (presentcol < sourceIndex_1 && presentcol >= targetIndex) {
289
+ updatedCol += 1;
290
+ }
291
+ newDataVerification_1["".concat(colRow[0], "_").concat(updatedCol)] = itemData;
292
+ });
293
+ _sheet.dataVerification = newDataVerification_1;
294
+ }
293
295
  (_c = _sheet.calcChain) === null || _c === void 0 ? void 0 : _c.forEach(function (item) {
294
296
  if (item.c === sourceIndex_1) {
295
297
  item.c = targetIndex;
@@ -253,24 +253,26 @@ export var useRowDragAndDrop = function useRowDragAndDrop(containerRef, selected
253
253
  }
254
254
  });
255
255
  });
256
- var newDataVerification = {};
257
- Object.keys(_sheet.dataVerification).forEach(function (item) {
258
- var _a;
259
- var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
260
- var colRow = item.split("_");
261
- if (colRow.length !== 2) return;
262
- var presentRow = parseInt(colRow[0], 10);
263
- var updatedRow = presentRow;
264
- if (presentRow === sourceIndex_1) {
265
- updatedRow = targetIndex;
266
- } else if (presentRow > sourceIndex_1 && presentRow < targetIndex) {
267
- updatedRow -= 1;
268
- } else if (presentRow < sourceIndex_1 && presentRow >= targetIndex) {
269
- updatedRow += 1;
270
- }
271
- newDataVerification["".concat(updatedRow, "_").concat(colRow[1])] = itemData;
272
- });
273
- _sheet.dataVerification = newDataVerification;
256
+ if (_sheet.dataVerification) {
257
+ var newDataVerification_1 = {};
258
+ Object.keys(_sheet.dataVerification).forEach(function (item) {
259
+ var _a;
260
+ var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
261
+ var colRow = item.split("_");
262
+ if (colRow.length !== 2) return;
263
+ var presentRow = parseInt(colRow[0], 10);
264
+ var updatedRow = presentRow;
265
+ if (presentRow === sourceIndex_1) {
266
+ updatedRow = targetIndex;
267
+ } else if (presentRow > sourceIndex_1 && presentRow < targetIndex) {
268
+ updatedRow -= 1;
269
+ } else if (presentRow < sourceIndex_1 && presentRow >= targetIndex) {
270
+ updatedRow += 1;
271
+ }
272
+ newDataVerification_1["".concat(updatedRow, "_").concat(colRow[1])] = itemData;
273
+ });
274
+ _sheet.dataVerification = newDataVerification_1;
275
+ }
274
276
  (_a = _sheet.calcChain) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
275
277
  if (item.r === sourceIndex_1) {
276
278
  item.r = targetIndex;
@@ -6,5 +6,4 @@ export declare function incrementColumn(cell: string): string;
6
6
  export declare function decrementColumn(cell: string): string;
7
7
  export declare function incrementRow(cell: string): string;
8
8
  export declare function decrementRow(cell: string): string;
9
- export declare function countCommasOutsideQuotes(str: string): number;
10
9
  export declare function countCommasBeforeCursor(editableDiv: HTMLDivElement): number;
@@ -84,19 +84,6 @@ export function decrementRow(cell) {
84
84
  var newRowPart = Math.max(1, parsed.rowPart - 1);
85
85
  return parsed.colPart + newRowPart;
86
86
  }
87
- export function countCommasOutsideQuotes(str) {
88
- var inQuotes = false;
89
- var count = 0;
90
- for (var i = 0; i < str.length; i++) {
91
- var char = str[i];
92
- if (char === '"') {
93
- inQuotes = !inQuotes;
94
- } else if (char === ',' && !inQuotes) {
95
- count++;
96
- }
97
- }
98
- return count;
99
- }
100
87
  export function countCommasBeforeCursor(editableDiv) {
101
88
  var selection = window.getSelection();
102
89
  if (!(selection === null || selection === void 0 ? void 0 : selection.rangeCount)) return 0;
@@ -107,12 +94,12 @@ export function countCommasBeforeCursor(editableDiv) {
107
94
  var textBeforeCursor = preCaretRange.toString();
108
95
  var inQuotes = false;
109
96
  var count = 0;
110
- for (var i = 0; i < textBeforeCursor.length; i++) {
97
+ for (var i = 0; i < textBeforeCursor.length; i += 1) {
111
98
  var char = textBeforeCursor[i];
112
99
  if (char === '"') {
113
100
  inQuotes = !inQuotes;
114
- } else if (char === ',' && !inQuotes) {
115
- count++;
101
+ } else if (char === "," && !inQuotes) {
102
+ count += 1;
116
103
  }
117
104
  }
118
105
  return count;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Cell } from "@fileverse-dev/fortune-core";
3
3
  import "./index.css";
4
- export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "Underline" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "Border" | "MergeHorizontal" | "Percent" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "Filter" | "Link" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "Search" | "DuneChart" | "Ellipsis";
4
+ export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "Percent" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "MergeHorizontal" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "DuneChart" | "Ellipsis";
5
5
  export declare const CurrencySelector: ({ cell, defaultTextFormat, toolTipText, }: {
6
6
  cell: Cell | null | undefined;
7
7
  defaultTextFormat: string;
@@ -124,7 +124,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
124
124
  };
125
125
  import React, { useContext, useCallback, useRef, useEffect, useState } from "react";
126
126
  import { toolbarItemClickHandler, handleTextBackground, handleTextColor, handleTextSize, normalizedCellAttr, getFlowdata, newComment, editComment, deleteComment, showHideComment, showHideAllComments, autoSelectionFormula, handleSum, locale, handleMerge, handleBorder, toolbarItemSelectedFunc, handleFreeze, insertImage, showImgChooser, updateFormat, handleSort, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, createFilter, clearFilter, applyLocation, insertDuneChart } from "@fileverse-dev/fortune-core";
127
- import { setSelection, getSelection } from "@fileverse-dev/fortune-core/lib/api";
127
+ import { setSelection, getSelection } from "@fileverse-dev/fortune-core/src/api";
128
128
  import _ from "lodash";
129
129
  import { IconButton, LucideIcon, Tooltip, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from "@fileverse/ui";
130
130
  import DataVerificationPortal from "./dataVerificationPortal";
@@ -248,6 +248,9 @@ var DynamicInputList = function DynamicInputList(_a) {
248
248
  e.target.focus();
249
249
  },
250
250
  key: item.id,
251
+ onKeyDown: function onKeyDown(e) {
252
+ e.stopPropagation();
253
+ },
251
254
  className: "w-full",
252
255
  placeholder: "Option ".concat(index + 1),
253
256
  value: item.value,
@@ -504,7 +504,7 @@ var InputBox = function InputBox() {
504
504
  minHeight: firstSelection.height
505
505
  }, inputBoxStyle) : {}
506
506
  }, /*#__PURE__*/_react.default.createElement(_ContentEditable.default, {
507
- onMouseUp: function onMouseUp(e) {
507
+ onMouseUp: function onMouseUp() {
508
508
  var currentCommaCount = (0, _helper.countCommasBeforeCursor)(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
509
509
  setCommaCount(currentCommaCount);
510
510
  },
@@ -280,24 +280,26 @@ var useColumnDragAndDrop = exports.useColumnDragAndDrop = function useColumnDrag
280
280
  }
281
281
  });
282
282
  });
283
- var newDataVerification = {};
284
- Object.keys(_sheet.dataVerification).forEach(function (item) {
285
- var _a;
286
- var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
287
- var colRow = item.split("_");
288
- if (colRow.length !== 2) return;
289
- var presentcol = parseInt(colRow[1], 10);
290
- var updatedCol = presentcol;
291
- if (presentcol === sourceIndex_1) {
292
- updatedCol = targetIndex;
293
- } else if (presentcol > sourceIndex_1 && presentcol < targetIndex) {
294
- updatedCol -= 1;
295
- } else if (presentcol < sourceIndex_1 && presentcol >= targetIndex) {
296
- updatedCol += 1;
297
- }
298
- newDataVerification["".concat(colRow[0], "_").concat(updatedCol)] = itemData;
299
- });
300
- _sheet.dataVerification = newDataVerification;
283
+ if (_sheet.dataVerification) {
284
+ var newDataVerification_1 = {};
285
+ Object.keys(_sheet.dataVerification).forEach(function (item) {
286
+ var _a;
287
+ var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
288
+ var colRow = item.split("_");
289
+ if (colRow.length !== 2) return;
290
+ var presentcol = parseInt(colRow[1], 10);
291
+ var updatedCol = presentcol;
292
+ if (presentcol === sourceIndex_1) {
293
+ updatedCol = targetIndex;
294
+ } else if (presentcol > sourceIndex_1 && presentcol < targetIndex) {
295
+ updatedCol -= 1;
296
+ } else if (presentcol < sourceIndex_1 && presentcol >= targetIndex) {
297
+ updatedCol += 1;
298
+ }
299
+ newDataVerification_1["".concat(colRow[0], "_").concat(updatedCol)] = itemData;
300
+ });
301
+ _sheet.dataVerification = newDataVerification_1;
302
+ }
301
303
  (_c = _sheet.calcChain) === null || _c === void 0 ? void 0 : _c.forEach(function (item) {
302
304
  if (item.c === sourceIndex_1) {
303
305
  item.c = targetIndex;
@@ -260,24 +260,26 @@ var useRowDragAndDrop = exports.useRowDragAndDrop = function useRowDragAndDrop(c
260
260
  }
261
261
  });
262
262
  });
263
- var newDataVerification = {};
264
- Object.keys(_sheet.dataVerification).forEach(function (item) {
265
- var _a;
266
- var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
267
- var colRow = item.split("_");
268
- if (colRow.length !== 2) return;
269
- var presentRow = parseInt(colRow[0], 10);
270
- var updatedRow = presentRow;
271
- if (presentRow === sourceIndex_1) {
272
- updatedRow = targetIndex;
273
- } else if (presentRow > sourceIndex_1 && presentRow < targetIndex) {
274
- updatedRow -= 1;
275
- } else if (presentRow < sourceIndex_1 && presentRow >= targetIndex) {
276
- updatedRow += 1;
277
- }
278
- newDataVerification["".concat(updatedRow, "_").concat(colRow[1])] = itemData;
279
- });
280
- _sheet.dataVerification = newDataVerification;
263
+ if (_sheet.dataVerification) {
264
+ var newDataVerification_1 = {};
265
+ Object.keys(_sheet.dataVerification).forEach(function (item) {
266
+ var _a;
267
+ var itemData = (_a = _sheet.dataVerification) === null || _a === void 0 ? void 0 : _a[item];
268
+ var colRow = item.split("_");
269
+ if (colRow.length !== 2) return;
270
+ var presentRow = parseInt(colRow[0], 10);
271
+ var updatedRow = presentRow;
272
+ if (presentRow === sourceIndex_1) {
273
+ updatedRow = targetIndex;
274
+ } else if (presentRow > sourceIndex_1 && presentRow < targetIndex) {
275
+ updatedRow -= 1;
276
+ } else if (presentRow < sourceIndex_1 && presentRow >= targetIndex) {
277
+ updatedRow += 1;
278
+ }
279
+ newDataVerification_1["".concat(updatedRow, "_").concat(colRow[1])] = itemData;
280
+ });
281
+ _sheet.dataVerification = newDataVerification_1;
282
+ }
281
283
  (_a = _sheet.calcChain) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
282
284
  if (item.r === sourceIndex_1) {
283
285
  item.r = targetIndex;
@@ -6,5 +6,4 @@ export declare function incrementColumn(cell: string): string;
6
6
  export declare function decrementColumn(cell: string): string;
7
7
  export declare function incrementRow(cell: string): string;
8
8
  export declare function decrementRow(cell: string): string;
9
- export declare function countCommasOutsideQuotes(str: string): number;
10
9
  export declare function countCommasBeforeCursor(editableDiv: HTMLDivElement): number;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.countCommasBeforeCursor = countCommasBeforeCursor;
7
- exports.countCommasOutsideQuotes = countCommasOutsideQuotes;
8
7
  exports.decrementColumn = decrementColumn;
9
8
  exports.decrementRow = decrementRow;
10
9
  exports.getCursorPosition = getCursorPosition;
@@ -99,19 +98,6 @@ function decrementRow(cell) {
99
98
  var newRowPart = Math.max(1, parsed.rowPart - 1);
100
99
  return parsed.colPart + newRowPart;
101
100
  }
102
- function countCommasOutsideQuotes(str) {
103
- var inQuotes = false;
104
- var count = 0;
105
- for (var i = 0; i < str.length; i++) {
106
- var char = str[i];
107
- if (char === '"') {
108
- inQuotes = !inQuotes;
109
- } else if (char === ',' && !inQuotes) {
110
- count++;
111
- }
112
- }
113
- return count;
114
- }
115
101
  function countCommasBeforeCursor(editableDiv) {
116
102
  var selection = window.getSelection();
117
103
  if (!(selection === null || selection === void 0 ? void 0 : selection.rangeCount)) return 0;
@@ -122,12 +108,12 @@ function countCommasBeforeCursor(editableDiv) {
122
108
  var textBeforeCursor = preCaretRange.toString();
123
109
  var inQuotes = false;
124
110
  var count = 0;
125
- for (var i = 0; i < textBeforeCursor.length; i++) {
111
+ for (var i = 0; i < textBeforeCursor.length; i += 1) {
126
112
  var char = textBeforeCursor[i];
127
113
  if (char === '"') {
128
114
  inQuotes = !inQuotes;
129
- } else if (char === ',' && !inQuotes) {
130
- count++;
115
+ } else if (char === "," && !inQuotes) {
116
+ count += 1;
131
117
  }
132
118
  }
133
119
  return count;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Cell } from "@fileverse-dev/fortune-core";
3
3
  import "./index.css";
4
- export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "Underline" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "Border" | "MergeHorizontal" | "Percent" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "Filter" | "Link" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "Search" | "DuneChart" | "Ellipsis";
4
+ export declare const getLucideIcon: (title: string) => "Ethereum" | "DollarSign" | "" | "ChevronDown" | "Undo" | "Redo" | "Underline" | "Border" | "Filter" | "Link" | "Search" | "Percent" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "MergeHorizontal" | "DecimalsArrowLeft" | "DecimalsArrowRight" | "PaintbrushVertical" | "MessageSquarePlus" | "Image" | "Sigma" | "ShieldCheck" | "DuneChart" | "Ellipsis";
5
5
  export declare const CurrencySelector: ({ cell, defaultTextFormat, toolTipText, }: {
6
6
  cell: Cell | null | undefined;
7
7
  defaultTextFormat: string;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getLucideIcon = exports.default = exports.CurrencySelector = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _fortuneCore = require("@fileverse-dev/fortune-core");
10
- var _api = require("@fileverse-dev/fortune-core/lib/api");
10
+ var _api = require("@fileverse-dev/fortune-core/src/api");
11
11
  var _lodash = _interopRequireDefault(require("lodash"));
12
12
  var _ui = require("@fileverse/ui");
13
13
  var _dataVerificationPortal = _interopRequireDefault(require("./dataVerificationPortal"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.1.98",
3
+ "version": "1.1.99-patch-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.1.98",
19
+ "@fileverse-dev/fortune-core": "1.1.99-patch-1",
20
20
  "@fileverse/ui": "^4.1.7-patch-21",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",