@storybook/addon-interactions 8.1.0-alpha.2 → 8.1.0-alpha.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
1
+ import { StepLabel, PlayFunction, PlayFunctionContext, ArgsEnhancer, Renderer } from '@storybook/types';
2
+
3
+ declare const runStep: (label: StepLabel, play: PlayFunction, context: PlayFunctionContext<any>) => void | Promise<void>;
4
+ declare const traverseArgs: (value: unknown, depth?: number, key?: string) => unknown;
5
+ declare const argsEnhancers: ArgsEnhancer<Renderer>[];
6
+ declare const parameters: {
7
+ throwPlayFunctionExceptions: boolean;
8
+ };
9
+
10
+ export { argsEnhancers, parameters, runStep, traverseArgs };
package/dist/preview.js CHANGED
@@ -1,6 +1,11 @@
1
- import { isMockFunction, fn } from '@storybook/test';
2
- import { instrument } from '@storybook/instrumenter';
1
+ 'use strict';
3
2
 
4
- var {step:runStep}=instrument({step:(label,play,context)=>play(context)},{intercept:!0}),traverseArgs=(value,depth=0,key)=>{if(depth>5||value==null)return value;if(isMockFunction(value))return key&&value.mockName(key),value;if(typeof value=="function"&&"isAction"in value&&value.isAction&&!("implicit"in value&&value.implicit)){let mock=fn(value);return key&&mock.mockName(key),mock}if(Array.isArray(value))return depth++,value.map(item=>traverseArgs(item,depth));if(typeof value=="object"&&value.constructor===Object){depth++;for(let[k,v]of Object.entries(value))Object.getOwnPropertyDescriptor(value,k).writable&&(value[k]=traverseArgs(v,depth,k));return value}return value},wrapActionsInSpyFns=({initialArgs})=>traverseArgs(initialArgs),argsEnhancers=[wrapActionsInSpyFns],parameters={throwPlayFunctionExceptions:!1};
3
+ var test = require('@storybook/test');
4
+ var instrumenter = require('@storybook/instrumenter');
5
5
 
6
- export { argsEnhancers, parameters, runStep, traverseArgs };
6
+ var {step:runStep}=instrumenter.instrument({step:(label,play,context)=>play(context)},{intercept:!0}),traverseArgs=(value,depth=0,key)=>{if(depth>5||value==null)return value;if(test.isMockFunction(value))return key&&value.mockName(key),value;if(typeof value=="function"&&"isAction"in value&&value.isAction&&!("implicit"in value&&value.implicit)){let mock=test.fn(value);return key&&mock.mockName(key),mock}if(Array.isArray(value))return depth++,value.map(item=>traverseArgs(item,depth));if(typeof value=="object"&&value.constructor===Object){depth++;for(let[k,v]of Object.entries(value))Object.getOwnPropertyDescriptor(value,k).writable&&(value[k]=traverseArgs(v,depth,k));return value}return value},wrapActionsInSpyFns=({initialArgs})=>traverseArgs(initialArgs),argsEnhancers=[wrapActionsInSpyFns],parameters={throwPlayFunctionExceptions:!1};
7
+
8
+ exports.argsEnhancers = argsEnhancers;
9
+ exports.parameters = parameters;
10
+ exports.runStep = runStep;
11
+ exports.traverseArgs = traverseArgs;
@@ -0,0 +1,6 @@
1
+ import { isMockFunction, fn } from '@storybook/test';
2
+ import { instrument } from '@storybook/instrumenter';
3
+
4
+ var {step:runStep}=instrument({step:(label,play,context)=>play(context)},{intercept:!0}),traverseArgs=(value,depth=0,key)=>{if(depth>5||value==null)return value;if(isMockFunction(value))return key&&value.mockName(key),value;if(typeof value=="function"&&"isAction"in value&&value.isAction&&!("implicit"in value&&value.implicit)){let mock=fn(value);return key&&mock.mockName(key),mock}if(Array.isArray(value))return depth++,value.map(item=>traverseArgs(item,depth));if(typeof value=="object"&&value.constructor===Object){depth++;for(let[k,v]of Object.entries(value))Object.getOwnPropertyDescriptor(value,k).writable&&(value[k]=traverseArgs(v,depth,k));return value}return value},wrapActionsInSpyFns=({initialArgs})=>traverseArgs(initialArgs),argsEnhancers=[wrapActionsInSpyFns],parameters={throwPlayFunctionExceptions:!1};
5
+
6
+ export { argsEnhancers, parameters, runStep, traverseArgs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-interactions",
3
- "version": "8.1.0-alpha.2",
3
+ "version": "8.1.0-alpha.4",
4
4
  "description": "Automate, test and debug user interactions",
5
5
  "keywords": [
6
6
  "storybook-addons",
@@ -28,8 +28,12 @@
28
28
  "require": "./dist/index.js",
29
29
  "import": "./dist/index.mjs"
30
30
  },
31
+ "./preview": {
32
+ "types": "./dist/preview.d.ts",
33
+ "require": "./dist/preview.js",
34
+ "import": "./dist/preview.mjs"
35
+ },
31
36
  "./manager": "./dist/manager.js",
32
- "./preview": "./dist/preview.js",
33
37
  "./preset": "./dist/preset.js",
34
38
  "./register.js": "./dist/manager.js",
35
39
  "./package.json": "./package.json"
@@ -50,22 +54,22 @@
50
54
  },
51
55
  "dependencies": {
52
56
  "@storybook/global": "^5.0.0",
53
- "@storybook/instrumenter": "8.1.0-alpha.2",
54
- "@storybook/test": "8.1.0-alpha.2",
55
- "@storybook/types": "8.1.0-alpha.2",
57
+ "@storybook/instrumenter": "8.1.0-alpha.4",
58
+ "@storybook/test": "8.1.0-alpha.4",
59
+ "@storybook/types": "8.1.0-alpha.4",
56
60
  "polished": "^4.2.2",
57
61
  "ts-dedent": "^2.2.0"
58
62
  },
59
63
  "devDependencies": {
60
64
  "@devtools-ds/object-inspector": "^1.1.2",
61
- "@storybook/client-logger": "8.1.0-alpha.2",
62
- "@storybook/components": "8.1.0-alpha.2",
63
- "@storybook/core-common": "8.1.0-alpha.2",
64
- "@storybook/core-events": "8.1.0-alpha.2",
65
+ "@storybook/client-logger": "8.1.0-alpha.4",
66
+ "@storybook/components": "8.1.0-alpha.4",
67
+ "@storybook/core-common": "8.1.0-alpha.4",
68
+ "@storybook/core-events": "8.1.0-alpha.4",
65
69
  "@storybook/icons": "^1.2.5",
66
- "@storybook/manager-api": "8.1.0-alpha.2",
67
- "@storybook/preview-api": "8.1.0-alpha.2",
68
- "@storybook/theming": "8.1.0-alpha.2",
70
+ "@storybook/manager-api": "8.1.0-alpha.4",
71
+ "@storybook/preview-api": "8.1.0-alpha.4",
72
+ "@storybook/theming": "8.1.0-alpha.4",
69
73
  "@types/node": "^18.0.0",
70
74
  "formik": "^2.2.9",
71
75
  "react": "^18.2.0",