@storybook/nextjs 7.2.3 → 7.3.0
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.
|
@@ -850,6 +850,8 @@ type ArgsStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (args: T
|
|
|
850
850
|
type StoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyStoryFn<TRenderer, TArgs> | ArgsStoryFn<TRenderer, TArgs>;
|
|
851
851
|
type DecoratorFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (fn: PartialStoryFn<TRenderer, TArgs>, c: StoryContext<TRenderer, TArgs>) => TRenderer['storyResult'];
|
|
852
852
|
|
|
853
|
+
type ExportName = string;
|
|
854
|
+
type MetaId = string;
|
|
853
855
|
interface StoriesSpecifier {
|
|
854
856
|
/**
|
|
855
857
|
* When auto-titling, what to prefix all generated titles with (default: '')
|
|
@@ -884,16 +886,89 @@ interface IndexedCSFFile {
|
|
|
884
886
|
};
|
|
885
887
|
stories: IndexedStory[];
|
|
886
888
|
}
|
|
887
|
-
|
|
889
|
+
/**
|
|
890
|
+
* FIXME: This is a temporary type to allow us to deprecate the old indexer API.
|
|
891
|
+
* We should remove this type and the deprecated indexer API in 8.0.
|
|
892
|
+
*/
|
|
893
|
+
type BaseIndexer = {
|
|
894
|
+
/**
|
|
895
|
+
* A regular expression that should match all files to be handled by this indexer
|
|
896
|
+
*/
|
|
888
897
|
test: RegExp;
|
|
898
|
+
};
|
|
899
|
+
/**
|
|
900
|
+
* An indexer describes which filenames it handles, and how to index each individual file - turning it into an entry in the index.
|
|
901
|
+
*/
|
|
902
|
+
type Indexer = BaseIndexer & {
|
|
903
|
+
/**
|
|
904
|
+
* Indexes a file containing stories or docs.
|
|
905
|
+
* @param fileName The name of the file to index.
|
|
906
|
+
* @param options {@link IndexerOptions} for indexing the file.
|
|
907
|
+
* @returns A promise that resolves to an array of {@link IndexInput} objects.
|
|
908
|
+
*/
|
|
909
|
+
index: (fileName: string, options: IndexerOptions) => Promise<IndexInput[]>;
|
|
910
|
+
/**
|
|
911
|
+
* @soonDeprecated Use {@link index} instead
|
|
912
|
+
*/
|
|
913
|
+
indexer?: never;
|
|
914
|
+
};
|
|
915
|
+
type DeprecatedIndexer = BaseIndexer & {
|
|
889
916
|
indexer: (fileName: string, options: IndexerOptions) => Promise<IndexedCSFFile>;
|
|
890
|
-
|
|
917
|
+
index?: never;
|
|
918
|
+
};
|
|
919
|
+
/**
|
|
920
|
+
* @soonDeprecated Use {@link Indexer} instead
|
|
921
|
+
*/
|
|
922
|
+
type StoryIndexer = Indexer | DeprecatedIndexer;
|
|
923
|
+
/**
|
|
924
|
+
* The base input for indexing a story or docs entry.
|
|
925
|
+
*/
|
|
926
|
+
type BaseIndexInput = {
|
|
927
|
+
/** The file to import from e.g. the story file. */
|
|
928
|
+
importPath: Path;
|
|
929
|
+
/** The name of the export to import. */
|
|
930
|
+
exportName: ExportName;
|
|
931
|
+
/** The name of the entry, auto-generated from {@link exportName} if unspecified. */
|
|
932
|
+
name?: StoryName;
|
|
933
|
+
/** The location in the sidebar, auto-generated from {@link importPath} if unspecified. */
|
|
934
|
+
title?: ComponentTitle;
|
|
935
|
+
/**
|
|
936
|
+
* The custom id optionally set at `meta.id` if it needs to differ from the id generated via {@link title}.
|
|
937
|
+
* If unspecified, the meta id will be auto-generated from {@link title}.
|
|
938
|
+
* If specified, the meta in the CSF file _must_ have a matching id set at `meta.id`, to be correctly matched.
|
|
939
|
+
*/
|
|
940
|
+
metaId?: MetaId;
|
|
941
|
+
/** Tags for filtering entries in Storybook and its tools. */
|
|
942
|
+
tags?: Tag[];
|
|
943
|
+
/**
|
|
944
|
+
* The id of the entry, auto-generated from {@link title}/{@link metaId} and {@link exportName} if unspecified.
|
|
945
|
+
* If specified, the story in the CSF file _must_ have a matching id set at `parameters.__id`, to be correctly matched.
|
|
946
|
+
* Only use this if you need to override the auto-generated id.
|
|
947
|
+
*/
|
|
948
|
+
__id?: StoryId;
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* The input for indexing a story entry.
|
|
952
|
+
*/
|
|
953
|
+
type StoryIndexInput = BaseIndexInput & {
|
|
954
|
+
type: 'story';
|
|
955
|
+
};
|
|
956
|
+
/**
|
|
957
|
+
* The input for indexing a docs entry.
|
|
958
|
+
*/
|
|
959
|
+
type DocsIndexInput = BaseIndexInput & {
|
|
960
|
+
type: 'docs';
|
|
961
|
+
/** Paths to story files that must be pre-loaded for this docs entry. */
|
|
962
|
+
storiesImports?: Path[];
|
|
963
|
+
};
|
|
964
|
+
type IndexInput = StoryIndexInput | DocsIndexInput;
|
|
891
965
|
type Addon_ReturnTypeFramework<ReturnType> = {
|
|
892
966
|
component: any;
|
|
893
967
|
storyResult: ReturnType;
|
|
894
968
|
canvasElement: any;
|
|
895
969
|
};
|
|
896
970
|
type Addon_DecoratorFunction<StoryFnReturnType = unknown> = DecoratorFunction<Addon_ReturnTypeFramework<StoryFnReturnType>>;
|
|
971
|
+
type Path = string;
|
|
897
972
|
|
|
898
973
|
interface Options$1 {
|
|
899
974
|
allowRegExp: boolean;
|
|
@@ -1169,8 +1244,13 @@ interface StorybookConfig {
|
|
|
1169
1244
|
previewAnnotations?: PresetValue<Entry[]>;
|
|
1170
1245
|
/**
|
|
1171
1246
|
* Process CSF files for the story index.
|
|
1247
|
+
* @soonDeprecated use {@link experimental_indexers} instead
|
|
1172
1248
|
*/
|
|
1173
1249
|
storyIndexers?: PresetValue<StoryIndexer[]>;
|
|
1250
|
+
/**
|
|
1251
|
+
* Process CSF files for the story index.
|
|
1252
|
+
*/
|
|
1253
|
+
experimental_indexers?: PresetValue<Indexer[]>;
|
|
1174
1254
|
/**
|
|
1175
1255
|
* Docs related features in index generation
|
|
1176
1256
|
*/
|
package/dist/preset.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PresetProperty, O as Options } from './index.d-
|
|
1
|
+
import { P as PresetProperty, O as Options } from './index.d-62173427.js';
|
|
2
2
|
import { TransformOptions } from '@babel/core';
|
|
3
3
|
import { StorybookConfig } from './index.js';
|
|
4
4
|
import 'file-system-cache';
|
package/dist/preview.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/nextjs",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Storybook for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
"@babel/preset-react": "^7.22.5",
|
|
72
72
|
"@babel/preset-typescript": "^7.22.5",
|
|
73
73
|
"@babel/runtime": "^7.22.6",
|
|
74
|
-
"@storybook/addon-actions": "7.
|
|
75
|
-
"@storybook/builder-webpack5": "7.
|
|
76
|
-
"@storybook/core-common": "7.
|
|
77
|
-
"@storybook/node-logger": "7.
|
|
78
|
-
"@storybook/preset-react-webpack": "7.
|
|
79
|
-
"@storybook/preview-api": "7.
|
|
80
|
-
"@storybook/react": "7.
|
|
74
|
+
"@storybook/addon-actions": "7.3.0",
|
|
75
|
+
"@storybook/builder-webpack5": "7.3.0",
|
|
76
|
+
"@storybook/core-common": "7.3.0",
|
|
77
|
+
"@storybook/node-logger": "7.3.0",
|
|
78
|
+
"@storybook/preset-react-webpack": "7.3.0",
|
|
79
|
+
"@storybook/preview-api": "7.3.0",
|
|
80
|
+
"@storybook/react": "7.3.0",
|
|
81
81
|
"@types/node": "^16.0.0",
|
|
82
82
|
"css-loader": "^6.7.3",
|
|
83
83
|
"find-up": "^5.0.0",
|