@rainlanguage/ui-components 0.0.1-alpha.65 → 0.0.1-alpha.67

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.
@@ -1,3 +1,7 @@
1
1
  import type { ConfigSource } from '@rainlanguage/orderbook';
2
2
  export declare const mockConfigSource: ConfigSource;
3
- export declare const mockSettingsStore: import("svelte/store").Writable<ConfigSource>;
3
+ export declare const mockSettingsStore: {
4
+ subscribe: (this: void, run: import("svelte/store").Subscriber<ConfigSource>, invalidate?: import("svelte/store").Invalidator<ConfigSource> | undefined) => import("svelte/store").Unsubscriber;
5
+ set: (this: void, value: ConfigSource) => void;
6
+ mockSetSubscribeValue: (value: ConfigSource) => void;
7
+ };
@@ -34,4 +34,9 @@ export const mockConfigSource = {
34
34
  name_two: 'address_two'
35
35
  }
36
36
  };
37
- export const mockSettingsStore = writable(mockConfigSource);
37
+ const mockSettingsStoreWritable = writable(mockConfigSource);
38
+ export const mockSettingsStore = {
39
+ subscribe: mockSettingsStoreWritable.subscribe,
40
+ set: mockSettingsStoreWritable.set,
41
+ mockSetSubscribeValue: (value) => mockSettingsStoreWritable.set(value)
42
+ };
@@ -1,6 +1,25 @@
1
1
  import type { ConfigSource } from '@rainlanguage/orderbook';
2
2
  import { type Config } from '@wagmi/core';
3
- import type { Page } from '@sveltejs/kit';
3
+ declare const initialPageState: {
4
+ data: {
5
+ stores: {
6
+ settings: {};
7
+ };
8
+ dotrain: string;
9
+ deployment: {
10
+ key: string;
11
+ };
12
+ strategyDetail: {};
13
+ };
14
+ url: URL;
15
+ params: {};
16
+ form: {};
17
+ status: number;
18
+ error: null;
19
+ route: {
20
+ id: null;
21
+ };
22
+ };
4
23
  export declare const mockSettingsStore: {
5
24
  subscribe: (this: void, run: import("svelte/store").Subscriber<ConfigSource | undefined>, invalidate?: import("svelte/store").Invalidator<ConfigSource | undefined> | undefined) => import("svelte/store").Unsubscriber;
6
25
  set: (this: void, value: ConfigSource | undefined) => void;
@@ -77,7 +96,66 @@ export declare const mockShowMyItemsOnlyStore: {
77
96
  mockSetSubscribeValue: (value: boolean) => void;
78
97
  };
79
98
  export declare const mockPageStore: {
80
- subscribe: (this: void, run: import("svelte/store").Subscriber<Page<Record<string, string>, string | null>>, invalidate?: import("svelte/store").Invalidator<Page<Record<string, string>, string | null>> | undefined) => import("svelte/store").Unsubscriber;
81
- set: (this: void, value: Page<Record<string, string>, string | null>) => void;
82
- mockSetSubscribeValue: (value: Page) => void;
83
- };
99
+ subscribe: (this: void, run: import("svelte/store").Subscriber<{
100
+ data: {
101
+ stores: {
102
+ settings: {};
103
+ };
104
+ dotrain: string;
105
+ deployment: {
106
+ key: string;
107
+ };
108
+ strategyDetail: {};
109
+ };
110
+ url: URL;
111
+ params: {};
112
+ form: {};
113
+ status: number;
114
+ error: null;
115
+ route: {
116
+ id: null;
117
+ };
118
+ }>, invalidate?: import("svelte/store").Invalidator<{
119
+ data: {
120
+ stores: {
121
+ settings: {};
122
+ };
123
+ dotrain: string;
124
+ deployment: {
125
+ key: string;
126
+ };
127
+ strategyDetail: {};
128
+ };
129
+ url: URL;
130
+ params: {};
131
+ form: {};
132
+ status: number;
133
+ error: null;
134
+ route: {
135
+ id: null;
136
+ };
137
+ }> | undefined) => import("svelte/store").Unsubscriber;
138
+ set: (this: void, value: {
139
+ data: {
140
+ stores: {
141
+ settings: {};
142
+ };
143
+ dotrain: string;
144
+ deployment: {
145
+ key: string;
146
+ };
147
+ strategyDetail: {};
148
+ };
149
+ url: URL;
150
+ params: {};
151
+ form: {};
152
+ status: number;
153
+ error: null;
154
+ route: {
155
+ id: null;
156
+ };
157
+ }) => void;
158
+ mockSetSubscribeValue: (newValue: Partial<typeof initialPageState>) => void;
159
+ reset: () => void;
160
+ };
161
+ export {};
@@ -2,6 +2,23 @@ import { writable } from 'svelte/store';
2
2
  import settingsFixture from '../__fixtures__/settings-12-11-24.json';
3
3
  import {} from '@wagmi/core';
4
4
  import { mockWeb3Config } from './mockWeb3Config';
5
+ const initialPageState = {
6
+ data: {
7
+ stores: { settings: {} },
8
+ dotrain: 'some dotrain content',
9
+ deployment: { key: 'deploy-key' },
10
+ strategyDetail: {}
11
+ },
12
+ url: new URL('http://localhost:3000/deploy'),
13
+ params: {},
14
+ form: {},
15
+ status: 200,
16
+ error: null,
17
+ route: {
18
+ id: null
19
+ }
20
+ };
21
+ const mockPageWritable = writable(initialPageState);
5
22
  const mockSettingsWritable = writable(settingsFixture);
6
23
  const mockActiveSubgraphsWritable = writable({});
7
24
  const mockAccountsWritable = writable({});
@@ -17,7 +34,6 @@ const mockChainIdWritable = writable(0);
17
34
  const mockConnectedWritable = writable(true);
18
35
  const mockWagmiConfigWritable = writable(mockWeb3Config);
19
36
  const mockShowMyItemsOnlyWritable = writable(false);
20
- const mockPageWritable = writable();
21
37
  export const mockSettingsStore = {
22
38
  subscribe: mockSettingsWritable.subscribe,
23
39
  set: mockSettingsWritable.set,
@@ -96,5 +112,11 @@ export const mockShowMyItemsOnlyStore = {
96
112
  export const mockPageStore = {
97
113
  subscribe: mockPageWritable.subscribe,
98
114
  set: mockPageWritable.set,
99
- mockSetSubscribeValue: (value) => mockPageWritable.set(value)
115
+ mockSetSubscribeValue: (newValue) => {
116
+ mockPageWritable.update((currentValue) => ({
117
+ ...currentValue,
118
+ ...newValue
119
+ }));
120
+ },
121
+ reset: () => mockPageWritable.set(initialPageState)
100
122
  };
@@ -5,7 +5,7 @@ export let pathname;
5
5
  $: breadcrumbs = generateBreadcrumbs(pathname);
6
6
  </script>
7
7
 
8
- <div class="mb-4 flex w-full items-center justify-between">
8
+ <div class="mb-4 flex w-full items-center justify-between" data-testid="page-header">
9
9
  <Breadcrumb
10
10
  olClass="inline-flex items-center rtl:space-x-reverse"
11
11
  aria-label="Default breadcrumb example"
package/dist/index.d.ts CHANGED
@@ -81,13 +81,14 @@ export { DEFAULT_PAGE_SIZE, DEFAULT_REFRESH_INTERVAL } from './queries/constants
81
81
  export { QKEY_VAULTS, QKEY_VAULT, QKEY_VAULT_CHANGES, QKEY_ORDERS, QKEY_ORDER, QKEY_ORDER_TRADES_LIST, QKEY_ORDER_QUOTE, QKEY_VAULTS_VOL_LIST, QKEY_ORDER_APY } from './queries/keys';
82
82
  export { darkChartTheme, lightChartTheme } from './utils/lightweightChartsThemes';
83
83
  export { lightCodeMirrorTheme, darkCodeMirrorTheme } from './utils/codeMirrorThemes';
84
- export { mockConfigSource } from './__mocks__/settings';
85
- export { mockSettingsStore } from './__mocks__/settings';
86
84
  export { default as transactionStore } from './stores/transactionStore';
87
- export { mockTransactionStore } from './__mocks__/mockTransactionStore';
88
85
  export { default as logoLight } from './assets/logo-light.svg';
89
86
  export { default as logoDark } from './assets/logo-dark.svg';
90
87
  export { default as GuiProvider } from './providers/GuiProvider.svelte';
91
88
  export { default as WalletProvider } from './providers/wallet/WalletProvider.svelte';
92
89
  export { useGui } from './hooks/useGui';
93
90
  export { useAccount } from './providers/wallet/useAccount';
91
+ export { mockPageStore } from './__mocks__/stores';
92
+ export { mockConfigSource } from './__mocks__/settings';
93
+ export { mockSettingsStore } from './__mocks__/settings';
94
+ export { mockTransactionStore } from './__mocks__/mockTransactionStore';
package/dist/index.js CHANGED
@@ -80,10 +80,7 @@ export { QKEY_VAULTS, QKEY_VAULT, QKEY_VAULT_CHANGES, QKEY_ORDERS, QKEY_ORDER, Q
80
80
  export { darkChartTheme, lightChartTheme } from './utils/lightweightChartsThemes';
81
81
  export { lightCodeMirrorTheme, darkCodeMirrorTheme } from './utils/codeMirrorThemes';
82
82
  // Stores
83
- export { mockConfigSource } from './__mocks__/settings';
84
- export { mockSettingsStore } from './__mocks__/settings';
85
83
  export { default as transactionStore } from './stores/transactionStore';
86
- export { mockTransactionStore } from './__mocks__/mockTransactionStore';
87
84
  // Assets
88
85
  export { default as logoLight } from './assets/logo-light.svg';
89
86
  export { default as logoDark } from './assets/logo-dark.svg';
@@ -93,3 +90,8 @@ export { default as WalletProvider } from './providers/wallet/WalletProvider.sve
93
90
  // Hooks
94
91
  export { useGui } from './hooks/useGui';
95
92
  export { useAccount } from './providers/wallet/useAccount';
93
+ // Mocks
94
+ export { mockPageStore } from './__mocks__/stores';
95
+ export { mockConfigSource } from './__mocks__/settings';
96
+ export { mockSettingsStore } from './__mocks__/settings';
97
+ export { mockTransactionStore } from './__mocks__/mockTransactionStore';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainlanguage/ui-components",
3
- "version": "0.0.1-alpha.65",
3
+ "version": "0.0.1-alpha.67",
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.65",
56
+ "@rainlanguage/orderbook": "0.0.1-alpha.67",
57
57
  "@reown/appkit": "1.6.4",
58
58
  "@reown/appkit-adapter-wagmi": "1.6.4",
59
59
  "@sentry/sveltekit": "7.120.0",