Skip to content

Commit

Permalink
Convert addon globals to initialGlobals
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Jun 11, 2024
1 parent 5a11ab1 commit 32224e4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/addons/backgrounds/src/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export const parameters = {
},
};

export const globals = {
export const initialGlobals = {
[PARAM_KEY]: null as any,
};
2 changes: 1 addition & 1 deletion code/addons/measure/src/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { PARAM_KEY } from './constants';

export const decorators: Addon_DecoratorFunction[] = [withMeasure];

export const globals = {
export const initialGlobals = {
[PARAM_KEY]: false,
};
2 changes: 1 addition & 1 deletion code/addons/outline/src/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { PARAM_KEY } from './constants';

export const decorators: Addon_DecoratorFunction[] = [withOutline];

export const globals = {
export const initialGlobals = {
[PARAM_KEY]: false,
};
2 changes: 1 addition & 1 deletion code/addons/viewport/src/preview.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const globals = { viewport: 'reset', viewportRotated: false };
export const initialGlobals = { viewport: 'reset', viewportRotated: false };
2 changes: 1 addition & 1 deletion code/addons/viewport/src/shortcuts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type API } from '@storybook/manager-api';
import { ADDON_ID } from './constants';
import { globals as defaultGlobals } from './preview';
import { initialGlobals as defaultGlobals } from './preview';

const getCurrentViewportIndex = (viewportsKeys: string[], current: string): number =>
viewportsKeys.indexOf(current);
Expand Down
2 changes: 1 addition & 1 deletion code/lib/preview-api/template/stories/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const decorators = [
},
];

export const globals = {
export const initialGlobals = {
foo: 'fooValue',
};

Expand Down

0 comments on commit 32224e4

Please sign in to comment.