mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
chore: move setCustomElements to app web-components
This commit is contained in:
parent
d07adbbfb4
commit
77b33cd184
@ -1,7 +1,7 @@
|
||||
/* global window */
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import { addParameters } from '@storybook/client-api';
|
||||
import { getCustomElements } from './customElements';
|
||||
import { getCustomElements } from '@storybook/web-components';
|
||||
|
||||
function mapData(data) {
|
||||
return data.map(item => ({
|
||||
|
@ -1,15 +0,0 @@
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
/* global window */
|
||||
|
||||
/**
|
||||
* @param customElements any for now as spec is not super stable yet
|
||||
*/
|
||||
export function setCustomElements(customElements: any) {
|
||||
// @ts-ignore
|
||||
window.__STORYBOOK_CUSTOM_ELEMENTS__ = customElements;
|
||||
}
|
||||
|
||||
export function getCustomElements() {
|
||||
// @ts-ignore
|
||||
return window.__STORYBOOK_CUSTOM_ELEMENTS__;
|
||||
}
|
@ -1 +0,0 @@
|
||||
export { setCustomElements, getCustomElements } from './frameworks/web-components/customElements';
|
@ -7,7 +7,7 @@
|
||||
- Add to your `.storybook/config.js`
|
||||
|
||||
```js
|
||||
import { setCustomElements } from '@storybook/addon-docs';
|
||||
import { setCustomElements } from '@storybook/web-components';
|
||||
import customElements from '../custom-elements.json';
|
||||
|
||||
setCustomElements(customElements);
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
/* global window */
|
||||
|
||||
export {
|
||||
storiesOf,
|
||||
setAddon,
|
||||
@ -9,6 +12,19 @@ export {
|
||||
raw,
|
||||
} from './preview';
|
||||
|
||||
/**
|
||||
* @param customElements any for now as spec is not super stable yet
|
||||
*/
|
||||
export function setCustomElements(customElements: any) {
|
||||
// @ts-ignore
|
||||
window.__STORYBOOK_CUSTOM_ELEMENTS__ = customElements;
|
||||
}
|
||||
|
||||
export function getCustomElements() {
|
||||
// @ts-ignore
|
||||
return window.__STORYBOOK_CUSTOM_ELEMENTS__;
|
||||
}
|
||||
|
||||
if (module && module.hot && module.hot.decline) {
|
||||
module.hot.decline();
|
||||
}
|
||||
|
@ -1,8 +1,12 @@
|
||||
/* global window */
|
||||
|
||||
import { configure, addParameters, addDecorator } from '@storybook/web-components';
|
||||
import {
|
||||
configure,
|
||||
addParameters,
|
||||
addDecorator,
|
||||
setCustomElements,
|
||||
} from '@storybook/web-components';
|
||||
import { withA11y } from '@storybook/addon-a11y';
|
||||
import { setCustomElements } from '@storybook/addon-docs';
|
||||
|
||||
import customElements from '../custom-elements.json';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user