@storybook/addon-highlight 7.0.0-beta.2 → 7.0.0-beta.20

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.js CHANGED
@@ -1 +1 @@
1
- var I=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var s=(t,o)=>{for(var H in o)I(t,H,{get:o[H],enumerable:!0})},c=(t,o,H,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of T(o))!i.call(t,e)&&e!==H&&I(t,e,{get:()=>o[e],enumerable:!(r=h(o,e))||r.enumerable});return t};var n=t=>c(I({},"__esModule",{value:!0}),t);var x={};s(x,{HIGHLIGHT:()=>d,RESET_HIGHLIGHT:()=>l,default:()=>p});module.exports=n(x);var G="storybook/highlight";var d=`${G}/add`,l=`${G}/reset`;module&&module.hot&&module.hot.decline&&module.hot.decline();var p={};0&&(module.exports={HIGHLIGHT,RESET_HIGHLIGHT});
1
+ var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{HIGHLIGHT:()=>HIGHLIGHT,RESET_HIGHLIGHT:()=>RESET_HIGHLIGHT,default:()=>src_default});module.exports=__toCommonJS(src_exports);var ADDON_ID="storybook/highlight";var HIGHLIGHT=`${ADDON_ID}/add`,RESET_HIGHLIGHT=`${ADDON_ID}/reset`;module&&module.hot&&module.hot.decline&&module.hot.decline();var src_default={};0&&(module.exports={HIGHLIGHT,RESET_HIGHLIGHT});
package/dist/preview.js CHANGED
@@ -1,7 +1,7 @@
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
- outline: 2px ${t} ${e};
1
+ var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preview_exports={};__export(preview_exports,{highlightObject:()=>highlightObject,highlightStyle:()=>highlightStyle});module.exports=__toCommonJS(preview_exports);var import_global=require("@storybook/global"),import_preview_api=require("@storybook/preview-api"),import_core_events=require("@storybook/core-events");var ADDON_ID="storybook/highlight",HIGHLIGHT_STYLE_ID="storybookHighlight",HIGHLIGHT=`${ADDON_ID}/add`,RESET_HIGHLIGHT=`${ADDON_ID}/reset`;var{document}=import_global.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
- `,L=e=>({outline:`2px dashed ${e}`,outlineOffset:2,boxShadow:"0 0 0 6px rgba(255,255,255,0.6)"});module&&module.hot&&module.hot.decline&&module.hot.decline();var r=a.addons.getChannel(),_=e=>{let t=s;d();let o=Array.from(new Set(e.elements)),l=h.createElement("style");l.setAttribute("id",t),l.innerHTML=o.map(n=>`${n}{
6
- ${u(e.color,e.style)}
7
- }`).join(" "),h.head.appendChild(l)},d=()=>{let e=s,t=h.getElementById(e);t&&t.parentNode.removeChild(t)};r.on(I.STORY_CHANGED,d);r.on(m,d);r.on(H,_);0&&(module.exports={highlightObject,highlightStyle});
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=import_preview_api.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(import_core_events.STORY_CHANGED,resetHighlight);channel.on(RESET_HIGHLIGHT,resetHighlight);channel.on(HIGHLIGHT,highlight);0&&(module.exports={highlightObject,highlightStyle});
package/dist/preview.mjs CHANGED
@@ -1,4 +1,4 @@
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")=>`
1
+ import{HIGHLIGHT,HIGHLIGHT_STYLE_ID,RESET_HIGHLIGHT}from"./chunk-33ALZPRS.mjs";import{global}from"@storybook/global";import{addons}from"@storybook/preview-api";import{STORY_CHANGED}from"@storybook/core-events";var{document}=global,highlightStyle=(color="#FF4785",style="dashed")=>`
2
2
  outline: 2px ${style} ${color};
3
3
  outline-offset: 2px;
4
4
  box-shadow: 0 0 0 6px rgba(255,255,255,0.6);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-highlight",
3
- "version": "7.0.0-beta.2",
3
+ "version": "7.0.0-beta.20",
4
4
  "description": "Highlight DOM nodes within your stories",
5
5
  "keywords": [
6
6
  "storybook-addons",
@@ -25,6 +25,7 @@
25
25
  "author": "winkerVSbecks",
26
26
  "exports": {
27
27
  ".": {
28
+ "node": "./dist/index.js",
28
29
  "require": "./dist/index.js",
29
30
  "import": "./dist/index.mjs",
30
31
  "types": "./dist/index.d.ts"
@@ -60,9 +61,9 @@
60
61
  "prep": "../../../scripts/prepare/bundle.ts"
61
62
  },
62
63
  "dependencies": {
63
- "@storybook/core-events": "7.0.0-beta.2",
64
- "@storybook/preview-api": "7.0.0-beta.2",
65
- "global": "^4.4.0"
64
+ "@storybook/core-events": "7.0.0-beta.20",
65
+ "@storybook/global": "^5.0.0",
66
+ "@storybook/preview-api": "7.0.0-beta.20"
66
67
  },
67
68
  "devDependencies": {
68
69
  "@types/webpack-env": "^1.16.0",
@@ -77,7 +78,7 @@
77
78
  "./src/preview.ts"
78
79
  ]
79
80
  },
80
- "gitHead": "66a0d588184add900c48d49f3a62743fa9cc5185",
81
+ "gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
81
82
  "sbmodern": "dist/modern/index.js",
82
83
  "storybook": {
83
84
  "displayName": "Highlight",