@storybook/addon-docs 7.0.0-alpha.5 → 7.0.0-alpha.50
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/README.md +14 -77
- package/angular/index.js +1 -1
- package/dist/DocsRenderer-MHI45CTG.mjs +1 -0
- package/dist/chunk-HKSD7XQF.mjs +1 -0
- package/dist/chunk-WMY67HY3.mjs +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/preset.d.ts +5 -0
- package/dist/preset.js +7 -0
- package/dist/preset.mjs +7 -0
- package/dist/preview.d.ts +3 -0
- package/dist/preview.js +1 -0
- package/dist/preview.mjs +1 -0
- package/jest-transform-mdx.js +4 -3
- package/jest.config.js +7 -0
- package/package.json +63 -36
- package/preset.js +1 -1
- package/preview.js +1 -1
- package/web-components/README.md +1 -0
- package/LICENSE +0 -21
- package/blocks.d.ts +0 -2
- package/blocks.js +0 -14
- package/dist/cjs/blocks/Anchor.js +0 -23
- package/dist/cjs/blocks/ArgsTable.js +0 -329
- package/dist/cjs/blocks/Canvas.js +0 -109
- package/dist/cjs/blocks/Description.js +0 -126
- package/dist/cjs/blocks/DocsContainer.js +0 -127
- package/dist/cjs/blocks/DocsContext.js +0 -25
- package/dist/cjs/blocks/DocsPage.js +0 -30
- package/dist/cjs/blocks/DocsStory.js +0 -68
- package/dist/cjs/blocks/Heading.js +0 -31
- package/dist/cjs/blocks/Meta.js +0 -50
- package/dist/cjs/blocks/Preview.js +0 -23
- package/dist/cjs/blocks/Primary.js +0 -39
- package/dist/cjs/blocks/Props.js +0 -29
- package/dist/cjs/blocks/Source.js +0 -179
- package/dist/cjs/blocks/SourceContainer.js +0 -67
- package/dist/cjs/blocks/Stories.js +0 -51
- package/dist/cjs/blocks/Story.js +0 -143
- package/dist/cjs/blocks/Subheading.js +0 -31
- package/dist/cjs/blocks/Subtitle.js +0 -39
- package/dist/cjs/blocks/Title.js +0 -44
- package/dist/cjs/blocks/Wrapper.js +0 -20
- package/dist/cjs/blocks/enhanceSource.js +0 -92
- package/dist/cjs/blocks/index.js +0 -366
- package/dist/cjs/blocks/mdx.js +0 -234
- package/dist/cjs/blocks/types.js +0 -10
- package/dist/cjs/blocks/useStory.js +0 -37
- package/dist/cjs/blocks/utils.js +0 -40
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/manager.js +0 -20
- package/dist/cjs/preset.js +0 -162
- package/dist/cjs/preview.js +0 -18
- package/dist/cjs/shared.js +0 -22
- package/dist/esm/blocks/Anchor.js +0 -8
- package/dist/esm/blocks/ArgsTable.js +0 -292
- package/dist/esm/blocks/Canvas.js +0 -83
- package/dist/esm/blocks/Description.js +0 -107
- package/dist/esm/blocks/DocsContainer.js +0 -98
- package/dist/esm/blocks/DocsContext.js +0 -16
- package/dist/esm/blocks/DocsPage.js +0 -11
- package/dist/esm/blocks/DocsStory.js +0 -46
- package/dist/esm/blocks/Heading.js +0 -17
- package/dist/esm/blocks/Meta.js +0 -31
- package/dist/esm/blocks/Preview.js +0 -9
- package/dist/esm/blocks/Primary.js +0 -23
- package/dist/esm/blocks/Props.js +0 -14
- package/dist/esm/blocks/Source.js +0 -144
- package/dist/esm/blocks/SourceContainer.js +0 -44
- package/dist/esm/blocks/Stories.js +0 -30
- package/dist/esm/blocks/Story.js +0 -114
- package/dist/esm/blocks/Subheading.js +0 -17
- package/dist/esm/blocks/Subtitle.js +0 -23
- package/dist/esm/blocks/Title.js +0 -24
- package/dist/esm/blocks/Wrapper.js +0 -8
- package/dist/esm/blocks/enhanceSource.js +0 -87
- package/dist/esm/blocks/index.js +0 -24
- package/dist/esm/blocks/mdx.js +0 -203
- package/dist/esm/blocks/types.js +0 -2
- package/dist/esm/blocks/useStory.js +0 -27
- package/dist/esm/blocks/utils.js +0 -29
- package/dist/esm/index.js +0 -1
- package/dist/esm/manager.js +0 -16
- package/dist/esm/preset.js +0 -132
- package/dist/esm/preview.js +0 -6
- package/dist/esm/shared.js +0 -11
- package/dist/types/blocks/Anchor.d.ts +0 -6
- package/dist/types/blocks/ArgsTable.d.ts +0 -33
- package/dist/types/blocks/Canvas.d.ts +0 -9
- package/dist/types/blocks/Description.d.ts +0 -20
- package/dist/types/blocks/DocsContainer.d.ts +0 -7
- package/dist/types/blocks/DocsContext.d.ts +0 -5
- package/dist/types/blocks/DocsPage.d.ts +0 -2
- package/dist/types/blocks/DocsStory.d.ts +0 -3
- package/dist/types/blocks/Heading.d.ts +0 -6
- package/dist/types/blocks/Meta.d.ts +0 -9
- package/dist/types/blocks/Preview.d.ts +0 -3
- package/dist/types/blocks/Primary.d.ts +0 -6
- package/dist/types/blocks/Props.d.ts +0 -3
- package/dist/types/blocks/Source.d.ts +0 -38
- package/dist/types/blocks/SourceContainer.d.ts +0 -14
- package/dist/types/blocks/Stories.d.ts +0 -7
- package/dist/types/blocks/Story.d.ts +0 -28
- package/dist/types/blocks/Subheading.d.ts +0 -3
- package/dist/types/blocks/Subtitle.d.ts +0 -6
- package/dist/types/blocks/Title.d.ts +0 -8
- package/dist/types/blocks/Wrapper.d.ts +0 -2
- package/dist/types/blocks/enhanceSource.d.ts +0 -3
- package/dist/types/blocks/index.d.ts +0 -24
- package/dist/types/blocks/mdx.d.ts +0 -20
- package/dist/types/blocks/types.d.ts +0 -13
- package/dist/types/blocks/useStory.d.ts +0 -5
- package/dist/types/blocks/utils.d.ts +0 -3
- package/dist/types/index.d.ts +0 -1
- package/dist/types/manager.d.ts +0 -1
- package/dist/types/preset.d.ts +0 -12
- package/dist/types/preview.d.ts +0 -6
- package/dist/types/shared.d.ts +0 -24
- package/manager.js +0 -1
- package/mdx-compiler-plugin.js +0 -1
- package/register.js +0 -6
package/dist/cjs/blocks/index.js
DELETED
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
ColorPalette: true,
|
|
8
|
-
ColorItem: true,
|
|
9
|
-
IconGallery: true,
|
|
10
|
-
IconItem: true,
|
|
11
|
-
Typeset: true
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "ColorItem", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _components.ColorItem;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "ColorPalette", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _components.ColorPalette;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "IconGallery", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _components.IconGallery;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "IconItem", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () {
|
|
34
|
-
return _components.IconItem;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, "Typeset", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () {
|
|
40
|
-
return _components.Typeset;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
var _components = require("@storybook/components");
|
|
45
|
-
|
|
46
|
-
var _Anchor = require("./Anchor");
|
|
47
|
-
|
|
48
|
-
Object.keys(_Anchor).forEach(function (key) {
|
|
49
|
-
if (key === "default" || key === "__esModule") return;
|
|
50
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
51
|
-
if (key in exports && exports[key] === _Anchor[key]) return;
|
|
52
|
-
Object.defineProperty(exports, key, {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
get: function () {
|
|
55
|
-
return _Anchor[key];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
var _ArgsTable = require("./ArgsTable");
|
|
61
|
-
|
|
62
|
-
Object.keys(_ArgsTable).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
65
|
-
if (key in exports && exports[key] === _ArgsTable[key]) return;
|
|
66
|
-
Object.defineProperty(exports, key, {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _ArgsTable[key];
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
var _Canvas = require("./Canvas");
|
|
75
|
-
|
|
76
|
-
Object.keys(_Canvas).forEach(function (key) {
|
|
77
|
-
if (key === "default" || key === "__esModule") return;
|
|
78
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
79
|
-
if (key in exports && exports[key] === _Canvas[key]) return;
|
|
80
|
-
Object.defineProperty(exports, key, {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function () {
|
|
83
|
-
return _Canvas[key];
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
var _Description = require("./Description");
|
|
89
|
-
|
|
90
|
-
Object.keys(_Description).forEach(function (key) {
|
|
91
|
-
if (key === "default" || key === "__esModule") return;
|
|
92
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
93
|
-
if (key in exports && exports[key] === _Description[key]) return;
|
|
94
|
-
Object.defineProperty(exports, key, {
|
|
95
|
-
enumerable: true,
|
|
96
|
-
get: function () {
|
|
97
|
-
return _Description[key];
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
var _DocsContext = require("./DocsContext");
|
|
103
|
-
|
|
104
|
-
Object.keys(_DocsContext).forEach(function (key) {
|
|
105
|
-
if (key === "default" || key === "__esModule") return;
|
|
106
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
107
|
-
if (key in exports && exports[key] === _DocsContext[key]) return;
|
|
108
|
-
Object.defineProperty(exports, key, {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return _DocsContext[key];
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
var _DocsPage = require("./DocsPage");
|
|
117
|
-
|
|
118
|
-
Object.keys(_DocsPage).forEach(function (key) {
|
|
119
|
-
if (key === "default" || key === "__esModule") return;
|
|
120
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
121
|
-
if (key in exports && exports[key] === _DocsPage[key]) return;
|
|
122
|
-
Object.defineProperty(exports, key, {
|
|
123
|
-
enumerable: true,
|
|
124
|
-
get: function () {
|
|
125
|
-
return _DocsPage[key];
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
var _DocsContainer = require("./DocsContainer");
|
|
131
|
-
|
|
132
|
-
Object.keys(_DocsContainer).forEach(function (key) {
|
|
133
|
-
if (key === "default" || key === "__esModule") return;
|
|
134
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
135
|
-
if (key in exports && exports[key] === _DocsContainer[key]) return;
|
|
136
|
-
Object.defineProperty(exports, key, {
|
|
137
|
-
enumerable: true,
|
|
138
|
-
get: function () {
|
|
139
|
-
return _DocsContainer[key];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
var _DocsStory = require("./DocsStory");
|
|
145
|
-
|
|
146
|
-
Object.keys(_DocsStory).forEach(function (key) {
|
|
147
|
-
if (key === "default" || key === "__esModule") return;
|
|
148
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
149
|
-
if (key in exports && exports[key] === _DocsStory[key]) return;
|
|
150
|
-
Object.defineProperty(exports, key, {
|
|
151
|
-
enumerable: true,
|
|
152
|
-
get: function () {
|
|
153
|
-
return _DocsStory[key];
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
var _Heading = require("./Heading");
|
|
159
|
-
|
|
160
|
-
Object.keys(_Heading).forEach(function (key) {
|
|
161
|
-
if (key === "default" || key === "__esModule") return;
|
|
162
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
163
|
-
if (key in exports && exports[key] === _Heading[key]) return;
|
|
164
|
-
Object.defineProperty(exports, key, {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function () {
|
|
167
|
-
return _Heading[key];
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
var _Meta = require("./Meta");
|
|
173
|
-
|
|
174
|
-
Object.keys(_Meta).forEach(function (key) {
|
|
175
|
-
if (key === "default" || key === "__esModule") return;
|
|
176
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
177
|
-
if (key in exports && exports[key] === _Meta[key]) return;
|
|
178
|
-
Object.defineProperty(exports, key, {
|
|
179
|
-
enumerable: true,
|
|
180
|
-
get: function () {
|
|
181
|
-
return _Meta[key];
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
var _Preview = require("./Preview");
|
|
187
|
-
|
|
188
|
-
Object.keys(_Preview).forEach(function (key) {
|
|
189
|
-
if (key === "default" || key === "__esModule") return;
|
|
190
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
191
|
-
if (key in exports && exports[key] === _Preview[key]) return;
|
|
192
|
-
Object.defineProperty(exports, key, {
|
|
193
|
-
enumerable: true,
|
|
194
|
-
get: function () {
|
|
195
|
-
return _Preview[key];
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
var _Primary = require("./Primary");
|
|
201
|
-
|
|
202
|
-
Object.keys(_Primary).forEach(function (key) {
|
|
203
|
-
if (key === "default" || key === "__esModule") return;
|
|
204
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
205
|
-
if (key in exports && exports[key] === _Primary[key]) return;
|
|
206
|
-
Object.defineProperty(exports, key, {
|
|
207
|
-
enumerable: true,
|
|
208
|
-
get: function () {
|
|
209
|
-
return _Primary[key];
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
var _Props = require("./Props");
|
|
215
|
-
|
|
216
|
-
Object.keys(_Props).forEach(function (key) {
|
|
217
|
-
if (key === "default" || key === "__esModule") return;
|
|
218
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
219
|
-
if (key in exports && exports[key] === _Props[key]) return;
|
|
220
|
-
Object.defineProperty(exports, key, {
|
|
221
|
-
enumerable: true,
|
|
222
|
-
get: function () {
|
|
223
|
-
return _Props[key];
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
var _Source = require("./Source");
|
|
229
|
-
|
|
230
|
-
Object.keys(_Source).forEach(function (key) {
|
|
231
|
-
if (key === "default" || key === "__esModule") return;
|
|
232
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
233
|
-
if (key in exports && exports[key] === _Source[key]) return;
|
|
234
|
-
Object.defineProperty(exports, key, {
|
|
235
|
-
enumerable: true,
|
|
236
|
-
get: function () {
|
|
237
|
-
return _Source[key];
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
var _SourceContainer = require("./SourceContainer");
|
|
243
|
-
|
|
244
|
-
Object.keys(_SourceContainer).forEach(function (key) {
|
|
245
|
-
if (key === "default" || key === "__esModule") return;
|
|
246
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
247
|
-
if (key in exports && exports[key] === _SourceContainer[key]) return;
|
|
248
|
-
Object.defineProperty(exports, key, {
|
|
249
|
-
enumerable: true,
|
|
250
|
-
get: function () {
|
|
251
|
-
return _SourceContainer[key];
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
var _Stories = require("./Stories");
|
|
257
|
-
|
|
258
|
-
Object.keys(_Stories).forEach(function (key) {
|
|
259
|
-
if (key === "default" || key === "__esModule") return;
|
|
260
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
261
|
-
if (key in exports && exports[key] === _Stories[key]) return;
|
|
262
|
-
Object.defineProperty(exports, key, {
|
|
263
|
-
enumerable: true,
|
|
264
|
-
get: function () {
|
|
265
|
-
return _Stories[key];
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
var _Story = require("./Story");
|
|
271
|
-
|
|
272
|
-
Object.keys(_Story).forEach(function (key) {
|
|
273
|
-
if (key === "default" || key === "__esModule") return;
|
|
274
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
275
|
-
if (key in exports && exports[key] === _Story[key]) return;
|
|
276
|
-
Object.defineProperty(exports, key, {
|
|
277
|
-
enumerable: true,
|
|
278
|
-
get: function () {
|
|
279
|
-
return _Story[key];
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
var _Subheading = require("./Subheading");
|
|
285
|
-
|
|
286
|
-
Object.keys(_Subheading).forEach(function (key) {
|
|
287
|
-
if (key === "default" || key === "__esModule") return;
|
|
288
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
289
|
-
if (key in exports && exports[key] === _Subheading[key]) return;
|
|
290
|
-
Object.defineProperty(exports, key, {
|
|
291
|
-
enumerable: true,
|
|
292
|
-
get: function () {
|
|
293
|
-
return _Subheading[key];
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
var _Subtitle = require("./Subtitle");
|
|
299
|
-
|
|
300
|
-
Object.keys(_Subtitle).forEach(function (key) {
|
|
301
|
-
if (key === "default" || key === "__esModule") return;
|
|
302
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
303
|
-
if (key in exports && exports[key] === _Subtitle[key]) return;
|
|
304
|
-
Object.defineProperty(exports, key, {
|
|
305
|
-
enumerable: true,
|
|
306
|
-
get: function () {
|
|
307
|
-
return _Subtitle[key];
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
var _Title = require("./Title");
|
|
313
|
-
|
|
314
|
-
Object.keys(_Title).forEach(function (key) {
|
|
315
|
-
if (key === "default" || key === "__esModule") return;
|
|
316
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
317
|
-
if (key in exports && exports[key] === _Title[key]) return;
|
|
318
|
-
Object.defineProperty(exports, key, {
|
|
319
|
-
enumerable: true,
|
|
320
|
-
get: function () {
|
|
321
|
-
return _Title[key];
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
var _Wrapper = require("./Wrapper");
|
|
327
|
-
|
|
328
|
-
Object.keys(_Wrapper).forEach(function (key) {
|
|
329
|
-
if (key === "default" || key === "__esModule") return;
|
|
330
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
331
|
-
if (key in exports && exports[key] === _Wrapper[key]) return;
|
|
332
|
-
Object.defineProperty(exports, key, {
|
|
333
|
-
enumerable: true,
|
|
334
|
-
get: function () {
|
|
335
|
-
return _Wrapper[key];
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
var _types = require("./types");
|
|
341
|
-
|
|
342
|
-
Object.keys(_types).forEach(function (key) {
|
|
343
|
-
if (key === "default" || key === "__esModule") return;
|
|
344
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
345
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
346
|
-
Object.defineProperty(exports, key, {
|
|
347
|
-
enumerable: true,
|
|
348
|
-
get: function () {
|
|
349
|
-
return _types[key];
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
|
|
354
|
-
var _mdx = require("./mdx");
|
|
355
|
-
|
|
356
|
-
Object.keys(_mdx).forEach(function (key) {
|
|
357
|
-
if (key === "default" || key === "__esModule") return;
|
|
358
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
359
|
-
if (key in exports && exports[key] === _mdx[key]) return;
|
|
360
|
-
Object.defineProperty(exports, key, {
|
|
361
|
-
enumerable: true,
|
|
362
|
-
get: function () {
|
|
363
|
-
return _mdx[key];
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
});
|
package/dist/cjs/blocks/mdx.js
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.assertIsFn = exports.HeadersMdx = exports.HeaderMdx = exports.CodeOrSourceMdx = exports.AnchorMdx = exports.AddContext = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _addons = require("@storybook/addons");
|
|
11
|
-
|
|
12
|
-
var _coreEvents = require("@storybook/core-events");
|
|
13
|
-
|
|
14
|
-
var _components = require("@storybook/components");
|
|
15
|
-
|
|
16
|
-
var _global = _interopRequireDefault(require("global"));
|
|
17
|
-
|
|
18
|
-
var _theming = require("@storybook/theming");
|
|
19
|
-
|
|
20
|
-
var _DocsContext = require("./DocsContext");
|
|
21
|
-
|
|
22
|
-
const _excluded = ["children"],
|
|
23
|
-
_excluded2 = ["className", "children"],
|
|
24
|
-
_excluded3 = ["href", "target", "children"],
|
|
25
|
-
_excluded4 = ["as", "id", "children"],
|
|
26
|
-
_excluded5 = ["as", "id", "children"];
|
|
27
|
-
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
|
-
|
|
32
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
-
|
|
34
|
-
const {
|
|
35
|
-
document
|
|
36
|
-
} = _global.default; // Hacky utility for asserting identifiers in MDX Story elements
|
|
37
|
-
|
|
38
|
-
const assertIsFn = val => {
|
|
39
|
-
if (typeof val !== 'function') {
|
|
40
|
-
throw new Error(`Expected story function, got: ${val}`);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return val;
|
|
44
|
-
}; // Hacky utility for adding mdxStoryToId to the default context
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
exports.assertIsFn = assertIsFn;
|
|
48
|
-
|
|
49
|
-
const AddContext = props => {
|
|
50
|
-
const {
|
|
51
|
-
children
|
|
52
|
-
} = props,
|
|
53
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
54
|
-
|
|
55
|
-
const parentContext = _react.default.useContext(_DocsContext.DocsContext);
|
|
56
|
-
|
|
57
|
-
return /*#__PURE__*/_react.default.createElement(_DocsContext.DocsContext.Provider, {
|
|
58
|
-
value: Object.assign({}, parentContext, rest)
|
|
59
|
-
}, children);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
exports.AddContext = AddContext;
|
|
63
|
-
|
|
64
|
-
const CodeOrSourceMdx = _ref => {
|
|
65
|
-
let {
|
|
66
|
-
className,
|
|
67
|
-
children
|
|
68
|
-
} = _ref,
|
|
69
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
70
|
-
|
|
71
|
-
// markdown-to-jsx does not add className to inline code
|
|
72
|
-
if (typeof className !== 'string' && (typeof children !== 'string' || !children.match(/[\n\r]/g))) {
|
|
73
|
-
return /*#__PURE__*/_react.default.createElement(_components.Code, null, children);
|
|
74
|
-
} // className: "lang-jsx"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const language = className && className.split('-');
|
|
78
|
-
return /*#__PURE__*/_react.default.createElement(_components.Source, _extends({
|
|
79
|
-
language: language && language[1] || 'plaintext',
|
|
80
|
-
format: false,
|
|
81
|
-
code: children
|
|
82
|
-
}, rest));
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
exports.CodeOrSourceMdx = CodeOrSourceMdx;
|
|
86
|
-
|
|
87
|
-
function navigate(url) {
|
|
88
|
-
_addons.addons.getChannel().emit(_coreEvents.NAVIGATE_URL, url);
|
|
89
|
-
} // @ts-ignore
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const A = _components.components.a;
|
|
93
|
-
|
|
94
|
-
const AnchorInPage = ({
|
|
95
|
-
hash,
|
|
96
|
-
children
|
|
97
|
-
}) => /*#__PURE__*/_react.default.createElement(A, {
|
|
98
|
-
href: hash,
|
|
99
|
-
target: "_self",
|
|
100
|
-
onClick: event => {
|
|
101
|
-
const id = hash.substring(1);
|
|
102
|
-
const element = document.getElementById(id);
|
|
103
|
-
|
|
104
|
-
if (element) {
|
|
105
|
-
navigate(hash);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}, children);
|
|
109
|
-
|
|
110
|
-
const AnchorMdx = props => {
|
|
111
|
-
const {
|
|
112
|
-
href,
|
|
113
|
-
target,
|
|
114
|
-
children
|
|
115
|
-
} = props,
|
|
116
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded3);
|
|
117
|
-
|
|
118
|
-
if (href) {
|
|
119
|
-
// Enable scrolling for in-page anchors.
|
|
120
|
-
if (href.startsWith('#')) {
|
|
121
|
-
return /*#__PURE__*/_react.default.createElement(AnchorInPage, {
|
|
122
|
-
hash: href
|
|
123
|
-
}, children);
|
|
124
|
-
} // Links to other pages of SB should use the base URL of the top level iframe instead of the base URL of the preview iframe.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (target !== '_blank' && !href.startsWith('https://')) {
|
|
128
|
-
return /*#__PURE__*/_react.default.createElement(A, _extends({
|
|
129
|
-
href: href,
|
|
130
|
-
onClick: event => {
|
|
131
|
-
event.preventDefault(); // use the A element's href, which has been modified for
|
|
132
|
-
// local paths without a `?path=` query param prefix
|
|
133
|
-
|
|
134
|
-
navigate(event.currentTarget.getAttribute('href'));
|
|
135
|
-
},
|
|
136
|
-
target: target
|
|
137
|
-
}, rest), children);
|
|
138
|
-
}
|
|
139
|
-
} // External URL dont need any modification.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return /*#__PURE__*/_react.default.createElement(A, props);
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
exports.AnchorMdx = AnchorMdx;
|
|
146
|
-
const SUPPORTED_MDX_HEADERS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
147
|
-
const OcticonHeaders = SUPPORTED_MDX_HEADERS.reduce((acc, headerType) => Object.assign({}, acc, {
|
|
148
|
-
// @ts-ignore
|
|
149
|
-
[headerType]: (0, _theming.styled)(_components.components[headerType])({
|
|
150
|
-
'& svg': {
|
|
151
|
-
visibility: 'hidden'
|
|
152
|
-
},
|
|
153
|
-
'&:hover svg': {
|
|
154
|
-
visibility: 'visible'
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
}), {});
|
|
158
|
-
|
|
159
|
-
const OcticonAnchor = _theming.styled.a(() => ({
|
|
160
|
-
float: 'left',
|
|
161
|
-
paddingRight: '4px',
|
|
162
|
-
marginLeft: '-20px',
|
|
163
|
-
// Allow the theme's text color to override the default link color.
|
|
164
|
-
color: 'inherit'
|
|
165
|
-
}));
|
|
166
|
-
|
|
167
|
-
const HeaderWithOcticonAnchor = _ref2 => {
|
|
168
|
-
let {
|
|
169
|
-
as,
|
|
170
|
-
id,
|
|
171
|
-
children
|
|
172
|
-
} = _ref2,
|
|
173
|
-
rest = _objectWithoutPropertiesLoose(_ref2, _excluded4);
|
|
174
|
-
|
|
175
|
-
// @ts-ignore
|
|
176
|
-
const OcticonHeader = OcticonHeaders[as];
|
|
177
|
-
const hash = `#${id}`;
|
|
178
|
-
return /*#__PURE__*/_react.default.createElement(OcticonHeader, _extends({
|
|
179
|
-
id: id
|
|
180
|
-
}, rest), /*#__PURE__*/_react.default.createElement(OcticonAnchor, {
|
|
181
|
-
"aria-hidden": "true",
|
|
182
|
-
href: hash,
|
|
183
|
-
tabIndex: -1,
|
|
184
|
-
target: "_self",
|
|
185
|
-
onClick: event => {
|
|
186
|
-
const element = document.getElementById(id);
|
|
187
|
-
|
|
188
|
-
if (element) {
|
|
189
|
-
navigate(hash);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
193
|
-
viewBox: "0 0 16 16",
|
|
194
|
-
version: "1.1",
|
|
195
|
-
width: "16",
|
|
196
|
-
height: "16",
|
|
197
|
-
"aria-hidden": "true",
|
|
198
|
-
fill: "currentColor"
|
|
199
|
-
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
200
|
-
fillRule: "evenodd",
|
|
201
|
-
d: "M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"
|
|
202
|
-
}))), children);
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
const HeaderMdx = props => {
|
|
206
|
-
const {
|
|
207
|
-
as,
|
|
208
|
-
id,
|
|
209
|
-
children
|
|
210
|
-
} = props,
|
|
211
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded5); // An id should have been added on every header by the "remark-slug" plugin.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if (id) {
|
|
215
|
-
return /*#__PURE__*/_react.default.createElement(HeaderWithOcticonAnchor, _extends({
|
|
216
|
-
as: as,
|
|
217
|
-
id: id
|
|
218
|
-
}, rest), children);
|
|
219
|
-
} // @ts-ignore
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const Header = _components.components[as]; // Make sure it still work if "remark-slug" plugin is not present.
|
|
223
|
-
|
|
224
|
-
return /*#__PURE__*/_react.default.createElement(Header, props);
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
exports.HeaderMdx = HeaderMdx;
|
|
228
|
-
const HeadersMdx = SUPPORTED_MDX_HEADERS.reduce((acc, headerType) => Object.assign({}, acc, {
|
|
229
|
-
// @ts-ignore
|
|
230
|
-
[headerType]: props => /*#__PURE__*/_react.default.createElement(HeaderMdx, _extends({
|
|
231
|
-
as: headerType
|
|
232
|
-
}, props))
|
|
233
|
-
}), {});
|
|
234
|
-
exports.HeadersMdx = HeadersMdx;
|
package/dist/cjs/blocks/types.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PRIMARY_STORY = exports.CURRENT_SELECTION = void 0;
|
|
7
|
-
const CURRENT_SELECTION = '.';
|
|
8
|
-
exports.CURRENT_SELECTION = CURRENT_SELECTION;
|
|
9
|
-
const PRIMARY_STORY = '^';
|
|
10
|
-
exports.PRIMARY_STORY = PRIMARY_STORY;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useStories = useStories;
|
|
7
|
-
exports.useStory = useStory;
|
|
8
|
-
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
|
|
11
|
-
function useStory(storyId, context) {
|
|
12
|
-
const stories = useStories([storyId], context);
|
|
13
|
-
return stories && stories[0];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function useStories(storyIds, context) {
|
|
17
|
-
const initialStoriesById = context.componentStories().reduce((acc, story) => {
|
|
18
|
-
acc[story.id] = story;
|
|
19
|
-
return acc;
|
|
20
|
-
}, {});
|
|
21
|
-
const [storiesById, setStories] = (0, _react.useState)(initialStoriesById);
|
|
22
|
-
(0, _react.useEffect)(() => {
|
|
23
|
-
Promise.all(storyIds.map(async storyId => {
|
|
24
|
-
// loadStory will be called every single time useStory is called
|
|
25
|
-
// because useEffect does not use storyIds as an input. This is because
|
|
26
|
-
// HMR can change the story even when the storyId hasn't changed. However, it
|
|
27
|
-
// will be a no-op once the story has loaded. Furthermore, the `story` will
|
|
28
|
-
// have an exact equality when the story hasn't changed, so it won't trigger
|
|
29
|
-
// any unnecessary re-renders
|
|
30
|
-
const story = await context.loadStory(storyId);
|
|
31
|
-
setStories(current => current[storyId] === story ? current : Object.assign({}, current, {
|
|
32
|
-
[storyId]: story
|
|
33
|
-
}));
|
|
34
|
-
}));
|
|
35
|
-
});
|
|
36
|
-
return storyIds.map(storyId => storiesById[storyId]);
|
|
37
|
-
}
|
package/dist/cjs/blocks/utils.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getComponentName = void 0;
|
|
7
|
-
exports.scrollToElement = scrollToElement;
|
|
8
|
-
|
|
9
|
-
/* eslint-disable no-underscore-dangle */
|
|
10
|
-
const titleCase = str => str.split('-').map(part => part.charAt(0).toUpperCase() + part.slice(1)).join('');
|
|
11
|
-
|
|
12
|
-
const getComponentName = component => {
|
|
13
|
-
if (!component) {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (typeof component === 'string') {
|
|
18
|
-
if (component.includes('-')) {
|
|
19
|
-
return titleCase(component);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return component;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (component.__docgenInfo && component.__docgenInfo.displayName) {
|
|
26
|
-
return component.__docgenInfo.displayName;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return component.name;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
exports.getComponentName = getComponentName;
|
|
33
|
-
|
|
34
|
-
function scrollToElement(element, block = 'start') {
|
|
35
|
-
element.scrollIntoView({
|
|
36
|
-
behavior: 'smooth',
|
|
37
|
-
block,
|
|
38
|
-
inline: 'nearest'
|
|
39
|
-
});
|
|
40
|
-
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _blocks = require("./blocks");
|
|
8
|
-
|
|
9
|
-
Object.keys(_blocks).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _blocks[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _blocks[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|