@tramvai/storybook-addon 0.1.22 → 2.10.2
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 +8 -8
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -193,9 +193,9 @@ export const PageStory = () => <Page />;
|
|
|
193
193
|
<TabItem value="page" label="page.tsx" default>
|
|
194
194
|
|
|
195
195
|
```tsx
|
|
196
|
-
import {
|
|
196
|
+
import { declareAction } from '@tramvai/core';
|
|
197
197
|
|
|
198
|
-
const serverAction =
|
|
198
|
+
const serverAction = declareAction({
|
|
199
199
|
name: 'server-action',
|
|
200
200
|
fn() {
|
|
201
201
|
console.log('server action');
|
|
@@ -205,7 +205,7 @@ const serverAction = createAction({
|
|
|
205
205
|
},
|
|
206
206
|
});
|
|
207
207
|
|
|
208
|
-
const browserAction =
|
|
208
|
+
const browserAction = declareAction({
|
|
209
209
|
name: 'browser-action',
|
|
210
210
|
fn() {
|
|
211
211
|
console.log('browser action');
|
|
@@ -231,7 +231,7 @@ Page.actions = [serverAction, browserAction];
|
|
|
231
231
|
import type { TramvaiStoriesParameters } from '@tramvai/storybook-addon';
|
|
232
232
|
import { Page } from './page';
|
|
233
233
|
|
|
234
|
-
// Actions with `onlyBrowser` condition will be executed
|
|
234
|
+
// Actions with `onlyBrowser` condition will be executed
|
|
235
235
|
const parameters: TramvaiStoriesParameters = {
|
|
236
236
|
tramvai: {
|
|
237
237
|
actions: Page.actions,
|
|
@@ -256,12 +256,12 @@ export const PageStory = () => <Page />;
|
|
|
256
256
|
<TabItem value="page" label="page.tsx" default>
|
|
257
257
|
|
|
258
258
|
```tsx
|
|
259
|
-
import {
|
|
259
|
+
import { declareAction } from '@tramvai/core';
|
|
260
260
|
|
|
261
|
-
const httpRequestAction =
|
|
261
|
+
const httpRequestAction = declareAction({
|
|
262
262
|
name: 'http-request-action',
|
|
263
|
-
|
|
264
|
-
return httpClient.get('/');
|
|
263
|
+
async fn() {
|
|
264
|
+
return this.deps.httpClient.get('/');
|
|
265
265
|
},
|
|
266
266
|
deps: {
|
|
267
267
|
httpClient: HTTP_CLIENT,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/storybook-addon",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/preset.js",
|
|
6
6
|
"typings": "lib/preset.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"registry": "https://registry.npmjs.org/"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tramvai/test-mocks": "2.
|
|
23
|
+
"@tramvai/test-mocks": "2.10.2",
|
|
24
24
|
"webpack-chain": "^6.5.1",
|
|
25
25
|
"webpack-merge": "^5.8.0",
|
|
26
26
|
"react-query": "^3.35.0"
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"webpack": "5.64.4"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@tramvai/cli": "2.
|
|
35
|
-
"@tramvai/core": "2.
|
|
36
|
-
"@tramvai/state": "2.
|
|
37
|
-
"@tramvai/react": "2.
|
|
38
|
-
"@tramvai/tokens-common": "2.
|
|
39
|
-
"@tinkoff/dippy": "0.7.
|
|
34
|
+
"@tramvai/cli": "2.10.2",
|
|
35
|
+
"@tramvai/core": "2.10.2",
|
|
36
|
+
"@tramvai/state": "2.10.2",
|
|
37
|
+
"@tramvai/react": "2.10.2",
|
|
38
|
+
"@tramvai/tokens-common": "2.10.2",
|
|
39
|
+
"@tinkoff/dippy": "0.7.45",
|
|
40
40
|
"@tinkoff/router": "0.2.0",
|
|
41
41
|
"@tinkoff/url": "0.7.39",
|
|
42
42
|
"react": ">=16.14.0"
|