Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 10.1.11

- React: Fix several CSF factory bugs - [#33354](https://github.com/storybookjs/storybook/pull/33354), thanks @kasperpeulen!
- UI: Fix React error 300 on some addons - [#33381](https://github.com/storybookjs/storybook/pull/33381), thanks @Sidnioulz!

## 10.1.10

- Core: Fix `.env`-file parsing - [#33383](https://github.com/storybookjs/storybook/pull/33383), thanks @JReinhold!
Expand Down Expand Up @@ -297,10 +302,6 @@ It also includes features to level up your UI development, documentation, and te

</details>

## 9.1.17

- Core: Fix .env-file parsing, thanks @jreinhold!

## 9.1.16

- CLI: Fix Nextjs project creation in empty directories - [#32828](https://github.com/storybookjs/storybook/pull/32828), thanks @yannbf!
Expand Down Expand Up @@ -846,10 +847,6 @@ Unique contributors: 29

</details>

## 8.6.15

- Core: Fix .env-file parsing, thanks @jreinhold!

## 8.6.14

- CLI: Add skip onboarding, recommended/minimal config - [#30930](https://github.com/storybookjs/storybook/pull/30930), thanks @shilman!
Expand Down Expand Up @@ -1827,10 +1824,6 @@ It brings major improvements to Storybook's feature set for testing and document

Please checkout our [Migration Guide](https://storybook.js.org/docs/8.0/migration-guide) to upgrade from earlier versions of Storybook. To see a comprehensive list of changes that went into 8.0, you can refer to the [8.0 prerelease changelogs](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.prerelease.md).

## 7.6.21

- Core: Fix .env-file parsing, thanks @jreinhold!

## 7.6.17

- Addon-docs: Fix Table of Contents heading leak - [#23677](https://github.com/storybookjs/storybook/pull/23677), thanks [@vmizg](https://github.com/vmizg)!
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 10.2.0-alpha.11

- Core: Add try-catch for cross-origin access in Storybook hooks - [#33448](https://github.com/storybookjs/storybook/pull/33448), thanks @ndelangen!
- UI: Keep preview frame stable in overall layout - [#33447](https://github.com/storybookjs/storybook/pull/33447), thanks @Sidnioulz!

## 10.2.0-alpha.10

- Dependencies: Bump various packages - [#33412](https://github.com/storybookjs/storybook/pull/33412), thanks @ndelangen!
Expand Down
44 changes: 20 additions & 24 deletions code/core/src/manager/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,39 +169,35 @@ export const Layout = ({ managerLayoutState, setManagerLayoutState, hasTab, ...s
showPanel={showPanel}
>
{showPages && <PagesContainer>{slots.slotPages}</PagesContainer>}
{isDesktop && (
<>
<>
{isDesktop && (
<SidebarContainer>
<Drag ref={sidebarResizerRef} />
{slots.slotSidebar}
</SidebarContainer>

<MainContentMatcher>{slots.slotMain}</MainContentMatcher>

{showPanel && (
<PanelContainer position={panelPosition}>
<Drag
orientation={panelPosition === 'bottom' ? 'horizontal' : 'vertical'}
position={panelPosition === 'bottom' ? 'left' : 'right'}
ref={panelResizerRef}
/>
{slots.slotPanel}
</PanelContainer>
)}
</>
)}

{isMobile && (
<>
)}
{isMobile && (
<OrderedMobileNavigation
menu={slots.slotSidebar}
panel={slots.slotPanel}
showPanel={showPanel}
/>
<MainContentMatcher>{slots.slotMain}</MainContentMatcher>
<Notifications />
</>
)}
)}

<MainContentMatcher>{slots.slotMain}</MainContentMatcher>

{isDesktop && showPanel && (
<PanelContainer position={panelPosition}>
<Drag
orientation={panelPosition === 'bottom' ? 'horizontal' : 'vertical'}
position={panelPosition === 'bottom' ? 'left' : 'right'}
ref={panelResizerRef}
/>
{slots.slotPanel}
</PanelContainer>
)}
{isMobile && <Notifications />}
</>
</LayoutContainer>
);
};
Expand Down
29 changes: 22 additions & 7 deletions code/core/template/stories/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,30 @@ declare global {
}
}

// This is used to test the hooks in our E2E tests (look for storybook-hooks.spec.ts)
globalThis.parent.__STORYBOOK_BEFORE_ALL_CALLS__ = 0;
globalThis.parent.__STORYBOOK_BEFORE_ALL_CLEANUP_CALLS__ = 0;
try {
// This is used to test the hooks in our E2E tests (look for storybook-hooks.spec.ts)

/**
* Wrapped in a try-catch, because accessing properties on globalThis.parent may throw if the
* parent is cross-origin.
*/
globalThis.parent.__STORYBOOK_BEFORE_ALL_CALLS__ = 0;
globalThis.parent.__STORYBOOK_BEFORE_ALL_CLEANUP_CALLS__ = 0;
} catch {
// ignore
}

export const beforeAll = async () => {
globalThis.parent.__STORYBOOK_BEFORE_ALL_CALLS__ += 1;
return () => {
globalThis.parent.__STORYBOOK_BEFORE_ALL_CLEANUP_CALLS__ += 1;
};
let cleanup: () => void = () => {};
try {
globalThis.parent.__STORYBOOK_BEFORE_ALL_CALLS__ += 1;
cleanup = () => {
globalThis.parent.__STORYBOOK_BEFORE_ALL_CLEANUP_CALLS__ += 1;
};
} catch {
// ignore
}
return cleanup;
};

export const parameters = {
Expand Down
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "10.2.0-alpha.11"
}
6 changes: 5 additions & 1 deletion docs/api/main-config/main-config-static-dirs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Sets a list of directories of [static files](../../configure/integration/images-

{/* prettier-ignore-end */}

<Callout variant="info">
When using Vite-based frameworks, additional directories may be copied to your build directory because of Vite's own [static asset handling](https://vite.dev/guide/assets#the-public-directory). You can set Vite's `publicDir` option to `false` to disable this behavior.
</Callout>

## With configuration objects

You can also use a configuration object to define the directories:
Expand All @@ -25,4 +29,4 @@ You can also use a configuration object to define the directories:

<CodeSnippets path="main-config-static-dirs-with-object.md" />

{/* prettier-ignore-end */}
{/* prettier-ignore-end */}
4 changes: 4 additions & 0 deletions docs/configure/integration/images-and-assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ Or even use a configuration object to define the directories:

{/* prettier-ignore-end */}

<Callout variant="info">
When using Vite-based frameworks, additional directories may be copied to your build directory because of Vite's own [static asset handling](https://vite.dev/guide/assets#the-public-directory). You can set Vite's `publicDir` option to `false` to disable this behavior.
</Callout>

## Reference assets from a CDN

Upload your files to an online CDN and reference them. In this example, we’re using a placeholder image service.
Expand Down
13 changes: 13 additions & 0 deletions docs/contribute/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ Otherwise, if it affects the `Manager` (the outermost Storybook `iframe` where t

![Storybook manager preview](../_assets/addons/manager-preview.png)

The `yarn build` commands accepts arguments to help speed up your development workflow:
* `--all` will cause all packages to be built
* `--watch` will enable watch mode (and skip the watch mode prompt)
* `--prod` will build for production (and skip the production mode prompt)
* individual package names can be passed, without the `@storybook/` prefix, e.g. `storybook`, `addon-docs`, etc.

For example, to build Storybook and the docs addon in watch mode, run:

```shell
yarn build --watch storybook addon-docs
```


## Check your work

When you're done coding, add documentation and tests as appropriate. That simplifies the PR review process, which means your code will get merged faster.
Expand Down
2 changes: 1 addition & 1 deletion docs/versions/next.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"10.2.0-alpha.10","info":{"plain":"- Dependencies: Bump various packages - [#33412](https://github.com/storybookjs/storybook/pull/33412), thanks @ndelangen!\n- Interactions: Add disable parameter for interactions panel - [#33368](https://github.com/storybookjs/storybook/pull/33368), thanks @jeevikar14!\n- Interactions: Fix state reset bug when switching stories with date mocks - [#33388](https://github.com/storybookjs/storybook/pull/33388), thanks @Sidnioulz!\n- Manifests: Refactor from `componentManifestGenerator` to extensible `manifests` preset property - [#33392](https://github.com/storybookjs/storybook/pull/33392), thanks @JReinhold!\n- Manifests: Support `!manifest` tag in preview files - [#33406](https://github.com/storybookjs/storybook/pull/33406), thanks @JReinhold!\n- NextJS: Import `next/dist` with `.js`-extension for ESM compat - [#33380](https://github.com/storybookjs/storybook/pull/33380), thanks @yue4u!\n- Preview: Treat canceled animations as finished - [#32401](https://github.com/storybookjs/storybook/pull/32401), thanks @bawjensen!\n- UI: Ensure consistent right padding in TreeNode - [#33322](https://github.com/storybookjs/storybook/pull/33322), thanks @Sidnioulz!\n- UI: Fix React error 300 on some addons - [#33381](https://github.com/storybookjs/storybook/pull/33381), thanks @Sidnioulz!\n- UI: Prevent primary story from duplicating anchor ID - [#33384](https://github.com/storybookjs/storybook/pull/33384), thanks @Sidnioulz!\n- Upgrade: Preserve package.json indentation when upgrading - [#32280](https://github.com/storybookjs/storybook/pull/32280), thanks @y-hsgw!\n- Vitest: Fallback detecting vitest version in postinstall - [#33415](https://github.com/storybookjs/storybook/pull/33415), thanks @ndelangen!"}}
{"version":"10.2.0-alpha.11","info":{"plain":"- Core: Add try-catch for cross-origin access in Storybook hooks - [#33448](https://github.com/storybookjs/storybook/pull/33448), thanks @ndelangen!\n- UI: Keep preview frame stable in overall layout - [#33447](https://github.com/storybookjs/storybook/pull/33447), thanks @Sidnioulz!"}}
Loading
Loading