@storybook/addon-docs 10.1.0-alpha.10 → 10.1.0-alpha.12
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/dist/_browser-chunks/Color-S5NAVK5F.js +1096 -0
- package/dist/_browser-chunks/{DocsRenderer-HT7GNKAR.js → DocsRenderer-GHJI37HO.js} +2 -2
- package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
- package/dist/_browser-chunks/chunk-CYSK6WYR.js +7 -0
- package/dist/_browser-chunks/chunk-DDRHE7EB.js +949 -0
- package/dist/_browser-chunks/{chunk-74ZUTOZN.js → chunk-OATZR77O.js} +9 -22
- package/dist/_browser-chunks/chunk-UUESKCKV.js +31 -0
- package/dist/_node-chunks/{chunk-AAP3IT42.js → chunk-C335KFTP.js} +13 -19
- package/dist/_node-chunks/chunk-KYCOJTNB.js +168 -0
- package/dist/_node-chunks/chunk-O7PYD3IJ.js +22630 -0
- package/dist/_node-chunks/chunk-W3QUNYQ5.js +196 -0
- package/dist/_node-chunks/mdx-plugin-DEILFM7O.js +1032 -0
- package/dist/_node-chunks/rehype-external-links-5BFMYXOM.js +121 -0
- package/dist/_node-chunks/{rehype-slug-NPV5OLTF.js → rehype-slug-WW2KPWVT.js} +24 -58
- package/dist/angular/index.js +3 -5
- package/dist/blocks.d.ts +4 -2
- package/dist/blocks.js +1833 -3846
- package/dist/ember/index.js +3 -5
- package/dist/index.js +4 -6
- package/dist/manager.js +11 -22
- package/dist/mdx-loader.js +13 -19
- package/dist/preset.js +155 -454
- package/dist/preview.js +2 -2
- package/package.json +6 -6
- package/dist/_browser-chunks/Color-553OW3OY.js +0 -1694
- package/dist/_browser-chunks/chunk-DMNQCVA2.js +0 -12
- package/dist/_browser-chunks/chunk-UZFOWTVP.js +0 -974
- package/dist/_browser-chunks/chunk-YDZYZRYC.js +0 -39
- package/dist/_node-chunks/chunk-BHIBLL2L.js +0 -36332
- package/dist/_node-chunks/chunk-RAVRMRBT.js +0 -248
- package/dist/_node-chunks/chunk-TSMODHW2.js +0 -231
- package/dist/_node-chunks/mdx-plugin-OGZHIA54.js +0 -1654
- package/dist/_node-chunks/rehype-external-links-32F3YIMH.js +0 -168
|
@@ -0,0 +1,1032 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_nnw3aq5pfe from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_nnw3aq5pfe from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_nnw3aq5pfe from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_nnw3aq5pfe.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_nnw3aq5pfe.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_nnw3aq5pfe.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
compile
|
|
14
|
+
} from "./chunk-O7PYD3IJ.js";
|
|
15
|
+
import "./chunk-W3QUNYQ5.js";
|
|
16
|
+
import "./chunk-KYCOJTNB.js";
|
|
17
|
+
import {
|
|
18
|
+
__commonJS,
|
|
19
|
+
__toESM
|
|
20
|
+
} from "./chunk-C335KFTP.js";
|
|
21
|
+
|
|
22
|
+
// ../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/constants.js
|
|
23
|
+
var require_constants = __commonJS({
|
|
24
|
+
"../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
25
|
+
"use strict";
|
|
26
|
+
var WIN_NO_SLASH = "[^\\\\/]", ONE_CHAR = "(?=.)", QMARK = "[^/]", END_ANCHOR = "(?:\\/|$)", START_ANCHOR = "(?:^|\\/)", DOTS_SLASH = `\\.{1,2}${END_ANCHOR}`, NO_DOT = "(?!\\.)", NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!\\.{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, QMARK_NO_DOT = "[^.\\/]", STAR = `${QMARK}*?`, SEP = "/", POSIX_CHARS = {
|
|
27
|
+
DOT_LITERAL: "\\.",
|
|
28
|
+
PLUS_LITERAL: "\\+",
|
|
29
|
+
QMARK_LITERAL: "\\?",
|
|
30
|
+
SLASH_LITERAL: "\\/",
|
|
31
|
+
ONE_CHAR,
|
|
32
|
+
QMARK,
|
|
33
|
+
END_ANCHOR,
|
|
34
|
+
DOTS_SLASH,
|
|
35
|
+
NO_DOT,
|
|
36
|
+
NO_DOTS,
|
|
37
|
+
NO_DOT_SLASH,
|
|
38
|
+
NO_DOTS_SLASH,
|
|
39
|
+
QMARK_NO_DOT,
|
|
40
|
+
STAR,
|
|
41
|
+
START_ANCHOR,
|
|
42
|
+
SEP
|
|
43
|
+
}, WINDOWS_CHARS = {
|
|
44
|
+
...POSIX_CHARS,
|
|
45
|
+
SLASH_LITERAL: "[\\\\/]",
|
|
46
|
+
QMARK: WIN_NO_SLASH,
|
|
47
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
48
|
+
DOTS_SLASH: "\\.{1,2}(?:[\\\\/]|$)",
|
|
49
|
+
NO_DOT: "(?!\\.)",
|
|
50
|
+
NO_DOTS: "(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",
|
|
51
|
+
NO_DOT_SLASH: "(?!\\.{0,1}(?:[\\\\/]|$))",
|
|
52
|
+
NO_DOTS_SLASH: "(?!\\.{1,2}(?:[\\\\/]|$))",
|
|
53
|
+
QMARK_NO_DOT: "[^.\\\\/]",
|
|
54
|
+
START_ANCHOR: "(?:^|[\\\\/])",
|
|
55
|
+
END_ANCHOR: "(?:[\\\\/]|$)",
|
|
56
|
+
SEP: "\\"
|
|
57
|
+
}, POSIX_REGEX_SOURCE = {
|
|
58
|
+
alnum: "a-zA-Z0-9",
|
|
59
|
+
alpha: "a-zA-Z",
|
|
60
|
+
ascii: "\\x00-\\x7F",
|
|
61
|
+
blank: " \\t",
|
|
62
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
63
|
+
digit: "0-9",
|
|
64
|
+
graph: "\\x21-\\x7E",
|
|
65
|
+
lower: "a-z",
|
|
66
|
+
print: "\\x20-\\x7E ",
|
|
67
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
68
|
+
space: " \\t\\r\\n\\v\\f",
|
|
69
|
+
upper: "A-Z",
|
|
70
|
+
word: "A-Za-z0-9_",
|
|
71
|
+
xdigit: "A-Fa-f0-9"
|
|
72
|
+
};
|
|
73
|
+
module.exports = {
|
|
74
|
+
MAX_LENGTH: 1024 * 64,
|
|
75
|
+
POSIX_REGEX_SOURCE,
|
|
76
|
+
// regular expressions
|
|
77
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
78
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
79
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
80
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
81
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
82
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
83
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
84
|
+
REPLACEMENTS: {
|
|
85
|
+
__proto__: null,
|
|
86
|
+
"***": "*",
|
|
87
|
+
"**/**": "**",
|
|
88
|
+
"**/**/**": "**"
|
|
89
|
+
},
|
|
90
|
+
// Digits
|
|
91
|
+
CHAR_0: 48,
|
|
92
|
+
/* 0 */
|
|
93
|
+
CHAR_9: 57,
|
|
94
|
+
/* 9 */
|
|
95
|
+
// Alphabet chars.
|
|
96
|
+
CHAR_UPPERCASE_A: 65,
|
|
97
|
+
/* A */
|
|
98
|
+
CHAR_LOWERCASE_A: 97,
|
|
99
|
+
/* a */
|
|
100
|
+
CHAR_UPPERCASE_Z: 90,
|
|
101
|
+
/* Z */
|
|
102
|
+
CHAR_LOWERCASE_Z: 122,
|
|
103
|
+
/* z */
|
|
104
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
105
|
+
/* ( */
|
|
106
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
107
|
+
/* ) */
|
|
108
|
+
CHAR_ASTERISK: 42,
|
|
109
|
+
/* * */
|
|
110
|
+
// Non-alphabetic chars.
|
|
111
|
+
CHAR_AMPERSAND: 38,
|
|
112
|
+
/* & */
|
|
113
|
+
CHAR_AT: 64,
|
|
114
|
+
/* @ */
|
|
115
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
116
|
+
/* \ */
|
|
117
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
118
|
+
/* \r */
|
|
119
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
120
|
+
/* ^ */
|
|
121
|
+
CHAR_COLON: 58,
|
|
122
|
+
/* : */
|
|
123
|
+
CHAR_COMMA: 44,
|
|
124
|
+
/* , */
|
|
125
|
+
CHAR_DOT: 46,
|
|
126
|
+
/* . */
|
|
127
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
128
|
+
/* " */
|
|
129
|
+
CHAR_EQUAL: 61,
|
|
130
|
+
/* = */
|
|
131
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
132
|
+
/* ! */
|
|
133
|
+
CHAR_FORM_FEED: 12,
|
|
134
|
+
/* \f */
|
|
135
|
+
CHAR_FORWARD_SLASH: 47,
|
|
136
|
+
/* / */
|
|
137
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
138
|
+
/* ` */
|
|
139
|
+
CHAR_HASH: 35,
|
|
140
|
+
/* # */
|
|
141
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
142
|
+
/* - */
|
|
143
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
144
|
+
/* < */
|
|
145
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
146
|
+
/* { */
|
|
147
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
148
|
+
/* [ */
|
|
149
|
+
CHAR_LINE_FEED: 10,
|
|
150
|
+
/* \n */
|
|
151
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
152
|
+
/* \u00A0 */
|
|
153
|
+
CHAR_PERCENT: 37,
|
|
154
|
+
/* % */
|
|
155
|
+
CHAR_PLUS: 43,
|
|
156
|
+
/* + */
|
|
157
|
+
CHAR_QUESTION_MARK: 63,
|
|
158
|
+
/* ? */
|
|
159
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
160
|
+
/* > */
|
|
161
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
162
|
+
/* } */
|
|
163
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
164
|
+
/* ] */
|
|
165
|
+
CHAR_SEMICOLON: 59,
|
|
166
|
+
/* ; */
|
|
167
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
168
|
+
/* ' */
|
|
169
|
+
CHAR_SPACE: 32,
|
|
170
|
+
/* */
|
|
171
|
+
CHAR_TAB: 9,
|
|
172
|
+
/* \t */
|
|
173
|
+
CHAR_UNDERSCORE: 95,
|
|
174
|
+
/* _ */
|
|
175
|
+
CHAR_VERTICAL_LINE: 124,
|
|
176
|
+
/* | */
|
|
177
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
178
|
+
/* \uFEFF */
|
|
179
|
+
/**
|
|
180
|
+
* Create EXTGLOB_CHARS
|
|
181
|
+
*/
|
|
182
|
+
extglobChars(chars) {
|
|
183
|
+
return {
|
|
184
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
185
|
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
186
|
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
187
|
+
"*": { type: "star", open: "(?:", close: ")*" },
|
|
188
|
+
"@": { type: "at", open: "(?:", close: ")" }
|
|
189
|
+
};
|
|
190
|
+
},
|
|
191
|
+
/**
|
|
192
|
+
* Create GLOB_CHARS
|
|
193
|
+
*/
|
|
194
|
+
globChars(win322) {
|
|
195
|
+
return win322 === !0 ? WINDOWS_CHARS : POSIX_CHARS;
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// ../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/utils.js
|
|
202
|
+
var require_utils = __commonJS({
|
|
203
|
+
"../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/utils.js"(exports) {
|
|
204
|
+
"use strict";
|
|
205
|
+
var {
|
|
206
|
+
REGEX_BACKSLASH,
|
|
207
|
+
REGEX_REMOVE_BACKSLASH,
|
|
208
|
+
REGEX_SPECIAL_CHARS,
|
|
209
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
210
|
+
} = require_constants();
|
|
211
|
+
exports.isObject = (val) => val !== null && typeof val == "object" && !Array.isArray(val);
|
|
212
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
213
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
214
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
215
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
216
|
+
exports.isWindows = () => {
|
|
217
|
+
if (typeof navigator < "u" && navigator.platform) {
|
|
218
|
+
let platform = navigator.platform.toLowerCase();
|
|
219
|
+
return platform === "win32" || platform === "windows";
|
|
220
|
+
}
|
|
221
|
+
return typeof process < "u" && process.platform ? process.platform === "win32" : !1;
|
|
222
|
+
};
|
|
223
|
+
exports.removeBackslashes = (str) => str.replace(REGEX_REMOVE_BACKSLASH, (match) => match === "\\" ? "" : match);
|
|
224
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
225
|
+
let idx = input.lastIndexOf(char, lastIdx);
|
|
226
|
+
return idx === -1 ? input : input[idx - 1] === "\\" ? exports.escapeLast(input, char, idx - 1) : `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
227
|
+
};
|
|
228
|
+
exports.removePrefix = (input, state = {}) => {
|
|
229
|
+
let output = input;
|
|
230
|
+
return output.startsWith("./") && (output = output.slice(2), state.prefix = "./"), output;
|
|
231
|
+
};
|
|
232
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
233
|
+
let prepend = options.contains ? "" : "^", append = options.contains ? "" : "$", output = `${prepend}(?:${input})${append}`;
|
|
234
|
+
return state.negated === !0 && (output = `(?:^(?!${output}).*$)`), output;
|
|
235
|
+
};
|
|
236
|
+
exports.basename = (path, { windows } = {}) => {
|
|
237
|
+
let segs = path.split(windows ? /[\\/]/ : "/"), last = segs[segs.length - 1];
|
|
238
|
+
return last === "" ? segs[segs.length - 2] : last;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// ../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/scan.js
|
|
244
|
+
var require_scan = __commonJS({
|
|
245
|
+
"../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
246
|
+
"use strict";
|
|
247
|
+
var utils = require_utils(), {
|
|
248
|
+
CHAR_ASTERISK,
|
|
249
|
+
/* * */
|
|
250
|
+
CHAR_AT,
|
|
251
|
+
/* @ */
|
|
252
|
+
CHAR_BACKWARD_SLASH,
|
|
253
|
+
/* \ */
|
|
254
|
+
CHAR_COMMA,
|
|
255
|
+
/* , */
|
|
256
|
+
CHAR_DOT,
|
|
257
|
+
/* . */
|
|
258
|
+
CHAR_EXCLAMATION_MARK,
|
|
259
|
+
/* ! */
|
|
260
|
+
CHAR_FORWARD_SLASH,
|
|
261
|
+
/* / */
|
|
262
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
263
|
+
/* { */
|
|
264
|
+
CHAR_LEFT_PARENTHESES,
|
|
265
|
+
/* ( */
|
|
266
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
267
|
+
/* [ */
|
|
268
|
+
CHAR_PLUS,
|
|
269
|
+
/* + */
|
|
270
|
+
CHAR_QUESTION_MARK,
|
|
271
|
+
/* ? */
|
|
272
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
273
|
+
/* } */
|
|
274
|
+
CHAR_RIGHT_PARENTHESES,
|
|
275
|
+
/* ) */
|
|
276
|
+
CHAR_RIGHT_SQUARE_BRACKET
|
|
277
|
+
/* ] */
|
|
278
|
+
} = require_constants(), isPathSeparator = (code) => code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token) => {
|
|
279
|
+
token.isPrefix !== !0 && (token.depth = token.isGlobstar ? 1 / 0 : 1);
|
|
280
|
+
}, scan = (input, options) => {
|
|
281
|
+
let opts = options || {}, length = input.length - 1, scanToEnd = opts.parts === !0 || opts.scanToEnd === !0, slashes = [], tokens = [], parts = [], str = input, index = -1, start = 0, lastIndex = 0, isBrace = !1, isBracket = !1, isGlob = !1, isExtglob = !1, isGlobstar = !1, braceEscaped = !1, backslashes = !1, negated = !1, negatedExtglob = !1, finished = !1, braces = 0, prev, code, token = { value: "", depth: 0, isGlob: !1 }, eos = () => index >= length, peek = () => str.charCodeAt(index + 1), advance = () => (prev = code, str.charCodeAt(++index));
|
|
282
|
+
for (; index < length; ) {
|
|
283
|
+
code = advance();
|
|
284
|
+
let next;
|
|
285
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
286
|
+
backslashes = token.backslashes = !0, code = advance(), code === CHAR_LEFT_CURLY_BRACE && (braceEscaped = !0);
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
if (braceEscaped === !0 || code === CHAR_LEFT_CURLY_BRACE) {
|
|
290
|
+
for (braces++; eos() !== !0 && (code = advance()); ) {
|
|
291
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
292
|
+
backslashes = token.backslashes = !0, advance();
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
296
|
+
braces++;
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (braceEscaped !== !0 && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
300
|
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
301
|
+
continue;
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
if (braceEscaped !== !0 && code === CHAR_COMMA) {
|
|
305
|
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
306
|
+
continue;
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
if (code === CHAR_RIGHT_CURLY_BRACE && (braces--, braces === 0)) {
|
|
310
|
+
braceEscaped = !1, isBrace = token.isBrace = !0, finished = !0;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (scanToEnd === !0)
|
|
315
|
+
continue;
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
319
|
+
if (slashes.push(index), tokens.push(token), token = { value: "", depth: 0, isGlob: !1 }, finished === !0) continue;
|
|
320
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
321
|
+
start += 2;
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
lastIndex = index + 1;
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
if (opts.noext !== !0 && (code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === !0 && peek() === CHAR_LEFT_PARENTHESES) {
|
|
328
|
+
if (isGlob = token.isGlob = !0, isExtglob = token.isExtglob = !0, finished = !0, code === CHAR_EXCLAMATION_MARK && index === start && (negatedExtglob = !0), scanToEnd === !0) {
|
|
329
|
+
for (; eos() !== !0 && (code = advance()); ) {
|
|
330
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
331
|
+
backslashes = token.backslashes = !0, code = advance();
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
335
|
+
isGlob = token.isGlob = !0, finished = !0;
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
if (code === CHAR_ASTERISK) {
|
|
344
|
+
if (prev === CHAR_ASTERISK && (isGlobstar = token.isGlobstar = !0), isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
345
|
+
continue;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
349
|
+
if (isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
350
|
+
continue;
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
354
|
+
for (; eos() !== !0 && (next = advance()); ) {
|
|
355
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
356
|
+
backslashes = token.backslashes = !0, advance();
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
360
|
+
isBracket = token.isBracket = !0, isGlob = token.isGlob = !0, finished = !0;
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (scanToEnd === !0)
|
|
365
|
+
continue;
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
if (opts.nonegate !== !0 && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
369
|
+
negated = token.negated = !0, start++;
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
if (opts.noparen !== !0 && code === CHAR_LEFT_PARENTHESES) {
|
|
373
|
+
if (isGlob = token.isGlob = !0, scanToEnd === !0) {
|
|
374
|
+
for (; eos() !== !0 && (code = advance()); ) {
|
|
375
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
376
|
+
backslashes = token.backslashes = !0, code = advance();
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
380
|
+
finished = !0;
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
if (isGlob === !0) {
|
|
389
|
+
if (finished = !0, scanToEnd === !0)
|
|
390
|
+
continue;
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
opts.noext === !0 && (isExtglob = !1, isGlob = !1);
|
|
395
|
+
let base = str, prefix = "", glob = "";
|
|
396
|
+
start > 0 && (prefix = str.slice(0, start), str = str.slice(start), lastIndex -= start), base && isGlob === !0 && lastIndex > 0 ? (base = str.slice(0, lastIndex), glob = str.slice(lastIndex)) : isGlob === !0 ? (base = "", glob = str) : base = str, base && base !== "" && base !== "/" && base !== str && isPathSeparator(base.charCodeAt(base.length - 1)) && (base = base.slice(0, -1)), opts.unescape === !0 && (glob && (glob = utils.removeBackslashes(glob)), base && backslashes === !0 && (base = utils.removeBackslashes(base)));
|
|
397
|
+
let state = {
|
|
398
|
+
prefix,
|
|
399
|
+
input,
|
|
400
|
+
start,
|
|
401
|
+
base,
|
|
402
|
+
glob,
|
|
403
|
+
isBrace,
|
|
404
|
+
isBracket,
|
|
405
|
+
isGlob,
|
|
406
|
+
isExtglob,
|
|
407
|
+
isGlobstar,
|
|
408
|
+
negated,
|
|
409
|
+
negatedExtglob
|
|
410
|
+
};
|
|
411
|
+
if (opts.tokens === !0 && (state.maxDepth = 0, isPathSeparator(code) || tokens.push(token), state.tokens = tokens), opts.parts === !0 || opts.tokens === !0) {
|
|
412
|
+
let prevIndex;
|
|
413
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
414
|
+
let n = prevIndex ? prevIndex + 1 : start, i = slashes[idx], value = input.slice(n, i);
|
|
415
|
+
opts.tokens && (idx === 0 && start !== 0 ? (tokens[idx].isPrefix = !0, tokens[idx].value = prefix) : tokens[idx].value = value, depth(tokens[idx]), state.maxDepth += tokens[idx].depth), (idx !== 0 || value !== "") && parts.push(value), prevIndex = i;
|
|
416
|
+
}
|
|
417
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
418
|
+
let value = input.slice(prevIndex + 1);
|
|
419
|
+
parts.push(value), opts.tokens && (tokens[tokens.length - 1].value = value, depth(tokens[tokens.length - 1]), state.maxDepth += tokens[tokens.length - 1].depth);
|
|
420
|
+
}
|
|
421
|
+
state.slashes = slashes, state.parts = parts;
|
|
422
|
+
}
|
|
423
|
+
return state;
|
|
424
|
+
};
|
|
425
|
+
module.exports = scan;
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
// ../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/parse.js
|
|
430
|
+
var require_parse = __commonJS({
|
|
431
|
+
"../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
432
|
+
"use strict";
|
|
433
|
+
var constants = require_constants(), utils = require_utils(), {
|
|
434
|
+
MAX_LENGTH,
|
|
435
|
+
POSIX_REGEX_SOURCE,
|
|
436
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
437
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
438
|
+
REPLACEMENTS
|
|
439
|
+
} = constants, expandRange = (args, options) => {
|
|
440
|
+
if (typeof options.expandRange == "function")
|
|
441
|
+
return options.expandRange(...args, options);
|
|
442
|
+
args.sort();
|
|
443
|
+
let value = `[${args.join("-")}]`;
|
|
444
|
+
try {
|
|
445
|
+
new RegExp(value);
|
|
446
|
+
} catch {
|
|
447
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
448
|
+
}
|
|
449
|
+
return value;
|
|
450
|
+
}, syntaxError = (type, char) => `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, parse = (input, options) => {
|
|
451
|
+
if (typeof input != "string")
|
|
452
|
+
throw new TypeError("Expected a string");
|
|
453
|
+
input = REPLACEMENTS[input] || input;
|
|
454
|
+
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
455
|
+
if (len > max)
|
|
456
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
457
|
+
let bos = { type: "bos", value: "", output: opts.prepend || "" }, tokens = [bos], capture = opts.capture ? "" : "?:", PLATFORM_CHARS = constants.globChars(opts.windows), EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS), {
|
|
458
|
+
DOT_LITERAL,
|
|
459
|
+
PLUS_LITERAL,
|
|
460
|
+
SLASH_LITERAL,
|
|
461
|
+
ONE_CHAR,
|
|
462
|
+
DOTS_SLASH,
|
|
463
|
+
NO_DOT,
|
|
464
|
+
NO_DOT_SLASH,
|
|
465
|
+
NO_DOTS_SLASH,
|
|
466
|
+
QMARK,
|
|
467
|
+
QMARK_NO_DOT,
|
|
468
|
+
STAR,
|
|
469
|
+
START_ANCHOR
|
|
470
|
+
} = PLATFORM_CHARS, globstar = (opts2) => `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, nodot = opts.dot ? "" : NO_DOT, qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT, star = opts.bash === !0 ? globstar(opts) : STAR;
|
|
471
|
+
opts.capture && (star = `(${star})`), typeof opts.noext == "boolean" && (opts.noextglob = opts.noext);
|
|
472
|
+
let state = {
|
|
473
|
+
input,
|
|
474
|
+
index: -1,
|
|
475
|
+
start: 0,
|
|
476
|
+
dot: opts.dot === !0,
|
|
477
|
+
consumed: "",
|
|
478
|
+
output: "",
|
|
479
|
+
prefix: "",
|
|
480
|
+
backtrack: !1,
|
|
481
|
+
negated: !1,
|
|
482
|
+
brackets: 0,
|
|
483
|
+
braces: 0,
|
|
484
|
+
parens: 0,
|
|
485
|
+
quotes: 0,
|
|
486
|
+
globstar: !1,
|
|
487
|
+
tokens
|
|
488
|
+
};
|
|
489
|
+
input = utils.removePrefix(input, state), len = input.length;
|
|
490
|
+
let extglobs = [], braces = [], stack = [], prev = bos, value, eos = () => state.index === len - 1, peek = state.peek = (n = 1) => input[state.index + n], advance = state.advance = () => input[++state.index] || "", remaining = () => input.slice(state.index + 1), consume = (value2 = "", num = 0) => {
|
|
491
|
+
state.consumed += value2, state.index += num;
|
|
492
|
+
}, append = (token) => {
|
|
493
|
+
state.output += token.output != null ? token.output : token.value, consume(token.value);
|
|
494
|
+
}, negate = () => {
|
|
495
|
+
let count = 1;
|
|
496
|
+
for (; peek() === "!" && (peek(2) !== "(" || peek(3) === "?"); )
|
|
497
|
+
advance(), state.start++, count++;
|
|
498
|
+
return count % 2 === 0 ? !1 : (state.negated = !0, state.start++, !0);
|
|
499
|
+
}, increment = (type) => {
|
|
500
|
+
state[type]++, stack.push(type);
|
|
501
|
+
}, decrement = (type) => {
|
|
502
|
+
state[type]--, stack.pop();
|
|
503
|
+
}, push = (tok) => {
|
|
504
|
+
if (prev.type === "globstar") {
|
|
505
|
+
let isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"), isExtglob = tok.extglob === !0 || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
506
|
+
tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob && (state.output = state.output.slice(0, -prev.output.length), prev.type = "star", prev.value = "*", prev.output = star, state.output += prev.output);
|
|
507
|
+
}
|
|
508
|
+
if (extglobs.length && tok.type !== "paren" && (extglobs[extglobs.length - 1].inner += tok.value), (tok.value || tok.output) && append(tok), prev && prev.type === "text" && tok.type === "text") {
|
|
509
|
+
prev.output = (prev.output || prev.value) + tok.value, prev.value += tok.value;
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
tok.prev = prev, tokens.push(tok), prev = tok;
|
|
513
|
+
}, extglobOpen = (type, value2) => {
|
|
514
|
+
let token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
515
|
+
token.prev = prev, token.parens = state.parens, token.output = state.output;
|
|
516
|
+
let output = (opts.capture ? "(" : "") + token.open;
|
|
517
|
+
increment("parens"), push({ type, value: value2, output: state.output ? "" : ONE_CHAR }), push({ type: "paren", extglob: !0, value: advance(), output }), extglobs.push(token);
|
|
518
|
+
}, extglobClose = (token) => {
|
|
519
|
+
let output = token.close + (opts.capture ? ")" : ""), rest;
|
|
520
|
+
if (token.type === "negate") {
|
|
521
|
+
let extglobStar = star;
|
|
522
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/") && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
523
|
+
let expression = parse(rest, { ...options, fastpaths: !1 }).output;
|
|
524
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
525
|
+
}
|
|
526
|
+
token.prev.type === "bos" && (state.negatedExtglob = !0);
|
|
527
|
+
}
|
|
528
|
+
push({ type: "paren", extglob: !0, value, output }), decrement("parens");
|
|
529
|
+
};
|
|
530
|
+
if (opts.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
531
|
+
let backslashes = !1, output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => first === "\\" ? (backslashes = !0, m) : first === "?" ? esc ? esc + first + (rest ? QMARK.repeat(rest.length) : "") : index === 0 ? qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "") : QMARK.repeat(chars.length) : first === "." ? DOT_LITERAL.repeat(chars.length) : first === "*" ? esc ? esc + first + (rest ? star : "") : star : esc ? m : `\\${m}`);
|
|
532
|
+
return backslashes === !0 && (opts.unescape === !0 ? output = output.replace(/\\/g, "") : output = output.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), output === input && opts.contains === !0 ? (state.output = input, state) : (state.output = utils.wrapOutput(output, state, options), state);
|
|
533
|
+
}
|
|
534
|
+
for (; !eos(); ) {
|
|
535
|
+
if (value = advance(), value === "\0")
|
|
536
|
+
continue;
|
|
537
|
+
if (value === "\\") {
|
|
538
|
+
let next = peek();
|
|
539
|
+
if (next === "/" && opts.bash !== !0 || next === "." || next === ";")
|
|
540
|
+
continue;
|
|
541
|
+
if (!next) {
|
|
542
|
+
value += "\\", push({ type: "text", value });
|
|
543
|
+
continue;
|
|
544
|
+
}
|
|
545
|
+
let match = /^\\+/.exec(remaining()), slashes = 0;
|
|
546
|
+
if (match && match[0].length > 2 && (slashes = match[0].length, state.index += slashes, slashes % 2 !== 0 && (value += "\\")), opts.unescape === !0 ? value = advance() : value += advance(), state.brackets === 0) {
|
|
547
|
+
push({ type: "text", value });
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
552
|
+
if (opts.posix !== !1 && value === ":") {
|
|
553
|
+
let inner = prev.value.slice(1);
|
|
554
|
+
if (inner.includes("[") && (prev.posix = !0, inner.includes(":"))) {
|
|
555
|
+
let idx = prev.value.lastIndexOf("["), pre = prev.value.slice(0, idx), rest2 = prev.value.slice(idx + 2), posix2 = POSIX_REGEX_SOURCE[rest2];
|
|
556
|
+
if (posix2) {
|
|
557
|
+
prev.value = pre + posix2, state.backtrack = !0, advance(), !bos.output && tokens.indexOf(prev) === 1 && (bos.output = ONE_CHAR);
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
(value === "[" && peek() !== ":" || value === "-" && peek() === "]") && (value = `\\${value}`), value === "]" && (prev.value === "[" || prev.value === "[^") && (value = `\\${value}`), opts.posix === !0 && value === "!" && prev.value === "[" && (value = "^"), prev.value += value, append({ value });
|
|
563
|
+
continue;
|
|
564
|
+
}
|
|
565
|
+
if (state.quotes === 1 && value !== '"') {
|
|
566
|
+
value = utils.escapeRegex(value), prev.value += value, append({ value });
|
|
567
|
+
continue;
|
|
568
|
+
}
|
|
569
|
+
if (value === '"') {
|
|
570
|
+
state.quotes = state.quotes === 1 ? 0 : 1, opts.keepQuotes === !0 && push({ type: "text", value });
|
|
571
|
+
continue;
|
|
572
|
+
}
|
|
573
|
+
if (value === "(") {
|
|
574
|
+
increment("parens"), push({ type: "paren", value });
|
|
575
|
+
continue;
|
|
576
|
+
}
|
|
577
|
+
if (value === ")") {
|
|
578
|
+
if (state.parens === 0 && opts.strictBrackets === !0)
|
|
579
|
+
throw new SyntaxError(syntaxError("opening", "("));
|
|
580
|
+
let extglob = extglobs[extglobs.length - 1];
|
|
581
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
582
|
+
extglobClose(extglobs.pop());
|
|
583
|
+
continue;
|
|
584
|
+
}
|
|
585
|
+
push({ type: "paren", value, output: state.parens ? ")" : "\\)" }), decrement("parens");
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
if (value === "[") {
|
|
589
|
+
if (opts.nobracket === !0 || !remaining().includes("]")) {
|
|
590
|
+
if (opts.nobracket !== !0 && opts.strictBrackets === !0)
|
|
591
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
592
|
+
value = `\\${value}`;
|
|
593
|
+
} else
|
|
594
|
+
increment("brackets");
|
|
595
|
+
push({ type: "bracket", value });
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
if (value === "]") {
|
|
599
|
+
if (opts.nobracket === !0 || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
600
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
if (state.brackets === 0) {
|
|
604
|
+
if (opts.strictBrackets === !0)
|
|
605
|
+
throw new SyntaxError(syntaxError("opening", "["));
|
|
606
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
decrement("brackets");
|
|
610
|
+
let prevValue = prev.value.slice(1);
|
|
611
|
+
if (prev.posix !== !0 && prevValue[0] === "^" && !prevValue.includes("/") && (value = `/${value}`), prev.value += value, append({ value }), opts.literalBrackets === !1 || utils.hasRegexChars(prevValue))
|
|
612
|
+
continue;
|
|
613
|
+
let escaped = utils.escapeRegex(prev.value);
|
|
614
|
+
if (state.output = state.output.slice(0, -prev.value.length), opts.literalBrackets === !0) {
|
|
615
|
+
state.output += escaped, prev.value = escaped;
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
prev.value = `(${capture}${escaped}|${prev.value})`, state.output += prev.value;
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
if (value === "{" && opts.nobrace !== !0) {
|
|
622
|
+
increment("braces");
|
|
623
|
+
let open = {
|
|
624
|
+
type: "brace",
|
|
625
|
+
value,
|
|
626
|
+
output: "(",
|
|
627
|
+
outputIndex: state.output.length,
|
|
628
|
+
tokensIndex: state.tokens.length
|
|
629
|
+
};
|
|
630
|
+
braces.push(open), push(open);
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
if (value === "}") {
|
|
634
|
+
let brace = braces[braces.length - 1];
|
|
635
|
+
if (opts.nobrace === !0 || !brace) {
|
|
636
|
+
push({ type: "text", value, output: value });
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
let output = ")";
|
|
640
|
+
if (brace.dots === !0) {
|
|
641
|
+
let arr = tokens.slice(), range = [];
|
|
642
|
+
for (let i = arr.length - 1; i >= 0 && (tokens.pop(), arr[i].type !== "brace"); i--)
|
|
643
|
+
arr[i].type !== "dots" && range.unshift(arr[i].value);
|
|
644
|
+
output = expandRange(range, opts), state.backtrack = !0;
|
|
645
|
+
}
|
|
646
|
+
if (brace.comma !== !0 && brace.dots !== !0) {
|
|
647
|
+
let out = state.output.slice(0, brace.outputIndex), toks = state.tokens.slice(brace.tokensIndex);
|
|
648
|
+
brace.value = brace.output = "\\{", value = output = "\\}", state.output = out;
|
|
649
|
+
for (let t of toks)
|
|
650
|
+
state.output += t.output || t.value;
|
|
651
|
+
}
|
|
652
|
+
push({ type: "brace", value, output }), decrement("braces"), braces.pop();
|
|
653
|
+
continue;
|
|
654
|
+
}
|
|
655
|
+
if (value === "|") {
|
|
656
|
+
extglobs.length > 0 && extglobs[extglobs.length - 1].conditions++, push({ type: "text", value });
|
|
657
|
+
continue;
|
|
658
|
+
}
|
|
659
|
+
if (value === ",") {
|
|
660
|
+
let output = value, brace = braces[braces.length - 1];
|
|
661
|
+
brace && stack[stack.length - 1] === "braces" && (brace.comma = !0, output = "|"), push({ type: "comma", value, output });
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
if (value === "/") {
|
|
665
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
666
|
+
state.start = state.index + 1, state.consumed = "", state.output = "", tokens.pop(), prev = bos;
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
670
|
+
continue;
|
|
671
|
+
}
|
|
672
|
+
if (value === ".") {
|
|
673
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
674
|
+
prev.value === "." && (prev.output = DOT_LITERAL);
|
|
675
|
+
let brace = braces[braces.length - 1];
|
|
676
|
+
prev.type = "dots", prev.output += value, prev.value += value, brace.dots = !0;
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
679
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
680
|
+
push({ type: "text", value, output: DOT_LITERAL });
|
|
681
|
+
continue;
|
|
682
|
+
}
|
|
683
|
+
push({ type: "dot", value, output: DOT_LITERAL });
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
if (value === "?") {
|
|
687
|
+
if (!(prev && prev.value === "(") && opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
688
|
+
extglobOpen("qmark", value);
|
|
689
|
+
continue;
|
|
690
|
+
}
|
|
691
|
+
if (prev && prev.type === "paren") {
|
|
692
|
+
let next = peek(), output = value;
|
|
693
|
+
(prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) && (output = `\\${value}`), push({ type: "text", value, output });
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
if (opts.dot !== !0 && (prev.type === "slash" || prev.type === "bos")) {
|
|
697
|
+
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
698
|
+
continue;
|
|
699
|
+
}
|
|
700
|
+
push({ type: "qmark", value, output: QMARK });
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
703
|
+
if (value === "!") {
|
|
704
|
+
if (opts.noextglob !== !0 && peek() === "(" && (peek(2) !== "?" || !/[!=<:]/.test(peek(3)))) {
|
|
705
|
+
extglobOpen("negate", value);
|
|
706
|
+
continue;
|
|
707
|
+
}
|
|
708
|
+
if (opts.nonegate !== !0 && state.index === 0) {
|
|
709
|
+
negate();
|
|
710
|
+
continue;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
if (value === "+") {
|
|
714
|
+
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
715
|
+
extglobOpen("plus", value);
|
|
716
|
+
continue;
|
|
717
|
+
}
|
|
718
|
+
if (prev && prev.value === "(" || opts.regex === !1) {
|
|
719
|
+
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
723
|
+
push({ type: "plus", value });
|
|
724
|
+
continue;
|
|
725
|
+
}
|
|
726
|
+
push({ type: "plus", value: PLUS_LITERAL });
|
|
727
|
+
continue;
|
|
728
|
+
}
|
|
729
|
+
if (value === "@") {
|
|
730
|
+
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
731
|
+
push({ type: "at", extglob: !0, value, output: "" });
|
|
732
|
+
continue;
|
|
733
|
+
}
|
|
734
|
+
push({ type: "text", value });
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
if (value !== "*") {
|
|
738
|
+
(value === "$" || value === "^") && (value = `\\${value}`);
|
|
739
|
+
let match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
740
|
+
match && (value += match[0], state.index += match[0].length), push({ type: "text", value });
|
|
741
|
+
continue;
|
|
742
|
+
}
|
|
743
|
+
if (prev && (prev.type === "globstar" || prev.star === !0)) {
|
|
744
|
+
prev.type = "star", prev.star = !0, prev.value += value, prev.output = star, state.backtrack = !0, state.globstar = !0, consume(value);
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
let rest = remaining();
|
|
748
|
+
if (opts.noextglob !== !0 && /^\([^?]/.test(rest)) {
|
|
749
|
+
extglobOpen("star", value);
|
|
750
|
+
continue;
|
|
751
|
+
}
|
|
752
|
+
if (prev.type === "star") {
|
|
753
|
+
if (opts.noglobstar === !0) {
|
|
754
|
+
consume(value);
|
|
755
|
+
continue;
|
|
756
|
+
}
|
|
757
|
+
let prior = prev.prev, before = prior.prev, isStart = prior.type === "slash" || prior.type === "bos", afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
758
|
+
if (opts.bash === !0 && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
759
|
+
push({ type: "star", value, output: "" });
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
let isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"), isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
763
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
764
|
+
push({ type: "star", value, output: "" });
|
|
765
|
+
continue;
|
|
766
|
+
}
|
|
767
|
+
for (; rest.slice(0, 3) === "/**"; ) {
|
|
768
|
+
let after = input[state.index + 4];
|
|
769
|
+
if (after && after !== "/")
|
|
770
|
+
break;
|
|
771
|
+
rest = rest.slice(3), consume("/**", 3);
|
|
772
|
+
}
|
|
773
|
+
if (prior.type === "bos" && eos()) {
|
|
774
|
+
prev.type = "globstar", prev.value += value, prev.output = globstar(opts), state.output = prev.output, state.globstar = !0, consume(value);
|
|
775
|
+
continue;
|
|
776
|
+
}
|
|
777
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
778
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"), prev.value += value, state.globstar = !0, state.output += prior.output + prev.output, consume(value);
|
|
779
|
+
continue;
|
|
780
|
+
}
|
|
781
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
782
|
+
let end = rest[1] !== void 0 ? "|$" : "";
|
|
783
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`, prev.value += value, state.output += prior.output + prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
|
784
|
+
continue;
|
|
785
|
+
}
|
|
786
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
787
|
+
prev.type = "globstar", prev.value += value, prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`, state.output = prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
state.output = state.output.slice(0, -prev.output.length), prev.type = "globstar", prev.output = globstar(opts), prev.value += value, state.output += prev.output, state.globstar = !0, consume(value);
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
let token = { type: "star", value, output: star };
|
|
794
|
+
if (opts.bash === !0) {
|
|
795
|
+
token.output = ".*?", (prev.type === "bos" || prev.type === "slash") && (token.output = nodot + token.output), push(token);
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
798
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === !0) {
|
|
799
|
+
token.output = value, push(token);
|
|
800
|
+
continue;
|
|
801
|
+
}
|
|
802
|
+
(state.index === state.start || prev.type === "slash" || prev.type === "dot") && (prev.type === "dot" ? (state.output += NO_DOT_SLASH, prev.output += NO_DOT_SLASH) : opts.dot === !0 ? (state.output += NO_DOTS_SLASH, prev.output += NO_DOTS_SLASH) : (state.output += nodot, prev.output += nodot), peek() !== "*" && (state.output += ONE_CHAR, prev.output += ONE_CHAR)), push(token);
|
|
803
|
+
}
|
|
804
|
+
for (; state.brackets > 0; ) {
|
|
805
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "]"));
|
|
806
|
+
state.output = utils.escapeLast(state.output, "["), decrement("brackets");
|
|
807
|
+
}
|
|
808
|
+
for (; state.parens > 0; ) {
|
|
809
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", ")"));
|
|
810
|
+
state.output = utils.escapeLast(state.output, "("), decrement("parens");
|
|
811
|
+
}
|
|
812
|
+
for (; state.braces > 0; ) {
|
|
813
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "}"));
|
|
814
|
+
state.output = utils.escapeLast(state.output, "{"), decrement("braces");
|
|
815
|
+
}
|
|
816
|
+
if (opts.strictSlashes !== !0 && (prev.type === "star" || prev.type === "bracket") && push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }), state.backtrack === !0) {
|
|
817
|
+
state.output = "";
|
|
818
|
+
for (let token of state.tokens)
|
|
819
|
+
state.output += token.output != null ? token.output : token.value, token.suffix && (state.output += token.suffix);
|
|
820
|
+
}
|
|
821
|
+
return state;
|
|
822
|
+
};
|
|
823
|
+
parse.fastpaths = (input, options) => {
|
|
824
|
+
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
825
|
+
if (len > max)
|
|
826
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
827
|
+
input = REPLACEMENTS[input] || input;
|
|
828
|
+
let {
|
|
829
|
+
DOT_LITERAL,
|
|
830
|
+
SLASH_LITERAL,
|
|
831
|
+
ONE_CHAR,
|
|
832
|
+
DOTS_SLASH,
|
|
833
|
+
NO_DOT,
|
|
834
|
+
NO_DOTS,
|
|
835
|
+
NO_DOTS_SLASH,
|
|
836
|
+
STAR,
|
|
837
|
+
START_ANCHOR
|
|
838
|
+
} = constants.globChars(opts.windows), nodot = opts.dot ? NO_DOTS : NO_DOT, slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT, capture = opts.capture ? "" : "?:", state = { negated: !1, prefix: "" }, star = opts.bash === !0 ? ".*?" : STAR;
|
|
839
|
+
opts.capture && (star = `(${star})`);
|
|
840
|
+
let globstar = (opts2) => opts2.noglobstar === !0 ? star : `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, create = (str) => {
|
|
841
|
+
switch (str) {
|
|
842
|
+
case "*":
|
|
843
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
844
|
+
case ".*":
|
|
845
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
846
|
+
case "*.*":
|
|
847
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
848
|
+
case "*/*":
|
|
849
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
850
|
+
case "**":
|
|
851
|
+
return nodot + globstar(opts);
|
|
852
|
+
case "**/*":
|
|
853
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
854
|
+
case "**/*.*":
|
|
855
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
856
|
+
case "**/.*":
|
|
857
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
858
|
+
default: {
|
|
859
|
+
let match = /^(.*?)\.(\w+)$/.exec(str);
|
|
860
|
+
if (!match) return;
|
|
861
|
+
let source2 = create(match[1]);
|
|
862
|
+
return source2 ? source2 + DOT_LITERAL + match[2] : void 0;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}, output = utils.removePrefix(input, state), source = create(output);
|
|
866
|
+
return source && opts.strictSlashes !== !0 && (source += `${SLASH_LITERAL}?`), source;
|
|
867
|
+
};
|
|
868
|
+
module.exports = parse;
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
// ../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/picomatch.js
|
|
873
|
+
var require_picomatch = __commonJS({
|
|
874
|
+
"../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
875
|
+
"use strict";
|
|
876
|
+
var scan = require_scan(), parse = require_parse(), utils = require_utils(), constants = require_constants(), isObject = (val) => val && typeof val == "object" && !Array.isArray(val), picomatch = (glob, options, returnState = !1) => {
|
|
877
|
+
if (Array.isArray(glob)) {
|
|
878
|
+
let fns = glob.map((input) => picomatch(input, options, returnState));
|
|
879
|
+
return (str) => {
|
|
880
|
+
for (let isMatch of fns) {
|
|
881
|
+
let state2 = isMatch(str);
|
|
882
|
+
if (state2) return state2;
|
|
883
|
+
}
|
|
884
|
+
return !1;
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
let isState = isObject(glob) && glob.tokens && glob.input;
|
|
888
|
+
if (glob === "" || typeof glob != "string" && !isState)
|
|
889
|
+
throw new TypeError("Expected pattern to be a non-empty string");
|
|
890
|
+
let opts = options || {}, posix2 = opts.windows, regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, !1, !0), state = regex.state;
|
|
891
|
+
delete regex.state;
|
|
892
|
+
let isIgnored = () => !1;
|
|
893
|
+
if (opts.ignore) {
|
|
894
|
+
let ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
895
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
896
|
+
}
|
|
897
|
+
let matcher = (input, returnObject = !1) => {
|
|
898
|
+
let { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix: posix2 }), result = { glob, state, regex, posix: posix2, input, output, match, isMatch };
|
|
899
|
+
return typeof opts.onResult == "function" && opts.onResult(result), isMatch === !1 ? (result.isMatch = !1, returnObject ? result : !1) : isIgnored(input) ? (typeof opts.onIgnore == "function" && opts.onIgnore(result), result.isMatch = !1, returnObject ? result : !1) : (typeof opts.onMatch == "function" && opts.onMatch(result), returnObject ? result : !0);
|
|
900
|
+
};
|
|
901
|
+
return returnState && (matcher.state = state), matcher;
|
|
902
|
+
};
|
|
903
|
+
picomatch.test = (input, regex, options, { glob, posix: posix2 } = {}) => {
|
|
904
|
+
if (typeof input != "string")
|
|
905
|
+
throw new TypeError("Expected input to be a string");
|
|
906
|
+
if (input === "")
|
|
907
|
+
return { isMatch: !1, output: "" };
|
|
908
|
+
let opts = options || {}, format = opts.format || (posix2 ? utils.toPosixSlashes : null), match = input === glob, output = match && format ? format(input) : input;
|
|
909
|
+
return match === !1 && (output = format ? format(input) : input, match = output === glob), (match === !1 || opts.capture === !0) && (opts.matchBase === !0 || opts.basename === !0 ? match = picomatch.matchBase(input, regex, options, posix2) : match = regex.exec(output)), { isMatch: !!match, match, output };
|
|
910
|
+
};
|
|
911
|
+
picomatch.matchBase = (input, glob, options) => (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input));
|
|
912
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
913
|
+
picomatch.parse = (pattern, options) => Array.isArray(pattern) ? pattern.map((p) => picomatch.parse(p, options)) : parse(pattern, { ...options, fastpaths: !1 });
|
|
914
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
915
|
+
picomatch.compileRe = (state, options, returnOutput = !1, returnState = !1) => {
|
|
916
|
+
if (returnOutput === !0)
|
|
917
|
+
return state.output;
|
|
918
|
+
let opts = options || {}, prepend = opts.contains ? "" : "^", append = opts.contains ? "" : "$", source = `${prepend}(?:${state.output})${append}`;
|
|
919
|
+
state && state.negated === !0 && (source = `^(?!${source}).*$`);
|
|
920
|
+
let regex = picomatch.toRegex(source, options);
|
|
921
|
+
return returnState === !0 && (regex.state = state), regex;
|
|
922
|
+
};
|
|
923
|
+
picomatch.makeRe = (input, options = {}, returnOutput = !1, returnState = !1) => {
|
|
924
|
+
if (!input || typeof input != "string")
|
|
925
|
+
throw new TypeError("Expected a non-empty string");
|
|
926
|
+
let parsed = { negated: !1, fastpaths: !0 };
|
|
927
|
+
return options.fastpaths !== !1 && (input[0] === "." || input[0] === "*") && (parsed.output = parse.fastpaths(input, options)), parsed.output || (parsed = parse(input, options)), picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
928
|
+
};
|
|
929
|
+
picomatch.toRegex = (source, options) => {
|
|
930
|
+
try {
|
|
931
|
+
let opts = options || {};
|
|
932
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
933
|
+
} catch (err) {
|
|
934
|
+
if (options && options.debug === !0) throw err;
|
|
935
|
+
return /$^/;
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
picomatch.constants = constants;
|
|
939
|
+
module.exports = picomatch;
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
// ../../node_modules/@rollup/pluginutils/node_modules/picomatch/index.js
|
|
944
|
+
var require_picomatch2 = __commonJS({
|
|
945
|
+
"../../node_modules/@rollup/pluginutils/node_modules/picomatch/index.js"(exports, module) {
|
|
946
|
+
"use strict";
|
|
947
|
+
var pico = require_picomatch(), utils = require_utils();
|
|
948
|
+
function picomatch(glob, options, returnState = !1) {
|
|
949
|
+
return options && (options.windows === null || options.windows === void 0) && (options = { ...options, windows: utils.isWindows() }), pico(glob, options, returnState);
|
|
950
|
+
}
|
|
951
|
+
Object.assign(picomatch, pico);
|
|
952
|
+
module.exports = picomatch;
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
|
|
956
|
+
// ../../node_modules/@rollup/pluginutils/dist/es/index.js
|
|
957
|
+
import { extname, win32, posix, isAbsolute, resolve } from "path";
|
|
958
|
+
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
959
|
+
function isArray(arg) {
|
|
960
|
+
return Array.isArray(arg);
|
|
961
|
+
}
|
|
962
|
+
function ensureArray(thing) {
|
|
963
|
+
return isArray(thing) ? thing : thing == null ? [] : [thing];
|
|
964
|
+
}
|
|
965
|
+
var normalizePathRegExp = new RegExp(`\\${win32.sep}`, "g"), normalizePath = function(filename) {
|
|
966
|
+
return filename.replace(normalizePathRegExp, posix.sep);
|
|
967
|
+
};
|
|
968
|
+
function getMatcherString(id, resolutionBase) {
|
|
969
|
+
if (resolutionBase === !1 || isAbsolute(id) || id.startsWith("**"))
|
|
970
|
+
return normalizePath(id);
|
|
971
|
+
let basePath = normalizePath(resolve(resolutionBase || "")).replace(/[-^$*+?.()|[\]{}]/g, "\\$&");
|
|
972
|
+
return posix.join(basePath, normalizePath(id));
|
|
973
|
+
}
|
|
974
|
+
var createFilter = function(include, exclude, options) {
|
|
975
|
+
let resolutionBase = options && options.resolve, getMatcher = (id) => id instanceof RegExp ? id : {
|
|
976
|
+
test: (what) => {
|
|
977
|
+
let pattern = getMatcherString(id, resolutionBase);
|
|
978
|
+
return (0, import_picomatch.default)(pattern, { dot: !0 })(what);
|
|
979
|
+
}
|
|
980
|
+
}, includeMatchers = ensureArray(include).map(getMatcher), excludeMatchers = ensureArray(exclude).map(getMatcher);
|
|
981
|
+
return !includeMatchers.length && !excludeMatchers.length ? (id) => typeof id == "string" && !id.includes("\0") : function(id) {
|
|
982
|
+
if (typeof id != "string" || id.includes("\0"))
|
|
983
|
+
return !1;
|
|
984
|
+
let pathId = normalizePath(id);
|
|
985
|
+
for (let i = 0; i < excludeMatchers.length; ++i) {
|
|
986
|
+
let matcher = excludeMatchers[i];
|
|
987
|
+
if (matcher instanceof RegExp && (matcher.lastIndex = 0), matcher.test(pathId))
|
|
988
|
+
return !1;
|
|
989
|
+
}
|
|
990
|
+
for (let i = 0; i < includeMatchers.length; ++i) {
|
|
991
|
+
let matcher = includeMatchers[i];
|
|
992
|
+
if (matcher instanceof RegExp && (matcher.lastIndex = 0), matcher.test(pathId))
|
|
993
|
+
return !0;
|
|
994
|
+
}
|
|
995
|
+
return !includeMatchers.length;
|
|
996
|
+
};
|
|
997
|
+
}, reservedWords = "break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public", builtins = "arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl", forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(" "));
|
|
998
|
+
forbiddenIdentifiers.add("");
|
|
999
|
+
var hasStringIsWellFormed = "isWellFormed" in String.prototype;
|
|
1000
|
+
|
|
1001
|
+
// src/mdx-plugin.ts
|
|
1002
|
+
async function mdxPlugin(options) {
|
|
1003
|
+
let filter = createFilter(/\.mdx$/), { presets } = options, mdxPluginOptions = (await presets.apply("options", {}))?.mdxPluginOptions, rehypeSlug = (await import("./rehype-slug-WW2KPWVT.js")).default, rehypeExternalLinks = (await import("./rehype-external-links-5BFMYXOM.js")).default;
|
|
1004
|
+
return {
|
|
1005
|
+
name: "storybook:mdx-plugin",
|
|
1006
|
+
enforce: "pre",
|
|
1007
|
+
async transform(src, id) {
|
|
1008
|
+
if (!filter(id))
|
|
1009
|
+
return;
|
|
1010
|
+
let mdxLoaderOptions = await presets.apply("mdxLoaderOptions", {
|
|
1011
|
+
...mdxPluginOptions,
|
|
1012
|
+
mdxCompileOptions: {
|
|
1013
|
+
providerImportSource: import.meta.resolve("@storybook/addon-docs/mdx-react-shim"),
|
|
1014
|
+
...mdxPluginOptions?.mdxCompileOptions,
|
|
1015
|
+
rehypePlugins: [
|
|
1016
|
+
...mdxPluginOptions?.mdxCompileOptions?.rehypePlugins ?? [],
|
|
1017
|
+
rehypeSlug,
|
|
1018
|
+
rehypeExternalLinks
|
|
1019
|
+
]
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
return {
|
|
1023
|
+
code: String(await compile(src, mdxLoaderOptions)),
|
|
1024
|
+
// TODO: support source maps
|
|
1025
|
+
map: null
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
export {
|
|
1031
|
+
mdxPlugin
|
|
1032
|
+
};
|