@tamagui/language-service 0.0.0-bootstrap.0 → 3.0.0-beta.643.1
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 +140 -1
- package/dist/cjs/check.cjs +173 -0
- package/dist/cjs/check.native.cjs +369 -0
- package/dist/cjs/check.native.js +371 -0
- package/dist/cjs/check.native.js.map +1 -0
- package/dist/cjs/core.cjs +221 -0
- package/dist/cjs/core.native.cjs +305 -0
- package/dist/cjs/core.native.js +307 -0
- package/dist/cjs/core.native.js.map +1 -0
- package/dist/cjs/document.cjs +82 -0
- package/dist/cjs/document.native.cjs +158 -0
- package/dist/cjs/document.native.js +160 -0
- package/dist/cjs/document.native.js.map +1 -0
- package/dist/cjs/extract-estree.cjs +193 -0
- package/dist/cjs/extract-estree.native.cjs +296 -0
- package/dist/cjs/extract-estree.native.js +298 -0
- package/dist/cjs/extract-estree.native.js.map +1 -0
- package/dist/cjs/extract-sucrase.cjs +222 -0
- package/dist/cjs/extract-sucrase.native.cjs +256 -0
- package/dist/cjs/extract-sucrase.native.js +258 -0
- package/dist/cjs/extract-sucrase.native.js.map +1 -0
- package/dist/cjs/host.cjs +38 -0
- package/dist/cjs/host.native.cjs +61 -0
- package/dist/cjs/host.native.js +63 -0
- package/dist/cjs/host.native.js.map +1 -0
- package/dist/cjs/index.cjs +301 -0
- package/dist/cjs/index.native.cjs +414 -0
- package/dist/cjs/index.native.js +416 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/esm/check.mjs +148 -0
- package/dist/esm/check.mjs.map +1 -0
- package/dist/esm/check.native.js +342 -0
- package/dist/esm/check.native.js.map +1 -0
- package/dist/esm/core.mjs +198 -0
- package/dist/esm/core.mjs.map +1 -0
- package/dist/esm/core.native.js +280 -0
- package/dist/esm/core.native.js.map +1 -0
- package/dist/esm/document.mjs +61 -0
- package/dist/esm/document.mjs.map +1 -0
- package/dist/esm/document.native.js +135 -0
- package/dist/esm/document.native.js.map +1 -0
- package/dist/esm/extract-estree.mjs +172 -0
- package/dist/esm/extract-estree.mjs.map +1 -0
- package/dist/esm/extract-estree.native.js +273 -0
- package/dist/esm/extract-estree.native.js.map +1 -0
- package/dist/esm/extract-sucrase.mjs +201 -0
- package/dist/esm/extract-sucrase.mjs.map +1 -0
- package/dist/esm/extract-sucrase.native.js +233 -0
- package/dist/esm/extract-sucrase.native.js.map +1 -0
- package/dist/esm/host.mjs +17 -0
- package/dist/esm/host.mjs.map +1 -0
- package/dist/esm/host.native.js +38 -0
- package/dist/esm/host.native.js.map +1 -0
- package/dist/esm/index.mjs +281 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +392 -0
- package/dist/esm/index.native.js.map +1 -0
- package/index.cjs +1 -0
- package/package.json +79 -7
- package/src/check.ts +204 -0
- package/src/core.ts +355 -0
- package/src/document.ts +140 -0
- package/src/extract-estree.ts +251 -0
- package/src/extract-sucrase.ts +308 -0
- package/src/host.ts +32 -0
- package/src/index.ts +452 -0
- package/types/check.d.ts +31 -0
- package/types/check.d.ts.map +11 -0
- package/types/core.d.ts +68 -0
- package/types/core.d.ts.map +11 -0
- package/types/document.d.ts +42 -0
- package/types/document.d.ts.map +11 -0
- package/types/extract-estree.d.ts +19 -0
- package/types/extract-estree.d.ts.map +11 -0
- package/types/extract-sucrase.d.ts +26 -0
- package/types/extract-sucrase.d.ts.map +11 -0
- package/types/host.d.ts +10 -0
- package/types/host.d.ts.map +11 -0
- package/types/index.d.ts +9 -0
- package/types/index.d.ts.map +11 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var core_exports = {};
|
|
25
|
+
__export(core_exports, {
|
|
26
|
+
completionSortText: () => completionSortText,
|
|
27
|
+
createStyleTooling: () => createStyleTooling
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(core_exports);
|
|
30
|
+
var import_normalize_css_color = require("@tamagui/normalize-css-color");
|
|
31
|
+
var import_tooling = require("@tamagui/style-grammar/tooling");
|
|
32
|
+
function _type_of(obj) {
|
|
33
|
+
"@swc/helpers - typeof";
|
|
34
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
35
|
+
}
|
|
36
|
+
var modifierKindLabel = {
|
|
37
|
+
state: "state modifier",
|
|
38
|
+
media: "media modifier",
|
|
39
|
+
theme: "theme modifier",
|
|
40
|
+
platform: "platform modifier",
|
|
41
|
+
group: "group modifier",
|
|
42
|
+
container: "container modifier"
|
|
43
|
+
};
|
|
44
|
+
var modifierKindSort = {
|
|
45
|
+
state: "00",
|
|
46
|
+
group: "01",
|
|
47
|
+
media: "02",
|
|
48
|
+
container: "03",
|
|
49
|
+
theme: "04",
|
|
50
|
+
platform: "05"
|
|
51
|
+
};
|
|
52
|
+
var stateModifierSort = new Map(import_tooling.stateModifierNames.map(function(name, index) {
|
|
53
|
+
return [name, index];
|
|
54
|
+
}));
|
|
55
|
+
function completionSortText(completion, modifierKind) {
|
|
56
|
+
if (modifierKind) {
|
|
57
|
+
var _stateModifierSort_get;
|
|
58
|
+
var stateOrder = modifierKind === "state" ? `${String((_stateModifierSort_get = stateModifierSort.get(completion.value)) !== null && _stateModifierSort_get !== void 0 ? _stateModifierSort_get : 999).padStart(3, "0")}:` : "";
|
|
59
|
+
return `${modifierKindSort[modifierKind]}:${stateOrder}${completion.value}`;
|
|
60
|
+
}
|
|
61
|
+
return `${completion.kind === "configured" ? "10" : "11"}:${completion.value}`;
|
|
62
|
+
}
|
|
63
|
+
function tokenValue(entry) {
|
|
64
|
+
if (entry && (typeof entry === "undefined" ? "undefined" : _type_of(entry)) === "object" && "val" in entry) {
|
|
65
|
+
return entry.val;
|
|
66
|
+
}
|
|
67
|
+
return entry;
|
|
68
|
+
}
|
|
69
|
+
function parseColor(value, opacity) {
|
|
70
|
+
if (typeof value !== "string") return null;
|
|
71
|
+
var normalized = (0, import_normalize_css_color.normalizeCSSColor)(value);
|
|
72
|
+
if (normalized === null) return null;
|
|
73
|
+
var color = (0, import_normalize_css_color.rgba)(normalized);
|
|
74
|
+
if (opacity !== void 0) color.a = color.a * (opacity / 100);
|
|
75
|
+
return color;
|
|
76
|
+
}
|
|
77
|
+
function createStyleTooling(file) {
|
|
78
|
+
var serialized = file.tamaguiConfig;
|
|
79
|
+
if (!serialized) return null;
|
|
80
|
+
var config = (0, import_tooling.createGrammarConfigViewFromSerializedConfig)(serialized, file.tamaguiConfigMetadata);
|
|
81
|
+
var registry = (0, import_tooling.createModifierRegistry)(config).registry;
|
|
82
|
+
var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);
|
|
83
|
+
var engine = {
|
|
84
|
+
config,
|
|
85
|
+
registry,
|
|
86
|
+
candidates
|
|
87
|
+
};
|
|
88
|
+
var styleProps = (0, import_tooling.createStylePropSet)(config);
|
|
89
|
+
var themes = serialized.themes || {};
|
|
90
|
+
var rootThemes = Object.keys(themes).filter(function(name) {
|
|
91
|
+
return !name.includes("_");
|
|
92
|
+
});
|
|
93
|
+
var previewThemes = [...["light", "dark"].filter(function(name) {
|
|
94
|
+
return rootThemes.includes(name);
|
|
95
|
+
}), ...rootThemes.filter(function(name) {
|
|
96
|
+
return name !== "light" && name !== "dark";
|
|
97
|
+
})];
|
|
98
|
+
var tokens = serialized.tokens || {};
|
|
99
|
+
var media = serialized.media || {};
|
|
100
|
+
var targetProperty = function(name) {
|
|
101
|
+
var _config_shorthands;
|
|
102
|
+
return ((_config_shorthands = config.shorthands) === null || _config_shorthands === void 0 ? void 0 : _config_shorthands[name]) || name;
|
|
103
|
+
};
|
|
104
|
+
var themeValue = function(name) {
|
|
105
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
106
|
+
try {
|
|
107
|
+
for (var _iterator = previewThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
108
|
+
var theme = _step.value;
|
|
109
|
+
var _themes_theme;
|
|
110
|
+
var value = (_themes_theme = themes[theme]) === null || _themes_theme === void 0 ? void 0 : _themes_theme[name];
|
|
111
|
+
if (value !== void 0) return {
|
|
112
|
+
theme,
|
|
113
|
+
value
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
} catch (err) {
|
|
117
|
+
_didIteratorError = true;
|
|
118
|
+
_iteratorError = err;
|
|
119
|
+
} finally {
|
|
120
|
+
try {
|
|
121
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
122
|
+
_iterator.return();
|
|
123
|
+
}
|
|
124
|
+
} finally {
|
|
125
|
+
if (_didIteratorError) {
|
|
126
|
+
throw _iteratorError;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
};
|
|
132
|
+
var annotationColor = function(annotation) {
|
|
133
|
+
if (annotation.kind === "token" || annotation.kind === "identifier") {
|
|
134
|
+
var name = annotation.opacity !== void 0 ? annotation.text.slice(0, annotation.text.lastIndexOf("/")) : annotation.text;
|
|
135
|
+
if (annotation.tokenCategory === "color") {
|
|
136
|
+
var _tokens_color;
|
|
137
|
+
var themed = themeValue(name);
|
|
138
|
+
if (themed) {
|
|
139
|
+
var color = parseColor(themed.value, annotation.opacity);
|
|
140
|
+
return color ? {
|
|
141
|
+
color,
|
|
142
|
+
theme: themed.theme
|
|
143
|
+
} : null;
|
|
144
|
+
}
|
|
145
|
+
var color1 = parseColor(tokenValue((_tokens_color = tokens.color) === null || _tokens_color === void 0 ? void 0 : _tokens_color[name]), annotation.opacity);
|
|
146
|
+
return color1 ? { color: color1 } : null;
|
|
147
|
+
}
|
|
148
|
+
if (annotation.kind === "identifier") {
|
|
149
|
+
var color2 = parseColor(name);
|
|
150
|
+
return color2 ? { color: color2 } : null;
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
if (annotation.kind === "keyword" && annotation.text === "transparent") {
|
|
155
|
+
return { color: {
|
|
156
|
+
r: 0,
|
|
157
|
+
g: 0,
|
|
158
|
+
b: 0,
|
|
159
|
+
a: 0
|
|
160
|
+
} };
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
};
|
|
164
|
+
var annotations = function(property, value) {
|
|
165
|
+
return (0, import_tooling.annotateStyleValue)(property, value, engine);
|
|
166
|
+
};
|
|
167
|
+
var formatRgba = function(color) {
|
|
168
|
+
return color.a === 1 ? `rgb(${color.r}, ${color.g}, ${color.b})` : `rgba(${color.r}, ${color.g}, ${color.b}, ${Number(color.a.toFixed(3))})`;
|
|
169
|
+
};
|
|
170
|
+
return {
|
|
171
|
+
styleProps,
|
|
172
|
+
engine,
|
|
173
|
+
previewThemes,
|
|
174
|
+
isStyleProp: function(name) {
|
|
175
|
+
return styleProps.has(name);
|
|
176
|
+
},
|
|
177
|
+
targetProperty,
|
|
178
|
+
modifierKind: function(name) {
|
|
179
|
+
return registry.get(name);
|
|
180
|
+
},
|
|
181
|
+
completions(property, value, cursor) {
|
|
182
|
+
var target = targetProperty(property);
|
|
183
|
+
if ((0, import_tooling.programEligibility)(target) === "legacy-part") return null;
|
|
184
|
+
if (!styleProps.has(property)) return null;
|
|
185
|
+
return (0, import_tooling.completeStyleValueAtCursor)(property, value, cursor, engine);
|
|
186
|
+
},
|
|
187
|
+
diagnostics(property, value) {
|
|
188
|
+
if (!styleProps.has(property)) return [];
|
|
189
|
+
return (0, import_tooling.diagnoseStyleValueProgram)(property, value, engine);
|
|
190
|
+
},
|
|
191
|
+
annotations,
|
|
192
|
+
colors(property, value) {
|
|
193
|
+
if (!styleProps.has(property)) return [];
|
|
194
|
+
var results = [];
|
|
195
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
196
|
+
try {
|
|
197
|
+
for (var _iterator = annotations(property, value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
198
|
+
var annotation = _step.value;
|
|
199
|
+
var resolved = annotationColor(annotation);
|
|
200
|
+
if (!resolved) continue;
|
|
201
|
+
results.push({
|
|
202
|
+
start: annotation.start,
|
|
203
|
+
end: annotation.end,
|
|
204
|
+
text: annotation.text,
|
|
205
|
+
color: resolved.color,
|
|
206
|
+
...resolved.theme !== void 0 && { theme: resolved.theme }
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
} catch (err) {
|
|
210
|
+
_didIteratorError = true;
|
|
211
|
+
_iteratorError = err;
|
|
212
|
+
} finally {
|
|
213
|
+
try {
|
|
214
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
215
|
+
_iterator.return();
|
|
216
|
+
}
|
|
217
|
+
} finally {
|
|
218
|
+
if (_didIteratorError) {
|
|
219
|
+
throw _iteratorError;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return results;
|
|
224
|
+
},
|
|
225
|
+
hover(property, value, offset) {
|
|
226
|
+
if (!styleProps.has(property)) return null;
|
|
227
|
+
var annotation = annotations(property, value).find(function(entry) {
|
|
228
|
+
return offset >= entry.start && offset <= entry.end;
|
|
229
|
+
});
|
|
230
|
+
if (!annotation) return null;
|
|
231
|
+
var lines = [];
|
|
232
|
+
var color;
|
|
233
|
+
if (annotation.kind === "modifier" && annotation.modifierKind) {
|
|
234
|
+
lines.push(`**${annotation.text}** \xB7 Tamagui ${modifierKindLabel[annotation.modifierKind]}`);
|
|
235
|
+
if (annotation.modifierKind === "media") {
|
|
236
|
+
var query = media[annotation.text];
|
|
237
|
+
if (query !== void 0) {
|
|
238
|
+
lines.push("```json\n" + JSON.stringify(query) + "\n```");
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
} else if (annotation.kind === "token") {
|
|
242
|
+
var name = annotation.opacity !== void 0 ? annotation.text.slice(0, annotation.text.lastIndexOf("/")) : annotation.text;
|
|
243
|
+
if (annotation.tokenCategory === "color") {
|
|
244
|
+
lines.push(`**${name}** \xB7 Tamagui color`);
|
|
245
|
+
var shown = 0;
|
|
246
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
247
|
+
try {
|
|
248
|
+
for (var _iterator = previewThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
249
|
+
var theme = _step.value;
|
|
250
|
+
var _themes_theme;
|
|
251
|
+
var _$value = (_themes_theme = themes[theme]) === null || _themes_theme === void 0 ? void 0 : _themes_theme[name];
|
|
252
|
+
if (_$value === void 0 || shown >= 4) continue;
|
|
253
|
+
shown++;
|
|
254
|
+
lines.push(`- ${theme}: \`${String(_$value)}\``);
|
|
255
|
+
}
|
|
256
|
+
} catch (err) {
|
|
257
|
+
_didIteratorError = true;
|
|
258
|
+
_iteratorError = err;
|
|
259
|
+
} finally {
|
|
260
|
+
try {
|
|
261
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
262
|
+
_iterator.return();
|
|
263
|
+
}
|
|
264
|
+
} finally {
|
|
265
|
+
if (_didIteratorError) {
|
|
266
|
+
throw _iteratorError;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (shown === 0) {
|
|
271
|
+
var _tokens_color;
|
|
272
|
+
var _$value1 = tokenValue((_tokens_color = tokens.color) === null || _tokens_color === void 0 ? void 0 : _tokens_color[name]);
|
|
273
|
+
if (_$value1 !== void 0) lines.push(`- \`${String(_$value1)}\``);
|
|
274
|
+
}
|
|
275
|
+
if (annotation.opacity !== void 0) {
|
|
276
|
+
lines.push(`- opacity: ${annotation.opacity}%`);
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
var _tokens_;
|
|
280
|
+
var _$value2 = tokenValue((_tokens_ = tokens[annotation.tokenCategory || ""]) === null || _tokens_ === void 0 ? void 0 : _tokens_[name]);
|
|
281
|
+
lines.push(`**${name}** \xB7 Tamagui ${annotation.tokenCategory} token` + (_$value2 !== void 0 ? ` = \`${String(_$value2)}\`` : ""));
|
|
282
|
+
}
|
|
283
|
+
var resolved = annotationColor(annotation);
|
|
284
|
+
if (resolved) {
|
|
285
|
+
color = resolved.color;
|
|
286
|
+
lines.push(`- resolves: \`${formatRgba(resolved.color)}\``);
|
|
287
|
+
}
|
|
288
|
+
} else if (annotation.kind === "keyword") {
|
|
289
|
+
lines.push(`**${annotation.text}** \xB7 CSS keyword` + (annotation.property ? ` for \`${annotation.property}\`` : ""));
|
|
290
|
+
} else {
|
|
291
|
+
var resolved1 = annotationColor(annotation);
|
|
292
|
+
if (!resolved1) return null;
|
|
293
|
+
color = resolved1.color;
|
|
294
|
+
lines.push(`**${annotation.text}** \xB7 CSS color = \`${formatRgba(resolved1.color)}\``);
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
start: annotation.start,
|
|
298
|
+
end: annotation.end,
|
|
299
|
+
text: annotation.text,
|
|
300
|
+
markdown: lines.join("\n\n"),
|
|
301
|
+
...color !== void 0 && { color }
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var core_exports = {};
|
|
25
|
+
__export(core_exports, {
|
|
26
|
+
completionSortText: () => completionSortText,
|
|
27
|
+
createStyleTooling: () => createStyleTooling
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(core_exports);
|
|
30
|
+
var import_normalize_css_color = require("@tamagui/normalize-css-color");
|
|
31
|
+
var import_tooling = require("@tamagui/style-grammar/tooling");
|
|
32
|
+
function _type_of(obj) {
|
|
33
|
+
"@swc/helpers - typeof";
|
|
34
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
35
|
+
}
|
|
36
|
+
var modifierKindLabel = {
|
|
37
|
+
state: "state modifier",
|
|
38
|
+
media: "media modifier",
|
|
39
|
+
theme: "theme modifier",
|
|
40
|
+
platform: "platform modifier",
|
|
41
|
+
group: "group modifier",
|
|
42
|
+
container: "container modifier"
|
|
43
|
+
};
|
|
44
|
+
var modifierKindSort = {
|
|
45
|
+
state: "00",
|
|
46
|
+
group: "01",
|
|
47
|
+
media: "02",
|
|
48
|
+
container: "03",
|
|
49
|
+
theme: "04",
|
|
50
|
+
platform: "05"
|
|
51
|
+
};
|
|
52
|
+
var stateModifierSort = new Map(import_tooling.stateModifierNames.map(function(name, index) {
|
|
53
|
+
return [name, index];
|
|
54
|
+
}));
|
|
55
|
+
function completionSortText(completion, modifierKind) {
|
|
56
|
+
if (modifierKind) {
|
|
57
|
+
var _stateModifierSort_get;
|
|
58
|
+
var stateOrder = modifierKind === "state" ? `${String((_stateModifierSort_get = stateModifierSort.get(completion.value)) !== null && _stateModifierSort_get !== void 0 ? _stateModifierSort_get : 999).padStart(3, "0")}:` : "";
|
|
59
|
+
return `${modifierKindSort[modifierKind]}:${stateOrder}${completion.value}`;
|
|
60
|
+
}
|
|
61
|
+
return `${completion.kind === "configured" ? "10" : "11"}:${completion.value}`;
|
|
62
|
+
}
|
|
63
|
+
function tokenValue(entry) {
|
|
64
|
+
if (entry && (typeof entry === "undefined" ? "undefined" : _type_of(entry)) === "object" && "val" in entry) {
|
|
65
|
+
return entry.val;
|
|
66
|
+
}
|
|
67
|
+
return entry;
|
|
68
|
+
}
|
|
69
|
+
function parseColor(value, opacity) {
|
|
70
|
+
if (typeof value !== "string") return null;
|
|
71
|
+
var normalized = (0, import_normalize_css_color.normalizeCSSColor)(value);
|
|
72
|
+
if (normalized === null) return null;
|
|
73
|
+
var color = (0, import_normalize_css_color.rgba)(normalized);
|
|
74
|
+
if (opacity !== void 0) color.a = color.a * (opacity / 100);
|
|
75
|
+
return color;
|
|
76
|
+
}
|
|
77
|
+
function createStyleTooling(file) {
|
|
78
|
+
var serialized = file.tamaguiConfig;
|
|
79
|
+
if (!serialized) return null;
|
|
80
|
+
var config = (0, import_tooling.createGrammarConfigViewFromSerializedConfig)(serialized, file.tamaguiConfigMetadata);
|
|
81
|
+
var registry = (0, import_tooling.createModifierRegistry)(config).registry;
|
|
82
|
+
var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);
|
|
83
|
+
var engine = {
|
|
84
|
+
config,
|
|
85
|
+
registry,
|
|
86
|
+
candidates
|
|
87
|
+
};
|
|
88
|
+
var styleProps = (0, import_tooling.createStylePropSet)(config);
|
|
89
|
+
var themes = serialized.themes || {};
|
|
90
|
+
var rootThemes = Object.keys(themes).filter(function(name) {
|
|
91
|
+
return !name.includes("_");
|
|
92
|
+
});
|
|
93
|
+
var previewThemes = [...["light", "dark"].filter(function(name) {
|
|
94
|
+
return rootThemes.includes(name);
|
|
95
|
+
}), ...rootThemes.filter(function(name) {
|
|
96
|
+
return name !== "light" && name !== "dark";
|
|
97
|
+
})];
|
|
98
|
+
var tokens = serialized.tokens || {};
|
|
99
|
+
var media = serialized.media || {};
|
|
100
|
+
var targetProperty = function(name) {
|
|
101
|
+
var _config_shorthands;
|
|
102
|
+
return ((_config_shorthands = config.shorthands) === null || _config_shorthands === void 0 ? void 0 : _config_shorthands[name]) || name;
|
|
103
|
+
};
|
|
104
|
+
var themeValue = function(name) {
|
|
105
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
106
|
+
try {
|
|
107
|
+
for (var _iterator = previewThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
108
|
+
var theme = _step.value;
|
|
109
|
+
var _themes_theme;
|
|
110
|
+
var value = (_themes_theme = themes[theme]) === null || _themes_theme === void 0 ? void 0 : _themes_theme[name];
|
|
111
|
+
if (value !== void 0) return {
|
|
112
|
+
theme,
|
|
113
|
+
value
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
} catch (err) {
|
|
117
|
+
_didIteratorError = true;
|
|
118
|
+
_iteratorError = err;
|
|
119
|
+
} finally {
|
|
120
|
+
try {
|
|
121
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
122
|
+
_iterator.return();
|
|
123
|
+
}
|
|
124
|
+
} finally {
|
|
125
|
+
if (_didIteratorError) {
|
|
126
|
+
throw _iteratorError;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
};
|
|
132
|
+
var annotationColor = function(annotation) {
|
|
133
|
+
if (annotation.kind === "token" || annotation.kind === "identifier") {
|
|
134
|
+
var name = annotation.opacity !== void 0 ? annotation.text.slice(0, annotation.text.lastIndexOf("/")) : annotation.text;
|
|
135
|
+
if (annotation.tokenCategory === "color") {
|
|
136
|
+
var _tokens_color;
|
|
137
|
+
var themed = themeValue(name);
|
|
138
|
+
if (themed) {
|
|
139
|
+
var color = parseColor(themed.value, annotation.opacity);
|
|
140
|
+
return color ? {
|
|
141
|
+
color,
|
|
142
|
+
theme: themed.theme
|
|
143
|
+
} : null;
|
|
144
|
+
}
|
|
145
|
+
var color1 = parseColor(tokenValue((_tokens_color = tokens.color) === null || _tokens_color === void 0 ? void 0 : _tokens_color[name]), annotation.opacity);
|
|
146
|
+
return color1 ? { color: color1 } : null;
|
|
147
|
+
}
|
|
148
|
+
if (annotation.kind === "identifier") {
|
|
149
|
+
var color2 = parseColor(name);
|
|
150
|
+
return color2 ? { color: color2 } : null;
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
if (annotation.kind === "keyword" && annotation.text === "transparent") {
|
|
155
|
+
return { color: {
|
|
156
|
+
r: 0,
|
|
157
|
+
g: 0,
|
|
158
|
+
b: 0,
|
|
159
|
+
a: 0
|
|
160
|
+
} };
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
};
|
|
164
|
+
var annotations = function(property, value) {
|
|
165
|
+
return (0, import_tooling.annotateStyleValue)(property, value, engine);
|
|
166
|
+
};
|
|
167
|
+
var formatRgba = function(color) {
|
|
168
|
+
return color.a === 1 ? `rgb(${color.r}, ${color.g}, ${color.b})` : `rgba(${color.r}, ${color.g}, ${color.b}, ${Number(color.a.toFixed(3))})`;
|
|
169
|
+
};
|
|
170
|
+
return {
|
|
171
|
+
styleProps,
|
|
172
|
+
engine,
|
|
173
|
+
previewThemes,
|
|
174
|
+
isStyleProp: function(name) {
|
|
175
|
+
return styleProps.has(name);
|
|
176
|
+
},
|
|
177
|
+
targetProperty,
|
|
178
|
+
modifierKind: function(name) {
|
|
179
|
+
return registry.get(name);
|
|
180
|
+
},
|
|
181
|
+
completions(property, value, cursor) {
|
|
182
|
+
var target = targetProperty(property);
|
|
183
|
+
if ((0, import_tooling.programEligibility)(target) === "legacy-part") return null;
|
|
184
|
+
if (!styleProps.has(property)) return null;
|
|
185
|
+
return (0, import_tooling.completeStyleValueAtCursor)(property, value, cursor, engine);
|
|
186
|
+
},
|
|
187
|
+
diagnostics(property, value) {
|
|
188
|
+
if (!styleProps.has(property)) return [];
|
|
189
|
+
return (0, import_tooling.diagnoseStyleValueProgram)(property, value, engine);
|
|
190
|
+
},
|
|
191
|
+
annotations,
|
|
192
|
+
colors(property, value) {
|
|
193
|
+
if (!styleProps.has(property)) return [];
|
|
194
|
+
var results = [];
|
|
195
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
196
|
+
try {
|
|
197
|
+
for (var _iterator = annotations(property, value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
198
|
+
var annotation = _step.value;
|
|
199
|
+
var resolved = annotationColor(annotation);
|
|
200
|
+
if (!resolved) continue;
|
|
201
|
+
results.push({
|
|
202
|
+
start: annotation.start,
|
|
203
|
+
end: annotation.end,
|
|
204
|
+
text: annotation.text,
|
|
205
|
+
color: resolved.color,
|
|
206
|
+
...resolved.theme !== void 0 && { theme: resolved.theme }
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
} catch (err) {
|
|
210
|
+
_didIteratorError = true;
|
|
211
|
+
_iteratorError = err;
|
|
212
|
+
} finally {
|
|
213
|
+
try {
|
|
214
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
215
|
+
_iterator.return();
|
|
216
|
+
}
|
|
217
|
+
} finally {
|
|
218
|
+
if (_didIteratorError) {
|
|
219
|
+
throw _iteratorError;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return results;
|
|
224
|
+
},
|
|
225
|
+
hover(property, value, offset) {
|
|
226
|
+
if (!styleProps.has(property)) return null;
|
|
227
|
+
var annotation = annotations(property, value).find(function(entry) {
|
|
228
|
+
return offset >= entry.start && offset <= entry.end;
|
|
229
|
+
});
|
|
230
|
+
if (!annotation) return null;
|
|
231
|
+
var lines = [];
|
|
232
|
+
var color;
|
|
233
|
+
if (annotation.kind === "modifier" && annotation.modifierKind) {
|
|
234
|
+
lines.push(`**${annotation.text}** \xB7 Tamagui ${modifierKindLabel[annotation.modifierKind]}`);
|
|
235
|
+
if (annotation.modifierKind === "media") {
|
|
236
|
+
var query = media[annotation.text];
|
|
237
|
+
if (query !== void 0) {
|
|
238
|
+
lines.push("```json\n" + JSON.stringify(query) + "\n```");
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
} else if (annotation.kind === "token") {
|
|
242
|
+
var name = annotation.opacity !== void 0 ? annotation.text.slice(0, annotation.text.lastIndexOf("/")) : annotation.text;
|
|
243
|
+
if (annotation.tokenCategory === "color") {
|
|
244
|
+
lines.push(`**${name}** \xB7 Tamagui color`);
|
|
245
|
+
var shown = 0;
|
|
246
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
247
|
+
try {
|
|
248
|
+
for (var _iterator = previewThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
249
|
+
var theme = _step.value;
|
|
250
|
+
var _themes_theme;
|
|
251
|
+
var _$value = (_themes_theme = themes[theme]) === null || _themes_theme === void 0 ? void 0 : _themes_theme[name];
|
|
252
|
+
if (_$value === void 0 || shown >= 4) continue;
|
|
253
|
+
shown++;
|
|
254
|
+
lines.push(`- ${theme}: \`${String(_$value)}\``);
|
|
255
|
+
}
|
|
256
|
+
} catch (err) {
|
|
257
|
+
_didIteratorError = true;
|
|
258
|
+
_iteratorError = err;
|
|
259
|
+
} finally {
|
|
260
|
+
try {
|
|
261
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
262
|
+
_iterator.return();
|
|
263
|
+
}
|
|
264
|
+
} finally {
|
|
265
|
+
if (_didIteratorError) {
|
|
266
|
+
throw _iteratorError;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (shown === 0) {
|
|
271
|
+
var _tokens_color;
|
|
272
|
+
var _$value1 = tokenValue((_tokens_color = tokens.color) === null || _tokens_color === void 0 ? void 0 : _tokens_color[name]);
|
|
273
|
+
if (_$value1 !== void 0) lines.push(`- \`${String(_$value1)}\``);
|
|
274
|
+
}
|
|
275
|
+
if (annotation.opacity !== void 0) {
|
|
276
|
+
lines.push(`- opacity: ${annotation.opacity}%`);
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
var _tokens_;
|
|
280
|
+
var _$value2 = tokenValue((_tokens_ = tokens[annotation.tokenCategory || ""]) === null || _tokens_ === void 0 ? void 0 : _tokens_[name]);
|
|
281
|
+
lines.push(`**${name}** \xB7 Tamagui ${annotation.tokenCategory} token` + (_$value2 !== void 0 ? ` = \`${String(_$value2)}\`` : ""));
|
|
282
|
+
}
|
|
283
|
+
var resolved = annotationColor(annotation);
|
|
284
|
+
if (resolved) {
|
|
285
|
+
color = resolved.color;
|
|
286
|
+
lines.push(`- resolves: \`${formatRgba(resolved.color)}\``);
|
|
287
|
+
}
|
|
288
|
+
} else if (annotation.kind === "keyword") {
|
|
289
|
+
lines.push(`**${annotation.text}** \xB7 CSS keyword` + (annotation.property ? ` for \`${annotation.property}\`` : ""));
|
|
290
|
+
} else {
|
|
291
|
+
var resolved1 = annotationColor(annotation);
|
|
292
|
+
if (!resolved1) return null;
|
|
293
|
+
color = resolved1.color;
|
|
294
|
+
lines.push(`**${annotation.text}** \xB7 CSS color = \`${formatRgba(resolved1.color)}\``);
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
start: annotation.start,
|
|
298
|
+
end: annotation.end,
|
|
299
|
+
text: annotation.text,
|
|
300
|
+
markdown: lines.join("\n\n"),
|
|
301
|
+
...color !== void 0 && { color }
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
//# sourceMappingURL=core.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.native.js","names":[],"sources":["cjs/core.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar core_exports = {};\n__export(core_exports, {\n completionSortText: () => completionSortText,\n createStyleTooling: () => createStyleTooling\n});\nmodule.exports = __toCommonJS(core_exports);\nvar import_normalize_css_color = require(\"@tamagui/normalize-css-color\");\nvar import_tooling = require(\"@tamagui/style-grammar/tooling\");\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar modifierKindLabel = {\n state: \"state modifier\",\n media: \"media modifier\",\n theme: \"theme modifier\",\n platform: \"platform modifier\",\n group: \"group modifier\",\n container: \"container modifier\"\n};\nvar modifierKindSort = {\n state: \"00\",\n group: \"01\",\n media: \"02\",\n container: \"03\",\n theme: \"04\",\n platform: \"05\"\n};\nvar stateModifierSort = new Map(import_tooling.stateModifierNames.map(function(name, index) {\n return [\n name,\n index\n ];\n}));\nfunction completionSortText(completion, modifierKind) {\n if (modifierKind) {\n var _stateModifierSort_get;\n var stateOrder = modifierKind === \"state\" ? `${String((_stateModifierSort_get = stateModifierSort.get(completion.value)) !== null && _stateModifierSort_get !== void 0 ? _stateModifierSort_get : 999).padStart(3, \"0\")}:` : \"\";\n return `${modifierKindSort[modifierKind]}:${stateOrder}${completion.value}`;\n }\n return `${completion.kind === \"configured\" ? \"10\" : \"11\"}:${completion.value}`;\n}\nfunction tokenValue(entry) {\n if (entry && (typeof entry === \"undefined\" ? \"undefined\" : _type_of(entry)) === \"object\" && \"val\" in entry) {\n return entry.val;\n }\n return entry;\n}\nfunction parseColor(value, opacity) {\n if (typeof value !== \"string\") return null;\n var normalized = (0, import_normalize_css_color.normalizeCSSColor)(value);\n if (normalized === null) return null;\n var color = (0, import_normalize_css_color.rgba)(normalized);\n if (opacity !== void 0) color.a = color.a * (opacity / 100);\n return color;\n}\nfunction createStyleTooling(file) {\n var serialized = file.tamaguiConfig;\n if (!serialized) return null;\n var config = (0, import_tooling.createGrammarConfigViewFromSerializedConfig)(serialized, file.tamaguiConfigMetadata);\n var registry = (0, import_tooling.createModifierRegistry)(config).registry;\n var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);\n var engine = {\n config,\n registry,\n candidates\n };\n var styleProps = (0, import_tooling.createStylePropSet)(config);\n var themes = serialized.themes || {};\n var rootThemes = Object.keys(themes).filter(function(name) {\n return !name.includes(\"_\");\n });\n var previewThemes = [\n ...[\n \"light\",\n \"dark\"\n ].filter(function(name) {\n return rootThemes.includes(name);\n }),\n ...rootThemes.filter(function(name) {\n return name !== \"light\" && name !== \"dark\";\n })\n ];\n var tokens = serialized.tokens || {};\n var media = serialized.media || {};\n var targetProperty = function(name) {\n var _config_shorthands;\n return ((_config_shorthands = config.shorthands) === null || _config_shorthands === void 0 ? void 0 : _config_shorthands[name]) || name;\n };\n var themeValue = function(name) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = previewThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var theme = _step.value;\n var _themes_theme;\n var value = (_themes_theme = themes[theme]) === null || _themes_theme === void 0 ? void 0 : _themes_theme[name];\n if (value !== void 0) return {\n theme,\n value\n };\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return null;\n };\n var annotationColor = function(annotation) {\n if (annotation.kind === \"token\" || annotation.kind === \"identifier\") {\n var name = annotation.opacity !== void 0 ? annotation.text.slice(0, annotation.text.lastIndexOf(\"/\")) : annotation.text;\n if (annotation.tokenCategory === \"color\") {\n var _tokens_color;\n var themed = themeValue(name);\n if (themed) {\n var color = parseColor(themed.value, annotation.opacity);\n return color ? {\n color,\n theme: themed.theme\n } : null;\n }\n var color1 = parseColor(tokenValue((_tokens_color = tokens.color) === null || _tokens_color === void 0 ? void 0 : _tokens_color[name]), annotation.opacity);\n return color1 ? {\n color: color1\n } : null;\n }\n if (annotation.kind === \"identifier\") {\n var color2 = parseColor(name);\n return color2 ? {\n color: color2\n } : null;\n }\n return null;\n }\n if (annotation.kind === \"keyword\" && annotation.text === \"transparent\") {\n return {\n color: {\n r: 0,\n g: 0,\n b: 0,\n a: 0\n }\n };\n }\n return null;\n };\n var annotations = function(property, value) {\n return (0, import_tooling.annotateStyleValue)(property, value, engine);\n };\n var formatRgba = function(color) {\n return color.a === 1 ? `rgb(${color.r}, ${color.g}, ${color.b})` : `rgba(${color.r}, ${color.g}, ${color.b}, ${Number(color.a.toFixed(3))})`;\n };\n return {\n styleProps,\n engine,\n previewThemes,\n isStyleProp: function(name) {\n return styleProps.has(name);\n },\n targetProperty,\n modifierKind: function(name) {\n return registry.get(name);\n },\n completions(property, value, cursor) {\n var target = targetProperty(property);\n if ((0, import_tooling.programEligibility)(target) === \"legacy-part\") return null;\n if (!styleProps.has(property)) return null;\n return (0, import_tooling.completeStyleValueAtCursor)(property, value, cursor, engine);\n },\n diagnostics(property, value) {\n if (!styleProps.has(property)) return [];\n return (0, import_tooling.diagnoseStyleValueProgram)(property, value, engine);\n },\n annotations,\n colors(property, value) {\n if (!styleProps.has(property)) return [];\n var results = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = annotations(property, value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var annotation = _step.value;\n var resolved = annotationColor(annotation);\n if (!resolved) continue;\n results.push({\n start: annotation.start,\n end: annotation.end,\n text: annotation.text,\n color: resolved.color,\n ...resolved.theme !== void 0 && {\n theme: resolved.theme\n }\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return results;\n },\n hover(property, value, offset) {\n if (!styleProps.has(property)) return null;\n var annotation = annotations(property, value).find(function(entry) {\n return offset >= entry.start && offset <= entry.end;\n });\n if (!annotation) return null;\n var lines = [];\n var color;\n if (annotation.kind === \"modifier\" && annotation.modifierKind) {\n lines.push(`**${annotation.text}** \\xB7 Tamagui ${modifierKindLabel[annotation.modifierKind]}`);\n if (annotation.modifierKind === \"media\") {\n var query = media[annotation.text];\n if (query !== void 0) {\n lines.push(\"```json\\n\" + JSON.stringify(query) + \"\\n```\");\n }\n }\n } else if (annotation.kind === \"token\") {\n var name = annotation.opacity !== void 0 ? annotation.text.slice(0, annotation.text.lastIndexOf(\"/\")) : annotation.text;\n if (annotation.tokenCategory === \"color\") {\n lines.push(`**${name}** \\xB7 Tamagui color`);\n var shown = 0;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = previewThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var theme = _step.value;\n var _themes_theme;\n var _$value = (_themes_theme = themes[theme]) === null || _themes_theme === void 0 ? void 0 : _themes_theme[name];\n if (_$value === void 0 || shown >= 4) continue;\n shown++;\n lines.push(`- ${theme}: \\`${String(_$value)}\\``);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (shown === 0) {\n var _tokens_color;\n var _$value1 = tokenValue((_tokens_color = tokens.color) === null || _tokens_color === void 0 ? void 0 : _tokens_color[name]);\n if (_$value1 !== void 0) lines.push(`- \\`${String(_$value1)}\\``);\n }\n if (annotation.opacity !== void 0) {\n lines.push(`- opacity: ${annotation.opacity}%`);\n }\n } else {\n var _tokens_;\n var _$value2 = tokenValue((_tokens_ = tokens[annotation.tokenCategory || \"\"]) === null || _tokens_ === void 0 ? void 0 : _tokens_[name]);\n lines.push(`**${name}** \\xB7 Tamagui ${annotation.tokenCategory} token` + (_$value2 !== void 0 ? ` = \\`${String(_$value2)}\\`` : \"\"));\n }\n var resolved = annotationColor(annotation);\n if (resolved) {\n color = resolved.color;\n lines.push(`- resolves: \\`${formatRgba(resolved.color)}\\``);\n }\n } else if (annotation.kind === \"keyword\") {\n lines.push(`**${annotation.text}** \\xB7 CSS keyword` + (annotation.property ? ` for \\`${annotation.property}\\`` : \"\"));\n } else {\n var resolved1 = annotationColor(annotation);\n if (!resolved1) return null;\n color = resolved1.color;\n lines.push(`**${annotation.text}** \\xB7 CSS color = \\`${formatRgba(resolved1.color)}\\``);\n }\n return {\n start: annotation.start,\n end: annotation.end,\n text: annotation.text,\n markdown: lines.join(\"\\n\\n\"),\n ...color !== void 0 && {\n color\n }\n };\n }\n };\n}\n//# sourceMappingURL=core.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,eAAe,CAAC;AACpB,SAAS,cAAc;CACrB,0BAA0B;CAC1B,0BAA0B;AAC5B,CAAC;AACD,OAAO,UAAU,aAAa,YAAY;AAC1C,IAAI,6BAA6B,QAAQ,8BAA8B;AACvE,IAAI,iBAAiB,QAAQ,gCAAgC;AAC7D,SAAS,SAAS,KAAK;CACrB;C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