@storybook/addon-highlight 7.0.0-alpha.52 → 7.0.0-alpha.54
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/README.md +1 -1
- package/dist/chunk-33ALZPRS.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/preview.js +1 -1
- package/dist/preview.mjs +5 -5
- package/package.json +4 -4
- package/dist/chunk-3L7URCJV.mjs +0 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Highlight DOM nodes by emitting the `HIGHLIGHT` event from within a story or an
|
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
30
|
import React, { useEffect } from 'react';
|
|
31
|
-
import { useChannel } from '@storybook/
|
|
31
|
+
import { useChannel } from '@storybook/preview-api';
|
|
32
32
|
import { HIGHLIGHT, RESET_HIGHLIGHT } from '@storybook/addon-highlight';
|
|
33
33
|
import { MyComponent } form './MyComponent';
|
|
34
34
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ADDON_ID="storybook/highlight",HIGHLIGHT_STYLE_ID="storybookHighlight",HIGHLIGHT=`${ADDON_ID}/add`,RESET_HIGHLIGHT=`${ADDON_ID}/reset`;export{HIGHLIGHT_STYLE_ID,HIGHLIGHT,RESET_HIGHLIGHT};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{HIGHLIGHT,RESET_HIGHLIGHT}from"./chunk-33ALZPRS.mjs";module&&module.hot&&module.hot.decline&&module.hot.decline();var src_default={};export{HIGHLIGHT,RESET_HIGHLIGHT,src_default as default};
|
package/dist/preview.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var x=Object.create;var i=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},c=(e,t,o,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!y.call(e,n)&&n!==o&&i(e,n,{get:()=>t[n],enumerable:!(l=G(t,n))||l.enumerable});return e};var b=(e,t,o)=>(o=e!=null?x(f(e)):{},c(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),E=e=>c(i({},"__esModule",{value:!0}),e);var O={};S(O,{highlightObject:()=>L,highlightStyle:()=>u});module.exports=E(O);var p=b(require("global")),a=require("@storybook/
|
|
1
|
+
var x=Object.create;var i=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},c=(e,t,o,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!y.call(e,n)&&n!==o&&i(e,n,{get:()=>t[n],enumerable:!(l=G(t,n))||l.enumerable});return e};var b=(e,t,o)=>(o=e!=null?x(f(e)):{},c(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),E=e=>c(i({},"__esModule",{value:!0}),e);var O={};S(O,{highlightObject:()=>L,highlightStyle:()=>u});module.exports=E(O);var p=b(require("global")),a=require("@storybook/preview-api"),I=require("@storybook/core-events");var g="storybook/highlight",s="storybookHighlight",H=`${g}/add`,m=`${g}/reset`;var{document:h}=p.default,u=(e="#FF4785",t="dashed")=>`
|
|
2
2
|
outline: 2px ${t} ${e};
|
|
3
3
|
outline-offset: 2px;
|
|
4
4
|
box-shadow: 0 0 0 6px rgba(255,255,255,0.6);
|
package/dist/preview.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
2
|
-
outline: 2px ${
|
|
1
|
+
import{HIGHLIGHT,HIGHLIGHT_STYLE_ID,RESET_HIGHLIGHT}from"./chunk-33ALZPRS.mjs";import global from"global";import{addons}from"@storybook/preview-api";import{STORY_CHANGED}from"@storybook/core-events";var{document}=global,highlightStyle=(color="#FF4785",style="dashed")=>`
|
|
2
|
+
outline: 2px ${style} ${color};
|
|
3
3
|
outline-offset: 2px;
|
|
4
4
|
box-shadow: 0 0 0 6px rgba(255,255,255,0.6);
|
|
5
|
-
`,
|
|
6
|
-
${
|
|
7
|
-
}`).join(" "),
|
|
5
|
+
`,highlightObject=color=>({outline:`2px dashed ${color}`,outlineOffset:2,boxShadow:"0 0 0 6px rgba(255,255,255,0.6)"});module&&module.hot&&module.hot.decline&&module.hot.decline();var channel=addons.getChannel(),highlight=infos=>{let id=HIGHLIGHT_STYLE_ID;resetHighlight();let elements=Array.from(new Set(infos.elements)),sheet=document.createElement("style");sheet.setAttribute("id",id),sheet.innerHTML=elements.map(target=>`${target}{
|
|
6
|
+
${highlightStyle(infos.color,infos.style)}
|
|
7
|
+
}`).join(" "),document.head.appendChild(sheet)},resetHighlight=()=>{let id=HIGHLIGHT_STYLE_ID,sheetToBeRemoved=document.getElementById(id);sheetToBeRemoved&&sheetToBeRemoved.parentNode.removeChild(sheetToBeRemoved)};channel.on(STORY_CHANGED,resetHighlight);channel.on(RESET_HIGHLIGHT,resetHighlight);channel.on(HIGHLIGHT,highlight);export{highlightObject,highlightStyle};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-highlight",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.54",
|
|
4
4
|
"description": "Highlight DOM nodes within your stories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook-addons",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@storybook/
|
|
64
|
-
"@storybook/
|
|
63
|
+
"@storybook/core-events": "7.0.0-alpha.54",
|
|
64
|
+
"@storybook/preview-api": "7.0.0-alpha.54",
|
|
65
65
|
"global": "^4.4.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"./src/preview.ts"
|
|
78
78
|
]
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "91177d4e27daec556a24ae6223c3cbe17a998d9b",
|
|
81
81
|
"sbmodern": "dist/modern/index.js",
|
|
82
82
|
"storybook": {
|
|
83
83
|
"displayName": "Highlight",
|
package/dist/chunk-3L7URCJV.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var o="storybook/highlight",t="storybookHighlight",H=`${o}/add`,I=`${o}/reset`;export{t as a,H as b,I as c};
|