storybook 10.2.0-beta.3 → 10.2.0-beta.5
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/base-preview-head.html +54 -36
- package/dist/_browser-chunks/{chunk-QOXZ7W26.js → chunk-2N4WE3KZ.js} +4 -6
- package/dist/_node-chunks/{builder-manager-JZHWQECC.js → builder-manager-6HNC5XRN.js} +12 -12
- package/dist/_node-chunks/{camelcase-2NZ4BLHX.js → camelcase-IYCRRXA5.js} +7 -7
- package/dist/_node-chunks/{chunk-WH4P3VKT.js → chunk-2JDPJ6YT.js} +6 -6
- package/dist/_node-chunks/{chunk-Y3SK4LWX.js → chunk-3UIUEILA.js} +6 -6
- package/dist/_node-chunks/chunk-62RIBMM5.js +61 -0
- package/dist/_node-chunks/{chunk-GQBGRYLZ.js → chunk-6NGDJBHX.js} +6 -6
- package/dist/_node-chunks/{chunk-APWBWPND.js → chunk-BQLJQU5S.js} +7 -7
- package/dist/_node-chunks/{chunk-6OI3K47W.js → chunk-CMQAD4WN.js} +9 -9
- package/dist/_node-chunks/{chunk-RZNT4K2G.js → chunk-DMYLXMGZ.js} +6 -6
- package/dist/_node-chunks/{chunk-QAIAKYZA.js → chunk-FILQYYM4.js} +7 -7
- package/dist/_node-chunks/{chunk-ESJWIQ4Z.js → chunk-G555WVXU.js} +6 -6
- package/dist/_node-chunks/{chunk-KBE3TTUR.js → chunk-GQ3W7RNH.js} +7 -7
- package/dist/_node-chunks/{chunk-RNTIDFBO.js → chunk-JA7NYZ5J.js} +9 -9
- package/dist/_node-chunks/{chunk-P626DC5C.js → chunk-KXY4T45O.js} +20 -20
- package/dist/_node-chunks/chunk-MMY3MCUW.js +23 -0
- package/dist/_node-chunks/{chunk-AAPM4ZUE.js → chunk-MMY6BHPB.js} +7 -7
- package/dist/_node-chunks/{chunk-YDILOOT5.js → chunk-NW4ZFC4G.js} +12 -12
- package/dist/_node-chunks/{chunk-6RSHZM6F.js → chunk-OHVVMOY4.js} +10 -10
- package/dist/_node-chunks/{chunk-R6FEBIT5.js → chunk-OLBWWB7V.js} +7 -7
- package/dist/_node-chunks/{chunk-P6D6ID6E.js → chunk-OQRIJVFV.js} +6 -6
- package/dist/_node-chunks/{chunk-LCBCTN4M.js → chunk-RX5EJSWN.js} +7 -7
- package/dist/_node-chunks/chunk-SMNCEA3Q.js +18 -0
- package/dist/_node-chunks/{chunk-JIOULQ32.js → chunk-SVOF2HZJ.js} +6 -6
- package/dist/_node-chunks/{chunk-JG6ODK5N.js → chunk-T7IXSAG3.js} +20 -11
- package/dist/_node-chunks/{chunk-DWLMCD64.js → chunk-TL7YS5OJ.js} +7 -7
- package/dist/_node-chunks/{chunk-VSP4OUV7.js → chunk-UQ7G5JAB.js} +6 -6
- package/dist/_node-chunks/{chunk-KJE25OIE.js → chunk-WQ6RUO2U.js} +8 -8
- package/dist/_node-chunks/{chunk-EQ3YUBKH.js → chunk-XFRIIIR5.js} +16 -16
- package/dist/_node-chunks/{chunk-5GZNNLKU.js → chunk-Y6FR5UWD.js} +7 -7
- package/dist/_node-chunks/{chunk-4DTADLHM.js → chunk-ZHRPEVJJ.js} +43 -25
- package/dist/_node-chunks/{globby-MSU5U7ID.js → globby-FBLNM57G.js} +9 -9
- package/dist/_node-chunks/{lib-OAHUNMVL.js → lib-GDCHT75J.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-Q6YYOOB2.js → mdx-N42X6CFJ-MCJFRV3K.js} +8 -8
- package/dist/_node-chunks/{p-limit-RMVLANG5.js → p-limit-AURGZ6D4.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.js +18 -18
- package/dist/common/index.js +19 -19
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +49 -16
- package/dist/core-server/index.js +35 -35
- package/dist/core-server/presets/common-manager.js +15 -21
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +25 -25
- package/dist/csf/index.d.ts +333 -8
- package/dist/csf/index.js +1 -1
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +58 -25
- package/dist/manager/runtime.js +100 -102
- package/dist/manager-api/index.d.ts +14 -14
- package/dist/manager-api/index.js +1 -1
- package/dist/mocking-utils/index.js +8 -8
- package/dist/node-logger/index.js +9 -9
- package/dist/preview/runtime.js +4 -6
- package/dist/preview-api/index.d.ts +4 -4
- package/dist/preview-api/index.js +1 -1
- package/dist/server-errors.js +11 -11
- package/dist/telemetry/index.d.ts +5 -0
- package/dist/telemetry/index.js +23 -23
- package/dist/types/index.d.ts +2 -3
- package/package.json +1 -1
- package/dist/_node-chunks/chunk-7GISRHHS.js +0 -23
- package/dist/_node-chunks/chunk-BEZTSJFQ.js +0 -61
- package/dist/_node-chunks/chunk-E63NMV7B.js +0 -18
package/dist/manager/runtime.js
CHANGED
|
@@ -1600,18 +1600,21 @@ var components_default = __STORYBOOK_COMPONENTS__, { A, AbstractToolbar, ActionB
|
|
|
1600
1600
|
var defaultItemValues = {
|
|
1601
1601
|
type: "item",
|
|
1602
1602
|
value: ""
|
|
1603
|
-
}, normalizeArgType = (key, argType) =>
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
})
|
|
1603
|
+
}, normalizeArgType = (key, argType) => {
|
|
1604
|
+
let toolbar = argType.toolbar;
|
|
1605
|
+
return toolbar ? {
|
|
1606
|
+
...argType,
|
|
1607
|
+
name: argType.name || key,
|
|
1608
|
+
description: argType.description || key,
|
|
1609
|
+
toolbar: {
|
|
1610
|
+
...argType.toolbar,
|
|
1611
|
+
items: toolbar.items.map((_item) => {
|
|
1612
|
+
let item = typeof _item == "string" ? { value: _item, title: _item } : _item;
|
|
1613
|
+
return item.type === "reset" && toolbar.icon && (item.icon = toolbar.icon, item.hideIcon = !0, item.value = void 0), { ...defaultItemValues, ...item };
|
|
1614
|
+
})
|
|
1615
|
+
}
|
|
1616
|
+
} : null;
|
|
1617
|
+
};
|
|
1615
1618
|
|
|
1616
1619
|
// src/toolbar/components/ToolbarMenuSelect.tsx
|
|
1617
1620
|
init_react();
|
|
@@ -1865,28 +1868,25 @@ var NEW_ICON_MAP = icons_exports, Svg = styled.svg`
|
|
|
1865
1868
|
vscode: "VSCodeIcon"
|
|
1866
1869
|
};
|
|
1867
1870
|
|
|
1868
|
-
// src/toolbar/
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
// src/toolbar/utils/create-cycle-value-array.ts
|
|
1872
|
-
var disallowedCycleableItemTypes = ["reset"], createCycleValueArray = (items) => items.filter((item) => !disallowedCycleableItemTypes.includes(item.type)).map((item) => item.value);
|
|
1871
|
+
// src/toolbar/utils/get-selected.ts
|
|
1872
|
+
var getSelectedItem = ({ currentValue, items }) => items.find((item) => item.value === currentValue && item.type !== "reset");
|
|
1873
1873
|
|
|
1874
1874
|
// src/toolbar/constants.ts
|
|
1875
1875
|
var TOOLBAR_ID = "toolbar";
|
|
1876
1876
|
|
|
1877
1877
|
// src/toolbar/utils/register-shortcuts.ts
|
|
1878
1878
|
var registerShortcuts = async (api, id, shortcuts) => {
|
|
1879
|
-
shortcuts
|
|
1879
|
+
shortcuts.next && await api.setAddonShortcut(TOOLBAR_ID, {
|
|
1880
1880
|
label: shortcuts.next.label,
|
|
1881
1881
|
defaultShortcut: shortcuts.next.keys,
|
|
1882
1882
|
actionName: `${id}:next`,
|
|
1883
1883
|
action: shortcuts.next.action
|
|
1884
|
-
}), shortcuts
|
|
1884
|
+
}), shortcuts.previous && await api.setAddonShortcut(TOOLBAR_ID, {
|
|
1885
1885
|
label: shortcuts.previous.label,
|
|
1886
1886
|
defaultShortcut: shortcuts.previous.keys,
|
|
1887
1887
|
actionName: `${id}:previous`,
|
|
1888
1888
|
action: shortcuts.previous.action
|
|
1889
|
-
}), shortcuts
|
|
1889
|
+
}), shortcuts.reset && await api.setAddonShortcut(TOOLBAR_ID, {
|
|
1890
1890
|
label: shortcuts.reset.label,
|
|
1891
1891
|
defaultShortcut: shortcuts.reset.keys,
|
|
1892
1892
|
actionName: `${id}:reset`,
|
|
@@ -1894,42 +1894,6 @@ var registerShortcuts = async (api, id, shortcuts) => {
|
|
|
1894
1894
|
});
|
|
1895
1895
|
};
|
|
1896
1896
|
|
|
1897
|
-
// src/toolbar/hoc/withKeyboardCycle.tsx
|
|
1898
|
-
var withKeyboardCycle = (Component2) => (props) => {
|
|
1899
|
-
let {
|
|
1900
|
-
id,
|
|
1901
|
-
toolbar: { items, shortcuts }
|
|
1902
|
-
} = props, api = useStorybookApi(), [globals, updateGlobals] = useGlobals(), cycleValues = useRef([]), currentValue = globals[id], reset = useCallback(() => {
|
|
1903
|
-
updateGlobals({ [id]: "" });
|
|
1904
|
-
}, [updateGlobals]), setNext = useCallback(() => {
|
|
1905
|
-
let values = cycleValues.current, currentIndex = values.indexOf(currentValue), newCurrentIndex = currentIndex === values.length - 1 ? 0 : currentIndex + 1, newCurrent = cycleValues.current[newCurrentIndex];
|
|
1906
|
-
updateGlobals({ [id]: newCurrent });
|
|
1907
|
-
}, [cycleValues, currentValue, updateGlobals]), setPrevious = useCallback(() => {
|
|
1908
|
-
let values = cycleValues.current, indexOf = values.indexOf(currentValue), currentIndex = indexOf > -1 ? indexOf : 0, newCurrentIndex = currentIndex === 0 ? values.length - 1 : currentIndex - 1, newCurrent = cycleValues.current[newCurrentIndex];
|
|
1909
|
-
updateGlobals({ [id]: newCurrent });
|
|
1910
|
-
}, [cycleValues, currentValue, updateGlobals]);
|
|
1911
|
-
return useEffect(() => {
|
|
1912
|
-
shortcuts && registerShortcuts(api, id, {
|
|
1913
|
-
next: { ...shortcuts.next, action: setNext },
|
|
1914
|
-
previous: { ...shortcuts.previous, action: setPrevious },
|
|
1915
|
-
reset: { ...shortcuts.reset, action: reset }
|
|
1916
|
-
});
|
|
1917
|
-
}, [api, id, shortcuts, setNext, setPrevious, reset]), useEffect(() => {
|
|
1918
|
-
cycleValues.current = createCycleValueArray(items);
|
|
1919
|
-
}, []), react_default.createElement(Component2, { cycleValues: cycleValues.current, ...props });
|
|
1920
|
-
};
|
|
1921
|
-
|
|
1922
|
-
// src/toolbar/utils/get-selected.ts
|
|
1923
|
-
var getSelectedItem = ({ currentValue, items }) => currentValue != null && items.find((item) => item.value === currentValue && item.type !== "reset"), getSelectedIcon = ({ currentValue, items }) => {
|
|
1924
|
-
let selectedItem = getSelectedItem({ currentValue, items });
|
|
1925
|
-
if (selectedItem)
|
|
1926
|
-
return selectedItem.icon;
|
|
1927
|
-
}, getSelectedTitle = ({ currentValue, items }) => {
|
|
1928
|
-
let selectedItem = getSelectedItem({ currentValue, items });
|
|
1929
|
-
if (selectedItem)
|
|
1930
|
-
return selectedItem.title;
|
|
1931
|
-
};
|
|
1932
|
-
|
|
1933
1897
|
// src/toolbar/components/ToolbarMenuSelect.tsx
|
|
1934
1898
|
var ToolbarMenuItemContainer = styled("div")({
|
|
1935
1899
|
width: "100%",
|
|
@@ -1938,16 +1902,16 @@ var ToolbarMenuItemContainer = styled("div")({
|
|
|
1938
1902
|
gap: 8
|
|
1939
1903
|
}), ToolbarMenuItemMiddle = styled("div")({
|
|
1940
1904
|
flex: 1
|
|
1941
|
-
}), ToolbarMenuSelect =
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1905
|
+
}), ToolbarMenuSelect = ({
|
|
1906
|
+
id,
|
|
1907
|
+
name,
|
|
1908
|
+
description,
|
|
1909
|
+
toolbar: { icon: _icon, items, title: _title, preventDynamicIcon, dynamicTitle, shortcuts }
|
|
1910
|
+
}) => {
|
|
1911
|
+
let api = useStorybookApi(), [globals, updateGlobals, storyGlobals] = useGlobals(), currentValue = globals[id], isOverridden = id in storyGlobals, icon = _icon, title2 = _title;
|
|
1912
|
+
preventDynamicIcon || (icon = getSelectedItem({ currentValue, items })?.icon || icon), dynamicTitle && (title2 = getSelectedItem({ currentValue, items })?.title || title2), !title2 && !icon && console.warn(`Toolbar '${name}' has no title or icon`);
|
|
1913
|
+
let resetItem = items.find((item) => item.type === "reset"), resetLabel = resetItem?.title, options2 = react_default.useMemo(
|
|
1914
|
+
() => items.filter((item) => item.type === "item").map((item) => {
|
|
1951
1915
|
let itemTitle = item.title ?? item.value ?? "Untitled", iconComponent = !item.hideIcon && item.icon ? react_default.createElement(Icons, { icon: item.icon, __suppressDeprecationWarning: !0 }) : void 0;
|
|
1952
1916
|
return item.right ? {
|
|
1953
1917
|
title: itemTitle,
|
|
@@ -1958,31 +1922,60 @@ var ToolbarMenuItemContainer = styled("div")({
|
|
|
1958
1922
|
value: item.value,
|
|
1959
1923
|
icon: iconComponent
|
|
1960
1924
|
};
|
|
1961
|
-
}),
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
);
|
|
1925
|
+
}),
|
|
1926
|
+
[items]
|
|
1927
|
+
);
|
|
1928
|
+
react_default.useEffect(() => {
|
|
1929
|
+
if (shortcuts) {
|
|
1930
|
+
let length = options2.length;
|
|
1931
|
+
registerShortcuts(api, id, {
|
|
1932
|
+
next: {
|
|
1933
|
+
...shortcuts.next,
|
|
1934
|
+
action: () => {
|
|
1935
|
+
let idx = options2.findIndex((i2) => i2.value === globals[id]), nextIdx = idx < 0 ? 0 : (idx + 1) % length;
|
|
1936
|
+
updateGlobals({ [id]: options2[nextIdx].value });
|
|
1937
|
+
}
|
|
1938
|
+
},
|
|
1939
|
+
previous: {
|
|
1940
|
+
...shortcuts.previous,
|
|
1941
|
+
action: () => {
|
|
1942
|
+
let idx = options2.findIndex((i2) => i2.value === globals[id]), previousIdx = idx < 0 ? length - 1 : (idx + length - 1) % length;
|
|
1943
|
+
updateGlobals({ [id]: options2[previousIdx].value });
|
|
1944
|
+
}
|
|
1945
|
+
},
|
|
1946
|
+
reset: {
|
|
1947
|
+
...shortcuts.reset,
|
|
1948
|
+
action: () => {
|
|
1949
|
+
updateGlobals({ [id]: void 0 });
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
}, [api, id, shortcuts, globals, options2, updateGlobals]);
|
|
1955
|
+
let ariaLabel = description || title2 || name || id;
|
|
1956
|
+
return react_default.createElement(
|
|
1957
|
+
Select,
|
|
1958
|
+
{
|
|
1959
|
+
defaultOptions: [currentValue],
|
|
1960
|
+
options: options2,
|
|
1961
|
+
disabled: isOverridden,
|
|
1962
|
+
ariaLabel,
|
|
1963
|
+
tooltip: ariaLabel,
|
|
1964
|
+
resetLabel,
|
|
1965
|
+
onReset: resetItem ? () => updateGlobals({ [id]: resetItem?.value }) : void 0,
|
|
1966
|
+
onSelect: (selected) => updateGlobals({ [id]: selected }),
|
|
1967
|
+
icon: icon && react_default.createElement(Icons, { icon, __suppressDeprecationWarning: !0 })
|
|
1968
|
+
},
|
|
1969
|
+
title2
|
|
1970
|
+
);
|
|
1971
|
+
};
|
|
1979
1972
|
|
|
1980
1973
|
// src/toolbar/components/ToolbarManager.tsx
|
|
1981
1974
|
var ToolbarManager = () => {
|
|
1982
|
-
let globalTypes = useGlobalTypes()
|
|
1983
|
-
return
|
|
1975
|
+
let globalTypes = useGlobalTypes();
|
|
1976
|
+
return Object.keys(globalTypes).some((id) => !!globalTypes[id].toolbar) ? react_default.createElement(react_default.Fragment, null, react_default.createElement(Separator, null), Object.keys(globalTypes).map((id) => {
|
|
1984
1977
|
let normalizedArgType = normalizeArgType(id, globalTypes[id]);
|
|
1985
|
-
return react_default.createElement(ToolbarMenuSelect, { key: id, id, ...normalizedArgType });
|
|
1978
|
+
return normalizedArgType && react_default.createElement(ToolbarMenuSelect, { key: id, id, ...normalizedArgType });
|
|
1986
1979
|
})) : null;
|
|
1987
1980
|
};
|
|
1988
1981
|
|
|
@@ -5136,6 +5129,10 @@ var Wrapper = styled.div(
|
|
|
5136
5129
|
outline: "none"
|
|
5137
5130
|
}
|
|
5138
5131
|
},
|
|
5132
|
+
"input + div": {
|
|
5133
|
+
paddingInline: 0,
|
|
5134
|
+
fontSize: "inherit"
|
|
5135
|
+
},
|
|
5139
5136
|
"&:has(input:focus-visible)": {
|
|
5140
5137
|
outline: `2px solid ${theme.color.secondary}`,
|
|
5141
5138
|
outlineOffset: -2
|
|
@@ -5151,8 +5148,8 @@ var Wrapper = styled.div(
|
|
|
5151
5148
|
setValue,
|
|
5152
5149
|
minValue = -1 / 0,
|
|
5153
5150
|
maxValue = 1 / 0,
|
|
5154
|
-
unit,
|
|
5155
|
-
baseUnit,
|
|
5151
|
+
unit: fixedUnit,
|
|
5152
|
+
baseUnit = fixedUnit,
|
|
5156
5153
|
className,
|
|
5157
5154
|
style,
|
|
5158
5155
|
...props
|
|
@@ -5163,14 +5160,14 @@ var Wrapper = styled.div(
|
|
|
5163
5160
|
useImperativeHandle(forwardedRef, () => inputRef.current);
|
|
5164
5161
|
let parseValue = useCallback(
|
|
5165
5162
|
(value2) => {
|
|
5166
|
-
let [, inputValue2,
|
|
5167
|
-
return { number: Math.max(minValue, Math.min(parseFloat(inputValue2), maxValue)), unit
|
|
5163
|
+
let [, inputValue2, unit = fixedUnit || baseUnit || ""] = value2.match(/(-?\d+(?:\.\d+)?)(\%|[a-z]{1,4})?$/) || [];
|
|
5164
|
+
return { number: Math.max(minValue, Math.min(parseFloat(inputValue2), maxValue)), unit };
|
|
5168
5165
|
},
|
|
5169
|
-
[minValue, maxValue,
|
|
5166
|
+
[minValue, maxValue, fixedUnit, baseUnit]
|
|
5170
5167
|
), updateValue = useCallback(
|
|
5171
5168
|
(value2) => {
|
|
5172
|
-
let { number, unit
|
|
5173
|
-
Number.isNaN(number) ? setInputValue(value2) : (setInputValue(`${number}${
|
|
5169
|
+
let { number, unit } = parseValue(value2);
|
|
5170
|
+
Number.isNaN(number) ? setInputValue(value2) : (setInputValue(`${number}${unit === baseUnit ? "" : unit}`), setValue(`${number}${unit}`));
|
|
5174
5171
|
},
|
|
5175
5172
|
[parseValue, setValue, baseUnit]
|
|
5176
5173
|
), onChange = useCallback(
|
|
@@ -5192,8 +5189,8 @@ var Wrapper = styled.div(
|
|
|
5192
5189
|
if (e2.key !== "ArrowUp" && e2.key !== "ArrowDown")
|
|
5193
5190
|
return;
|
|
5194
5191
|
e2.preventDefault();
|
|
5195
|
-
let { number, unit
|
|
5196
|
-
Number.isNaN(number) || (updateValue(`${e2.key === "ArrowUp" ? number + 1 : number - 1}${
|
|
5192
|
+
let { number, unit } = parseValue(inputValue);
|
|
5193
|
+
Number.isNaN(number) || (updateValue(`${e2.key === "ArrowUp" ? number + 1 : number - 1}${unit}`), setInputSelection());
|
|
5197
5194
|
}, input = inputRef.current;
|
|
5198
5195
|
if (input)
|
|
5199
5196
|
return input.addEventListener("keydown", handleKeyDown), () => input.removeEventListener("keydown", handleKeyDown);
|
|
@@ -5204,6 +5201,7 @@ var Wrapper = styled.div(
|
|
|
5204
5201
|
id,
|
|
5205
5202
|
ref: inputRef,
|
|
5206
5203
|
value: inputValue,
|
|
5204
|
+
suffix: fixedUnit || inputValue && baseUnit,
|
|
5207
5205
|
onChange,
|
|
5208
5206
|
onFocus: setInputSelection,
|
|
5209
5207
|
onBlur: updateInputValue
|
|
@@ -11561,7 +11559,7 @@ var TourGuide = ({
|
|
|
11561
11559
|
TourGuide.render = (props) => {
|
|
11562
11560
|
let container = document.getElementById("storybook-tour");
|
|
11563
11561
|
container || (container = document.createElement("div"), container.id = "storybook-tour", document.body.appendChild(container)), root = root ?? createRoot(container), root.render(
|
|
11564
|
-
react_default.createElement(ThemeProvider, { theme: convert(themes.light) }, react_default.createElement(
|
|
11562
|
+
props ? react_default.createElement(ThemeProvider, { theme: convert(themes.light) }, react_default.createElement(
|
|
11565
11563
|
TourGuide,
|
|
11566
11564
|
{
|
|
11567
11565
|
...props,
|
|
@@ -11572,7 +11570,7 @@ TourGuide.render = (props) => {
|
|
|
11572
11570
|
props.onDismiss?.(), root?.render(null), root = null;
|
|
11573
11571
|
}
|
|
11574
11572
|
}
|
|
11575
|
-
))
|
|
11573
|
+
)) : null
|
|
11576
11574
|
);
|
|
11577
11575
|
};
|
|
11578
11576
|
|
|
@@ -11939,9 +11937,9 @@ export default {
|
|
|
11939
11937
|
after: ["installVitest"],
|
|
11940
11938
|
label: "Test your components",
|
|
11941
11939
|
criteria: "Component tests are run from the test widget in the sidebar",
|
|
11942
|
-
subscribe: ({ done }) => internal_universalTestProviderStore.onStateChange(
|
|
11943
|
-
|
|
11944
|
-
),
|
|
11940
|
+
subscribe: ({ done }) => internal_universalTestProviderStore.onStateChange((state) => {
|
|
11941
|
+
state["storybook/test"] === "test-provider-state:running" && (TourGuide.render(null), done());
|
|
11942
|
+
}),
|
|
11945
11943
|
action: {
|
|
11946
11944
|
label: "Start",
|
|
11947
11945
|
onClick: ({ api }) => {
|
|
@@ -18125,7 +18123,7 @@ var { document: document6 } = scope, DEFAULT_MAX_SEARCH_RESULTS = 50, options =
|
|
|
18125
18123
|
query: input,
|
|
18126
18124
|
results,
|
|
18127
18125
|
isNavVisible: !isOpen && document6.activeElement !== inputRef.current,
|
|
18128
|
-
isNavReachable: input.length === 0,
|
|
18126
|
+
isNavReachable: !isOpen || input.length === 0,
|
|
18129
18127
|
isSearchResultRendered: isOpen,
|
|
18130
18128
|
closeMenu,
|
|
18131
18129
|
getMenuProps,
|
|
@@ -405,7 +405,7 @@ interface SubState$5 {
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
declare const controlOrMetaSymbol: () => "⌘" | "ctrl";
|
|
408
|
-
declare const controlOrMetaKey: () => "
|
|
408
|
+
declare const controlOrMetaKey: () => "control" | "meta";
|
|
409
409
|
declare const optionOrAltSymbol: () => "⌥" | "alt";
|
|
410
410
|
declare const isShortcutTaken: (arr1: string[], arr2: string[]) => boolean;
|
|
411
411
|
type KeyboardEventLike = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey' | 'key' | 'code' | 'keyCode' | 'preventDefault'>;
|
|
@@ -952,7 +952,7 @@ declare function useGlobals(): [
|
|
|
952
952
|
storyGlobals: Globals,
|
|
953
953
|
userGlobals: Globals
|
|
954
954
|
];
|
|
955
|
-
declare function useGlobalTypes():
|
|
955
|
+
declare function useGlobalTypes(): GlobalTypes;
|
|
956
956
|
declare function useArgTypes(): ArgTypes;
|
|
957
957
|
|
|
958
958
|
declare const typesX: typeof Addon_TypesEnum;
|
|
@@ -3267,11 +3267,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3267
3267
|
mutedAt?: number | undefined;
|
|
3268
3268
|
}>>;
|
|
3269
3269
|
}, "strip", ZodTypeAny, {
|
|
3270
|
-
|
|
3270
|
+
controls?: {
|
|
3271
3271
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3272
3272
|
mutedAt?: number | undefined;
|
|
3273
3273
|
} | undefined;
|
|
3274
|
-
|
|
3274
|
+
autodocs?: {
|
|
3275
3275
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3276
3276
|
mutedAt?: number | undefined;
|
|
3277
3277
|
} | undefined;
|
|
@@ -3356,11 +3356,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3356
3356
|
mutedAt?: number | undefined;
|
|
3357
3357
|
} | undefined;
|
|
3358
3358
|
}, {
|
|
3359
|
-
|
|
3359
|
+
controls?: {
|
|
3360
3360
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3361
3361
|
mutedAt?: number | undefined;
|
|
3362
3362
|
} | undefined;
|
|
3363
|
-
|
|
3363
|
+
autodocs?: {
|
|
3364
3364
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3365
3365
|
mutedAt?: number | undefined;
|
|
3366
3366
|
} | undefined;
|
|
@@ -3454,11 +3454,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3454
3454
|
}>>;
|
|
3455
3455
|
}, "strip", ZodTypeAny, {
|
|
3456
3456
|
items?: {
|
|
3457
|
-
|
|
3457
|
+
controls?: {
|
|
3458
3458
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3459
3459
|
mutedAt?: number | undefined;
|
|
3460
3460
|
} | undefined;
|
|
3461
|
-
|
|
3461
|
+
autodocs?: {
|
|
3462
3462
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3463
3463
|
mutedAt?: number | undefined;
|
|
3464
3464
|
} | undefined;
|
|
@@ -3548,11 +3548,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3548
3548
|
} | undefined;
|
|
3549
3549
|
}, {
|
|
3550
3550
|
items?: {
|
|
3551
|
-
|
|
3551
|
+
controls?: {
|
|
3552
3552
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3553
3553
|
mutedAt?: number | undefined;
|
|
3554
3554
|
} | undefined;
|
|
3555
|
-
|
|
3555
|
+
autodocs?: {
|
|
3556
3556
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3557
3557
|
mutedAt?: number | undefined;
|
|
3558
3558
|
} | undefined;
|
|
@@ -3649,11 +3649,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3649
3649
|
userSince?: number | undefined;
|
|
3650
3650
|
checklist?: {
|
|
3651
3651
|
items?: {
|
|
3652
|
-
|
|
3652
|
+
controls?: {
|
|
3653
3653
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3654
3654
|
mutedAt?: number | undefined;
|
|
3655
3655
|
} | undefined;
|
|
3656
|
-
|
|
3656
|
+
autodocs?: {
|
|
3657
3657
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3658
3658
|
mutedAt?: number | undefined;
|
|
3659
3659
|
} | undefined;
|
|
@@ -3750,11 +3750,11 @@ declare const userSettingSchema: ZodObject<{
|
|
|
3750
3750
|
userSince?: number | undefined;
|
|
3751
3751
|
checklist?: {
|
|
3752
3752
|
items?: {
|
|
3753
|
-
|
|
3753
|
+
controls?: {
|
|
3754
3754
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3755
3755
|
mutedAt?: number | undefined;
|
|
3756
3756
|
} | undefined;
|
|
3757
|
-
|
|
3757
|
+
autodocs?: {
|
|
3758
3758
|
status?: "done" | "open" | "accepted" | "skipped" | undefined;
|
|
3759
3759
|
mutedAt?: number | undefined;
|
|
3760
3760
|
} | undefined;
|
|
@@ -2396,7 +2396,7 @@ import { global as global8 } from "@storybook/global";
|
|
|
2396
2396
|
import semver from "semver";
|
|
2397
2397
|
|
|
2398
2398
|
// src/manager-api/version.ts
|
|
2399
|
-
var version = "10.2.0-beta.
|
|
2399
|
+
var version = "10.2.0-beta.5";
|
|
2400
2400
|
|
|
2401
2401
|
// src/manager-api/modules/versions.ts
|
|
2402
2402
|
var { VERSIONCHECK } = global8, getVersionCheckData = (0, import_memoizerific2.default)(1)(() => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_nd4p3i1nxyh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_nd4p3i1nxyh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_nd4p3i1nxyh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_nd4p3i1nxyh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_nd4p3i1nxyh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_nd4p3i1nxyh.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
join,
|
|
17
17
|
normalize,
|
|
18
18
|
resolve
|
|
19
|
-
} from "../_node-chunks/chunk-
|
|
20
|
-
import "../_node-chunks/chunk-
|
|
19
|
+
} from "../_node-chunks/chunk-3UIUEILA.js";
|
|
20
|
+
import "../_node-chunks/chunk-G555WVXU.js";
|
|
21
21
|
|
|
22
22
|
// ../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
23
23
|
var comma = 44, semicolon = 59, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_nd4p3i1nxyh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_nd4p3i1nxyh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_nd4p3i1nxyh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_nd4p3i1nxyh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_nd4p3i1nxyh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_nd4p3i1nxyh.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -22,9 +22,9 @@ import {
|
|
|
22
22
|
once,
|
|
23
23
|
prompt,
|
|
24
24
|
protectUrls
|
|
25
|
-
} from "../_node-chunks/chunk-
|
|
26
|
-
import "../_node-chunks/chunk-
|
|
27
|
-
import "../_node-chunks/chunk-
|
|
25
|
+
} from "../_node-chunks/chunk-WQ6RUO2U.js";
|
|
26
|
+
import "../_node-chunks/chunk-OLBWWB7V.js";
|
|
27
|
+
import "../_node-chunks/chunk-G555WVXU.js";
|
|
28
28
|
var export_instance = import_npmlog.default;
|
|
29
29
|
export {
|
|
30
30
|
CLI_COLORS,
|
package/dist/preview/runtime.js
CHANGED
|
@@ -34727,8 +34727,8 @@ var ArgsStore = class {
|
|
|
34727
34727
|
}
|
|
34728
34728
|
};
|
|
34729
34729
|
|
|
34730
|
-
// src/preview-api/modules/store/csf/
|
|
34731
|
-
var
|
|
34730
|
+
// src/preview-api/modules/store/csf/getValuesFromGlobalTypes.ts
|
|
34731
|
+
var getValuesFromGlobalTypes = (globalTypes = {}) => Object.entries(globalTypes).reduce((acc, [arg, { defaultValue }]) => (typeof defaultValue < "u" && (acc[arg] = defaultValue), acc), {});
|
|
34732
34732
|
|
|
34733
34733
|
// src/preview-api/modules/store/GlobalsStore.ts
|
|
34734
34734
|
var GlobalsStore = class {
|
|
@@ -34741,7 +34741,7 @@ var GlobalsStore = class {
|
|
|
34741
34741
|
set({ globals = {}, globalTypes = {} }) {
|
|
34742
34742
|
let delta = this.initialGlobals && deepDiff(this.initialGlobals, this.globals);
|
|
34743
34743
|
this.allowedGlobalNames = /* @__PURE__ */ new Set([...Object.keys(globals), ...Object.keys(globalTypes)]);
|
|
34744
|
-
let defaultGlobals =
|
|
34744
|
+
let defaultGlobals = getValuesFromGlobalTypes(globalTypes);
|
|
34745
34745
|
this.initialGlobals = { ...defaultGlobals, ...globals }, this.globals = this.initialGlobals, delta && delta !== DEEPLY_EQUAL && this.updateFromPersisted(delta);
|
|
34746
34746
|
}
|
|
34747
34747
|
filterAllowedGlobals(globals) {
|
|
@@ -35210,7 +35210,6 @@ inferControls.secondPass = !0;
|
|
|
35210
35210
|
// src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts
|
|
35211
35211
|
function normalizeProjectAnnotations({
|
|
35212
35212
|
argTypes,
|
|
35213
|
-
globalTypes,
|
|
35214
35213
|
argTypesEnhancers,
|
|
35215
35214
|
decorators: decorators4,
|
|
35216
35215
|
loaders: loaders2,
|
|
@@ -35221,7 +35220,6 @@ function normalizeProjectAnnotations({
|
|
|
35221
35220
|
}) {
|
|
35222
35221
|
return {
|
|
35223
35222
|
...argTypes && { argTypes: normalizeInputTypes(argTypes) },
|
|
35224
|
-
...globalTypes && { globalTypes: normalizeInputTypes(globalTypes) },
|
|
35225
35223
|
decorators: normalizeArrays(decorators4),
|
|
35226
35224
|
loaders: normalizeArrays(loaders2),
|
|
35227
35225
|
beforeEach: normalizeArrays(beforeEach),
|
|
@@ -35440,7 +35438,7 @@ function composeStory(storyAnnotations, componentAnnotations, projectAnnotations
|
|
|
35440
35438
|
normalizedComponentAnnotations,
|
|
35441
35439
|
normalizedProjectAnnotations
|
|
35442
35440
|
), globals = {
|
|
35443
|
-
...
|
|
35441
|
+
...getValuesFromGlobalTypes(normalizedProjectAnnotations.globalTypes),
|
|
35444
35442
|
...normalizedProjectAnnotations.initialGlobals,
|
|
35445
35443
|
...story.storyGlobals
|
|
35446
35444
|
}, reporting = new ReporterAPI(), initializeContext = () => {
|
|
@@ -357,7 +357,7 @@ declare function processCSFFile<TRenderer extends Renderer>(moduleExports: Modul
|
|
|
357
357
|
declare function prepareStory<TRenderer extends Renderer>(storyAnnotations: NormalizedStoryAnnotations<TRenderer>, componentAnnotations: NormalizedComponentAnnotations<TRenderer>, projectAnnotations: NormalizedProjectAnnotations<TRenderer>): PreparedStory<TRenderer>;
|
|
358
358
|
declare function prepareMeta<TRenderer extends Renderer>(componentAnnotations: NormalizedComponentAnnotations<TRenderer>, projectAnnotations: NormalizedProjectAnnotations<TRenderer>, moduleExport: ModuleExport): PreparedMeta<TRenderer>;
|
|
359
359
|
|
|
360
|
-
declare function normalizeProjectAnnotations<TRenderer extends Renderer>({ argTypes,
|
|
360
|
+
declare function normalizeProjectAnnotations<TRenderer extends Renderer>({ argTypes, argTypesEnhancers, decorators, loaders, beforeEach, afterEach, initialGlobals, ...annotations }: ProjectAnnotations<TRenderer>): NormalizedProjectAnnotations<TRenderer>;
|
|
361
361
|
|
|
362
362
|
declare const normalizeArrays: <T>(array: T[] | T | undefined) => T[];
|
|
363
363
|
|
|
@@ -480,7 +480,7 @@ declare class StoryStore<TRenderer extends Renderer> {
|
|
|
480
480
|
}): {
|
|
481
481
|
args: storybook_internal_csf.Args;
|
|
482
482
|
initialGlobals: storybook_internal_csf.Globals;
|
|
483
|
-
globalTypes:
|
|
483
|
+
globalTypes: storybook_internal_csf.GlobalTypes | undefined;
|
|
484
484
|
userGlobals: storybook_internal_csf.Globals;
|
|
485
485
|
reporting: ReporterAPI;
|
|
486
486
|
globals: {
|
|
@@ -585,7 +585,7 @@ declare class DocsContext<TRenderer extends Renderer> implements DocsContextProp
|
|
|
585
585
|
viewMode: string;
|
|
586
586
|
args: storybook_internal_csf.Args;
|
|
587
587
|
initialGlobals: storybook_internal_csf.Globals;
|
|
588
|
-
globalTypes:
|
|
588
|
+
globalTypes: storybook_internal_csf.GlobalTypes | undefined;
|
|
589
589
|
userGlobals: storybook_internal_csf.Globals;
|
|
590
590
|
reporting: ReporterAPI;
|
|
591
591
|
globals: {
|
|
@@ -843,7 +843,7 @@ declare class Preview<TRenderer extends Renderer> {
|
|
|
843
843
|
}): {
|
|
844
844
|
args: Args;
|
|
845
845
|
initialGlobals: Globals;
|
|
846
|
-
globalTypes:
|
|
846
|
+
globalTypes: storybook_internal_csf.GlobalTypes | undefined;
|
|
847
847
|
userGlobals: Globals;
|
|
848
848
|
reporting: ReporterAPI;
|
|
849
849
|
globals: {
|
package/dist/server-errors.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_nd4p3i1nxyh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_nd4p3i1nxyh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_nd4p3i1nxyh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_nd4p3i1nxyh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_nd4p3i1nxyh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_nd4p3i1nxyh.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -46,13 +46,13 @@ import {
|
|
|
46
46
|
WebpackCompilationError,
|
|
47
47
|
WebpackInvocationError,
|
|
48
48
|
WebpackMissingStatsError
|
|
49
|
-
} from "./_node-chunks/chunk-
|
|
49
|
+
} from "./_node-chunks/chunk-OHVVMOY4.js";
|
|
50
50
|
import {
|
|
51
51
|
StorybookError
|
|
52
|
-
} from "./_node-chunks/chunk-
|
|
53
|
-
import "./_node-chunks/chunk-
|
|
54
|
-
import "./_node-chunks/chunk-
|
|
55
|
-
import "./_node-chunks/chunk-
|
|
52
|
+
} from "./_node-chunks/chunk-UQ7G5JAB.js";
|
|
53
|
+
import "./_node-chunks/chunk-Y6FR5UWD.js";
|
|
54
|
+
import "./_node-chunks/chunk-OLBWWB7V.js";
|
|
55
|
+
import "./_node-chunks/chunk-G555WVXU.js";
|
|
56
56
|
export {
|
|
57
57
|
AddonVitestPostinstallConfigUpdateError,
|
|
58
58
|
AddonVitestPostinstallError,
|
|
@@ -148,6 +148,11 @@ interface IErrorWithStdErrAndStdOut {
|
|
|
148
148
|
[key: string]: unknown;
|
|
149
149
|
}
|
|
150
150
|
declare function removeAnsiEscapeCodes(input?: string): string;
|
|
151
|
+
/**
|
|
152
|
+
* Removes all user-specific file system paths from the input string, replacing them with "$SNIP".
|
|
153
|
+
* This helps sanitize sensitive user information from output (such as error messages or logs). e.g.
|
|
154
|
+
* `/Users/username/storybook-app/src/pages/index.js` -> `$SNIP/src/pages/index.js`
|
|
155
|
+
*/
|
|
151
156
|
declare function cleanPaths(str: string, separator?: string): string;
|
|
152
157
|
declare function sanitizeError(error: Error, pathSeparator?: string): any;
|
|
153
158
|
|