storybook 10.1.0-beta.3 → 10.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_node-chunks/{builder-manager-OAF6SRKJ.js → builder-manager-T3A7QLUO.js} +24 -26
- package/dist/_node-chunks/{camelcase-UG5ZJHCD.js → camelcase-WMMYRUH4.js} +7 -7
- package/dist/_node-chunks/{chunk-WBULWRM7.js → chunk-3MVB5IZX.js} +28 -24
- package/dist/_node-chunks/{chunk-N5IE6WWR.js → chunk-5DEFF2GB.js} +7 -7
- package/dist/_node-chunks/{chunk-JOOO54RB.js → chunk-67VVNDJJ.js} +6 -6
- package/dist/_node-chunks/{chunk-SUILKNPA.js → chunk-C6RLDV2P.js} +8 -8
- package/dist/_node-chunks/{chunk-473LXK7O.js → chunk-CM44JL5Z.js} +6 -6
- package/dist/_node-chunks/{chunk-XS5QCZP7.js → chunk-CSFSQ2I4.js} +7 -7
- package/dist/_node-chunks/{chunk-H6HVK5J2.js → chunk-EFN4RLWH.js} +7 -7
- package/dist/_node-chunks/{chunk-WYLXFNIP.js → chunk-EFTR6VSG.js} +9 -9
- package/dist/_node-chunks/{chunk-SKFAHEPX.js → chunk-EJPOXNSG.js} +15 -15
- package/dist/_node-chunks/{chunk-7WOMK33B.js → chunk-HDMHX5QM.js} +7 -7
- package/dist/_node-chunks/{chunk-U24W5IIW.js → chunk-HT32VUX7.js} +7 -7
- package/dist/_node-chunks/chunk-IQFN7VY4.js +23 -0
- package/dist/_node-chunks/{chunk-RABBUYPA.js → chunk-JYAXWHGH.js} +9 -9
- package/dist/_node-chunks/chunk-K7U3BSTR.js +61 -0
- package/dist/_node-chunks/{chunk-CRJ7M6EO.js → chunk-KAVR7KJP.js} +285 -280
- package/dist/_node-chunks/{chunk-6YYH64IJ.js → chunk-KI6KY2ZN.js} +13 -13
- package/dist/_node-chunks/{chunk-Y7VDA7NY.js → chunk-NORFPLB6.js} +7 -7
- package/dist/_node-chunks/{chunk-LZ2HPFRB.js → chunk-PMZEJJNX.js} +7 -7
- package/dist/_node-chunks/{chunk-NOTIBODG.js → chunk-RSJK2D7X.js} +6 -6
- package/dist/_node-chunks/{chunk-UWK6Z4VL.js → chunk-TBYOSPAV.js} +6 -6
- package/dist/_node-chunks/{chunk-STYUJSG3.js → chunk-TC7X5DN2.js} +10 -10
- package/dist/_node-chunks/{chunk-TUQOGYET.js → chunk-TCLOOFNE.js} +7 -7
- package/dist/_node-chunks/{chunk-WSIZMTN2.js → chunk-VN7SAKM4.js} +6 -6
- package/dist/_node-chunks/{chunk-745GFLCZ.js → chunk-VW25O2YM.js} +6 -6
- package/dist/_node-chunks/{chunk-A5VW7257.js → chunk-WGBDDI6W.js} +642 -639
- package/dist/_node-chunks/chunk-YN3C74EA.js +18 -0
- package/dist/_node-chunks/{chunk-NKT3R6IH.js → chunk-YTTOTUWC.js} +6 -6
- package/dist/_node-chunks/{chunk-Q65ED3UK.js → chunk-YZ3XRP4N.js} +6 -6
- package/dist/_node-chunks/{dist-N33YQ3NH.js → dist-L6XLFQOU.js} +9 -9
- package/dist/_node-chunks/{globby-5IBS67N3.js → globby-7IXLXFEA.js} +9 -9
- package/dist/_node-chunks/{lib-2XH6KQ2B.js → lib-T5L2ZSAG.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-3GGSRLVV.js → mdx-N42X6CFJ-GOOKUTSA.js} +8 -8
- package/dist/_node-chunks/{p-limit-Z3A7N5MY.js → p-limit-7GKATDEW.js} +7 -7
- package/dist/babel/index.js +10 -10
- package/dist/bin/core.js +12 -12
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +9 -9
- package/dist/cli/index.d.ts +1 -2
- package/dist/cli/index.js +18 -18
- package/dist/common/index.d.ts +553 -560
- package/dist/common/index.js +19 -21
- package/dist/core-server/index.js +33 -33
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +25 -25
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/runtime.js +70 -96
- package/dist/manager-api/index.d.ts +178 -178
- package/dist/manager-api/index.js +1 -1
- package/dist/mocking-utils/index.js +8 -8
- package/dist/node-logger/index.d.ts +3 -1
- package/dist/node-logger/index.js +9 -9
- package/dist/server-errors.js +11 -11
- package/dist/telemetry/index.js +23 -23
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/_node-chunks/chunk-5N3H43LE.js +0 -23
- package/dist/_node-chunks/chunk-DRN5YXX5.js +0 -18
- package/dist/_node-chunks/chunk-LJRIVT23.js +0 -61
package/dist/manager/runtime.js
CHANGED
|
@@ -6537,6 +6537,19 @@ var storeOptions = {
|
|
|
6537
6537
|
};
|
|
6538
6538
|
var STORE_CHANNEL_EVENT_NAME = `UNIVERSAL_STORE:${storeOptions.id}`;
|
|
6539
6539
|
|
|
6540
|
+
// src/cli/AddonVitestService.constants.ts
|
|
6541
|
+
var SUPPORTED_FRAMEWORKS = [
|
|
6542
|
+
"html-vite" /* HTML_VITE */,
|
|
6543
|
+
"nextjs-vite" /* NEXTJS_VITE */,
|
|
6544
|
+
"preact-vite" /* PREACT_VITE */,
|
|
6545
|
+
"react-native-web-vite" /* REACT_NATIVE_WEB_VITE */,
|
|
6546
|
+
"react-vite" /* REACT_VITE */,
|
|
6547
|
+
"svelte-vite" /* SVELTE_VITE */,
|
|
6548
|
+
"sveltekit" /* SVELTEKIT */,
|
|
6549
|
+
"vue3-vite" /* VUE3_VITE */,
|
|
6550
|
+
"web-components-vite" /* WEB_COMPONENTS_VITE */
|
|
6551
|
+
];
|
|
6552
|
+
|
|
6540
6553
|
// src/docs-tools/shared.ts
|
|
6541
6554
|
var ADDON_ID5 = "storybook/docs", PANEL_ID3 = `${ADDON_ID5}/panel`;
|
|
6542
6555
|
var SNIPPET_RENDERED = `${ADDON_ID5}/snippet-rendered`;
|
|
@@ -10652,8 +10665,13 @@ var CodeWrapper = styled.div(({ theme }) => ({
|
|
|
10652
10665
|
".linenumber": {
|
|
10653
10666
|
opacity: 0.5
|
|
10654
10667
|
}
|
|
10655
|
-
})), CodeSnippet = (props) => react_default.createElement(ThemeProvider, { theme: convert(themes.dark) }, react_default.createElement(CodeWrapper, null, react_default.createElement(SyntaxHighlighter, { ...props }))), subscribeToIndex = (condition) => ({ api, done }) => {
|
|
10656
|
-
let check = () => condition(
|
|
10668
|
+
})), CodeSnippet = (props) => react_default.createElement(ThemeProvider, { theme: convert(themes.dark) }, react_default.createElement(CodeWrapper, null, react_default.createElement(SyntaxHighlighter, { ...props }))), isExample = (id) => id.startsWith("example-") || id.startsWith("configure-your-project--"), subscribeToIndex = (condition) => ({ api, done }) => {
|
|
10669
|
+
let check = () => condition(
|
|
10670
|
+
Object.entries(api.getIndex()?.entries || {}).reduce(
|
|
10671
|
+
(acc, [id, entry]) => isExample(entry.id) ? acc : Object.assign(acc, { [id]: entry }),
|
|
10672
|
+
{}
|
|
10673
|
+
)
|
|
10674
|
+
);
|
|
10657
10675
|
if (check())
|
|
10658
10676
|
done();
|
|
10659
10677
|
else
|
|
@@ -10699,7 +10717,10 @@ var CodeWrapper = styled.div(({ theme }) => ({
|
|
|
10699
10717
|
id: "renderComponent",
|
|
10700
10718
|
label: "Render a component",
|
|
10701
10719
|
criteria: "A story finished rendering successfully",
|
|
10702
|
-
subscribe: ({ api, done }) => api.on(
|
|
10720
|
+
subscribe: ({ api, done }) => api.on(
|
|
10721
|
+
STORY_FINISHED,
|
|
10722
|
+
({ storyId, status }) => status === "success" && !isExample(storyId) && done()
|
|
10723
|
+
),
|
|
10703
10724
|
content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Storybook renders your components in isolation, using stories. That allows you to work on the bit of UI you need, without worrying about the rest of the app."), react_default.createElement("p", null, "Rendering your components can often require", " ", react_default.createElement(
|
|
10704
10725
|
Link,
|
|
10705
10726
|
{
|
|
@@ -10786,7 +10807,7 @@ export const Primary: Story = {
|
|
|
10786
10807
|
criteria: "At least 5 components exist in the index",
|
|
10787
10808
|
subscribe: subscribeToIndex((entries) => {
|
|
10788
10809
|
let stories = Object.values(entries).filter(
|
|
10789
|
-
(entry) => entry.type === "story"
|
|
10810
|
+
(entry) => entry.type === "story"
|
|
10790
10811
|
);
|
|
10791
10812
|
return new Set(stories.map(({ title: title2 }) => title2)).size >= 5;
|
|
10792
10813
|
})
|
|
@@ -10819,7 +10840,7 @@ export const Primary: Story = {
|
|
|
10819
10840
|
))),
|
|
10820
10841
|
criteria: "At least 20 stories exist in the index",
|
|
10821
10842
|
subscribe: subscribeToIndex((entries) => Object.values(entries).filter(
|
|
10822
|
-
(entry) => entry.type === "story"
|
|
10843
|
+
(entry) => entry.type === "story"
|
|
10823
10844
|
).length >= 20)
|
|
10824
10845
|
},
|
|
10825
10846
|
{
|
|
@@ -10943,8 +10964,7 @@ export default {
|
|
|
10943
10964
|
id: "installVitest",
|
|
10944
10965
|
label: "Install Vitest addon",
|
|
10945
10966
|
afterCompletion: "unavailable",
|
|
10946
|
-
available: () =>
|
|
10947
|
-
// TODO check for compatibility with the project
|
|
10967
|
+
available: () => !!globalThis.STORYBOOK_FRAMEWORK && SUPPORTED_FRAMEWORKS.includes(globalThis.STORYBOOK_FRAMEWORK),
|
|
10948
10968
|
criteria: "@storybook/addon-vitest registered in .storybook/main.js|ts",
|
|
10949
10969
|
subscribe: ({ done }) => {
|
|
10950
10970
|
addons.experimental_getRegisteredAddons().includes(ADDON_ID4) && done();
|
|
@@ -11047,7 +11067,7 @@ export default {
|
|
|
11047
11067
|
criteria: "At least one story with a play or test function",
|
|
11048
11068
|
subscribe: subscribeToIndex(
|
|
11049
11069
|
(entries) => Object.values(entries).some(
|
|
11050
|
-
(
|
|
11070
|
+
(entry) => entry.tags?.includes("play-fn") || entry.tags?.includes("test-fn")
|
|
11051
11071
|
)
|
|
11052
11072
|
),
|
|
11053
11073
|
content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "When you need to test non-visual or particularly complex behavior of a component, add a play function."), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.ts
|
|
@@ -11319,16 +11339,16 @@ export const Disabled: Story = {
|
|
|
11319
11339
|
label: "Automatically document your components",
|
|
11320
11340
|
criteria: "At least one component with the autodocs tag applied",
|
|
11321
11341
|
subscribe: subscribeToIndex(
|
|
11322
|
-
(entries) => Object.values(entries).some(
|
|
11323
|
-
({ id, tags }) => !id.startsWith("example-") && tags?.includes("autodocs")
|
|
11324
|
-
)
|
|
11342
|
+
(entries) => Object.values(entries).some((entry) => entry.tags?.includes("autodocs"))
|
|
11325
11343
|
),
|
|
11326
|
-
content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Add the autodocs tag to a component's meta to automatically generate documentation for that component, complete with examples, source code, an API table, and a description."), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.
|
|
11344
|
+
content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Add the autodocs tag to a component's meta to automatically generate documentation for that component, complete with examples, source code, an API table, and a description."), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.js
|
|
11327
11345
|
|
|
11328
|
-
|
|
11346
|
+
const meta = {
|
|
11329
11347
|
component: Button,
|
|
11330
11348
|
tags: ['autodocs'], // \u{1F448} Add this tag
|
|
11331
|
-
}
|
|
11349
|
+
}
|
|
11350
|
+
|
|
11351
|
+
export default meta;`), react_default.createElement("p", null, "That tag can also be applied in ", react_default.createElement("code", null, ".storybook/preview.ts"), ", to generate documentation for ", react_default.createElement("em", null, "all"), " components."), react_default.createElement(
|
|
11332
11352
|
"img",
|
|
11333
11353
|
{
|
|
11334
11354
|
src: api.getDocsUrl({
|
|
@@ -11356,9 +11376,7 @@ export default {
|
|
|
11356
11376
|
label: "Custom content with MDX",
|
|
11357
11377
|
criteria: "At least one MDX page",
|
|
11358
11378
|
subscribe: subscribeToIndex(
|
|
11359
|
-
(entries) => Object.values(entries).some(
|
|
11360
|
-
({ id, type }) => type === "docs" && !id.startsWith("example-")
|
|
11361
|
-
)
|
|
11379
|
+
(entries) => Object.values(entries).some((entry) => entry.type === "docs")
|
|
11362
11380
|
),
|
|
11363
11381
|
content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "You can use MDX (markdown + React components) to provide an introduction to your project, document things like design tokens, or go beyond the automatic documentation for your components."), react_default.createElement("p", null, "For a start, create an ", react_default.createElement("code", null, "introduction.mdx"), " file and (using markdown and Storybook's", " ", react_default.createElement(
|
|
11364
11382
|
Link,
|
|
@@ -14104,6 +14122,9 @@ var withStatusColor = ({ theme, status }) => {
|
|
|
14104
14122
|
), StatusButton = forwardRef((props, ref) => react_default.createElement(StyledButton, { variant: "ghost", padding: "small", ...props, ref }));
|
|
14105
14123
|
StatusButton.displayName = "StatusButton";
|
|
14106
14124
|
|
|
14125
|
+
// src/manager/components/sidebar/StatusContext.tsx
|
|
14126
|
+
var StatusContext = createContext({});
|
|
14127
|
+
|
|
14107
14128
|
// src/manager/components/sidebar/ContextMenu.tsx
|
|
14108
14129
|
var empty = {
|
|
14109
14130
|
onMouseEnter: () => {
|
|
@@ -14119,7 +14140,7 @@ var empty = {
|
|
|
14119
14140
|
outlineOffset: -2
|
|
14120
14141
|
}
|
|
14121
14142
|
}), useContextMenu = (context, links, api) => {
|
|
14122
|
-
let [hoverCount, setHoverCount] = useState(0), [isOpen, setIsOpen] = useState(!1), [copyText, setCopyText] = react_default.useState("Copy story name"), shortcutKeys = api.getShortcutKeys(), enableShortcuts = !!shortcutKeys, topLinks = useMemo(() => {
|
|
14143
|
+
let [hoverCount, setHoverCount] = useState(0), [isOpen, setIsOpen] = useState(!1), [copyText, setCopyText] = react_default.useState("Copy story name"), { allStatuses, groupStatus } = useContext(StatusContext), shortcutKeys = api.getShortcutKeys(), enableShortcuts = !!shortcutKeys, topLinks = useMemo(() => {
|
|
14123
14144
|
let defaultLinks = [];
|
|
14124
14145
|
return context && "importPath" in context && defaultLinks.push({
|
|
14125
14146
|
id: "open-in-editor",
|
|
@@ -14146,7 +14167,7 @@ var empty = {
|
|
|
14146
14167
|
}, 2e3);
|
|
14147
14168
|
}
|
|
14148
14169
|
}), defaultLinks;
|
|
14149
|
-
}, [context, copyText, enableShortcuts, shortcutKeys]), handlers = useMemo(() => ({
|
|
14170
|
+
}, [api, context, copyText, enableShortcuts, shortcutKeys]), handlers = useMemo(() => ({
|
|
14150
14171
|
onMouseEnter: () => {
|
|
14151
14172
|
setHoverCount((c2) => c2 + 1);
|
|
14152
14173
|
},
|
|
@@ -14159,7 +14180,20 @@ var empty = {
|
|
|
14159
14180
|
}), []), providerLinks = useMemo(() => {
|
|
14160
14181
|
let registeredTestProviders = api.getElements(Addon_TypesEnum.experimental_TEST_PROVIDER);
|
|
14161
14182
|
return hoverCount ? generateTestProviderLinks(registeredTestProviders, context) : [];
|
|
14162
|
-
}, [api, context, hoverCount]), shouldRender = !context.refId && (providerLinks.length > 0 || links.length > 0 || topLinks.length > 0)
|
|
14183
|
+
}, [api, context, hoverCount]), shouldRender = !context.refId && (providerLinks.length > 0 || links.length > 0 || topLinks.length > 0), isLeafNode = context.type === "story" || context.type === "docs", itemStatus = useMemo(() => {
|
|
14184
|
+
let status = "status-value:unknown";
|
|
14185
|
+
if (!context)
|
|
14186
|
+
return status;
|
|
14187
|
+
if (isLeafNode) {
|
|
14188
|
+
let values = Object.values(allStatuses?.[context.id] || {}).map((s2) => s2.value);
|
|
14189
|
+
status = getMostCriticalStatusValue(values);
|
|
14190
|
+
}
|
|
14191
|
+
if (!isLeafNode) {
|
|
14192
|
+
let groupValue = groupStatus && groupStatus[context.id];
|
|
14193
|
+
status = groupValue === "status-value:success" || groupValue === void 0 ? "status-value:unknown" : groupValue;
|
|
14194
|
+
}
|
|
14195
|
+
return status;
|
|
14196
|
+
}, [allStatuses, groupStatus, context, isLeafNode]), MenuIcon2 = useMemo(() => context.type !== "story" && context.type !== "docs" ? itemStatus !== "status-value:success" && itemStatus !== "status-value:unknown" ? react_default.createElement("svg", { key: "icon", viewBox: "0 0 6 6", width: "6", height: "6" }, react_default.createElement(UseSymbol, { type: "dot" })) : react_default.createElement(EllipsisIcon, null) : itemStatus === "status-value:error" ? react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "error" })) : itemStatus === "status-value:warning" ? react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "warning" })) : itemStatus === "status-value:success" ? react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "success" })) : react_default.createElement(EllipsisIcon, null), [itemStatus, context.type]);
|
|
14163
14197
|
return useMemo(() => globalThis.CONFIG_TYPE !== "DEVELOPMENT" ? empty : {
|
|
14164
14198
|
onMouseEnter: handlers.onMouseEnter,
|
|
14165
14199
|
node: shouldRender ? react_default.createElement(
|
|
@@ -14180,13 +14214,13 @@ var empty = {
|
|
|
14180
14214
|
"data-testid": "context-menu",
|
|
14181
14215
|
ariaLabel: "Open context menu",
|
|
14182
14216
|
type: "button",
|
|
14183
|
-
status:
|
|
14217
|
+
status: itemStatus,
|
|
14184
14218
|
onClick: handlers.onOpen
|
|
14185
14219
|
},
|
|
14186
|
-
|
|
14220
|
+
MenuIcon2
|
|
14187
14221
|
)
|
|
14188
14222
|
) : null
|
|
14189
|
-
}, [context, handlers, isOpen, shouldRender, links, topLinks]);
|
|
14223
|
+
}, [context, handlers, isOpen, shouldRender, links, topLinks, itemStatus, MenuIcon2]);
|
|
14190
14224
|
}, LiveContextMenu = ({
|
|
14191
14225
|
context,
|
|
14192
14226
|
links,
|
|
@@ -14209,33 +14243,6 @@ function generateTestProviderLinks(registeredTestProviders, context) {
|
|
|
14209
14243
|
}).filter(Boolean);
|
|
14210
14244
|
}
|
|
14211
14245
|
|
|
14212
|
-
// src/manager/components/sidebar/StatusContext.tsx
|
|
14213
|
-
var StatusContext = createContext({}), useStatusSummary = (item) => {
|
|
14214
|
-
let { data, allStatuses, groupStatus } = useContext(StatusContext), summary = {
|
|
14215
|
-
counts: {
|
|
14216
|
-
"status-value:pending": 0,
|
|
14217
|
-
"status-value:success": 0,
|
|
14218
|
-
"status-value:error": 0,
|
|
14219
|
-
"status-value:warning": 0,
|
|
14220
|
-
"status-value:unknown": 0
|
|
14221
|
-
},
|
|
14222
|
-
statusesByValue: {
|
|
14223
|
-
"status-value:pending": {},
|
|
14224
|
-
"status-value:success": {},
|
|
14225
|
-
"status-value:error": {},
|
|
14226
|
-
"status-value:warning": {},
|
|
14227
|
-
"status-value:unknown": {}
|
|
14228
|
-
}
|
|
14229
|
-
};
|
|
14230
|
-
if (data && allStatuses && groupStatus && ["status-value:pending", "status-value:warning", "status-value:error"].includes(
|
|
14231
|
-
groupStatus[item.id]
|
|
14232
|
-
))
|
|
14233
|
-
for (let storyId of getDescendantIds(data, item.id, !1))
|
|
14234
|
-
for (let status of Object.values(allStatuses[storyId] ?? {}))
|
|
14235
|
-
summary.counts[status.value]++, summary.statusesByValue[status.value][storyId] ??= [], summary.statusesByValue[status.value][storyId].push(status);
|
|
14236
|
-
return summary;
|
|
14237
|
-
};
|
|
14238
|
-
|
|
14239
14246
|
// src/manager/components/sidebar/components/CollapseIcon.tsx
|
|
14240
14247
|
var CollapseIconWrapper = styled.div(({ theme, isExpanded }) => ({
|
|
14241
14248
|
width: 8,
|
|
@@ -14578,47 +14585,19 @@ var statusOrder = [
|
|
|
14578
14585
|
setExpanded,
|
|
14579
14586
|
onSelectStoryId,
|
|
14580
14587
|
api
|
|
14581
|
-
} = props, theme = useTheme(), { isDesktop, isMobile: isMobile2, setMobileMenuOpen } = useLayout()
|
|
14588
|
+
} = props, theme = useTheme(), { isDesktop, isMobile: isMobile2, setMobileMenuOpen } = useLayout();
|
|
14582
14589
|
if (!isDisplayed)
|
|
14583
14590
|
return null;
|
|
14584
|
-
let statusLinks = useMemo(() => {
|
|
14585
|
-
|
|
14586
|
-
|
|
14587
|
-
|
|
14588
|
-
|
|
14589
|
-
|
|
14590
|
-
|
|
14591
|
-
|
|
14592
|
-
onClick: () => {
|
|
14593
|
-
onSelectStoryId(item.id), internal_fullStatusStore.selectStatuses([status]);
|
|
14594
|
-
}
|
|
14595
|
-
}));
|
|
14596
|
-
if (item.type === "component" || item.type === "group") {
|
|
14597
|
-
let links = [], errorCount = counts["status-value:error"], warningCount = counts["status-value:warning"];
|
|
14598
|
-
return errorCount && links.push({
|
|
14599
|
-
id: "errors",
|
|
14600
|
-
icon: StatusIconMap["status-value:error"],
|
|
14601
|
-
title: `${errorCount} ${errorCount === 1 ? "story" : "stories"} with errors`,
|
|
14602
|
-
onClick: () => {
|
|
14603
|
-
let [firstStoryId] = Object.entries(statusesByValue["status-value:error"])[0];
|
|
14604
|
-
onSelectStoryId(firstStoryId);
|
|
14605
|
-
let errorStatuses = Object.values(statusesByValue["status-value:error"]).flat();
|
|
14606
|
-
internal_fullStatusStore.selectStatuses(errorStatuses);
|
|
14607
|
-
}
|
|
14608
|
-
}), warningCount && links.push({
|
|
14609
|
-
id: "warnings",
|
|
14610
|
-
icon: StatusIconMap["status-value:warning"],
|
|
14611
|
-
title: `${warningCount} ${warningCount === 1 ? "story" : "stories"} with warnings`,
|
|
14612
|
-
onClick: () => {
|
|
14613
|
-
let [firstStoryId] = Object.entries(statusesByValue["status-value:warning"])[0];
|
|
14614
|
-
onSelectStoryId(firstStoryId);
|
|
14615
|
-
let warningStatuses = Object.values(statusesByValue["status-value:warning"]).flat();
|
|
14616
|
-
internal_fullStatusStore.selectStatuses(warningStatuses);
|
|
14617
|
-
}
|
|
14618
|
-
}), links;
|
|
14591
|
+
let statusLinks = useMemo(() => item.type === "story" || item.type === "docs" ? Object.entries(statuses).filter(([, status]) => status.sidebarContextMenu !== !1).sort((a2, b2) => statusOrder.indexOf(a2[1].value) - statusOrder.indexOf(b2[1].value)).map(([typeId, status]) => ({
|
|
14592
|
+
id: typeId,
|
|
14593
|
+
title: status.title,
|
|
14594
|
+
description: status.description,
|
|
14595
|
+
"aria-label": `Test status for ${status.title}: ${status.value}`,
|
|
14596
|
+
icon: StatusIconMap[status.value],
|
|
14597
|
+
onClick: () => {
|
|
14598
|
+
onSelectStoryId(item.id), internal_fullStatusStore.selectStatuses([status]);
|
|
14619
14599
|
}
|
|
14620
|
-
|
|
14621
|
-
}, [counts, item.id, item.type, onSelectStoryId, statuses, statusesByValue]), id = createId(item.id, refId), contextMenu = refId === "storybook_internal" ? useContextMenu(item, statusLinks, api) : { node: null, onMouseEnter: () => {
|
|
14600
|
+
})) : [], [item.id, item.type, onSelectStoryId, statuses]), id = createId(item.id, refId), contextMenu = refId === "storybook_internal" ? useContextMenu(item, statusLinks, api) : { node: null, onMouseEnter: () => {
|
|
14622
14601
|
} };
|
|
14623
14602
|
if (item.type === "story" && !("children" in item && item.children) && (!("subtype" in item) || item.subtype !== "test") || item.type === "docs") {
|
|
14624
14603
|
let LeafNode3 = item.type === "docs" ? DocumentNode : StoryNode, statusValue = getMostCriticalStatusValue(
|
|
@@ -19119,14 +19098,9 @@ var Sections = styled.ol(({ theme }) => ({
|
|
|
19119
19098
|
return { id, title: title2, items, progress };
|
|
19120
19099
|
}),
|
|
19121
19100
|
[itemsById, sectionsById]
|
|
19122
|
-
), next = useMemo(
|
|
19123
|
-
() => Object.values(sections).findIndex(
|
|
19124
|
-
({ items }) => items.some((item) => item.isOpen && item.isAvailable)
|
|
19125
|
-
),
|
|
19126
|
-
[sections]
|
|
19127
19101
|
);
|
|
19128
|
-
return react_default.createElement(Sections, null, sections.map(({ id, title: title2, items, progress }
|
|
19129
|
-
let collapsed =
|
|
19102
|
+
return react_default.createElement(Sections, null, sections.map(({ id, title: title2, items, progress }) => {
|
|
19103
|
+
let collapsed = progress === 100 && items.every((item) => item.id !== locationHash);
|
|
19130
19104
|
return react_default.createElement("li", { key: id }, react_default.createElement(Focus.Proxy, { targetId: `toggle-${id}` }, react_default.createElement(
|
|
19131
19105
|
Collapsible,
|
|
19132
19106
|
{
|
|
@@ -19164,7 +19138,7 @@ var Sections = styled.ol(({ theme }) => ({
|
|
|
19164
19138
|
isSkipped,
|
|
19165
19139
|
...item
|
|
19166
19140
|
}) => {
|
|
19167
|
-
let isChecked = isAccepted || isDone, isCollapsed =
|
|
19141
|
+
let isChecked = isAccepted || isDone, isCollapsed = item.id !== locationHash, isLocked = !!isLockedBy, itemContent = content?.({ api });
|
|
19168
19142
|
return react_default.createElement(Listbox.Item, { as: "li", key: item.id }, react_default.createElement(
|
|
19169
19143
|
Focus.Target,
|
|
19170
19144
|
{
|