@lukso/transaction-view-core 0.4.1 → 0.5.0-dev.5ea12c5
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/.turbo/turbo-build.log +16 -16
- package/.turbo/turbo-typecheck.log +4 -0
- package/CHANGELOG.md +15 -0
- package/dist/index.cjs +39 -159
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -9
- package/dist/index.d.ts +0 -9
- package/dist/index.js +66 -191
- package/dist/index.js.map +1 -1
- package/dist/shared/index.cjs +23 -60
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +4 -16
- package/dist/shared/index.d.ts +4 -16
- package/dist/shared/index.js +35 -72
- package/dist/shared/index.js.map +1 -1
- package/package.json +5 -4
- package/src/components/asset-card.ts +2 -22
- package/src/components/contract-card.ts +2 -67
- package/src/components/info-panel.ts +1 -21
- package/src/components/transaction-playback.ts +4 -4
- package/src/index.ts +1 -1
- package/src/shared/address-display.ts +3 -6
- package/src/shared/address-view.ts +2 -18
- package/src/shared/custom-select.ts +1 -1
- package/src/shared/function-name-view.ts +1 -1
- package/src/shared/gas-provider-view.ts +4 -7
- package/src/shared/icon-view.ts +7 -9
- package/src/shared/image-list.ts +3 -3
- package/src/shared/load-web-components.ts +3 -2
- package/src/shared/notification-view.ts +1 -1
- package/src/shared/progress-view.ts +1 -10
- package/src/shared/scroll-to-bottom-button.ts +1 -1
- package/src/shared/signal-controller.ts +3 -1
- package/src/shared/transaction-view-controller.ts +1 -1
- package/src/shared/url-view.ts +3 -3
- package/src/shared/value-view.ts +6 -12
- package/src/styles/styles.css +1 -1
- package/src/vue-entry.ts +0 -1
- package/tsup.config.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
useImageLoader
|
|
17
17
|
} from "@lukso/transaction-view-headless";
|
|
18
18
|
import { css, html, LitElement } from "lit";
|
|
19
|
-
import { property
|
|
19
|
+
import { property } from "lit/decorators.js";
|
|
20
20
|
|
|
21
21
|
// src/shared/safe-custom-element.ts
|
|
22
22
|
function safeCustomElement(tagName) {
|
|
@@ -36,13 +36,13 @@ var AddressDisplay = class extends LitElement {
|
|
|
36
36
|
this.showCopyButton = false;
|
|
37
37
|
this.nameOnly = false;
|
|
38
38
|
this.maxWidth = 200;
|
|
39
|
-
this.isLoadingImage = false;
|
|
40
39
|
// Composables
|
|
41
40
|
this.imageLoader = useImageLoader();
|
|
42
41
|
this.addressResolver = useAddressResolver();
|
|
42
|
+
this.isLoadingImage = false;
|
|
43
43
|
// Task for loading profile image
|
|
44
44
|
this.imageTask = new Task(this, {
|
|
45
|
-
task: async ([resolved]
|
|
45
|
+
task: async ([resolved]) => {
|
|
46
46
|
if (!resolved) return null;
|
|
47
47
|
this.isLoadingImage = true;
|
|
48
48
|
try {
|
|
@@ -297,12 +297,6 @@ __decorateClass([
|
|
|
297
297
|
__decorateClass([
|
|
298
298
|
property({ type: Number, attribute: "max-width" })
|
|
299
299
|
], AddressDisplay.prototype, "maxWidth", 2);
|
|
300
|
-
__decorateClass([
|
|
301
|
-
state()
|
|
302
|
-
], AddressDisplay.prototype, "imageData", 2);
|
|
303
|
-
__decorateClass([
|
|
304
|
-
state()
|
|
305
|
-
], AddressDisplay.prototype, "isLoadingImage", 2);
|
|
306
300
|
AddressDisplay = __decorateClass([
|
|
307
301
|
safeCustomElement("address-display")
|
|
308
302
|
], AddressDisplay);
|
|
@@ -312,12 +306,12 @@ import { Task as Task2 } from "@lit/task";
|
|
|
312
306
|
import { useAddressResolver as useAddressResolver2 } from "@lukso/transaction-view-headless";
|
|
313
307
|
import makeBlockie from "ethereum-blockies-base64";
|
|
314
308
|
import { html as html2 } from "lit";
|
|
315
|
-
import { property as property2, state
|
|
309
|
+
import { property as property2, state } from "lit/decorators.js";
|
|
316
310
|
|
|
317
311
|
// src/shared/load-web-components.ts
|
|
318
312
|
var originalDefine = typeof customElements !== "undefined" ? customElements.define.bind(customElements) : null;
|
|
319
313
|
if (typeof customElements !== "undefined" && originalDefine) {
|
|
320
|
-
customElements.define =
|
|
314
|
+
customElements.define = (name, constructor, options) => {
|
|
321
315
|
if (!customElements.get(name)) {
|
|
322
316
|
originalDefine(name, constructor, options);
|
|
323
317
|
}
|
|
@@ -369,14 +363,14 @@ var AddressView = class extends CoreLitElement {
|
|
|
369
363
|
this.addressResolver = useAddressResolver2();
|
|
370
364
|
// Task for resolving address data
|
|
371
365
|
this.addressTask = new Task2(this, {
|
|
372
|
-
task: async ([address]
|
|
366
|
+
task: async ([address]) => {
|
|
373
367
|
if (!address) return null;
|
|
374
368
|
this.isLoadingAddress = true;
|
|
375
369
|
try {
|
|
376
370
|
const resolved = await this.addressResolver.resolveAddress(address);
|
|
377
371
|
this.requestUpdate();
|
|
378
372
|
return resolved;
|
|
379
|
-
} catch (
|
|
373
|
+
} catch (_error) {
|
|
380
374
|
return null;
|
|
381
375
|
} finally {
|
|
382
376
|
this.isLoadingAddress = false;
|
|
@@ -403,20 +397,6 @@ var AddressView = class extends CoreLitElement {
|
|
|
403
397
|
const computedName = this.addressResolver.formatDisplayName(resolved);
|
|
404
398
|
return this.label || computedName || "Anonymous";
|
|
405
399
|
}
|
|
406
|
-
/**
|
|
407
|
-
* Check if this is a contract address (non-profile)
|
|
408
|
-
*/
|
|
409
|
-
get isContract() {
|
|
410
|
-
const resolved = this.addressTask.value;
|
|
411
|
-
return resolved ? resolved.__gqltype !== "Profile" : false;
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Check if this should show the address hash (profiles show hash, contracts don't)
|
|
415
|
-
*/
|
|
416
|
-
get shouldShowAddressHash() {
|
|
417
|
-
const resolved = this.addressTask.value;
|
|
418
|
-
return resolved ? resolved.__gqltype === "Profile" : true;
|
|
419
|
-
}
|
|
420
400
|
/**
|
|
421
401
|
* Get prefix for the address display
|
|
422
402
|
*/
|
|
@@ -657,10 +637,10 @@ __decorateClass([
|
|
|
657
637
|
property2({ type: String, attribute: "name-color" })
|
|
658
638
|
], AddressView.prototype, "nameColor", 2);
|
|
659
639
|
__decorateClass([
|
|
660
|
-
|
|
640
|
+
state()
|
|
661
641
|
], AddressView.prototype, "isLoadingAddress", 2);
|
|
662
642
|
__decorateClass([
|
|
663
|
-
|
|
643
|
+
state()
|
|
664
644
|
], AddressView.prototype, "identicon", 2);
|
|
665
645
|
AddressView = __decorateClass([
|
|
666
646
|
safeCustomElement("address-view")
|
|
@@ -995,7 +975,7 @@ var GasProviderView = class extends CoreLitElement {
|
|
|
995
975
|
}
|
|
996
976
|
displayRelayerResetDate() {
|
|
997
977
|
const date = new Date(this.relayerResetDate);
|
|
998
|
-
return isNaN(date.getTime()) ? "N/A" : date.toLocaleDateString();
|
|
978
|
+
return Number.isNaN(date.getTime()) ? "N/A" : date.toLocaleDateString();
|
|
999
979
|
}
|
|
1000
980
|
render() {
|
|
1001
981
|
const formatted = this.formatToken(this.balance);
|
|
@@ -1014,9 +994,9 @@ var GasProviderView = class extends CoreLitElement {
|
|
|
1014
994
|
const options = [...relayerOptions, ...controllerOption];
|
|
1015
995
|
const selectedValue = this.selectedGasProvider ? this.selectedGasProvider.type === "controller" ? this.controllerAddress : (() => {
|
|
1016
996
|
const r = this.allRelayers.find(
|
|
1017
|
-
(x) => x.id === this.selectedGasProvider
|
|
997
|
+
(x) => x.id === this.selectedGasProvider?.id
|
|
1018
998
|
);
|
|
1019
|
-
return r?.website || r?.apiUrl || `relayer:${this.selectedGasProvider
|
|
999
|
+
return r?.website || r?.apiUrl || `relayer:${this.selectedGasProvider?.id}`;
|
|
1020
1000
|
})() : void 0;
|
|
1021
1001
|
return html5`
|
|
1022
1002
|
<div class="w-full">
|
|
@@ -1079,7 +1059,7 @@ import {
|
|
|
1079
1059
|
useImageLoader as useImageLoader2
|
|
1080
1060
|
} from "@lukso/transaction-view-headless";
|
|
1081
1061
|
import { html as html6 } from "lit";
|
|
1082
|
-
import { property as property6
|
|
1062
|
+
import { property as property6 } from "lit/decorators.js";
|
|
1083
1063
|
var IconView = class extends CoreLitElement {
|
|
1084
1064
|
constructor() {
|
|
1085
1065
|
super(...arguments);
|
|
@@ -1090,14 +1070,14 @@ var IconView = class extends CoreLitElement {
|
|
|
1090
1070
|
this.showIconIdenticon = true;
|
|
1091
1071
|
this.showLabelIdenticon = false;
|
|
1092
1072
|
this.forceUnresolved = false;
|
|
1093
|
-
this.isLoadingImage = false;
|
|
1094
|
-
this.isLoadingAddress = false;
|
|
1095
1073
|
// Composables
|
|
1096
1074
|
this.imageLoader = useImageLoader2();
|
|
1097
1075
|
this.addressResolver = useAddressResolver3();
|
|
1076
|
+
this.isLoadingAddress = false;
|
|
1077
|
+
this.isLoadingImage = false;
|
|
1098
1078
|
// Task for resolving address data
|
|
1099
1079
|
this.addressTask = new Task3(this, {
|
|
1100
|
-
task: async ([address]
|
|
1080
|
+
task: async ([address]) => {
|
|
1101
1081
|
if (!address) return null;
|
|
1102
1082
|
this.isLoadingAddress = true;
|
|
1103
1083
|
try {
|
|
@@ -1115,11 +1095,11 @@ var IconView = class extends CoreLitElement {
|
|
|
1115
1095
|
});
|
|
1116
1096
|
// Task for loading profile image
|
|
1117
1097
|
this.imageTask = new Task3(this, {
|
|
1118
|
-
task: async ([resolved]
|
|
1098
|
+
task: async ([resolved]) => {
|
|
1119
1099
|
if (!resolved) return null;
|
|
1120
1100
|
this.isLoadingImage = true;
|
|
1121
1101
|
try {
|
|
1122
|
-
let image;
|
|
1102
|
+
let image = null;
|
|
1123
1103
|
if (this.imageHint && resolved[this.imageHint]) {
|
|
1124
1104
|
const imageArray = resolved[this.imageHint];
|
|
1125
1105
|
if (Array.isArray(imageArray) && imageArray.length > 0) {
|
|
@@ -1257,15 +1237,6 @@ __decorateClass([
|
|
|
1257
1237
|
__decorateClass([
|
|
1258
1238
|
property6({ type: Number, attribute: "image-index" })
|
|
1259
1239
|
], IconView.prototype, "imageIndex", 2);
|
|
1260
|
-
__decorateClass([
|
|
1261
|
-
state5()
|
|
1262
|
-
], IconView.prototype, "imageData", 2);
|
|
1263
|
-
__decorateClass([
|
|
1264
|
-
state5()
|
|
1265
|
-
], IconView.prototype, "isLoadingImage", 2);
|
|
1266
|
-
__decorateClass([
|
|
1267
|
-
state5()
|
|
1268
|
-
], IconView.prototype, "isLoadingAddress", 2);
|
|
1269
1240
|
IconView = __decorateClass([
|
|
1270
1241
|
safeCustomElement("icon-view")
|
|
1271
1242
|
], IconView);
|
|
@@ -1374,7 +1345,7 @@ function useImageLoader3(host) {
|
|
|
1374
1345
|
|
|
1375
1346
|
// src/shared/notification-view.ts
|
|
1376
1347
|
import { html as html7 } from "lit";
|
|
1377
|
-
import { property as property7, state as
|
|
1348
|
+
import { property as property7, state as state2 } from "lit/decorators.js";
|
|
1378
1349
|
var NotificationView = class extends CoreLitElement {
|
|
1379
1350
|
constructor() {
|
|
1380
1351
|
super(...arguments);
|
|
@@ -1484,7 +1455,7 @@ __decorateClass([
|
|
|
1484
1455
|
property7({ attribute: "acknowledge-text" })
|
|
1485
1456
|
], NotificationView.prototype, "acknowledgeText", 2);
|
|
1486
1457
|
__decorateClass([
|
|
1487
|
-
|
|
1458
|
+
state2()
|
|
1488
1459
|
], NotificationView.prototype, "acknowledged", 2);
|
|
1489
1460
|
__decorateClass([
|
|
1490
1461
|
property7({ type: Boolean, reflect: true })
|
|
@@ -1513,14 +1484,6 @@ var ProgressView = class extends CoreLitElement {
|
|
|
1513
1484
|
`}
|
|
1514
1485
|
`;
|
|
1515
1486
|
}
|
|
1516
|
-
renderAddressLabel() {
|
|
1517
|
-
return html8`
|
|
1518
|
-
<value-view
|
|
1519
|
-
.value=${this.address}
|
|
1520
|
-
.unit=${this.unit}
|
|
1521
|
-
></value-view>
|
|
1522
|
-
`;
|
|
1523
|
-
}
|
|
1524
1487
|
render() {
|
|
1525
1488
|
const isError = (this.className || "").split(/\s+/).includes("error");
|
|
1526
1489
|
return html8`
|
|
@@ -1666,7 +1629,9 @@ var MultiSignalController = class {
|
|
|
1666
1629
|
});
|
|
1667
1630
|
}
|
|
1668
1631
|
hostDisconnected() {
|
|
1669
|
-
this.unsubscribes.forEach((unsubscribe) =>
|
|
1632
|
+
this.unsubscribes.forEach((unsubscribe) => {
|
|
1633
|
+
unsubscribe();
|
|
1634
|
+
});
|
|
1670
1635
|
this.unsubscribes = [];
|
|
1671
1636
|
}
|
|
1672
1637
|
getValue(index) {
|
|
@@ -1913,7 +1878,7 @@ function useTransactionSignal(host, signal) {
|
|
|
1913
1878
|
|
|
1914
1879
|
// src/shared/url-view.ts
|
|
1915
1880
|
import { html as html10 } from "lit";
|
|
1916
|
-
import { property as property10, state as
|
|
1881
|
+
import { property as property10, state as state3 } from "lit/decorators.js";
|
|
1917
1882
|
var UrlView = class extends CoreLitElement {
|
|
1918
1883
|
constructor() {
|
|
1919
1884
|
super(...arguments);
|
|
@@ -1943,14 +1908,14 @@ var UrlView = class extends CoreLitElement {
|
|
|
1943
1908
|
this.favicon = this.faviconCandidates[this.faviconIndex];
|
|
1944
1909
|
const hostname = u.hostname.replace(/^www\./, "");
|
|
1945
1910
|
const hostnamePretty = hostname.split(".").filter(Boolean).slice(-2).join(" ").replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
1946
|
-
if (this.label
|
|
1911
|
+
if (this.label?.trim()) {
|
|
1947
1912
|
this.displayName = this.label.trim();
|
|
1948
1913
|
} else {
|
|
1949
1914
|
this.displayName = hostnamePretty || this.url;
|
|
1950
1915
|
}
|
|
1951
1916
|
} catch {
|
|
1952
1917
|
this.favicon = void 0;
|
|
1953
|
-
this.displayName = this.label
|
|
1918
|
+
this.displayName = this.label?.trim() ? this.label : this.url;
|
|
1954
1919
|
}
|
|
1955
1920
|
}
|
|
1956
1921
|
handleImageError() {
|
|
@@ -2015,10 +1980,10 @@ __decorateClass([
|
|
|
2015
1980
|
property10({ type: Number, attribute: "max-width" })
|
|
2016
1981
|
], UrlView.prototype, "maxWidth", 2);
|
|
2017
1982
|
__decorateClass([
|
|
2018
|
-
|
|
1983
|
+
state3()
|
|
2019
1984
|
], UrlView.prototype, "favicon", 2);
|
|
2020
1985
|
__decorateClass([
|
|
2021
|
-
|
|
1986
|
+
state3()
|
|
2022
1987
|
], UrlView.prototype, "displayName", 2);
|
|
2023
1988
|
UrlView = __decorateClass([
|
|
2024
1989
|
safeCustomElement("url-view")
|
|
@@ -2028,7 +1993,7 @@ UrlView = __decorateClass([
|
|
|
2028
1993
|
import { Task as Task4 } from "@lit/task";
|
|
2029
1994
|
import { useAddressResolver as useAddressResolver4 } from "@lukso/transaction-view-headless";
|
|
2030
1995
|
import { html as html11 } from "lit";
|
|
2031
|
-
import { property as property11, state as
|
|
1996
|
+
import { property as property11, state as state4 } from "lit/decorators.js";
|
|
2032
1997
|
import { when } from "lit/directives/when.js";
|
|
2033
1998
|
function formatUnits(value, decimals = 18) {
|
|
2034
1999
|
const divisor = 10n ** BigInt(decimals);
|
|
@@ -2137,14 +2102,15 @@ var ValueView = class extends CoreLitElement {
|
|
|
2137
2102
|
if (value === null) return "null";
|
|
2138
2103
|
if (value === void 0) return "undefined";
|
|
2139
2104
|
switch (effectiveType) {
|
|
2140
|
-
case "currency":
|
|
2105
|
+
case "currency": {
|
|
2141
2106
|
const { numeric, symbol } = this.getCurrencyParts();
|
|
2142
2107
|
return `${numeric} ${symbol}`;
|
|
2108
|
+
}
|
|
2143
2109
|
case "bigint":
|
|
2144
2110
|
if (typeof value === "bigint") {
|
|
2145
|
-
return value.toString()
|
|
2111
|
+
return `${value.toString()}n`;
|
|
2146
2112
|
}
|
|
2147
|
-
return String(value)
|
|
2113
|
+
return `${String(value)}n`;
|
|
2148
2114
|
case "boolean":
|
|
2149
2115
|
return value ? "true" : "false";
|
|
2150
2116
|
case "number":
|
|
@@ -2172,7 +2138,7 @@ var ValueView = class extends CoreLitElement {
|
|
|
2172
2138
|
try {
|
|
2173
2139
|
if (typeof value === "bigint") {
|
|
2174
2140
|
numeric = formatUnits(value, effectiveDecimals);
|
|
2175
|
-
} else if (typeof value === "string" && !isNaN(Number(value))) {
|
|
2141
|
+
} else if (typeof value === "string" && !Number.isNaN(Number(value))) {
|
|
2176
2142
|
const bigintValue = BigInt(value);
|
|
2177
2143
|
numeric = formatUnits(bigintValue, effectiveDecimals);
|
|
2178
2144
|
}
|
|
@@ -2402,10 +2368,7 @@ __decorateClass([
|
|
|
2402
2368
|
property11()
|
|
2403
2369
|
], ValueView.prototype, "address", 2);
|
|
2404
2370
|
__decorateClass([
|
|
2405
|
-
|
|
2406
|
-
], ValueView.prototype, "resolvedMetadata", 2);
|
|
2407
|
-
__decorateClass([
|
|
2408
|
-
state8()
|
|
2371
|
+
state4()
|
|
2409
2372
|
], ValueView.prototype, "_hasSlotContent", 2);
|
|
2410
2373
|
ValueView = __decorateClass([
|
|
2411
2374
|
safeCustomElement("value-view")
|
|
@@ -2415,7 +2378,7 @@ ValueView = __decorateClass([
|
|
|
2415
2378
|
import { Task as Task5 } from "@lit/task";
|
|
2416
2379
|
import { useAddressResolver as useAddressResolver5 } from "@lukso/transaction-view-headless";
|
|
2417
2380
|
import { html as html12 } from "lit";
|
|
2418
|
-
import { property as property12, state as
|
|
2381
|
+
import { property as property12, state as state5 } from "lit/decorators.js";
|
|
2419
2382
|
import { repeat } from "lit/directives/repeat.js";
|
|
2420
2383
|
var ImageList = class extends CoreLitElement {
|
|
2421
2384
|
constructor() {
|
|
@@ -2427,7 +2390,7 @@ var ImageList = class extends CoreLitElement {
|
|
|
2427
2390
|
this.addressResolver = useAddressResolver5();
|
|
2428
2391
|
// Task for resolving address data
|
|
2429
2392
|
this.addressTask = new Task5(this, {
|
|
2430
|
-
task: async ([address]
|
|
2393
|
+
task: async ([address]) => {
|
|
2431
2394
|
if (!address) return null;
|
|
2432
2395
|
this.isLoading = true;
|
|
2433
2396
|
try {
|
|
@@ -2484,7 +2447,7 @@ var ImageList = class extends CoreLitElement {
|
|
|
2484
2447
|
* Render a single image item
|
|
2485
2448
|
*/
|
|
2486
2449
|
renderImageItem(item, index) {
|
|
2487
|
-
const
|
|
2450
|
+
const _itemIndex = item.index !== void 0 ? item.index : index;
|
|
2488
2451
|
const isImage = this.isImageFile(item);
|
|
2489
2452
|
if (isImage) {
|
|
2490
2453
|
const imageSrc = item.src || item.url;
|
|
@@ -2590,19 +2553,15 @@ __decorateClass([
|
|
|
2590
2553
|
property12({ type: Boolean, attribute: "is-card-view" })
|
|
2591
2554
|
], ImageList.prototype, "isCardView", 2);
|
|
2592
2555
|
__decorateClass([
|
|
2593
|
-
|
|
2556
|
+
state5()
|
|
2594
2557
|
], ImageList.prototype, "isLoading", 2);
|
|
2595
2558
|
ImageList = __decorateClass([
|
|
2596
2559
|
safeCustomElement("image-list")
|
|
2597
2560
|
], ImageList);
|
|
2598
2561
|
|
|
2599
2562
|
// src/components/info-panel.ts
|
|
2600
|
-
import {
|
|
2601
|
-
import {
|
|
2602
|
-
useAddressResolver as useAddressResolver6
|
|
2603
|
-
} from "@lukso/transaction-view-headless";
|
|
2604
|
-
import { css as css4, html as html13, LitElement as LitElement3 } from "lit";
|
|
2605
|
-
import { property as property13, state as state10 } from "lit/decorators.js";
|
|
2563
|
+
import { css as css3, html as html13, LitElement as LitElement3 } from "lit";
|
|
2564
|
+
import { property as property13, state as state6 } from "lit/decorators.js";
|
|
2606
2565
|
import { classMap } from "lit/directives/class-map.js";
|
|
2607
2566
|
import { repeat as repeat2 } from "lit/directives/repeat.js";
|
|
2608
2567
|
import { when as when2 } from "lit/directives/when.js";
|
|
@@ -2613,17 +2572,6 @@ var InfoPanel = class extends LitElement3 {
|
|
|
2613
2572
|
this.open = false;
|
|
2614
2573
|
this.standard = "";
|
|
2615
2574
|
this.type = "transfer";
|
|
2616
|
-
this._isAnimating = false;
|
|
2617
|
-
this._resolutionTask = new Task6(this, {
|
|
2618
|
-
task: async ([address]) => {
|
|
2619
|
-
if (!address) return null;
|
|
2620
|
-
const { resolveAddress } = useAddressResolver6();
|
|
2621
|
-
const data = await resolveAddress(address);
|
|
2622
|
-
this._resolvedData = data;
|
|
2623
|
-
return data;
|
|
2624
|
-
},
|
|
2625
|
-
args: () => [this.address]
|
|
2626
|
-
});
|
|
2627
2575
|
}
|
|
2628
2576
|
_extractBaseAddress(addressOrComposite) {
|
|
2629
2577
|
return addressOrComposite.split("-")[0];
|
|
@@ -2800,7 +2748,7 @@ var InfoPanel = class extends LitElement3 {
|
|
|
2800
2748
|
`;
|
|
2801
2749
|
}
|
|
2802
2750
|
};
|
|
2803
|
-
InfoPanel.styles =
|
|
2751
|
+
InfoPanel.styles = css3`
|
|
2804
2752
|
:host {
|
|
2805
2753
|
display: block;
|
|
2806
2754
|
position: relative;
|
|
@@ -2985,10 +2933,7 @@ __decorateClass([
|
|
|
2985
2933
|
property13({ type: String })
|
|
2986
2934
|
], InfoPanel.prototype, "type", 2);
|
|
2987
2935
|
__decorateClass([
|
|
2988
|
-
|
|
2989
|
-
], InfoPanel.prototype, "_isAnimating", 2);
|
|
2990
|
-
__decorateClass([
|
|
2991
|
-
state10()
|
|
2936
|
+
state6()
|
|
2992
2937
|
], InfoPanel.prototype, "_resolvedData", 2);
|
|
2993
2938
|
InfoPanel = __decorateClass([
|
|
2994
2939
|
safeCustomElement("info-panel")
|
|
@@ -2996,13 +2941,13 @@ InfoPanel = __decorateClass([
|
|
|
2996
2941
|
|
|
2997
2942
|
// src/components/asset-card.ts
|
|
2998
2943
|
import { html as html14 } from "lit";
|
|
2999
|
-
import { property as property14, state as
|
|
2944
|
+
import { property as property14, state as state7 } from "lit/decorators.js";
|
|
3000
2945
|
import { repeat as repeat3 } from "lit/directives/repeat.js";
|
|
3001
2946
|
import { when as when3 } from "lit/directives/when.js";
|
|
3002
2947
|
import "@lukso/web-components";
|
|
3003
|
-
import { Task as
|
|
2948
|
+
import { Task as Task6 } from "@lit/task";
|
|
3004
2949
|
import {
|
|
3005
|
-
useAddressResolver as
|
|
2950
|
+
useAddressResolver as useAddressResolver6
|
|
3006
2951
|
} from "@lukso/transaction-view-headless";
|
|
3007
2952
|
function formatUnits2(value, decimals = 18) {
|
|
3008
2953
|
const divisor = 10n ** BigInt(decimals);
|
|
@@ -3023,10 +2968,9 @@ var AssetCard = class extends CoreLitElement {
|
|
|
3023
2968
|
this.showInfoButton = true;
|
|
3024
2969
|
this.showCreator = true;
|
|
3025
2970
|
this.displayDetails = false;
|
|
3026
|
-
this._imageError = false;
|
|
3027
2971
|
// Composables
|
|
3028
|
-
this.addressResolver =
|
|
3029
|
-
this._resolutionTask = new
|
|
2972
|
+
this.addressResolver = useAddressResolver6();
|
|
2973
|
+
this._resolutionTask = new Task6(this, {
|
|
3030
2974
|
task: async ([address]) => {
|
|
3031
2975
|
if (!address) return null;
|
|
3032
2976
|
const { resolveAddress } = this.addressResolver;
|
|
@@ -3037,25 +2981,12 @@ var AssetCard = class extends CoreLitElement {
|
|
|
3037
2981
|
args: () => [this.address]
|
|
3038
2982
|
});
|
|
3039
2983
|
}
|
|
3040
|
-
_handleImageError() {
|
|
3041
|
-
this._imageError = true;
|
|
3042
|
-
}
|
|
3043
2984
|
_handleInfoClick() {
|
|
3044
2985
|
this.displayDetails = !this.displayDetails;
|
|
3045
2986
|
}
|
|
3046
2987
|
_extractBaseAddress(addressOrComposite) {
|
|
3047
2988
|
return addressOrComposite.split("-")[0];
|
|
3048
2989
|
}
|
|
3049
|
-
_extractTokenId(addressOrComposite) {
|
|
3050
|
-
const parts = addressOrComposite.split("-");
|
|
3051
|
-
return parts.length > 1 ? parts[1] : void 0;
|
|
3052
|
-
}
|
|
3053
|
-
_copyToClipboard(text) {
|
|
3054
|
-
if (navigator.clipboard) {
|
|
3055
|
-
navigator.clipboard.writeText(text);
|
|
3056
|
-
this.dispatchEvent(new CustomEvent("copied", { detail: { text } }));
|
|
3057
|
-
}
|
|
3058
|
-
}
|
|
3059
2990
|
_renderAddressSection() {
|
|
3060
2991
|
const data = this._resolutionTask.value;
|
|
3061
2992
|
if (!data) return "";
|
|
@@ -3305,7 +3236,7 @@ var AssetCard = class extends CoreLitElement {
|
|
|
3305
3236
|
${when3(
|
|
3306
3237
|
this.amount,
|
|
3307
3238
|
() => html14`
|
|
3308
|
-
<span class="">${formatUnits2(BigInt(this.amount), this._resolvedData?.decimals)}</span>
|
|
3239
|
+
<span class="">${formatUnits2(BigInt(this.amount || 0), this._resolvedData?.decimals)}</span>
|
|
3309
3240
|
<span class="ml-1 text-neutral-60 max-w-[60px] whitespace-nowrap overflow-hidden text-ellipsis text-[14px] font-semibold">${this._resolvedData?.lsp4TokenSymbol || ""}</span>
|
|
3310
3241
|
`,
|
|
3311
3242
|
() => html14`${this._resolvedData?.lsp4TokenSymbol || ""}`
|
|
@@ -3356,20 +3287,17 @@ __decorateClass([
|
|
|
3356
3287
|
property14({ type: Boolean, attribute: "show-creator" })
|
|
3357
3288
|
], AssetCard.prototype, "showCreator", 2);
|
|
3358
3289
|
__decorateClass([
|
|
3359
|
-
|
|
3290
|
+
state7()
|
|
3360
3291
|
], AssetCard.prototype, "displayDetails", 2);
|
|
3361
3292
|
__decorateClass([
|
|
3362
|
-
|
|
3293
|
+
state7()
|
|
3363
3294
|
], AssetCard.prototype, "_resolvedData", 2);
|
|
3364
|
-
__decorateClass([
|
|
3365
|
-
state11()
|
|
3366
|
-
], AssetCard.prototype, "_imageError", 2);
|
|
3367
3295
|
AssetCard = __decorateClass([
|
|
3368
3296
|
safeCustomElement("asset-card")
|
|
3369
3297
|
], AssetCard);
|
|
3370
3298
|
|
|
3371
3299
|
// src/components/description-view.ts
|
|
3372
|
-
import { css as
|
|
3300
|
+
import { css as css4, html as html15, LitElement as LitElement4 } from "lit";
|
|
3373
3301
|
import { property as property15 } from "lit/decorators.js";
|
|
3374
3302
|
import { repeat as repeat4 } from "lit/directives/repeat.js";
|
|
3375
3303
|
import { when as when4 } from "lit/directives/when.js";
|
|
@@ -3576,7 +3504,7 @@ var DescriptionView = class extends LitElement4 {
|
|
|
3576
3504
|
`;
|
|
3577
3505
|
}
|
|
3578
3506
|
};
|
|
3579
|
-
DescriptionView.styles =
|
|
3507
|
+
DescriptionView.styles = css4`
|
|
3580
3508
|
:host {
|
|
3581
3509
|
display: block;
|
|
3582
3510
|
font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
@@ -3868,8 +3796,8 @@ DescriptionView = __decorateClass([
|
|
|
3868
3796
|
], DescriptionView);
|
|
3869
3797
|
|
|
3870
3798
|
// src/components/universal-token-view.ts
|
|
3871
|
-
import { css as
|
|
3872
|
-
import { property as property16, state as
|
|
3799
|
+
import { css as css5, html as html16, LitElement as LitElement5 } from "lit";
|
|
3800
|
+
import { property as property16, state as state8 } from "lit/decorators.js";
|
|
3873
3801
|
import { when as when5 } from "lit/directives/when.js";
|
|
3874
3802
|
var UniversalTokenView = class extends LitElement5 {
|
|
3875
3803
|
constructor() {
|
|
@@ -3965,7 +3893,7 @@ var UniversalTokenView = class extends LitElement5 {
|
|
|
3965
3893
|
`;
|
|
3966
3894
|
}
|
|
3967
3895
|
};
|
|
3968
|
-
UniversalTokenView.styles =
|
|
3896
|
+
UniversalTokenView.styles = css5`
|
|
3969
3897
|
:host {
|
|
3970
3898
|
display: block;
|
|
3971
3899
|
font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
@@ -4077,20 +4005,15 @@ __decorateClass([
|
|
|
4077
4005
|
property16({ type: Object })
|
|
4078
4006
|
], UniversalTokenView.prototype, "data", 2);
|
|
4079
4007
|
__decorateClass([
|
|
4080
|
-
|
|
4008
|
+
state8()
|
|
4081
4009
|
], UniversalTokenView.prototype, "_infoPanelOpen", 2);
|
|
4082
4010
|
UniversalTokenView = __decorateClass([
|
|
4083
4011
|
safeCustomElement("universal-token-view")
|
|
4084
4012
|
], UniversalTokenView);
|
|
4085
4013
|
|
|
4086
4014
|
// src/components/contract-card.ts
|
|
4087
|
-
import {
|
|
4088
|
-
import {
|
|
4089
|
-
useAddressResolver as useAddressResolver8,
|
|
4090
|
-
useImageLoader as useImageLoader4
|
|
4091
|
-
} from "@lukso/transaction-view-headless";
|
|
4092
|
-
import { css as css7, html as html17, LitElement as LitElement6 } from "lit";
|
|
4093
|
-
import { property as property17, state as state13 } from "lit/decorators.js";
|
|
4015
|
+
import { css as css6, html as html17, LitElement as LitElement6 } from "lit";
|
|
4016
|
+
import { property as property17, state as state9 } from "lit/decorators.js";
|
|
4094
4017
|
var ContractCard = class extends LitElement6 {
|
|
4095
4018
|
constructor() {
|
|
4096
4019
|
super(...arguments);
|
|
@@ -4101,54 +4024,6 @@ var ContractCard = class extends LitElement6 {
|
|
|
4101
4024
|
this.hasOverlay = false;
|
|
4102
4025
|
this.customClass = "";
|
|
4103
4026
|
this.headerClass = "";
|
|
4104
|
-
this._resolutionTask = new Task8(this, {
|
|
4105
|
-
task: async ([address, resolved]) => {
|
|
4106
|
-
if (resolved) {
|
|
4107
|
-
this._resolvedData = resolved;
|
|
4108
|
-
return resolved;
|
|
4109
|
-
}
|
|
4110
|
-
const { resolveAddress } = useAddressResolver8();
|
|
4111
|
-
const baseAddress = this._extractBaseAddress(address);
|
|
4112
|
-
const data = await resolveAddress(baseAddress);
|
|
4113
|
-
this._resolvedData = data;
|
|
4114
|
-
return data;
|
|
4115
|
-
},
|
|
4116
|
-
args: () => [this.address, this.resolved]
|
|
4117
|
-
});
|
|
4118
|
-
this._profileImageTask = new Task8(this, {
|
|
4119
|
-
task: async ([resolved]) => {
|
|
4120
|
-
const { loadProfileImage } = useImageLoader4();
|
|
4121
|
-
const data = resolved || this._resolvedData;
|
|
4122
|
-
if (!data) return null;
|
|
4123
|
-
const image = await loadProfileImage(data, {
|
|
4124
|
-
width: 256,
|
|
4125
|
-
height: 256,
|
|
4126
|
-
dpr: window.devicePixelRatio || 1
|
|
4127
|
-
});
|
|
4128
|
-
if (image?.src) {
|
|
4129
|
-
this._profileImageUrl = image.src;
|
|
4130
|
-
}
|
|
4131
|
-
return image;
|
|
4132
|
-
},
|
|
4133
|
-
args: () => [this._resolvedData]
|
|
4134
|
-
});
|
|
4135
|
-
this._backgroundImageTask = new Task8(this, {
|
|
4136
|
-
task: async ([resolved]) => {
|
|
4137
|
-
const { loadBackgroundImage } = useImageLoader4();
|
|
4138
|
-
const data = resolved || this._resolvedData;
|
|
4139
|
-
if (!data) return null;
|
|
4140
|
-
const image = await loadBackgroundImage(data, {
|
|
4141
|
-
width: 800,
|
|
4142
|
-
height: 200,
|
|
4143
|
-
dpr: window.devicePixelRatio || 1
|
|
4144
|
-
});
|
|
4145
|
-
if (image?.src) {
|
|
4146
|
-
this._backgroundImageUrl = image.src;
|
|
4147
|
-
}
|
|
4148
|
-
return image;
|
|
4149
|
-
},
|
|
4150
|
-
args: () => [this._resolvedData]
|
|
4151
|
-
});
|
|
4152
4027
|
}
|
|
4153
4028
|
_extractBaseAddress(addressOrComposite) {
|
|
4154
4029
|
return addressOrComposite.split("-")[0];
|
|
@@ -4193,7 +4068,7 @@ var ContractCard = class extends LitElement6 {
|
|
|
4193
4068
|
`;
|
|
4194
4069
|
}
|
|
4195
4070
|
};
|
|
4196
|
-
ContractCard.styles =
|
|
4071
|
+
ContractCard.styles = css6`
|
|
4197
4072
|
:host {
|
|
4198
4073
|
display: block;
|
|
4199
4074
|
}
|
|
@@ -4232,20 +4107,20 @@ __decorateClass([
|
|
|
4232
4107
|
property17({ attribute: "header-class" })
|
|
4233
4108
|
], ContractCard.prototype, "headerClass", 2);
|
|
4234
4109
|
__decorateClass([
|
|
4235
|
-
|
|
4110
|
+
state9()
|
|
4236
4111
|
], ContractCard.prototype, "_resolvedData", 2);
|
|
4237
4112
|
__decorateClass([
|
|
4238
|
-
|
|
4113
|
+
state9()
|
|
4239
4114
|
], ContractCard.prototype, "_profileImageUrl", 2);
|
|
4240
4115
|
__decorateClass([
|
|
4241
|
-
|
|
4116
|
+
state9()
|
|
4242
4117
|
], ContractCard.prototype, "_backgroundImageUrl", 2);
|
|
4243
4118
|
ContractCard = __decorateClass([
|
|
4244
4119
|
safeCustomElement("contract-card")
|
|
4245
4120
|
], ContractCard);
|
|
4246
4121
|
|
|
4247
4122
|
// src/components/permissions-block.ts
|
|
4248
|
-
import { html as html18, nothing
|
|
4123
|
+
import { html as html18, nothing } from "lit";
|
|
4249
4124
|
import { property as property18 } from "lit/decorators.js";
|
|
4250
4125
|
var PermissionsBlock = class extends CoreLitElement {
|
|
4251
4126
|
constructor() {
|
|
@@ -4268,13 +4143,13 @@ var PermissionsBlock = class extends CoreLitElement {
|
|
|
4268
4143
|
name=${this.icon}
|
|
4269
4144
|
size="x-small"
|
|
4270
4145
|
color=${this.color}
|
|
4271
|
-
></lukso-icon>` :
|
|
4146
|
+
></lukso-icon>` : nothing}
|
|
4272
4147
|
<div class="ml-2 heading-inter-14-bold">${this.title}</div>
|
|
4273
4148
|
</div>
|
|
4274
4149
|
|
|
4275
4150
|
${this.description ? html18`<div class="text-[var(--neutral-40)] paragraph-inter-12-regular">
|
|
4276
4151
|
${this.description}
|
|
4277
|
-
</div>` :
|
|
4152
|
+
</div>` : nothing}
|
|
4278
4153
|
|
|
4279
4154
|
<div class="h-px w-full bg-[var(--neutral-90)] mt-4"></div>
|
|
4280
4155
|
|