From 0a42592dbf019b45de8b2b0ef8648b210d1a5552 Mon Sep 17 00:00:00 2001 From: o-az Date: Tue, 12 Nov 2024 17:41:55 -0800 Subject: [PATCH 1/4] feat: migrate to svelte 5 --- app/package-lock.json | 127 ++++++---- app/package.json | 6 +- .../lib/components/address-multichain.svelte | 10 +- app/src/lib/components/asset-card.svelte | 13 +- .../lib/components/balances-overview.svelte | 12 +- .../components/card-animated-border.svelte | 23 +- app/src/lib/components/chains-gate.svelte | 7 +- app/src/lib/components/connect/connect.svelte | 104 ++++---- .../lib/components/connect/connection.svelte | 51 ++-- .../connect/metamask-mobile-alert.svelte | 6 +- app/src/lib/components/details-heading.svelte | 10 +- app/src/lib/components/dev-tools.svelte | 7 +- .../lib/components/draft-page-notice.svelte | 6 +- .../lib/components/explorer-pagination.svelte | 2 + .../lib/components/explorer-precise.svelte | 23 +- .../explorer-table-paginated.svelte | 10 +- app/src/lib/components/footer.svelte | 5 +- app/src/lib/components/kbd.svelte | 11 +- app/src/lib/components/loading-bar.svelte | 6 +- app/src/lib/components/loading-dots.svelte | 8 +- app/src/lib/components/loading-logo.svelte | 8 +- .../components/navigation/navigation.svelte | 1 + app/src/lib/components/not-connected.svelte | 28 ++- app/src/lib/components/online-status.svelte | 34 +-- app/src/lib/components/packet-details.svelte | 8 +- app/src/lib/components/packet-path.svelte | 10 +- app/src/lib/components/precise.svelte | 34 ++- .../components/preloading-indicator.svelte | 6 +- app/src/lib/components/search/cmdk.svelte | 228 ++++++++++-------- .../lib/components/search/search-bar.svelte | 17 +- app/src/lib/components/spinner-svg.svelte | 8 +- .../components/spinning-logo/square.svelte | 17 +- .../spinning-outline-logo-three.svelte | 12 +- .../components/spinning-outline-logo.svelte | 2 +- app/src/lib/components/stats-bar-stat.svelte | 20 +- app/src/lib/components/stepper.svelte | 8 +- .../components/table-cells/cell-assets.svelte | 9 +- .../table-cells/cell-chain-index.svelte | 11 +- .../components/table-cells/cell-copy.svelte | 14 +- .../table-cells/cell-duration-text.svelte | 6 +- .../table-cells/cell-icon-tooltip.svelte | 112 +++++---- .../table-cells/cell-origin-channel.svelte | 11 +- .../table-cells/cell-origin-connection.svelte | 11 +- .../table-cells/cell-origin-transfer.svelte | 13 +- .../components/table-cells/cell-origin.svelte | 11 +- .../table-cells/cell-plain-text.svelte | 9 +- .../table-cells/cell-sequence.svelte | 11 +- .../components/table-cells/cell-status.svelte | 9 +- .../table-cells/cell-timestamp.svelte | 6 +- app/src/lib/components/tables/packets.svelte | 13 +- app/src/lib/components/time-elapsed.svelte | 10 +- .../lib/components/transfer-details.svelte | 6 +- .../transfers-table/transfers-table.svelte | 10 +- app/src/lib/components/truncate.svelte | 11 +- .../alert-dialog/alert-dialog-action.svelte | 20 +- .../alert-dialog/alert-dialog-cancel.svelte | 20 +- .../alert-dialog/alert-dialog-content.svelte | 24 +- .../alert-dialog-description.svelte | 14 +- .../alert-dialog/alert-dialog-footer.svelte | 14 +- .../alert-dialog/alert-dialog-header.svelte | 14 +- .../alert-dialog/alert-dialog-overlay.svelte | 17 +- .../alert-dialog/alert-dialog-portal.svelte | 10 +- .../ui/alert-dialog/alert-dialog-title.svelte | 16 +- .../ui/avatar/avatar-fallback.svelte | 14 +- .../components/ui/avatar/avatar-image.svelte | 15 +- .../lib/components/ui/avatar/avatar.svelte | 16 +- app/src/lib/components/ui/badge/badge.svelte | 24 +- .../lib/components/ui/button/button.svelte | 38 ++- .../components/ui/card/card-content.svelte | 14 +- .../ui/card/card-description.svelte | 14 +- .../lib/components/ui/card/card-footer.svelte | 14 +- .../lib/components/ui/card/card-header.svelte | 14 +- .../lib/components/ui/card/card-title.svelte | 16 +- app/src/lib/components/ui/card/card.svelte | 14 +- .../components/ui/checkbox/checkbox.svelte | 31 ++- .../ui/collapsible/collapsible-content.svelte | 16 +- .../ui/command/command-dialog.svelte | 27 ++- .../ui/command/command-empty.svelte | 14 +- .../ui/command/command-group.svelte | 14 +- .../ui/command/command-input.svelte | 13 +- .../components/ui/command/command-item.svelte | 24 +- .../components/ui/command/command-list.svelte | 14 +- .../ui/command/command-separator.svelte | 11 +- .../ui/command/command-shortcut.svelte | 14 +- .../lib/components/ui/command/command.svelte | 16 +- .../ui/dialog/dialog-content.svelte | 32 ++- .../ui/dialog/dialog-description.svelte | 14 +- .../components/ui/dialog/dialog-footer.svelte | 14 +- .../components/ui/dialog/dialog-header.svelte | 14 +- .../ui/dialog/dialog-overlay.svelte | 25 +- .../components/ui/dialog/dialog-portal.svelte | 10 +- .../components/ui/dialog/dialog-title.svelte | 14 +- .../ui/drawer/drawer-content.svelte | 14 +- .../ui/drawer/drawer-description.svelte | 16 +- .../components/ui/drawer/drawer-footer.svelte | 16 +- .../components/ui/drawer/drawer-header.svelte | 16 +- .../components/ui/drawer/drawer-nested.svelte | 22 +- .../ui/drawer/drawer-overlay.svelte | 16 +- .../components/ui/drawer/drawer-title.svelte | 16 +- .../lib/components/ui/drawer/drawer.svelte | 22 +- .../dropdown-menu-checkbox-item.svelte | 16 +- .../dropdown-menu-content.svelte | 27 ++- .../dropdown-menu/dropdown-menu-item.svelte | 16 +- .../dropdown-menu/dropdown-menu-label.svelte | 16 +- .../dropdown-menu-radio-group.svelte | 12 +- .../dropdown-menu-radio-item.svelte | 16 +- .../dropdown-menu-separator.svelte | 11 +- .../dropdown-menu-shortcut.svelte | 14 +- .../dropdown-menu-sub-content.svelte | 26 +- .../dropdown-menu-sub-trigger.svelte | 16 +- app/src/lib/components/ui/input/input.svelte | 53 ++-- app/src/lib/components/ui/label/label.svelte | 14 +- .../ui/pagination/pagination-content.svelte | 14 +- .../ui/pagination/pagination-ellipsis.svelte | 11 +- .../ui/pagination/pagination-item.svelte | 14 +- .../ui/pagination/pagination-link.svelte | 27 ++- .../pagination/pagination-next-button.svelte | 40 +-- .../pagination/pagination-prev-button.svelte | 40 +-- .../ui/pagination/pagination.svelte | 48 ++-- .../ui/popover/popover-content.svelte | 24 +- .../ui/resizable/resizable-handle.svelte | 12 +- .../ui/resizable/resizable-pane-group.svelte | 27 ++- .../scroll-area/scroll-area-scrollbar.svelte | 13 +- .../ui/scroll-area/scroll-area.svelte | 27 ++- .../ui/select/select-content.svelte | 35 ++- .../components/ui/select/select-item.svelte | 29 ++- .../components/ui/select/select-label.svelte | 14 +- .../ui/select/select-separator.svelte | 11 +- .../ui/select/select-trigger.svelte | 26 +- .../components/ui/separator/separator.svelte | 15 +- .../components/ui/sheet/sheet-content.svelte | 34 ++- .../ui/sheet/sheet-description.svelte | 14 +- .../components/ui/sheet/sheet-footer.svelte | 14 +- .../components/ui/sheet/sheet-header.svelte | 14 +- .../components/ui/sheet/sheet-overlay.svelte | 17 +- .../components/ui/sheet/sheet-portal.svelte | 14 +- .../components/ui/sheet/sheet-title.svelte | 14 +- .../lib/components/ui/sonner/sonner.svelte | 7 +- .../lib/components/ui/switch/switch.svelte | 13 +- .../lib/components/ui/table/table-body.svelte | 14 +- .../components/ui/table/table-caption.svelte | 14 +- .../lib/components/ui/table/table-cell.svelte | 21 +- .../components/ui/table/table-footer.svelte | 14 +- .../lib/components/ui/table/table-head.svelte | 14 +- .../components/ui/table/table-header.svelte | 19 +- .../lib/components/ui/table/table-row.svelte | 21 +- app/src/lib/components/ui/table/table.svelte | 14 +- .../components/ui/tabs/tabs-content.svelte | 16 +- .../lib/components/ui/tabs/tabs-list.svelte | 14 +- .../components/ui/tabs/tabs-trigger.svelte | 16 +- .../ui/tooltip/tooltip-content.svelte | 29 ++- .../color/icon-blocks-color.svelte | 8 +- .../color/icon-channel-color.svelte | 8 +- .../color/icon-connection-color.svelte | 8 +- .../color/icon-explorer-color.svelte | 8 +- .../color/icon-faucet-color.svelte | 8 +- .../union-icons/color/icon-home-color.svelte | 8 +- .../union-icons/color/icon-index-color.svelte | 8 +- .../color/icon-packet-color.svelte | 8 +- .../union-icons/color/icon-queue-color.svelte | 8 +- .../color/icon-search-color.svelte | 8 +- .../color/icon-settings-color.svelte | 8 +- .../color/icon-transfers-color.svelte | 8 +- .../color/icon-usertransfers-color.svelte | 8 +- .../color/icon-wallet-color.svelte | 8 +- .../inverse/icon-blocks-inverse.svelte | 8 +- .../inverse/icon-channel-inverse.svelte | 8 +- .../inverse/icon-connection-inverse.svelte | 8 +- .../inverse/icon-explorer-inverse.svelte | 8 +- .../inverse/icon-faucet-inverse.svelte | 8 +- .../inverse/icon-home-inverse.svelte | 8 +- .../inverse/icon-index-inverse.svelte | 8 +- .../inverse/icon-packet-inverse.svelte | 8 +- .../inverse/icon-queue-inverse.svelte | 8 +- .../inverse/icon-search-inverse.svelte | 8 +- .../inverse/icon-settings-inverse.svelte | 8 +- .../inverse/icon-transfers-inverse.svelte | 8 +- .../inverse/icon-usertransfers-inverse.svelte | 8 +- .../inverse/icon-wallet-inverse.svelte | 8 +- .../mono/icon-alltransfers-mono.svelte | 8 +- .../union-icons/mono/icon-blocks-mono.svelte | 8 +- .../union-icons/mono/icon-channel-mono.svelte | 8 +- .../mono/icon-connection-mono.svelte | 8 +- .../mono/icon-explorer-mono.svelte | 8 +- .../union-icons/mono/icon-faucet-mono.svelte | 8 +- .../union-icons/mono/icon-home-mono.svelte | 8 +- .../mono/icon-hubblestatus-mono.svelte | 8 +- .../mono/icon-ibcchannels-mono.svelte | 8 +- .../mono/icon-ibcconnections-mono.svelte | 8 +- .../union-icons/mono/icon-index-mono.svelte | 8 +- .../union-icons/mono/icon-packet-mono.svelte | 8 +- .../union-icons/mono/icon-queue-mono.svelte | 8 +- .../union-icons/mono/icon-search-mono.svelte | 8 +- .../union-icons/mono/icon-searchk-mono.svelte | 8 +- .../mono/icon-settings-mono.svelte | 8 +- .../mono/icon-transfers-mono.svelte | 8 +- .../mono/icon-usertransfers-mono.svelte | 8 +- .../union-icons/mono/icon-wallet-mono.svelte | 8 +- .../lib/components/wallet-gate-cosmos.svelte | 12 +- app/src/lib/components/wallet-gate-evm.svelte | 12 +- app/src/lib/swap-form.svelte | 124 +++++----- app/src/routes/+layout.svelte | 13 +- app/src/routes/balances/+page.svelte | 22 +- .../explorer/(components)/icon-button.svelte | 11 +- .../routes/explorer/(components)/menu.svelte | 9 +- .../explorer/(components)/pixel-graph.svelte | 16 +- .../explorer/(components)/stats-bar.svelte | 2 +- .../(components)/table-channels.svelte | 2 +- .../(components)/table-connections.svelte | 2 +- .../routes/explorer/(components)/table.svelte | 7 + app/src/routes/explorer/+layout.svelte | 15 +- app/src/routes/explorer/+page.svelte | 4 +- .../address/[slug=address]/+layout.svelte | 2 + .../address/[slug=address]/+page.svelte | 24 +- app/src/routes/explorer/blocks/+page.svelte | 2 +- .../routes/explorer/index-status/+page.svelte | 4 +- .../[channel_id]/[sequence]/+page.svelte | 1 + .../routes/explorer/transfers/+layout.svelte | 7 +- .../routes/explorer/transfers/+page.svelte | 12 +- .../explorer/transfers/[source]/+page.svelte | 6 +- .../faucet/(components)/cosmos-balance.svelte | 17 +- .../faucet/(components)/dydx-faucet.svelte | 4 +- .../(components)/external-faucets.svelte | 6 +- .../faucet/(components)/stride-faucet.svelte | 4 +- .../faucet/(components)/token-balance.svelte | 18 +- app/src/routes/faucet/+page.svelte | 52 ++-- app/src/routes/swap/+page.svelte | 6 +- .../(components)/assets-dialog.svelte | 24 +- .../(components)/card-section-heading.svelte | 10 +- .../transfer/(components)/chain-button.svelte | 12 +- .../transfer/(components)/chain-dialog.svelte | 32 ++- .../(components)/recipient-field.svelte | 8 +- .../(components)/settings-dialog.svelte | 8 +- .../(components)/transfer-form.svelte | 2 + app/src/routes/transfer/+page.svelte | 10 +- 235 files changed, 2639 insertions(+), 1238 deletions(-) diff --git a/app/package-lock.json b/app/package-lock.json index c375428b91..c427182c8c 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -51,8 +51,8 @@ "@melt-ui/svelte": "^0.83.0", "@svelte-put/shortcut": "^3.1.1", "@sveltejs/adapter-static": "^3.0.4", - "@sveltejs/kit": "^2.5.26", - "@sveltejs/vite-plugin-svelte": "^3.1.2", + "@sveltejs/kit": "^2.5.27", + "@sveltejs/vite-plugin-svelte": "^4.0.0", "@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.9", @@ -70,7 +70,7 @@ "postcss": "^8.4.45", "postcss-import": "^16.1.0", "rollup-plugin-visualizer": "^5.12.0", - "svelte": "^4.2.19", + "svelte": "^5.0.0", "svelte-check": "^4.0.1", "svelte-preprocess": "^6.0.2", "tailwind-merge": "^2.5.2", @@ -2968,43 +2968,42 @@ } }, "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.1.2.tgz", - "integrity": "sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-4.0.0.tgz", + "integrity": "sha512-kpVJwF+gNiMEsoHaw+FJL76IYiwBikkxYU83+BpqQLdVMff19KeRKLd2wisS8niNBMJ2omv5gG+iGDDwd8jzag==", "dev": true, "license": "MIT", "dependencies": { - "@sveltejs/vite-plugin-svelte-inspector": "^2.1.0", - "debug": "^4.3.4", + "@sveltejs/vite-plugin-svelte-inspector": "^3.0.0-next.0||^3.0.0", + "debug": "^4.3.7", "deepmerge": "^4.3.1", "kleur": "^4.1.5", - "magic-string": "^0.30.10", - "svelte-hmr": "^0.16.0", - "vitefu": "^0.2.5" + "magic-string": "^0.30.12", + "vitefu": "^1.0.3" }, "engines": { - "node": "^18.0.0 || >=20" + "node": "^18.0.0 || ^20.0.0 || >=22" }, "peerDependencies": { - "svelte": "^4.0.0 || ^5.0.0-next.0", + "svelte": "^5.0.0-next.96 || ^5.0.0", "vite": "^5.0.0" } }, "node_modules/@sveltejs/vite-plugin-svelte-inspector": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.1.0.tgz", - "integrity": "sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-3.0.1.tgz", + "integrity": "sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==", "dev": true, "license": "MIT", "dependencies": { - "debug": "^4.3.4" + "debug": "^4.3.7" }, "engines": { - "node": "^18.0.0 || >=20" + "node": "^18.0.0 || ^20.0.0 || >=22" }, "peerDependencies": { - "@sveltejs/vite-plugin-svelte": "^3.0.0", - "svelte": "^4.0.0 || ^5.0.0-next.0", + "@sveltejs/vite-plugin-svelte": "^4.0.0-next.0||^4.0.0", + "svelte": "^5.0.0-next.96 || ^5.0.0", "vite": "^5.0.0" } }, @@ -3969,6 +3968,16 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-typescript": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/acorn-typescript/-/acorn-typescript-1.4.13.tgz", + "integrity": "sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": ">=8.9.0" + } + }, "node_modules/alge": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/alge/-/alge-0.8.1.tgz", @@ -5692,6 +5701,17 @@ "dev": true, "license": "MIT" }, + "node_modules/esrap": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.2.2.tgz", + "integrity": "sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15", + "@types/estree": "^1.0.1" + } + }, "node_modules/estree-walker": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", @@ -6778,12 +6798,12 @@ } }, "node_modules/is-reference": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", - "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", "license": "MIT", "dependencies": { - "@types/estree": "*" + "@types/estree": "^1.0.6" } }, "node_modules/is-stream": { @@ -9966,7 +9986,7 @@ "sveld": "cli.js" } }, - "node_modules/svelte": { + "node_modules/sveld/node_modules/svelte": { "version": "4.2.19", "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.19.tgz", "integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==", @@ -9991,6 +10011,31 @@ "node": ">=16" } }, + "node_modules/svelte": { + "version": "5.1.16", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.1.16.tgz", + "integrity": "sha512-QcY+om9r8+uTcSfeFuv8++ExdfwVCKeT+Y7GPSZ6rQPczvy62BMtvMoi0rScabgv+upGE5jxKjd7M4u23+AjGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@types/estree": "^1.0.5", + "acorn": "^8.12.1", + "acorn-typescript": "^1.4.13", + "aria-query": "^5.3.1", + "axobject-query": "^4.1.0", + "esm-env": "^1.0.0", + "esrap": "^1.2.2", + "is-reference": "^3.0.2", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/svelte-check": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.0.5.tgz", @@ -10015,19 +10060,6 @@ "typescript": ">=5.0.0" } }, - "node_modules/svelte-hmr": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.16.0.tgz", - "integrity": "sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==", - "dev": true, - "license": "ISC", - "engines": { - "node": "^12.20 || ^14.13.1 || >= 16" - }, - "peerDependencies": { - "svelte": "^3.19.0 || ^4.0.0" - } - }, "node_modules/svelte-persisted-store": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/svelte-persisted-store/-/svelte-persisted-store-0.11.0.tgz", @@ -11807,13 +11839,17 @@ } }, "node_modules/vitefu": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", - "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.3.tgz", + "integrity": "sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==", "dev": true, "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*" + ], "peerDependencies": { - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0-beta.0" }, "peerDependenciesMeta": { "vite": { @@ -12238,6 +12274,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/zimmerframe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz", + "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==", + "dev": true, + "license": "MIT" + }, "node_modules/zod": { "version": "3.23.8", "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", diff --git a/app/package.json b/app/package.json index 9386a2b9d2..b56f33f72c 100644 --- a/app/package.json +++ b/app/package.json @@ -57,8 +57,8 @@ "@melt-ui/svelte": "^0.83.0", "@svelte-put/shortcut": "^3.1.1", "@sveltejs/adapter-static": "^3.0.4", - "@sveltejs/kit": "^2.5.26", - "@sveltejs/vite-plugin-svelte": "^3.1.2", + "@sveltejs/kit": "^2.5.27", + "@sveltejs/vite-plugin-svelte": "^4.0.0", "@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.9", @@ -76,7 +76,7 @@ "postcss": "^8.4.45", "postcss-import": "^16.1.0", "rollup-plugin-visualizer": "^5.12.0", - "svelte": "^4.2.19", + "svelte": "^5.0.0", "svelte-check": "^4.0.1", "svelte-preprocess": "^6.0.2", "tailwind-merge": "^2.5.2", diff --git a/app/src/lib/components/address-multichain.svelte b/app/src/lib/components/address-multichain.svelte index 91e6516738..154fb2b0d9 100644 --- a/app/src/lib/components/address-multichain.svelte +++ b/app/src/lib/components/address-multichain.svelte @@ -3,8 +3,12 @@ import type { Chain } from "$lib/types" import { hexAddressToBech32 } from "@unionlabs/client" import { Badge } from "$lib/components/ui/badge/index.ts" -export let address: { address: string; normalizedAddress: string } -export let chains: Array + interface Props { + address: { address: string; normalizedAddress: string }; + chains: Array; + } + + let { address, chains }: Props = $props(); const addressChain = chains.find(c => address.address.startsWith(c.addr_prefix)) as Chain @@ -43,7 +47,7 @@ const longestPrefix = Math.max.apply( 0, allCosmosAddresses.map(pair => pair.prefix.length) ) -let addressIndex = 0 +let addressIndex = $state(0) setInterval(() => { //logic goes here addressIndex = (addressIndex + 1) % (allCosmosAddresses.length - 1) diff --git a/app/src/lib/components/asset-card.svelte b/app/src/lib/components/asset-card.svelte index ff33665ac0..13a03058ab 100644 --- a/app/src/lib/components/asset-card.svelte +++ b/app/src/lib/components/asset-card.svelte @@ -6,13 +6,18 @@ import Precise from "$lib/components/precise.svelte" import { getSupportedAsset } from "$lib/utilities/helpers.ts" import { showUnsupported } from "$lib/stores/user.ts" -//Create correct type here -export let asset: { symbol: string; balance: string | bigint; denom?: string; address: string } -export let chain: Chain + + interface Props { + //Create correct type here + asset: { symbol: string; balance: string | bigint; denom?: string; address: string }; + chain: Chain; + } + + let { asset, chain }: Props = $props(); //Finds the asset in chains.assets and checks if supported, const identifier = asset.denom ? asset.denom : asset.address -$: supportedAsset = getSupportedAsset(chain, identifier) +let supportedAsset = $derived(getSupportedAsset(chain, identifier)) {#if supportedAsset || $showUnsupported} diff --git a/app/src/lib/components/balances-overview.svelte b/app/src/lib/components/balances-overview.svelte index 502c3cf6f4..15103a62e1 100644 --- a/app/src/lib/components/balances-overview.svelte +++ b/app/src/lib/components/balances-overview.svelte @@ -6,14 +6,18 @@ import ScrollArea from "./ui/scroll-area/scroll-area.svelte" import LoadingLogo from "./loading-logo.svelte" import { userAddrOnChain } from "$lib/utilities/address" -export let userAddr: UserAddresses -export let chains: Array + interface Props { + userAddr: UserAddresses; + chains: Array; + } -$: userBalances = userBalancesQuery({ + let { userAddr, chains }: Props = $props(); + +let userBalances = $derived(userBalancesQuery({ chains, userAddr, connected: true -}) +})) {#each $userBalances as balance, index} diff --git a/app/src/lib/components/card-animated-border.svelte b/app/src/lib/components/card-animated-border.svelte index 2e6cedaa9d..6f576eb6d8 100644 --- a/app/src/lib/components/card-animated-border.svelte +++ b/app/src/lib/components/card-animated-border.svelte @@ -1,10 +1,21 @@
+>
- + {@render children?.()}
diff --git a/app/src/lib/components/chains-gate.svelte b/app/src/lib/components/chains-gate.svelte index dd8639fd8c..24d977cbdb 100644 --- a/app/src/lib/components/chains-gate.svelte +++ b/app/src/lib/components/chains-gate.svelte @@ -3,6 +3,11 @@ import type { Chain } from "$lib/types" import LoadingLogo from "./loading-logo.svelte" import { chainsQuery } from "$lib/queries/chains" import { type Readable, derived } from "svelte/store" + interface Props { + children?: import('svelte').Snippet<[any]>; + } + + let { children }: Props = $props(); let chains = chainsQuery() @@ -82,7 +87,7 @@ let checkedChains: Readable> = derived(chains, $chains => { {#if !!$chains.data} - + {@render children?.({ chains: $checkedChains, })} {:else if $chains.isLoading} {:else if $chains.isError} diff --git a/app/src/lib/components/connect/connect.svelte b/app/src/lib/components/connect/connect.svelte index fe8923189a..d98d846583 100644 --- a/app/src/lib/components/connect/connect.svelte +++ b/app/src/lib/components/connect/connect.svelte @@ -1,4 +1,6 @@ - - - + + {#snippet children({ builder })} + + {/snippet} + CRT effect - - - + + {#snippet children({ builder })} + + {/snippet} + setMode("system")} class="cursor-pointer"> diff --git a/app/src/lib/components/connect/connection.svelte b/app/src/lib/components/connect/connection.svelte index 210a2c7c77..7e2bdc7759 100644 --- a/app/src/lib/components/connect/connection.svelte +++ b/app/src/lib/components/connect/connection.svelte @@ -12,29 +12,44 @@ import { truncateEvmAddress, truncateUnionAddress } from "$lib/wallet/utilities/ const OFFENDING_WALLET_ID = "io.metamask.mobile" -export let chain: "cosmos" | "evm" | "aptos" type T = $$Generic type $$Props = Props -export let address: $$Props["address"] -export let hoverState: $$Props["hoverState"] -export let connectStatus: $$Props["connectStatus"] -export let onConnectClick: $$Props["onConnectClick"] -export let onDisconnectClick: $$Props["onDisconnectClick"] -export let connectedWalletId: $$Props["connectedWalletId"] -export let chainWalletsInformation: $$Props["chainWalletsInformation"] + interface Props_1 { + chain: "cosmos" | "evm" | "aptos"; + address: $$Props["address"]; + hoverState: $$Props["hoverState"]; + connectStatus: $$Props["connectStatus"]; + onConnectClick: $$Props["onConnectClick"]; + onDisconnectClick: $$Props["onDisconnectClick"]; + connectedWalletId: $$Props["connectedWalletId"]; + chainWalletsInformation: $$Props["chainWalletsInformation"]; + [key: string]: any + } + + let { + chain, + address, + hoverState = $bindable(), + connectStatus, + onConnectClick, + onDisconnectClick, + connectedWalletId, + chainWalletsInformation, + ...rest + }: Props_1 = $props(); -$: connectText = - connectStatus === "connected" && address && address?.length > 0 +let connectText = + $derived(connectStatus === "connected" && address && address?.length > 0 ? chain === "evm" ? truncateEvmAddress(address, -1) : chain === "aptos" ? address : truncateUnionAddress(address, -1) - : "" + : "") -let copyClicked = false +let copyClicked = $state(false) const toggleCopy = () => (copyClicked = !copyClicked) const onCopyClick = () => [toggleCopy(), setTimeout(() => toggleCopy(), 1_500)] @@ -45,17 +60,17 @@ let sanitizeWalletInformation = array.findIndex(t => t.name.toLowerCase().startsWith(predicate.name.toLowerCase())) === index ) ?? chainWalletsInformation -$: walletListToRender = - connectStatus === "connected" ? chainWalletsInformation : sanitizeWalletInformation +let walletListToRender = + $derived(connectStatus === "connected" ? chainWalletsInformation : sanitizeWalletInformation) -let metamaskAlertDialogOpen = false +let metamaskAlertDialogOpen = $state(false)

{chain}

- - {appStatus === 'online' ? blockHeight : 'offline'} - - + + {#snippet children({ builder })} + + + {appStatus === 'online' ? blockHeight : 'offline'} + + {/snippet} + const packet = readFragment(packetDetailsFragment, packetDetails) -export let chains: Array + interface Props { + packetDetails: FragmentOf; + chains: Array; + } + + let { packetDetails, chains }: Props = $props(); const packetSourceDestination = { source_chain_id: packet.source_chain_id, diff --git a/app/src/lib/components/packet-path.svelte b/app/src/lib/components/packet-path.svelte index 9aea4c10e9..fb7f686dfc 100644 --- a/app/src/lib/components/packet-path.svelte +++ b/app/src/lib/components/packet-path.svelte @@ -3,8 +3,9 @@ import { cn } from "$lib/utilities/shadcn" import type { Chain } from "$lib/types" import { toDisplayName } from "$lib/utilities/chains" import MoveRightIcon from "virtual:icons/lucide/move-right" -export let chains: Array -export let packet: { + interface Props { + chains: Array; + packet: { source_chain_id: string source_connection_id: string source_channel_id: string @@ -13,7 +14,10 @@ export let packet: { destination_connection_id: string destination_channel_id: string destination_sequence: string -} +}; + } + + let { chains, packet }: Props = $props();
diff --git a/app/src/lib/components/precise.svelte b/app/src/lib/components/precise.svelte index 275334df2a..a97d6787c7 100644 --- a/app/src/lib/components/precise.svelte +++ b/app/src/lib/components/precise.svelte @@ -3,11 +3,21 @@ import * as Tooltip from "$lib/components/ui/tooltip" import type { Chain } from "$lib/types.ts" import { getSupportedAsset } from "$lib/utilities/helpers.ts" -export let chain: Chain -export let asset: any -export let displayDecimals = 2 -export let showToolTip = false -export let showSymbol = false + interface Props { + chain: Chain; + asset: any; + displayDecimals?: number; + showToolTip?: boolean; + showSymbol?: boolean; + } + + let { + chain, + asset, + displayDecimals = 2, + showToolTip = false, + showSymbol = false + }: Props = $props(); const formatBalance = ( balance: bigint | string, @@ -48,15 +58,15 @@ const abbreviateNumber = (num: number, displayDecimals: number): string => { return num.toFixed(displayDecimals) } -$: supportedAsset = asset ? getSupportedAsset(chain, asset.address) : null +let supportedAsset = $derived(asset ? getSupportedAsset(chain, asset.address) : null) -$: balance = asset ? (asset.balance ?? BigInt(0)) : BigInt(0) -$: decimals = asset && supportedAsset ? supportedAsset.decimals : asset ? asset.decimals : 0 -$: symbol = - asset && supportedAsset ? supportedAsset.display_symbol : asset ? asset.symbol : "Unknown" +let balance = $derived(asset ? (asset.balance ?? BigInt(0)) : BigInt(0)) +let decimals = $derived(asset && supportedAsset ? supportedAsset.decimals : asset ? asset.decimals : 0) +let symbol = + $derived(asset && supportedAsset ? supportedAsset.display_symbol : asset ? asset.symbol : "Unknown") -$: formatted = formatBalance(balance, decimals, true) -$: precise = formatBalance(balance, decimals, false) +let formatted = $derived(formatBalance(balance, decimals, true)) +let precise = $derived(formatBalance(balance, decimals, false)) {#key formatted} diff --git a/app/src/lib/components/preloading-indicator.svelte b/app/src/lib/components/preloading-indicator.svelte index aae2fad991..487d900087 100644 --- a/app/src/lib/components/preloading-indicator.svelte +++ b/app/src/lib/components/preloading-indicator.svelte @@ -2,7 +2,7 @@ import { onMount } from "svelte" import { cn } from "$lib/utilities/shadcn.ts" -let [progress, visible] = [0, false] +let [progress, visible] = $state([0, false]) onMount(() => { visible = true const next = () => { @@ -19,14 +19,14 @@ onMount(() => {
+>
{/if} {#if progress >= 0.4}
+>
{/if}