Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Preminor alpha 7.3.0-alpha.0 #23794

Merged
merged 28 commits into from
Aug 11, 2023
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
615db42
Don't assign values to all slots (rollback to v7.0.27)
kasperpeulen Aug 3, 2023
35f1766
Merge branch 'next' into kasper/vue3-slots
kasperpeulen Aug 3, 2023
bb06edf
Merge branch 'next' into kasper/vue3-slots
kasperpeulen Aug 3, 2023
1582887
Merge branch 'next' into kasper/vue3-slots
kasperpeulen Aug 4, 2023
7d4f4a4
Merge branch 'next' into kasper/vue3-slots
kasperpeulen Aug 7, 2023
a1406c7
Update CHANGELOG.md for v7.2.2 [skip ci]
storybook-bot Aug 9, 2023
354d1ba
Merge branch 'next-release' into next
storybook-bot Aug 10, 2023
d89dee3
Update postinstall to look for addon script
Aug 10, 2023
d4ca02a
Deprecate key in addon render function as it is not available anymore
kasperpeulen Aug 10, 2023
9550c42
Fix TS checks
kasperpeulen Aug 10, 2023
0eaaa8c
Merge pull request #23792 from storybookjs/kasper/bug-23782
kasperpeulen Aug 10, 2023
910b671
Improve Icon component
cdedreuille Aug 10, 2023
d964d59
Added the new Toolbar component
cdedreuille Aug 10, 2023
b157376
Don't log when there is no postinstall script
Aug 10, 2023
c75a8fc
Adds more video coverage to the documentation
jonniebigodes Aug 10, 2023
601e902
Moves video up and callout
jonniebigodes Aug 10, 2023
af906e2
Merge pull request #23797 from storybookjs/chore_docs_adds_videos
jonniebigodes Aug 10, 2023
19d26cc
Merge pull request #23791 from storybookjs/shaun/new-add-cmd
shilman Aug 11, 2023
df451e7
Fix Safari bug with static keyword
kasperpeulen Aug 11, 2023
c936edc
Support Safari 15, Firefox 91 and Chrome 100
kasperpeulen Aug 11, 2023
8d8fc73
Merge pull request #23800 from storybookjs/kasper/fix-safari-static
kasperpeulen Aug 11, 2023
3ba0d68
Update CHANGELOG.md for v7.2.3 [skip ci]
storybook-bot Aug 11, 2023
ae80dc4
Merge pull request #23795 from storybookjs/charles-ui-updates
cdedreuille Aug 11, 2023
0dcbaed
Upgrade Addon Design
cdedreuille Aug 11, 2023
8413307
Merge branch 'next' into kasper/vue3-slots
kasperpeulen Aug 11, 2023
8e6cfb4
Merge pull request #23806 from storybookjs/charles-upgrade-addon-design
cdedreuille Aug 11, 2023
f158786
Merge pull request #23697 from storybookjs/kasper/vue3-slots
kasperpeulen Aug 11, 2023
d9ee3e5
Write changelog for 7.3.0-alpha.0
storybook-bot Aug 11, 2023
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
Next Next commit
Don't assign values to all slots (rollback to v7.0.27)
  • Loading branch information
kasperpeulen committed Aug 3, 2023
commit 615db423a000e7c59f186bb2c72a347c9ed51dcd
22 changes: 8 additions & 14 deletions code/renderers/vue3/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { App } from 'vue';
import { createApp, h, reactive, isVNode, isReactive } from 'vue';
import type { ArgsStoryFn, RenderContext } from '@storybook/types';
import type { Args, StoryContext } from '@storybook/csf';

import type { StoryFnVueReturnType, StoryID, VueRenderer } from './types';

export const render: ArgsStoryFn<VueRenderer> = (props, context) => {
Expand All @@ -14,7 +13,7 @@ export const render: ArgsStoryFn<VueRenderer> = (props, context) => {
);
}

return () => h(Component, props, generateSlots(context));
return () => h(Component, props, getSlots(props, context));
};

// set of setup functions that will be called when story is created
Expand All @@ -36,7 +35,6 @@ const map = new Map<
{
vueApp: ReturnType<typeof createApp>;
reactiveArgs: Args;
reactiveSlots?: Args;
}
>();

Expand Down Expand Up @@ -93,20 +91,16 @@ export function renderToCanvas(

/**
* generate slots for default story without render function template
* @param context
*/

function generateSlots(context: StoryContext<VueRenderer, Args>) {
function getSlots(props: Args, context: StoryContext<VueRenderer, Args>) {
const { argTypes } = context;
const slots = Object.entries(argTypes)
.filter(([key, value]) => argTypes[key]?.table?.category === 'slots')
.map(([key, value]) => {
const slotValue = context.args[key];
return [key, typeof slotValue === 'function' ? slotValue : () => slotValue];
});

return reactive(Object.fromEntries(slots));
const slots = Object.entries(props)
.filter(([key]) => argTypes[key]?.table?.category === 'slots')
.map(([key, value]) => [key, typeof value === 'function' ? value : () => value]);

return Object.fromEntries(slots);
}

/**
* get the args from the root element props if it is a vnode otherwise from the context
* @param element is the root element of the story
Expand Down
Loading