-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fallback to use corresponding new packages for storybook version 8
- Loading branch information
1 parent
f104e77
commit 365331c
Showing
4 changed files
with
58 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
import { addons } from '@storybook/addons'; | ||
import type { Addons } from '@storybook/addons'; | ||
|
||
let addons: Addons | undefined; | ||
try { | ||
addons = require('@storybook/addons').addons; | ||
} catch {} | ||
try { | ||
addons = require('@storybook/manager-api').addons; | ||
} catch {} | ||
|
||
(window as any).__STORYCAP_MANAGED_MODE_REGISTERED__ = true; | ||
|
||
addons.register('storycap', () => { | ||
// nothing to do | ||
}); | ||
addons && | ||
addons.register('storycap', () => { | ||
// nothing to do | ||
}); |
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