mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
fixes
This commit is contained in:
parent
301af1c18f
commit
88ab1a2381
@ -19,7 +19,6 @@ import { DocsContext } from '@storybook/blocks';
|
||||
import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport';
|
||||
|
||||
import { DocsPageWrapper } from '../lib/blocks/src/components';
|
||||
import type { GlobalTypes } from '@storybook/csf';
|
||||
|
||||
const { document } = global;
|
||||
|
||||
@ -313,25 +312,8 @@ export const parameters = {
|
||||
},
|
||||
};
|
||||
|
||||
// export const globalTypes = {
|
||||
// viewport: {
|
||||
// options: MINIMAL_VIEWPORTS,
|
||||
// },
|
||||
// backgrounds: {
|
||||
// options: {
|
||||
// light: { name: 'light', value: '#f7f7f7' },
|
||||
// dark: { name: 'dark', value: '#333' },
|
||||
// },
|
||||
// grid: {
|
||||
// cellSize: 15,
|
||||
// cellAmount: 10,
|
||||
// opacity: 0.8,
|
||||
// },
|
||||
// },
|
||||
// } satisfies GlobalTypes;
|
||||
|
||||
export const initialGlobals = {
|
||||
// theme: 'light',
|
||||
// viewport: { value: 'mobile1', isRotated: false },
|
||||
// backgrounds: { value: 'dark', grid: false },
|
||||
} as const;
|
||||
// export const initialGlobals = {
|
||||
// theme: 'light',
|
||||
// viewport: { value: 'mobile1', isRotated: false },
|
||||
// backgrounds: { value: 'dark', grid: false },
|
||||
// } as const;
|
||||
|
@ -1,49 +1,41 @@
|
||||
import type { Addon_DecoratorFunction } from 'storybook/internal/types';
|
||||
import { withBackground } from './legacy/withBackgroundLegacy';
|
||||
import { withGrid } from './legacy/withGridLegacy';
|
||||
import { PARAM_KEY } from './constants';
|
||||
import { PARAM_KEY as KEY } from './constants';
|
||||
import { withBackgroundAndGrid } from './decorator';
|
||||
|
||||
export const decorators: Addon_DecoratorFunction[] = FEATURES?.backgroundsStoryGlobals
|
||||
? [withBackgroundAndGrid]
|
||||
: [withGrid, withBackground];
|
||||
|
||||
// TODO: remove in 9.0
|
||||
export const parameters = {
|
||||
[PARAM_KEY]: {
|
||||
[KEY]: {
|
||||
grid: {
|
||||
cellSize: 20,
|
||||
opacity: 0.5,
|
||||
cellAmount: 5,
|
||||
},
|
||||
values: [
|
||||
{ name: 'light', value: '#F8F8F8' },
|
||||
{ name: 'dark', value: '#333333' },
|
||||
],
|
||||
...(FEATURES?.backgroundsStoryGlobals
|
||||
? {
|
||||
options: {
|
||||
light: { name: 'light', value: '#F8F8F8' },
|
||||
dark: { name: 'dark', value: '#333' },
|
||||
},
|
||||
}
|
||||
: {
|
||||
// TODO: remove in 9.0
|
||||
values: [
|
||||
{ name: 'light', value: '#F8F8F8' },
|
||||
{ name: 'dark', value: '#333333' },
|
||||
],
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
// // TODO: remove feature flag in 9.0
|
||||
// export const globalTypes = FEATURES?.backgroundsStoryGlobals
|
||||
// ? {
|
||||
// [PARAM_KEY]: {
|
||||
// grid: {
|
||||
// cellSize: 20,
|
||||
// opacity: 0.5,
|
||||
// cellAmount: 5,
|
||||
// },
|
||||
// values: [
|
||||
// { name: 'light', value: '#F8F8F8' },
|
||||
// { name: 'dark', value: '#333333' },
|
||||
// ],
|
||||
// },
|
||||
// }
|
||||
// : {};
|
||||
|
||||
export const globalTypes = {
|
||||
[PARAM_KEY]: {},
|
||||
[KEY]: {},
|
||||
};
|
||||
|
||||
export const initialGlobals = {
|
||||
[PARAM_KEY]: null as any,
|
||||
[KEY]: null as any,
|
||||
};
|
||||
|
1
code/addons/backgrounds/src/typings.d.ts
vendored
Normal file
1
code/addons/backgrounds/src/typings.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features'];
|
@ -69,7 +69,6 @@
|
||||
},
|
||||
"bundler": {
|
||||
"exportEntries": [
|
||||
"./src/models/index.ts",
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user