diff --git a/lib/ui/package.json b/lib/ui/package.json index 1309d4095b73..71faaeba4489 100644 --- a/lib/ui/package.json +++ b/lib/ui/package.json @@ -29,6 +29,7 @@ "@storybook/core-events": "5.1.0-alpha.40", "@storybook/router": "5.1.0-alpha.40", "@storybook/theming": "5.1.0-alpha.40", + "copy-to-clipboard": "^3.0.8", "core-js": "^3.0.1", "core-js-pure": "^3.0.1", "fast-deep-equal": "^2.0.1", diff --git a/lib/ui/src/components/preview/__snapshots__/preview.stories.storyshot b/lib/ui/src/components/preview/__snapshots__/preview.stories.storyshot index 6c0bc9320fe5..fb1bdad30de7 100644 --- a/lib/ui/src/components/preview/__snapshots__/preview.stories.storyshot +++ b/lib/ui/src/components/preview/__snapshots__/preview.stories.storyshot @@ -2,7 +2,7 @@ exports[`Storyshots UI|Preview/Preview no tabs 1`] = ` Array [ - .emotion-22 { + .emotion-25 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -39,7 +39,7 @@ Array [ margin-left: 15px; } -.emotion-21 { +.emotion-24 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -54,7 +54,7 @@ Array [ margin-left: 30px; } -.emotion-21 > * { +.emotion-24 > * { margin-right: 15px; } @@ -70,7 +70,7 @@ Array [ fill: currentColor; } -.emotion-23 { +.emotion-26 { overflow-y: hidden; overflow-x: auto; color: #999999; @@ -133,7 +133,7 @@ Array [ }
* { +.emotion-30 > * { margin-right: 15px; } @@ -509,7 +509,7 @@ Array [ fill: currentColor; } -.emotion-29 { +.emotion-32 { overflow-y: hidden; overflow-x: auto; color: #999999; @@ -579,7 +579,7 @@ Array [ }
), }, + { + match: p => p.viewMode === 'story', + render: () => ( + + copy( + `${window.location.origin}${ + window.location.pathname + }${baseUrl}?id=${storyId}${stringifyQueryParams(queryParams)}` + ) + } + title="Copy canvas link" + > + + + ), + }, ]); const filter = item =>