Skip to content

Commit

Permalink
Merge pull request #15107 from storybookjs/addon-css-essentials
Browse files Browse the repository at this point in the history
Essentials: Add measue and outline addons
  • Loading branch information
shilman authored Jun 2, 2021
2 parents d1cbf84 + d302502 commit d7fd97b
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 6 deletions.
2 changes: 2 additions & 0 deletions addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@
"@storybook/addon-backgrounds": "6.3.0-beta.8",
"@storybook/addon-controls": "6.3.0-beta.8",
"@storybook/addon-docs": "6.3.0-beta.8",
"@storybook/addon-measure": "^1.1.0",
"@storybook/addon-toolbars": "6.3.0-beta.8",
"@storybook/addon-viewport": "6.3.0-beta.8",
"@storybook/addons": "6.3.0-beta.8",
"@storybook/api": "6.3.0-beta.8",
"@storybook/node-logger": "6.3.0-beta.8",
"core-js": "^3.8.2",
"regenerator-runtime": "^0.13.7",
"storybook-addon-outline": "^1.3.2",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions addons/essentials/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export function addons(options: PresetOptions = {}) {

const main = requireMain(options.configDir);
return (
['docs', 'controls', 'actions', 'backgrounds', 'viewport', 'toolbars']
['docs', 'controls', 'actions', 'backgrounds', 'viewport', 'toolbars', 'measure', 'outline']
.filter((key) => (options as any)[key] !== false)
.map((key) => `@storybook/addon-${key}`)
.map((key) => (key === 'outline' ? `storybook-addon-${key}` : `@storybook/addon-${key}`))
.filter((addon) => !checkInstalled(addon, main))
// Use `require.resolve` to ensure Yarn PnP compatibility
// Files of various addons should be resolved in the context of `addon-essentials` as they are listed as deps here
Expand Down
14 changes: 14 additions & 0 deletions lib/components/src/Zoom/Zoom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,30 @@ iFrameActualSize.args = {
active: true,
};

// The iFrame stories are disabled because useGlobals works in practice
// but, for some reason breaks in the stories for Zoom.iFrame
iFrameActualSize.parameters = {
chromatic: { disableSnapshot: true },
};

export const iFrameZoomedIn = TemplateIFrame.bind({});

iFrameZoomedIn.args = {
scale: 0.7,
active: true,
};

iFrameZoomedIn.parameters = {
chromatic: { disableSnapshot: true },
};

export const iFrameZoomedOut = TemplateIFrame.bind({});

iFrameZoomedOut.args = {
scale: 3,
active: true,
};

iFrameZoomedOut.parameters = {
chromatic: { disableSnapshot: true },
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Object {
"ROOT/addons/actions/dist/esm/register.js",
"ROOT/addons/backgrounds/dist/esm/register.js",
"ROOT/addons/toolbars/dist/esm/register.js",
"NODE_MODULES/@storybook/addon-measure/dist/preset/manager.js",
"NODE_MODULES/storybook-addon-outline/dist/preset/register.js",
"ROOT/examples/cra-ts-essentials/.storybook/generated-refs.js",
],
"keys": Array [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Object {
"ROOT/addons/actions/dist/esm/register.js",
"ROOT/addons/backgrounds/dist/esm/register.js",
"ROOT/addons/toolbars/dist/esm/register.js",
"NODE_MODULES/@storybook/addon-measure/dist/preset/manager.js",
"NODE_MODULES/storybook-addon-outline/dist/preset/register.js",
"ROOT/examples/cra-ts-essentials/.storybook/generated-refs.js",
],
"keys": Array [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Object {
"ROOT/addons/actions/dist/esm/preset/addArgs.js-generated-other-entry.js",
"ROOT/addons/backgrounds/dist/esm/preset/addDecorator.js-generated-other-entry.js",
"ROOT/addons/backgrounds/dist/esm/preset/addParameter.js-generated-other-entry.js",
"NODE_MODULES/@storybook/addon-measure/dist/preset/preview.js-generated-other-entry.js",
"NODE_MODULES/storybook-addon-outline/dist/preset/addDecorator.js-generated-other-entry.js",
"ROOT/examples/cra-ts-essentials/.storybook/preview.js-generated-config-entry.js",
"ROOT/examples/cra-ts-essentials/.storybook/generated-stories-entry.js",
"NODE_MODULES/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Object {
"ROOT/addons/actions/dist/esm/preset/addArgs.js-generated-other-entry.js",
"ROOT/addons/backgrounds/dist/esm/preset/addDecorator.js-generated-other-entry.js",
"ROOT/addons/backgrounds/dist/esm/preset/addParameter.js-generated-other-entry.js",
"NODE_MODULES/@storybook/addon-measure/dist/preset/preview.js-generated-other-entry.js",
"NODE_MODULES/storybook-addon-outline/dist/preset/addDecorator.js-generated-other-entry.js",
"ROOT/examples/cra-ts-essentials/.storybook/preview.js-generated-config-entry.js",
"ROOT/examples/cra-ts-essentials/.storybook/generated-stories-entry.js",
],
Expand Down
2 changes: 2 additions & 0 deletions lib/core-server/src/__snapshots__/vue-3-cli_manager-dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Object {
"ROOT/addons/backgrounds/dist/esm/register.js",
"ROOT/addons/viewport/dist/esm/register.js",
"ROOT/addons/toolbars/dist/esm/register.js",
"NODE_MODULES/@storybook/addon-measure/dist/preset/manager.js",
"NODE_MODULES/storybook-addon-outline/dist/preset/register.js",
"ROOT/examples/vue-3-cli/.storybook/generated-refs.js",
],
"keys": Array [
Expand Down
2 changes: 2 additions & 0 deletions lib/core-server/src/__snapshots__/vue-3-cli_manager-prod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Object {
"ROOT/addons/backgrounds/dist/esm/register.js",
"ROOT/addons/viewport/dist/esm/register.js",
"ROOT/addons/toolbars/dist/esm/register.js",
"NODE_MODULES/@storybook/addon-measure/dist/preset/manager.js",
"NODE_MODULES/storybook-addon-outline/dist/preset/register.js",
"ROOT/examples/vue-3-cli/.storybook/generated-refs.js",
],
"keys": Array [
Expand Down
2 changes: 2 additions & 0 deletions lib/core-server/src/__snapshots__/vue-3-cli_preview-dev
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Object {
"ROOT/addons/actions/dist/esm/preset/addArgs.js-generated-other-entry.js",
"ROOT/addons/backgrounds/dist/esm/preset/addDecorator.js-generated-other-entry.js",
"ROOT/addons/backgrounds/dist/esm/preset/addParameter.js-generated-other-entry.js",
"NODE_MODULES/@storybook/addon-measure/dist/preset/preview.js-generated-other-entry.js",
"NODE_MODULES/storybook-addon-outline/dist/preset/addDecorator.js-generated-other-entry.js",
"ROOT/examples/vue-3-cli/.storybook/preview.ts-generated-config-entry.js",
"ROOT/examples/vue-3-cli/.storybook/generated-stories-entry.js",
"NODE_MODULES/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined",
Expand Down
2 changes: 2 additions & 0 deletions lib/core-server/src/__snapshots__/vue-3-cli_preview-prod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Object {
"ROOT/addons/actions/dist/esm/preset/addArgs.js-generated-other-entry.js",
"ROOT/addons/backgrounds/dist/esm/preset/addDecorator.js-generated-other-entry.js",
"ROOT/addons/backgrounds/dist/esm/preset/addParameter.js-generated-other-entry.js",
"NODE_MODULES/@storybook/addon-measure/dist/preset/preview.js-generated-other-entry.js",
"NODE_MODULES/storybook-addon-outline/dist/preset/addDecorator.js-generated-other-entry.js",
"ROOT/examples/vue-3-cli/.storybook/preview.ts-generated-config-entry.js",
"ROOT/examples/vue-3-cli/.storybook/generated-stories-entry.js",
],
Expand Down
4 changes: 4 additions & 0 deletions scripts/verdaccio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ packages:
access: $all
publish: $all
proxy: npmjs
'@storybook/addon-measure':
access: $all
publish: $all
proxy: npmjs

# storybook packages are NOT proxied to global registry
# allowing us to republish any version during tests
Expand Down
53 changes: 49 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5807,6 +5807,7 @@ __metadata:
"@storybook/addon-backgrounds": 6.3.0-beta.8
"@storybook/addon-controls": 6.3.0-beta.8
"@storybook/addon-docs": 6.3.0-beta.8
"@storybook/addon-measure": ^1.1.0
"@storybook/addon-toolbars": 6.3.0-beta.8
"@storybook/addon-viewport": 6.3.0-beta.8
"@storybook/addons": 6.3.0-beta.8
Expand All @@ -5817,6 +5818,7 @@ __metadata:
"@types/webpack-env": ^1.16.0
core-js: ^3.8.2
regenerator-runtime: ^0.13.7
storybook-addon-outline: ^1.3.2
ts-dedent: ^2.0.0
peerDependencies:
"@babel/core": ^7.9.6
Expand Down Expand Up @@ -5897,6 +5899,26 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/addon-measure@npm:^1.1.0":
version: 1.1.0
resolution: "@storybook/addon-measure@npm:1.1.0"
peerDependencies:
"@storybook/addons": ^6.3.0-beta.1
"@storybook/api": ^6.3.0-beta.1
"@storybook/components": ^6.3.0-beta.1
"@storybook/core-events": ^6.3.0-beta.1
"@storybook/theming": ^6.3.0-beta.1
react: ^16.8.0 || ^17.0.0
react-dom: ^16.8.0 || ^17.0.0
peerDependenciesMeta:
react:
optional: true
react-dom:
optional: true
checksum: 33441086c7870b58fe718e3084b7fd7ff194938c243ac156a132eb7ee6e66b0e03d3556ab061b47fcc28ffdc134428502f9aeb67c615075f0869f34ae773a366
languageName: node
linkType: hard

"@storybook/addon-postcss@npm:^2.0.0":
version: 2.0.0
resolution: "@storybook/addon-postcss@npm:2.0.0"
Expand Down Expand Up @@ -6096,7 +6118,7 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/addons@workspace:*, @storybook/addons@workspace:lib/addons":
"@storybook/[email protected], @storybook/addons@^6.3.0-beta.6, @storybook/addons@workspace:*, @storybook/addons@workspace:lib/addons":
version: 0.0.0-use.local
resolution: "@storybook/addons@workspace:lib/addons"
dependencies:
Expand Down Expand Up @@ -6193,7 +6215,7 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/api@workspace:*, @storybook/api@workspace:lib/api":
"@storybook/[email protected], @storybook/api@^6.3.0-beta.6, @storybook/api@workspace:*, @storybook/api@workspace:lib/api":
version: 0.0.0-use.local
resolution: "@storybook/api@workspace:lib/api"
dependencies:
Expand Down Expand Up @@ -6530,7 +6552,7 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/components@workspace:*, @storybook/components@workspace:lib/components":
"@storybook/[email protected], @storybook/components@^6.3.0-beta.6, @storybook/components@workspace:*, @storybook/components@workspace:lib/components":
version: 0.0.0-use.local
resolution: "@storybook/components@workspace:lib/components"
dependencies:
Expand Down Expand Up @@ -6662,7 +6684,7 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/core-events@workspace:*, @storybook/core-events@workspace:lib/core-events":
"@storybook/[email protected], @storybook/core-events@^6.3.0-beta.6, @storybook/core-events@workspace:*, @storybook/core-events@workspace:lib/core-events":
version: 0.0.0-use.local
resolution: "@storybook/core-events@workspace:lib/core-events"
dependencies:
Expand Down Expand Up @@ -39037,6 +39059,22 @@ [email protected]:
languageName: node
linkType: hard

"storybook-addon-outline@npm:^1.3.2":
version: 1.3.2
resolution: "storybook-addon-outline@npm:1.3.2"
dependencies:
"@storybook/addons": ^6.3.0-beta.6
"@storybook/api": ^6.3.0-beta.6
"@storybook/components": ^6.3.0-beta.6
"@storybook/core-events": ^6.3.0-beta.6
ts-dedent: ^2.1.1
peerDependencies:
react: ^16.8.0 || ^17.0.0
react-dom: ^16.8.0 || ^17.0.0
checksum: 75586ff5093ab904ad1d5d98b0934d009192ebb02db4ae986f40f50e4b72e0ce131afa46932d68dca6e9849a13e7355cb7745b19dc60e5b9624a696eb8b611aa
languageName: node
linkType: hard

"storybook@workspace:lib/cli-storybook":
version: 0.0.0-use.local
resolution: "storybook@workspace:lib/cli-storybook"
Expand Down Expand Up @@ -40977,6 +41015,13 @@ [email protected]:
languageName: node
linkType: hard

"ts-dedent@npm:^2.1.1":
version: 2.1.1
resolution: "ts-dedent@npm:2.1.1"
checksum: 7ac68dbc2e864db6e3f0500a8b6af5bf775020bfe09816cf647469e06acdcb76d2a24b1b0211614c3c44e0978aa081a51a3dde6b8f211a68f945cbc177f7f9c2
languageName: node
linkType: hard

"ts-essentials@npm:^2.0.3":
version: 2.0.12
resolution: "ts-essentials@npm:2.0.12"
Expand Down

0 comments on commit d7fd97b

Please sign in to comment.