storybook-addon-vis 0.15.2 → 0.15.3

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/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from 'vitest-plugin-vis';
2
2
  import { ToMatchImageSnapshotOptions, ImageSnapshotIdOptions } from 'vitest-plugin-vis/client';
3
+ export { ToMatchImageSnapshotOptions } from 'vitest-plugin-vis/client';
3
4
 
4
5
  /**
5
6
  * Define snapshot parameter for auto snapshot.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client/storybook/param.ts","../src/client/has_image_snapshot.ts"],"names":[],"mappings":";;;;;AAKO,SAAS,wBAAwB,QAAuC,EAAA;AAC9E,EAAA,OAAO,EAAE,QAAS,EAAA;AACnB;ACDA,eAAsB,iBAAiB,OAA8C,EAAA;AACpF,EAAA,MAAM,OAAO,cAAe,EAAA;AAC5B,EAAA,IAAI,CAAC,IAAM,EAAA;AACV,IAAO,OAAA,KAAA;AAAA;AAGR,EAAM,MAAA,MAAA,GAAS,SAAS,IAAI,CAAA;AAC5B,EAAA,IAAI,SAAS,mBAAqB,EAAA;AACjC,IAAA,OAAO,QACL,CAAA,sBAAA,CAAuB,MAAM,CAAA,CAC7B,KAAK,CAAC,KAAA,KAAU,QAAS,CAAA,gBAAA,CAAiB,QAAQ,OAAQ,CAAA,mBAAA,CAAqB,MAAQ,EAAA,KAAK,CAAC,CAAC,CAAA;AAAA;AAGjG,EAAO,OAAA,QAAA,CAAS,iBAAiB,MAAM,CAAA;AACxC","file":"index.js","sourcesContent":["import type { ToMatchImageSnapshotOptions } from 'vitest-plugin-vis/client'\n\n/**\n * Define snapshot parameter for auto snapshot.\n */\nexport function defineAutoSnapshotParam(snapshot: ToMatchImageSnapshotOptions) {\n\treturn { snapshot }\n}\n","import { type ImageSnapshotIdOptions, toTaskId } from 'vitest-plugin-vis/client'\nimport { commands, getCurrentTest } from './vitest_proxy.ts'\n\n/**\n * Check if the snapshot image exists.\n */\nexport async function hasImageSnapshot(options?: ImageSnapshotIdOptions | undefined) {\n\tconst test = getCurrentTest()\n\tif (!test) {\n\t\treturn false\n\t}\n\n\tconst taskId = toTaskId(test)\n\tif (options?.customizeSnapshotId) {\n\t\treturn commands\n\t\t\t.imageSnapshotNextIndex(taskId)\n\t\t\t.then((index) => commands.hasImageSnapshot(taskId, options.customizeSnapshotId!(taskId, index)))\n\t}\n\n\treturn commands.hasImageSnapshot(taskId)\n}\n"]}
1
+ {"version":3,"sources":["../src/client/storybook/param.ts","../src/client/has_image_snapshot.ts"],"names":[],"mappings":";;;;;AAKO,SAAS,wBAAwB,QAAuC,EAAA;AAC9E,EAAA,OAAO,EAAE,QAAS,EAAA;AACnB;ACDA,eAAsB,iBAAiB,OAA8C,EAAA;AACpF,EAAA,MAAM,OAAO,cAAe,EAAA;AAC5B,EAAA,IAAI,CAAC,IAAM,EAAA;AACV,IAAO,OAAA,KAAA;AAAA;AAGR,EAAM,MAAA,MAAA,GAAS,SAAS,IAAI,CAAA;AAC5B,EAAA,IAAI,SAAS,mBAAqB,EAAA;AACjC,IAAA,OAAO,QACL,CAAA,sBAAA,CAAuB,MAAM,CAAA,CAC7B,KAAK,CAAC,KAAA,KAAU,QAAS,CAAA,gBAAA,CAAiB,QAAQ,OAAQ,CAAA,mBAAA,CAAqB,MAAQ,EAAA,KAAK,CAAC,CAAC,CAAA;AAAA;AAGjG,EAAO,OAAA,QAAA,CAAS,iBAAiB,MAAM,CAAA;AACxC","file":"index.js","sourcesContent":["import type { ToMatchImageSnapshotOptions } from 'vitest-plugin-vis/client'\n\n/**\n * Define snapshot parameter for auto snapshot.\n */\nexport function defineAutoSnapshotParam(snapshot: ToMatchImageSnapshotOptions) {\n\treturn { snapshot }\n}\n\nexport type { ToMatchImageSnapshotOptions }\n","import { type ImageSnapshotIdOptions, toTaskId } from 'vitest-plugin-vis/client'\nimport { commands, getCurrentTest } from './vitest_proxy.ts'\n\n/**\n * Check if the snapshot image exists.\n */\nexport async function hasImageSnapshot(options?: ImageSnapshotIdOptions | undefined) {\n\tconst test = getCurrentTest()\n\tif (!test) {\n\t\treturn false\n\t}\n\n\tconst taskId = toTaskId(test)\n\tif (options?.customizeSnapshotId) {\n\t\treturn commands\n\t\t\t.imageSnapshotNextIndex(taskId)\n\t\t\t.then((index) => commands.hasImageSnapshot(taskId, options.customizeSnapshotId!(taskId, index)))\n\t}\n\n\treturn commands.hasImageSnapshot(taskId)\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-vis",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Storybook Vitest visual testing addon",
5
5
  "keywords": [
6
6
  "image-snapshot",
@@ -6,3 +6,5 @@ import type { ToMatchImageSnapshotOptions } from 'vitest-plugin-vis/client'
6
6
  export function defineAutoSnapshotParam(snapshot: ToMatchImageSnapshotOptions) {
7
7
  return { snapshot }
8
8
  }
9
+
10
+ export type { ToMatchImageSnapshotOptions }