@storybook/addon-highlight 7.1.0-alpha.8 → 7.1.0-beta.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.
@@ -1 +1,3 @@
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};
1
+ var ADDON_ID="storybook/highlight",HIGHLIGHT_STYLE_ID="storybookHighlight",HIGHLIGHT=`${ADDON_ID}/add`,RESET_HIGHLIGHT=`${ADDON_ID}/reset`;
2
+
3
+ export { HIGHLIGHT, HIGHLIGHT_STYLE_ID, RESET_HIGHLIGHT };
package/dist/index.js CHANGED
@@ -1 +1 @@
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`;var src_default={};0&&(module.exports={HIGHLIGHT,RESET_HIGHLIGHT});
1
+ "use strict";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`;var src_default={};0&&(module.exports={HIGHLIGHT,RESET_HIGHLIGHT});
package/dist/index.mjs CHANGED
@@ -1 +1,5 @@
1
- import{HIGHLIGHT,RESET_HIGHLIGHT}from"./chunk-33ALZPRS.mjs";var src_default={};export{HIGHLIGHT,RESET_HIGHLIGHT,src_default as default};
1
+ export { HIGHLIGHT, RESET_HIGHLIGHT } from './chunk-33ALZPRS.mjs';
2
+
3
+ var src_default={};
4
+
5
+ export { src_default as default };
package/dist/preview.js CHANGED
@@ -1,7 +1,7 @@
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")=>`
1
+ "use strict";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
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
5
  `,highlightObject=color=>({outline:`2px dashed ${color}`,outlineOffset:2,boxShadow:"0 0 0 6px rgba(255,255,255,0.6)"}),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
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});
7
+ }`).join(" "),document.head.appendChild(sheet)},resetHighlight=()=>{var _a;let id=HIGHLIGHT_STYLE_ID,sheetToBeRemoved=document.getElementById(id);sheetToBeRemoved&&((_a=sheetToBeRemoved.parentNode)==null||_a.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,7 +1,14 @@
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")=>`
1
+ import { RESET_HIGHLIGHT, HIGHLIGHT, HIGHLIGHT_STYLE_ID } from './chunk-33ALZPRS.mjs';
2
+ import { global } from '@storybook/global';
3
+ import { addons } from '@storybook/preview-api';
4
+ import { STORY_CHANGED } from '@storybook/core-events';
5
+
6
+ var {document}=global,highlightStyle=(color="#FF4785",style="dashed")=>`
2
7
  outline: 2px ${style} ${color};
3
8
  outline-offset: 2px;
4
9
  box-shadow: 0 0 0 6px rgba(255,255,255,0.6);
5
10
  `,highlightObject=color=>({outline:`2px dashed ${color}`,outlineOffset:2,boxShadow:"0 0 0 6px rgba(255,255,255,0.6)"}),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
11
  ${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};
12
+ }`).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);
13
+
14
+ export { highlightObject, highlightStyle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-highlight",
3
- "version": "7.1.0-alpha.8",
3
+ "version": "7.1.0-beta.0",
4
4
  "description": "Highlight DOM nodes within your stories",
5
5
  "keywords": [
6
6
  "storybook-addons",
@@ -15,7 +15,7 @@
15
15
  "repository": {
16
16
  "type": "git",
17
17
  "url": "https://github.com/storybookjs/storybook.git",
18
- "directory": "addons/highlight"
18
+ "directory": "code/addons/highlight"
19
19
  },
20
20
  "funding": {
21
21
  "type": "opencollective",
@@ -25,15 +25,15 @@
25
25
  "author": "winkerVSbecks",
26
26
  "exports": {
27
27
  ".": {
28
+ "types": "./dist/index.d.ts",
28
29
  "node": "./dist/index.js",
29
30
  "require": "./dist/index.js",
30
- "import": "./dist/index.mjs",
31
- "types": "./dist/index.d.ts"
31
+ "import": "./dist/index.mjs"
32
32
  },
33
33
  "./preview": {
34
+ "types": "./dist/preview.d.ts",
34
35
  "require": "./dist/preview.js",
35
- "import": "./dist/preview.mjs",
36
- "types": "./dist/preview.d.ts"
36
+ "import": "./dist/preview.mjs"
37
37
  },
38
38
  "./package.json": "./package.json"
39
39
  },
@@ -61,9 +61,9 @@
61
61
  "prep": "../../../scripts/prepare/bundle.ts"
62
62
  },
63
63
  "dependencies": {
64
- "@storybook/core-events": "7.1.0-alpha.8",
64
+ "@storybook/core-events": "7.1.0-beta.0",
65
65
  "@storybook/global": "^5.0.0",
66
- "@storybook/preview-api": "7.1.0-alpha.8"
66
+ "@storybook/preview-api": "7.1.0-beta.0"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/webpack-env": "^1.16.0",
@@ -78,7 +78,7 @@
78
78
  "./src/preview.ts"
79
79
  ]
80
80
  },
81
- "gitHead": "ae73d1c8065f7d614cfe6f3462ae7ca55a0c4e6b",
81
+ "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17",
82
82
  "sbmodern": "dist/modern/index.js",
83
83
  "storybook": {
84
84
  "displayName": "Highlight",
@@ -87,4 +87,4 @@
87
87
  ],
88
88
  "icon": "https://user-images.githubusercontent.com/42671/162045505-9d06fe2e-8fcb-4c41-9486-e0553bce10cc.png"
89
89
  }
90
- }
90
+ }