@rainlanguage/ui-components 0.0.1-alpha.24 → 0.0.1-alpha.240
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/README.md +14 -6
- package/dist/__fixtures__/settings.yaml +123 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte +4 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte.d.ts +18 -0
- package/dist/__mocks__/MockCodeMirrorEditor.svelte +17 -0
- package/dist/__mocks__/MockCodeMirrorEditor.svelte.d.ts +21 -0
- package/dist/__mocks__/MockComponent.js +1 -1
- package/dist/__mocks__/MockComponent.svelte +10 -2
- package/dist/__mocks__/MockComponent.svelte.d.ts +4 -1
- package/dist/__mocks__/mockWeb3Config.d.ts +1 -1
- package/dist/__mocks__/mockWeb3Config.js +10 -7
- package/dist/__mocks__/queries.js +9 -9
- package/dist/__mocks__/stores.d.ts +55 -45
- package/dist/__mocks__/stores.js +85 -68
- package/dist/app.css +3 -3
- package/dist/components/ButtonDarkMode.svelte +7 -1
- package/dist/components/ButtonLoading.svelte +1 -1
- package/dist/components/ButtonScrub.svelte +22 -0
- package/dist/components/ButtonScrub.svelte.d.ts +25 -0
- package/dist/components/ButtonVaultLink.svelte +12 -11
- package/dist/components/ButtonVaultLink.svelte.d.ts +4 -3
- package/dist/components/CheckboxInactiveOrdersVault.svelte +20 -0
- package/dist/components/CheckboxInactiveOrdersVault.svelte.d.ts +19 -0
- package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
- package/dist/components/CodeMirrorDotrain.svelte +4 -0
- package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
- package/dist/components/CodeMirrorRainlang.svelte +20 -12
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +3 -2
- package/dist/components/EditableSpan.svelte +3 -14
- package/dist/components/EditableSpan.svelte.d.ts +0 -1
- package/dist/components/Hash.svelte +6 -5
- package/dist/components/License.svelte +5 -4
- package/dist/components/ListViewRaindexFilters.svelte +64 -0
- package/dist/components/ListViewRaindexFilters.svelte.d.ts +32 -0
- package/dist/components/LocalDbStatusBadge.svelte +27 -0
- package/dist/components/LocalDbStatusBadge.svelte.d.ts +19 -0
- package/dist/components/LocalDbStatusCard.svelte +43 -0
- package/dist/components/LocalDbStatusCard.svelte.d.ts +20 -0
- package/dist/components/LocalDbStatusModal.svelte +105 -0
- package/dist/components/LocalDbStatusModal.svelte.d.ts +21 -0
- package/dist/components/OrderOrVaultHash.svelte +12 -12
- package/dist/components/OrderOrVaultHash.svelte.d.ts +4 -4
- package/dist/components/PageHeader.svelte +1 -1
- package/dist/components/Sensitive.svelte +16 -0
- package/dist/components/Sensitive.svelte.d.ts +28 -0
- package/dist/components/TanstackAppTable.svelte +270 -60
- package/dist/components/TanstackAppTable.svelte.d.ts +15 -9
- package/dist/components/ToastDetail.svelte +42 -0
- package/dist/components/ToastDetail.svelte.d.ts +20 -0
- package/dist/components/Tooltip.svelte +8 -0
- package/dist/components/Tooltip.svelte.d.ts +21 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte +23 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +19 -0
- package/dist/components/VaultCard.svelte +18 -0
- package/dist/components/VaultCard.svelte.d.ts +19 -0
- package/dist/components/charts/LightweightChart.svelte +1 -1
- package/dist/components/charts/LightweightChart.svelte.d.ts +5 -5
- package/dist/components/charts/OrderTradesChart.svelte +319 -28
- package/dist/components/charts/OrderTradesChart.svelte.d.ts +4 -4
- package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
- package/dist/components/charts/VaultBalanceChart.svelte +8 -26
- package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -7
- package/dist/components/charts/transformAndSortData.d.ts +24 -0
- package/dist/components/charts/transformAndSortData.js +111 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte +11 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte.d.ts +19 -0
- package/dist/components/deployment/ButtonSelectOption.svelte +2 -0
- package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
- package/dist/components/deployment/ComposedRainlangModal.svelte +3 -2
- package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
- package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
- package/dist/components/deployment/DeploymentSteps.svelte +196 -221
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +6 -12
- package/dist/components/deployment/DeploymentTile.svelte +2 -2
- package/dist/components/deployment/DeploymentTile.svelte.d.ts +1 -1
- package/dist/components/deployment/DeploymentsSection.svelte +15 -22
- package/dist/components/deployment/DeploymentsSection.svelte.d.ts +3 -2
- package/dist/components/deployment/DepositInput.svelte +10 -11
- package/dist/components/deployment/DepositInput.svelte.d.ts +2 -3
- package/dist/components/deployment/DisclaimerModal.svelte +6 -7
- package/dist/components/deployment/FieldDefinitionInput.svelte +10 -14
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +2 -3
- package/dist/components/deployment/InvalidOrdersSection.svelte +17 -0
- package/dist/components/deployment/InvalidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/{StrategyPage.svelte → OrderPage.svelte} +15 -24
- package/dist/components/deployment/OrderPage.svelte.d.ts +21 -0
- package/dist/components/deployment/SelectToken.svelte +127 -50
- package/dist/components/deployment/SelectToken.svelte.d.ts +5 -4
- package/dist/components/deployment/TokenBalance.svelte +19 -0
- package/dist/components/deployment/TokenBalance.svelte.d.ts +19 -0
- package/dist/components/deployment/TokenIOInput.svelte +27 -17
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +3 -3
- package/dist/components/deployment/TokenSelectionModal.svelte +148 -0
- package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +20 -0
- package/dist/components/deployment/{ValidStrategiesSection.svelte → ValidOrdersSection.svelte} +7 -7
- package/dist/components/deployment/ValidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/VaultIdInformation.svelte +17 -0
- package/dist/components/deployment/VaultIdInformation.svelte.d.ts +21 -0
- package/dist/components/detail/OrderDetail.svelte +220 -82
- package/dist/components/detail/OrderDetail.svelte.d.ts +21 -15
- package/dist/components/detail/TanstackOrderQuote.svelte +114 -46
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +14 -16
- package/dist/components/detail/VaultDetail.svelte +82 -79
- package/dist/components/detail/VaultDetail.svelte.d.ts +12 -18
- package/dist/components/dropdown/DropdownActiveNetworks.svelte +44 -0
- package/dist/components/dropdown/DropdownActiveNetworks.svelte.d.ts +19 -0
- package/dist/components/dropdown/DropdownCheckbox.svelte +4 -4
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte +172 -0
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte.d.ts +25 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte +152 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +28 -0
- package/dist/components/icon/Refresh.svelte +4 -2
- package/dist/components/icon/Refresh.svelte.d.ts +2 -0
- package/dist/components/input/InputOrderHash.svelte +1 -1
- package/dist/components/input/InputOrderHash.svelte.d.ts +3 -3
- package/dist/components/input/InputOwnerFilter.svelte +48 -0
- package/dist/components/input/InputOwnerFilter.svelte.d.ts +19 -0
- package/dist/components/input/InputRegistryUrl.svelte +36 -14
- package/dist/components/input/InputToken.svelte +2 -2
- package/dist/components/input/InputTokenAmount.svelte +30 -20
- package/dist/components/input/InputTokenAmount.svelte.d.ts +3 -3
- package/dist/components/tables/OrderAPY.svelte +6 -33
- package/dist/components/tables/OrderAPY.svelte.d.ts +1 -4
- package/dist/components/tables/OrderTradesListTable.svelte +132 -124
- package/dist/components/tables/OrderTradesListTable.svelte.d.ts +4 -4
- package/dist/components/tables/OrderVaultsVolTable.svelte +17 -22
- package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +2 -2
- package/dist/components/tables/OrdersListTable.svelte +206 -115
- package/dist/components/tables/OrdersListTable.svelte.d.ts +18 -23
- package/dist/components/tables/VaultBalanceChangesTable.svelte +83 -43
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +13 -11
- package/dist/components/tables/VaultsListTable.svelte +275 -150
- package/dist/components/tables/VaultsListTable.svelte.d.ts +24 -33
- package/dist/components/transactions/FixedBottomTransaction.svelte +64 -0
- package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
- package/dist/components/transactions/TransactionDetail.svelte +31 -0
- package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
- package/dist/components/transactions/TransactionList.svelte +17 -0
- package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
- package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
- package/dist/components/transactions/getStatusEmoji.js +20 -0
- package/dist/components/wallet/WalletConnect.svelte +5 -4
- package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +1 -0
- package/dist/errors/DeploymentStepsError.d.ts +11 -5
- package/dist/errors/DeploymentStepsError.js +13 -7
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/hooks/useLocalDb.d.ts +3 -0
- package/dist/hooks/useLocalDb.js +10 -0
- package/dist/hooks/useRaindexClient.d.ts +3 -0
- package/dist/hooks/useRaindexClient.js +11 -0
- package/dist/hooks/useRaindexOrderBuilder.d.ts +3 -0
- package/dist/hooks/useRaindexOrderBuilder.js +11 -0
- package/dist/index.d.ts +122 -91
- package/dist/index.js +118 -87
- package/dist/models/Transaction.d.ts +75 -0
- package/dist/models/Transaction.js +100 -0
- package/dist/providers/LocalDbProvider.svelte +8 -0
- package/dist/providers/LocalDbProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexClientProvider.svelte +8 -0
- package/dist/providers/RaindexClientProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexOrderBuilderProvider.svelte +8 -0
- package/dist/providers/RaindexOrderBuilderProvider.svelte.d.ts +21 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte +8 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +24 -0
- package/dist/providers/dotrainRegistry/context.d.ts +9 -0
- package/dist/providers/dotrainRegistry/context.js +43 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +5 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.js +35 -0
- package/dist/providers/registry/RegistryManager.d.ts +65 -0
- package/dist/providers/registry/RegistryManager.js +134 -0
- package/dist/providers/registry/RegistryProvider.svelte +6 -0
- package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
- package/dist/providers/registry/context.d.ts +10 -0
- package/dist/providers/registry/context.js +46 -0
- package/dist/providers/registry/useRegistry.d.ts +7 -0
- package/dist/providers/registry/useRegistry.js +29 -0
- package/dist/providers/toasts/ToastProvider.svelte +17 -0
- package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
- package/dist/providers/toasts/context.d.ts +14 -0
- package/dist/providers/toasts/context.js +22 -0
- package/dist/providers/toasts/useToasts.d.ts +16 -0
- package/dist/providers/toasts/useToasts.js +63 -0
- package/dist/providers/transactions/TransactionManager.d.ts +234 -0
- package/dist/providers/transactions/TransactionManager.js +509 -0
- package/dist/providers/transactions/TransactionProvider.svelte +11 -0
- package/dist/providers/transactions/TransactionProvider.svelte.d.ts +24 -0
- package/dist/providers/transactions/context.d.ts +19 -0
- package/dist/providers/transactions/context.js +28 -0
- package/dist/providers/transactions/useTransactions.d.ts +13 -0
- package/dist/providers/transactions/useTransactions.js +18 -0
- package/dist/providers/wallet/WalletProvider.svelte +7 -0
- package/dist/providers/wallet/WalletProvider.svelte.d.ts +21 -0
- package/dist/providers/wallet/context.d.ts +10 -0
- package/dist/providers/wallet/context.js +47 -0
- package/dist/providers/wallet/useAccount.d.ts +8 -0
- package/dist/providers/wallet/useAccount.js +148 -0
- package/dist/queries/keys.d.ts +1 -0
- package/dist/queries/keys.js +10 -9
- package/dist/queries/queryClient.d.ts +2 -2
- package/dist/queries/queryClient.js +16 -11
- package/dist/services/awaitTransactionIndexing.d.ts +107 -0
- package/dist/services/awaitTransactionIndexing.js +60 -0
- package/dist/services/getExplorerLink.d.ts +1 -1
- package/dist/services/getExplorerLink.js +3 -5
- package/dist/services/handleShareChoices.d.ts +2 -2
- package/dist/services/handleShareChoices.js +6 -5
- package/dist/services/historicalOrderCharts.d.ts +3 -3
- package/dist/services/historicalOrderCharts.js +364 -371
- package/dist/services/index.d.ts +5 -2
- package/dist/services/index.js +3 -1
- package/dist/services/loadRegistryUrl.d.ts +2 -0
- package/dist/services/loadRegistryUrl.js +22 -0
- package/dist/services/pairTradesChartData.d.ts +47 -0
- package/dist/services/pairTradesChartData.js +194 -0
- package/dist/services/registry.d.ts +5 -5
- package/dist/services/registry.js +17 -217
- package/dist/services/time.d.ts +12 -0
- package/dist/services/time.js +88 -6
- package/dist/services/validateAmount.d.ts +30 -0
- package/dist/services/validateAmount.js +53 -0
- package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
- package/dist/storesGeneric/cachedWritableStore.js +93 -0
- package/dist/storesGeneric/scrub.d.ts +14 -0
- package/dist/storesGeneric/scrub.js +22 -0
- package/dist/test/matchers.d.ts +2 -2
- package/dist/test/matchers.js +2 -2
- package/dist/types/account.d.ts +3 -0
- package/dist/types/appStores.d.ts +9 -16
- package/dist/types/modal.d.ts +26 -14
- package/dist/types/order.d.ts +10 -0
- package/dist/types/order.js +1 -0
- package/dist/types/toast.d.ts +11 -0
- package/dist/types/toast.js +1 -0
- package/dist/types/tokenBalance.d.ts +6 -0
- package/dist/types/tokenBalance.js +1 -0
- package/dist/types/transaction.d.ts +67 -22
- package/dist/types/transaction.js +31 -1
- package/dist/utils/breadcrumbs.js +2 -2
- package/dist/utils/codeMirrorThemes.js +80 -74
- package/dist/utils/configHelpers.d.ts +4 -0
- package/dist/utils/configHelpers.js +21 -0
- package/dist/utils/constructHashLink.d.ts +24 -0
- package/dist/utils/constructHashLink.js +117 -0
- package/dist/utils/getNetworkName.d.ts +1 -0
- package/dist/utils/getNetworkName.js +13 -0
- package/dist/utils/hex.js +1 -1
- package/dist/utils/lightweightChartsThemes.d.ts +1 -1
- package/dist/utils/lightweightChartsThemes.js +11 -11
- package/dist/utils/localDbStatus.d.ts +26 -0
- package/dist/utils/localDbStatus.js +22 -0
- package/dist/utils/number.d.ts +0 -7
- package/dist/utils/number.js +5 -30
- package/dist/utils/stripTrailingWhitespace.d.ts +16 -0
- package/dist/utils/stripTrailingWhitespace.js +22 -0
- package/dist/utils/tokens.d.ts +2 -0
- package/dist/utils/tokens.js +3 -0
- package/dist/utils/vaultBalanceChangeLabels.d.ts +4 -0
- package/dist/utils/vaultBalanceChangeLabels.js +18 -0
- package/package.json +89 -84
- package/dist/__fixtures__/orderDetail.d.ts +0 -99
- package/dist/__fixtures__/orderDetail.js +0 -204
- package/dist/__fixtures__/settings-12-11-24.json +0 -160
- package/dist/__mocks__/mockTransactionStore.d.ts +0 -22
- package/dist/__mocks__/mockTransactionStore.js +0 -56
- package/dist/__mocks__/settings.d.ts +0 -3
- package/dist/__mocks__/settings.js +0 -37
- package/dist/components/CheckboxMyItemsOnly.svelte +0 -23
- package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +0 -21
- package/dist/components/ListViewOrderbookFilters.svelte +0 -58
- package/dist/components/ListViewOrderbookFilters.svelte.d.ts +0 -28
- package/dist/components/deployment/InvalidStrategiesSection.svelte +0 -19
- package/dist/components/deployment/InvalidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/StrategyPage.svelte.d.ts +0 -19
- package/dist/components/deployment/ValidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
- package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -28
- package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
- package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +0 -38
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +0 -21
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte +0 -15
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +0 -20
- package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
- package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
- package/dist/hooks/useGui.d.ts +0 -3
- package/dist/hooks/useGui.js +0 -11
- package/dist/providers/GuiProvider.svelte +0 -8
- package/dist/providers/GuiProvider.svelte.d.ts +0 -21
- package/dist/stores/transactionStore.d.ts +0 -98
- package/dist/stores/transactionStore.js +0 -303
- package/dist/types/strategy.d.ts +0 -10
- package/dist/utils/time.d.ts +0 -12
- package/dist/utils/time.js +0 -27
- package/dist/utils/vault.d.ts +0 -2
- package/dist/utils/vault.js +0 -29
- /package/dist/types/{strategy.js → account.js} +0 -0
package/dist/__mocks__/stores.js
CHANGED
|
@@ -1,113 +1,130 @@
|
|
|
1
|
-
import { writable } from
|
|
2
|
-
import
|
|
3
|
-
import {} from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
import {} from "@wagmi/core";
|
|
3
|
+
import { mockWeb3Config } from "./mockWeb3Config";
|
|
4
|
+
if (import.meta.vitest) {
|
|
5
|
+
vi.mock(import("@rainlanguage/raindex"), async (importOriginal) => {
|
|
6
|
+
const actual = await importOriginal();
|
|
7
|
+
return {
|
|
8
|
+
...actual,
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const initialPageState = {
|
|
13
|
+
data: {
|
|
14
|
+
dotrain: "some dotrain content",
|
|
15
|
+
deployment: { key: "deploy-key", name: "", description: "" },
|
|
16
|
+
orderDetail: {},
|
|
17
|
+
},
|
|
18
|
+
url: new URL("http://localhost:3000/deploy"),
|
|
19
|
+
params: {},
|
|
20
|
+
form: {},
|
|
21
|
+
status: 200,
|
|
22
|
+
error: null,
|
|
23
|
+
route: {
|
|
24
|
+
id: null,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const mockPageWritable = writable(initialPageState);
|
|
28
|
+
const mockShowInactiveOrdersWritable = writable(true);
|
|
29
|
+
const mockOrderHashWritable = writable("");
|
|
11
30
|
const mockHideZeroBalanceVaultsWritable = writable(false);
|
|
12
|
-
const
|
|
13
|
-
const
|
|
31
|
+
const mockHideInactiveOrdersVaultsWritable = writable(false);
|
|
32
|
+
const mockActiveNetworkRefWritable = writable("");
|
|
33
|
+
const mockActiveRaindexRefWritable = writable("");
|
|
14
34
|
const mockActiveAccountsWritable = writable({});
|
|
15
|
-
const mockSubgraphUrlWritable = writable(
|
|
16
|
-
const mockWalletAddressMatchesOrBlankWritable = writable(() => false);
|
|
17
|
-
const mockSignerAddressWritable = writable('');
|
|
35
|
+
const mockSubgraphUrlWritable = writable("");
|
|
18
36
|
const mockChainIdWritable = writable(0);
|
|
19
|
-
const mockConnectedWritable = writable(
|
|
37
|
+
const mockConnectedWritable = writable(true);
|
|
20
38
|
const mockWagmiConfigWritable = writable(mockWeb3Config);
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
subscribe: mockSettingsWritable.subscribe,
|
|
30
|
-
set: mockSettingsWritable.set,
|
|
31
|
-
mockSetSubscribeValue: (value) => mockSettingsWritable.set(value)
|
|
32
|
-
};
|
|
33
|
-
export const mockActiveSubgraphsStore = {
|
|
34
|
-
subscribe: mockActiveSubgraphsWritable.subscribe,
|
|
35
|
-
set: mockActiveSubgraphsWritable.set,
|
|
36
|
-
mockSetSubscribeValue: (value) => mockActiveSubgraphsWritable.set(value)
|
|
37
|
-
};
|
|
38
|
-
export const mockAccountsStore = {
|
|
39
|
-
subscribe: mockAccountsWritable.subscribe
|
|
40
|
-
};
|
|
41
|
-
export const mockActiveAccountsItemsStore = {
|
|
42
|
-
subscribe: mockActiveAccountsItemsWritable.subscribe,
|
|
43
|
-
set: mockActiveAccountsItemsWritable.set,
|
|
44
|
-
mockSetSubscribeValue: (value) => mockActiveAccountsItemsWritable.set(value)
|
|
45
|
-
};
|
|
46
|
-
export const mockActiveOrderStatusStore = {
|
|
47
|
-
subscribe: mockActiveOrderStatusWritable.subscribe,
|
|
48
|
-
set: mockActiveOrderStatusWritable.set,
|
|
49
|
-
mockSetSubscribeValue: (value) => mockActiveOrderStatusWritable.set(value)
|
|
39
|
+
const mockSelectedChainIdsWritable = writable([]);
|
|
40
|
+
const mockActiveTokensWritable = writable([]);
|
|
41
|
+
const mockActiveRaindexAddressesWritable = writable([]);
|
|
42
|
+
const mockOwnerFilterWritable = writable("");
|
|
43
|
+
export const mockShowInactiveOrdersStore = {
|
|
44
|
+
subscribe: mockShowInactiveOrdersWritable.subscribe,
|
|
45
|
+
set: mockShowInactiveOrdersWritable.set,
|
|
46
|
+
mockSetSubscribeValue: (value) => mockShowInactiveOrdersWritable.set(value),
|
|
50
47
|
};
|
|
51
48
|
export const mockOrderHashStore = {
|
|
52
49
|
subscribe: mockOrderHashWritable.subscribe,
|
|
53
50
|
set: mockOrderHashWritable.set,
|
|
54
|
-
mockSetSubscribeValue: (value) => mockOrderHashWritable.set(value)
|
|
51
|
+
mockSetSubscribeValue: (value) => mockOrderHashWritable.set(value),
|
|
55
52
|
};
|
|
56
53
|
export const mockHideZeroBalanceVaultsStore = {
|
|
57
54
|
subscribe: mockHideZeroBalanceVaultsWritable.subscribe,
|
|
58
55
|
set: mockHideZeroBalanceVaultsWritable.set,
|
|
59
|
-
mockSetSubscribeValue: (value) => mockHideZeroBalanceVaultsWritable.set(value)
|
|
56
|
+
mockSetSubscribeValue: (value) => mockHideZeroBalanceVaultsWritable.set(value),
|
|
57
|
+
};
|
|
58
|
+
export const mockHideInactiveOrdersVaultsStore = {
|
|
59
|
+
subscribe: mockHideInactiveOrdersVaultsWritable.subscribe,
|
|
60
|
+
set: mockHideInactiveOrdersVaultsWritable.set,
|
|
61
|
+
mockSetSubscribeValue: (value) => mockHideInactiveOrdersVaultsWritable.set(value),
|
|
60
62
|
};
|
|
61
63
|
export const mockActiveNetworkRefStore = {
|
|
62
64
|
subscribe: mockActiveNetworkRefWritable.subscribe,
|
|
63
65
|
set: mockActiveNetworkRefWritable.set,
|
|
64
|
-
mockSetSubscribeValue: (value) => mockActiveNetworkRefWritable.set(value)
|
|
66
|
+
mockSetSubscribeValue: (value) => mockActiveNetworkRefWritable.set(value),
|
|
65
67
|
};
|
|
66
|
-
export const
|
|
67
|
-
subscribe:
|
|
68
|
-
set:
|
|
69
|
-
mockSetSubscribeValue: (value) =>
|
|
68
|
+
export const mockActiveRaindexRefStore = {
|
|
69
|
+
subscribe: mockActiveRaindexRefWritable.subscribe,
|
|
70
|
+
set: mockActiveRaindexRefWritable.set,
|
|
71
|
+
mockSetSubscribeValue: (value) => mockActiveRaindexRefWritable.set(value),
|
|
70
72
|
};
|
|
71
73
|
export const mockActiveAccountsStore = {
|
|
72
74
|
subscribe: mockActiveAccountsWritable.subscribe,
|
|
73
75
|
set: mockActiveAccountsWritable.set,
|
|
74
|
-
mockSetSubscribeValue: (value) => mockActiveAccountsWritable.set(value)
|
|
76
|
+
mockSetSubscribeValue: (value) => mockActiveAccountsWritable.set(value),
|
|
75
77
|
};
|
|
76
78
|
export const mockSubgraphUrlStore = {
|
|
77
79
|
subscribe: mockSubgraphUrlWritable.subscribe,
|
|
78
80
|
set: mockSubgraphUrlWritable.set,
|
|
79
|
-
mockSetSubscribeValue: (value) => mockSubgraphUrlWritable.set(value)
|
|
80
|
-
};
|
|
81
|
-
export const mockSignerAddressStore = {
|
|
82
|
-
subscribe: mockSignerAddressWritable.subscribe,
|
|
83
|
-
set: mockSignerAddressWritable.set,
|
|
84
|
-
mockSetSubscribeValue: (value) => mockSignerAddressWritable.set(value),
|
|
85
|
-
update: mockSignerAddressWritable.update
|
|
81
|
+
mockSetSubscribeValue: (value) => mockSubgraphUrlWritable.set(value),
|
|
86
82
|
};
|
|
87
83
|
export const mockChainIdStore = {
|
|
88
84
|
subscribe: mockChainIdWritable.subscribe,
|
|
89
85
|
set: mockChainIdWritable.set,
|
|
90
|
-
mockSetSubscribeValue: (value) => mockChainIdWritable.set(value)
|
|
86
|
+
mockSetSubscribeValue: (value) => mockChainIdWritable.set(value),
|
|
91
87
|
};
|
|
92
88
|
export const mockConnectedStore = {
|
|
93
89
|
subscribe: mockConnectedWritable.subscribe,
|
|
94
90
|
set: mockConnectedWritable.set,
|
|
95
91
|
update: mockConnectedWritable.update,
|
|
96
|
-
mockSetSubscribeValue: (value) => mockConnectedWritable.set(value)
|
|
92
|
+
mockSetSubscribeValue: (value) => mockConnectedWritable.set(value),
|
|
97
93
|
};
|
|
98
94
|
export const mockWagmiConfigStore = {
|
|
99
95
|
subscribe: mockWagmiConfigWritable.subscribe,
|
|
100
96
|
set: mockWagmiConfigWritable.set,
|
|
101
97
|
update: mockWagmiConfigWritable.update,
|
|
102
|
-
mockSetSubscribeValue: (value) => mockWagmiConfigWritable.set(value)
|
|
98
|
+
mockSetSubscribeValue: (value) => mockWagmiConfigWritable.set(value),
|
|
103
99
|
};
|
|
104
|
-
export const
|
|
105
|
-
subscribe:
|
|
106
|
-
set:
|
|
107
|
-
mockSetSubscribeValue: (value) =>
|
|
100
|
+
export const mockSelectedChainIdsStore = {
|
|
101
|
+
subscribe: mockSelectedChainIdsWritable.subscribe,
|
|
102
|
+
set: mockSelectedChainIdsWritable.set,
|
|
103
|
+
mockSetSubscribeValue: (value) => mockSelectedChainIdsWritable.set(value),
|
|
108
104
|
};
|
|
109
105
|
export const mockPageStore = {
|
|
110
106
|
subscribe: mockPageWritable.subscribe,
|
|
111
107
|
set: mockPageWritable.set,
|
|
112
|
-
mockSetSubscribeValue: (
|
|
108
|
+
mockSetSubscribeValue: (newValue) => {
|
|
109
|
+
mockPageWritable.update((currentValue) => ({
|
|
110
|
+
...currentValue,
|
|
111
|
+
...newValue,
|
|
112
|
+
}));
|
|
113
|
+
},
|
|
114
|
+
reset: () => mockPageWritable.set(initialPageState),
|
|
115
|
+
};
|
|
116
|
+
export const mockActiveTokensStore = {
|
|
117
|
+
subscribe: mockActiveTokensWritable.subscribe,
|
|
118
|
+
set: mockActiveTokensWritable.set,
|
|
119
|
+
mockSetSubscribeValue: (value) => mockActiveTokensWritable.set(value),
|
|
120
|
+
};
|
|
121
|
+
export const mockActiveRaindexAddressesStore = {
|
|
122
|
+
subscribe: mockActiveRaindexAddressesWritable.subscribe,
|
|
123
|
+
set: mockActiveRaindexAddressesWritable.set,
|
|
124
|
+
mockSetSubscribeValue: (value) => mockActiveRaindexAddressesWritable.set(value),
|
|
125
|
+
};
|
|
126
|
+
export const mockOwnerFilterStore = {
|
|
127
|
+
subscribe: mockOwnerFilterWritable.subscribe,
|
|
128
|
+
set: mockOwnerFilterWritable.set,
|
|
129
|
+
mockSetSubscribeValue: (value) => mockOwnerFilterWritable.set(value),
|
|
113
130
|
};
|
package/dist/app.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
1
|
+
@import "tailwindcss/base";
|
|
2
|
+
@import "tailwindcss/components";
|
|
3
|
+
@import "tailwindcss/utilities";
|
|
@@ -9,6 +9,12 @@ function toggle(e) {
|
|
|
9
9
|
}
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
|
-
<button
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
title="Toggle dark mode"
|
|
15
|
+
aria-label="Toggle dark mode"
|
|
16
|
+
data-testid="dark-mode-toggle"
|
|
17
|
+
on:click={toggle}
|
|
18
|
+
>
|
|
13
19
|
<DarkMode />
|
|
14
20
|
</button>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import { EyeOutline, EyeSlashOutline } from "flowbite-svelte-icons";
|
|
2
|
+
import { scrub as scrubStore } from "../storesGeneric/scrub";
|
|
3
|
+
export let scrub = scrubStore;
|
|
4
|
+
function toggle() {
|
|
5
|
+
scrub.update((value) => !value);
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<button
|
|
10
|
+
type="button"
|
|
11
|
+
on:click={toggle}
|
|
12
|
+
data-testid="scrub-toggle"
|
|
13
|
+
aria-pressed={$scrub}
|
|
14
|
+
title={$scrub ? 'Show addresses and hashes' : 'Hide addresses and hashes for screenshots'}
|
|
15
|
+
class="rounded-lg p-2 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
16
|
+
>
|
|
17
|
+
{#if $scrub}
|
|
18
|
+
<EyeSlashOutline />
|
|
19
|
+
{:else}
|
|
20
|
+
<EyeOutline />
|
|
21
|
+
{/if}
|
|
22
|
+
</button>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Writable } from 'svelte/store';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* Eyeball toggle for the global "scrub" mode. Sits next to the dark-mode
|
|
7
|
+
* button in the sidebar. Clicking it masks/unmasks every address and
|
|
8
|
+
* transaction hash in the GUI for safe screenshotting.
|
|
9
|
+
*
|
|
10
|
+
* The store is injectable for testing; it defaults to the global scrub store.
|
|
11
|
+
*/ scrub?: Writable<boolean>;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
exports?: {} | undefined;
|
|
18
|
+
bindings?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
export type ButtonScrubProps = typeof __propDef.props;
|
|
21
|
+
export type ButtonScrubEvents = typeof __propDef.events;
|
|
22
|
+
export type ButtonScrubSlots = typeof __propDef.slots;
|
|
23
|
+
export default class ButtonScrub extends SvelteComponent<ButtonScrubProps, ButtonScrubEvents, ButtonScrubSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import
|
|
3
|
-
import { formatUnits } from "viem";
|
|
1
|
+
<script>import { toHex } from "viem";
|
|
2
|
+
import Tooltip from "./Tooltip.svelte";
|
|
4
3
|
export let tokenVault;
|
|
5
|
-
export let
|
|
4
|
+
export let chainId;
|
|
5
|
+
export let raindexAddress;
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<div
|
|
@@ -10,17 +10,18 @@ export let subgraphName;
|
|
|
10
10
|
data-testid="vault-link"
|
|
11
11
|
>
|
|
12
12
|
<div class="flex flex-col items-start gap-y-2">
|
|
13
|
-
<Tooltip triggeredBy=
|
|
14
|
-
ID: <span class="font-mono">{
|
|
13
|
+
<Tooltip triggeredBy={`#token-info-${tokenVault.vaultId}`}>
|
|
14
|
+
ID: <span class="font-mono">{toHex(tokenVault.vaultId)}</span>
|
|
15
15
|
</Tooltip>
|
|
16
|
-
<a
|
|
16
|
+
<a
|
|
17
|
+
href={`/vaults/${chainId}-${raindexAddress}-${tokenVault.id}`}
|
|
18
|
+
id={`token-info-${tokenVault.vaultId}`}
|
|
19
|
+
class="text-blue-500 hover:underline"
|
|
20
|
+
>
|
|
17
21
|
{tokenVault.token.name} ({tokenVault.token.symbol})
|
|
18
22
|
</a>
|
|
19
23
|
<span class="text-sm text-gray-500 dark:text-gray-400">
|
|
20
|
-
Balance: {
|
|
21
|
-
BigInt(tokenVault.balance),
|
|
22
|
-
parseInt(tokenVault.token.decimals || '18')
|
|
23
|
-
)}
|
|
24
|
+
Balance: {tokenVault.formattedBalance}
|
|
24
25
|
</span>
|
|
25
26
|
</div>
|
|
26
27
|
<div>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Address, RaindexVault } from '@rainlanguage/raindex';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
tokenVault:
|
|
6
|
-
|
|
5
|
+
tokenVault: RaindexVault;
|
|
6
|
+
chainId: number;
|
|
7
|
+
raindexAddress: Address;
|
|
7
8
|
};
|
|
8
9
|
events: {
|
|
9
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>import { Checkbox, Label } from "flowbite-svelte";
|
|
2
|
+
export let hideInactiveOrdersVaults;
|
|
3
|
+
function handleHideInactiveOrdersVaultsChange() {
|
|
4
|
+
$hideInactiveOrdersVaults = !$hideInactiveOrdersVaults;
|
|
5
|
+
}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div data-testid="inactive-orders-vault-checkbox" class="flex items-center gap-x-2">
|
|
9
|
+
<Label
|
|
10
|
+
for="hide-inactive-orders-vaults"
|
|
11
|
+
class="cursor-pointer whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
12
|
+
>
|
|
13
|
+
Hide vaults without active orders
|
|
14
|
+
</Label>
|
|
15
|
+
<Checkbox
|
|
16
|
+
id="hide-inactive-orders-vaults"
|
|
17
|
+
checked={$hideInactiveOrdersVaults}
|
|
18
|
+
on:change={handleHideInactiveOrdersVaultsChange}
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { AppStoresInterface } from '../types/appStores';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
hideInactiveOrdersVaults: AppStoresInterface["hideInactiveOrdersVaults"];
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type CheckboxInactiveOrdersVaultProps = typeof __propDef.props;
|
|
15
|
+
export type CheckboxInactiveOrdersVaultEvents = typeof __propDef.events;
|
|
16
|
+
export type CheckboxInactiveOrdersVaultSlots = typeof __propDef.slots;
|
|
17
|
+
export default class CheckboxInactiveOrdersVault extends SvelteComponent<CheckboxInactiveOrdersVaultProps, CheckboxInactiveOrdersVaultEvents, CheckboxInactiveOrdersVaultSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppStoresInterface } from '../types/appStores';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
hideZeroBalanceVaults:
|
|
5
|
+
hideZeroBalanceVaults: AppStoresInterface["hideZeroBalanceVaults"];
|
|
6
6
|
};
|
|
7
7
|
events: {
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
@@ -6,6 +6,7 @@ export let disabled = false;
|
|
|
6
6
|
export let styles = {};
|
|
7
7
|
export let rainlangExtension;
|
|
8
8
|
export let codeMirrorTheme;
|
|
9
|
+
export let onTextChange;
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<div data-testid="codemirror-dotrain">
|
|
@@ -22,6 +23,9 @@ export let codeMirrorTheme;
|
|
|
22
23
|
},
|
|
23
24
|
...styles
|
|
24
25
|
}}
|
|
26
|
+
on:change={(e) => {
|
|
27
|
+
onTextChange(e.detail);
|
|
28
|
+
}}
|
|
25
29
|
on:ready={(e) => {
|
|
26
30
|
openLintPanel(e.detail);
|
|
27
31
|
}}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import CodeMirror from "svelte-codemirror-editor";
|
|
1
|
+
<script>import CodeMirror from "svelte-codemirror-editor";
|
|
3
2
|
import { RainlangLR } from "codemirror-rainlang";
|
|
3
|
+
import { stripTrailingWhitespace } from "../utils/stripTrailingWhitespace";
|
|
4
4
|
export let order = void 0;
|
|
5
5
|
export let rainlangText = void 0;
|
|
6
6
|
export let codeMirrorTheme;
|
|
7
7
|
export let codeMirrorDisabled = true;
|
|
8
8
|
export let codeMirrorStyles = {};
|
|
9
|
-
|
|
9
|
+
export let onSave = void 0;
|
|
10
|
+
let value;
|
|
11
|
+
$: value = rainlangText ?? order?.rainlang;
|
|
12
|
+
function handleBlur() {
|
|
13
|
+
if (value === void 0) return;
|
|
14
|
+
const stripped = stripTrailingWhitespace(value);
|
|
15
|
+
value = stripped;
|
|
16
|
+
rainlangText = stripped;
|
|
17
|
+
onSave?.(stripped);
|
|
18
|
+
}
|
|
10
19
|
</script>
|
|
11
20
|
|
|
12
|
-
|
|
21
|
+
<!-- Render the editor whenever a source value is present, including an empty
|
|
22
|
+
string left by stripping whitespace-only input on blur. -->
|
|
23
|
+
{#if value != null}
|
|
13
24
|
<CodeMirror
|
|
14
|
-
value
|
|
25
|
+
{value}
|
|
15
26
|
extensions={[RainlangLR]}
|
|
16
27
|
theme={codeMirrorTheme}
|
|
17
28
|
readonly={codeMirrorDisabled}
|
|
@@ -23,12 +34,9 @@ $: extendedOrder = order ? extendOrder(order) : void 0;
|
|
|
23
34
|
},
|
|
24
35
|
...codeMirrorStyles
|
|
25
36
|
}}
|
|
37
|
+
on:change={(e) => {
|
|
38
|
+
value = e.detail;
|
|
39
|
+
}}
|
|
40
|
+
on:blur={handleBlur}
|
|
26
41
|
/>
|
|
27
|
-
{:else if !extendedOrder?.rainlang && !rainlangText}
|
|
28
|
-
<div
|
|
29
|
-
class="w-full tracking-tight text-gray-900 dark:text-white"
|
|
30
|
-
data-testid="rainlang-not-included"
|
|
31
|
-
>
|
|
32
|
-
Rain source not included in order meta
|
|
33
|
-
</div>
|
|
34
42
|
{/if}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { RaindexOrder } from '@rainlanguage/raindex';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
order?:
|
|
5
|
+
order?: RaindexOrder | undefined;
|
|
6
6
|
rainlangText?: string | undefined;
|
|
7
7
|
codeMirrorTheme: any;
|
|
8
8
|
codeMirrorDisabled?: boolean;
|
|
9
9
|
codeMirrorStyles?: {};
|
|
10
|
+
onSave?: ((text: string) => void) | undefined;
|
|
10
11
|
};
|
|
11
12
|
events: {
|
|
12
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { PenSolid } from "flowbite-svelte-icons";
|
|
2
3
|
export let displayValue;
|
|
3
|
-
let focussed = false;
|
|
4
4
|
let textContent;
|
|
5
5
|
let editableSpan;
|
|
6
6
|
let dispatch = createEventDispatcher();
|
|
7
|
-
const inputFocussed = () => {
|
|
8
|
-
focussed = true;
|
|
9
|
-
dispatch("focus");
|
|
10
|
-
};
|
|
11
7
|
const inputBlurred = () => {
|
|
12
|
-
focussed = false;
|
|
13
8
|
displayValue = textContent;
|
|
14
9
|
dispatch("blur", { value: textContent });
|
|
15
10
|
};
|
|
@@ -20,27 +15,21 @@ const handleKeyDown = (event) => {
|
|
|
20
15
|
};
|
|
21
16
|
</script>
|
|
22
17
|
|
|
23
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
24
18
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
25
19
|
<div
|
|
26
20
|
data-testid="editableSpanWrapper"
|
|
27
|
-
|
|
28
|
-
class="flex gap-x-1 border-b-2 border-dotted text-sm text-gray-400 dark:text-gray-400"
|
|
21
|
+
class="flex items-center gap-x-1 border-b-2 border-dotted text-sm text-gray-400 dark:text-gray-400"
|
|
29
22
|
>
|
|
23
|
+
<PenSolid class="h-3 w-3 cursor-pointer" />
|
|
30
24
|
<span>Block:</span>
|
|
31
25
|
<div class="relative">
|
|
32
26
|
<span
|
|
33
27
|
data-testid="editableSpan"
|
|
34
|
-
class="absolute"
|
|
35
|
-
class:opacity-0={!focussed}
|
|
36
28
|
bind:this={editableSpan}
|
|
37
29
|
bind:textContent
|
|
38
30
|
contenteditable="true"
|
|
39
31
|
on:keydown={handleKeyDown}
|
|
40
32
|
on:blur={inputBlurred}>{displayValue}</span
|
|
41
33
|
>
|
|
42
|
-
<span data-testid="displayElement" class="pointer-events-none" class:opacity-0={focussed}
|
|
43
|
-
>{displayValue}</span
|
|
44
|
-
>
|
|
45
34
|
</div>
|
|
46
35
|
</div>
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
})(HashType || {});
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
|
-
<script>import
|
|
10
|
+
<script>import Tooltip from "./Tooltip.svelte";
|
|
11
|
+
import Sensitive from "./Sensitive.svelte";
|
|
11
12
|
import {
|
|
12
13
|
WalletOutline,
|
|
13
14
|
FingerprintOutline,
|
|
@@ -54,13 +55,13 @@ function copy(e) {
|
|
|
54
55
|
{:else if type === HashType.Address}
|
|
55
56
|
<ClipboardOutline size="sm" />
|
|
56
57
|
{/if}
|
|
57
|
-
<div>{displayValue}</div>
|
|
58
|
+
<Sensitive><div>{displayValue}</div></Sensitive>
|
|
58
59
|
</button>
|
|
59
60
|
|
|
60
61
|
{#if showCopiedMessage}
|
|
61
62
|
<div
|
|
62
63
|
out:fade
|
|
63
|
-
class="fixed rounded bg-green-500 px-2 py-1 text-xs text-white
|
|
64
|
+
class="fixed rounded bg-green-500 px-2 py-1 text-xs text-white"
|
|
64
65
|
style="top: {cursorY + 10}px; left: {cursorX + 10}px"
|
|
65
66
|
>
|
|
66
67
|
Copied to clipboard
|
|
@@ -68,7 +69,7 @@ function copy(e) {
|
|
|
68
69
|
{/if}
|
|
69
70
|
|
|
70
71
|
{#if shorten}
|
|
71
|
-
<Tooltip triggeredBy={`#${id}`}
|
|
72
|
+
<Tooltip triggeredBy={`#${id}`}>
|
|
72
73
|
<div class="flex items-center justify-start space-x-2">
|
|
73
74
|
{#if type === HashType.Wallet}
|
|
74
75
|
<WalletOutline size="sm" />
|
|
@@ -79,7 +80,7 @@ function copy(e) {
|
|
|
79
80
|
{:else if type === HashType.Address}
|
|
80
81
|
<ClipboardOutline size="sm" />
|
|
81
82
|
{/if}
|
|
82
|
-
<div>{value}</div>
|
|
83
|
+
<Sensitive><div>{value}</div></Sensitive>
|
|
83
84
|
</div>
|
|
84
85
|
</Tooltip>
|
|
85
86
|
{/if}
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
import { Heading, Text, BlockQuote } from '@rainlanguage/ui-components';
|
|
3
3
|
import Markdown from 'svelte-markdown';
|
|
4
4
|
import { onMount } from 'svelte';
|
|
5
|
+
import { LICENSE_URL } from '../consts';
|
|
5
6
|
|
|
6
7
|
let source = '';
|
|
7
8
|
|
|
8
9
|
onMount(async () => {
|
|
9
10
|
try {
|
|
10
|
-
const response = await fetch(
|
|
11
|
-
'https://raw.githubusercontent.com/rainlanguage/decentralicense/refs/heads/master/README.md'
|
|
12
|
-
);
|
|
11
|
+
const response = await fetch(LICENSE_URL);
|
|
13
12
|
if (response.ok) {
|
|
14
13
|
source = await response.text();
|
|
14
|
+
} else {
|
|
15
|
+
source = `Failed to fetch license: HTTP ${response.status}`;
|
|
15
16
|
}
|
|
16
17
|
} catch {
|
|
17
|
-
source = '';
|
|
18
|
+
source = 'Failed to fetch license.';
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
</script>
|