@tramvai/storybook-addon 0.1.24 → 2.20.0

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.
Files changed (2) hide show
  1. package/README.md +8 -8
  2. package/package.json +11 -11
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 { createAction } from '@tramvai/core';
196
+ import { declareAction } from '@tramvai/core';
197
197
 
198
- const serverAction = createAction({
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 = createAction({
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 { createAction } from '@tramvai/core';
259
+ import { declareAction } from '@tramvai/core';
260
260
 
261
- const httpRequestAction = createAction({
261
+ const httpRequestAction = declareAction({
262
262
  name: 'http-request-action',
263
- fn: async (_, __, { httpClient }) => {
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": "0.1.24",
3
+ "version": "2.20.0",
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.7.1",
23
+ "@tramvai/test-mocks": "2.20.0",
24
24
  "webpack-chain": "^6.5.1",
25
25
  "webpack-merge": "^5.8.0",
26
26
  "react-query": "^3.35.0"
@@ -28,17 +28,17 @@
28
28
  "devDependencies": {
29
29
  "@types/webpack": ">=5.28",
30
30
  "@babel/core": "^7.16.0",
31
- "webpack": "5.64.4"
31
+ "webpack": "5.74.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@tramvai/cli": "2.7.1",
35
- "@tramvai/core": "2.7.1",
36
- "@tramvai/state": "2.7.1",
37
- "@tramvai/react": "2.7.1",
38
- "@tramvai/tokens-common": "2.7.1",
39
- "@tinkoff/dippy": "0.7.44",
40
- "@tinkoff/router": "0.2.0",
41
- "@tinkoff/url": "0.7.39",
34
+ "@tramvai/cli": "2.20.0",
35
+ "@tramvai/core": "2.20.0",
36
+ "@tramvai/state": "2.20.0",
37
+ "@tramvai/react": "2.20.0",
38
+ "@tramvai/tokens-common": "2.20.0",
39
+ "@tinkoff/dippy": "0.8.2",
40
+ "@tinkoff/router": "0.2.2",
41
+ "@tinkoff/url": "0.8.2",
42
42
  "react": ">=16.14.0"
43
43
  }
44
44
  }