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
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"./src/postinstall.ts"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16",
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684",
"storybook": {
"displayName": "Accessibility",
"icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"./src/manager.tsx"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16",
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684",
"storybook": {
"displayName": "Docs",
"icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export class JsonArray extends Component<JsonArrayProps, JsonArrayState> {
onClick: handleRemove,
className: 'rejt-minus-menu',
style: minus,
'aria-label': `remove the array '${name}'`,
'aria-label': `remove the array '${String(name)}'`,
});

return (
Expand Down Expand Up @@ -379,15 +379,15 @@ export class JsonArray extends Component<JsonArrayProps, JsonArrayState> {
onClick: this.handleAddMode,
className: 'rejt-plus-menu',
style: plus,
'aria-label': `add a new item to the '${name}' array`,
'aria-label': `add a new item to the '${String(name)}' array`,
});
const removeItemButton =
minusMenuElement &&
cloneElement(minusMenuElement, {
onClick: handleRemove,
className: 'rejt-minus-menu',
style: minus,
'aria-label': `remove the array '${name}'`,
'aria-label': `remove the array '${String(name)}'`,
});

const onlyValue = true;
Expand Down Expand Up @@ -670,8 +670,8 @@ export class JsonFunctionValue extends Component<JsonFunctionValueProps, JsonFun
onClick: handleRemove,
className: 'rejt-minus-menu',
style: style.minus,
'aria-label': `remove the function '${name}'${
parentPropertyName ? ` from '${parentPropertyName}'` : ''
'aria-label': `remove the function '${String(name)}'${
String(parentPropertyName) ? ` from '${String(parentPropertyName)}'` : ''
}`,
});
minusElement = resultOnlyResult ? null : minusMenuLayout;
Expand Down Expand Up @@ -1222,7 +1222,7 @@ export class JsonObject extends Component<JsonObjectProps, JsonObjectState> {
onClick: handleRemove,
className: 'rejt-minus-menu',
style: minus,
'aria-label': `remove the object '${name}'`,
'aria-label': `remove the object '${String(name)}'`,
});

return (
Expand Down Expand Up @@ -1268,15 +1268,15 @@ export class JsonObject extends Component<JsonObjectProps, JsonObjectState> {
onClick: this.handleAddMode,
className: 'rejt-plus-menu',
style: plus,
'aria-label': `add a new property to the object '${name}'`,
'aria-label': `add a new property to the object '${String(name)}'`,
});
const removeItemButton =
minusMenuElement &&
cloneElement(minusMenuElement, {
onClick: handleRemove,
className: 'rejt-minus-menu',
style: minus,
'aria-label': `remove the object '${name}'`,
'aria-label': `remove the object '${String(name)}'`,
});

const list = keyList.map((key) => (
Expand Down Expand Up @@ -1540,8 +1540,8 @@ export class JsonValue extends Component<JsonValueProps, JsonValueState> {
onClick: handleRemove,
className: 'rejt-minus-menu',
style: style.minus,
'aria-label': `remove the property '${name}' with value '${originalValue}'${
parentPropertyName ? ` from '${parentPropertyName}'` : ''
'aria-label': `remove the property '${String(name)}' with value '${String(originalValue)}'${
String(parentPropertyName) ? ` from '${String(parentPropertyName)}'` : ''
}`,
});

Expand Down
2 changes: 1 addition & 1 deletion code/addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"./src/manager.tsx"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16",
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684",
"storybook": {
"displayName": "Jest",
"icon": "https://pbs.twimg.com/profile_images/821713465245102080/mMtKIMax_400x400.jpg",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
],
"post": "./scripts/fix-preview-api-reference.ts"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16",
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684",
"storybook": {
"displayName": "Links",
"icon": "https://user-images.githubusercontent.com/263385/101991673-48355c80-3c7c-11eb-9b6e-b627c96a75f6.png",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"./src/preview.tsx"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16",
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684",
"storybook": {
"displayName": "Themes",
"unsupportedFrameworks": [
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
13 changes: 12 additions & 1 deletion code/e2e-tests/addon-controls.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test';
import process from 'process';

import { SbPage } from './util';
import { SbPage, isReactSandbox } from './util';

const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';
const templateName = process.env.STORYBOOK_TEMPLATE_NAME || '';
Expand Down Expand Up @@ -103,4 +103,15 @@ test.describe('addon-controls', () => {

await expect(page).toHaveURL(/.*multiSelect\[0]:double\+\+space.*/);
});

// We want to avoid the controls panel crashing when JSX elements are part of args table
test('should show JSX elements in controls panel', async ({ page }) => {
test.skip(!isReactSandbox(templateName), 'This is a React only feature');
await page.goto(`${storybookUrl}?path=/story/stories-renderers-react-jsx-docgen--default`);

const sbPage = new SbPage(page, expect);
await sbPage.waitUntilLoaded();
await sbPage.viewAddonPanel('Controls');
await expect(sbPage.panelContent().getByText('children').first()).toBeVisible();
});
});
12 changes: 11 additions & 1 deletion code/e2e-tests/addon-docs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect, test } from '@playwright/test';
import process from 'process';
import { dedent } from 'ts-dedent';

import { SbPage } from './util';
import { SbPage, isReactSandbox } from './util';

const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';
const templateName = process.env.STORYBOOK_TEMPLATE_NAME || '';
Expand Down Expand Up @@ -280,4 +280,14 @@ test.describe('addon-docs', () => {
'H 2 Content',
]);
});

// We want to avoid the docs page crashing when JSX elements are part of args table
test('should show JSX elements in docs page', async ({ page }) => {
test.skip(!isReactSandbox(templateName), 'This is a React only feature');

const sbPage = new SbPage(page, expect);
await sbPage.navigateToStory('/stories/renderers/react/jsx-docgen', 'docs');
const root = sbPage.previewRoot();
await expect(root.getByText('children').first()).toBeVisible();
});
});
4 changes: 4 additions & 0 deletions code/e2e-tests/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ export class SbPage {
const templateName: keyof typeof allTemplates = process.env.STORYBOOK_TEMPLATE_NAME || ('' as any);

const templates = allTemplates;

export const isReactSandbox = (templateName: string) =>
templates[templateName as keyof typeof templates]?.expected.renderer === '@storybook/react';

export const hasVitestIntegration =
!templates[templateName]?.skipTasks?.includes('vitest-integration');

Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,5 @@
"./src/builders/build-storybook/index.ts"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
"access": "public"
},
"bundler": {},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/html-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/nextjs-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/preact-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/react-native-web-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/react-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/server-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/svelte-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/vue3-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/frameworks/web-components-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/lib/cli-sb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/lib/cli-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/lib/codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@
"cjs"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/lib/core-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/lib/create-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@
],
"types": false
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/lib/csf-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/lib/react-dom-shim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@
"./src/react-18.tsx"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/presets/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
"cjs"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/presets/react-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/presets/server-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@
],
"platform": "node"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/renderers/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@
],
"platform": "browser"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/renderers/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@
],
"platform": "browser"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
2 changes: 1 addition & 1 deletion code/renderers/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@
],
"platform": "browser"
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
}
Loading