@storybook/addon-docs 10.5.0-alpha.5 → 10.5.0-alpha.7
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/_browser-chunks/{Color-MQE2NRD4.js → Color-AVMI7ZZZ.js} +3 -3
- package/dist/_browser-chunks/{DocsRenderer-LL677BLK.js → DocsRenderer-JROSPFPF.js} +1 -1
- package/dist/_browser-chunks/{chunk-S4QKU6I5.js → chunk-6Z2O5XYJ.js} +2 -2
- package/dist/_browser-chunks/{chunk-SL3VIQZ3.js → chunk-UAWMPV5J.js} +5 -1
- package/dist/_node-chunks/{chunk-UVV6FRUF.js → chunk-2WTY7RHL.js} +198 -198
- package/dist/_node-chunks/{chunk-CR22MHHI.js → chunk-AR7B7DGI.js} +18 -9
- package/dist/_node-chunks/{chunk-OBCKO6Y3.js → chunk-BS47STAB.js} +6 -6
- package/dist/_node-chunks/{chunk-2QFSQ4RB.js → chunk-ZM6M6OKB.js} +6 -6
- package/dist/_node-chunks/{mdx-plugin-DT6OS2CV.js → mdx-plugin-R2MYDMMD.js} +11 -11
- package/dist/_node-chunks/{rehype-external-links-SIYDSVTO.js → rehype-external-links-QE2YWBRR.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-XCUUIQBS.js → rehype-slug-EPMUVHIS.js} +8 -8
- package/dist/angular/index.js +1 -1
- package/dist/blocks.d.ts +14 -1
- package/dist/blocks.js +286 -112
- package/dist/ember/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/manager.js +1 -1
- package/dist/mdx-loader.js +10 -10
- package/dist/preset.js +9 -9
- package/dist/preview.js +2 -2
- package/package.json +4 -4
package/dist/blocks.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
curriedTransparentize$1,
|
|
12
12
|
rgba
|
|
13
13
|
} from "./_browser-chunks/chunk-SPXYZZB5.js";
|
|
14
|
-
import "./_browser-chunks/chunk-
|
|
14
|
+
import "./_browser-chunks/chunk-UAWMPV5J.js";
|
|
15
15
|
|
|
16
16
|
// src/blocks/components/ArgsTable/ArgsTable.tsx
|
|
17
17
|
import React23 from "react";
|
|
@@ -1143,7 +1143,10 @@ var styleResets = {
|
|
|
1143
1143
|
};
|
|
1144
1144
|
|
|
1145
1145
|
// src/blocks/controls/options/Options.tsx
|
|
1146
|
-
var normalizeOptions = (options, labels) => Array.isArray(options) ? options.reduce((acc, item) =>
|
|
1146
|
+
var normalizeOptions = (options, labels) => Array.isArray(options) ? options.reduce((acc, item) => {
|
|
1147
|
+
let label = labels != null && !Array.isArray(labels) && typeof labels[item] == "string" ? labels[item] : String(item);
|
|
1148
|
+
return acc[label] = item, acc;
|
|
1149
|
+
}, {}) : options, Controls = {
|
|
1147
1150
|
check: CheckboxControl,
|
|
1148
1151
|
"inline-check": CheckboxControl,
|
|
1149
1152
|
radio: RadioControl,
|
|
@@ -2430,7 +2433,7 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2430
2433
|
onChange,
|
|
2431
2434
|
argType
|
|
2432
2435
|
}) => {
|
|
2433
|
-
let data = useMemo(() => value && cloneDeep(value), [value]), hasData = data != null, [showRaw, setShowRaw] = useState4(!hasData), [parseError, setParseError] = useState4(null), readonly = !!argType?.table?.readonly, updateRaw = useCallback3(
|
|
2436
|
+
let data = useMemo(() => value && cloneDeep(value), [value]), hasData = data != null, [showRaw, setShowRaw] = useState4(!hasData), hadDataRef = useRef3(hasData), [parseError, setParseError] = useState4(null), readonly = !!argType?.table?.readonly, updateRaw = useCallback3(
|
|
2434
2437
|
(raw) => {
|
|
2435
2438
|
try {
|
|
2436
2439
|
raw && onChange(JSON.parse(raw)), setParseError(null);
|
|
@@ -2441,7 +2444,11 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2441
2444
|
[onChange]
|
|
2442
2445
|
), [forceVisible, setForceVisible] = useState4(!1), onForceVisible = useCallback3(() => {
|
|
2443
2446
|
onChange({}), setForceVisible(!0);
|
|
2444
|
-
}, [onChange, setForceVisible])
|
|
2447
|
+
}, [onChange, setForceVisible]);
|
|
2448
|
+
useEffect4(() => {
|
|
2449
|
+
!hadDataRef.current && hasData && showRaw && !forceVisible && setShowRaw(!1), hadDataRef.current = hasData;
|
|
2450
|
+
}, [forceVisible, hasData, showRaw]);
|
|
2451
|
+
let htmlElRef = useRef3(null);
|
|
2445
2452
|
useEffect4(() => {
|
|
2446
2453
|
forceVisible && htmlElRef.current && htmlElRef.current.select();
|
|
2447
2454
|
}, [forceVisible]);
|
|
@@ -2767,7 +2774,7 @@ var FilesControl = ({
|
|
|
2767
2774
|
};
|
|
2768
2775
|
|
|
2769
2776
|
// src/blocks/controls/index.tsx
|
|
2770
|
-
var LazyColorControl = lazy(() => import("./_browser-chunks/Color-
|
|
2777
|
+
var LazyColorControl = lazy(() => import("./_browser-chunks/Color-AVMI7ZZZ.js")), ColorControl = (props) => React15.createElement(Suspense, { fallback: React15.createElement("div", null) }, React15.createElement(LazyColorControl, { ...props }));
|
|
2771
2778
|
|
|
2772
2779
|
// src/blocks/components/ArgsTable/ArgControl.tsx
|
|
2773
2780
|
var Controls2 = {
|
|
@@ -4274,7 +4281,7 @@ function useStories(storyIds, context) {
|
|
|
4274
4281
|
// src/blocks/blocks/with-mdx-component-override.tsx
|
|
4275
4282
|
import React25 from "react";
|
|
4276
4283
|
import { useMDXComponents } from "@mdx-js/react";
|
|
4277
|
-
var MDX_WRAPPED_BLOCK = Symbol("mdxWrappedBlock"), MdxWrappedBlockContext = React25.createContext(null), withMdxComponentOverride = (blockName, Block) => {
|
|
4284
|
+
var MDX_WRAPPED_BLOCK = /* @__PURE__ */ Symbol("mdxWrappedBlock"), MdxWrappedBlockContext = React25.createContext(null), withMdxComponentOverride = (blockName, Block) => {
|
|
4278
4285
|
let WrappedBlock = (props) => {
|
|
4279
4286
|
let wrappedBlocks = React25.useContext(MdxWrappedBlockContext), Override = useMDXComponents()[blockName];
|
|
4280
4287
|
if (wrappedBlocks?.has(blockName) || Override === WrappedBlock)
|
|
@@ -5544,10 +5551,72 @@ import React36 from "react";
|
|
|
5544
5551
|
var anchorBlockIdFromId = (storyId) => `anchor--${storyId}`, Anchor = ({ storyId, children }) => React36.createElement("div", { id: anchorBlockIdFromId(storyId), className: "sb-anchor" }, children);
|
|
5545
5552
|
|
|
5546
5553
|
// src/blocks/blocks/ArgTypes.tsx
|
|
5547
|
-
import React37 from "react";
|
|
5554
|
+
import React37, { useContext as useContext4 } from "react";
|
|
5548
5555
|
import { InvalidBlockOfPropError as InvalidBlockOfPropError2 } from "storybook/internal/preview-errors";
|
|
5549
5556
|
import { filterArgTypes } from "storybook/preview-api";
|
|
5550
5557
|
|
|
5558
|
+
// src/blocks/blocks/argTypesShared.ts
|
|
5559
|
+
import {
|
|
5560
|
+
getServiceSubcomponentArgTypes,
|
|
5561
|
+
mergeServiceArgTypes
|
|
5562
|
+
} from "storybook/internal/docs-tools";
|
|
5563
|
+
|
|
5564
|
+
// src/blocks/blocks/useServiceDocgen.ts
|
|
5565
|
+
import { useCallback as useCallback7, useMemo as useMemo4, useRef as useRef6, useSyncExternalStore } from "react";
|
|
5566
|
+
import { getService } from "storybook/preview-api";
|
|
5567
|
+
function useServiceDocgen(id) {
|
|
5568
|
+
let snapshotCache = useRef6({ id: void 0, value: void 0 }), service = useMemo4(() => {
|
|
5569
|
+
try {
|
|
5570
|
+
return getService("core/docgen");
|
|
5571
|
+
} catch {
|
|
5572
|
+
return;
|
|
5573
|
+
}
|
|
5574
|
+
}, []), getSnapshot = useCallback7(() => snapshotCache.current.id === id ? snapshotCache.current.value : void 0, [id]), subscribe = useCallback7(
|
|
5575
|
+
(listener) => service && id ? service.queries.getDocgen.subscribe({ id }, (value) => {
|
|
5576
|
+
snapshotCache.current = { id, value }, listener();
|
|
5577
|
+
}) : () => {
|
|
5578
|
+
},
|
|
5579
|
+
[service, id]
|
|
5580
|
+
);
|
|
5581
|
+
return useSyncExternalStore(subscribe, getSnapshot);
|
|
5582
|
+
}
|
|
5583
|
+
|
|
5584
|
+
// src/blocks/blocks/argTypesShared.ts
|
|
5585
|
+
function extractComponentArgTypes(component, parameters) {
|
|
5586
|
+
let { extractArgTypes } = parameters.docs || {};
|
|
5587
|
+
if (!extractArgTypes)
|
|
5588
|
+
throw new Error("Args unsupported. See Args documentation for your framework." /* ARGS_UNSUPPORTED */);
|
|
5589
|
+
return extractArgTypes(component);
|
|
5590
|
+
}
|
|
5591
|
+
function extractSubcomponentArgTypes(subcomponents, parameters) {
|
|
5592
|
+
return Object.fromEntries(
|
|
5593
|
+
Object.entries(subcomponents || {}).map(([key, comp]) => [
|
|
5594
|
+
key,
|
|
5595
|
+
extractComponentArgTypes(comp, parameters)
|
|
5596
|
+
])
|
|
5597
|
+
);
|
|
5598
|
+
}
|
|
5599
|
+
function useDocgenServiceRows({
|
|
5600
|
+
componentId,
|
|
5601
|
+
storyId,
|
|
5602
|
+
parameters,
|
|
5603
|
+
initialArgs,
|
|
5604
|
+
customArgTypes
|
|
5605
|
+
}) {
|
|
5606
|
+
let servicePayload = useServiceDocgen(componentId);
|
|
5607
|
+
return !servicePayload || !componentId ? null : {
|
|
5608
|
+
serviceComponentName: servicePayload.name,
|
|
5609
|
+
mainRows: mergeServiceArgTypes({
|
|
5610
|
+
payload: servicePayload,
|
|
5611
|
+
storyId: storyId ?? componentId,
|
|
5612
|
+
parameters,
|
|
5613
|
+
initialArgs,
|
|
5614
|
+
customArgTypes
|
|
5615
|
+
}),
|
|
5616
|
+
subcomponentRows: getServiceSubcomponentArgTypes(servicePayload)
|
|
5617
|
+
};
|
|
5618
|
+
}
|
|
5619
|
+
|
|
5551
5620
|
// src/blocks/blocks/useOf.ts
|
|
5552
5621
|
import { useContext as useContext3 } from "react";
|
|
5553
5622
|
var useOf = (moduleExportOrType, validTypes) => useContext3(DocsContext).resolveOf(moduleExportOrType, validTypes);
|
|
@@ -5566,68 +5635,112 @@ function scrollToElement(element, block = "start") {
|
|
|
5566
5635
|
}
|
|
5567
5636
|
|
|
5568
5637
|
// src/blocks/blocks/ArgTypes.tsx
|
|
5569
|
-
function
|
|
5570
|
-
let {
|
|
5571
|
-
if (
|
|
5572
|
-
throw new
|
|
5573
|
-
|
|
5574
|
-
}
|
|
5575
|
-
function getArgTypesFromResolved(resolved) {
|
|
5638
|
+
function useResolveArgTypes(props) {
|
|
5639
|
+
let { of } = props;
|
|
5640
|
+
if ("of" in props && of === void 0)
|
|
5641
|
+
throw new InvalidBlockOfPropError2();
|
|
5642
|
+
let context = useContext4(DocsContext), resolved = useOf(of || "meta"), resolvedArgTypes;
|
|
5576
5643
|
if (resolved.type === "component") {
|
|
5577
5644
|
let {
|
|
5578
|
-
component
|
|
5579
|
-
projectAnnotations: { parameters
|
|
5645
|
+
component,
|
|
5646
|
+
projectAnnotations: { parameters }
|
|
5580
5647
|
} = resolved;
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
component
|
|
5648
|
+
resolvedArgTypes = {
|
|
5649
|
+
parameters,
|
|
5650
|
+
// Bare `of={Component}` has no story/meta annotations; the docgen service is addressed by
|
|
5651
|
+
// component id, recovered from the CSF file that declares this component.
|
|
5652
|
+
componentId: context.getComponentId(component),
|
|
5653
|
+
argTypes: extractComponentArgTypes(component, parameters),
|
|
5654
|
+
component
|
|
5655
|
+
};
|
|
5656
|
+
} else if (resolved.type === "meta") {
|
|
5657
|
+
let { id, argTypes, parameters, initialArgs, component, subcomponents } = resolved.preparedMeta;
|
|
5658
|
+
resolvedArgTypes = {
|
|
5659
|
+
parameters,
|
|
5660
|
+
componentId: id.split("--")[0],
|
|
5661
|
+
initialArgs,
|
|
5662
|
+
argTypes,
|
|
5663
|
+
component,
|
|
5664
|
+
subcomponents
|
|
5665
|
+
};
|
|
5666
|
+
} else {
|
|
5667
|
+
let { id, argTypes, parameters, initialArgs, component, subcomponents } = resolved.story;
|
|
5668
|
+
resolvedArgTypes = {
|
|
5669
|
+
parameters,
|
|
5670
|
+
componentId: id.split("--")[0],
|
|
5671
|
+
storyId: id,
|
|
5672
|
+
initialArgs,
|
|
5673
|
+
argTypes,
|
|
5674
|
+
component,
|
|
5675
|
+
subcomponents
|
|
5585
5676
|
};
|
|
5586
5677
|
}
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
}
|
|
5596
|
-
return { argTypes, parameters, component, subcomponents };
|
|
5678
|
+
let argTypesParameters = resolvedArgTypes.parameters?.docs?.argTypes || {};
|
|
5679
|
+
return {
|
|
5680
|
+
...resolvedArgTypes,
|
|
5681
|
+
filterProps: {
|
|
5682
|
+
include: props.include ?? argTypesParameters.include,
|
|
5683
|
+
exclude: props.exclude ?? argTypesParameters.exclude,
|
|
5684
|
+
sort: props.sort ?? argTypesParameters.sort
|
|
5685
|
+
}
|
|
5686
|
+
};
|
|
5597
5687
|
}
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5688
|
+
function renderArgTypesTables({
|
|
5689
|
+
mainName = "Main",
|
|
5690
|
+
mainRows,
|
|
5691
|
+
subcomponentRows,
|
|
5692
|
+
include,
|
|
5693
|
+
exclude,
|
|
5694
|
+
sort
|
|
5695
|
+
}) {
|
|
5696
|
+
let filteredMainRows = filterArgTypes(mainRows, include, exclude);
|
|
5697
|
+
if (Object.keys(subcomponentRows).length === 0)
|
|
5698
|
+
return React37.createElement(ArgsTable, { rows: filteredMainRows, sort });
|
|
5699
|
+
let tabs = {
|
|
5700
|
+
[mainName]: { rows: filteredMainRows, sort },
|
|
5701
|
+
...Object.fromEntries(
|
|
5702
|
+
Object.entries(subcomponentRows).map(([key, rows]) => [
|
|
5703
|
+
key,
|
|
5704
|
+
{
|
|
5705
|
+
rows: filterArgTypes(rows, include, exclude),
|
|
5706
|
+
sort
|
|
5707
|
+
}
|
|
5708
|
+
])
|
|
5709
|
+
)
|
|
5620
5710
|
};
|
|
5621
5711
|
return React37.createElement(TabbedArgsTable, { tabs, sort });
|
|
5622
|
-
}
|
|
5712
|
+
}
|
|
5713
|
+
var LegacyArgTypes = (props) => {
|
|
5714
|
+
let { argTypes, parameters, component, subcomponents, filterProps } = useResolveArgTypes(props);
|
|
5715
|
+
return argTypes ? renderArgTypesTables({
|
|
5716
|
+
mainName: getComponentName(component),
|
|
5717
|
+
mainRows: argTypes,
|
|
5718
|
+
subcomponentRows: extractSubcomponentArgTypes(subcomponents, parameters),
|
|
5719
|
+
...filterProps
|
|
5720
|
+
}) : null;
|
|
5721
|
+
}, DocgenServiceArgTypes = (props) => {
|
|
5722
|
+
let { argTypes, parameters, componentId, storyId, initialArgs, filterProps, component } = useResolveArgTypes(props), serviceRows = useDocgenServiceRows({
|
|
5723
|
+
componentId,
|
|
5724
|
+
storyId,
|
|
5725
|
+
parameters,
|
|
5726
|
+
initialArgs,
|
|
5727
|
+
customArgTypes: argTypes
|
|
5728
|
+
});
|
|
5729
|
+
return serviceRows ? renderArgTypesTables({
|
|
5730
|
+
mainName: getComponentName(component) ?? serviceRows.serviceComponentName,
|
|
5731
|
+
mainRows: serviceRows.mainRows,
|
|
5732
|
+
subcomponentRows: serviceRows.subcomponentRows,
|
|
5733
|
+
...filterProps
|
|
5734
|
+
}) : null;
|
|
5735
|
+
}, ArgTypesImpl = (props) => globalThis.FEATURES?.experimentalDocgenServer ? React37.createElement(DocgenServiceArgTypes, { ...props }) : React37.createElement(LegacyArgTypes, { ...props }), ArgTypes = withMdxComponentOverride("ArgTypes", ArgTypesImpl);
|
|
5623
5736
|
|
|
5624
5737
|
// src/blocks/blocks/Canvas.tsx
|
|
5625
|
-
import React40, { useCallback as
|
|
5738
|
+
import React40, { useCallback as useCallback8, useContext as useContext6 } from "react";
|
|
5626
5739
|
import { FORCE_REMOUNT } from "storybook/internal/core-events";
|
|
5627
5740
|
import { InvalidBlockOfPropError as InvalidBlockOfPropError4 } from "storybook/internal/preview-errors";
|
|
5628
5741
|
|
|
5629
5742
|
// src/blocks/blocks/Source.tsx
|
|
5630
|
-
import React39, { useContext as
|
|
5743
|
+
import React39, { useContext as useContext5, useMemo as useMemo5 } from "react";
|
|
5631
5744
|
import { SourceType } from "storybook/internal/docs-tools";
|
|
5632
5745
|
import { InvalidBlockOfPropError as InvalidBlockOfPropError3 } from "storybook/internal/preview-errors";
|
|
5633
5746
|
|
|
@@ -5798,7 +5911,7 @@ var require_es_object_atoms = __commonJS({
|
|
|
5798
5911
|
return !1;
|
|
5799
5912
|
if (typeof Symbol.iterator == "symbol")
|
|
5800
5913
|
return !0;
|
|
5801
|
-
var obj = {}, sym = Symbol("test"), symObj = Object(sym);
|
|
5914
|
+
var obj = {}, sym = /* @__PURE__ */ Symbol("test"), symObj = Object(sym);
|
|
5802
5915
|
if (typeof sym == "string" || Object.prototype.toString.call(sym) !== "[object Symbol]" || Object.prototype.toString.call(symObj) !== "[object Symbol]")
|
|
5803
5916
|
return !1;
|
|
5804
5917
|
var symVal = 42;
|
|
@@ -5826,7 +5939,7 @@ var require_es_object_atoms = __commonJS({
|
|
|
5826
5939
|
"use strict";
|
|
5827
5940
|
var origSymbol = typeof Symbol < "u" && Symbol, hasSymbolSham = require_shams();
|
|
5828
5941
|
module.exports = function() {
|
|
5829
|
-
return typeof origSymbol != "function" || typeof Symbol != "function" || typeof origSymbol("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : hasSymbolSham();
|
|
5942
|
+
return typeof origSymbol != "function" || typeof Symbol != "function" || typeof origSymbol("foo") != "symbol" || typeof /* @__PURE__ */ Symbol("bar") != "symbol" ? !1 : hasSymbolSham();
|
|
5830
5943
|
};
|
|
5831
5944
|
}
|
|
5832
5945
|
}), require_Reflect_getPrototypeOf = __commonJS({
|
|
@@ -6715,7 +6828,7 @@ var EMPTY_SOURCE_CONTEXT = { sources: {} }, getStorySource = (storyId, args, sou
|
|
|
6715
6828
|
type === SourceType.AUTO && snippet && isArgsStory ? snippet : sourceParameters.originalSource || "", transformer = transformFromProps ?? sourceParameters.transform, transformedCode = transformer ? useTransformCode(code, transformer, storyContext) : code;
|
|
6716
6829
|
return sourceParameters.code !== void 0 ? sourceParameters.code : transformedCode;
|
|
6717
6830
|
}, useSourceProps = (props, docsContext, sourceContext) => {
|
|
6718
|
-
let { of } = props, story =
|
|
6831
|
+
let { of } = props, story = useMemo5(() => {
|
|
6719
6832
|
if (of)
|
|
6720
6833
|
return docsContext.resolveOf(of, ["story"]).story;
|
|
6721
6834
|
try {
|
|
@@ -6743,19 +6856,19 @@ var EMPTY_SOURCE_CONTEXT = { sources: {} }, getStorySource = (storyId, args, sou
|
|
|
6743
6856
|
dark
|
|
6744
6857
|
});
|
|
6745
6858
|
}, SourceWithStorySnippet = (props) => {
|
|
6746
|
-
let sourceContext =
|
|
6859
|
+
let sourceContext = useContext5(SourceContext), docsContext = useContext5(DocsContext), sourceProps = useSourceProps(props, docsContext, sourceContext);
|
|
6747
6860
|
return React39.createElement(Source, { ...sourceProps });
|
|
6748
6861
|
}, SourceWithCode = (props) => {
|
|
6749
|
-
let docsContext =
|
|
6862
|
+
let docsContext = useContext5(DocsContext), sourceProps = useSourceProps(props, docsContext, EMPTY_SOURCE_CONTEXT);
|
|
6750
6863
|
return React39.createElement(Source, { ...sourceProps });
|
|
6751
6864
|
}, SourceImpl = (props) => props.code !== void 0 ? React39.createElement(SourceWithCode, { ...props }) : React39.createElement(SourceWithStorySnippet, { ...props }), Source2 = withMdxComponentOverride("Source", SourceImpl);
|
|
6752
6865
|
|
|
6753
6866
|
// src/blocks/blocks/Canvas.tsx
|
|
6754
6867
|
var CanvasImpl = (props) => {
|
|
6755
|
-
let docsContext =
|
|
6868
|
+
let docsContext = useContext6(DocsContext), sourceContext = useContext6(SourceContext), { of, source } = props;
|
|
6756
6869
|
if ("of" in props && of === void 0)
|
|
6757
6870
|
throw new InvalidBlockOfPropError4();
|
|
6758
|
-
let { story } = useOf(of || "story", ["story"]), sourceProps = useSourceProps({ ...source, ...of && { of } }, docsContext, sourceContext), layout = props.layout ?? story.parameters.layout ?? story.parameters.docs?.canvas?.layout ?? "padded", withToolbar = props.withToolbar ?? story.parameters.docs?.canvas?.withToolbar ?? !1, additionalActions = props.additionalActions ?? story.parameters.docs?.canvas?.additionalActions, sourceState = props.sourceState ?? story.parameters.docs?.canvas?.sourceState ?? "hidden", className = props.className ?? story.parameters.docs?.canvas?.className, inline = props.story?.inline ?? story.parameters?.docs?.story?.inline ?? !1, handleReloadStory =
|
|
6871
|
+
let { story } = useOf(of || "story", ["story"]), sourceProps = useSourceProps({ ...source, ...of && { of } }, docsContext, sourceContext), layout = props.layout ?? story.parameters.layout ?? story.parameters.docs?.canvas?.layout ?? "padded", withToolbar = props.withToolbar ?? story.parameters.docs?.canvas?.withToolbar ?? !1, additionalActions = props.additionalActions ?? story.parameters.docs?.canvas?.additionalActions, sourceState = props.sourceState ?? story.parameters.docs?.canvas?.sourceState ?? "hidden", className = props.className ?? story.parameters.docs?.canvas?.className, inline = props.story?.inline ?? story.parameters?.docs?.story?.inline ?? !1, handleReloadStory = useCallback8(() => {
|
|
6759
6872
|
docsContext.channel.emit(FORCE_REMOUNT, { storyId: story.id });
|
|
6760
6873
|
}, [docsContext.channel, story.id]);
|
|
6761
6874
|
return React40.createElement(
|
|
@@ -6775,11 +6888,11 @@ var CanvasImpl = (props) => {
|
|
|
6775
6888
|
}, Canvas = withMdxComponentOverride("Canvas", CanvasImpl);
|
|
6776
6889
|
|
|
6777
6890
|
// src/blocks/blocks/Controls.tsx
|
|
6778
|
-
import React41, { useContext as
|
|
6891
|
+
import React41, { useContext as useContext8 } from "react";
|
|
6779
6892
|
import { filterArgTypes as filterArgTypes2 } from "storybook/preview-api";
|
|
6780
6893
|
|
|
6781
6894
|
// src/blocks/blocks/useArgs.ts
|
|
6782
|
-
import { useCallback as
|
|
6895
|
+
import { useCallback as useCallback9, useEffect as useEffect13, useState as useState16 } from "react";
|
|
6783
6896
|
import {
|
|
6784
6897
|
RESET_STORY_ARGS,
|
|
6785
6898
|
STORY_ARGS_UPDATED,
|
|
@@ -6798,10 +6911,10 @@ var useArgs = (story, context) => {
|
|
|
6798
6911
|
};
|
|
6799
6912
|
return context.channel.on(STORY_ARGS_UPDATED, onArgsUpdated), () => context.channel.off(STORY_ARGS_UPDATED, onArgsUpdated);
|
|
6800
6913
|
}, [storyId, context.channel]);
|
|
6801
|
-
let updateArgs =
|
|
6914
|
+
let updateArgs = useCallback9(
|
|
6802
6915
|
(updatedArgs) => context.channel.emit(UPDATE_STORY_ARGS, { storyId, updatedArgs }),
|
|
6803
6916
|
[storyId, context.channel]
|
|
6804
|
-
), resetArgs =
|
|
6917
|
+
), resetArgs = useCallback9(
|
|
6805
6918
|
(argNames) => context.channel.emit(RESET_STORY_ARGS, { storyId, argNames }),
|
|
6806
6919
|
[storyId, context.channel]
|
|
6807
6920
|
);
|
|
@@ -6822,32 +6935,48 @@ var useGlobals = (story, context) => {
|
|
|
6822
6935
|
};
|
|
6823
6936
|
|
|
6824
6937
|
// src/blocks/blocks/usePrimaryStory.ts
|
|
6825
|
-
import { useContext as
|
|
6938
|
+
import { useContext as useContext7 } from "react";
|
|
6826
6939
|
import { Tag } from "storybook/internal/preview-api";
|
|
6827
6940
|
var usePrimaryStory = () => {
|
|
6828
|
-
let context =
|
|
6941
|
+
let context = useContext7(DocsContext), stories = context.componentStories();
|
|
6829
6942
|
return context.filterByAutodocs === !1 ? stories[0] : stories.find((story) => story.tags.includes(Tag.AUTODOCS));
|
|
6830
6943
|
};
|
|
6831
6944
|
|
|
6832
6945
|
// src/blocks/blocks/Controls.tsx
|
|
6833
|
-
function
|
|
6834
|
-
let
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6946
|
+
function getControlsFilterProps(story, props) {
|
|
6947
|
+
let controlsParameters = story.parameters.docs?.controls || {};
|
|
6948
|
+
return {
|
|
6949
|
+
include: props.include ?? controlsParameters.include,
|
|
6950
|
+
exclude: props.exclude ?? controlsParameters.exclude,
|
|
6951
|
+
sort: props.sort ?? controlsParameters.sort
|
|
6952
|
+
};
|
|
6838
6953
|
}
|
|
6839
|
-
|
|
6840
|
-
let
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6954
|
+
function useControlsInteractiveState(story, context) {
|
|
6955
|
+
let controlsId = $bdb11010cef70236$export$f680877a34711e37(), [args, updateArgs, resetArgs] = useArgs(story, context), [globals] = useGlobals(story, context);
|
|
6956
|
+
return { controlsId, args, globals, updateArgs, resetArgs };
|
|
6957
|
+
}
|
|
6958
|
+
var ControlsTables = ({
|
|
6959
|
+
mainName = "Story",
|
|
6960
|
+
mainRows,
|
|
6961
|
+
subcomponentRows,
|
|
6962
|
+
include,
|
|
6963
|
+
exclude,
|
|
6964
|
+
sort,
|
|
6965
|
+
storyId,
|
|
6966
|
+
controlsId,
|
|
6967
|
+
args,
|
|
6968
|
+
globals,
|
|
6969
|
+
updateArgs,
|
|
6970
|
+
resetArgs
|
|
6971
|
+
}) => {
|
|
6972
|
+
let filteredMainRows = filterArgTypes2(mainRows, include, exclude);
|
|
6973
|
+
if (Object.keys(subcomponentRows).length === 0)
|
|
6974
|
+
return Object.keys(filteredMainRows).length > 0 || Object.keys(args).length > 0 ? React41.createElement(
|
|
6846
6975
|
ArgsTable,
|
|
6847
6976
|
{
|
|
6848
|
-
storyId
|
|
6977
|
+
storyId,
|
|
6849
6978
|
controlsId,
|
|
6850
|
-
rows:
|
|
6979
|
+
rows: filteredMainRows,
|
|
6851
6980
|
sort,
|
|
6852
6981
|
args,
|
|
6853
6982
|
globals,
|
|
@@ -6855,17 +6984,17 @@ var ControlsImpl = (props) => {
|
|
|
6855
6984
|
resetArgs
|
|
6856
6985
|
}
|
|
6857
6986
|
) : null;
|
|
6858
|
-
let
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6987
|
+
let tabs = {
|
|
6988
|
+
[mainName]: { rows: filteredMainRows, sort },
|
|
6989
|
+
...Object.fromEntries(
|
|
6990
|
+
Object.entries(subcomponentRows).map(([key, rows]) => [
|
|
6991
|
+
key,
|
|
6992
|
+
{
|
|
6993
|
+
rows: filterArgTypes2(rows, include, exclude),
|
|
6994
|
+
sort
|
|
6995
|
+
}
|
|
6996
|
+
])
|
|
6997
|
+
)
|
|
6869
6998
|
};
|
|
6870
6999
|
return React41.createElement(
|
|
6871
7000
|
TabbedArgsTable,
|
|
@@ -6876,14 +7005,52 @@ var ControlsImpl = (props) => {
|
|
|
6876
7005
|
globals,
|
|
6877
7006
|
updateArgs,
|
|
6878
7007
|
resetArgs,
|
|
6879
|
-
storyId
|
|
7008
|
+
storyId,
|
|
6880
7009
|
controlsId
|
|
6881
7010
|
}
|
|
6882
7011
|
);
|
|
7012
|
+
}, LegacyControls = ({ story, context, ...props }) => {
|
|
7013
|
+
let { parameters, argTypes, component, subcomponents } = story, filterProps = getControlsFilterProps(story, props), interactiveState = useControlsInteractiveState(story, context);
|
|
7014
|
+
return argTypes ? React41.createElement(
|
|
7015
|
+
ControlsTables,
|
|
7016
|
+
{
|
|
7017
|
+
mainName: getComponentName(component) || "Story",
|
|
7018
|
+
mainRows: argTypes,
|
|
7019
|
+
subcomponentRows: extractSubcomponentArgTypes(subcomponents, parameters),
|
|
7020
|
+
...filterProps,
|
|
7021
|
+
storyId: story.id,
|
|
7022
|
+
...interactiveState
|
|
7023
|
+
}
|
|
7024
|
+
) : null;
|
|
7025
|
+
}, DocgenServiceControls = ({ story, context, ...props }) => {
|
|
7026
|
+
let { parameters, argTypes, component } = story, filterProps = getControlsFilterProps(story, props), interactiveState = useControlsInteractiveState(story, context), serviceRows = useDocgenServiceRows({
|
|
7027
|
+
componentId: story.id.split("--")[0],
|
|
7028
|
+
storyId: story.id,
|
|
7029
|
+
parameters,
|
|
7030
|
+
initialArgs: story.initialArgs,
|
|
7031
|
+
customArgTypes: argTypes
|
|
7032
|
+
});
|
|
7033
|
+
return serviceRows ? React41.createElement(
|
|
7034
|
+
ControlsTables,
|
|
7035
|
+
{
|
|
7036
|
+
mainName: getComponentName(component) ?? serviceRows.serviceComponentName,
|
|
7037
|
+
mainRows: serviceRows.mainRows,
|
|
7038
|
+
subcomponentRows: serviceRows.subcomponentRows,
|
|
7039
|
+
...filterProps,
|
|
7040
|
+
storyId: story.id,
|
|
7041
|
+
...interactiveState
|
|
7042
|
+
}
|
|
7043
|
+
) : null;
|
|
7044
|
+
}, ControlsImpl = (props) => {
|
|
7045
|
+
let { of } = props, context = useContext8(DocsContext), primaryStory = usePrimaryStory(), story = of ? context.resolveOf(of, ["story"]).story : primaryStory;
|
|
7046
|
+
if (!story)
|
|
7047
|
+
return null;
|
|
7048
|
+
let storyProps = { ...props, story, context };
|
|
7049
|
+
return globalThis.FEATURES?.experimentalDocgenServer ? React41.createElement(DocgenServiceControls, { ...storyProps }) : React41.createElement(LegacyControls, { ...storyProps });
|
|
6883
7050
|
}, Controls3 = withMdxComponentOverride("Controls", ControlsImpl);
|
|
6884
7051
|
|
|
6885
7052
|
// src/blocks/blocks/Description.tsx
|
|
6886
|
-
import React44 from "react";
|
|
7053
|
+
import React44, { useContext as useContext10 } from "react";
|
|
6887
7054
|
import { InvalidBlockOfPropError as InvalidBlockOfPropError5 } from "storybook/internal/preview-errors";
|
|
6888
7055
|
|
|
6889
7056
|
// src/blocks/blocks/Markdown.tsx
|
|
@@ -6891,7 +7058,7 @@ import React43 from "react";
|
|
|
6891
7058
|
import { dedent } from "ts-dedent";
|
|
6892
7059
|
|
|
6893
7060
|
// src/blocks/blocks/mdx.tsx
|
|
6894
|
-
import React42, { useContext as
|
|
7061
|
+
import React42, { useContext as useContext9 } from "react";
|
|
6895
7062
|
import { Button as Button8, Code, components, nameSpaceClassNames } from "storybook/internal/components";
|
|
6896
7063
|
import { NAVIGATE_URL as NAVIGATE_URL2 } from "storybook/internal/core-events";
|
|
6897
7064
|
import { LinkIcon } from "@storybook/icons";
|
|
@@ -6925,7 +7092,7 @@ function navigate(context, url) {
|
|
|
6925
7092
|
context.channel.emit(NAVIGATE_URL2, url);
|
|
6926
7093
|
}
|
|
6927
7094
|
var A2 = components.a, AnchorInPage = ({ hash, children }) => {
|
|
6928
|
-
let context =
|
|
7095
|
+
let context = useContext9(DocsContext);
|
|
6929
7096
|
return React42.createElement(
|
|
6930
7097
|
A2,
|
|
6931
7098
|
{
|
|
@@ -6939,7 +7106,7 @@ var A2 = components.a, AnchorInPage = ({ hash, children }) => {
|
|
|
6939
7106
|
children
|
|
6940
7107
|
);
|
|
6941
7108
|
}, AnchorMdx = (props) => {
|
|
6942
|
-
let { href, target, children, ...rest } = props, context =
|
|
7109
|
+
let { href, target, children, ...rest } = props, context = useContext9(DocsContext);
|
|
6943
7110
|
return !href || target === "_blank" || /^https?:\/\//.test(href) ? React42.createElement(A2, { ...props }) : href.startsWith("#") ? React42.createElement(AnchorInPage, { hash: href }, children) : React42.createElement(
|
|
6944
7111
|
A2,
|
|
6945
7112
|
{
|
|
@@ -6996,7 +7163,7 @@ var A2 = components.a, AnchorInPage = ({ hash, children }) => {
|
|
|
6996
7163
|
children,
|
|
6997
7164
|
...rest
|
|
6998
7165
|
}) => {
|
|
6999
|
-
let context =
|
|
7166
|
+
let context = useContext9(DocsContext), OcticonHeader = OcticonHeaders[as], hash = `#${id}`;
|
|
7000
7167
|
return React42.createElement(OcticonHeader, { id, ...rest }, React42.createElement(OcticonAlignmentWrapper, { className: "sb-unstyled" }, React42.createElement(OcticonAnchorWrapper, null, React42.createElement(
|
|
7001
7168
|
Button8,
|
|
7002
7169
|
{
|
|
@@ -7076,7 +7243,7 @@ var MarkdownImpl = (props) => {
|
|
|
7076
7243
|
}, Markdown = withMdxComponentOverride("Markdown", MarkdownImpl);
|
|
7077
7244
|
|
|
7078
7245
|
// src/blocks/blocks/Description.tsx
|
|
7079
|
-
var DescriptionType = /* @__PURE__ */ ((DescriptionType2) => (DescriptionType2.INFO = "info", DescriptionType2.NOTES = "notes", DescriptionType2.DOCGEN = "docgen", DescriptionType2.AUTO = "auto", DescriptionType2))(DescriptionType || {}), getDescriptionFromResolvedOf = (resolvedOf) => {
|
|
7246
|
+
var DescriptionType = /* @__PURE__ */ ((DescriptionType2) => (DescriptionType2.INFO = "info", DescriptionType2.NOTES = "notes", DescriptionType2.DOCGEN = "docgen", DescriptionType2.AUTO = "auto", DescriptionType2))(DescriptionType || {}), getDescriptionFromResolvedOf = (resolvedOf, serviceComponentDescription) => {
|
|
7080
7247
|
switch (resolvedOf.type) {
|
|
7081
7248
|
case "story":
|
|
7082
7249
|
return resolvedOf.story.parameters.docs?.description?.story || null;
|
|
@@ -7085,7 +7252,7 @@ var DescriptionType = /* @__PURE__ */ ((DescriptionType2) => (DescriptionType2.I
|
|
|
7085
7252
|
return metaDescription || parameters.docs?.extractComponentDescription?.(component, {
|
|
7086
7253
|
component,
|
|
7087
7254
|
parameters
|
|
7088
|
-
}) || null;
|
|
7255
|
+
}) || serviceComponentDescription || null;
|
|
7089
7256
|
}
|
|
7090
7257
|
case "component": {
|
|
7091
7258
|
let {
|
|
@@ -7095,18 +7262,21 @@ var DescriptionType = /* @__PURE__ */ ((DescriptionType2) => (DescriptionType2.I
|
|
|
7095
7262
|
return parameters?.docs?.extractComponentDescription?.(component, {
|
|
7096
7263
|
component,
|
|
7097
7264
|
parameters
|
|
7098
|
-
}) || null;
|
|
7265
|
+
}) || serviceComponentDescription || null;
|
|
7099
7266
|
}
|
|
7100
7267
|
default:
|
|
7101
7268
|
throw new Error(
|
|
7102
7269
|
`Unrecognized module type resolved from 'useOf', got: ${resolvedOf.type}`
|
|
7103
7270
|
);
|
|
7104
7271
|
}
|
|
7272
|
+
}, useServiceComponentDescription = (resolvedOf) => {
|
|
7273
|
+
let context = useContext10(DocsContext), componentId;
|
|
7274
|
+
return globalThis.FEATURES?.experimentalDocgenServer && (resolvedOf.type === "meta" ? componentId = resolvedOf.preparedMeta.componentId : resolvedOf.type === "component" && (componentId = context.getComponentId(resolvedOf.component))), useServiceDocgen(componentId)?.description || void 0;
|
|
7105
7275
|
}, DescriptionImpl = (props) => {
|
|
7106
7276
|
let { of } = props;
|
|
7107
7277
|
if ("of" in props && of === void 0)
|
|
7108
7278
|
throw new InvalidBlockOfPropError5();
|
|
7109
|
-
let resolvedOf = useOf(of || "meta"), markdown = getDescriptionFromResolvedOf(resolvedOf);
|
|
7279
|
+
let resolvedOf = useOf(of || "meta"), serviceComponentDescription = useServiceComponentDescription(resolvedOf), markdown = getDescriptionFromResolvedOf(resolvedOf, serviceComponentDescription);
|
|
7110
7280
|
return markdown ? React44.createElement(Markdown, null, markdown) : null;
|
|
7111
7281
|
}, Description2 = withMdxComponentOverride("Description", DescriptionImpl);
|
|
7112
7282
|
|
|
@@ -7114,7 +7284,7 @@ var DescriptionType = /* @__PURE__ */ ((DescriptionType2) => (DescriptionType2.I
|
|
|
7114
7284
|
import React54 from "react";
|
|
7115
7285
|
|
|
7116
7286
|
// src/blocks/blocks/DocsContainer.tsx
|
|
7117
|
-
import React45, { useEffect as useEffect15, useMemo as
|
|
7287
|
+
import React45, { useEffect as useEffect15, useMemo as useMemo6 } from "react";
|
|
7118
7288
|
import { ThemeProvider, ensure as ensureTheme } from "storybook/theming";
|
|
7119
7289
|
|
|
7120
7290
|
// src/blocks/blocks/DocsSluggerContext.ts
|
|
@@ -7175,7 +7345,7 @@ var { document: document3, window: globalWindow3 } = globalThis, DocsContainer =
|
|
|
7175
7345
|
theme,
|
|
7176
7346
|
children
|
|
7177
7347
|
}) => {
|
|
7178
|
-
let slugger =
|
|
7348
|
+
let slugger = useMemo6(() => createDocsSlugger(), []), toc;
|
|
7179
7349
|
try {
|
|
7180
7350
|
toc = context.resolveOf("meta", ["meta"]).preparedMeta.parameters?.docs?.toc;
|
|
7181
7351
|
} catch {
|
|
@@ -7270,7 +7440,7 @@ var PrimaryImpl = () => {
|
|
|
7270
7440
|
}, Primary = withMdxComponentOverride("Primary", PrimaryImpl);
|
|
7271
7441
|
|
|
7272
7442
|
// src/blocks/blocks/Stories.tsx
|
|
7273
|
-
import React50, { useContext as
|
|
7443
|
+
import React50, { useContext as useContext11 } from "react";
|
|
7274
7444
|
import { Tag as Tag2 } from "storybook/internal/preview-api";
|
|
7275
7445
|
import { styled as styled29 } from "storybook/theming";
|
|
7276
7446
|
var StyledHeading = styled29(Heading2)(({ theme }) => ({
|
|
@@ -7287,7 +7457,7 @@ var StyledHeading = styled29(Heading2)(({ theme }) => ({
|
|
|
7287
7457
|
marginTop: "56px"
|
|
7288
7458
|
}
|
|
7289
7459
|
})), StoriesImpl = ({ title = "Stories", includePrimary = !0 }) => {
|
|
7290
|
-
let { componentStories, projectAnnotations, getStoryContext } =
|
|
7460
|
+
let { componentStories, projectAnnotations, getStoryContext } = useContext11(DocsContext), stories = componentStories(), { stories: { filter } = { filter: void 0 } } = projectAnnotations.parameters?.docs || {};
|
|
7291
7461
|
return filter && (stories = stories.filter((story) => filter(story, getStoryContext(story)))), stories.some((story) => story.tags?.includes(Tag2.AUTODOCS)) && (stories = stories.filter((story) => story.tags?.includes(Tag2.AUTODOCS) && !story.usesMount)), includePrimary || (stories = stories.slice(1)), !stories || stories.length === 0 ? null : React50.createElement(React50.Fragment, null, typeof title == "string" ? React50.createElement(StyledHeading, null, title) : title, stories.map(
|
|
7292
7462
|
(story) => story && React50.createElement(DocsStory, { key: story.id, of: story.moduleExport, expanded: !0, __forceInitialArgs: !0 })
|
|
7293
7463
|
));
|
|
@@ -7353,7 +7523,8 @@ function Docs({
|
|
|
7353
7523
|
}
|
|
7354
7524
|
|
|
7355
7525
|
// src/blocks/blocks/external/ExternalDocs.tsx
|
|
7356
|
-
import React55, { useRef as
|
|
7526
|
+
import React55, { useRef as useRef7 } from "react";
|
|
7527
|
+
import { deprecate as deprecate2 } from "storybook/internal/client-logger";
|
|
7357
7528
|
import { composeConfigs as composeConfigs2 } from "storybook/preview-api";
|
|
7358
7529
|
|
|
7359
7530
|
// src/blocks/blocks/external/ExternalPreview.ts
|
|
@@ -7435,13 +7606,14 @@ var ConstantMap = class {
|
|
|
7435
7606
|
|
|
7436
7607
|
// src/blocks/blocks/external/ExternalDocs.tsx
|
|
7437
7608
|
function usePreview(projectAnnotations) {
|
|
7438
|
-
let previewRef =
|
|
7609
|
+
let previewRef = useRef7();
|
|
7439
7610
|
return previewRef.current || (previewRef.current = new ExternalPreview(projectAnnotations)), previewRef.current;
|
|
7440
7611
|
}
|
|
7441
7612
|
function ExternalDocs({
|
|
7442
7613
|
projectAnnotationsList,
|
|
7443
7614
|
children
|
|
7444
7615
|
}) {
|
|
7616
|
+
deprecate2("ExternalDocs is deprecated and will be removed in Storybook 11.");
|
|
7445
7617
|
let projectAnnotations = composeConfigs2(projectAnnotationsList), preview2 = usePreview(projectAnnotations), docsParameter = {
|
|
7446
7618
|
...projectAnnotations.parameters?.docs,
|
|
7447
7619
|
page: () => children
|
|
@@ -7451,13 +7623,14 @@ function ExternalDocs({
|
|
|
7451
7623
|
|
|
7452
7624
|
// src/blocks/blocks/external/ExternalDocsContainer.tsx
|
|
7453
7625
|
import React56 from "react";
|
|
7626
|
+
import { deprecate as deprecate3 } from "storybook/internal/client-logger";
|
|
7454
7627
|
import { ThemeProvider as ThemeProvider2, ensure, themes } from "storybook/theming";
|
|
7455
|
-
var preview, ExternalDocsContainer = ({ projectAnnotations, children }) => (preview || (preview = new ExternalPreview(projectAnnotations)), React56.createElement(DocsContext.Provider, { value: preview.docsContext() }, React56.createElement(ThemeProvider2, { theme: ensure(themes.light) }, children)));
|
|
7628
|
+
var preview, ExternalDocsContainer = ({ projectAnnotations, children }) => (deprecate3("ExternalDocsContainer is deprecated and will be removed in Storybook 11."), preview || (preview = new ExternalPreview(projectAnnotations)), React56.createElement(DocsContext.Provider, { value: preview.docsContext() }, React56.createElement(ThemeProvider2, { theme: ensure(themes.light) }, children)));
|
|
7456
7629
|
|
|
7457
7630
|
// src/blocks/blocks/Meta.tsx
|
|
7458
|
-
import React57, { useContext as
|
|
7631
|
+
import React57, { useContext as useContext12 } from "react";
|
|
7459
7632
|
var Meta = ({ of }) => {
|
|
7460
|
-
let context =
|
|
7633
|
+
let context = useContext12(DocsContext);
|
|
7461
7634
|
of && context.referenceMeta(of, !0);
|
|
7462
7635
|
try {
|
|
7463
7636
|
let primary = context.storyById();
|
|
@@ -7537,6 +7710,7 @@ export {
|
|
|
7537
7710
|
formatTime,
|
|
7538
7711
|
getStoryId,
|
|
7539
7712
|
getStoryProps,
|
|
7713
|
+
normalizeOptions,
|
|
7540
7714
|
parse2 as parse,
|
|
7541
7715
|
parseDate,
|
|
7542
7716
|
parseTime,
|