@rainlanguage/ui-components 0.0.1-alpha.111 → 0.0.1-alpha.113
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/dist/components/deployment/ButtonSelectOption.svelte +2 -0
- package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
- package/dist/components/deployment/DeploymentSteps.svelte +2 -3
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +2 -0
- package/dist/components/deployment/DepositInput.svelte +1 -0
- package/dist/components/deployment/DisclaimerModal.svelte +1 -0
- package/dist/components/deployment/FieldDefinitionInput.svelte +2 -0
- package/dist/components/deployment/SelectToken.svelte +4 -1
- package/dist/components/deployment/TokenIOInput.svelte +1 -0
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export let active;
|
|
3
3
|
export let buttonText;
|
|
4
4
|
export let clickHandler;
|
|
5
|
+
export let dataTestId;
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
8
|
<Button
|
|
@@ -9,6 +10,7 @@ export let clickHandler;
|
|
|
9
10
|
color="alternative"
|
|
10
11
|
class={active ? 'border-2 border-blue-300 dark:border-blue-700' : 'border-2 border-transparent'}
|
|
11
12
|
on:click={clickHandler}
|
|
13
|
+
data-testid={dataTestId}
|
|
12
14
|
>
|
|
13
15
|
{buttonText}
|
|
14
16
|
</Button>
|
|
@@ -13,7 +13,6 @@ import DepositInput from "./DepositInput.svelte";
|
|
|
13
13
|
import SelectToken from "./SelectToken.svelte";
|
|
14
14
|
import DeploymentSectionHeader from "./DeploymentSectionHeader.svelte";
|
|
15
15
|
import { useGui } from "../../hooks/useGui";
|
|
16
|
-
import { useAccount } from "../../providers/wallet/useAccount";
|
|
17
16
|
import { handleDeployment } from "./handleDeployment";
|
|
18
17
|
import {} from "../../types/transaction";
|
|
19
18
|
import { fade } from "svelte/transition";
|
|
@@ -25,6 +24,7 @@ export let onDeploy;
|
|
|
25
24
|
export let wagmiConnected;
|
|
26
25
|
export let appKitModal;
|
|
27
26
|
export let settings;
|
|
27
|
+
export let account;
|
|
28
28
|
let allDepositFields = [];
|
|
29
29
|
let allTokenOutputs = [];
|
|
30
30
|
let allFieldDefinitionsWithoutDefaults = [];
|
|
@@ -35,7 +35,6 @@ let allTokenInfos = [];
|
|
|
35
35
|
let selectTokens = void 0;
|
|
36
36
|
let checkingDeployment = false;
|
|
37
37
|
let subgraphUrl = void 0;
|
|
38
|
-
const { account } = useAccount();
|
|
39
38
|
const gui = useGui();
|
|
40
39
|
const registry = useRegistry();
|
|
41
40
|
let deploymentStepsError = DeploymentStepsError.error;
|
|
@@ -179,7 +178,7 @@ async function handleDeployButtonClick() {
|
|
|
179
178
|
}
|
|
180
179
|
DeploymentStepsError.clear();
|
|
181
180
|
const deploymentArgs = await handleDeployment(gui, $account, subgraphUrl);
|
|
182
|
-
return
|
|
181
|
+
return onDeploy(deploymentArgs);
|
|
183
182
|
} catch (e) {
|
|
184
183
|
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.ADD_ORDER_FAILED);
|
|
185
184
|
} finally {
|
|
@@ -3,6 +3,7 @@ import { type ConfigSource, type NameAndDescriptionCfg } from '@rainlanguage/ord
|
|
|
3
3
|
import { type Writable } from 'svelte/store';
|
|
4
4
|
import type { AppKit } from '@reown/appkit';
|
|
5
5
|
import { type DeploymentArgs } from '../../types/transaction';
|
|
6
|
+
import type { Account } from '../../types/account';
|
|
6
7
|
declare const __propDef: {
|
|
7
8
|
props: {
|
|
8
9
|
/** The deployment configuration containing key, name and description */ deployment: {
|
|
@@ -15,6 +16,7 @@ declare const __propDef: {
|
|
|
15
16
|
wagmiConnected: Writable<boolean>;
|
|
16
17
|
appKitModal: Writable<AppKit>;
|
|
17
18
|
settings: Writable<ConfigSource>;
|
|
19
|
+
account: Account;
|
|
18
20
|
};
|
|
19
21
|
events: {
|
|
20
22
|
[evt: string]: CustomEvent<any>;
|
|
@@ -85,6 +85,7 @@ $: if (deposit.token?.key) {
|
|
|
85
85
|
<div class="flex w-full flex-wrap gap-4">
|
|
86
86
|
{#each deposit.presets as preset}
|
|
87
87
|
<ButtonSelectOption
|
|
88
|
+
dataTestId={`deposit-preset-${preset}`}
|
|
88
89
|
active={currentDeposit?.amount === preset}
|
|
89
90
|
buttonText={preset}
|
|
90
91
|
clickHandler={() => handlePresetClick(preset)}
|
|
@@ -13,6 +13,7 @@ async function handleAcceptDisclaimer() {
|
|
|
13
13
|
bind:open
|
|
14
14
|
class="max-h-full dark:border dark:border-gray-700 dark:bg-gray-900"
|
|
15
15
|
dialogClass="fixed top-0 start-0 end-1 h-modal md:inset-0 md:h-full z-50 w-full p-4 flex justify-center items-center h-full"
|
|
16
|
+
data-testid="deployment-disclaimer-modal"
|
|
16
17
|
>
|
|
17
18
|
<div class="flex flex-col items-start gap-y-8 p-4">
|
|
18
19
|
<div class="space-y-4">
|
|
@@ -48,6 +48,7 @@ async function handleCustomInputChange(value) {
|
|
|
48
48
|
<div class="flex w-full flex-wrap gap-4">
|
|
49
49
|
{#each fieldDefinition.presets as preset}
|
|
50
50
|
<ButtonSelectOption
|
|
51
|
+
dataTestId={`binding-${fieldDefinition.binding}-preset-${preset.name || preset.value}`}
|
|
51
52
|
buttonText={preset.name || preset.value}
|
|
52
53
|
clickHandler={() => handlePresetClick(preset)}
|
|
53
54
|
active={currentValue?.value === preset.value}
|
|
@@ -58,6 +59,7 @@ async function handleCustomInputChange(value) {
|
|
|
58
59
|
|
|
59
60
|
{#if !fieldDefinition.presets || fieldDefinition.showCustomField}
|
|
60
61
|
<Input
|
|
62
|
+
data-testid={`binding-${fieldDefinition.binding}-input`}
|
|
61
63
|
size="lg"
|
|
62
64
|
placeholder="Enter custom value"
|
|
63
65
|
bind:value={inputValue}
|
|
@@ -81,7 +81,10 @@ async function handleInput(event) {
|
|
|
81
81
|
<span>Checking...</span>
|
|
82
82
|
</div>
|
|
83
83
|
{:else if tokenInfo}
|
|
84
|
-
<div
|
|
84
|
+
<div
|
|
85
|
+
class="flex h-5 flex-row items-center gap-2"
|
|
86
|
+
data-testid={`select-token-success-${token.key}`}
|
|
87
|
+
>
|
|
85
88
|
<CheckCircleSolid class="h-5 w-5" color="green" />
|
|
86
89
|
<span>{tokenInfo.name}</span>
|
|
87
90
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainlanguage/ui-components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.113",
|
|
4
4
|
"description": "A component library for building Svelte applications to be used with Raindex.",
|
|
5
5
|
"license": "LicenseRef-DCL-1.0",
|
|
6
6
|
"author": "Rain Open Source Software Ltd",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@fontsource/dm-sans": "5.1.0",
|
|
54
54
|
"@imask/svelte": "7.6.1",
|
|
55
55
|
"@observablehq/plot": "0.6.16",
|
|
56
|
-
"@rainlanguage/orderbook": "0.0.1-alpha.
|
|
56
|
+
"@rainlanguage/orderbook": "0.0.1-alpha.113",
|
|
57
57
|
"@reown/appkit": "1.6.4",
|
|
58
58
|
"@reown/appkit-adapter-wagmi": "1.6.4",
|
|
59
59
|
"@sentry/sveltekit": "7.120.0",
|