@fileverse-dev/fortune-react 1.0.39 → 1.0.41
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/CryptoDenominationSelector/index.css +67 -0
- package/es/components/CryptoDenominationSelector/index.d.ts +8 -0
- package/es/components/CryptoDenominationSelector/index.js +272 -0
- package/es/components/FormatSearch/index.js +9 -5
- package/es/components/SVGDefines.js +60 -1
- package/es/components/SheetTab/index.js +23 -2
- package/es/components/Toolbar/Combo.js +18 -4
- package/es/components/Toolbar/index.css +6 -0
- package/es/components/Toolbar/index.d.ts +1 -1
- package/es/components/Toolbar/index.js +334 -3
- package/es/components/Workbook/api.d.ts +2 -0
- package/es/components/Workbook/api.js +2 -0
- package/es/components/Workbook/index.d.ts +24 -23
- package/es/components/Workbook/index.js +36 -1
- package/es/constants.d.ts +26 -0
- package/es/constants.js +44 -3
- package/es/utils/convertCellsToCrypto.d.ts +8 -0
- package/es/utils/convertCellsToCrypto.js +215 -0
- package/es/utils/cryptoApi.d.ts +2 -0
- package/es/utils/cryptoApi.js +154 -0
- package/es/utils/updateCellsDecimalFormat.d.ts +6 -0
- package/es/utils/updateCellsDecimalFormat.js +80 -0
- package/lib/components/CryptoDenominationSelector/index.css +67 -0
- package/lib/components/CryptoDenominationSelector/index.d.ts +8 -0
- package/lib/components/CryptoDenominationSelector/index.js +281 -0
- package/lib/components/FormatSearch/index.js +9 -5
- package/lib/components/SVGDefines.js +60 -1
- package/lib/components/SheetTab/index.js +23 -2
- package/lib/components/Toolbar/Combo.js +18 -4
- package/lib/components/Toolbar/index.css +6 -0
- package/lib/components/Toolbar/index.d.ts +1 -1
- package/lib/components/Toolbar/index.js +333 -2
- package/lib/components/Workbook/api.d.ts +2 -0
- package/lib/components/Workbook/api.js +2 -0
- package/lib/components/Workbook/index.d.ts +24 -23
- package/lib/components/Workbook/index.js +35 -0
- package/lib/constants.d.ts +26 -0
- package/lib/constants.js +45 -3
- package/lib/utils/convertCellsToCrypto.d.ts +8 -0
- package/lib/utils/convertCellsToCrypto.js +222 -0
- package/lib/utils/cryptoApi.d.ts +2 -0
- package/lib/utils/cryptoApi.js +161 -0
- package/lib/utils/updateCellsDecimalFormat.d.ts +6 -0
- package/lib/utils/updateCellsDecimalFormat.js +86 -0
- package/package.json +2 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.crypto-denomination-selector {
|
|
2
|
+
min-width: 240px;
|
|
3
|
+
font-family: inherit;
|
|
4
|
+
color: hsl(var(--color-text-default));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.cds-row {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
line-height: 20px;
|
|
13
|
+
}
|
|
14
|
+
.cds-row input[type="number"] {
|
|
15
|
+
width: 40px;
|
|
16
|
+
height: 28px;
|
|
17
|
+
text-align: center;
|
|
18
|
+
border: 1px solid hsl(var(--color-border-default));
|
|
19
|
+
border-radius: 6px;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
padding: 0 4px;
|
|
22
|
+
margin: 0 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Chrome, Safari, Edge, Opera */
|
|
26
|
+
.cds-row input::-webkit-outer-spin-button,
|
|
27
|
+
.cds-row input::-webkit-inner-spin-button {
|
|
28
|
+
-webkit-appearance: none;
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Firefox */
|
|
33
|
+
.cds-row input[type=number] {
|
|
34
|
+
-moz-appearance: textfield;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.cds-list {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: 2px;
|
|
41
|
+
margin-top: 8px;
|
|
42
|
+
}
|
|
43
|
+
.cds-option {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: 10px;
|
|
47
|
+
padding: 8px 12px;
|
|
48
|
+
border-radius: 8px;
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
line-height: 20px;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
transition: background 0.13s;
|
|
53
|
+
position: relative;
|
|
54
|
+
}
|
|
55
|
+
.cds-option.selected {
|
|
56
|
+
background: hsl(var(--color-bg-default-selected));
|
|
57
|
+
}
|
|
58
|
+
.cds-option:hover {
|
|
59
|
+
background: hsl(var(--color-bg-default-hover));
|
|
60
|
+
}
|
|
61
|
+
.cds-icon {
|
|
62
|
+
width: 16px;
|
|
63
|
+
height: 16px;
|
|
64
|
+
display: inline-block;
|
|
65
|
+
background-size: contain;
|
|
66
|
+
background-repeat: no-repeat;
|
|
67
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.css";
|
|
3
|
+
interface CryptoDenominationSelectorProps {
|
|
4
|
+
initialDecimals?: number;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const CryptoDenominationSelector: React.FC<CryptoDenominationSelectorProps>;
|
|
8
|
+
export default CryptoDenominationSelector;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) {
|
|
3
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
4
|
+
resolve(value);
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) {
|
|
9
|
+
try {
|
|
10
|
+
step(generator.next(value));
|
|
11
|
+
} catch (e) {
|
|
12
|
+
reject(e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function rejected(value) {
|
|
16
|
+
try {
|
|
17
|
+
step(generator["throw"](value));
|
|
18
|
+
} catch (e) {
|
|
19
|
+
reject(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function step(result) {
|
|
23
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
24
|
+
}
|
|
25
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
29
|
+
var _ = {
|
|
30
|
+
label: 0,
|
|
31
|
+
sent: function sent() {
|
|
32
|
+
if (t[0] & 1) throw t[1];
|
|
33
|
+
return t[1];
|
|
34
|
+
},
|
|
35
|
+
trys: [],
|
|
36
|
+
ops: []
|
|
37
|
+
},
|
|
38
|
+
f,
|
|
39
|
+
y,
|
|
40
|
+
t,
|
|
41
|
+
g;
|
|
42
|
+
return g = {
|
|
43
|
+
next: verb(0),
|
|
44
|
+
"throw": verb(1),
|
|
45
|
+
"return": verb(2)
|
|
46
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
47
|
+
return this;
|
|
48
|
+
}), g;
|
|
49
|
+
function verb(n) {
|
|
50
|
+
return function (v) {
|
|
51
|
+
return step([n, v]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function step(op) {
|
|
55
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
+
switch (op[0]) {
|
|
60
|
+
case 0:
|
|
61
|
+
case 1:
|
|
62
|
+
t = op;
|
|
63
|
+
break;
|
|
64
|
+
case 4:
|
|
65
|
+
_.label++;
|
|
66
|
+
return {
|
|
67
|
+
value: op[1],
|
|
68
|
+
done: false
|
|
69
|
+
};
|
|
70
|
+
case 5:
|
|
71
|
+
_.label++;
|
|
72
|
+
y = op[1];
|
|
73
|
+
op = [0];
|
|
74
|
+
continue;
|
|
75
|
+
case 7:
|
|
76
|
+
op = _.ops.pop();
|
|
77
|
+
_.trys.pop();
|
|
78
|
+
continue;
|
|
79
|
+
default:
|
|
80
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
81
|
+
_ = 0;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
85
|
+
_.label = op[1];
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
89
|
+
_.label = t[1];
|
|
90
|
+
t = op;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (t && _.label < t[2]) {
|
|
94
|
+
_.label = t[2];
|
|
95
|
+
_.ops.push(op);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
if (t[2]) _.ops.pop();
|
|
99
|
+
_.trys.pop();
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
op = body.call(thisArg, _);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
op = [6, e];
|
|
105
|
+
y = 0;
|
|
106
|
+
} finally {
|
|
107
|
+
f = t = 0;
|
|
108
|
+
}
|
|
109
|
+
if (op[0] & 5) throw op[1];
|
|
110
|
+
return {
|
|
111
|
+
value: op[0] ? op[1] : void 0,
|
|
112
|
+
done: true
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
import React, { useState, useContext, useCallback, useMemo } from "react";
|
|
117
|
+
import { getFlowdata, normalizedCellAttr } from "@fileverse-dev/fortune-core";
|
|
118
|
+
import { IconButton, LucideIcon, Popover, PopoverContent, PopoverTrigger } from "@fileverse/ui";
|
|
119
|
+
import "./index.css";
|
|
120
|
+
import SVGIcon from "../SVGIcon";
|
|
121
|
+
import WorkbookContext from "../../context";
|
|
122
|
+
import { convertCellsToCrypto } from "../../utils/convertCellsToCrypto";
|
|
123
|
+
import { updateCellsDecimalFormat } from "../../utils/updateCellsDecimalFormat";
|
|
124
|
+
var CRYPTO_OPTIONS = [{
|
|
125
|
+
label: "Bitcoin (BTC)",
|
|
126
|
+
value: "BTC",
|
|
127
|
+
icon: "Btc"
|
|
128
|
+
}, {
|
|
129
|
+
label: "Ethereum (ETH)",
|
|
130
|
+
value: "ETH",
|
|
131
|
+
icon: "Ethereum"
|
|
132
|
+
}, {
|
|
133
|
+
label: "Solana (SOL)",
|
|
134
|
+
value: "SOL",
|
|
135
|
+
icon: "Solana"
|
|
136
|
+
}];
|
|
137
|
+
var CryptoDenominationSelector = function CryptoDenominationSelector(_a) {
|
|
138
|
+
var _b = _a.initialDecimals,
|
|
139
|
+
initialDecimals = _b === void 0 ? 6 : _b,
|
|
140
|
+
children = _a.children;
|
|
141
|
+
var _c = useContext(WorkbookContext),
|
|
142
|
+
setContext = _c.setContext,
|
|
143
|
+
context = _c.context;
|
|
144
|
+
var activeCryptoCurrency = useMemo(function () {
|
|
145
|
+
var _a, _b;
|
|
146
|
+
var firstSelection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
|
|
147
|
+
var flowdata = getFlowdata(context);
|
|
148
|
+
if (!firstSelection || !flowdata) return null;
|
|
149
|
+
var row = firstSelection.row_focus;
|
|
150
|
+
var col = firstSelection.column_focus;
|
|
151
|
+
if (row == null || col == null) return null;
|
|
152
|
+
var cell = (_b = flowdata[row]) === null || _b === void 0 ? void 0 : _b[col];
|
|
153
|
+
if (!cell) return null;
|
|
154
|
+
var curr = normalizedCellAttr(cell, "ct");
|
|
155
|
+
if (!(curr === null || curr === void 0 ? void 0 : curr.fa)) return null;
|
|
156
|
+
var found = CRYPTO_OPTIONS.find(function (option) {
|
|
157
|
+
return curr.fa.includes(option.value);
|
|
158
|
+
});
|
|
159
|
+
return found ? found.value : null;
|
|
160
|
+
}, [context]);
|
|
161
|
+
var _d = useState(initialDecimals),
|
|
162
|
+
decimals = _d[0],
|
|
163
|
+
setDecimals = _d[1];
|
|
164
|
+
var _e = useState(false),
|
|
165
|
+
open = _e[0],
|
|
166
|
+
setOpen = _e[1];
|
|
167
|
+
var handleDenominationChange = useCallback(function (newDenomination) {
|
|
168
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
169
|
+
return __generator(this, function (_a) {
|
|
170
|
+
switch (_a.label) {
|
|
171
|
+
case 0:
|
|
172
|
+
return [4, convertCellsToCrypto({
|
|
173
|
+
context: context,
|
|
174
|
+
setContext: setContext,
|
|
175
|
+
denomination: newDenomination,
|
|
176
|
+
decimals: decimals,
|
|
177
|
+
baseCurrency: "USD"
|
|
178
|
+
})];
|
|
179
|
+
case 1:
|
|
180
|
+
_a.sent();
|
|
181
|
+
return [2];
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
}, [context, setContext, decimals]);
|
|
186
|
+
var handleDecimalsChange = useCallback(function (newDecimals) {
|
|
187
|
+
setDecimals(newDecimals);
|
|
188
|
+
updateCellsDecimalFormat({
|
|
189
|
+
context: context,
|
|
190
|
+
setContext: setContext,
|
|
191
|
+
decimals: newDecimals
|
|
192
|
+
});
|
|
193
|
+
}, [context, setContext]);
|
|
194
|
+
var handleTriggerClick = useCallback(function (e) {
|
|
195
|
+
e.preventDefault();
|
|
196
|
+
e.stopPropagation();
|
|
197
|
+
if (context.allowEdit === false) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
setOpen(!open);
|
|
201
|
+
}, [open, context.allowEdit]);
|
|
202
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
203
|
+
open: open,
|
|
204
|
+
onOpenChange: setOpen
|
|
205
|
+
}, /*#__PURE__*/React.createElement(PopoverTrigger, {
|
|
206
|
+
asChild: true
|
|
207
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
208
|
+
onClick: handleTriggerClick
|
|
209
|
+
}, children)), /*#__PURE__*/React.createElement(PopoverContent, {
|
|
210
|
+
align: "end",
|
|
211
|
+
side: "bottom",
|
|
212
|
+
sideOffset: 4,
|
|
213
|
+
className: "p-2"
|
|
214
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
215
|
+
className: "crypto-denomination-selector"
|
|
216
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
217
|
+
className: "cds-row px-2"
|
|
218
|
+
}, /*#__PURE__*/React.createElement("span", null, "Decimal places:"), /*#__PURE__*/React.createElement("span", {
|
|
219
|
+
className: "flex items-center"
|
|
220
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
221
|
+
icon: "Minus",
|
|
222
|
+
variant: "ghost",
|
|
223
|
+
size: "sm",
|
|
224
|
+
className: "!bg-transparent",
|
|
225
|
+
disabled: decimals === 1,
|
|
226
|
+
onClick: function onClick() {
|
|
227
|
+
return handleDecimalsChange(Math.max(1, decimals - 1));
|
|
228
|
+
}
|
|
229
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
230
|
+
type: "number",
|
|
231
|
+
min: 1,
|
|
232
|
+
max: 18,
|
|
233
|
+
value: decimals,
|
|
234
|
+
onChange: function onChange(e) {
|
|
235
|
+
return handleDecimalsChange(Math.max(1, Math.min(18, Number(e.target.value))));
|
|
236
|
+
}
|
|
237
|
+
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
238
|
+
icon: "Plus",
|
|
239
|
+
variant: "ghost",
|
|
240
|
+
size: "sm",
|
|
241
|
+
className: "!bg-transparent",
|
|
242
|
+
disabled: decimals === 18,
|
|
243
|
+
onClick: function onClick() {
|
|
244
|
+
return handleDecimalsChange(Math.min(18, decimals + 1));
|
|
245
|
+
}
|
|
246
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
247
|
+
className: "cds-list"
|
|
248
|
+
}, CRYPTO_OPTIONS.map(function (opt) {
|
|
249
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
250
|
+
key: opt.value,
|
|
251
|
+
className: "flex items-center justify-between cds-option".concat(activeCryptoCurrency === opt.value ? " selected" : ""),
|
|
252
|
+
onClick: function onClick() {
|
|
253
|
+
return handleDenominationChange(opt.value);
|
|
254
|
+
}
|
|
255
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
256
|
+
className: "flex items-center gap-2"
|
|
257
|
+
}, activeCryptoCurrency === opt.value ? (/*#__PURE__*/React.createElement(LucideIcon, {
|
|
258
|
+
name: "Check",
|
|
259
|
+
className: "w-4 h-4"
|
|
260
|
+
})) : (/*#__PURE__*/React.createElement("div", {
|
|
261
|
+
className: "w-4 h-4"
|
|
262
|
+
})), opt.label), /*#__PURE__*/React.createElement(LucideIcon, {
|
|
263
|
+
name: opt.icon,
|
|
264
|
+
className: "cds-icon"
|
|
265
|
+
}), opt.value === "SOL" && (/*#__PURE__*/React.createElement(SVGIcon, {
|
|
266
|
+
name: "solana",
|
|
267
|
+
width: 16,
|
|
268
|
+
height: 16
|
|
269
|
+
})));
|
|
270
|
+
})))));
|
|
271
|
+
};
|
|
272
|
+
export default CryptoDenominationSelector;
|
|
@@ -45,7 +45,7 @@ export var FormatSearch = function FormatSearch(_a) {
|
|
|
45
45
|
var index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
46
46
|
if (_.isNil(index)) return;
|
|
47
47
|
var selectedFormat = toolbarFormat[selectedFormatIndex].value;
|
|
48
|
-
var formatString = "".concat(selectedFormat, "#,##0.").concat("0".repeat(decimalPlace));
|
|
48
|
+
var formatString = "".concat(selectedFormat, " #,##0.").concat("0".repeat(decimalPlace));
|
|
49
49
|
_.forEach(ctx.luckysheet_select_save, function (selection) {
|
|
50
50
|
var _a, _b, _c, _d;
|
|
51
51
|
for (var r = selection.row[0]; r <= selection.row[1]; r += 1) {
|
|
@@ -98,15 +98,19 @@ export var FormatSearch = function FormatSearch(_a) {
|
|
|
98
98
|
}
|
|
99
99
|
}, /*#__PURE__*/React.createElement(SelectTrigger, {
|
|
100
100
|
className: "w-full"
|
|
101
|
-
}, /*#__PURE__*/React.createElement(SelectValue,
|
|
101
|
+
}, /*#__PURE__*/React.createElement(SelectValue, {
|
|
102
|
+
className: "flex items-center gap-2"
|
|
103
|
+
}, /*#__PURE__*/React.createElement("span", null, (_b = toolbarFormat[selectedFormatIndex]) === null || _b === void 0 ? void 0 : _b.name), /*#__PURE__*/React.createElement("span", {
|
|
104
|
+
className: "text-body-sm color-text-secondary ml-1"
|
|
105
|
+
}, "(", (_c = toolbarFormat[selectedFormatIndex]) === null || _c === void 0 ? void 0 : _c.value, ")"))), /*#__PURE__*/React.createElement(SelectContent, null, toolbarFormat.map(function (v, index) {
|
|
102
106
|
return /*#__PURE__*/React.createElement(SelectItem, {
|
|
103
107
|
key: v.name,
|
|
104
108
|
value: String(index)
|
|
105
109
|
}, /*#__PURE__*/React.createElement("div", {
|
|
106
|
-
className: "flex justify-between w-full"
|
|
110
|
+
className: "flex justify-between w-full items-center gap-2"
|
|
107
111
|
}, /*#__PURE__*/React.createElement("span", null, v.name), /*#__PURE__*/React.createElement("span", {
|
|
108
|
-
className: "text-body-sm text-
|
|
109
|
-
}, v.value)));
|
|
112
|
+
className: "text-body-sm color-text-secondary"
|
|
113
|
+
}, "(", v.value, ")")));
|
|
110
114
|
}))))), /*#__PURE__*/React.createElement(Divider, {
|
|
111
115
|
className: "w-full border-t-[1px] my-4"
|
|
112
116
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -1897,6 +1897,65 @@ var SVGDefines = function SVGDefines(_a) {
|
|
|
1897
1897
|
}), /*#__PURE__*/React.createElement("path", {
|
|
1898
1898
|
d: "M8.00147 1.3335C8.31859 1.33426 8.59155 1.55835 8.65382 1.86931C8.95517 3.3758 9.86768 4.83997 11.0835 5.81267L11.2677 5.96501C12.171 6.73236 12.8015 7.61685 13.1121 8.58741L12.4767 8.79053L11.842 8.99431C11.6214 8.30509 11.1562 7.61973 10.4045 6.98129L10.2508 6.85434C9.31898 6.10886 8.53727 5.12515 8.00017 4.03337C7.83296 4.35237 7.44178 4.48213 7.11671 4.32243C6.78643 4.15985 6.6502 3.76015 6.81267 3.42986C7.05681 2.9339 7.23662 2.40833 7.34717 1.86671L7.3615 1.80941C7.44507 1.52891 7.70415 1.33298 8.00147 1.3335Z",
|
|
1899
1899
|
fill: "#363B3F"
|
|
1900
|
-
})))
|
|
1900
|
+
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
1901
|
+
id: "solana",
|
|
1902
|
+
width: "16",
|
|
1903
|
+
height: "16",
|
|
1904
|
+
viewBox: "0 0 16 16",
|
|
1905
|
+
fill: "none"
|
|
1906
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
1907
|
+
"clip-path": "url(#clip0_568_119011)"
|
|
1908
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
1909
|
+
d: "M2.59975 11.6853C2.69631 11.5775 2.82907 11.5146 2.96988 11.5146H15.7393C15.9726 11.5146 16.0893 11.8291 15.9244 12.0132L13.4019 14.8294C13.3053 14.9372 13.1725 15.0001 13.0317 15.0001H0.262315C0.0289729 15.0001 -0.0876979 14.6856 0.0772505 14.5015L2.59975 11.6853Z",
|
|
1910
|
+
fill: "url(#paint0_linear_568_119011)"
|
|
1911
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1912
|
+
d: "M2.59975 1.17068C2.70033 1.06288 2.8331 1 2.96988 1H15.7393C15.9726 1 16.0893 1.3144 15.9244 1.49856L13.4019 4.31473C13.3053 4.42252 13.1725 4.4854 13.0317 4.4854H0.262315C0.0289729 4.4854 -0.0876979 4.171 0.0772505 3.98685L2.59975 1.17068Z",
|
|
1913
|
+
fill: "url(#paint1_linear_568_119011)"
|
|
1914
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1915
|
+
d: "M13.4019 6.39431C13.3053 6.28651 13.1725 6.22363 13.0317 6.22363H0.262315C0.0289729 6.22363 -0.0876979 6.53804 0.0772505 6.72219L2.59975 9.53836C2.69631 9.64615 2.82907 9.70903 2.96988 9.70903H15.7393C15.9726 9.70903 16.0893 9.39463 15.9244 9.21048L13.4019 6.39431Z",
|
|
1916
|
+
fill: "url(#paint2_linear_568_119011)"
|
|
1917
|
+
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
1918
|
+
id: "paint0_linear_568_119011",
|
|
1919
|
+
x1: "14.5195",
|
|
1920
|
+
y1: "-0.682254",
|
|
1921
|
+
x2: "4.0567",
|
|
1922
|
+
y2: "17.2684",
|
|
1923
|
+
gradientUnits: "userSpaceOnUse"
|
|
1924
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
1925
|
+
"stop-color": "#00FFA3"
|
|
1926
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
1927
|
+
offset: "1",
|
|
1928
|
+
"stop-color": "#DC1FFF"
|
|
1929
|
+
})), /*#__PURE__*/React.createElement("linearGradient", {
|
|
1930
|
+
id: "paint1_linear_568_119011",
|
|
1931
|
+
x1: "10.6552",
|
|
1932
|
+
y1: "-2.93462",
|
|
1933
|
+
x2: "0.192482",
|
|
1934
|
+
y2: "15.016",
|
|
1935
|
+
gradientUnits: "userSpaceOnUse"
|
|
1936
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
1937
|
+
"stop-color": "#00FFA3"
|
|
1938
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
1939
|
+
offset: "1",
|
|
1940
|
+
"stop-color": "#DC1FFF"
|
|
1941
|
+
})), /*#__PURE__*/React.createElement("linearGradient", {
|
|
1942
|
+
id: "paint2_linear_568_119011",
|
|
1943
|
+
x1: "12.575",
|
|
1944
|
+
y1: "-1.81561",
|
|
1945
|
+
x2: "2.11229",
|
|
1946
|
+
y2: "16.135",
|
|
1947
|
+
gradientUnits: "userSpaceOnUse"
|
|
1948
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
1949
|
+
"stop-color": "#00FFA3"
|
|
1950
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
1951
|
+
offset: "1",
|
|
1952
|
+
"stop-color": "#DC1FFF"
|
|
1953
|
+
})), /*#__PURE__*/React.createElement("clipPath", {
|
|
1954
|
+
id: "clip0_568_119011"
|
|
1955
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
1956
|
+
width: "16",
|
|
1957
|
+
height: "16",
|
|
1958
|
+
fill: "white"
|
|
1959
|
+
}))))));
|
|
1901
1960
|
};
|
|
1902
1961
|
export default SVGDefines;
|
|
@@ -57,7 +57,28 @@ var SheetTab = function SheetTab() {
|
|
|
57
57
|
var _a;
|
|
58
58
|
(_a = settings.onSheetCountChange) === null || _a === void 0 ? void 0 : _a.call(settings, context.luckysheetfile.length);
|
|
59
59
|
}, [context.luckysheetfile.length]);
|
|
60
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "w-full",
|
|
62
|
+
id: "denomination-warning",
|
|
63
|
+
style: {
|
|
64
|
+
position: "fixed",
|
|
65
|
+
display: "none",
|
|
66
|
+
backgroundColor: "#F8F9FA",
|
|
67
|
+
borderBottom: "1px solid #E8EBEC",
|
|
68
|
+
color: "#77818A",
|
|
69
|
+
fontFamily: "Helvetica Neue",
|
|
70
|
+
fontSize: "var(--font-size-2xsm, 12px)",
|
|
71
|
+
fontStyle: "normal",
|
|
72
|
+
fontWeight: "400",
|
|
73
|
+
bottom: "31px"
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: "max-w-7xl mx-auto px-4 py-1"
|
|
77
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
78
|
+
className: "text-sm text-center"
|
|
79
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
80
|
+
className: "font-medium"
|
|
81
|
+
}, "Disclaimer:"), " Prices aren't updated in real time, so they might be slightly different from the source when you check. Updates can be delayed by up to 20 minutes."))), /*#__PURE__*/React.createElement("div", {
|
|
61
82
|
className: "luckysheet-sheet-area luckysheet-noselected-text",
|
|
62
83
|
onContextMenu: function onContextMenu(e) {
|
|
63
84
|
return e.preventDefault();
|
|
@@ -138,6 +159,6 @@ var SheetTab = function SheetTab() {
|
|
|
138
159
|
height: 12
|
|
139
160
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
140
161
|
className: "fortune-sheet-area-right"
|
|
141
|
-
}, /*#__PURE__*/React.createElement(ZoomControl, null)));
|
|
162
|
+
}, /*#__PURE__*/React.createElement(ZoomControl, null))));
|
|
142
163
|
};
|
|
143
164
|
export default SheetTab;
|
|
@@ -18,8 +18,11 @@ var Combo = function Combo(_a) {
|
|
|
18
18
|
open = _c[0],
|
|
19
19
|
setOpen = _c[1];
|
|
20
20
|
var buttonRef = useRef(null);
|
|
21
|
+
var handleOpenChange = function handleOpenChange(newOpen) {
|
|
22
|
+
setOpen(newOpen);
|
|
23
|
+
};
|
|
21
24
|
var isLucideIcon = useMemo(function () {
|
|
22
|
-
return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip", "font-color", "background", "border-all", "merge-all", "format", "conditionFormat", "filter", "comment", "image", "formula-sum", "dune", "template", "font-color", "background"].includes(iconId);
|
|
25
|
+
return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip", "font-color", "background", "border-all", "merge-all", "format", "conditionFormat", "filter", "comment", "image", "formula-sum", "dune", "template", "font-color", "background", "currency"].includes(iconId);
|
|
23
26
|
}, [iconId]);
|
|
24
27
|
var trigger = !isLucideIcon ? (/*#__PURE__*/React.createElement(Tooltip, {
|
|
25
28
|
text: tooltip,
|
|
@@ -75,7 +78,8 @@ var Combo = function Combo(_a) {
|
|
|
75
78
|
return setOpen(!open);
|
|
76
79
|
},
|
|
77
80
|
className: cn("fortune-toolbar-combo-button", {
|
|
78
|
-
"custom-color-button": iconId === "font-color" && fillColor
|
|
81
|
+
"custom-color-button": iconId === "font-color" && fillColor,
|
|
82
|
+
"min-w-fit rounded-l-none": iconId === "currency"
|
|
79
83
|
}),
|
|
80
84
|
style: {
|
|
81
85
|
color: iconId === "font-color" ? fillColor : undefined
|
|
@@ -86,7 +90,8 @@ var Combo = function Combo(_a) {
|
|
|
86
90
|
className: "fortune-toolbar-item"
|
|
87
91
|
}, /*#__PURE__*/React.createElement(Popover, {
|
|
88
92
|
open: open,
|
|
89
|
-
onOpenChange:
|
|
93
|
+
onOpenChange: handleOpenChange,
|
|
94
|
+
modal: true
|
|
90
95
|
}, /*#__PURE__*/React.createElement(PopoverTrigger, {
|
|
91
96
|
asChild: true
|
|
92
97
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -96,7 +101,16 @@ var Combo = function Combo(_a) {
|
|
|
96
101
|
side: "bottom",
|
|
97
102
|
sideOffset: 4,
|
|
98
103
|
alignOffset: -16,
|
|
99
|
-
className: "fortune-toolbar-combo-popup border-none"
|
|
104
|
+
className: "fortune-toolbar-combo-popup border-none",
|
|
105
|
+
onMouseDown: function onMouseDown(e) {
|
|
106
|
+
return e.stopPropagation();
|
|
107
|
+
},
|
|
108
|
+
onMouseUp: function onMouseUp(e) {
|
|
109
|
+
return e.stopPropagation();
|
|
110
|
+
},
|
|
111
|
+
onClick: function onClick(e) {
|
|
112
|
+
return e.stopPropagation();
|
|
113
|
+
}
|
|
100
114
|
}, children === null || children === void 0 ? void 0 : children(setOpen))));
|
|
101
115
|
};
|
|
102
116
|
export default Combo;
|
|
@@ -403,3 +403,9 @@
|
|
|
403
403
|
.custom-color-button > svg > path:first-child {
|
|
404
404
|
display: none !important;
|
|
405
405
|
}
|
|
406
|
+
|
|
407
|
+
#search-input-container [cmdk-input-wrapper] {
|
|
408
|
+
border: 1px solid hsl(var(--color-border-default));
|
|
409
|
+
border-radius: 8px;
|
|
410
|
+
margin: 8px 8px 0px 8px;
|
|
411
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./index.css";
|
|
3
|
-
export declare const getLucideIcon: (title: string) => "" | "Undo" | "Redo" | "PaintRoller" | "Bold" | "Italic" | "Strikethrough" | "Underline" | "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "Baseline" | "PaintBucket" | "Border" | "MergeHorizontal" | "
|
|
3
|
+
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
4
|
declare const Toolbar: React.FC<{
|
|
5
5
|
setMoreItems: React.Dispatch<React.SetStateAction<React.ReactNode>>;
|
|
6
6
|
moreItemsOpen: boolean;
|