@cappa/plugin-storybook 0.12.2 → 0.13.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.
@@ -356,6 +356,7 @@ const cappaPluginStorybook = (options) => {
356
356
  const baseOptions = {
357
357
  fullPage: storyParameters?.fullPage,
358
358
  crop: storyParameters?.crop ?? options?.crop,
359
+ scale: storyParameters?.scale,
359
360
  delay: storyParameters?.delay,
360
361
  omitBackground: storyParameters?.omitBackground,
361
362
  skip: storyParameters?.skip,
@@ -1,4 +1,4 @@
1
- import { CropSetting, DiffOptions, Plugin } from "@cappa/core";
1
+ import { CropSetting, DiffOptions, Plugin, ScreenshotScale } from "@cappa/core";
2
2
  //#region src/types.d.ts
3
3
  interface StorybookRenderOptions {
4
4
  viewMode?: "story" | "docs";
@@ -17,6 +17,11 @@ interface ScreenshotVariantOverrideStorybook {
17
17
  * Overrides the plugin's and the config's `crop`.
18
18
  */
19
19
  crop?: CropSetting;
20
+ /**
21
+ * `"device"` captures at the context's `deviceScaleFactor` instead of one
22
+ * pixel per CSS pixel. Overrides the config's `screenshot.scale`.
23
+ */
24
+ scale?: ScreenshotScale;
20
25
  delay?: number;
21
26
  skip?: boolean;
22
27
  mask?: string[];
@@ -1,4 +1,4 @@
1
- import { CropSetting, DiffOptions, Plugin } from "@cappa/core";
1
+ import { CropSetting, DiffOptions, Plugin, ScreenshotScale } from "@cappa/core";
2
2
  //#region src/types.d.ts
3
3
  interface StorybookRenderOptions {
4
4
  viewMode?: "story" | "docs";
@@ -17,6 +17,11 @@ interface ScreenshotVariantOverrideStorybook {
17
17
  * Overrides the plugin's and the config's `crop`.
18
18
  */
19
19
  crop?: CropSetting;
20
+ /**
21
+ * `"device"` captures at the context's `deviceScaleFactor` instead of one
22
+ * pixel per CSS pixel. Overrides the config's `screenshot.scale`.
23
+ */
24
+ scale?: ScreenshotScale;
20
25
  delay?: number;
21
26
  skip?: boolean;
22
27
  mask?: string[];
@@ -356,6 +356,7 @@ const cappaPluginStorybook = (options) => {
356
356
  const baseOptions = {
357
357
  fullPage: storyParameters?.fullPage,
358
358
  crop: storyParameters?.crop ?? options?.crop,
359
+ scale: storyParameters?.scale,
359
360
  delay: storyParameters?.delay,
360
361
  omitBackground: storyParameters?.omitBackground,
361
362
  skip: storyParameters?.skip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cappa/plugin-storybook",
3
- "version": "0.12.2",
3
+ "version": "0.13.0",
4
4
  "description": "Storybook plugin for Cappa - takes screenshots of Storybook stories",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -76,7 +76,7 @@
76
76
  }
77
77
  },
78
78
  "dependencies": {
79
- "@cappa/core": "0.19.0",
79
+ "@cappa/core": "0.20.0",
80
80
  "@cappa/logger": "0.0.12",
81
81
  "@swc/core": "^1.16.2",
82
82
  "chalk": "^6.0.0"