@rainlanguage/ui-components 0.0.1-alpha.13 → 0.0.1-alpha.15
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/DeploymentSteps.svelte +13 -4
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +1 -2
- package/dist/errors/DeploymentStepsError.d.ts +2 -1
- package/dist/errors/DeploymentStepsError.js +2 -1
- package/dist/hooks/useGui.d.ts +3 -0
- package/dist/hooks/useGui.js +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/providers/GuiProvider.svelte +8 -0
- package/dist/providers/GuiProvider.svelte.d.ts +21 -0
- package/package.json +2 -2
- package/dist/components/deployment/SelectTokensSection.svelte +0 -17
- package/dist/components/deployment/SelectTokensSection.svelte.d.ts +0 -21
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
<script>import { Alert } from "flowbite-svelte";
|
|
2
2
|
import TokenIOSection from "./TokenIOSection.svelte";
|
|
3
3
|
import DepositsSection from "./DepositsSection.svelte";
|
|
4
|
-
import SelectTokensSection from "./SelectTokensSection.svelte";
|
|
5
4
|
import ComposedRainlangModal from "./ComposedRainlangModal.svelte";
|
|
6
5
|
import FieldDefinitionsSection from "./FieldDefinitionsSection.svelte";
|
|
7
6
|
import {} from "@rainlanguage/orderbook/js_api";
|
|
8
7
|
import WalletConnect from "../wallet/WalletConnect.svelte";
|
|
9
8
|
import {
|
|
10
|
-
DotrainOrderGui
|
|
11
9
|
} from "@rainlanguage/orderbook/js_api";
|
|
12
10
|
import { fade } from "svelte/transition";
|
|
13
11
|
import { Button, Toggle, Spinner } from "flowbite-svelte";
|
|
@@ -18,11 +16,13 @@ import { handleShareChoices } from "../../services/handleShareChoices";
|
|
|
18
16
|
import { getDeploymentTransactionArgs } from "./getDeploymentTransactionArgs";
|
|
19
17
|
import { DeploymentStepsError, DeploymentStepsErrorCode } from "../../errors";
|
|
20
18
|
import { onMount } from "svelte";
|
|
19
|
+
import SelectToken from "./SelectToken.svelte";
|
|
20
|
+
import DeploymentSectionHeader from "./DeploymentSectionHeader.svelte";
|
|
21
|
+
import { useGui } from "../../hooks/useGui";
|
|
21
22
|
export let settings;
|
|
22
23
|
export let dotrain;
|
|
23
24
|
export let deployment;
|
|
24
25
|
export let strategyDetail;
|
|
25
|
-
export let gui;
|
|
26
26
|
export let handleDeployModal;
|
|
27
27
|
export let handleDisclaimerModal;
|
|
28
28
|
let allDepositFields = [];
|
|
@@ -33,6 +33,7 @@ let allTokensSelected = false;
|
|
|
33
33
|
let showAdvancedOptions = false;
|
|
34
34
|
let checkingDeployment = false;
|
|
35
35
|
let allTokenInfos = [];
|
|
36
|
+
const gui = useGui();
|
|
36
37
|
const selectTokens = gui.getSelectTokens();
|
|
37
38
|
const networkKey = gui.getNetworkKey();
|
|
38
39
|
const subgraphUrl = $settings?.subgraphs?.[networkKey] ?? "";
|
|
@@ -191,7 +192,15 @@ const areAllTokensSelected = async () => {
|
|
|
191
192
|
{/if}
|
|
192
193
|
|
|
193
194
|
{#if selectTokens && selectTokens.length > 0}
|
|
194
|
-
<
|
|
195
|
+
<div class="flex w-full flex-col gap-4">
|
|
196
|
+
<DeploymentSectionHeader
|
|
197
|
+
title="Select Tokens"
|
|
198
|
+
description="Select the tokens that you want to use in your order."
|
|
199
|
+
/>
|
|
200
|
+
{#each selectTokens as token}
|
|
201
|
+
<SelectToken {token} {onSelectTokenSelect} {gui} />
|
|
202
|
+
{/each}
|
|
203
|
+
</div>
|
|
195
204
|
{/if}
|
|
196
205
|
|
|
197
206
|
{#if allTokensSelected || selectTokens?.length === 0}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import { type ConfigSource } from '@rainlanguage/orderbook/js_api';
|
|
3
|
-
import {
|
|
3
|
+
import { type NameAndDescriptionCfg } from '@rainlanguage/orderbook/js_api';
|
|
4
4
|
import { type Config } from '@wagmi/core';
|
|
5
5
|
import { type Writable } from 'svelte/store';
|
|
6
6
|
import type { AppKit } from '@reown/appkit';
|
|
@@ -15,7 +15,6 @@ declare const __propDef: {
|
|
|
15
15
|
description: string;
|
|
16
16
|
};
|
|
17
17
|
strategyDetail: NameAndDescriptionCfg;
|
|
18
|
-
gui: DotrainOrderGui;
|
|
19
18
|
handleDeployModal: (args: DeployModalProps) => void;
|
|
20
19
|
handleDisclaimerModal: (args: DisclaimerModalProps) => void;
|
|
21
20
|
wagmiConfig: Writable<Config | undefined>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare enum DeploymentStepsErrorCode {
|
|
2
|
-
|
|
2
|
+
NO_GUI_PROVIDER = "No GUI provider found.",
|
|
3
|
+
NO_GUI = "Error loading GUI.",
|
|
3
4
|
NO_STRATEGY = "No valid strategy exists at this URL",
|
|
4
5
|
NO_SELECT_TOKENS = "Error loading tokens",
|
|
5
6
|
NO_TOKEN_INFO = "Error loading token information",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
2
|
export var DeploymentStepsErrorCode;
|
|
3
3
|
(function (DeploymentStepsErrorCode) {
|
|
4
|
-
DeploymentStepsErrorCode["
|
|
4
|
+
DeploymentStepsErrorCode["NO_GUI_PROVIDER"] = "No GUI provider found.";
|
|
5
|
+
DeploymentStepsErrorCode["NO_GUI"] = "Error loading GUI.";
|
|
5
6
|
DeploymentStepsErrorCode["NO_STRATEGY"] = "No valid strategy exists at this URL";
|
|
6
7
|
DeploymentStepsErrorCode["NO_SELECT_TOKENS"] = "Error loading tokens";
|
|
7
8
|
DeploymentStepsErrorCode["NO_TOKEN_INFO"] = "Error loading token information";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getContext } from 'svelte';
|
|
2
|
+
import { DotrainOrderGui } from '@rainlanguage/orderbook/js_api';
|
|
3
|
+
import { DeploymentStepsError, DeploymentStepsErrorCode } from '../errors/DeploymentStepsError';
|
|
4
|
+
export const GUI_CONTEXT_KEY = 'gui-context';
|
|
5
|
+
export function useGui() {
|
|
6
|
+
const gui = getContext(GUI_CONTEXT_KEY);
|
|
7
|
+
if (!gui) {
|
|
8
|
+
DeploymentStepsError.catch(null, DeploymentStepsErrorCode.NO_GUI_PROVIDER);
|
|
9
|
+
}
|
|
10
|
+
return gui;
|
|
11
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -87,3 +87,5 @@ export { default as transactionStore } from './stores/transactionStore';
|
|
|
87
87
|
export { mockTransactionStore } from './__mocks__/mockTransactionStore';
|
|
88
88
|
export { default as logoLight } from './assets/logo-light.svg';
|
|
89
89
|
export { default as logoDark } from './assets/logo-dark.svg';
|
|
90
|
+
export { useGui } from './hooks/useGui';
|
|
91
|
+
export { default as GuiProvider } from './providers/GuiProvider.svelte';
|
package/dist/index.js
CHANGED
|
@@ -87,3 +87,7 @@ export { mockTransactionStore } from './__mocks__/mockTransactionStore';
|
|
|
87
87
|
// Assets
|
|
88
88
|
export { default as logoLight } from './assets/logo-light.svg';
|
|
89
89
|
export { default as logoDark } from './assets/logo-dark.svg';
|
|
90
|
+
// Hooks
|
|
91
|
+
export { useGui } from './hooks/useGui';
|
|
92
|
+
// Providers
|
|
93
|
+
export { default as GuiProvider } from './providers/GuiProvider.svelte';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { DotrainOrderGui } from '@rainlanguage/orderbook/js_api';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
gui: DotrainOrderGui;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
exports?: {} | undefined;
|
|
14
|
+
bindings?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type GuiProviderProps = typeof __propDef.props;
|
|
17
|
+
export type GuiProviderEvents = typeof __propDef.events;
|
|
18
|
+
export type GuiProviderSlots = typeof __propDef.slots;
|
|
19
|
+
export default class GuiProvider extends SvelteComponent<GuiProviderProps, GuiProviderEvents, GuiProviderSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
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.15",
|
|
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.0.18",
|
|
54
54
|
"@imask/svelte": "^7.3.0",
|
|
55
55
|
"@observablehq/plot": "^0.6.13",
|
|
56
|
-
"@rainlanguage/orderbook": "0.0.1-alpha.
|
|
56
|
+
"@rainlanguage/orderbook": "0.0.1-alpha.15",
|
|
57
57
|
"@reown/appkit": "^1.6.4",
|
|
58
58
|
"@reown/appkit-adapter-wagmi": "^1.6.4",
|
|
59
59
|
"@sentry/sveltekit": "^7.107.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script>import DeploymentSectionHeader from "./DeploymentSectionHeader.svelte";
|
|
2
|
-
import SelectToken from "./SelectToken.svelte";
|
|
3
|
-
import { DotrainOrderGui } from "@rainlanguage/orderbook/js_api";
|
|
4
|
-
export let gui;
|
|
5
|
-
export let selectTokens;
|
|
6
|
-
export let onSelectTokenSelect;
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<div class="flex w-full flex-col gap-4">
|
|
10
|
-
<DeploymentSectionHeader
|
|
11
|
-
title="Select Tokens"
|
|
12
|
-
description="Select the tokens that you want to use in your order."
|
|
13
|
-
/>
|
|
14
|
-
{#each selectTokens as token}
|
|
15
|
-
<SelectToken {token} bind:gui {onSelectTokenSelect} />
|
|
16
|
-
{/each}
|
|
17
|
-
</div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { DotrainOrderGui, type SelectTokens } from '@rainlanguage/orderbook/js_api';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
gui: DotrainOrderGui;
|
|
6
|
-
selectTokens: SelectTokens;
|
|
7
|
-
onSelectTokenSelect: () => void;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
exports?: {} | undefined;
|
|
14
|
-
bindings?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export type SelectTokensSectionProps = typeof __propDef.props;
|
|
17
|
-
export type SelectTokensSectionEvents = typeof __propDef.events;
|
|
18
|
-
export type SelectTokensSectionSlots = typeof __propDef.slots;
|
|
19
|
-
export default class SelectTokensSection extends SvelteComponent<SelectTokensSectionProps, SelectTokensSectionEvents, SelectTokensSectionSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|