@@ -42,8 +42,6 @@ describe('mdx2', () => {
42
42
foo.parameters = { storySource: { source: '"bar"' } };
43
43
44
44
const componentMeta = { title: 'foobar', includeStories: ['foo'] };
45
-
46
- const mdxStoryNameToKey = { foo: 'foo' };
47
45
` ) ;
48
46
} ) ;
49
47
@@ -60,7 +58,6 @@ describe('mdx2', () => {
60
58
// @ts -ignore
61
59
expect ( compileSync ( input ) ) . toMatchInlineSnapshot ( `
62
60
/*@jsxRuntime automatic @jsxImportSource react*/
63
- import { assertIsFn, AddContext } from "@storybook/addon-docs";
64
61
import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
65
62
function MDXContent(props = {}) {
66
63
const {wrapper: MDXLayout} = props.components || ({});
@@ -100,12 +97,10 @@ describe('mdx2', () => {
100
97
101
98
const componentMeta = { title: 'foobar', includeStories: ["foo"], };
102
99
103
- const mdxStoryNameToKey = {"foo":"foo"};
104
-
105
100
componentMeta.parameters = componentMeta.parameters || {};
106
101
componentMeta.parameters.docs = {
107
102
...(componentMeta.parameters.docs || {}),
108
- page: () => <AddContext mdxStoryNameToKey={mdxStoryNameToKey} mdxComponentAnnotations={componentMeta}>< MDXContent /></AddContext >,
103
+ page: () => <MDXContent />,
109
104
};
110
105
111
106
export default componentMeta;
@@ -119,11 +114,7 @@ describe('mdx2', () => {
119
114
120
115
{3 + 3}
121
116
` )
122
- ) . toMatchInlineSnapshot ( `
123
- const componentMeta = { includeStories: [] };
124
-
125
- const mdxStoryNameToKey = {};
126
- ` ) ;
117
+ ) . toMatchInlineSnapshot ( `const componentMeta = { includeStories: [] };` ) ;
127
118
} ) ;
128
119
} ) ;
129
120
@@ -163,8 +154,6 @@ describe('docs-mdx-compiler-plugin', () => {
163
154
},
164
155
includeStories: ['componentNotes'],
165
156
};
166
-
167
- const mdxStoryNameToKey = { 'component notes': 'componentNotes' };
168
157
` ) ;
169
158
} ) ;
170
159
@@ -191,8 +180,6 @@ describe('docs-mdx-compiler-plugin', () => {
191
180
component: Button,
192
181
includeStories: ['componentNotes'],
193
182
};
194
-
195
- const mdxStoryNameToKey = { 'component notes': 'componentNotes' };
196
183
` ) ;
197
184
} ) ;
198
185
@@ -225,8 +212,6 @@ describe('docs-mdx-compiler-plugin', () => {
225
212
_Foo_.storyName = 'renamed';
226
213
227
214
const componentMeta = { title: 'MDX/CSF imports', includeStories: ['_Basic_', '_Other_', '_Foo_'] };
228
-
229
- const mdxStoryNameToKey = { _Basic_: '_Basic_', _Other_: '_Other_', renamed: '_Foo_' };
230
215
` ) ;
231
216
} ) ;
232
217
@@ -268,8 +253,6 @@ describe('docs-mdx-compiler-plugin', () => {
268
253
],
269
254
includeStories: ['one'],
270
255
};
271
-
272
- const mdxStoryNameToKey = { one: 'one' };
273
256
` ) ;
274
257
} ) ;
275
258
@@ -292,8 +275,6 @@ describe('docs-mdx-compiler-plugin', () => {
292
275
__page.parameters = { docsOnly: true };
293
276
294
277
const componentMeta = { title: 'docs-only', includeStories: ['__page'] };
295
-
296
- const mdxStoryNameToKey = {};
297
278
` ) ;
298
279
} ) ;
299
280
@@ -330,8 +311,6 @@ describe('docs-mdx-compiler-plugin', () => {
330
311
],
331
312
includeStories: ['one'],
332
313
};
333
-
334
- const mdxStoryNameToKey = { one: 'one' };
335
314
` ) ;
336
315
} ) ;
337
316
@@ -350,8 +329,6 @@ describe('docs-mdx-compiler-plugin', () => {
350
329
__page.parameters = { docsOnly: true };
351
330
352
331
const componentMeta = { title: "Addons/Docs/what's in a title?", includeStories: ['__page'] };
353
-
354
- const mdxStoryNameToKey = {};
355
332
` ) ;
356
333
} ) ;
357
334
@@ -385,8 +362,6 @@ describe('docs-mdx-compiler-plugin', () => {
385
362
helloStory.parameters = { storySource: { source: '<Button>{"Hello button"}</Button>' } };
386
363
387
364
const componentMeta = { title: 'Button', includeStories: ['one', 'helloStory'] };
388
-
389
- const mdxStoryNameToKey = { one: 'one', 'hello story': 'helloStory' };
390
365
` ) ;
391
366
} ) ;
392
367
@@ -428,8 +403,6 @@ describe('docs-mdx-compiler-plugin', () => {
428
403
component: Button,
429
404
includeStories: ['componentNotes', 'storyNotes'],
430
405
};
431
-
432
- const mdxStoryNameToKey = { 'component notes': 'componentNotes', 'story notes': 'storyNotes' };
433
406
` ) ;
434
407
} ) ;
435
408
@@ -479,8 +452,6 @@ describe('docs-mdx-compiler-plugin', () => {
479
452
component: Button,
480
453
includeStories: ['helloButton', 'two'],
481
454
};
482
-
483
- const mdxStoryNameToKey = { 'hello button': 'helloButton', two: 'two' };
484
455
` ) ;
485
456
} ) ;
486
457
@@ -522,8 +493,6 @@ describe('docs-mdx-compiler-plugin', () => {
522
493
componentNotes.parameters = { storySource: { source: 'args => <Button>Component notes</Button>' } };
523
494
524
495
const componentMeta = { title: 'Button', includeStories: ['componentNotes'] };
525
-
526
- const mdxStoryNameToKey = { 'component notes': 'componentNotes' };
527
496
` ) ;
528
497
} ) ;
529
498
@@ -536,11 +505,7 @@ describe('docs-mdx-compiler-plugin', () => {
536
505
537
506
<Story id="." />
538
507
` )
539
- ) . toMatchInlineSnapshot ( `
540
- const componentMeta = { includeStories: [] };
541
-
542
- const mdxStoryNameToKey = {};
543
- ` ) ;
508
+ ) . toMatchInlineSnapshot ( `const componentMeta = { includeStories: [] };` ) ;
544
509
} ) ;
545
510
546
511
it ( 'story-def-text-only.mdx' , ( ) => {
@@ -560,8 +525,6 @@ describe('docs-mdx-compiler-plugin', () => {
560
525
text.parameters = { storySource: { source: '"Plain text"' } };
561
526
562
527
const componentMeta = { title: 'Text', includeStories: ['text'] };
563
-
564
- const mdxStoryNameToKey = { text: 'text' };
565
528
` ) ;
566
529
} ) ;
567
530
@@ -612,13 +575,6 @@ describe('docs-mdx-compiler-plugin', () => {
612
575
title: 'Button',
613
576
includeStories: ['one', 'helloStory', 'wPunctuation', '_1FineDay'],
614
577
};
615
-
616
- const mdxStoryNameToKey = {
617
- one: 'one',
618
- 'hello story': 'helloStory',
619
- 'w/punctuation': 'wPunctuation',
620
- '1 fine day': '_1FineDay',
621
- };
622
578
` ) ;
623
579
} ) ;
624
580
@@ -643,8 +599,6 @@ describe('docs-mdx-compiler-plugin', () => {
643
599
basic.parameters = { storySource: { source: 'basicFn' } };
644
600
645
601
const componentMeta = { title: 'story-function-var', includeStories: ['basic'] };
646
-
647
- const mdxStoryNameToKey = { basic: 'basic' };
648
602
` ) ;
649
603
} ) ;
650
604
@@ -676,8 +630,6 @@ describe('docs-mdx-compiler-plugin', () => {
676
630
};
677
631
678
632
const componentMeta = { includeStories: ['functionStory'] };
679
-
680
- const mdxStoryNameToKey = { function: 'functionStory' };
681
633
` ) ;
682
634
} ) ;
683
635
@@ -709,8 +661,6 @@ describe('docs-mdx-compiler-plugin', () => {
709
661
};
710
662
711
663
const componentMeta = { title: 'Multiple', includeStories: ['multipleChildren'] };
712
-
713
- const mdxStoryNameToKey = { 'multiple children': 'multipleChildren' };
714
664
` ) ;
715
665
} ) ;
716
666
@@ -756,8 +706,6 @@ describe('docs-mdx-compiler-plugin', () => {
756
706
};
757
707
758
708
const componentMeta = { title: 'MDX|Welcome', includeStories: ['toStorybook'] };
759
-
760
- const mdxStoryNameToKey = { 'to storybook': 'toStorybook' };
761
709
` ) ;
762
710
} ) ;
763
711
@@ -770,11 +718,7 @@ describe('docs-mdx-compiler-plugin', () => {
770
718
771
719
<Story id="welcome--welcome" />
772
720
` )
773
- ) . toMatchInlineSnapshot ( `
774
- const componentMeta = { includeStories: [] };
775
-
776
- const mdxStoryNameToKey = {};
777
- ` ) ;
721
+ ) . toMatchInlineSnapshot ( `const componentMeta = { includeStories: [] };` ) ;
778
722
} ) ;
779
723
780
724
it ( 'title-template-string.mdx' , ( ) => {
@@ -796,8 +740,6 @@ describe('docs-mdx-compiler-plugin', () => {
796
740
__page.parameters = { docsOnly: true };
797
741
798
742
const componentMeta = { title: \`\${titleFunction('template')}\`, includeStories: ['__page'] };
799
-
800
- const mdxStoryNameToKey = {};
801
743
` ) ;
802
744
} ) ;
803
745
@@ -812,11 +754,7 @@ describe('docs-mdx-compiler-plugin', () => {
812
754
813
755
<Button>Hello button</Button>
814
756
` )
815
- ) . toMatchInlineSnapshot ( `
816
- const componentMeta = { includeStories: [] };
817
-
818
- const mdxStoryNameToKey = {};
819
- ` ) ;
757
+ ) . toMatchInlineSnapshot ( `const componentMeta = { includeStories: [] };` ) ;
820
758
} ) ;
821
759
822
760
it ( 'errors on missing story props' , async ( ) => {
@@ -856,8 +794,6 @@ describe('docs-mdx-compiler-plugin', () => {
856
794
__page.parameters = { docsOnly: true };
857
795
858
796
const componentMeta = { includeStories: ['__page'] };
859
-
860
- const mdxStoryNameToKey = {};
861
797
` ) ;
862
798
} ) ;
863
799
@@ -879,8 +815,6 @@ describe('docs-mdx-compiler-plugin', () => {
879
815
basic.parameters = { storySource: { source: '<Button>{"Basic"}</Button>' } };
880
816
881
817
const componentMeta = { component: Button, includeStories: ['basic'] };
882
-
883
- const mdxStoryNameToKey = { Basic: 'basic' };
884
818
` ) ;
885
819
} ) ;
886
820
@@ -900,8 +834,6 @@ describe('docs-mdx-compiler-plugin', () => {
900
834
basic.parameters = { storySource: { source: '{}' } };
901
835
902
836
const componentMeta = { title: 'Button', component: Button, includeStories: ['basic'] };
903
-
904
- const mdxStoryNameToKey = { Basic: 'basic' };
905
837
` ) ;
906
838
} ) ;
907
839
@@ -926,8 +858,6 @@ describe('docs-mdx-compiler-plugin', () => {
926
858
render: (args) => <Button {...args} />,
927
859
includeStories: ['basic'],
928
860
};
929
-
930
- const mdxStoryNameToKey = { Basic: 'basic' };
931
861
` ) ;
932
862
} ) ;
933
863
@@ -948,8 +878,6 @@ describe('docs-mdx-compiler-plugin', () => {
948
878
basic.render = (args) => <Button {...args} />;
949
879
950
880
const componentMeta = { title: 'Button', component: Button, includeStories: ['basic'] };
951
-
952
- const mdxStoryNameToKey = { Basic: 'basic' };
953
881
` ) ;
954
882
} ) ;
955
883
@@ -970,8 +898,6 @@ describe('docs-mdx-compiler-plugin', () => {
970
898
basic.play = () => console.log('play');
971
899
972
900
const componentMeta = { title: 'Button', component: Button, includeStories: ['basic'] };
973
-
974
- const mdxStoryNameToKey = { Basic: 'basic' };
975
901
` ) ;
976
902
} ) ;
977
903
} ) ;
@@ -1011,8 +937,6 @@ describe('docs-mdx-compiler-plugin', () => {
1011
937
__page.parameters = { docsOnly: true };
1012
938
1013
939
const componentMeta = { title: 'Example/Introduction', includeStories: ['__page'] };
1014
-
1015
- const mdxStoryNameToKey = {};
1016
940
` ) ;
1017
941
} ) ;
1018
942
} ) ;
0 commit comments