@farming-labs/theme 0.0.23 → 0.0.25
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/_virtual/_rolldown/runtime.mjs +26 -1
- package/dist/docs-api.mjs +3 -1
- package/dist/docs-layout.mjs +7 -3
- package/dist/get-app-dir.d.mts +9 -0
- package/dist/get-app-dir.mjs +16 -0
- package/dist/get-app-dir.test.d.mts +1 -0
- package/dist/get-app-dir.test.mjs +41 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +77 -0
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.mjs +1356 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.mjs +1119 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.mjs +1091 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.mjs +4 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.mjs +3 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.mjs +1821 -0
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.mjs +171 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.mjs +124 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.mjs +1334 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.mjs +105 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.mjs +118 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.mjs +455 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.mjs +168 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.mjs +3087 -0
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.mjs +384 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.mjs +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.mjs +16 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.mjs +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.mjs +15 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.mjs +13 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.mjs +34 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.mjs +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.mjs +122 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.mjs +39 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.mjs +99 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.mjs +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.mjs +14 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.mjs +21 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.mjs +5 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.mjs +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.mjs +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.mjs +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.mjs +8 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.mjs +30 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +939 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +81 -0
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs +51 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.mjs +81 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.mjs +9 -0
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.mjs +125 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.mjs +8 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.mjs +50 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/utils.XdZDrNZV.mjs +48 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.mjs +2613 -0
- package/package.json +6 -3
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js
|
|
4
|
+
var require_js_tokens = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
|
|
6
|
+
Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
|
|
7
|
+
Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy;
|
|
8
|
+
StringLiteral = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;
|
|
9
|
+
NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
|
|
10
|
+
Template = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;
|
|
11
|
+
WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/uy;
|
|
12
|
+
LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
|
|
13
|
+
MultiLineComment = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;
|
|
14
|
+
SingleLineComment = /\/\/.*/y;
|
|
15
|
+
HashbangComment = /^#!.*/;
|
|
16
|
+
JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
|
|
17
|
+
JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/uy;
|
|
18
|
+
JSXString = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;
|
|
19
|
+
JSXText = /[^<>{}]+/y;
|
|
20
|
+
TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
|
|
21
|
+
TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
|
|
22
|
+
KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
|
|
23
|
+
KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
|
|
24
|
+
Newline = RegExp(LineTerminatorSequence.source);
|
|
25
|
+
module.exports = function* (input, { jsx = false } = {}) {
|
|
26
|
+
var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
|
|
27
|
+
({length} = input);
|
|
28
|
+
lastIndex = 0;
|
|
29
|
+
lastSignificantToken = "";
|
|
30
|
+
stack = [{ tag: "JS" }];
|
|
31
|
+
braces = [];
|
|
32
|
+
parenNesting = 0;
|
|
33
|
+
postfixIncDec = false;
|
|
34
|
+
if (match = HashbangComment.exec(input)) {
|
|
35
|
+
yield {
|
|
36
|
+
type: "HashbangComment",
|
|
37
|
+
value: match[0]
|
|
38
|
+
};
|
|
39
|
+
lastIndex = match[0].length;
|
|
40
|
+
}
|
|
41
|
+
while (lastIndex < length) {
|
|
42
|
+
mode = stack[stack.length - 1];
|
|
43
|
+
switch (mode.tag) {
|
|
44
|
+
case "JS":
|
|
45
|
+
case "JSNonExpressionParen":
|
|
46
|
+
case "InterpolationInTemplate":
|
|
47
|
+
case "InterpolationInJSX":
|
|
48
|
+
if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
|
49
|
+
RegularExpressionLiteral.lastIndex = lastIndex;
|
|
50
|
+
if (match = RegularExpressionLiteral.exec(input)) {
|
|
51
|
+
lastIndex = RegularExpressionLiteral.lastIndex;
|
|
52
|
+
lastSignificantToken = match[0];
|
|
53
|
+
postfixIncDec = true;
|
|
54
|
+
yield {
|
|
55
|
+
type: "RegularExpressionLiteral",
|
|
56
|
+
value: match[0],
|
|
57
|
+
closed: match[1] !== void 0 && match[1] !== "\\"
|
|
58
|
+
};
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
Punctuator.lastIndex = lastIndex;
|
|
63
|
+
if (match = Punctuator.exec(input)) {
|
|
64
|
+
punctuator = match[0];
|
|
65
|
+
nextLastIndex = Punctuator.lastIndex;
|
|
66
|
+
nextLastSignificantToken = punctuator;
|
|
67
|
+
switch (punctuator) {
|
|
68
|
+
case "(":
|
|
69
|
+
if (lastSignificantToken === "?NonExpressionParenKeyword") stack.push({
|
|
70
|
+
tag: "JSNonExpressionParen",
|
|
71
|
+
nesting: parenNesting
|
|
72
|
+
});
|
|
73
|
+
parenNesting++;
|
|
74
|
+
postfixIncDec = false;
|
|
75
|
+
break;
|
|
76
|
+
case ")":
|
|
77
|
+
parenNesting--;
|
|
78
|
+
postfixIncDec = true;
|
|
79
|
+
if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
|
|
80
|
+
stack.pop();
|
|
81
|
+
nextLastSignificantToken = "?NonExpressionParenEnd";
|
|
82
|
+
postfixIncDec = false;
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
case "{":
|
|
86
|
+
Punctuator.lastIndex = 0;
|
|
87
|
+
isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
|
|
88
|
+
braces.push(isExpression);
|
|
89
|
+
postfixIncDec = false;
|
|
90
|
+
break;
|
|
91
|
+
case "}":
|
|
92
|
+
switch (mode.tag) {
|
|
93
|
+
case "InterpolationInTemplate":
|
|
94
|
+
if (braces.length === mode.nesting) {
|
|
95
|
+
Template.lastIndex = lastIndex;
|
|
96
|
+
match = Template.exec(input);
|
|
97
|
+
lastIndex = Template.lastIndex;
|
|
98
|
+
lastSignificantToken = match[0];
|
|
99
|
+
if (match[1] === "${") {
|
|
100
|
+
lastSignificantToken = "?InterpolationInTemplate";
|
|
101
|
+
postfixIncDec = false;
|
|
102
|
+
yield {
|
|
103
|
+
type: "TemplateMiddle",
|
|
104
|
+
value: match[0]
|
|
105
|
+
};
|
|
106
|
+
} else {
|
|
107
|
+
stack.pop();
|
|
108
|
+
postfixIncDec = true;
|
|
109
|
+
yield {
|
|
110
|
+
type: "TemplateTail",
|
|
111
|
+
value: match[0],
|
|
112
|
+
closed: match[1] === "`"
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
case "InterpolationInJSX": if (braces.length === mode.nesting) {
|
|
119
|
+
stack.pop();
|
|
120
|
+
lastIndex += 1;
|
|
121
|
+
lastSignificantToken = "}";
|
|
122
|
+
yield {
|
|
123
|
+
type: "JSXPunctuator",
|
|
124
|
+
value: "}"
|
|
125
|
+
};
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
postfixIncDec = braces.pop();
|
|
130
|
+
nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
|
|
131
|
+
break;
|
|
132
|
+
case "]":
|
|
133
|
+
postfixIncDec = true;
|
|
134
|
+
break;
|
|
135
|
+
case "++":
|
|
136
|
+
case "--":
|
|
137
|
+
nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
|
|
138
|
+
break;
|
|
139
|
+
case "<":
|
|
140
|
+
if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
|
141
|
+
stack.push({ tag: "JSXTag" });
|
|
142
|
+
lastIndex += 1;
|
|
143
|
+
lastSignificantToken = "<";
|
|
144
|
+
yield {
|
|
145
|
+
type: "JSXPunctuator",
|
|
146
|
+
value: punctuator
|
|
147
|
+
};
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
postfixIncDec = false;
|
|
151
|
+
break;
|
|
152
|
+
default: postfixIncDec = false;
|
|
153
|
+
}
|
|
154
|
+
lastIndex = nextLastIndex;
|
|
155
|
+
lastSignificantToken = nextLastSignificantToken;
|
|
156
|
+
yield {
|
|
157
|
+
type: "Punctuator",
|
|
158
|
+
value: punctuator
|
|
159
|
+
};
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
Identifier.lastIndex = lastIndex;
|
|
163
|
+
if (match = Identifier.exec(input)) {
|
|
164
|
+
lastIndex = Identifier.lastIndex;
|
|
165
|
+
nextLastSignificantToken = match[0];
|
|
166
|
+
switch (match[0]) {
|
|
167
|
+
case "for":
|
|
168
|
+
case "if":
|
|
169
|
+
case "while":
|
|
170
|
+
case "with": if (lastSignificantToken !== "." && lastSignificantToken !== "?.") nextLastSignificantToken = "?NonExpressionParenKeyword";
|
|
171
|
+
}
|
|
172
|
+
lastSignificantToken = nextLastSignificantToken;
|
|
173
|
+
postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
|
|
174
|
+
yield {
|
|
175
|
+
type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
|
|
176
|
+
value: match[0]
|
|
177
|
+
};
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
StringLiteral.lastIndex = lastIndex;
|
|
181
|
+
if (match = StringLiteral.exec(input)) {
|
|
182
|
+
lastIndex = StringLiteral.lastIndex;
|
|
183
|
+
lastSignificantToken = match[0];
|
|
184
|
+
postfixIncDec = true;
|
|
185
|
+
yield {
|
|
186
|
+
type: "StringLiteral",
|
|
187
|
+
value: match[0],
|
|
188
|
+
closed: match[2] !== void 0
|
|
189
|
+
};
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
NumericLiteral.lastIndex = lastIndex;
|
|
193
|
+
if (match = NumericLiteral.exec(input)) {
|
|
194
|
+
lastIndex = NumericLiteral.lastIndex;
|
|
195
|
+
lastSignificantToken = match[0];
|
|
196
|
+
postfixIncDec = true;
|
|
197
|
+
yield {
|
|
198
|
+
type: "NumericLiteral",
|
|
199
|
+
value: match[0]
|
|
200
|
+
};
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
Template.lastIndex = lastIndex;
|
|
204
|
+
if (match = Template.exec(input)) {
|
|
205
|
+
lastIndex = Template.lastIndex;
|
|
206
|
+
lastSignificantToken = match[0];
|
|
207
|
+
if (match[1] === "${") {
|
|
208
|
+
lastSignificantToken = "?InterpolationInTemplate";
|
|
209
|
+
stack.push({
|
|
210
|
+
tag: "InterpolationInTemplate",
|
|
211
|
+
nesting: braces.length
|
|
212
|
+
});
|
|
213
|
+
postfixIncDec = false;
|
|
214
|
+
yield {
|
|
215
|
+
type: "TemplateHead",
|
|
216
|
+
value: match[0]
|
|
217
|
+
};
|
|
218
|
+
} else {
|
|
219
|
+
postfixIncDec = true;
|
|
220
|
+
yield {
|
|
221
|
+
type: "NoSubstitutionTemplate",
|
|
222
|
+
value: match[0],
|
|
223
|
+
closed: match[1] === "`"
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
break;
|
|
229
|
+
case "JSXTag":
|
|
230
|
+
case "JSXTagEnd":
|
|
231
|
+
JSXPunctuator.lastIndex = lastIndex;
|
|
232
|
+
if (match = JSXPunctuator.exec(input)) {
|
|
233
|
+
lastIndex = JSXPunctuator.lastIndex;
|
|
234
|
+
nextLastSignificantToken = match[0];
|
|
235
|
+
switch (match[0]) {
|
|
236
|
+
case "<":
|
|
237
|
+
stack.push({ tag: "JSXTag" });
|
|
238
|
+
break;
|
|
239
|
+
case ">":
|
|
240
|
+
stack.pop();
|
|
241
|
+
if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
|
|
242
|
+
nextLastSignificantToken = "?JSX";
|
|
243
|
+
postfixIncDec = true;
|
|
244
|
+
} else stack.push({ tag: "JSXChildren" });
|
|
245
|
+
break;
|
|
246
|
+
case "{":
|
|
247
|
+
stack.push({
|
|
248
|
+
tag: "InterpolationInJSX",
|
|
249
|
+
nesting: braces.length
|
|
250
|
+
});
|
|
251
|
+
nextLastSignificantToken = "?InterpolationInJSX";
|
|
252
|
+
postfixIncDec = false;
|
|
253
|
+
break;
|
|
254
|
+
case "/": if (lastSignificantToken === "<") {
|
|
255
|
+
stack.pop();
|
|
256
|
+
if (stack[stack.length - 1].tag === "JSXChildren") stack.pop();
|
|
257
|
+
stack.push({ tag: "JSXTagEnd" });
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
lastSignificantToken = nextLastSignificantToken;
|
|
261
|
+
yield {
|
|
262
|
+
type: "JSXPunctuator",
|
|
263
|
+
value: match[0]
|
|
264
|
+
};
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
JSXIdentifier.lastIndex = lastIndex;
|
|
268
|
+
if (match = JSXIdentifier.exec(input)) {
|
|
269
|
+
lastIndex = JSXIdentifier.lastIndex;
|
|
270
|
+
lastSignificantToken = match[0];
|
|
271
|
+
yield {
|
|
272
|
+
type: "JSXIdentifier",
|
|
273
|
+
value: match[0]
|
|
274
|
+
};
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
JSXString.lastIndex = lastIndex;
|
|
278
|
+
if (match = JSXString.exec(input)) {
|
|
279
|
+
lastIndex = JSXString.lastIndex;
|
|
280
|
+
lastSignificantToken = match[0];
|
|
281
|
+
yield {
|
|
282
|
+
type: "JSXString",
|
|
283
|
+
value: match[0],
|
|
284
|
+
closed: match[2] !== void 0
|
|
285
|
+
};
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
break;
|
|
289
|
+
case "JSXChildren":
|
|
290
|
+
JSXText.lastIndex = lastIndex;
|
|
291
|
+
if (match = JSXText.exec(input)) {
|
|
292
|
+
lastIndex = JSXText.lastIndex;
|
|
293
|
+
lastSignificantToken = match[0];
|
|
294
|
+
yield {
|
|
295
|
+
type: "JSXText",
|
|
296
|
+
value: match[0]
|
|
297
|
+
};
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
switch (input[lastIndex]) {
|
|
301
|
+
case "<":
|
|
302
|
+
stack.push({ tag: "JSXTag" });
|
|
303
|
+
lastIndex++;
|
|
304
|
+
lastSignificantToken = "<";
|
|
305
|
+
yield {
|
|
306
|
+
type: "JSXPunctuator",
|
|
307
|
+
value: "<"
|
|
308
|
+
};
|
|
309
|
+
continue;
|
|
310
|
+
case "{":
|
|
311
|
+
stack.push({
|
|
312
|
+
tag: "InterpolationInJSX",
|
|
313
|
+
nesting: braces.length
|
|
314
|
+
});
|
|
315
|
+
lastIndex++;
|
|
316
|
+
lastSignificantToken = "?InterpolationInJSX";
|
|
317
|
+
postfixIncDec = false;
|
|
318
|
+
yield {
|
|
319
|
+
type: "JSXPunctuator",
|
|
320
|
+
value: "{"
|
|
321
|
+
};
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
WhiteSpace.lastIndex = lastIndex;
|
|
326
|
+
if (match = WhiteSpace.exec(input)) {
|
|
327
|
+
lastIndex = WhiteSpace.lastIndex;
|
|
328
|
+
yield {
|
|
329
|
+
type: "WhiteSpace",
|
|
330
|
+
value: match[0]
|
|
331
|
+
};
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
LineTerminatorSequence.lastIndex = lastIndex;
|
|
335
|
+
if (match = LineTerminatorSequence.exec(input)) {
|
|
336
|
+
lastIndex = LineTerminatorSequence.lastIndex;
|
|
337
|
+
postfixIncDec = false;
|
|
338
|
+
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) lastSignificantToken = "?NoLineTerminatorHere";
|
|
339
|
+
yield {
|
|
340
|
+
type: "LineTerminatorSequence",
|
|
341
|
+
value: match[0]
|
|
342
|
+
};
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
MultiLineComment.lastIndex = lastIndex;
|
|
346
|
+
if (match = MultiLineComment.exec(input)) {
|
|
347
|
+
lastIndex = MultiLineComment.lastIndex;
|
|
348
|
+
if (Newline.test(match[0])) {
|
|
349
|
+
postfixIncDec = false;
|
|
350
|
+
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) lastSignificantToken = "?NoLineTerminatorHere";
|
|
351
|
+
}
|
|
352
|
+
yield {
|
|
353
|
+
type: "MultiLineComment",
|
|
354
|
+
value: match[0],
|
|
355
|
+
closed: match[1] !== void 0
|
|
356
|
+
};
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
SingleLineComment.lastIndex = lastIndex;
|
|
360
|
+
if (match = SingleLineComment.exec(input)) {
|
|
361
|
+
lastIndex = SingleLineComment.lastIndex;
|
|
362
|
+
postfixIncDec = false;
|
|
363
|
+
yield {
|
|
364
|
+
type: "SingleLineComment",
|
|
365
|
+
value: match[0]
|
|
366
|
+
};
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
|
|
370
|
+
lastIndex += firstCodePoint.length;
|
|
371
|
+
lastSignificantToken = firstCodePoint;
|
|
372
|
+
postfixIncDec = false;
|
|
373
|
+
yield {
|
|
374
|
+
type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
|
|
375
|
+
value: firstCodePoint
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
}));
|
|
380
|
+
|
|
381
|
+
//#endregion
|
|
382
|
+
export default require_js_tokens();
|
|
383
|
+
|
|
384
|
+
export { require_js_tokens };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { inspectList } from "./helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js
|
|
4
|
+
function inspectArguments(args, options) {
|
|
5
|
+
if (args.length === 0) return "Arguments[]";
|
|
6
|
+
options.truncate -= 13;
|
|
7
|
+
return `Arguments[ ${inspectList(args, options)} ]`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { inspectArguments as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { inspectList, inspectProperty } from "./helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js
|
|
4
|
+
function inspectArray(array, options) {
|
|
5
|
+
const nonIndexProperties = Object.keys(array).slice(array.length);
|
|
6
|
+
if (!array.length && !nonIndexProperties.length) return "[]";
|
|
7
|
+
options.truncate -= 4;
|
|
8
|
+
const listContents = inspectList(array, options);
|
|
9
|
+
options.truncate -= listContents.length;
|
|
10
|
+
let propertyContents = "";
|
|
11
|
+
if (nonIndexProperties.length) propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
|
|
12
|
+
return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { inspectArray as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { truncate, truncator } from "./helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js
|
|
4
|
+
function inspectBigInt(number, options) {
|
|
5
|
+
let nums = truncate(number.toString(), options.truncate - 1);
|
|
6
|
+
if (nums !== truncator) nums += "n";
|
|
7
|
+
return options.stylize(nums, "bigint");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { inspectBigInt as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import inspectObject from "./object.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js
|
|
4
|
+
const toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false;
|
|
5
|
+
function inspectClass(value, options) {
|
|
6
|
+
let name = "";
|
|
7
|
+
if (toStringTag && toStringTag in value) name = value[toStringTag];
|
|
8
|
+
name = name || value.constructor.name;
|
|
9
|
+
if (!name || name === "_class") name = "<Anonymous Class>";
|
|
10
|
+
options.truncate -= name.length;
|
|
11
|
+
return `${name}${inspectObject(value, options)}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { inspectClass as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { truncate } from "./helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js
|
|
4
|
+
function inspectDate(dateObject, options) {
|
|
5
|
+
const stringRepresentation = dateObject.toJSON();
|
|
6
|
+
if (stringRepresentation === null) return "Invalid Date";
|
|
7
|
+
const split = stringRepresentation.split("T");
|
|
8
|
+
const date = split[0];
|
|
9
|
+
return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { inspectDate as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { inspectList, inspectProperty, truncate } from "./helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js
|
|
4
|
+
const errorKeys = [
|
|
5
|
+
"stack",
|
|
6
|
+
"line",
|
|
7
|
+
"column",
|
|
8
|
+
"name",
|
|
9
|
+
"message",
|
|
10
|
+
"fileName",
|
|
11
|
+
"lineNumber",
|
|
12
|
+
"columnNumber",
|
|
13
|
+
"number",
|
|
14
|
+
"description",
|
|
15
|
+
"cause"
|
|
16
|
+
];
|
|
17
|
+
function inspectObject(error, options) {
|
|
18
|
+
const properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1);
|
|
19
|
+
const name = error.name;
|
|
20
|
+
options.truncate -= name.length;
|
|
21
|
+
let message = "";
|
|
22
|
+
if (typeof error.message === "string") message = truncate(error.message, options.truncate);
|
|
23
|
+
else properties.unshift("message");
|
|
24
|
+
message = message ? `: ${message}` : "";
|
|
25
|
+
options.truncate -= message.length + 5;
|
|
26
|
+
options.seen = options.seen || [];
|
|
27
|
+
if (options.seen.includes(error)) return "[Circular]";
|
|
28
|
+
options.seen.push(error);
|
|
29
|
+
const propertyContents = inspectList(properties.map((key) => [key, error[key]]), options, inspectProperty);
|
|
30
|
+
return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { inspectObject as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { truncate } from "./helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js
|
|
4
|
+
function inspectFunction(func, options) {
|
|
5
|
+
const functionType = func[Symbol.toStringTag] || "Function";
|
|
6
|
+
const name = func.name;
|
|
7
|
+
if (!name) return options.stylize(`[${functionType}]`, "special");
|
|
8
|
+
return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { inspectFunction as default };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js
|
|
2
|
+
const ansiColors = {
|
|
3
|
+
bold: ["1", "22"],
|
|
4
|
+
dim: ["2", "22"],
|
|
5
|
+
italic: ["3", "23"],
|
|
6
|
+
underline: ["4", "24"],
|
|
7
|
+
inverse: ["7", "27"],
|
|
8
|
+
hidden: ["8", "28"],
|
|
9
|
+
strike: ["9", "29"],
|
|
10
|
+
black: ["30", "39"],
|
|
11
|
+
red: ["31", "39"],
|
|
12
|
+
green: ["32", "39"],
|
|
13
|
+
yellow: ["33", "39"],
|
|
14
|
+
blue: ["34", "39"],
|
|
15
|
+
magenta: ["35", "39"],
|
|
16
|
+
cyan: ["36", "39"],
|
|
17
|
+
white: ["37", "39"],
|
|
18
|
+
brightblack: ["30;1", "39"],
|
|
19
|
+
brightred: ["31;1", "39"],
|
|
20
|
+
brightgreen: ["32;1", "39"],
|
|
21
|
+
brightyellow: ["33;1", "39"],
|
|
22
|
+
brightblue: ["34;1", "39"],
|
|
23
|
+
brightmagenta: ["35;1", "39"],
|
|
24
|
+
brightcyan: ["36;1", "39"],
|
|
25
|
+
brightwhite: ["37;1", "39"],
|
|
26
|
+
grey: ["90", "39"]
|
|
27
|
+
};
|
|
28
|
+
const styles = {
|
|
29
|
+
special: "cyan",
|
|
30
|
+
number: "yellow",
|
|
31
|
+
bigint: "yellow",
|
|
32
|
+
boolean: "yellow",
|
|
33
|
+
undefined: "grey",
|
|
34
|
+
null: "bold",
|
|
35
|
+
string: "green",
|
|
36
|
+
symbol: "green",
|
|
37
|
+
date: "magenta",
|
|
38
|
+
regexp: "red"
|
|
39
|
+
};
|
|
40
|
+
const truncator = "…";
|
|
41
|
+
function colorise(value, styleType) {
|
|
42
|
+
const color = ansiColors[styles[styleType]] || ansiColors[styleType] || "";
|
|
43
|
+
if (!color) return String(value);
|
|
44
|
+
return `\u001b[${color[0]}m${String(value)}\u001b[${color[1]}m`;
|
|
45
|
+
}
|
|
46
|
+
function normaliseOptions({ showHidden = false, depth = 2, colors = false, customInspect = true, showProxy = false, maxArrayLength = Infinity, breakLength = Infinity, seen = [], truncate = Infinity, stylize = String } = {}, inspect) {
|
|
47
|
+
const options = {
|
|
48
|
+
showHidden: Boolean(showHidden),
|
|
49
|
+
depth: Number(depth),
|
|
50
|
+
colors: Boolean(colors),
|
|
51
|
+
customInspect: Boolean(customInspect),
|
|
52
|
+
showProxy: Boolean(showProxy),
|
|
53
|
+
maxArrayLength: Number(maxArrayLength),
|
|
54
|
+
breakLength: Number(breakLength),
|
|
55
|
+
truncate: Number(truncate),
|
|
56
|
+
seen,
|
|
57
|
+
inspect,
|
|
58
|
+
stylize
|
|
59
|
+
};
|
|
60
|
+
if (options.colors) options.stylize = colorise;
|
|
61
|
+
return options;
|
|
62
|
+
}
|
|
63
|
+
function isHighSurrogate(char) {
|
|
64
|
+
return char >= "\ud800" && char <= "\udbff";
|
|
65
|
+
}
|
|
66
|
+
function truncate(string, length, tail = truncator) {
|
|
67
|
+
string = String(string);
|
|
68
|
+
const tailLength = tail.length;
|
|
69
|
+
const stringLength = string.length;
|
|
70
|
+
if (tailLength > length && stringLength > tailLength) return tail;
|
|
71
|
+
if (stringLength > length && stringLength > tailLength) {
|
|
72
|
+
let end = length - tailLength;
|
|
73
|
+
if (end > 0 && isHighSurrogate(string[end - 1])) end = end - 1;
|
|
74
|
+
return `${string.slice(0, end)}${tail}`;
|
|
75
|
+
}
|
|
76
|
+
return string;
|
|
77
|
+
}
|
|
78
|
+
function inspectList(list, options, inspectItem, separator = ", ") {
|
|
79
|
+
inspectItem = inspectItem || options.inspect;
|
|
80
|
+
const size = list.length;
|
|
81
|
+
if (size === 0) return "";
|
|
82
|
+
const originalLength = options.truncate;
|
|
83
|
+
let output = "";
|
|
84
|
+
let peek = "";
|
|
85
|
+
let truncated = "";
|
|
86
|
+
for (let i = 0; i < size; i += 1) {
|
|
87
|
+
const last = i + 1 === list.length;
|
|
88
|
+
const secondToLast = i + 2 === list.length;
|
|
89
|
+
truncated = `${truncator}(${list.length - i})`;
|
|
90
|
+
const value = list[i];
|
|
91
|
+
options.truncate = originalLength - output.length - (last ? 0 : separator.length);
|
|
92
|
+
const string = peek || inspectItem(value, options) + (last ? "" : separator);
|
|
93
|
+
const nextLength = output.length + string.length;
|
|
94
|
+
const truncatedLength = nextLength + truncated.length;
|
|
95
|
+
if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) break;
|
|
96
|
+
if (!last && !secondToLast && truncatedLength > originalLength) break;
|
|
97
|
+
peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator);
|
|
98
|
+
if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) break;
|
|
99
|
+
output += string;
|
|
100
|
+
if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
|
|
101
|
+
truncated = `${truncator}(${list.length - i - 1})`;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
truncated = "";
|
|
105
|
+
}
|
|
106
|
+
return `${output}${truncated}`;
|
|
107
|
+
}
|
|
108
|
+
function quoteComplexKey(key) {
|
|
109
|
+
if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) return key;
|
|
110
|
+
return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'");
|
|
111
|
+
}
|
|
112
|
+
function inspectProperty([key, value], options) {
|
|
113
|
+
options.truncate -= 2;
|
|
114
|
+
if (typeof key === "string") key = quoteComplexKey(key);
|
|
115
|
+
else if (typeof key !== "number") key = `[${options.inspect(key, options)}]`;
|
|
116
|
+
options.truncate -= key.length;
|
|
117
|
+
value = options.inspect(value, options);
|
|
118
|
+
return `${key}: ${value}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
export { inspectList, inspectProperty, normaliseOptions, truncate, truncator };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { inspectList, truncator } from "./helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js
|
|
4
|
+
function inspectAttribute([key, value], options) {
|
|
5
|
+
options.truncate -= 3;
|
|
6
|
+
if (!value) return `${options.stylize(String(key), "yellow")}`;
|
|
7
|
+
return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
|
|
8
|
+
}
|
|
9
|
+
function inspectNodeCollection(collection, options) {
|
|
10
|
+
return inspectList(collection, options, inspectNode, "\n");
|
|
11
|
+
}
|
|
12
|
+
function inspectNode(node, options) {
|
|
13
|
+
switch (node.nodeType) {
|
|
14
|
+
case 1: return inspectHTML(node, options);
|
|
15
|
+
case 3: return options.inspect(node.data, options);
|
|
16
|
+
default: return options.inspect(node, options);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function inspectHTML(element, options) {
|
|
20
|
+
const properties = element.getAttributeNames();
|
|
21
|
+
const name = element.tagName.toLowerCase();
|
|
22
|
+
const head = options.stylize(`<${name}`, "special");
|
|
23
|
+
const headClose = options.stylize(`>`, "special");
|
|
24
|
+
const tail = options.stylize(`</${name}>`, "special");
|
|
25
|
+
options.truncate -= name.length * 2 + 5;
|
|
26
|
+
let propertyContents = "";
|
|
27
|
+
if (properties.length > 0) {
|
|
28
|
+
propertyContents += " ";
|
|
29
|
+
propertyContents += inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, " ");
|
|
30
|
+
}
|
|
31
|
+
options.truncate -= propertyContents.length;
|
|
32
|
+
const truncate = options.truncate;
|
|
33
|
+
let children = inspectNodeCollection(element.children, options);
|
|
34
|
+
if (children && children.length > truncate) children = `${truncator}(${element.children.length})`;
|
|
35
|
+
return `${head}${propertyContents}${headClose}${children}${tail}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { inspectHTML as default, inspectNodeCollection };
|