mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 05:51:21 +08:00
remove dead code
This commit is contained in:
parent
5d85cc6744
commit
c80f4079f9
@ -1 +0,0 @@
|
|||||||
import 'regenerator-runtime/runtime';
|
|
@ -1 +1,5 @@
|
|||||||
export * from './preview';
|
import { ClientApi } from '@storybook/client-api';
|
||||||
|
import { StoryStore } from '@storybook/store';
|
||||||
|
import { start } from './start';
|
||||||
|
|
||||||
|
export { start, ClientApi, StoryStore };
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
import global from 'global';
|
|
||||||
import { renderStorybookUI } from '@storybook/manager';
|
|
||||||
|
|
||||||
import Provider from './provider';
|
|
||||||
|
|
||||||
const { document } = global;
|
|
||||||
|
|
||||||
// We need to wait a promise "tick" to allow all subsequent addons etc to execute
|
|
||||||
// (alternatively, we could ensure this entry point is always loaded last)
|
|
||||||
Promise.resolve().then(() => {
|
|
||||||
const rootEl = document.getElementById('root');
|
|
||||||
renderStorybookUI(rootEl, new Provider());
|
|
||||||
});
|
|
@ -1,48 +0,0 @@
|
|||||||
import global from 'global';
|
|
||||||
import { Provider } from '@storybook/manager';
|
|
||||||
import { Channel } from '@storybook/channels';
|
|
||||||
import type { Addon_Types, Addon_Config } from '@storybook/types';
|
|
||||||
import { addons, AddonStore } from '@storybook/addons';
|
|
||||||
import * as postMessage from '@storybook/channel-postmessage';
|
|
||||||
import * as webSocket from '@storybook/channel-websocket';
|
|
||||||
import { CHANNEL_CREATED } from '@storybook/core-events';
|
|
||||||
|
|
||||||
const { FEATURES, SERVER_CHANNEL_URL } = global;
|
|
||||||
|
|
||||||
export default class ReactProvider extends Provider {
|
|
||||||
private addons: AddonStore;
|
|
||||||
|
|
||||||
private channel: Channel;
|
|
||||||
|
|
||||||
private serverChannel?: Channel;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
const channel = postMessage.createChannel({ page: 'manager' });
|
|
||||||
|
|
||||||
addons.setChannel(channel);
|
|
||||||
channel.emit(CHANNEL_CREATED);
|
|
||||||
|
|
||||||
this.addons = addons;
|
|
||||||
this.channel = channel;
|
|
||||||
|
|
||||||
if (FEATURES?.storyStoreV7 && SERVER_CHANNEL_URL) {
|
|
||||||
const serverChannel = webSocket.createChannel({ url: SERVER_CHANNEL_URL });
|
|
||||||
this.serverChannel = serverChannel;
|
|
||||||
addons.setServerChannel(this.serverChannel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getElements(type: Addon_Types) {
|
|
||||||
return this.addons.getElements(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
getConfig(): Addon_Config {
|
|
||||||
return this.addons.getConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
handleAPI(api: unknown) {
|
|
||||||
this.addons.loadAddons(api);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
import { ClientApi } from '@storybook/client-api';
|
|
||||||
import { StoryStore } from '@storybook/store';
|
|
||||||
import { start } from './start';
|
|
||||||
|
|
||||||
export { start, ClientApi, StoryStore };
|
|
Loading…
x
Reference in New Issue
Block a user