@storybook/manager 7.0.0-alpha.44
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 +188 -0
- package/dist/GlobalScrollAreaStyles-TBEQLFSH-NH4GGRR6.mjs +1 -0
- package/dist/OverlayScrollbars-ZWHHW3B2-NCU3SGRN.mjs +6 -0
- package/dist/WithTooltip-WW36AVDT-HE7FYFT5.mjs +9 -0
- package/dist/chunk-6XCSLWLC.mjs +1 -0
- package/dist/chunk-722JULI4.mjs +4 -0
- package/dist/chunk-7OQJDLEV.mjs +101 -0
- package/dist/chunk-AIPH5HO4.mjs +1 -0
- package/dist/chunk-L2PAVIFR.mjs +1 -0
- package/dist/chunk-MY4F7ORE.mjs +1 -0
- package/dist/chunk-NISR2N5K.mjs +7 -0
- package/dist/chunk-QV6IVTJA.mjs +1 -0
- package/dist/chunk-T6P6F2SI.mjs +44 -0
- package/dist/chunk-Z7LX2X6E.mjs +1 -0
- package/dist/formatter-UBTKRH7D-HPBI4PVA.mjs +156 -0
- package/dist/globals.d.ts +36 -0
- package/dist/globals.js +1 -0
- package/dist/globals.mjs +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +608 -0
- package/dist/index.mjs +1 -0
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +611 -0
- package/dist/runtime.mjs +1 -0
- package/dist/syntaxhighlighter-74DP7Q2I-NU4HICHN.mjs +1 -0
- package/package.json +104 -0
- package/paths.js +19 -0
package/dist/runtime.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ne,b as $,c as x,d,e as g,f as u,g as y,h as D,i as K,j as b,k as B,l as w,m as H,n as P,p as Y}from"./chunk-7OQJDLEV.mjs";import{a as S}from"./chunk-QV6IVTJA.mjs";import"./chunk-NISR2N5K.mjs";import{a as re}from"./chunk-722JULI4.mjs";import"./chunk-MY4F7ORE.mjs";import{a as k,b as f,d as C,e as L,s as I}from"./chunk-T6P6F2SI.mjs";import{b as oe}from"./chunk-Z7LX2X6E.mjs";import"./chunk-AIPH5HO4.mjs";import"./chunk-6XCSLWLC.mjs";import{e as h,g as l}from"./chunk-L2PAVIFR.mjs";l();var E=h(k());l();var O=h(k(),1);var U=h(ne(),1),{window:n,document:p,location:A}=O.default,_="storybook-channel",se={allowFunction:!0,maxDepth:25},ae=class{constructor(t){if(this.config=t,this.buffer=[],this.handler=null,n&&n.addEventListener("message",this.handleEvent.bind(this),!1),t.page!=="manager"&&t.page!=="preview")throw new Error(`postmsg-channel: "config.page" cannot be "${t.page}"`)}setHandler(t){this.handler=(...e)=>{t.apply(this,e),!this.connected&&this.getLocalFrame().length&&(this.flush(),this.connected=!0)}}send(t,e){let{target:o,allowRegExp:r,allowFunction:s,allowSymbol:i,allowDate:a,allowUndefined:c,allowClass:V,maxDepth:z,space:J,lazyEval:Q}=e||{},X=Object.fromEntries(Object.entries({allowRegExp:r,allowFunction:s,allowSymbol:i,allowDate:a,allowUndefined:c,allowClass:V,maxDepth:z,space:J,lazyEval:Q}).filter(([m,v])=>typeof v<"u")),Z={...se,...O.default.CHANNEL_OPTIONS||{},...X},F=this.getFrames(o),ee=U.default.parse(A.search,{ignoreQueryPrefix:!0}),te=u({key:_,event:t,refId:ee.refId},Z);return F.length?(this.buffer.length&&this.flush(),F.forEach(m=>{try{m.postMessage(te,"*")}catch{console.error("sending over postmessage fail")}}),Promise.resolve(null)):new Promise((m,v)=>{this.buffer.push({event:t,resolve:m,reject:v})})}flush(){let{buffer:t}=this;this.buffer=[],t.forEach(e=>{this.send(e.event).then(e.resolve).catch(e.reject)})}getFrames(t){if(this.config.page==="manager"){let e=[...p.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")].filter(o=>{try{return!!o.contentWindow&&o.dataset.isStorybook!==void 0&&o.id===t}catch{return!1}}).map(o=>o.contentWindow);return e.length?e:this.getCurrentFrames()}return n&&n.parent&&n.parent!==n?[n.parent]:[]}getCurrentFrames(){return this.config.page==="manager"?[...p.querySelectorAll('[data-is-storybook="true"]')].map(t=>t.contentWindow):n&&n.parent?[n.parent]:[]}getLocalFrame(){return this.config.page==="manager"?[...p.querySelectorAll("#storybook-preview-iframe")].map(t=>t.contentWindow):n&&n.parent?[n.parent]:[]}handleEvent(t){try{let{data:e}=t,{key:o,event:r,refId:s}=typeof e=="string"&&g(e)?y(e,O.default.CHANNEL_OPTIONS||{}):e;if(o===_){let i=this.config.page==="manager"?'<span style="color: #37D5D3; background: black"> manager </span>':'<span style="color: #1EA7FD; background: black"> preview </span>',a=Object.values(d).includes(r.type)?`<span style="color: #FF4785">${r.type}</span>`:`<span style="color: #FFAE00">${r.type}</span>`;if(s&&(r.refId=s),r.source=this.config.page==="preview"?t.origin:ie(t),!r.source){C.error(`${i} received ${a} but was unable to determine the source of the event`);return}let c=`${i} received ${a} (${e.length})`;C.debug(A.origin!==r.source?c:`${c} <span style="color: gray">(on ${A.origin} from ${r.source})</span>`,...r.args),this.handler(r)}}catch(e){f.error(e)}}},ie=t=>{let e=[...p.querySelectorAll("iframe[data-is-storybook]")],[o,...r]=e.filter(s=>{try{return s.contentWindow===t.source}catch{}let i=s.getAttribute("src"),a;try{({origin:a}=new URL(i,p.location))}catch{return!1}return a===t.origin});if(o&&r.length===0){let s=o.getAttribute("src"),{protocol:i,host:a,pathname:c}=new URL(s,p.location);return`${i}//${a}${c}`}return r.length>0&&f.error("found multiple candidates for event source"),null};function j({page:t}){let e=new ae({page:t});return new b({transport:e})}l();var q=h(k());var{WebSocket:ce}=q.default,N=class{constructor({url:e,onError:o}){this.socket=void 0,this.handler=void 0,this.buffer=[],this.isReady=!1,this.connect(e,o)}setHandler(e){this.handler=e}send(e){this.isReady?this.sendNow(e):this.sendLater(e)}sendLater(e){this.buffer.push(e)}sendNow(e){let o=u(e,{maxDepth:15,allowFunction:!0});this.socket.send(o)}flush(){let{buffer:e}=this;this.buffer=[],e.forEach(o=>this.send(o))}connect(e,o){this.socket=new ce(e),this.socket.onopen=()=>{this.isReady=!0,this.flush()},this.socket.onmessage=({data:r})=>{let s=typeof r=="string"&&g(r)?y(r):r;this.handler(s)},this.socket.onerror=r=>{o&&o(r)}}};function M({url:t,async:e=!1,onError:o=r=>f.warn(r)}){let r=new N({url:t,onError:o});return new b({transport:r,async:e})}l();var pe=h(oe()),fe=h(re());var W={react:pe,"react-dom":fe,"@storybook/components":K,"@storybook/channels":B,"@storybook/core-events":d,"@storybook/router":$,"@storybook/theming":I,"@storybook/api":D,"@storybook/addons":H,"@storybook/client-logger":L};var{FEATURES:me,SERVER_CHANNEL_URL:G}=E.default,T=class extends P{constructor(){super();let o=j({page:"manager"});if(w.setChannel(o),o.emit(x),this.addons=w,this.channel=o,me?.storyStoreV7&&G){let r=M({url:G});this.serverChannel=r,w.setServerChannel(this.serverChannel)}}getElements(o){return this.addons.getElements(o)}getConfig(){return this.addons.getConfig()}handleAPI(o){this.addons.loadAddons(o)}},{document:de}=E.default,ge=de.getElementById("root");Y(ge,new T);Object.keys(S).forEach(t=>{E.default[S[t]]=W[t]});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as t,d as r,e as i}from"./chunk-NISR2N5K.mjs";import"./chunk-MY4F7ORE.mjs";import"./chunk-T6P6F2SI.mjs";import"./chunk-Z7LX2X6E.mjs";import"./chunk-AIPH5HO4.mjs";import"./chunk-6XCSLWLC.mjs";import{g as o}from"./chunk-L2PAVIFR.mjs";o();export{r as SyntaxHighlighter,t as createCopyToClipboardFunction,i as default};
|
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@storybook/manager",
|
|
3
|
+
"version": "7.0.0-alpha.44",
|
|
4
|
+
"description": "Core Storybook UI",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"storybook"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/main/code/ui/manager",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/storybookjs/storybook/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/storybookjs/storybook.git",
|
|
15
|
+
"directory": "code/ui/manager"
|
|
16
|
+
},
|
|
17
|
+
"funding": {
|
|
18
|
+
"type": "opencollective",
|
|
19
|
+
"url": "https://opencollective.com/storybook"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"import": "./dist/index.mjs",
|
|
26
|
+
"types": "./dist/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./dist/runtime": {
|
|
29
|
+
"require": "./dist/runtime.js",
|
|
30
|
+
"import": "./dist/runtime.mjs",
|
|
31
|
+
"types": "./dist/runtime.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./dist/globals": {
|
|
34
|
+
"require": "./dist/globals.js",
|
|
35
|
+
"import": "./dist/globals.mjs",
|
|
36
|
+
"types": "./dist/globals.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./paths": "./paths.js",
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"main": "dist/index.js",
|
|
42
|
+
"module": "dist/index.mjs",
|
|
43
|
+
"types": "dist/index.d.ts",
|
|
44
|
+
"files": [
|
|
45
|
+
"dist/**/*",
|
|
46
|
+
"README.md",
|
|
47
|
+
"*.js",
|
|
48
|
+
"*.d.ts"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
|
|
52
|
+
"prep": "../../../scripts/prepare/bundle.ts"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
|
56
|
+
"@storybook/addons": "7.0.0-alpha.44",
|
|
57
|
+
"@storybook/api": "7.0.0-alpha.44",
|
|
58
|
+
"@storybook/channel-postmessage": "7.0.0-alpha.44",
|
|
59
|
+
"@storybook/channel-websocket": "7.0.0-alpha.44",
|
|
60
|
+
"@storybook/channels": "7.0.0-alpha.44",
|
|
61
|
+
"@storybook/client-logger": "7.0.0-alpha.44",
|
|
62
|
+
"@storybook/components": "7.0.0-alpha.44",
|
|
63
|
+
"@storybook/core-events": "7.0.0-alpha.44",
|
|
64
|
+
"@storybook/router": "7.0.0-alpha.44",
|
|
65
|
+
"@storybook/theming": "7.0.0-alpha.44",
|
|
66
|
+
"@storybook/types": "7.0.0-alpha.44",
|
|
67
|
+
"@testing-library/react": "^11.2.2",
|
|
68
|
+
"@types/semver": "^7.3.4",
|
|
69
|
+
"copy-to-clipboard": "^3.3.1",
|
|
70
|
+
"downshift": "^6.0.15",
|
|
71
|
+
"enzyme": "^3.11.0",
|
|
72
|
+
"fs-extra": "^9.0.1",
|
|
73
|
+
"fuse.js": "^3.6.1",
|
|
74
|
+
"global": "^4.4.0",
|
|
75
|
+
"lodash": "^4.17.21",
|
|
76
|
+
"markdown-to-jsx": "^7.1.3",
|
|
77
|
+
"memoizerific": "^1.11.3",
|
|
78
|
+
"polished": "^4.2.2",
|
|
79
|
+
"qs": "^6.10.0",
|
|
80
|
+
"react": "^16.8.0",
|
|
81
|
+
"react-dom": "^16.8.0",
|
|
82
|
+
"react-draggable": "^4.4.3",
|
|
83
|
+
"react-helmet-async": "^1.0.7",
|
|
84
|
+
"react-sizeme": "^3.0.1",
|
|
85
|
+
"resolve-from": "^5.0.0",
|
|
86
|
+
"semver": "^7.3.7",
|
|
87
|
+
"shelljs": "^0.8.5",
|
|
88
|
+
"store2": "^2.12.0",
|
|
89
|
+
"ts-dedent": "^2.0.0",
|
|
90
|
+
"typescript": "~4.6.3"
|
|
91
|
+
},
|
|
92
|
+
"publishConfig": {
|
|
93
|
+
"access": "public"
|
|
94
|
+
},
|
|
95
|
+
"bundler": {
|
|
96
|
+
"pre": "./scripts/generate-exports-file.ts",
|
|
97
|
+
"entries": [
|
|
98
|
+
"./src/index.tsx",
|
|
99
|
+
"./src/globals.ts",
|
|
100
|
+
"./src/runtime.ts"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"gitHead": "d4965bd328d8f83c279560c7bc8428e490b275f3"
|
|
104
|
+
}
|
package/paths.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { dirname } = require('path');
|
|
2
|
+
const resolveFrom = require('resolve-from');
|
|
3
|
+
|
|
4
|
+
const resolve = resolveFrom.bind(null, __dirname);
|
|
5
|
+
|
|
6
|
+
// These paths need to be aliased in the manager webpack config to ensure that all
|
|
7
|
+
// code running inside the manager uses the *same* version of react[-dom] that we use.
|
|
8
|
+
module.exports = {
|
|
9
|
+
'@storybook/addons': dirname(resolve('@storybook/addons/package.json')),
|
|
10
|
+
'@storybook/api': dirname(resolve('@storybook/api/package.json')),
|
|
11
|
+
'@storybook/channels': dirname(resolve('@storybook/channels/package.json')),
|
|
12
|
+
'@storybook/components': dirname(resolve('@storybook/components/package.json')),
|
|
13
|
+
'@storybook/core-events': dirname(resolve('@storybook/core-events/package.json')),
|
|
14
|
+
'@storybook/router': dirname(resolve('@storybook/router/package.json')),
|
|
15
|
+
'@storybook/theming': dirname(resolve('@storybook/theming/package.json')),
|
|
16
|
+
'@storybook/manager': dirname(resolve('@storybook/manager/package.json')),
|
|
17
|
+
react: dirname(resolve('react/package.json')),
|
|
18
|
+
'react-dom': dirname(resolve('react-dom/package.json')),
|
|
19
|
+
};
|