storybook 10.0.0-beta.5 → 10.0.0-beta.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/assets/server/openBrowser.applescript +94 -0
- package/dist/_browser-chunks/{WithTooltip-ERFLZL6W.js → WithTooltip-SK46ZJ2J.js} +1 -1
- package/dist/_browser-chunks/{chunk-EOILZP2R.js → chunk-BOOOPFZF.js} +7 -2
- package/dist/_browser-chunks/{chunk-YQV3EGQ5.js → chunk-OQ6NCFPL.js} +38 -15
- package/dist/_browser-chunks/{chunk-O5R5CGFA.js → chunk-TMDZCWME.js} +1 -2
- package/dist/_node-chunks/{builder-manager-ZTS4EIKQ.js → builder-manager-VFP7HSCF.js} +21 -151
- package/dist/_node-chunks/camelcase-ZLZNQMDD.js +18 -0
- package/dist/_node-chunks/{chunk-VQN4WAIA.js → chunk-2GCKJYK6.js} +7 -7
- package/dist/_node-chunks/{chunk-H52PBBSK.js → chunk-3NIQHNDU.js} +7 -7
- package/dist/_node-chunks/{chunk-3VVGIILJ.js → chunk-3QZ7KLON.js} +8 -8
- package/dist/_node-chunks/{chunk-VWSUFVUF.js → chunk-3XXQRL3A.js} +7 -7
- package/dist/_node-chunks/{chunk-OC3TVLYU.js → chunk-46BWYN3K.js} +7 -7
- package/dist/_node-chunks/{chunk-VX5P3IYA.js → chunk-4DIDWIST.js} +7 -7
- package/dist/_node-chunks/{chunk-TBWOUVTA.js → chunk-5YUTWYNI.js} +709 -935
- package/dist/_node-chunks/{chunk-4VDRH7SM.js → chunk-A2DKPKBY.js} +7 -7
- package/dist/_node-chunks/{chunk-KU3JBNPY.js → chunk-BC23FKU4.js} +8 -8
- package/dist/_node-chunks/{chunk-KZB7ELL6.js → chunk-BID2X7MU.js} +7 -7
- package/dist/_node-chunks/{chunk-PIKDGR3O.js → chunk-C4EOB63P.js} +7 -7
- package/dist/_node-chunks/{chunk-TVKUJ3SE.js → chunk-DH7BCQMG.js} +8 -8
- package/dist/_node-chunks/{chunk-J3DQMIO4.js → chunk-FCNWWJV7.js} +7 -7
- package/dist/_node-chunks/{chunk-EIHJ5J3O.js → chunk-GBZZSL2K.js} +264 -109
- package/dist/_node-chunks/{chunk-F7YW5W6B.js → chunk-GCWAGPDV.js} +12 -12
- package/dist/_node-chunks/{chunk-K4YETNYJ.js → chunk-I7SRMFT5.js} +7 -7
- package/dist/_node-chunks/{chunk-TKN5TEZV.js → chunk-IEFSRAX2.js} +13 -13
- package/dist/_node-chunks/{chunk-AK5PHLUA.js → chunk-IGWCAXA2.js} +7 -7
- package/dist/_node-chunks/chunk-IYOHZPPC.js +18 -0
- package/dist/_node-chunks/{chunk-F3WE3456.js → chunk-KVOP6ASA.js} +7 -7
- package/dist/_node-chunks/{chunk-DZJNLBBL.js → chunk-MHVF6Y35.js} +7 -7
- package/dist/_node-chunks/{chunk-UTCFHTQH.js → chunk-MRCMZPA2.js} +7 -7
- package/dist/_node-chunks/chunk-RNHUADRS.js +62 -0
- package/dist/_node-chunks/{chunk-4KRR46V2.js → chunk-RP3VMQPF.js} +15 -15
- package/dist/_node-chunks/{chunk-P7YMEOXF.js → chunk-TFIGR2HH.js} +7 -7
- package/dist/_node-chunks/{chunk-SW3VZAH7.js → chunk-TXDIOSHI.js} +9 -9
- package/dist/_node-chunks/{chunk-WCSHG2QT.js → chunk-U6MJQ7C6.js} +7 -7
- package/dist/_node-chunks/{chunk-ACUNHBEO.js → chunk-XXVKM2ZR.js} +26 -23
- package/dist/_node-chunks/{chunk-QHIU5I7C.js → chunk-YWU65VY4.js} +6 -6
- package/dist/_node-chunks/{chunk-P3TWEOO5.js → chunk-Z3PLI7S2.js} +7 -7
- package/dist/_node-chunks/{chunk-2VMDKLSW.js → chunk-ZM2HT2RW.js} +6 -6
- package/dist/_node-chunks/{chunk-D7SDB4XE.js → chunk-ZPNXCXIT.js} +8 -8
- package/dist/_node-chunks/{dist-OGRBL76N.js → dist-PG4I7ZDU.js} +9 -9
- package/dist/_node-chunks/{globby-65LOULA6.js → globby-HXB6X43W.js} +17 -13
- package/dist/_node-chunks/{lib-TF7JCT3A.js → lib-4JJTZC7T.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-6ZJEUZMZ.js → mdx-N42X6CFJ-3JBJ7PQF.js} +8 -8
- package/dist/_node-chunks/{p-limit-PF7JSPDT.js → p-limit-WBBNX4KI.js} +7 -7
- package/dist/_node-chunks/{plugin-A6XAWMXN.js → plugin-SEQ2OPRK.js} +10 -10
- package/dist/_node-chunks/{plugin-LGHGAC6J.js → plugin-SG6I7RFC.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-HDSEOU3Z.js → webpack-inject-mocker-runtime-plugin-5O25VYCQ.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-ZJJVMJUS.js → webpack-mock-plugin-35I32SAF.js} +9 -9
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +11 -11
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +8 -8
- package/dist/cli/index.js +27 -22
- package/dist/common/index.js +21 -21
- package/dist/components/index.js +8 -4
- package/dist/core-events/index.d.ts +18 -2
- package/dist/core-events/index.js +7 -1
- package/dist/core-server/index.js +1157 -1024
- package/dist/core-server/presets/common-manager.js +84 -39
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +691 -29
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf/index.d.ts +9 -4
- package/dist/csf/index.js +37 -8
- package/dist/csf-tools/index.d.ts +13 -6
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +1318 -1001
- package/dist/manager/globals.d.ts +0 -4
- package/dist/manager/globals.js +1 -6
- package/dist/manager/runtime.js +2198 -721
- package/dist/manager-api/index.d.ts +12 -5
- package/dist/manager-api/index.js +347 -76
- package/dist/node-logger/index.js +14 -14
- package/dist/preview/runtime.js +103 -63
- package/dist/preview-api/index.d.ts +70 -71
- package/dist/preview-api/index.js +1 -1
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +24 -24
- package/dist/types/index.d.ts +28 -7
- package/dist/viewport/index.d.ts +36 -4
- package/dist/viewport/index.js +1 -1
- package/package.json +5 -4
- package/dist/_node-chunks/camelcase-K3BM7RII.js +0 -18
- package/dist/_node-chunks/chunk-7LG5CLCT.js +0 -18
- package/dist/_node-chunks/chunk-DWJ7TV2O.js +0 -62
- package/dist/_node-chunks/default-browser-id-4RZZMHJE.js +0 -1719
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
import {
|
|
56
56
|
MINIMAL_VIEWPORTS,
|
|
57
57
|
responsiveViewport
|
|
58
|
-
} from "../../_browser-chunks/chunk-
|
|
58
|
+
} from "../../_browser-chunks/chunk-TMDZCWME.js";
|
|
59
59
|
import {
|
|
60
60
|
ADDON_ID as ADDON_ID2,
|
|
61
61
|
PARAM_KEY as PARAM_KEY2,
|
|
@@ -86,6 +86,7 @@ import {
|
|
|
86
86
|
useArgs,
|
|
87
87
|
useGlobals,
|
|
88
88
|
useParameter,
|
|
89
|
+
useStorybookApi,
|
|
89
90
|
useStorybookState
|
|
90
91
|
} from "storybook/manager-api";
|
|
91
92
|
import { styled as styled30 } from "storybook/theming";
|
|
@@ -5325,6 +5326,7 @@ var AddonWrapper = styled30.div({
|
|
|
5325
5326
|
overflowY: "auto"
|
|
5326
5327
|
});
|
|
5327
5328
|
var ControlsPanel = /* @__PURE__ */ __name(({ saveStory, createStory }) => {
|
|
5329
|
+
const api = useStorybookApi();
|
|
5328
5330
|
const [isLoading, setIsLoading] = useState13(true);
|
|
5329
5331
|
const [args, updateArgs, resetArgs, initialArgs] = useArgs();
|
|
5330
5332
|
const [globals] = useGlobals();
|
|
@@ -5336,6 +5338,7 @@ var ControlsPanel = /* @__PURE__ */ __name(({ saveStory, createStory }) => {
|
|
|
5336
5338
|
disableSaveFromUI = false
|
|
5337
5339
|
} = useParameter(PARAM_KEY5, {});
|
|
5338
5340
|
const { path, previewInitialized } = useStorybookState();
|
|
5341
|
+
const storyData = api.getCurrentStoryData();
|
|
5339
5342
|
useEffect10(() => {
|
|
5340
5343
|
if (previewInitialized) {
|
|
5341
5344
|
setIsLoading(false);
|
|
@@ -5369,15 +5372,15 @@ var ControlsPanel = /* @__PURE__ */ __name(({ saveStory, createStory }) => {
|
|
|
5369
5372
|
sort,
|
|
5370
5373
|
isLoading
|
|
5371
5374
|
}
|
|
5372
|
-
), hasControls && hasUpdatedArgs && global.CONFIG_TYPE === "DEVELOPMENT" && disableSaveFromUI !== true && React37.createElement(SaveStory, { ...{ resetArgs, saveStory, createStory } }));
|
|
5375
|
+
), hasControls && storyData.type === "story" && storyData.subtype !== "test" && hasUpdatedArgs && global.CONFIG_TYPE === "DEVELOPMENT" && disableSaveFromUI !== true && React37.createElement(SaveStory, { ...{ resetArgs, saveStory, createStory } }));
|
|
5373
5376
|
}, "ControlsPanel");
|
|
5374
5377
|
|
|
5375
5378
|
// src/controls/components/Title.tsx
|
|
5376
5379
|
import React38 from "react";
|
|
5377
5380
|
import { Badge } from "storybook/internal/components";
|
|
5378
|
-
import { useArgTypes as useArgTypes2, useStorybookApi } from "storybook/manager-api";
|
|
5381
|
+
import { useArgTypes as useArgTypes2, useStorybookApi as useStorybookApi2 } from "storybook/manager-api";
|
|
5379
5382
|
function Title2() {
|
|
5380
|
-
const api =
|
|
5383
|
+
const api = useStorybookApi2();
|
|
5381
5384
|
const selectedPanel = api.getSelectedPanel();
|
|
5382
5385
|
const rows = useArgTypes2();
|
|
5383
5386
|
const controlsCount = Object.values(rows).filter(
|
|
@@ -5501,9 +5504,9 @@ import { addons as addons2, types as types2 } from "storybook/manager-api";
|
|
|
5501
5504
|
import React40 from "react";
|
|
5502
5505
|
import { Badge as Badge2 } from "storybook/internal/components";
|
|
5503
5506
|
import { STORY_CHANGED } from "storybook/internal/core-events";
|
|
5504
|
-
import { useAddonState, useChannel, useStorybookApi as
|
|
5507
|
+
import { useAddonState, useChannel, useStorybookApi as useStorybookApi3 } from "storybook/manager-api";
|
|
5505
5508
|
function Title3() {
|
|
5506
|
-
const api =
|
|
5509
|
+
const api = useStorybookApi3();
|
|
5507
5510
|
const selectedPanel = api.getSelectedPanel();
|
|
5508
5511
|
const [{ count }, setCount] = useAddonState(ADDON_ID, { count: 0 });
|
|
5509
5512
|
useChannel({
|
|
@@ -6893,7 +6896,9 @@ import {
|
|
|
6893
6896
|
experimental_useStatusStore,
|
|
6894
6897
|
useAddonState as useAddonState2,
|
|
6895
6898
|
useChannel as useChannel2,
|
|
6896
|
-
useParameter as useParameter2
|
|
6899
|
+
useParameter as useParameter2,
|
|
6900
|
+
useStorybookApi as useStorybookApi6,
|
|
6901
|
+
useStorybookState as useStorybookState2
|
|
6897
6902
|
} from "storybook/manager-api";
|
|
6898
6903
|
|
|
6899
6904
|
// src/component-testing/constants.ts
|
|
@@ -7049,7 +7054,7 @@ var DetachedDebuggerMessage = /* @__PURE__ */ __name(({ storyUrl }) => {
|
|
|
7049
7054
|
import React47, { useEffect as useEffect12, useState as useState15 } from "react";
|
|
7050
7055
|
import { EmptyTabContent as EmptyTabContent2, Link as Link5 } from "storybook/internal/components";
|
|
7051
7056
|
import { DocumentIcon as DocumentIcon3 } from "@storybook/icons";
|
|
7052
|
-
import { useStorybookApi as
|
|
7057
|
+
import { useStorybookApi as useStorybookApi4 } from "storybook/manager-api";
|
|
7053
7058
|
import { styled as styled34 } from "storybook/theming";
|
|
7054
7059
|
var Links2 = styled34.div(({ theme: theme3 }) => ({
|
|
7055
7060
|
display: "flex",
|
|
@@ -7058,7 +7063,7 @@ var Links2 = styled34.div(({ theme: theme3 }) => ({
|
|
|
7058
7063
|
}));
|
|
7059
7064
|
var Empty2 = /* @__PURE__ */ __name(() => {
|
|
7060
7065
|
const [isLoading, setIsLoading] = useState15(true);
|
|
7061
|
-
const api =
|
|
7066
|
+
const api = useStorybookApi4();
|
|
7062
7067
|
const docsUrl = api.getDocsUrl({
|
|
7063
7068
|
subpath: DOCUMENTATION_PLAY_FUNCTION_LINK,
|
|
7064
7069
|
versioned: true,
|
|
@@ -8623,8 +8628,10 @@ var StyledIconButton2 = styled39(IconButton6)(({ theme: theme3 }) => ({
|
|
|
8623
8628
|
var StyledSeparator = styled39(Separator)({
|
|
8624
8629
|
marginTop: 0
|
|
8625
8630
|
});
|
|
8626
|
-
var StyledLocation = styled39(P2)(({ theme: theme3 }) => ({
|
|
8627
|
-
color: theme3.textMutedColor,
|
|
8631
|
+
var StyledLocation = styled39(P2)(({ theme: theme3, isText }) => ({
|
|
8632
|
+
color: isText ? theme3.textMutedColor : theme3.color.secondary,
|
|
8633
|
+
cursor: isText ? "default" : "pointer",
|
|
8634
|
+
fontWeight: isText ? theme3.typography.weight.regular : theme3.typography.weight.bold,
|
|
8628
8635
|
justifyContent: "flex-end",
|
|
8629
8636
|
textAlign: "right",
|
|
8630
8637
|
whiteSpace: "nowrap",
|
|
@@ -8657,7 +8664,10 @@ var Subnav = /* @__PURE__ */ __name(({
|
|
|
8657
8664
|
controlStates,
|
|
8658
8665
|
status,
|
|
8659
8666
|
storyFileName,
|
|
8660
|
-
onScrollToEnd
|
|
8667
|
+
onScrollToEnd,
|
|
8668
|
+
importPath,
|
|
8669
|
+
canOpenInEditor,
|
|
8670
|
+
api
|
|
8661
8671
|
}) => {
|
|
8662
8672
|
const buttonText = status === "errored" ? "Scroll to error" : "Scroll to end";
|
|
8663
8673
|
const theme3 = useTheme7();
|
|
@@ -8693,13 +8703,32 @@ var Subnav = /* @__PURE__ */ __name(({
|
|
|
8693
8703
|
disabled: !controlStates.end
|
|
8694
8704
|
},
|
|
8695
8705
|
React63.createElement(FastForwardIcon, null)
|
|
8696
|
-
)), React63.createElement(WithTooltip3, { trigger: "hover", hasChrome: false, tooltip: React63.createElement(Note2, { note: "Rerun" }) }, React63.createElement(RerunButton, { "aria-label": "Rerun", onClick: controls.rerun }, React63.createElement(SyncIcon, null)))), storyFileName && React63.createElement(Group, null, React63.createElement(
|
|
8706
|
+
)), React63.createElement(WithTooltip3, { trigger: "hover", hasChrome: false, tooltip: React63.createElement(Note2, { note: "Rerun" }) }, React63.createElement(RerunButton, { "aria-label": "Rerun", onClick: controls.rerun }, React63.createElement(SyncIcon, null)))), (importPath || storyFileName) && React63.createElement(Group, null, canOpenInEditor ? React63.createElement(
|
|
8707
|
+
WithTooltip3,
|
|
8708
|
+
{
|
|
8709
|
+
trigger: "hover",
|
|
8710
|
+
hasChrome: false,
|
|
8711
|
+
tooltip: React63.createElement(Note2, { note: "Open in editor" })
|
|
8712
|
+
},
|
|
8713
|
+
React63.createElement(
|
|
8714
|
+
StyledLocation,
|
|
8715
|
+
{
|
|
8716
|
+
"aria-label": "Open in editor",
|
|
8717
|
+
onClick: () => {
|
|
8718
|
+
api.openInEditor({
|
|
8719
|
+
file: importPath
|
|
8720
|
+
});
|
|
8721
|
+
}
|
|
8722
|
+
},
|
|
8723
|
+
storyFileName
|
|
8724
|
+
)
|
|
8725
|
+
) : React63.createElement(StyledLocation, { isText: true }, storyFileName)))));
|
|
8697
8726
|
}, "Subnav");
|
|
8698
8727
|
|
|
8699
8728
|
// src/component-testing/components/TestDiscrepancyMessage.tsx
|
|
8700
8729
|
import React64 from "react";
|
|
8701
8730
|
import { Link as Link6 } from "storybook/internal/components";
|
|
8702
|
-
import { useStorybookApi as
|
|
8731
|
+
import { useStorybookApi as useStorybookApi5 } from "storybook/manager-api";
|
|
8703
8732
|
import { styled as styled40 } from "storybook/theming";
|
|
8704
8733
|
var Wrapper12 = styled40.div(({ theme: { color: color2, typography: typography4, background } }) => ({
|
|
8705
8734
|
textAlign: "start",
|
|
@@ -8723,7 +8752,7 @@ var Wrapper12 = styled40.div(({ theme: { color: color2, typography: typography4,
|
|
|
8723
8752
|
}
|
|
8724
8753
|
}));
|
|
8725
8754
|
var TestDiscrepancyMessage = /* @__PURE__ */ __name(({ browserTestStatus }) => {
|
|
8726
|
-
const api =
|
|
8755
|
+
const api = useStorybookApi5();
|
|
8727
8756
|
const docsUrl = api.getDocsUrl({
|
|
8728
8757
|
subpath: DOCUMENTATION_DISCREPANCY_LINK,
|
|
8729
8758
|
versioned: true,
|
|
@@ -8787,7 +8816,10 @@ var InteractionsPanel = React65.memo(
|
|
|
8787
8816
|
onScrollToEnd,
|
|
8788
8817
|
endRef,
|
|
8789
8818
|
hasResultMismatch,
|
|
8790
|
-
browserTestStatus
|
|
8819
|
+
browserTestStatus,
|
|
8820
|
+
importPath,
|
|
8821
|
+
canOpenInEditor,
|
|
8822
|
+
api
|
|
8791
8823
|
}) {
|
|
8792
8824
|
const filter = useAnsiToHtmlFilter();
|
|
8793
8825
|
const hasRealInteractions = interactions.some((i2) => i2.id !== INTERNAL_RENDER_CALL_ID);
|
|
@@ -8798,7 +8830,10 @@ var InteractionsPanel = React65.memo(
|
|
|
8798
8830
|
controlStates,
|
|
8799
8831
|
status,
|
|
8800
8832
|
storyFileName: fileName,
|
|
8801
|
-
onScrollToEnd
|
|
8833
|
+
onScrollToEnd,
|
|
8834
|
+
importPath,
|
|
8835
|
+
canOpenInEditor,
|
|
8836
|
+
api
|
|
8802
8837
|
}
|
|
8803
8838
|
), React65.createElement("div", { "aria-label": "Interactions list" }, interactions.map((call) => React65.createElement(
|
|
8804
8839
|
Interaction,
|
|
@@ -8933,13 +8968,18 @@ var getInternalRenderLogItem = /* @__PURE__ */ __name((status) => ({
|
|
|
8933
8968
|
}), "getInternalRenderLogItem");
|
|
8934
8969
|
var Panel = memo4(
|
|
8935
8970
|
/* @__PURE__ */ __name(function PanelMemoized({ refId, storyId, storyUrl }) {
|
|
8936
|
-
const { statusValue, testRunId } = experimental_useStatusStore((
|
|
8937
|
-
const storyStatus = refId ? void 0 :
|
|
8971
|
+
const { statusValue, testRunId } = experimental_useStatusStore((state2) => {
|
|
8972
|
+
const storyStatus = refId ? void 0 : state2[storyId]?.[STATUS_TYPE_ID_COMPONENT_TEST];
|
|
8938
8973
|
return {
|
|
8939
8974
|
statusValue: storyStatus?.value,
|
|
8940
8975
|
testRunId: storyStatus?.data?.testRunId
|
|
8941
8976
|
};
|
|
8942
8977
|
});
|
|
8978
|
+
const state = useStorybookState2();
|
|
8979
|
+
const api = useStorybookApi6();
|
|
8980
|
+
const data = api.getData(state.storyId, state.refId);
|
|
8981
|
+
const importPath = data?.importPath;
|
|
8982
|
+
const canOpenInEditor = global2.CONFIG_TYPE === "DEVELOPMENT" && !state.refId;
|
|
8943
8983
|
const [panelState, set] = useAddonState2(ADDON_ID7, {
|
|
8944
8984
|
status: "rendering",
|
|
8945
8985
|
controlStates: INITIAL_CONTROL_STATES,
|
|
@@ -8980,6 +9020,7 @@ var Panel = memo4(
|
|
|
8980
9020
|
}
|
|
8981
9021
|
return () => observer?.disconnect();
|
|
8982
9022
|
}, []);
|
|
9023
|
+
const lastStoryId = useRef7(void 0);
|
|
8983
9024
|
const lastRenderId = useRef7(0);
|
|
8984
9025
|
const emit = useChannel2(
|
|
8985
9026
|
{
|
|
@@ -8987,16 +9028,17 @@ var Panel = memo4(
|
|
|
8987
9028
|
[EVENTS.SYNC]: (payload) => {
|
|
8988
9029
|
log.current = [getInternalRenderLogItem("done" /* DONE */), ...payload.logItems];
|
|
8989
9030
|
set(
|
|
8990
|
-
(
|
|
8991
|
-
{ ...
|
|
9031
|
+
(state2) => getPanelState(
|
|
9032
|
+
{ ...state2, controlStates: payload.controlStates, pausedAt: payload.pausedAt },
|
|
8992
9033
|
{ log: log.current, calls: calls.current, collapsed, setCollapsed }
|
|
8993
9034
|
)
|
|
8994
9035
|
);
|
|
8995
9036
|
},
|
|
8996
9037
|
[STORY_RENDER_PHASE_CHANGED]: (event) => {
|
|
8997
|
-
if (
|
|
9038
|
+
if (lastStoryId.current === event.storyId && ["preparing", "loading"].includes(event.newPhase)) {
|
|
8998
9039
|
return;
|
|
8999
9040
|
}
|
|
9041
|
+
lastStoryId.current = event.storyId;
|
|
9000
9042
|
lastRenderId.current = Math.max(lastRenderId.current, event.renderId || 0);
|
|
9001
9043
|
if (lastRenderId.current !== event.renderId) {
|
|
9002
9044
|
return;
|
|
@@ -9015,10 +9057,10 @@ var Panel = memo4(
|
|
|
9015
9057
|
unhandledErrors: void 0
|
|
9016
9058
|
});
|
|
9017
9059
|
} else {
|
|
9018
|
-
set((
|
|
9019
|
-
const status2 = event.newPhase in playStatusMap ? playStatusMap[event.newPhase] :
|
|
9060
|
+
set((state2) => {
|
|
9061
|
+
const status2 = event.newPhase in playStatusMap ? playStatusMap[event.newPhase] : state2.status;
|
|
9020
9062
|
return getPanelState(
|
|
9021
|
-
{ ...
|
|
9063
|
+
{ ...state2, status: status2, pausedAt: void 0 },
|
|
9022
9064
|
{ log: log.current, calls: calls.current, collapsed, setCollapsed }
|
|
9023
9065
|
);
|
|
9024
9066
|
});
|
|
@@ -9031,9 +9073,9 @@ var Panel = memo4(
|
|
|
9031
9073
|
getInternalRenderCall(storyId, { ...e2, callId: INTERNAL_RENDER_CALL_ID })
|
|
9032
9074
|
);
|
|
9033
9075
|
set(
|
|
9034
|
-
(
|
|
9076
|
+
(state2) => getPanelState(
|
|
9035
9077
|
{
|
|
9036
|
-
...
|
|
9078
|
+
...state2,
|
|
9037
9079
|
hasException: true,
|
|
9038
9080
|
caughtException: void 0,
|
|
9039
9081
|
controlStates: INITIAL_CONTROL_STATES,
|
|
@@ -9044,17 +9086,17 @@ var Panel = memo4(
|
|
|
9044
9086
|
);
|
|
9045
9087
|
},
|
|
9046
9088
|
[PLAY_FUNCTION_THREW_EXCEPTION]: (caughtException2) => {
|
|
9047
|
-
set((
|
|
9089
|
+
set((state2) => ({ ...state2, caughtException: caughtException2, hasException: true }));
|
|
9048
9090
|
},
|
|
9049
9091
|
[UNHANDLED_ERRORS_WHILE_PLAYING]: (unhandledErrors2) => {
|
|
9050
|
-
set((
|
|
9092
|
+
set((state2) => ({ ...state2, unhandledErrors: unhandledErrors2, hasException: true }));
|
|
9051
9093
|
}
|
|
9052
9094
|
},
|
|
9053
9095
|
[collapsed]
|
|
9054
9096
|
);
|
|
9055
9097
|
useEffect17(() => {
|
|
9056
9098
|
set(
|
|
9057
|
-
(
|
|
9099
|
+
(state2) => getPanelState(state2, { log: log.current, calls: calls.current, collapsed, setCollapsed })
|
|
9058
9100
|
);
|
|
9059
9101
|
}, [set, collapsed]);
|
|
9060
9102
|
const controls = useMemo5(
|
|
@@ -9122,7 +9164,10 @@ var Panel = memo4(
|
|
|
9122
9164
|
unhandledErrors,
|
|
9123
9165
|
pausedAt,
|
|
9124
9166
|
endRef,
|
|
9125
|
-
onScrollToEnd: scrollTarget && scrollToTarget
|
|
9167
|
+
onScrollToEnd: scrollTarget && scrollToTarget,
|
|
9168
|
+
importPath,
|
|
9169
|
+
canOpenInEditor,
|
|
9170
|
+
api
|
|
9126
9171
|
}
|
|
9127
9172
|
));
|
|
9128
9173
|
}, "PanelMemoized")
|
|
@@ -9131,9 +9176,9 @@ var Panel = memo4(
|
|
|
9131
9176
|
// src/component-testing/components/PanelTitle.tsx
|
|
9132
9177
|
import React67 from "react";
|
|
9133
9178
|
import { Badge as Badge3 } from "storybook/internal/components";
|
|
9134
|
-
import { useAddonState as useAddonState3, useStorybookApi as
|
|
9179
|
+
import { useAddonState as useAddonState3, useStorybookApi as useStorybookApi7 } from "storybook/manager-api";
|
|
9135
9180
|
function PanelTitle() {
|
|
9136
|
-
const api =
|
|
9181
|
+
const api = useStorybookApi7();
|
|
9137
9182
|
const selectedPanel = api.getSelectedPanel();
|
|
9138
9183
|
const [addonState = {}] = useAddonState3(ADDON_ID7);
|
|
9139
9184
|
const { status, hasException, interactionsCount } = addonState;
|
|
@@ -9306,11 +9351,11 @@ import { addons as addons5, types as types5 } from "storybook/manager-api";
|
|
|
9306
9351
|
import React71, { useCallback as useCallback9, useEffect as useEffect18 } from "react";
|
|
9307
9352
|
import { IconButton as IconButton8 } from "storybook/internal/components";
|
|
9308
9353
|
import { RulerIcon } from "@storybook/icons";
|
|
9309
|
-
import { useGlobals as useGlobals3, useStorybookApi as
|
|
9354
|
+
import { useGlobals as useGlobals3, useStorybookApi as useStorybookApi8 } from "storybook/manager-api";
|
|
9310
9355
|
var Tool = /* @__PURE__ */ __name(() => {
|
|
9311
9356
|
const [globals, updateGlobals] = useGlobals3();
|
|
9312
9357
|
const { measureEnabled } = globals || {};
|
|
9313
|
-
const api =
|
|
9358
|
+
const api = useStorybookApi8();
|
|
9314
9359
|
const toggleMeasure = useCallback9(
|
|
9315
9360
|
() => updateGlobals({
|
|
9316
9361
|
measureEnabled: !measureEnabled
|
|
@@ -9319,7 +9364,7 @@ var Tool = /* @__PURE__ */ __name(() => {
|
|
|
9319
9364
|
);
|
|
9320
9365
|
useEffect18(() => {
|
|
9321
9366
|
api.setAddonShortcut(ADDON_ID4, {
|
|
9322
|
-
label: "Toggle Measure
|
|
9367
|
+
label: "Toggle Measure",
|
|
9323
9368
|
defaultShortcut: ["M"],
|
|
9324
9369
|
actionName: "measure",
|
|
9325
9370
|
showInMenu: false,
|
|
@@ -9358,10 +9403,10 @@ import { addons as addons6, types as types6 } from "storybook/manager-api";
|
|
|
9358
9403
|
import React74, { memo as memo6, useCallback as useCallback10, useEffect as useEffect19 } from "react";
|
|
9359
9404
|
import { IconButton as IconButton9 } from "storybook/internal/components";
|
|
9360
9405
|
import { OutlineIcon } from "@storybook/icons";
|
|
9361
|
-
import { useGlobals as useGlobals4, useStorybookApi as
|
|
9406
|
+
import { useGlobals as useGlobals4, useStorybookApi as useStorybookApi9 } from "storybook/manager-api";
|
|
9362
9407
|
var OutlineSelector = memo6(/* @__PURE__ */ __name(function OutlineSelector2() {
|
|
9363
9408
|
const [globals, updateGlobals] = useGlobals4();
|
|
9364
|
-
const api =
|
|
9409
|
+
const api = useStorybookApi9();
|
|
9365
9410
|
const isActive = [true, "true"].includes(globals[PARAM_KEY4]);
|
|
9366
9411
|
const toggleOutline = useCallback10(
|
|
9367
9412
|
() => updateGlobals({
|
|
@@ -9501,7 +9546,7 @@ var ViewportTool = /* @__PURE__ */ __name(({ api }) => {
|
|
|
9501
9546
|
const { options = MINIMAL_VIEWPORTS, disable } = config || {};
|
|
9502
9547
|
const data = globals?.[PARAM_KEY2] || {};
|
|
9503
9548
|
const viewportName = typeof data === "string" ? data : data.value;
|
|
9504
|
-
const isRotated = typeof data === "string" ? false : data.isRotated;
|
|
9549
|
+
const isRotated = typeof data === "string" ? false : !!data.isRotated;
|
|
9505
9550
|
const item = options[viewportName] || responsiveViewport;
|
|
9506
9551
|
const isActive = isTooltipVisible || item !== responsiveViewport;
|
|
9507
9552
|
const isLocked = PARAM_KEY2 in storyGlobals;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_srln17sp2zh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_srln17sp2zh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_srln17sp2zh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_srln17sp2zh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_srln17sp2zh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_srln17sp2zh.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
glob
|
|
14
|
-
} from "../../_node-chunks/chunk-
|
|
14
|
+
} from "../../_node-chunks/chunk-MRCMZPA2.js";
|
|
15
15
|
import {
|
|
16
16
|
slash
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-FCNWWJV7.js";
|
|
18
18
|
import {
|
|
19
19
|
__name
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-ZM2HT2RW.js";
|
|
21
21
|
|
|
22
22
|
// src/core-server/utils/remove-mdx-entries.ts
|
|
23
23
|
import { isAbsolute, join, relative } from "node:path";
|