-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: synchronize manage/preview legacy mode
- Loading branch information
1 parent
d01851e
commit 4fc7de3
Showing
26 changed files
with
225 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,5 +65,6 @@ | |
}, | ||
"authors": [ | ||
"Atanas Stoyanov" | ||
] | ||
], | ||
"gitHead": "d01851e6b244a4e04dd5eed1146bffb5cceb3e5a" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { addDecorator, addParameters, useEffect } from '@storybook/client-api'; | ||
import { __STORYBOOK_STORY_STORE__ as storyStore } from 'global'; | ||
import addons, { makeDecorator } from '@storybook/addons'; | ||
import { FORCE_RE_RENDER } from '@storybook/core-events'; | ||
|
||
import { SET_DATA_MSG } from './shared/shared'; | ||
|
||
addDecorator( | ||
makeDecorator({ | ||
name: 'legacyControls', | ||
parameterName: 'controls', | ||
wrapper: (storyFn, context) => { | ||
const channel = addons.getChannel(); | ||
useEffect(() => { | ||
const onNewData = ({ storyId, controls }) => { | ||
const story = storyStore._data[storyId]; | ||
if (story) { | ||
story.parameters.controls = controls; | ||
} | ||
channel.emit(FORCE_RE_RENDER); | ||
}; | ||
channel.on(SET_DATA_MSG, onNewData); | ||
return () => { | ||
channel.removeListener(SET_DATA_MSG, onNewData); | ||
}; | ||
}, []); | ||
return storyFn(context); | ||
}, | ||
}), | ||
); | ||
|
||
addParameters({ | ||
controls: { | ||
legacy: true, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { extractSmartControls } from './smartControls'; | ||
export * from './blocks'; | ||
export { ThemeProvider } from './shared/ThemeProvider'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.