storybook-addon-vis 2.0.7 → 2.1.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.
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ var clientApi = require('vitest-plugin-vis/client-api');
4
+ var test = require('storybook/test');
5
+
6
+ // src/client/page/to_match_image_snapshot.ts
7
+ function toMatchImageSnapshot(options) {
8
+ const test = getCurrentTest();
9
+ if (!test) return Promise.resolve();
10
+ return clientApi.matchPageImageSnapshotAction(commands, clientApi.toTaskId(test), options);
11
+ }
12
+
13
+ // src/client/vitest_proxy.ts
14
+ var browserContext;
15
+ var vitestSuite;
16
+ if (globalThis.__vitest_browser__) {
17
+ import('@vitest/browser/context').then((m) => {
18
+ m.page.extend({ toMatchImageSnapshot });
19
+ browserContext = m;
20
+ });
21
+ import('vitest/suite').then((m) => {
22
+ vitestSuite = m;
23
+ });
24
+ }
25
+ var page = new Proxy({}, {
26
+ get(_target, prop) {
27
+ const r = browserContext?.page?.[prop];
28
+ if (prop === "toMatchImageSnapshot" && r === void 0) {
29
+ return () => {
30
+ };
31
+ }
32
+ return r;
33
+ }
34
+ });
35
+ var commands = new Proxy({}, {
36
+ get(_target, prop) {
37
+ return browserContext?.commands?.[prop];
38
+ }
39
+ });
40
+ var getCurrentTest = () => vitestSuite?.getCurrentTest();
41
+ function toMatchImageSnapshot2(subject, options) {
42
+ const test = getCurrentTest();
43
+ if (!test) return Promise.resolve(clientApi.success);
44
+ return clientApi.matchImageSnapshotAction(commands, clientApi.toTaskId(test), subject, options).then(() => clientApi.success);
45
+ }
46
+
47
+ // src/client/storybook/expect_extend.ts
48
+ test.expect.extend({ toMatchImageSnapshot: toMatchImageSnapshot2 });
49
+
50
+ // src/client/storybook/tags.ts
51
+ function isSnapshotEnabled(tags) {
52
+ return tags.lastIndexOf("!snapshot") < tags.lastIndexOf("snapshot");
53
+ }
54
+
55
+ exports.commands = commands;
56
+ exports.getCurrentTest = getCurrentTest;
57
+ exports.isSnapshotEnabled = isSnapshotEnabled;
58
+ exports.page = page;
59
+ //# sourceMappingURL=chunk-HQDMSJMI.cjs.map
60
+ //# sourceMappingURL=chunk-HQDMSJMI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client/page/to_match_image_snapshot.ts","../src/client/vitest_proxy.ts","../src/client/expect/to_match_image_snapshot.ts","../src/client/storybook/expect_extend.ts","../src/client/storybook/tags.ts"],"names":["matchPageImageSnapshotAction","toTaskId","toMatchImageSnapshot","success","matchImageSnapshotAction","expect"],"mappings":";;;;;;AAQO,SAAS,qBACf,OACC,EAAA;AACD,EAAA,MAAM,OAAO,cAAe,EAAA;AAG5B,EAAA,IAAI,CAAC,IAAA,EAAa,OAAA,OAAA,CAAQ,OAAQ,EAAA;AAGlC,EAAA,OAAOA,sCAA6B,CAAA,QAAA,EAAUC,kBAAS,CAAA,IAAI,GAAG,OAAO,CAAA;AACtE;;;ACdA,IAAI,cAAA;AACJ,IAAI,WAAA;AAEJ,IAAK,WAAmB,kBAAoB,EAAA;AAC3C,EAAA,OAAO,yBAAyB,CAAA,CAAE,IAAK,CAAA,CAAC,CAAM,KAAA;AAC7C,IAAA,CAAA,CAAE,IAAK,CAAA,MAAA,CAAO,EAAE,oBAAA,EAAsB,CAAA;AACtC,IAAiB,cAAA,GAAA,CAAA;AAAA,GACjB,CAAA;AACD,EAAA,OAAO,cAAc,CAAA,CAAE,IAAK,CAAA,CAAC,CAAM,KAAA;AAClC,IAAc,WAAA,GAAA,CAAA;AAAA,GACd,CAAA;AACF;AAEO,IAAM,IAAO,GAAA,IAAI,KAAmB,CAAA,EAAW,EAAA;AAAA,EACrD,GAAA,CAAI,SAAS,IAAM,EAAA;AAClB,IAAM,MAAA,CAAA,GAAK,cAAgB,EAAA,IAAA,GAAe,IAAI,CAAA;AAC9C,IAAI,IAAA,IAAA,KAAS,sBAA0B,IAAA,CAAA,KAAM,MAAW,EAAA;AACvD,MAAA,OAAO,MAAM;AAAA,OAAC;AAAA;AAEf,IAAO,OAAA,CAAA;AAAA;AAET,CAAC;AAEM,IAAM,QAAW,GAAA,IAAI,KAAuB,CAAA,EAAW,EAAA;AAAA,EAC7D,GAAA,CAAI,SAAS,IAAM,EAAA;AAClB,IAAQ,OAAA,cAAA,EAAgB,WAAmB,IAAI,CAAA;AAAA;AAEjD,CAAC;AAEY,IAAA,cAAA,GAAiB,MAC7B,WAAA,EAAa,cAAe;ACxBtB,SAASC,qBAAAA,CAKf,SACA,OACyB,EAAA;AACzB,EAAA,MAAM,OAAO,cAAe,EAAA;AAG5B,EAAA,IAAI,CAAC,IAAA,EAAa,OAAA,OAAA,CAAQ,QAAQC,iBAAO,CAAA;AAGzC,EAAO,OAAAC,kCAAA,CAAyB,QAAUH,EAAAA,kBAAAA,CAAS,IAAI,CAAA,EAAG,SAAS,OAAO,CAAA,CAAE,IAAK,CAAA,MAAME,iBAAO,CAAA;AAC/F;;;ACtBAE,WAAA,CAAO,MAAO,CAAA,EAAE,oBAAAH,EAAAA,qBAAAA,EAAsB,CAAA;;;ACH/B,SAAS,kBAAkB,IAAgB,EAAA;AACjD,EAAA,OAAO,KAAK,WAAY,CAAA,WAAW,CAAI,GAAA,IAAA,CAAK,YAAY,UAAU,CAAA;AACnE","file":"chunk-HQDMSJMI.cjs","sourcesContent":["import {\n\ttype ComparisonMethod,\n\ttype ToMatchPageImageSnapshotOptions,\n\tmatchPageImageSnapshotAction,\n\ttoTaskId,\n} from 'vitest-plugin-vis/client-api'\nimport { commands, getCurrentTest } from '../vitest_proxy.ts'\n\nexport function toMatchImageSnapshot<M extends ComparisonMethod = 'pixel'>(\n\toptions?: ToMatchPageImageSnapshotOptions<M> | undefined,\n) {\n\tconst test = getCurrentTest()\n\n\t/* v8 ignore start: stub as success when not in a test (e.g. in a story) */\n\tif (!test) return Promise.resolve()\n\t/* v8 ignore end */\n\n\treturn matchPageImageSnapshotAction(commands, toTaskId(test), options)\n}\n","import type { BrowserCommands, BrowserPage } from '@vitest/browser/context'\nimport type { SnapshotTestMeta } from 'vitest-plugin-vis/client-api'\nimport { toMatchImageSnapshot } from './page/to_match_image_snapshot.ts'\n\nlet browserContext: Awaited<typeof import('@vitest/browser/context')>\nlet vitestSuite: Awaited<typeof import('vitest/suite')>\n\nif ((globalThis as any).__vitest_browser__) {\n\timport('@vitest/browser/context').then((m) => {\n\t\tm.page.extend({ toMatchImageSnapshot })\n\t\tbrowserContext = m\n\t})\n\timport('vitest/suite').then((m) => {\n\t\tvitestSuite = m\n\t})\n}\n\nexport const page = new Proxy<BrowserPage>({} as any, {\n\tget(_target, prop) {\n\t\tconst r = (browserContext?.page as any)?.[prop]\n\t\tif (prop === 'toMatchImageSnapshot' && r === undefined) {\n\t\t\treturn () => {}\n\t\t}\n\t\treturn r\n\t},\n})\n\nexport const commands = new Proxy<BrowserCommands>({} as any, {\n\tget(_target, prop) {\n\t\treturn (browserContext?.commands as any)?.[prop]\n\t},\n})\n\nexport const getCurrentTest = () =>\n\tvitestSuite?.getCurrentTest() as (ReturnType<typeof vitestSuite.getCurrentTest> & SnapshotTestMeta) | undefined\n","import type { AsyncExpectationResult } from '@vitest/expect'\nimport {\n\ttype ComparisonMethod,\n\ttype ToMatchImageSnapshotOptions,\n\tmatchImageSnapshotAction,\n\tsuccess,\n\ttoTaskId,\n} from 'vitest-plugin-vis/client-api'\nimport { commands, getCurrentTest } from '../vitest_proxy.ts'\n\nexport function toMatchImageSnapshot<M extends ComparisonMethod>(\n\t/**\n\t * The element or locator to take the snapshot of,\n\t * or the base64 value of the image to compare against.\n\t */\n\tsubject: any,\n\toptions?: ToMatchImageSnapshotOptions<M> | undefined,\n): AsyncExpectationResult {\n\tconst test = getCurrentTest()\n\n\t/* v8 ignore start: stub as success when not in a test (e.g. in a story) */\n\tif (!test) return Promise.resolve(success)\n\t/* v8 ignore end */\n\n\treturn matchImageSnapshotAction(commands, toTaskId(test), subject, options).then(() => success)\n}\n","import { expect } from 'storybook/test'\nimport { toMatchImageSnapshot } from '../expect/to_match_image_snapshot.ts'\n\nexpect.extend({ toMatchImageSnapshot })\n","export function isSnapshotEnabled(tags: string[]) {\n\treturn tags.lastIndexOf('!snapshot') < tags.lastIndexOf('snapshot')\n}\n"]}
package/dist/index.cjs ADDED
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ var chunkHQDMSJMI_cjs = require('./chunk-HQDMSJMI.cjs');
4
+ var vitestPluginVis = require('vitest-plugin-vis');
5
+ var clientApi = require('vitest-plugin-vis/client-api');
6
+
7
+ // src/client/ctx.ts
8
+ var ctx = {
9
+ getCurrentTest: chunkHQDMSJMI_cjs.getCurrentTest,
10
+ __test__reset() {
11
+ ctx.getCurrentTest = chunkHQDMSJMI_cjs.getCurrentTest;
12
+ }
13
+ };
14
+
15
+ // src/client/has_image_snapshot.ts
16
+ function hasImageSnapshot(options) {
17
+ const test = ctx.getCurrentTest();
18
+ if (!test) return false;
19
+ return clientApi.hasImageSnapshotAction(chunkHQDMSJMI_cjs.commands, clientApi.toTaskId(test), options);
20
+ }
21
+
22
+ // src/client/storybook/param.ts
23
+ function defineAutoSnapshotParam(snapshot) {
24
+ return { snapshot };
25
+ }
26
+
27
+ // src/server/vis_options.ts
28
+ function defineStorybookVisOptions(options) {
29
+ return options;
30
+ }
31
+
32
+ Object.defineProperty(exports, "isSnapshotEnabled", {
33
+ enumerable: true,
34
+ get: function () { return chunkHQDMSJMI_cjs.isSnapshotEnabled; }
35
+ });
36
+ Object.defineProperty(exports, "page", {
37
+ enumerable: true,
38
+ get: function () { return chunkHQDMSJMI_cjs.page; }
39
+ });
40
+ exports.defineAutoSnapshotParam = defineAutoSnapshotParam;
41
+ exports.defineStorybookVisOptions = defineStorybookVisOptions;
42
+ exports.hasImageSnapshot = hasImageSnapshot;
43
+ Object.keys(vitestPluginVis).forEach(function (k) {
44
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
45
+ enumerable: true,
46
+ get: function () { return vitestPluginVis[k]; }
47
+ });
48
+ });
49
+ //# sourceMappingURL=index.cjs.map
50
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client/ctx.ts","../src/client/has_image_snapshot.ts","../src/client/storybook/param.ts","../src/server/vis_options.ts"],"names":["getCurrentTest","hasImageSnapshotAction","commands","toTaskId"],"mappings":";;;;;;;AAEO,IAAM,GAAM,GAAA;AAAA,kBAClBA,gCAAA;AAAA,EACA,aAAgB,GAAA;AACf,IAAA,GAAA,CAAI,cAAiB,GAAAA,gCAAA;AAAA;AAEvB,CAAA;;;ACAO,SAAS,iBAAiB,OAA+C,EAAA;AAC/E,EAAM,MAAA,IAAA,GAAO,IAAI,cAAe,EAAA;AAChC,EAAI,IAAA,CAAC,MAAa,OAAA,KAAA;AAElB,EAAA,OAAOC,gCAAuB,CAAAC,0BAAA,EAAUC,kBAAS,CAAA,IAAI,GAAG,OAAO,CAAA;AAChE;;;ACgBO,SAAS,wBACf,QACC,EAAA;AACD,EAAA,OAAO,EAAE,QAAS,EAAA;AACnB;;;ACTO,SAAS,0BAA0B,OAA8B,EAAA;AACvE,EAAO,OAAA,OAAA;AACR","file":"index.cjs","sourcesContent":["import { getCurrentTest } from './vitest_proxy.ts'\n\nexport const ctx = {\n\tgetCurrentTest,\n\t__test__reset() {\n\t\tctx.getCurrentTest = getCurrentTest\n\t},\n}\n","import { hasImageSnapshotAction, toTaskId, type ImageSnapshotKeyOptions } from 'vitest-plugin-vis/client-api'\nimport { ctx } from './ctx.ts'\nimport { commands } from './vitest_proxy.ts'\n\n/**\n * Check if the snapshot image exists.\n */\nexport function hasImageSnapshot(options?: ImageSnapshotKeyOptions | undefined) {\n\tconst test = ctx.getCurrentTest()\n\tif (!test) return false\n\n\treturn hasImageSnapshotAction(commands, toTaskId(test), options)\n}\n","import type {\n\tComparisonMethod,\n\tFailureThresholdOptions,\n\tImageSnapshotCompareOptions,\n\tImageSnapshotKeyOptions,\n\tImageSnapshotSubjectOptions,\n\tImageSnapshotTimeoutOptions,\n\tPixelComparisonOptions,\n\tSsimComparisonOptions,\n\tToMatchImageSnapshotOptions,\n} from 'vitest-plugin-vis/client-api'\n\n// This fix the inferred type cannot be named error\nexport type {\n\tComparisonMethod,\n\tFailureThresholdOptions,\n\tImageSnapshotCompareOptions,\n\tImageSnapshotKeyOptions,\n\tImageSnapshotSubjectOptions,\n\tImageSnapshotTimeoutOptions,\n\tPixelComparisonOptions,\n\tSsimComparisonOptions,\n\tToMatchImageSnapshotOptions,\n}\n\n/**\n * Define snapshot parameter for auto snapshot.\n */\nexport function defineAutoSnapshotParam<M extends ComparisonMethod>(\n\tsnapshot: ToMatchImageSnapshotOptions<M> & ImageSnapshotSubjectOptions,\n) {\n\treturn { snapshot }\n}\n","/**\n * Configuration options for visual testing suites in Storybook.\n *\n * @param options.visProjects Array of visual testing project configurations\n * @param options.visProjects[].snapshotRootDir Root directory for storing snapshots. Can be a string path or a function that returns a path based on CI and platform context\n * @param options.visProjects[].snapshotSubpath Optional function to customize the snapshot subdirectory path\n */\nexport type StorybookVisOptions = {\n\tvisProjects: Array<{\n\t\tsnapshotRootDir:\n\t\t\t| string\n\t\t\t| ((context: {\n\t\t\t\t\tci: boolean\n\t\t\t\t\tplatform: string\n\t\t\t }) => string)\n\t\t\t| undefined\n\t\tsnapshotSubpath?: ((options: { subpath: string }) => string) | undefined\n\t}>\n}\n\n/**\n * Define options for Storybook Visual Testing addon.\n */\nexport function defineStorybookVisOptions(options: StorybookVisOptions) {\n\treturn options\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import './matcher.cjs';
2
+ import { BrowserPage } from '@vitest/browser/context';
3
+ export * from 'vitest-plugin-vis';
4
+ import { ImageSnapshotKeyOptions, ComparisonMethod, ToMatchImageSnapshotOptions, ImageSnapshotSubjectOptions, ImageSnapshotTimeoutOptions, SsimComparisonOptions, PixelComparisonOptions, FailureThresholdOptions } from 'vitest-plugin-vis/client-api';
5
+ export { ComparisonMethod, FailureThresholdOptions, ImageSnapshotCompareOptions, ImageSnapshotKeyOptions, ImageSnapshotSubjectOptions, ImageSnapshotTimeoutOptions, PixelComparisonOptions, SsimComparisonOptions, ToMatchImageSnapshotOptions } from 'vitest-plugin-vis/client-api';
6
+
7
+ declare const page: BrowserPage;
8
+
9
+ /**
10
+ * Check if the snapshot image exists.
11
+ */
12
+ declare function hasImageSnapshot(options?: ImageSnapshotKeyOptions | undefined): false | Promise<boolean>;
13
+
14
+ /**
15
+ * Define snapshot parameter for auto snapshot.
16
+ */
17
+ declare function defineAutoSnapshotParam<M extends ComparisonMethod>(snapshot: ToMatchImageSnapshotOptions<M> & ImageSnapshotSubjectOptions): {
18
+ snapshot: ImageSnapshotTimeoutOptions & ImageSnapshotKeyOptions & (M extends "ssim" ? SsimComparisonOptions<M> : PixelComparisonOptions<M>) & FailureThresholdOptions & {
19
+ expectToFail?: boolean | undefined;
20
+ } & ImageSnapshotSubjectOptions;
21
+ };
22
+
23
+ declare function isSnapshotEnabled(tags: string[]): boolean;
24
+
25
+ /**
26
+ * Configuration options for visual testing suites in Storybook.
27
+ *
28
+ * @param options.visProjects Array of visual testing project configurations
29
+ * @param options.visProjects[].snapshotRootDir Root directory for storing snapshots. Can be a string path or a function that returns a path based on CI and platform context
30
+ * @param options.visProjects[].snapshotSubpath Optional function to customize the snapshot subdirectory path
31
+ */
32
+ type StorybookVisOptions = {
33
+ visProjects: Array<{
34
+ snapshotRootDir: string | ((context: {
35
+ ci: boolean;
36
+ platform: string;
37
+ }) => string) | undefined;
38
+ snapshotSubpath?: ((options: {
39
+ subpath: string;
40
+ }) => string) | undefined;
41
+ }>;
42
+ };
43
+ /**
44
+ * Define options for Storybook Visual Testing addon.
45
+ */
46
+ declare function defineStorybookVisOptions(options: StorybookVisOptions): StorybookVisOptions;
47
+
48
+ export { type StorybookVisOptions, defineAutoSnapshotParam, defineStorybookVisOptions, hasImageSnapshot, isSnapshotEnabled, page };
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=matcher.cjs.map
4
+ //# sourceMappingURL=matcher.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"matcher.cjs"}
@@ -0,0 +1,8 @@
1
+ import { ImageSnapshotMatcher } from 'vitest-plugin-vis/client-api';
2
+
3
+ declare global {
4
+ namespace jest {
5
+ interface Matchers<R, T> extends ImageSnapshotMatcher {
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var chunkHQDMSJMI_cjs = require('./chunk-HQDMSJMI.cjs');
4
+ var setup = require('vitest-plugin-vis/setup');
5
+ var vitestPluginVis = require('vitest-plugin-vis');
6
+
7
+ var visAnnotations = {
8
+ beforeEach(ctx) {
9
+ const test = chunkHQDMSJMI_cjs.getCurrentTest();
10
+ vitestPluginVis.setAutoSnapshotOptions({
11
+ enable: chunkHQDMSJMI_cjs.isSnapshotEnabled(ctx.tags),
12
+ ...ctx.parameters?.snapshot,
13
+ tags: ctx.tags,
14
+ ...test?.meta.vis
15
+ });
16
+ }
17
+ };
18
+
19
+ // src/vitest-setup.ts
20
+ var vis = setup.createVis(chunkHQDMSJMI_cjs.commands);
21
+
22
+ Object.defineProperty(exports, "setAutoSnapshotOptions", {
23
+ enumerable: true,
24
+ get: function () { return vitestPluginVis.setAutoSnapshotOptions; }
25
+ });
26
+ exports.vis = vis;
27
+ exports.visAnnotations = visAnnotations;
28
+ //# sourceMappingURL=vitest-setup.cjs.map
29
+ //# sourceMappingURL=vitest-setup.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/preview/vis_annotation.ts","../src/vitest-setup.ts"],"names":["getCurrentTest","setAutoSnapshotOptions","isSnapshotEnabled","createVis","commands"],"mappings":";;;;;;AAKO,IAAM,cAAiB,GAAA;AAAA,EAC7B,WAAW,GAAmB,EAAA;AAE7B,IAAA,MAAM,OAAOA,gCAAe,EAAA;AAC5B,IAAuBC,sCAAA,CAAA;AAAA,MACtB,MAAA,EAAQC,mCAAkB,CAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MAClC,GAAG,IAAI,UAAY,EAAA,QAAA;AAAA,MACnB,MAAM,GAAI,CAAA,IAAA;AAAA,MACV,GAAG,MAAM,IAAK,CAAA;AAAA,KACd,CAAA;AAAA;AAEH;;;ACRa,IAAA,GAAA,GAAMC,gBAA8BC,0BAAQ","file":"vitest-setup.cjs","sourcesContent":["import type { ProjectAnnotations, Renderer, StoryContext } from 'storybook/internal/types'\nimport { setAutoSnapshotOptions } from 'vitest-plugin-vis'\nimport { isSnapshotEnabled } from '../client/storybook/tags.ts'\nimport { getCurrentTest } from '../client/vitest_proxy.ts'\n\nexport const visAnnotations = {\n\tbeforeEach(ctx: StoryContext) {\n\t\t// console.debug('storbook-addon-vis.preview.beforeEach starts...')\n\t\tconst test = getCurrentTest()\n\t\tsetAutoSnapshotOptions({\n\t\t\tenable: isSnapshotEnabled(ctx.tags),\n\t\t\t...ctx.parameters?.snapshot,\n\t\t\ttags: ctx.tags,\n\t\t\t...test?.meta.vis,\n\t\t})\n\t},\n} satisfies ProjectAnnotations<Renderer>\n","// `storybook-addon-vis/vitest-setup` provides code needed in `vitest.setup.ts`.\nimport './client/storybook/expect_extend.ts'\nimport './shared/global_matcher_augment.ts'\n\nimport 'vitest-plugin-vis/setup' // for Vitest extends\nimport { createVis } from 'vitest-plugin-vis/setup'\nimport { commands } from './client/vitest_proxy.ts'\n\nexport const vis = createVis<{ tags: string[] }>(commands)\nexport { setAutoSnapshotOptions } from 'vitest-plugin-vis'\nexport { visAnnotations } from './preview/vis_annotation.ts'\n"]}
@@ -0,0 +1,15 @@
1
+ import * as vitest_plugin_vis_setup from 'vitest-plugin-vis/setup';
2
+ import './matcher.cjs';
3
+ export { setAutoSnapshotOptions } from 'vitest-plugin-vis';
4
+ import { StoryContext } from 'storybook/internal/types';
5
+ import 'vitest-plugin-vis/client-api';
6
+
7
+ declare const visAnnotations: {
8
+ beforeEach(ctx: StoryContext): void;
9
+ };
10
+
11
+ declare const vis: vitest_plugin_vis_setup.VisClientConfigurator<{
12
+ tags: string[];
13
+ }>;
14
+
15
+ export { vis, visAnnotations };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-vis",
3
- "version": "2.0.7",
3
+ "version": "2.1.0",
4
4
  "description": "Storybook Vitest visual testing addon",
5
5
  "keywords": [
6
6
  "image-snapshot",
@@ -29,17 +29,20 @@
29
29
  "exports": {
30
30
  ".": {
31
31
  "types": "./dist/index.d.ts",
32
- "import": "./dist/index.js"
32
+ "import": "./dist/index.js",
33
+ "require": "./dist/index.cjs"
33
34
  },
34
35
  "./manager": "./dist/manager.js",
35
36
  "./matcher": {
36
37
  "types": "./dist/matcher.d.ts",
37
- "import": "./dist/matcher.js"
38
+ "import": "./dist/matcher.js",
39
+ "require": "./dist/matcher.cjs"
38
40
  },
39
41
  "./preset": "./dist/preset.cjs",
40
42
  "./vitest-setup": {
41
43
  "types": "./dist/vitest-setup.d.ts",
42
- "import": "./dist/vitest-setup.js"
44
+ "import": "./dist/vitest-setup.js",
45
+ "require": "./dist/vitest-setup.cjs"
43
46
  },
44
47
  "./vitest-plugin": {
45
48
  "types": "./vitest-plugin.d.ts",