@michaelmishin/speclens 0.2.0 → 0.3.0
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 +74 -5
- package/dist/speclens.iife.js +1791 -658
- package/dist/speclens.iife.js.map +1 -1
- package/dist/speclens.js +2047 -339
- package/dist/speclens.js.map +1 -1
- package/package.json +1 -1
package/dist/speclens.js
CHANGED
|
@@ -17995,8 +17995,8 @@ const objectToNumericMapAsync = async (object) => {
|
|
|
17995
17995
|
};
|
|
17996
17996
|
const wait = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
17997
17997
|
const SPACE_OR_PUNCTUATION = /[\n\r\p{Z}\p{P}]+/u;
|
|
17998
|
-
function buildSearchIndex(operations) {
|
|
17999
|
-
const
|
|
17998
|
+
function buildSearchIndex(operations, guides) {
|
|
17999
|
+
const opSearch = new MiniSearch({
|
|
18000
18000
|
fields: ["operationId", "summary", "description", "path", "method", "tags"],
|
|
18001
18001
|
storeFields: ["operationId", "summary", "path", "method", "tags"],
|
|
18002
18002
|
searchOptions: {
|
|
@@ -18019,11 +18019,36 @@ function buildSearchIndex(operations) {
|
|
|
18019
18019
|
method: op.method,
|
|
18020
18020
|
tags: op.tags.join(" ")
|
|
18021
18021
|
}));
|
|
18022
|
-
|
|
18022
|
+
opSearch.addAll(documents);
|
|
18023
|
+
let guideSearch = null;
|
|
18024
|
+
if (guides == null ? void 0 : guides.length) {
|
|
18025
|
+
guideSearch = new MiniSearch({
|
|
18026
|
+
fields: ["title", "category", "content"],
|
|
18027
|
+
storeFields: ["slug", "title", "category"],
|
|
18028
|
+
searchOptions: {
|
|
18029
|
+
prefix: true,
|
|
18030
|
+
fuzzy: 0.2,
|
|
18031
|
+
boost: {
|
|
18032
|
+
title: 3,
|
|
18033
|
+
category: 1.5,
|
|
18034
|
+
content: 1
|
|
18035
|
+
}
|
|
18036
|
+
}
|
|
18037
|
+
});
|
|
18038
|
+
const guideDocs = guides.map((g2) => ({
|
|
18039
|
+
id: `guide-${g2.slug}`,
|
|
18040
|
+
slug: g2.slug,
|
|
18041
|
+
title: g2.title,
|
|
18042
|
+
category: g2.category || "General",
|
|
18043
|
+
content: g2.content || ""
|
|
18044
|
+
}));
|
|
18045
|
+
guideSearch.addAll(guideDocs);
|
|
18046
|
+
}
|
|
18023
18047
|
return {
|
|
18024
18048
|
search(query) {
|
|
18025
18049
|
if (!query.trim()) return [];
|
|
18026
|
-
|
|
18050
|
+
const opResults = opSearch.search(query).map((result) => ({
|
|
18051
|
+
type: "operation",
|
|
18027
18052
|
operationId: result.operationId,
|
|
18028
18053
|
path: result.path,
|
|
18029
18054
|
method: result.method,
|
|
@@ -18031,10 +18056,20 @@ function buildSearchIndex(operations) {
|
|
|
18031
18056
|
tags: result.tags.split(" ").filter(Boolean),
|
|
18032
18057
|
score: result.score
|
|
18033
18058
|
}));
|
|
18059
|
+
const guideResults = guideSearch ? guideSearch.search(query).map((result) => ({
|
|
18060
|
+
type: "guide",
|
|
18061
|
+
slug: result.slug,
|
|
18062
|
+
title: result.title,
|
|
18063
|
+
category: result.category,
|
|
18064
|
+
score: result.score
|
|
18065
|
+
})) : [];
|
|
18066
|
+
return [...opResults, ...guideResults].sort((a2, b2) => b2.score - a2.score);
|
|
18034
18067
|
},
|
|
18035
18068
|
autoSuggest(query) {
|
|
18036
18069
|
if (!query.trim()) return [];
|
|
18037
|
-
|
|
18070
|
+
const opSuggestions = opSearch.autoSuggest(query).map((s2) => s2.suggestion);
|
|
18071
|
+
const guideSuggestions = guideSearch ? guideSearch.autoSuggest(query).map((s2) => s2.suggestion) : [];
|
|
18072
|
+
return [.../* @__PURE__ */ new Set([...opSuggestions, ...guideSuggestions])];
|
|
18038
18073
|
}
|
|
18039
18074
|
};
|
|
18040
18075
|
}
|
|
@@ -18052,9 +18087,14 @@ class Router {
|
|
|
18052
18087
|
handleCurrentRoute() {
|
|
18053
18088
|
const hash = window.location.hash;
|
|
18054
18089
|
if (!hash) return;
|
|
18055
|
-
const
|
|
18056
|
-
if (
|
|
18057
|
-
this._callback(decodeURIComponent(
|
|
18090
|
+
const opMatch = hash.match(/^#\/operation\/(.+)$/);
|
|
18091
|
+
if (opMatch) {
|
|
18092
|
+
this._callback({ type: "operation", id: decodeURIComponent(opMatch[1]) });
|
|
18093
|
+
return;
|
|
18094
|
+
}
|
|
18095
|
+
const guideMatch = hash.match(/^#\/guide\/(.+)$/);
|
|
18096
|
+
if (guideMatch) {
|
|
18097
|
+
this._callback({ type: "guide", slug: decodeURIComponent(guideMatch[1]) });
|
|
18058
18098
|
}
|
|
18059
18099
|
}
|
|
18060
18100
|
navigateTo(operationId) {
|
|
@@ -18062,66 +18102,22 @@ class Router {
|
|
|
18062
18102
|
if (window.location.hash !== hash) {
|
|
18063
18103
|
window.location.hash = hash;
|
|
18064
18104
|
} else {
|
|
18065
|
-
this._callback(operationId);
|
|
18105
|
+
this._callback({ type: "operation", id: operationId });
|
|
18066
18106
|
}
|
|
18067
18107
|
}
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
|
|
18072
|
-
const STORAGE_KEY = "speclens-theme";
|
|
18073
|
-
class ThemeManager {
|
|
18074
|
-
constructor(host) {
|
|
18075
|
-
this._preference = "auto";
|
|
18076
|
-
this._mediaQuery = null;
|
|
18077
|
-
this._mediaListener = () => this._apply();
|
|
18078
|
-
this.resolved = "light";
|
|
18079
|
-
this._host = host;
|
|
18080
|
-
}
|
|
18081
|
-
init(preference) {
|
|
18082
|
-
const stored = this._readStorage();
|
|
18083
|
-
this._preference = stored ?? preference;
|
|
18084
|
-
this._mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
18085
|
-
this._mediaQuery.addEventListener("change", this._mediaListener);
|
|
18086
|
-
this._apply();
|
|
18087
|
-
}
|
|
18088
|
-
destroy() {
|
|
18089
|
-
var _a2;
|
|
18090
|
-
(_a2 = this._mediaQuery) == null ? void 0 : _a2.removeEventListener("change", this._mediaListener);
|
|
18091
|
-
}
|
|
18092
|
-
setTheme(preference) {
|
|
18093
|
-
this._preference = preference;
|
|
18094
|
-
this._writeStorage(preference);
|
|
18095
|
-
this._apply();
|
|
18096
|
-
}
|
|
18097
|
-
toggle() {
|
|
18098
|
-
const next2 = this.resolved === "light" ? "dark" : "light";
|
|
18099
|
-
this.setTheme(next2);
|
|
18100
|
-
return next2;
|
|
18101
|
-
}
|
|
18102
|
-
_apply() {
|
|
18103
|
-
var _a2;
|
|
18104
|
-
if (this._preference === "auto") {
|
|
18105
|
-
this.resolved = ((_a2 = this._mediaQuery) == null ? void 0 : _a2.matches) ? "dark" : "light";
|
|
18108
|
+
navigateToGuide(slug) {
|
|
18109
|
+
const hash = `#/guide/${encodeURIComponent(slug)}`;
|
|
18110
|
+
if (window.location.hash !== hash) {
|
|
18111
|
+
window.location.hash = hash;
|
|
18106
18112
|
} else {
|
|
18107
|
-
this.
|
|
18113
|
+
this._callback({ type: "guide", slug });
|
|
18108
18114
|
}
|
|
18109
|
-
this._host.setAttribute("data-theme", this.resolved);
|
|
18110
|
-
this._host.requestUpdate();
|
|
18111
18115
|
}
|
|
18112
|
-
|
|
18113
|
-
|
|
18114
|
-
const val = localStorage.getItem(STORAGE_KEY);
|
|
18115
|
-
if (val === "light" || val === "dark" || val === "auto") return val;
|
|
18116
|
-
} catch {
|
|
18117
|
-
}
|
|
18118
|
-
return null;
|
|
18116
|
+
static buildHash(operationId) {
|
|
18117
|
+
return `#/operation/${encodeURIComponent(operationId)}`;
|
|
18119
18118
|
}
|
|
18120
|
-
|
|
18121
|
-
|
|
18122
|
-
localStorage.setItem(STORAGE_KEY, value);
|
|
18123
|
-
} catch {
|
|
18124
|
-
}
|
|
18119
|
+
static buildGuideHash(slug) {
|
|
18120
|
+
return `#/guide/${encodeURIComponent(slug)}`;
|
|
18125
18121
|
}
|
|
18126
18122
|
}
|
|
18127
18123
|
function _getDefaults() {
|
|
@@ -20265,14 +20261,224 @@ marked.walkTokens;
|
|
|
20265
20261
|
marked.parseInline;
|
|
20266
20262
|
_Parser.parse;
|
|
20267
20263
|
_Lexer.lex;
|
|
20268
|
-
|
|
20269
|
-
|
|
20270
|
-
|
|
20271
|
-
|
|
20264
|
+
async function loadGuides(inlineGuides, guidesUrl) {
|
|
20265
|
+
let allGuides = [];
|
|
20266
|
+
if (guidesUrl) {
|
|
20267
|
+
const res = await fetch(guidesUrl);
|
|
20268
|
+
if (!res.ok) throw new Error(`Failed to load guides manifest: ${res.status}`);
|
|
20269
|
+
const manifest = await res.json();
|
|
20270
|
+
allGuides = manifest;
|
|
20271
|
+
}
|
|
20272
|
+
if (inlineGuides == null ? void 0 : inlineGuides.length) {
|
|
20273
|
+
const slugSet = /* @__PURE__ */ new Map();
|
|
20274
|
+
for (const g2 of allGuides) slugSet.set(g2.slug, g2);
|
|
20275
|
+
for (const g2 of inlineGuides) slugSet.set(g2.slug, g2);
|
|
20276
|
+
allGuides = Array.from(slugSet.values());
|
|
20277
|
+
}
|
|
20278
|
+
if (!allGuides.length) {
|
|
20279
|
+
return { categories: [], loaded: /* @__PURE__ */ new Map() };
|
|
20280
|
+
}
|
|
20281
|
+
const loaded = /* @__PURE__ */ new Map();
|
|
20282
|
+
await Promise.all(
|
|
20283
|
+
allGuides.map(async (guide) => {
|
|
20284
|
+
let rawMarkdown = guide.content ?? "";
|
|
20285
|
+
if (!rawMarkdown && guide.url) {
|
|
20286
|
+
const res = await fetch(guide.url);
|
|
20287
|
+
if (res.ok) {
|
|
20288
|
+
rawMarkdown = await res.text();
|
|
20289
|
+
}
|
|
20290
|
+
}
|
|
20291
|
+
const htmlContent = rawMarkdown ? sanitizeHtml(await marked.parse(rawMarkdown)) : "";
|
|
20292
|
+
loaded.set(guide.slug, { ...guide, htmlContent });
|
|
20293
|
+
})
|
|
20294
|
+
);
|
|
20295
|
+
const categoryMap = /* @__PURE__ */ new Map();
|
|
20296
|
+
for (const guide of allGuides) {
|
|
20297
|
+
const cat = guide.category || "General";
|
|
20298
|
+
if (!categoryMap.has(cat)) categoryMap.set(cat, []);
|
|
20299
|
+
categoryMap.get(cat).push(guide);
|
|
20300
|
+
}
|
|
20301
|
+
const categories = [];
|
|
20302
|
+
for (const [name, guides] of categoryMap) {
|
|
20303
|
+
guides.sort((a2, b2) => (a2.order ?? Infinity) - (b2.order ?? Infinity));
|
|
20304
|
+
categories.push({ name, guides });
|
|
20305
|
+
}
|
|
20306
|
+
return { categories, loaded };
|
|
20307
|
+
}
|
|
20308
|
+
function sanitizeHtml(html2) {
|
|
20309
|
+
return html2.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^>]*>.*?<\/iframe>/gi, "").replace(/<object\b[^>]*>.*?<\/object>/gi, "").replace(/<embed\b[^>]*>/gi, "").replace(/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/href\s*=\s*"javascript:[^"]*"/gi, 'href="#"').replace(/href\s*=\s*'javascript:[^']*'/gi, "href='#'");
|
|
20310
|
+
}
|
|
20311
|
+
const STORAGE_KEY = "speclens-theme";
|
|
20312
|
+
class ThemeManager {
|
|
20313
|
+
constructor(host) {
|
|
20314
|
+
this._preference = "auto";
|
|
20315
|
+
this._mediaQuery = null;
|
|
20316
|
+
this._mediaListener = () => this._apply();
|
|
20317
|
+
this.resolved = "light";
|
|
20318
|
+
this._host = host;
|
|
20319
|
+
}
|
|
20320
|
+
init(preference) {
|
|
20321
|
+
const stored = this._readStorage();
|
|
20322
|
+
this._preference = stored ?? preference;
|
|
20323
|
+
this._mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
20324
|
+
this._mediaQuery.addEventListener("change", this._mediaListener);
|
|
20325
|
+
this._apply();
|
|
20326
|
+
}
|
|
20327
|
+
destroy() {
|
|
20328
|
+
var _a2;
|
|
20329
|
+
(_a2 = this._mediaQuery) == null ? void 0 : _a2.removeEventListener("change", this._mediaListener);
|
|
20330
|
+
}
|
|
20331
|
+
setTheme(preference) {
|
|
20332
|
+
this._preference = preference;
|
|
20333
|
+
this._writeStorage(preference);
|
|
20334
|
+
this._apply();
|
|
20335
|
+
}
|
|
20336
|
+
toggle() {
|
|
20337
|
+
const next2 = this.resolved === "light" ? "dark" : "light";
|
|
20338
|
+
this.setTheme(next2);
|
|
20339
|
+
return next2;
|
|
20340
|
+
}
|
|
20341
|
+
_apply() {
|
|
20342
|
+
var _a2;
|
|
20343
|
+
if (this._preference === "auto") {
|
|
20344
|
+
this.resolved = ((_a2 = this._mediaQuery) == null ? void 0 : _a2.matches) ? "dark" : "light";
|
|
20345
|
+
} else {
|
|
20346
|
+
this.resolved = this._preference;
|
|
20347
|
+
}
|
|
20348
|
+
this._host.setAttribute("data-theme", this.resolved);
|
|
20349
|
+
this._host.requestUpdate();
|
|
20350
|
+
}
|
|
20351
|
+
_readStorage() {
|
|
20352
|
+
try {
|
|
20353
|
+
const val = localStorage.getItem(STORAGE_KEY);
|
|
20354
|
+
if (val === "light" || val === "dark" || val === "auto") return val;
|
|
20355
|
+
} catch {
|
|
20356
|
+
}
|
|
20357
|
+
return null;
|
|
20358
|
+
}
|
|
20359
|
+
_writeStorage(value) {
|
|
20360
|
+
try {
|
|
20361
|
+
localStorage.setItem(STORAGE_KEY, value);
|
|
20362
|
+
} catch {
|
|
20363
|
+
}
|
|
20364
|
+
}
|
|
20365
|
+
}
|
|
20366
|
+
const MAX_PROMPT_LENGTH = 6e3;
|
|
20367
|
+
function generateAiPrompt(op) {
|
|
20368
|
+
const lines = [];
|
|
20369
|
+
lines.push(`I'm working with the following REST API endpoint and need help understanding how to use it correctly.
|
|
20370
|
+
`);
|
|
20371
|
+
lines.push(`## Endpoint`);
|
|
20372
|
+
lines.push(`**${op.method.toUpperCase()} ${op.path}**`);
|
|
20373
|
+
if (op.summary) lines.push(`
|
|
20374
|
+
${op.summary}`);
|
|
20375
|
+
if (op.description) lines.push(`
|
|
20376
|
+
${op.description}`);
|
|
20377
|
+
if (op.parameters.length > 0) {
|
|
20378
|
+
lines.push(`
|
|
20379
|
+
## Parameters`);
|
|
20380
|
+
for (const p2 of op.parameters) {
|
|
20381
|
+
const flags = [];
|
|
20382
|
+
if (p2.required) flags.push("required");
|
|
20383
|
+
if (p2.deprecated) flags.push("deprecated");
|
|
20384
|
+
const type2 = p2.schema ? p2.schema.type ?? "any" : "any";
|
|
20385
|
+
const enumVals = p2.schema ? p2.schema.enum : void 0;
|
|
20386
|
+
let line = `- **${p2.name}** (${p2.in}, ${type2}${flags.length ? ", " + flags.join(", ") : ""})`;
|
|
20387
|
+
if (p2.description) line += `: ${p2.description}`;
|
|
20388
|
+
if (enumVals == null ? void 0 : enumVals.length) line += ` — Allowed values: ${enumVals.join(", ")}`;
|
|
20389
|
+
if (p2.example !== void 0) line += ` — Example: \`${JSON.stringify(p2.example)}\``;
|
|
20390
|
+
lines.push(line);
|
|
20391
|
+
}
|
|
20392
|
+
}
|
|
20393
|
+
if (op.requestBody) {
|
|
20394
|
+
lines.push(`
|
|
20395
|
+
## Request Body${op.requestBody.required ? " (required)" : ""}`);
|
|
20396
|
+
if (op.requestBody.description) lines.push(op.requestBody.description);
|
|
20397
|
+
for (const content of op.requestBody.content) {
|
|
20398
|
+
lines.push(`
|
|
20399
|
+
Content-Type: \`${content.mediaType}\``);
|
|
20400
|
+
if (content.schema) {
|
|
20401
|
+
const schemaStr = JSON.stringify(content.schema, null, 2);
|
|
20402
|
+
if (schemaStr.length < 2e3) {
|
|
20403
|
+
lines.push("```json");
|
|
20404
|
+
lines.push(schemaStr);
|
|
20405
|
+
lines.push("```");
|
|
20406
|
+
} else {
|
|
20407
|
+
lines.push("Schema: (large schema, key properties shown)");
|
|
20408
|
+
const props = content.schema.properties;
|
|
20409
|
+
if (props) {
|
|
20410
|
+
for (const [key, val] of Object.entries(props)) {
|
|
20411
|
+
const t2 = (val == null ? void 0 : val.type) ?? "object";
|
|
20412
|
+
lines.push(`- ${key}: ${t2}`);
|
|
20413
|
+
}
|
|
20414
|
+
}
|
|
20415
|
+
}
|
|
20416
|
+
}
|
|
20417
|
+
if (content.example !== void 0) {
|
|
20418
|
+
lines.push(`
|
|
20419
|
+
Example:
|
|
20420
|
+
\`\`\`json
|
|
20421
|
+
${JSON.stringify(content.example, null, 2)}
|
|
20422
|
+
\`\`\``);
|
|
20423
|
+
}
|
|
20424
|
+
}
|
|
20425
|
+
}
|
|
20426
|
+
if (op.responses.length > 0) {
|
|
20427
|
+
lines.push(`
|
|
20428
|
+
## Responses`);
|
|
20429
|
+
for (const r2 of op.responses) {
|
|
20430
|
+
lines.push(`
|
|
20431
|
+
### ${r2.statusCode}${r2.description ? " — " + r2.description : ""}`);
|
|
20432
|
+
for (const content of r2.content) {
|
|
20433
|
+
if (content.schema) {
|
|
20434
|
+
const schemaStr = JSON.stringify(content.schema, null, 2);
|
|
20435
|
+
if (schemaStr.length < 1500) {
|
|
20436
|
+
lines.push(`\`${content.mediaType}\`
|
|
20437
|
+
\`\`\`json
|
|
20438
|
+
${schemaStr}
|
|
20439
|
+
\`\`\``);
|
|
20440
|
+
} else {
|
|
20441
|
+
lines.push(`\`${content.mediaType}\` — (large schema)`);
|
|
20442
|
+
}
|
|
20443
|
+
}
|
|
20444
|
+
}
|
|
20445
|
+
}
|
|
20446
|
+
}
|
|
20447
|
+
if (op.security.length > 0) {
|
|
20448
|
+
lines.push(`
|
|
20449
|
+
## Authentication`);
|
|
20450
|
+
for (const req of op.security) {
|
|
20451
|
+
const schemes2 = Object.entries(req).map(
|
|
20452
|
+
([name, scopes]) => scopes.length > 0 ? `${name} (scopes: ${scopes.join(", ")})` : name
|
|
20453
|
+
);
|
|
20454
|
+
lines.push(`- ${schemes2.join(" + ")}`);
|
|
20455
|
+
}
|
|
20456
|
+
}
|
|
20457
|
+
lines.push(`
|
|
20458
|
+
Please help me understand this endpoint, write an example request, and explain the expected response.`);
|
|
20459
|
+
let prompt = lines.join("\n");
|
|
20460
|
+
if (prompt.length > MAX_PROMPT_LENGTH) {
|
|
20461
|
+
prompt = prompt.slice(0, MAX_PROMPT_LENGTH - 3) + "...";
|
|
20462
|
+
}
|
|
20463
|
+
return prompt;
|
|
20464
|
+
}
|
|
20465
|
+
function buildAiUrl(prompt, target) {
|
|
20466
|
+
const encoded = encodeURIComponent(prompt);
|
|
20467
|
+
switch (target) {
|
|
20468
|
+
case "chatgpt":
|
|
20469
|
+
return `https://chatgpt.com/?q=${encoded}`;
|
|
20470
|
+
case "claude":
|
|
20471
|
+
return `https://claude.ai/new?q=${encoded}`;
|
|
20472
|
+
}
|
|
20473
|
+
}
|
|
20474
|
+
var __defProp$d = Object.defineProperty;
|
|
20475
|
+
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
20476
|
+
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
20477
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
|
|
20272
20478
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
20273
20479
|
if (decorator = decorators[i3])
|
|
20274
20480
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20275
|
-
if (kind && result) __defProp$
|
|
20481
|
+
if (kind && result) __defProp$d(target, key, result);
|
|
20276
20482
|
return result;
|
|
20277
20483
|
};
|
|
20278
20484
|
let SlHeader = class extends i$1 {
|
|
@@ -20280,6 +20486,8 @@ let SlHeader = class extends i$1 {
|
|
|
20280
20486
|
super(...arguments);
|
|
20281
20487
|
this.spec = null;
|
|
20282
20488
|
this.authOpen = false;
|
|
20489
|
+
this.activeTab = "api";
|
|
20490
|
+
this.showTabs = false;
|
|
20283
20491
|
}
|
|
20284
20492
|
render() {
|
|
20285
20493
|
if (!this.spec) return b``;
|
|
@@ -20298,8 +20506,44 @@ let SlHeader = class extends i$1 {
|
|
|
20298
20506
|
</slot>
|
|
20299
20507
|
</div>
|
|
20300
20508
|
|
|
20509
|
+
${this.showTabs ? b`
|
|
20510
|
+
<nav class="nav-tabs">
|
|
20511
|
+
<button
|
|
20512
|
+
class="nav-tab ${this.activeTab === "api" ? "active" : ""}"
|
|
20513
|
+
@click=${() => this._switchTab("api")}
|
|
20514
|
+
>
|
|
20515
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
20516
|
+
<path d="M2 4h12M2 8h8M2 12h10"/>
|
|
20517
|
+
</svg>
|
|
20518
|
+
API Reference
|
|
20519
|
+
</button>
|
|
20520
|
+
<button
|
|
20521
|
+
class="nav-tab ${this.activeTab === "guides" ? "active" : ""}"
|
|
20522
|
+
@click=${() => this._switchTab("guides")}
|
|
20523
|
+
>
|
|
20524
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
20525
|
+
<path d="M2 3h10a2 2 0 012 2v8a1 1 0 01-1 1H5a2 2 0 01-2-2V3z"/>
|
|
20526
|
+
<path d="M2 3a2 2 0 012-2h6l4 4"/>
|
|
20527
|
+
<path d="M5 9h6M5 12h4"/>
|
|
20528
|
+
</svg>
|
|
20529
|
+
Guides
|
|
20530
|
+
</button>
|
|
20531
|
+
</nav>
|
|
20532
|
+
` : null}
|
|
20533
|
+
|
|
20301
20534
|
<div class="spacer"></div>
|
|
20302
20535
|
|
|
20536
|
+
<div class="search-wrapper">
|
|
20537
|
+
<button class="search-trigger" @click=${() => this.dispatchEvent(new CustomEvent("open-search"))}>
|
|
20538
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
20539
|
+
<circle cx="7" cy="7" r="4.5"/>
|
|
20540
|
+
<path d="M10.5 10.5L14 14" stroke-linecap="round"/>
|
|
20541
|
+
</svg>
|
|
20542
|
+
<span class="search-placeholder">Search…</span>
|
|
20543
|
+
<span class="search-shortcut">⌘K</span>
|
|
20544
|
+
</button>
|
|
20545
|
+
</div>
|
|
20546
|
+
|
|
20303
20547
|
<div class="actions">
|
|
20304
20548
|
${this.spec.securitySchemes.length > 0 ? b`
|
|
20305
20549
|
<button
|
|
@@ -20326,6 +20570,10 @@ let SlHeader = class extends i$1 {
|
|
|
20326
20570
|
</div>
|
|
20327
20571
|
`;
|
|
20328
20572
|
}
|
|
20573
|
+
_switchTab(tab) {
|
|
20574
|
+
if (tab === this.activeTab) return;
|
|
20575
|
+
this.dispatchEvent(new CustomEvent("tab-change", { detail: tab }));
|
|
20576
|
+
}
|
|
20329
20577
|
};
|
|
20330
20578
|
SlHeader.styles = [
|
|
20331
20579
|
resetStyles,
|
|
@@ -20389,8 +20637,115 @@ SlHeader.styles = [
|
|
|
20389
20637
|
white-space: nowrap;
|
|
20390
20638
|
}
|
|
20391
20639
|
|
|
20640
|
+
/* ── Nav Tabs ─────────────────────── */
|
|
20641
|
+
.nav-tabs {
|
|
20642
|
+
display: flex;
|
|
20643
|
+
align-items: stretch;
|
|
20644
|
+
align-self: stretch;
|
|
20645
|
+
gap: 2px;
|
|
20646
|
+
margin-left: var(--sl-spacing-lg);
|
|
20647
|
+
}
|
|
20648
|
+
|
|
20649
|
+
.nav-tab {
|
|
20650
|
+
position: relative;
|
|
20651
|
+
display: flex;
|
|
20652
|
+
align-items: center;
|
|
20653
|
+
gap: 5px;
|
|
20654
|
+
padding: 0 var(--sl-spacing-md);
|
|
20655
|
+
font-size: var(--sl-font-size-sm);
|
|
20656
|
+
font-weight: 600;
|
|
20657
|
+
color: var(--sl-color-text-muted);
|
|
20658
|
+
cursor: pointer;
|
|
20659
|
+
border: none;
|
|
20660
|
+
background: none;
|
|
20661
|
+
transition: color var(--sl-transition-fast);
|
|
20662
|
+
white-space: nowrap;
|
|
20663
|
+
}
|
|
20664
|
+
|
|
20665
|
+
.nav-tab:hover {
|
|
20666
|
+
color: var(--sl-color-text);
|
|
20667
|
+
}
|
|
20668
|
+
|
|
20669
|
+
.nav-tab.active {
|
|
20670
|
+
color: var(--sl-color-primary);
|
|
20671
|
+
}
|
|
20672
|
+
|
|
20673
|
+
.nav-tab.active::after {
|
|
20674
|
+
content: '';
|
|
20675
|
+
position: absolute;
|
|
20676
|
+
bottom: 0;
|
|
20677
|
+
left: var(--sl-spacing-sm);
|
|
20678
|
+
right: var(--sl-spacing-sm);
|
|
20679
|
+
height: 2px;
|
|
20680
|
+
background: var(--sl-color-primary);
|
|
20681
|
+
border-radius: 2px 2px 0 0;
|
|
20682
|
+
}
|
|
20683
|
+
|
|
20684
|
+
@media (max-width: 768px) {
|
|
20685
|
+
.nav-tabs {
|
|
20686
|
+
margin-left: var(--sl-spacing-sm);
|
|
20687
|
+
gap: 0;
|
|
20688
|
+
}
|
|
20689
|
+
.nav-tab { padding: 0 var(--sl-spacing-sm); font-size: var(--sl-font-size-xs); }
|
|
20690
|
+
.nav-tab svg { display: none; }
|
|
20691
|
+
}
|
|
20692
|
+
|
|
20392
20693
|
.spacer { flex: 1; }
|
|
20393
20694
|
|
|
20695
|
+
/* ── Search ────────────────────────── */
|
|
20696
|
+
.search-wrapper {
|
|
20697
|
+
position: relative;
|
|
20698
|
+
}
|
|
20699
|
+
|
|
20700
|
+
.search-trigger {
|
|
20701
|
+
display: flex;
|
|
20702
|
+
align-items: center;
|
|
20703
|
+
gap: 8px;
|
|
20704
|
+
height: 34px;
|
|
20705
|
+
padding: 0 12px;
|
|
20706
|
+
border-radius: var(--sl-radius-md);
|
|
20707
|
+
border: 1px solid var(--sl-color-border);
|
|
20708
|
+
background: var(--sl-color-bg);
|
|
20709
|
+
color: var(--sl-color-text-muted);
|
|
20710
|
+
font-size: var(--sl-font-size-sm);
|
|
20711
|
+
cursor: pointer;
|
|
20712
|
+
transition: all var(--sl-transition-fast);
|
|
20713
|
+
min-width: 200px;
|
|
20714
|
+
}
|
|
20715
|
+
|
|
20716
|
+
.search-trigger:hover {
|
|
20717
|
+
border-color: var(--sl-color-primary);
|
|
20718
|
+
color: var(--sl-color-text-secondary);
|
|
20719
|
+
}
|
|
20720
|
+
|
|
20721
|
+
.search-trigger .search-placeholder {
|
|
20722
|
+
flex: 1;
|
|
20723
|
+
text-align: left;
|
|
20724
|
+
}
|
|
20725
|
+
|
|
20726
|
+
.search-shortcut {
|
|
20727
|
+
font-size: 0.625rem;
|
|
20728
|
+
padding: 1px 5px;
|
|
20729
|
+
border-radius: 3px;
|
|
20730
|
+
background: var(--sl-color-surface-raised);
|
|
20731
|
+
border: 1px solid var(--sl-color-border);
|
|
20732
|
+
color: var(--sl-color-text-muted);
|
|
20733
|
+
font-family: var(--sl-font-mono);
|
|
20734
|
+
}
|
|
20735
|
+
|
|
20736
|
+
@media (max-width: 768px) {
|
|
20737
|
+
.search-trigger {
|
|
20738
|
+
min-width: 36px;
|
|
20739
|
+
width: 36px;
|
|
20740
|
+
padding: 0;
|
|
20741
|
+
justify-content: center;
|
|
20742
|
+
}
|
|
20743
|
+
.search-trigger .search-placeholder,
|
|
20744
|
+
.search-trigger .search-shortcut {
|
|
20745
|
+
display: none;
|
|
20746
|
+
}
|
|
20747
|
+
}
|
|
20748
|
+
|
|
20394
20749
|
.actions {
|
|
20395
20750
|
display: flex;
|
|
20396
20751
|
align-items: center;
|
|
@@ -20449,23 +20804,29 @@ SlHeader.styles = [
|
|
|
20449
20804
|
}
|
|
20450
20805
|
`
|
|
20451
20806
|
];
|
|
20452
|
-
__decorateClass$
|
|
20807
|
+
__decorateClass$d([
|
|
20453
20808
|
n2({ type: Object })
|
|
20454
20809
|
], SlHeader.prototype, "spec", 2);
|
|
20455
|
-
__decorateClass$
|
|
20810
|
+
__decorateClass$d([
|
|
20456
20811
|
n2({ type: Boolean })
|
|
20457
20812
|
], SlHeader.prototype, "authOpen", 2);
|
|
20458
|
-
|
|
20813
|
+
__decorateClass$d([
|
|
20814
|
+
n2()
|
|
20815
|
+
], SlHeader.prototype, "activeTab", 2);
|
|
20816
|
+
__decorateClass$d([
|
|
20817
|
+
n2({ type: Boolean })
|
|
20818
|
+
], SlHeader.prototype, "showTabs", 2);
|
|
20819
|
+
SlHeader = __decorateClass$d([
|
|
20459
20820
|
t$1("sl-header")
|
|
20460
20821
|
], SlHeader);
|
|
20461
|
-
var __defProp$
|
|
20462
|
-
var __getOwnPropDesc$
|
|
20463
|
-
var __decorateClass$
|
|
20464
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
20822
|
+
var __defProp$c = Object.defineProperty;
|
|
20823
|
+
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
20824
|
+
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
20825
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
20465
20826
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
20466
20827
|
if (decorator = decorators[i3])
|
|
20467
20828
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20468
|
-
if (kind && result) __defProp$
|
|
20829
|
+
if (kind && result) __defProp$c(target, key, result);
|
|
20469
20830
|
return result;
|
|
20470
20831
|
};
|
|
20471
20832
|
let SlSidebar = class extends i$1 {
|
|
@@ -20487,7 +20848,7 @@ let SlSidebar = class extends i$1 {
|
|
|
20487
20848
|
_handleSearchInput(e2) {
|
|
20488
20849
|
this._searchQuery = e2.target.value;
|
|
20489
20850
|
if (this.searchEngine && this._searchQuery.trim()) {
|
|
20490
|
-
this._searchResults = this.searchEngine.search(this._searchQuery).slice(0, 30);
|
|
20851
|
+
this._searchResults = this.searchEngine.search(this._searchQuery).filter((r2) => r2.type === "operation").slice(0, 30);
|
|
20491
20852
|
} else {
|
|
20492
20853
|
this._searchResults = [];
|
|
20493
20854
|
}
|
|
@@ -20850,44 +21211,354 @@ SlSidebar.styles = [
|
|
|
20850
21211
|
}
|
|
20851
21212
|
`
|
|
20852
21213
|
];
|
|
20853
|
-
__decorateClass$
|
|
21214
|
+
__decorateClass$c([
|
|
20854
21215
|
n2({ type: Array })
|
|
20855
21216
|
], SlSidebar.prototype, "tagGroups", 2);
|
|
20856
|
-
__decorateClass$
|
|
21217
|
+
__decorateClass$c([
|
|
20857
21218
|
n2({ type: String })
|
|
20858
21219
|
], SlSidebar.prototype, "activeOperationId", 2);
|
|
20859
|
-
__decorateClass$
|
|
21220
|
+
__decorateClass$c([
|
|
20860
21221
|
n2({ type: Boolean, reflect: true })
|
|
20861
21222
|
], SlSidebar.prototype, "open", 2);
|
|
20862
|
-
__decorateClass$
|
|
21223
|
+
__decorateClass$c([
|
|
20863
21224
|
n2({ type: Object })
|
|
20864
21225
|
], SlSidebar.prototype, "searchEngine", 2);
|
|
20865
|
-
__decorateClass$
|
|
21226
|
+
__decorateClass$c([
|
|
20866
21227
|
n2()
|
|
20867
21228
|
], SlSidebar.prototype, "layout", 2);
|
|
20868
|
-
__decorateClass$
|
|
21229
|
+
__decorateClass$c([
|
|
20869
21230
|
n2({ type: Array })
|
|
20870
21231
|
], SlSidebar.prototype, "securitySchemes", 2);
|
|
20871
|
-
__decorateClass$
|
|
21232
|
+
__decorateClass$c([
|
|
20872
21233
|
r$1()
|
|
20873
21234
|
], SlSidebar.prototype, "_searchQuery", 2);
|
|
20874
|
-
__decorateClass$
|
|
21235
|
+
__decorateClass$c([
|
|
20875
21236
|
r$1()
|
|
20876
21237
|
], SlSidebar.prototype, "_searchResults", 2);
|
|
20877
|
-
__decorateClass$
|
|
21238
|
+
__decorateClass$c([
|
|
20878
21239
|
e$2(".search-input")
|
|
20879
21240
|
], SlSidebar.prototype, "_searchInput", 2);
|
|
20880
|
-
SlSidebar = __decorateClass$
|
|
21241
|
+
SlSidebar = __decorateClass$c([
|
|
20881
21242
|
t$1("sl-sidebar")
|
|
20882
21243
|
], SlSidebar);
|
|
20883
|
-
var __defProp$
|
|
20884
|
-
var __getOwnPropDesc$
|
|
20885
|
-
var __decorateClass$
|
|
20886
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
21244
|
+
var __defProp$b = Object.defineProperty;
|
|
21245
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
21246
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
21247
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
20887
21248
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
20888
21249
|
if (decorator = decorators[i3])
|
|
20889
21250
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20890
|
-
if (kind && result) __defProp$
|
|
21251
|
+
if (kind && result) __defProp$b(target, key, result);
|
|
21252
|
+
return result;
|
|
21253
|
+
};
|
|
21254
|
+
let SlSearch = class extends i$1 {
|
|
21255
|
+
constructor() {
|
|
21256
|
+
super(...arguments);
|
|
21257
|
+
this.searchEngine = null;
|
|
21258
|
+
this._query = "";
|
|
21259
|
+
this._results = [];
|
|
21260
|
+
this._highlightIndex = 0;
|
|
21261
|
+
}
|
|
21262
|
+
firstUpdated() {
|
|
21263
|
+
var _a2;
|
|
21264
|
+
(_a2 = this._input) == null ? void 0 : _a2.focus();
|
|
21265
|
+
}
|
|
21266
|
+
_handleInput(e2) {
|
|
21267
|
+
this._query = e2.target.value;
|
|
21268
|
+
this._highlightIndex = 0;
|
|
21269
|
+
if (this.searchEngine && this._query.trim()) {
|
|
21270
|
+
this._results = this.searchEngine.search(this._query).slice(0, 20);
|
|
21271
|
+
} else {
|
|
21272
|
+
this._results = [];
|
|
21273
|
+
}
|
|
21274
|
+
}
|
|
21275
|
+
_handleKeyDown(e2) {
|
|
21276
|
+
switch (e2.key) {
|
|
21277
|
+
case "Escape":
|
|
21278
|
+
this.dispatchEvent(new CustomEvent("close"));
|
|
21279
|
+
break;
|
|
21280
|
+
case "ArrowDown":
|
|
21281
|
+
e2.preventDefault();
|
|
21282
|
+
this._highlightIndex = Math.min(this._highlightIndex + 1, this._results.length - 1);
|
|
21283
|
+
break;
|
|
21284
|
+
case "ArrowUp":
|
|
21285
|
+
e2.preventDefault();
|
|
21286
|
+
this._highlightIndex = Math.max(this._highlightIndex - 1, 0);
|
|
21287
|
+
break;
|
|
21288
|
+
case "Enter":
|
|
21289
|
+
if (this._results[this._highlightIndex]) {
|
|
21290
|
+
this._selectResult(this._results[this._highlightIndex]);
|
|
21291
|
+
}
|
|
21292
|
+
break;
|
|
21293
|
+
}
|
|
21294
|
+
}
|
|
21295
|
+
_selectResult(result) {
|
|
21296
|
+
if (result.type === "operation") {
|
|
21297
|
+
this.dispatchEvent(new CustomEvent("select-operation", { detail: result.operationId }));
|
|
21298
|
+
} else {
|
|
21299
|
+
this.dispatchEvent(new CustomEvent("select-guide", { detail: result.slug }));
|
|
21300
|
+
}
|
|
21301
|
+
}
|
|
21302
|
+
_renderResult(result, i3) {
|
|
21303
|
+
if (result.type === "operation") {
|
|
21304
|
+
return b`
|
|
21305
|
+
<div
|
|
21306
|
+
class="result-item ${i3 === this._highlightIndex ? "highlighted" : ""}"
|
|
21307
|
+
@click=${() => this._selectResult(result)}
|
|
21308
|
+
@mouseenter=${() => this._highlightIndex = i3}
|
|
21309
|
+
>
|
|
21310
|
+
<span class="method-badge method-${result.method}">${result.method}</span>
|
|
21311
|
+
<div class="result-info">
|
|
21312
|
+
<div class="result-path">${result.path}</div>
|
|
21313
|
+
${result.summary ? b`<div class="result-summary">${result.summary}</div>` : null}
|
|
21314
|
+
</div>
|
|
21315
|
+
</div>
|
|
21316
|
+
`;
|
|
21317
|
+
} else {
|
|
21318
|
+
return b`
|
|
21319
|
+
<div
|
|
21320
|
+
class="result-item ${i3 === this._highlightIndex ? "highlighted" : ""}"
|
|
21321
|
+
@click=${() => this._selectResult(result)}
|
|
21322
|
+
@mouseenter=${() => this._highlightIndex = i3}
|
|
21323
|
+
>
|
|
21324
|
+
<span class="guide-badge">Guide</span>
|
|
21325
|
+
<div class="result-info">
|
|
21326
|
+
<div class="result-path">${result.title}</div>
|
|
21327
|
+
<div class="result-summary">${result.category}</div>
|
|
21328
|
+
</div>
|
|
21329
|
+
</div>
|
|
21330
|
+
`;
|
|
21331
|
+
}
|
|
21332
|
+
}
|
|
21333
|
+
render() {
|
|
21334
|
+
return b`
|
|
21335
|
+
<div class="overlay" @click=${() => this.dispatchEvent(new CustomEvent("close"))}></div>
|
|
21336
|
+
<div class="modal" @keydown=${this._handleKeyDown}>
|
|
21337
|
+
<div class="input-wrapper">
|
|
21338
|
+
<svg class="search-icon" width="18" height="18" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
21339
|
+
<circle cx="7" cy="7" r="4.5"/>
|
|
21340
|
+
<path d="M10.5 10.5L14 14" stroke-linecap="round"/>
|
|
21341
|
+
</svg>
|
|
21342
|
+
<input
|
|
21343
|
+
type="text"
|
|
21344
|
+
placeholder="Search endpoints, guides…"
|
|
21345
|
+
.value=${this._query}
|
|
21346
|
+
@input=${this._handleInput}
|
|
21347
|
+
/>
|
|
21348
|
+
<span class="esc-hint">Esc</span>
|
|
21349
|
+
</div>
|
|
21350
|
+
|
|
21351
|
+
<div class="results">
|
|
21352
|
+
${this._query.trim() === "" ? b`
|
|
21353
|
+
<div class="empty-state">Start typing to search…</div>
|
|
21354
|
+
` : this._results.length === 0 ? b`
|
|
21355
|
+
<div class="no-results">No results for "${this._query}"</div>
|
|
21356
|
+
` : this._results.map((result, i3) => this._renderResult(result, i3))}
|
|
21357
|
+
</div>
|
|
21358
|
+
</div>
|
|
21359
|
+
`;
|
|
21360
|
+
}
|
|
21361
|
+
};
|
|
21362
|
+
SlSearch.styles = [
|
|
21363
|
+
resetStyles,
|
|
21364
|
+
i$4`
|
|
21365
|
+
:host {
|
|
21366
|
+
display: block;
|
|
21367
|
+
position: fixed;
|
|
21368
|
+
inset: 0;
|
|
21369
|
+
z-index: 300;
|
|
21370
|
+
}
|
|
21371
|
+
|
|
21372
|
+
.overlay {
|
|
21373
|
+
position: absolute;
|
|
21374
|
+
inset: 0;
|
|
21375
|
+
background: var(--sl-color-overlay);
|
|
21376
|
+
animation: sl-fade-in 150ms ease;
|
|
21377
|
+
}
|
|
21378
|
+
|
|
21379
|
+
@keyframes sl-fade-in {
|
|
21380
|
+
from { opacity: 0; }
|
|
21381
|
+
to { opacity: 1; }
|
|
21382
|
+
}
|
|
21383
|
+
|
|
21384
|
+
.modal {
|
|
21385
|
+
position: absolute;
|
|
21386
|
+
top: 15%;
|
|
21387
|
+
left: 50%;
|
|
21388
|
+
transform: translateX(-50%);
|
|
21389
|
+
width: min(560px, calc(100vw - 2rem));
|
|
21390
|
+
background: var(--sl-color-surface);
|
|
21391
|
+
border-radius: var(--sl-radius-xl);
|
|
21392
|
+
box-shadow: var(--sl-shadow-xl);
|
|
21393
|
+
border: 1px solid var(--sl-color-border);
|
|
21394
|
+
overflow: hidden;
|
|
21395
|
+
animation: sl-slide-up 150ms ease;
|
|
21396
|
+
}
|
|
21397
|
+
|
|
21398
|
+
@keyframes sl-slide-up {
|
|
21399
|
+
from { opacity: 0; transform: translateX(-50%) translateY(8px); }
|
|
21400
|
+
to { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
21401
|
+
}
|
|
21402
|
+
|
|
21403
|
+
.input-wrapper {
|
|
21404
|
+
display: flex;
|
|
21405
|
+
align-items: center;
|
|
21406
|
+
gap: var(--sl-spacing-sm);
|
|
21407
|
+
padding: var(--sl-spacing-md) var(--sl-spacing-lg);
|
|
21408
|
+
border-bottom: 1px solid var(--sl-color-border);
|
|
21409
|
+
}
|
|
21410
|
+
|
|
21411
|
+
.search-icon {
|
|
21412
|
+
color: var(--sl-color-text-muted);
|
|
21413
|
+
flex-shrink: 0;
|
|
21414
|
+
}
|
|
21415
|
+
|
|
21416
|
+
input {
|
|
21417
|
+
flex: 1;
|
|
21418
|
+
border: none;
|
|
21419
|
+
background: none;
|
|
21420
|
+
color: var(--sl-color-text);
|
|
21421
|
+
font-size: var(--sl-font-size-md);
|
|
21422
|
+
outline: none;
|
|
21423
|
+
}
|
|
21424
|
+
|
|
21425
|
+
input::placeholder {
|
|
21426
|
+
color: var(--sl-color-text-muted);
|
|
21427
|
+
}
|
|
21428
|
+
|
|
21429
|
+
.esc-hint {
|
|
21430
|
+
font-size: var(--sl-font-size-xs);
|
|
21431
|
+
padding: 2px 6px;
|
|
21432
|
+
border-radius: 3px;
|
|
21433
|
+
background: var(--sl-color-surface-raised);
|
|
21434
|
+
border: 1px solid var(--sl-color-border);
|
|
21435
|
+
color: var(--sl-color-text-muted);
|
|
21436
|
+
font-family: var(--sl-font-mono);
|
|
21437
|
+
}
|
|
21438
|
+
|
|
21439
|
+
.results {
|
|
21440
|
+
max-height: 400px;
|
|
21441
|
+
overflow-y: auto;
|
|
21442
|
+
padding: var(--sl-spacing-sm) 0;
|
|
21443
|
+
}
|
|
21444
|
+
|
|
21445
|
+
.result-item {
|
|
21446
|
+
display: flex;
|
|
21447
|
+
align-items: center;
|
|
21448
|
+
gap: var(--sl-spacing-sm);
|
|
21449
|
+
padding: var(--sl-spacing-sm) var(--sl-spacing-lg);
|
|
21450
|
+
cursor: pointer;
|
|
21451
|
+
transition: background var(--sl-transition-fast);
|
|
21452
|
+
}
|
|
21453
|
+
|
|
21454
|
+
.result-item:hover,
|
|
21455
|
+
.result-item.highlighted {
|
|
21456
|
+
background: var(--sl-color-surface-raised);
|
|
21457
|
+
}
|
|
21458
|
+
|
|
21459
|
+
.method-badge {
|
|
21460
|
+
display: inline-flex;
|
|
21461
|
+
align-items: center;
|
|
21462
|
+
justify-content: center;
|
|
21463
|
+
width: 48px;
|
|
21464
|
+
min-width: 48px;
|
|
21465
|
+
padding: 2px 0;
|
|
21466
|
+
border-radius: var(--sl-radius-sm);
|
|
21467
|
+
font-size: 0.625rem;
|
|
21468
|
+
font-weight: 700;
|
|
21469
|
+
font-family: var(--sl-font-mono);
|
|
21470
|
+
text-transform: uppercase;
|
|
21471
|
+
}
|
|
21472
|
+
|
|
21473
|
+
.method-get { background: var(--sl-color-get-bg); color: var(--sl-color-get); }
|
|
21474
|
+
.method-post { background: var(--sl-color-post-bg); color: var(--sl-color-post); }
|
|
21475
|
+
.method-put { background: var(--sl-color-put-bg); color: var(--sl-color-put); }
|
|
21476
|
+
.method-delete { background: var(--sl-color-delete-bg); color: var(--sl-color-delete); }
|
|
21477
|
+
.method-patch { background: var(--sl-color-patch-bg); color: var(--sl-color-patch); }
|
|
21478
|
+
.method-options,
|
|
21479
|
+
.method-head,
|
|
21480
|
+
.method-trace { background: var(--sl-color-options-bg); color: var(--sl-color-options); }
|
|
21481
|
+
|
|
21482
|
+
.result-info {
|
|
21483
|
+
min-width: 0;
|
|
21484
|
+
flex: 1;
|
|
21485
|
+
}
|
|
21486
|
+
|
|
21487
|
+
.result-path {
|
|
21488
|
+
font-family: var(--sl-font-mono);
|
|
21489
|
+
font-size: var(--sl-font-size-sm);
|
|
21490
|
+
color: var(--sl-color-text);
|
|
21491
|
+
overflow: hidden;
|
|
21492
|
+
text-overflow: ellipsis;
|
|
21493
|
+
white-space: nowrap;
|
|
21494
|
+
}
|
|
21495
|
+
|
|
21496
|
+
.result-summary {
|
|
21497
|
+
font-size: var(--sl-font-size-xs);
|
|
21498
|
+
color: var(--sl-color-text-muted);
|
|
21499
|
+
overflow: hidden;
|
|
21500
|
+
text-overflow: ellipsis;
|
|
21501
|
+
white-space: nowrap;
|
|
21502
|
+
}
|
|
21503
|
+
|
|
21504
|
+
.no-results {
|
|
21505
|
+
text-align: center;
|
|
21506
|
+
padding: var(--sl-spacing-xl);
|
|
21507
|
+
color: var(--sl-color-text-muted);
|
|
21508
|
+
font-size: var(--sl-font-size-sm);
|
|
21509
|
+
}
|
|
21510
|
+
|
|
21511
|
+
.empty-state {
|
|
21512
|
+
text-align: center;
|
|
21513
|
+
padding: var(--sl-spacing-xl);
|
|
21514
|
+
color: var(--sl-color-text-muted);
|
|
21515
|
+
font-size: var(--sl-font-size-sm);
|
|
21516
|
+
}
|
|
21517
|
+
|
|
21518
|
+
/* ── Guide result ───────────────────── */
|
|
21519
|
+
.guide-badge {
|
|
21520
|
+
display: inline-flex;
|
|
21521
|
+
align-items: center;
|
|
21522
|
+
justify-content: center;
|
|
21523
|
+
width: 48px;
|
|
21524
|
+
min-width: 48px;
|
|
21525
|
+
padding: 2px 0;
|
|
21526
|
+
border-radius: var(--sl-radius-sm);
|
|
21527
|
+
font-size: 0.625rem;
|
|
21528
|
+
font-weight: 700;
|
|
21529
|
+
text-transform: uppercase;
|
|
21530
|
+
background: var(--sl-color-bg-subtle);
|
|
21531
|
+
color: var(--sl-color-text-muted);
|
|
21532
|
+
border: 1px solid var(--sl-color-border);
|
|
21533
|
+
}
|
|
21534
|
+
`
|
|
21535
|
+
];
|
|
21536
|
+
__decorateClass$b([
|
|
21537
|
+
n2({ type: Object })
|
|
21538
|
+
], SlSearch.prototype, "searchEngine", 2);
|
|
21539
|
+
__decorateClass$b([
|
|
21540
|
+
r$1()
|
|
21541
|
+
], SlSearch.prototype, "_query", 2);
|
|
21542
|
+
__decorateClass$b([
|
|
21543
|
+
r$1()
|
|
21544
|
+
], SlSearch.prototype, "_results", 2);
|
|
21545
|
+
__decorateClass$b([
|
|
21546
|
+
r$1()
|
|
21547
|
+
], SlSearch.prototype, "_highlightIndex", 2);
|
|
21548
|
+
__decorateClass$b([
|
|
21549
|
+
e$2("input")
|
|
21550
|
+
], SlSearch.prototype, "_input", 2);
|
|
21551
|
+
SlSearch = __decorateClass$b([
|
|
21552
|
+
t$1("sl-search")
|
|
21553
|
+
], SlSearch);
|
|
21554
|
+
var __defProp$a = Object.defineProperty;
|
|
21555
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
21556
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
21557
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
21558
|
+
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
21559
|
+
if (decorator = decorators[i3])
|
|
21560
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
21561
|
+
if (kind && result) __defProp$a(target, key, result);
|
|
20891
21562
|
return result;
|
|
20892
21563
|
};
|
|
20893
21564
|
let SlParameters = class extends i$1 {
|
|
@@ -20927,7 +21598,7 @@ let SlParameters = class extends i$1 {
|
|
|
20927
21598
|
</div>
|
|
20928
21599
|
<div class="param-type">${this._getType(param.schema)}</div>
|
|
20929
21600
|
<div>
|
|
20930
|
-
<div class="param-desc"
|
|
21601
|
+
<div class="param-desc" .innerHTML=${marked.parse(param.description || "")}></div>
|
|
20931
21602
|
${param.example !== void 0 ? b`
|
|
20932
21603
|
<div class="param-example">Example: <code>${JSON.stringify(param.example)}</code></div>
|
|
20933
21604
|
` : null}
|
|
@@ -21016,47 +21687,152 @@ SlParameters.styles = [
|
|
|
21016
21687
|
line-height: 1.5;
|
|
21017
21688
|
}
|
|
21018
21689
|
|
|
21019
|
-
.param-
|
|
21020
|
-
|
|
21021
|
-
color: var(--sl-color-text-muted);
|
|
21022
|
-
margin-top: 2px;
|
|
21690
|
+
.param-desc p {
|
|
21691
|
+
margin: 0 0 var(--sl-spacing-xs) 0;
|
|
21023
21692
|
}
|
|
21024
21693
|
|
|
21025
|
-
.param-
|
|
21694
|
+
.param-desc p:last-child {
|
|
21695
|
+
margin-bottom: 0;
|
|
21696
|
+
}
|
|
21697
|
+
|
|
21698
|
+
.param-desc code {
|
|
21026
21699
|
background: var(--sl-color-code-bg);
|
|
21027
|
-
padding: 1px
|
|
21700
|
+
padding: 1px 5px;
|
|
21028
21701
|
border-radius: var(--sl-radius-sm);
|
|
21029
|
-
font-size:
|
|
21702
|
+
font-size: 0.85em;
|
|
21703
|
+
border: 1px solid var(--sl-color-border);
|
|
21030
21704
|
}
|
|
21031
21705
|
|
|
21032
|
-
.param-
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21706
|
+
.param-desc pre {
|
|
21707
|
+
background: #0d1117;
|
|
21708
|
+
border: 1px solid #30363d;
|
|
21709
|
+
border-radius: var(--sl-radius-md);
|
|
21710
|
+
padding: var(--sl-spacing-sm) var(--sl-spacing-md);
|
|
21711
|
+
overflow-x: auto;
|
|
21712
|
+
margin: var(--sl-spacing-xs) 0;
|
|
21037
21713
|
}
|
|
21038
21714
|
|
|
21039
|
-
.
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
padding:
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
color: var(--sl-color-text-secondary);
|
|
21715
|
+
.param-desc pre code {
|
|
21716
|
+
background: none;
|
|
21717
|
+
border: none;
|
|
21718
|
+
padding: 0;
|
|
21719
|
+
color: #e6edf3;
|
|
21720
|
+
font-size: var(--sl-font-size-xs);
|
|
21046
21721
|
}
|
|
21047
21722
|
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
|
|
21723
|
+
.param-desc table {
|
|
21724
|
+
width: 100%;
|
|
21725
|
+
border-collapse: separate;
|
|
21726
|
+
border-spacing: 0;
|
|
21727
|
+
border: 1px solid var(--sl-color-border);
|
|
21728
|
+
border-radius: var(--sl-radius-md);
|
|
21729
|
+
overflow: hidden;
|
|
21730
|
+
font-size: var(--sl-font-size-xs);
|
|
21731
|
+
margin: var(--sl-spacing-xs) 0;
|
|
21732
|
+
}
|
|
21733
|
+
|
|
21734
|
+
.param-desc th,
|
|
21735
|
+
.param-desc td {
|
|
21736
|
+
padding: var(--sl-spacing-xs) var(--sl-spacing-sm);
|
|
21737
|
+
text-align: left;
|
|
21738
|
+
border-bottom: 1px solid var(--sl-color-border);
|
|
21739
|
+
}
|
|
21740
|
+
|
|
21741
|
+
.param-desc th {
|
|
21742
|
+
background: var(--sl-color-bg-subtle);
|
|
21743
|
+
font-weight: 600;
|
|
21744
|
+
border-bottom-width: 2px;
|
|
21745
|
+
}
|
|
21746
|
+
|
|
21747
|
+
.param-desc tr:last-child td {
|
|
21748
|
+
border-bottom: none;
|
|
21749
|
+
}
|
|
21750
|
+
|
|
21751
|
+
.param-desc blockquote {
|
|
21752
|
+
border-left: 3px solid var(--sl-color-primary);
|
|
21753
|
+
background: rgba(99,102,241,0.05);
|
|
21754
|
+
padding: var(--sl-spacing-xs) var(--sl-spacing-sm);
|
|
21755
|
+
margin: var(--sl-spacing-xs) 0;
|
|
21756
|
+
border-radius: 0 var(--sl-radius-sm) var(--sl-radius-sm) 0;
|
|
21757
|
+
}
|
|
21758
|
+
|
|
21759
|
+
.param-desc ul,
|
|
21760
|
+
.param-desc ol {
|
|
21761
|
+
padding-left: var(--sl-spacing-lg);
|
|
21762
|
+
margin: var(--sl-spacing-xs) 0;
|
|
21763
|
+
}
|
|
21764
|
+
|
|
21765
|
+
.param-desc li {
|
|
21766
|
+
margin-bottom: 2px;
|
|
21767
|
+
}
|
|
21768
|
+
|
|
21769
|
+
.param-desc a {
|
|
21770
|
+
color: var(--sl-color-primary);
|
|
21771
|
+
text-decoration: none;
|
|
21772
|
+
}
|
|
21773
|
+
|
|
21774
|
+
.param-desc a:hover {
|
|
21775
|
+
text-decoration: underline;
|
|
21776
|
+
}
|
|
21777
|
+
|
|
21778
|
+
.param-desc h1,
|
|
21779
|
+
.param-desc h2,
|
|
21780
|
+
.param-desc h3,
|
|
21781
|
+
.param-desc h4,
|
|
21782
|
+
.param-desc h5,
|
|
21783
|
+
.param-desc h6 {
|
|
21784
|
+
margin: var(--sl-spacing-xs) 0 2px 0;
|
|
21785
|
+
font-weight: 600;
|
|
21786
|
+
line-height: 1.3;
|
|
21787
|
+
color: var(--sl-color-text);
|
|
21788
|
+
}
|
|
21789
|
+
|
|
21790
|
+
.param-desc h3 { font-size: 0.95em; }
|
|
21791
|
+
.param-desc h4 { font-size: 0.9em; }
|
|
21792
|
+
.param-desc h5,
|
|
21793
|
+
.param-desc h6 { font-size: 0.85em; }
|
|
21794
|
+
|
|
21795
|
+
.param-example {
|
|
21796
|
+
font-size: var(--sl-font-size-xs);
|
|
21797
|
+
color: var(--sl-color-text-muted);
|
|
21798
|
+
margin-top: 2px;
|
|
21799
|
+
}
|
|
21800
|
+
|
|
21801
|
+
.param-example code {
|
|
21802
|
+
background: var(--sl-color-code-bg);
|
|
21803
|
+
padding: 1px 4px;
|
|
21804
|
+
border-radius: var(--sl-radius-sm);
|
|
21805
|
+
font-size: var(--sl-font-size-xs);
|
|
21806
|
+
}
|
|
21807
|
+
|
|
21808
|
+
.param-enum {
|
|
21809
|
+
display: flex;
|
|
21810
|
+
flex-wrap: wrap;
|
|
21811
|
+
gap: 4px;
|
|
21812
|
+
margin-top: 4px;
|
|
21813
|
+
}
|
|
21814
|
+
|
|
21815
|
+
.enum-value {
|
|
21816
|
+
font-family: var(--sl-font-mono);
|
|
21817
|
+
font-size: 0.6875rem;
|
|
21818
|
+
padding: 1px 6px;
|
|
21819
|
+
border-radius: var(--sl-radius-sm);
|
|
21820
|
+
background: var(--sl-color-surface-raised);
|
|
21821
|
+
color: var(--sl-color-text-secondary);
|
|
21822
|
+
}
|
|
21823
|
+
|
|
21824
|
+
@media (max-width: 768px) {
|
|
21825
|
+
.param-row {
|
|
21826
|
+
grid-template-columns: 1fr;
|
|
21827
|
+
gap: var(--sl-spacing-xs);
|
|
21828
|
+
}
|
|
21829
|
+
}
|
|
21830
|
+
`
|
|
21831
|
+
];
|
|
21832
|
+
__decorateClass$a([
|
|
21057
21833
|
n2({ type: Array })
|
|
21058
21834
|
], SlParameters.prototype, "parameters", 2);
|
|
21059
|
-
SlParameters = __decorateClass$
|
|
21835
|
+
SlParameters = __decorateClass$a([
|
|
21060
21836
|
t$1("sl-parameters")
|
|
21061
21837
|
], SlParameters);
|
|
21062
21838
|
const SKIP_SYMBOL = Symbol("skip");
|
|
@@ -23249,14 +24025,14 @@ _registerSampler("integer", sampleNumber);
|
|
|
23249
24025
|
_registerSampler("number", sampleNumber);
|
|
23250
24026
|
_registerSampler("object", sampleObject);
|
|
23251
24027
|
_registerSampler("string", sampleString);
|
|
23252
|
-
var __defProp$
|
|
23253
|
-
var __getOwnPropDesc$
|
|
23254
|
-
var __decorateClass$
|
|
23255
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
24028
|
+
var __defProp$9 = Object.defineProperty;
|
|
24029
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
24030
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
24031
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
23256
24032
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
23257
24033
|
if (decorator = decorators[i3])
|
|
23258
24034
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23259
|
-
if (kind && result) __defProp$
|
|
24035
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
23260
24036
|
return result;
|
|
23261
24037
|
};
|
|
23262
24038
|
let SlRequestBody = class extends i$1 {
|
|
@@ -23411,13 +24187,13 @@ SlRequestBody.styles = [
|
|
|
23411
24187
|
}
|
|
23412
24188
|
`
|
|
23413
24189
|
];
|
|
23414
|
-
__decorateClass$
|
|
24190
|
+
__decorateClass$9([
|
|
23415
24191
|
n2({ type: Object })
|
|
23416
24192
|
], SlRequestBody.prototype, "requestBody", 2);
|
|
23417
|
-
__decorateClass$
|
|
24193
|
+
__decorateClass$9([
|
|
23418
24194
|
r$1()
|
|
23419
24195
|
], SlRequestBody.prototype, "_activeMediaType", 2);
|
|
23420
|
-
SlRequestBody = __decorateClass$
|
|
24196
|
+
SlRequestBody = __decorateClass$9([
|
|
23421
24197
|
t$1("sl-request-body")
|
|
23422
24198
|
], SlRequestBody);
|
|
23423
24199
|
/**
|
|
@@ -23463,14 +24239,14 @@ class e extends i2 {
|
|
|
23463
24239
|
}
|
|
23464
24240
|
e.directiveName = "unsafeHTML", e.resultType = 1;
|
|
23465
24241
|
const o = e$1(e);
|
|
23466
|
-
var __defProp$
|
|
23467
|
-
var __getOwnPropDesc$
|
|
23468
|
-
var __decorateClass$
|
|
23469
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
24242
|
+
var __defProp$8 = Object.defineProperty;
|
|
24243
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
24244
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
24245
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
23470
24246
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
23471
24247
|
if (decorator = decorators[i3])
|
|
23472
24248
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23473
|
-
if (kind && result) __defProp$
|
|
24249
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
23474
24250
|
return result;
|
|
23475
24251
|
};
|
|
23476
24252
|
let SlResponses = class extends i$1 {
|
|
@@ -23726,13 +24502,13 @@ SlResponses.styles = [
|
|
|
23726
24502
|
.hl-kw { color: #569cd6; }
|
|
23727
24503
|
`
|
|
23728
24504
|
];
|
|
23729
|
-
__decorateClass$
|
|
24505
|
+
__decorateClass$8([
|
|
23730
24506
|
n2({ type: Array })
|
|
23731
24507
|
], SlResponses.prototype, "responses", 2);
|
|
23732
|
-
__decorateClass$
|
|
24508
|
+
__decorateClass$8([
|
|
23733
24509
|
r$1()
|
|
23734
24510
|
], SlResponses.prototype, "_activeTab", 2);
|
|
23735
|
-
SlResponses = __decorateClass$
|
|
24511
|
+
SlResponses = __decorateClass$8([
|
|
23736
24512
|
t$1("sl-responses")
|
|
23737
24513
|
], SlResponses);
|
|
23738
24514
|
const globalObject = (function() {
|
|
@@ -27309,14 +28085,14 @@ class HTTPSnippet {
|
|
|
27309
28085
|
return results.length === 1 ? results[0] : results;
|
|
27310
28086
|
}
|
|
27311
28087
|
}
|
|
27312
|
-
var __defProp$
|
|
27313
|
-
var __getOwnPropDesc$
|
|
27314
|
-
var __decorateClass$
|
|
27315
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
28088
|
+
var __defProp$7 = Object.defineProperty;
|
|
28089
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
28090
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
28091
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
27316
28092
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
27317
28093
|
if (decorator = decorators[i3])
|
|
27318
28094
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
27319
|
-
if (kind && result) __defProp$
|
|
28095
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
27320
28096
|
return result;
|
|
27321
28097
|
};
|
|
27322
28098
|
const LANGUAGES = [
|
|
@@ -28118,44 +28894,44 @@ SlCodeSamples.styles = [
|
|
|
28118
28894
|
.hl-key { color: #9cdcfe; }
|
|
28119
28895
|
`
|
|
28120
28896
|
];
|
|
28121
|
-
__decorateClass$
|
|
28897
|
+
__decorateClass$7([
|
|
28122
28898
|
n2({ type: Object })
|
|
28123
28899
|
], SlCodeSamples.prototype, "operation", 2);
|
|
28124
|
-
__decorateClass$
|
|
28900
|
+
__decorateClass$7([
|
|
28125
28901
|
n2({ type: Array })
|
|
28126
28902
|
], SlCodeSamples.prototype, "servers", 2);
|
|
28127
|
-
__decorateClass$
|
|
28903
|
+
__decorateClass$7([
|
|
28128
28904
|
n2({ type: Object })
|
|
28129
28905
|
], SlCodeSamples.prototype, "authState", 2);
|
|
28130
|
-
__decorateClass$
|
|
28906
|
+
__decorateClass$7([
|
|
28131
28907
|
n2({ type: Array })
|
|
28132
28908
|
], SlCodeSamples.prototype, "securitySchemes", 2);
|
|
28133
|
-
__decorateClass$
|
|
28909
|
+
__decorateClass$7([
|
|
28134
28910
|
r$1()
|
|
28135
28911
|
], SlCodeSamples.prototype, "_activeTab", 2);
|
|
28136
|
-
__decorateClass$
|
|
28912
|
+
__decorateClass$7([
|
|
28137
28913
|
r$1()
|
|
28138
28914
|
], SlCodeSamples.prototype, "_snippets", 2);
|
|
28139
|
-
__decorateClass$
|
|
28915
|
+
__decorateClass$7([
|
|
28140
28916
|
r$1()
|
|
28141
28917
|
], SlCodeSamples.prototype, "_copied", 2);
|
|
28142
|
-
__decorateClass$
|
|
28918
|
+
__decorateClass$7([
|
|
28143
28919
|
r$1()
|
|
28144
28920
|
], SlCodeSamples.prototype, "_overflowStart", 2);
|
|
28145
|
-
__decorateClass$
|
|
28921
|
+
__decorateClass$7([
|
|
28146
28922
|
r$1()
|
|
28147
28923
|
], SlCodeSamples.prototype, "_moreOpen", 2);
|
|
28148
|
-
SlCodeSamples = __decorateClass$
|
|
28924
|
+
SlCodeSamples = __decorateClass$7([
|
|
28149
28925
|
t$1("sl-code-samples")
|
|
28150
28926
|
], SlCodeSamples);
|
|
28151
|
-
var __defProp$
|
|
28152
|
-
var __getOwnPropDesc$
|
|
28153
|
-
var __decorateClass$
|
|
28154
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
28927
|
+
var __defProp$6 = Object.defineProperty;
|
|
28928
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
28929
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
28930
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
28155
28931
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
28156
28932
|
if (decorator = decorators[i3])
|
|
28157
28933
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
28158
|
-
if (kind && result) __defProp$
|
|
28934
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
28159
28935
|
return result;
|
|
28160
28936
|
};
|
|
28161
28937
|
let SlSchema = class extends i$1 {
|
|
@@ -28465,26 +29241,26 @@ SlSchema.styles = [
|
|
|
28465
29241
|
}
|
|
28466
29242
|
`
|
|
28467
29243
|
];
|
|
28468
|
-
__decorateClass$
|
|
29244
|
+
__decorateClass$6([
|
|
28469
29245
|
n2({ type: Object })
|
|
28470
29246
|
], SlSchema.prototype, "schema", 2);
|
|
28471
|
-
__decorateClass$
|
|
29247
|
+
__decorateClass$6([
|
|
28472
29248
|
n2({ type: Number })
|
|
28473
29249
|
], SlSchema.prototype, "depth", 2);
|
|
28474
|
-
__decorateClass$
|
|
29250
|
+
__decorateClass$6([
|
|
28475
29251
|
r$1()
|
|
28476
29252
|
], SlSchema.prototype, "_expanded", 2);
|
|
28477
|
-
SlSchema = __decorateClass$
|
|
29253
|
+
SlSchema = __decorateClass$6([
|
|
28478
29254
|
t$1("sl-schema")
|
|
28479
29255
|
], SlSchema);
|
|
28480
|
-
var __defProp$
|
|
28481
|
-
var __getOwnPropDesc$
|
|
28482
|
-
var __decorateClass$
|
|
28483
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
29256
|
+
var __defProp$5 = Object.defineProperty;
|
|
29257
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
29258
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
29259
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
28484
29260
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
28485
29261
|
if (decorator = decorators[i3])
|
|
28486
29262
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
28487
|
-
if (kind && result) __defProp$
|
|
29263
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
28488
29264
|
return result;
|
|
28489
29265
|
};
|
|
28490
29266
|
let SlOperation = class extends i$1 {
|
|
@@ -28496,8 +29272,12 @@ let SlOperation = class extends i$1 {
|
|
|
28496
29272
|
this.proxyUrl = "";
|
|
28497
29273
|
this.hideTryIt = false;
|
|
28498
29274
|
this.hideCodeSamples = false;
|
|
29275
|
+
this.hideAskAi = false;
|
|
28499
29276
|
this.activeOperationId = "";
|
|
28500
29277
|
this._expanded = false;
|
|
29278
|
+
this._routeCopied = false;
|
|
29279
|
+
this._aiMenuOpen = false;
|
|
29280
|
+
this._aiMenuRect = null;
|
|
28501
29281
|
}
|
|
28502
29282
|
willUpdate(changed) {
|
|
28503
29283
|
var _a2;
|
|
@@ -28523,6 +29303,40 @@ let SlOperation = class extends i$1 {
|
|
|
28523
29303
|
composed: true
|
|
28524
29304
|
}));
|
|
28525
29305
|
}
|
|
29306
|
+
_copyRoute(e2) {
|
|
29307
|
+
e2.stopPropagation();
|
|
29308
|
+
navigator.clipboard.writeText(this.operation.path);
|
|
29309
|
+
this._routeCopied = true;
|
|
29310
|
+
setTimeout(() => {
|
|
29311
|
+
this._routeCopied = false;
|
|
29312
|
+
}, 1500);
|
|
29313
|
+
}
|
|
29314
|
+
_toggleAiMenu(e2) {
|
|
29315
|
+
e2.stopPropagation();
|
|
29316
|
+
if (!this._aiMenuOpen) {
|
|
29317
|
+
this._aiMenuRect = e2.currentTarget.getBoundingClientRect();
|
|
29318
|
+
}
|
|
29319
|
+
this._aiMenuOpen = !this._aiMenuOpen;
|
|
29320
|
+
if (this._aiMenuOpen) {
|
|
29321
|
+
const close = (ev) => {
|
|
29322
|
+
const path2 = ev.composedPath();
|
|
29323
|
+
const wrapper = this.renderRoot.querySelector(".ask-ai-wrapper");
|
|
29324
|
+
const menu = this.renderRoot.querySelector(".ai-menu");
|
|
29325
|
+
if (!path2.includes(wrapper) && !path2.includes(menu)) {
|
|
29326
|
+
this._aiMenuOpen = false;
|
|
29327
|
+
document.removeEventListener("click", close, true);
|
|
29328
|
+
}
|
|
29329
|
+
};
|
|
29330
|
+
requestAnimationFrame(() => document.addEventListener("click", close, true));
|
|
29331
|
+
}
|
|
29332
|
+
}
|
|
29333
|
+
_openAi(target, e2) {
|
|
29334
|
+
e2.stopPropagation();
|
|
29335
|
+
this._aiMenuOpen = false;
|
|
29336
|
+
const prompt = generateAiPrompt(this.operation);
|
|
29337
|
+
const url2 = buildAiUrl(prompt, target);
|
|
29338
|
+
window.open(url2, "_blank", "noopener,noreferrer");
|
|
29339
|
+
}
|
|
28526
29340
|
render() {
|
|
28527
29341
|
const op = this.operation;
|
|
28528
29342
|
if (!op) return b``;
|
|
@@ -28531,8 +29345,30 @@ let SlOperation = class extends i$1 {
|
|
|
28531
29345
|
<div class="op-header" @click=${this._toggle}>
|
|
28532
29346
|
<span class="method-badge method-${op.method}">${op.method}</span>
|
|
28533
29347
|
<span class="op-path">${op.path}</span>
|
|
29348
|
+
<button class="copy-route-btn" style=${this._routeCopied ? "opacity:1" : ""} @click=${this._copyRoute} title="Copy route path">
|
|
29349
|
+
${this._routeCopied ? b`
|
|
29350
|
+
<svg class="copied-check" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2">
|
|
29351
|
+
<path d="M3 8.5l3.5 3.5 6.5-7" stroke-linecap="round" stroke-linejoin="round"/>
|
|
29352
|
+
</svg>
|
|
29353
|
+
` : b`
|
|
29354
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
29355
|
+
<rect x="5" y="5" width="8" height="8" rx="1"/>
|
|
29356
|
+
<path d="M3 11V3h8"/>
|
|
29357
|
+
</svg>
|
|
29358
|
+
`}
|
|
29359
|
+
</button>
|
|
28534
29360
|
<span class="op-summary">${op.summary}</span>
|
|
28535
29361
|
${op.deprecated ? b`<span class="badge-deprecated">Deprecated</span>` : null}
|
|
29362
|
+
${!this.hideAskAi ? b`
|
|
29363
|
+
<div class="ask-ai-wrapper" style=${this._aiMenuOpen ? "opacity:1" : ""}>
|
|
29364
|
+
<button class="ask-ai-btn" @click=${this._toggleAiMenu}>
|
|
29365
|
+
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
|
|
29366
|
+
<path d="M8 1l1.5 3.5L13 6l-3.5 1.5L8 11 6.5 7.5 3 6l3.5-1.5L8 1zM3 11l.75 1.75L5.5 13.5l-1.75.75L3 16l-.75-1.75L.5 13.5l1.75-.75L3 11zM12.5 10l.75 1.75 1.75.75-1.75.75-.75 1.75-.75-1.75L10 12.5l1.75-.75.75-1.75z"/>
|
|
29367
|
+
</svg>
|
|
29368
|
+
Ask AI
|
|
29369
|
+
</button>
|
|
29370
|
+
</div>
|
|
29371
|
+
` : null}
|
|
28536
29372
|
${!this.hideTryIt ? b`
|
|
28537
29373
|
<button class="try-it-btn" @click=${this._openTryIt}>
|
|
28538
29374
|
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
|
|
@@ -28611,6 +29447,22 @@ let SlOperation = class extends i$1 {
|
|
|
28611
29447
|
</div>
|
|
28612
29448
|
` : null}
|
|
28613
29449
|
</div>
|
|
29450
|
+
${this._aiMenuOpen && this._aiMenuRect ? b`
|
|
29451
|
+
<div class="ai-menu" style="top:${this._aiMenuRect.bottom + 4}px;right:${window.innerWidth - this._aiMenuRect.right}px">
|
|
29452
|
+
<button class="ai-menu-item" @click=${(e2) => this._openAi("chatgpt", e2)}>
|
|
29453
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
29454
|
+
<path d="M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.677l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.612-1.5z"/>
|
|
29455
|
+
</svg>
|
|
29456
|
+
ChatGPT
|
|
29457
|
+
</button>
|
|
29458
|
+
<button class="ai-menu-item" @click=${(e2) => this._openAi("claude", e2)}>
|
|
29459
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
29460
|
+
<path d="M13.827 3.52h-3.654L5 20.48h3.213l1.436-4.115h4.847l1.367 4.115H19L13.827 3.52zm-3.192 10.6 1.85-5.3 1.744 5.3h-3.594z"/>
|
|
29461
|
+
</svg>
|
|
29462
|
+
Claude
|
|
29463
|
+
</button>
|
|
29464
|
+
</div>
|
|
29465
|
+
` : null}
|
|
28614
29466
|
`;
|
|
28615
29467
|
}
|
|
28616
29468
|
};
|
|
@@ -28847,69 +29699,178 @@ SlOperation.styles = [
|
|
|
28847
29699
|
color: var(--sl-color-text);
|
|
28848
29700
|
}
|
|
28849
29701
|
|
|
28850
|
-
|
|
28851
|
-
|
|
28852
|
-
|
|
28853
|
-
|
|
28854
|
-
|
|
28855
|
-
|
|
28856
|
-
|
|
28857
|
-
|
|
28858
|
-
|
|
28859
|
-
|
|
28860
|
-
}
|
|
29702
|
+
/* ── Copy Route Button ───────────────── */
|
|
29703
|
+
.copy-route-btn {
|
|
29704
|
+
padding: 4px 6px;
|
|
29705
|
+
border-radius: var(--sl-radius-sm);
|
|
29706
|
+
color: var(--sl-color-text-muted);
|
|
29707
|
+
opacity: 0;
|
|
29708
|
+
transition: opacity var(--sl-transition-fast);
|
|
29709
|
+
flex-shrink: 0;
|
|
29710
|
+
display: inline-flex;
|
|
29711
|
+
align-items: center;
|
|
28861
29712
|
}
|
|
28862
|
-
|
|
28863
|
-
|
|
28864
|
-
|
|
28865
|
-
|
|
28866
|
-
|
|
28867
|
-
|
|
28868
|
-
|
|
28869
|
-
|
|
28870
|
-
|
|
28871
|
-
|
|
28872
|
-
|
|
28873
|
-
|
|
28874
|
-
|
|
28875
|
-
|
|
28876
|
-
|
|
28877
|
-
|
|
28878
|
-
|
|
28879
|
-
|
|
28880
|
-
|
|
28881
|
-
|
|
28882
|
-
|
|
28883
|
-
|
|
28884
|
-
|
|
28885
|
-
|
|
28886
|
-
|
|
28887
|
-
|
|
28888
|
-
|
|
28889
|
-
|
|
28890
|
-
|
|
28891
|
-
|
|
28892
|
-
|
|
28893
|
-
|
|
28894
|
-
|
|
28895
|
-
var
|
|
28896
|
-
|
|
28897
|
-
|
|
28898
|
-
|
|
28899
|
-
|
|
28900
|
-
|
|
28901
|
-
|
|
28902
|
-
|
|
28903
|
-
|
|
28904
|
-
|
|
28905
|
-
|
|
28906
|
-
|
|
28907
|
-
|
|
28908
|
-
|
|
28909
|
-
|
|
28910
|
-
|
|
28911
|
-
|
|
28912
|
-
|
|
29713
|
+
|
|
29714
|
+
.op-header:hover .copy-route-btn {
|
|
29715
|
+
opacity: 1;
|
|
29716
|
+
}
|
|
29717
|
+
|
|
29718
|
+
.copy-route-btn:hover {
|
|
29719
|
+
background: var(--sl-color-surface-raised);
|
|
29720
|
+
color: var(--sl-color-text);
|
|
29721
|
+
}
|
|
29722
|
+
|
|
29723
|
+
.copy-route-btn .copied-check {
|
|
29724
|
+
color: var(--sl-color-success, #22c55e);
|
|
29725
|
+
}
|
|
29726
|
+
|
|
29727
|
+
/* ── Ask AI Button ───────────────────── */
|
|
29728
|
+
.ask-ai-wrapper {
|
|
29729
|
+
flex-shrink: 0;
|
|
29730
|
+
opacity: 0;
|
|
29731
|
+
transition: opacity var(--sl-transition-fast);
|
|
29732
|
+
}
|
|
29733
|
+
|
|
29734
|
+
.op-header:hover .ask-ai-wrapper {
|
|
29735
|
+
opacity: 1;
|
|
29736
|
+
}
|
|
29737
|
+
|
|
29738
|
+
.ask-ai-btn {
|
|
29739
|
+
display: inline-flex;
|
|
29740
|
+
align-items: center;
|
|
29741
|
+
gap: 5px;
|
|
29742
|
+
padding: 4px 12px;
|
|
29743
|
+
border-radius: var(--sl-radius-md);
|
|
29744
|
+
font-size: var(--sl-font-size-xs);
|
|
29745
|
+
font-weight: 600;
|
|
29746
|
+
color: var(--sl-color-text-muted);
|
|
29747
|
+
border: 1px solid var(--sl-color-border);
|
|
29748
|
+
background: transparent;
|
|
29749
|
+
cursor: pointer;
|
|
29750
|
+
transition: all var(--sl-transition-fast);
|
|
29751
|
+
white-space: nowrap;
|
|
29752
|
+
}
|
|
29753
|
+
|
|
29754
|
+
.ask-ai-btn:hover {
|
|
29755
|
+
background: var(--sl-color-surface-raised);
|
|
29756
|
+
color: var(--sl-color-text);
|
|
29757
|
+
border-color: var(--sl-color-text-muted);
|
|
29758
|
+
}
|
|
29759
|
+
|
|
29760
|
+
.ai-menu {
|
|
29761
|
+
position: fixed;
|
|
29762
|
+
z-index: 9999;
|
|
29763
|
+
min-width: 150px;
|
|
29764
|
+
background: var(--sl-color-surface);
|
|
29765
|
+
border: 1px solid var(--sl-color-border);
|
|
29766
|
+
border-radius: var(--sl-radius-md);
|
|
29767
|
+
box-shadow: var(--sl-shadow-md);
|
|
29768
|
+
padding: 4px 0;
|
|
29769
|
+
animation: sl-menu-in 120ms ease;
|
|
29770
|
+
}
|
|
29771
|
+
|
|
29772
|
+
@keyframes sl-menu-in {
|
|
29773
|
+
from { opacity: 0; transform: translateY(-4px); }
|
|
29774
|
+
to { opacity: 1; transform: translateY(0); }
|
|
29775
|
+
}
|
|
29776
|
+
|
|
29777
|
+
.ai-menu-item {
|
|
29778
|
+
display: flex;
|
|
29779
|
+
align-items: center;
|
|
29780
|
+
gap: 8px;
|
|
29781
|
+
width: 100%;
|
|
29782
|
+
padding: 8px 14px;
|
|
29783
|
+
font-size: var(--sl-font-size-sm);
|
|
29784
|
+
color: var(--sl-color-text);
|
|
29785
|
+
cursor: pointer;
|
|
29786
|
+
transition: background var(--sl-transition-fast);
|
|
29787
|
+
white-space: nowrap;
|
|
29788
|
+
text-align: left;
|
|
29789
|
+
}
|
|
29790
|
+
|
|
29791
|
+
.ai-menu-item:hover {
|
|
29792
|
+
background: var(--sl-color-bg-subtle);
|
|
29793
|
+
}
|
|
29794
|
+
|
|
29795
|
+
.ai-menu-item svg {
|
|
29796
|
+
flex-shrink: 0;
|
|
29797
|
+
}
|
|
29798
|
+
|
|
29799
|
+
@media (max-width: 900px) {
|
|
29800
|
+
.op-body {
|
|
29801
|
+
grid-template-columns: 1fr;
|
|
29802
|
+
}
|
|
29803
|
+
.op-code-panel {
|
|
29804
|
+
border-left: none;
|
|
29805
|
+
border-top: 1px solid var(--sl-color-border);
|
|
29806
|
+
}
|
|
29807
|
+
.op-code-sticky {
|
|
29808
|
+
position: static;
|
|
29809
|
+
}
|
|
29810
|
+
}
|
|
29811
|
+
`
|
|
29812
|
+
];
|
|
29813
|
+
__decorateClass$5([
|
|
29814
|
+
n2({ type: Object })
|
|
29815
|
+
], SlOperation.prototype, "operation", 2);
|
|
29816
|
+
__decorateClass$5([
|
|
29817
|
+
n2({ type: Array })
|
|
29818
|
+
], SlOperation.prototype, "servers", 2);
|
|
29819
|
+
__decorateClass$5([
|
|
29820
|
+
n2({ type: Array })
|
|
29821
|
+
], SlOperation.prototype, "securitySchemes", 2);
|
|
29822
|
+
__decorateClass$5([
|
|
29823
|
+
n2({ type: Object })
|
|
29824
|
+
], SlOperation.prototype, "authState", 2);
|
|
29825
|
+
__decorateClass$5([
|
|
29826
|
+
n2({ type: String })
|
|
29827
|
+
], SlOperation.prototype, "proxyUrl", 2);
|
|
29828
|
+
__decorateClass$5([
|
|
29829
|
+
n2({ type: Boolean, attribute: "hide-try-it" })
|
|
29830
|
+
], SlOperation.prototype, "hideTryIt", 2);
|
|
29831
|
+
__decorateClass$5([
|
|
29832
|
+
n2({ type: Boolean, attribute: "hide-code-samples" })
|
|
29833
|
+
], SlOperation.prototype, "hideCodeSamples", 2);
|
|
29834
|
+
__decorateClass$5([
|
|
29835
|
+
n2({ type: Boolean, attribute: "hide-ask-ai" })
|
|
29836
|
+
], SlOperation.prototype, "hideAskAi", 2);
|
|
29837
|
+
__decorateClass$5([
|
|
29838
|
+
n2({ type: String })
|
|
29839
|
+
], SlOperation.prototype, "activeOperationId", 2);
|
|
29840
|
+
__decorateClass$5([
|
|
29841
|
+
r$1()
|
|
29842
|
+
], SlOperation.prototype, "_expanded", 2);
|
|
29843
|
+
__decorateClass$5([
|
|
29844
|
+
r$1()
|
|
29845
|
+
], SlOperation.prototype, "_routeCopied", 2);
|
|
29846
|
+
__decorateClass$5([
|
|
29847
|
+
r$1()
|
|
29848
|
+
], SlOperation.prototype, "_aiMenuOpen", 2);
|
|
29849
|
+
__decorateClass$5([
|
|
29850
|
+
r$1()
|
|
29851
|
+
], SlOperation.prototype, "_aiMenuRect", 2);
|
|
29852
|
+
SlOperation = __decorateClass$5([
|
|
29853
|
+
t$1("sl-operation")
|
|
29854
|
+
], SlOperation);
|
|
29855
|
+
var __defProp$4 = Object.defineProperty;
|
|
29856
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
29857
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
29858
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
29859
|
+
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
29860
|
+
if (decorator = decorators[i3])
|
|
29861
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
29862
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
29863
|
+
return result;
|
|
29864
|
+
};
|
|
29865
|
+
let SlTryIt = class extends i$1 {
|
|
29866
|
+
constructor() {
|
|
29867
|
+
super(...arguments);
|
|
29868
|
+
this.servers = [];
|
|
29869
|
+
this.securitySchemes = [];
|
|
29870
|
+
this.authState = { apiKeys: {}, bearerTokens: {} };
|
|
29871
|
+
this.proxyUrl = "";
|
|
29872
|
+
this._paramValues = {};
|
|
29873
|
+
this._bodyValue = "";
|
|
28913
29874
|
this._formFields = {};
|
|
28914
29875
|
this._selectedServer = 0;
|
|
28915
29876
|
this._response = null;
|
|
@@ -29531,59 +30492,59 @@ SlTryIt.styles = [
|
|
|
29531
30492
|
}
|
|
29532
30493
|
`
|
|
29533
30494
|
];
|
|
29534
|
-
__decorateClass$
|
|
30495
|
+
__decorateClass$4([
|
|
29535
30496
|
n2({ type: Object })
|
|
29536
30497
|
], SlTryIt.prototype, "operation", 2);
|
|
29537
|
-
__decorateClass$
|
|
30498
|
+
__decorateClass$4([
|
|
29538
30499
|
n2({ type: Array })
|
|
29539
30500
|
], SlTryIt.prototype, "servers", 2);
|
|
29540
|
-
__decorateClass$
|
|
30501
|
+
__decorateClass$4([
|
|
29541
30502
|
n2({ type: Array })
|
|
29542
30503
|
], SlTryIt.prototype, "securitySchemes", 2);
|
|
29543
|
-
__decorateClass$
|
|
30504
|
+
__decorateClass$4([
|
|
29544
30505
|
n2({ type: Object })
|
|
29545
30506
|
], SlTryIt.prototype, "authState", 2);
|
|
29546
|
-
__decorateClass$
|
|
30507
|
+
__decorateClass$4([
|
|
29547
30508
|
n2({ type: String })
|
|
29548
30509
|
], SlTryIt.prototype, "proxyUrl", 2);
|
|
29549
|
-
__decorateClass$
|
|
30510
|
+
__decorateClass$4([
|
|
29550
30511
|
r$1()
|
|
29551
30512
|
], SlTryIt.prototype, "_paramValues", 2);
|
|
29552
|
-
__decorateClass$
|
|
30513
|
+
__decorateClass$4([
|
|
29553
30514
|
r$1()
|
|
29554
30515
|
], SlTryIt.prototype, "_bodyValue", 2);
|
|
29555
|
-
__decorateClass$
|
|
30516
|
+
__decorateClass$4([
|
|
29556
30517
|
r$1()
|
|
29557
30518
|
], SlTryIt.prototype, "_formFields", 2);
|
|
29558
|
-
__decorateClass$
|
|
30519
|
+
__decorateClass$4([
|
|
29559
30520
|
r$1()
|
|
29560
30521
|
], SlTryIt.prototype, "_selectedServer", 2);
|
|
29561
|
-
__decorateClass$
|
|
30522
|
+
__decorateClass$4([
|
|
29562
30523
|
r$1()
|
|
29563
30524
|
], SlTryIt.prototype, "_response", 2);
|
|
29564
|
-
__decorateClass$
|
|
30525
|
+
__decorateClass$4([
|
|
29565
30526
|
r$1()
|
|
29566
30527
|
], SlTryIt.prototype, "_loading", 2);
|
|
29567
|
-
__decorateClass$
|
|
30528
|
+
__decorateClass$4([
|
|
29568
30529
|
r$1()
|
|
29569
30530
|
], SlTryIt.prototype, "_error", 2);
|
|
29570
|
-
__decorateClass$
|
|
30531
|
+
__decorateClass$4([
|
|
29571
30532
|
r$1()
|
|
29572
30533
|
], SlTryIt.prototype, "_showResponseHeaders", 2);
|
|
29573
|
-
__decorateClass$
|
|
30534
|
+
__decorateClass$4([
|
|
29574
30535
|
r$1()
|
|
29575
30536
|
], SlTryIt.prototype, "_initialized", 2);
|
|
29576
|
-
SlTryIt = __decorateClass$
|
|
30537
|
+
SlTryIt = __decorateClass$4([
|
|
29577
30538
|
t$1("sl-try-it")
|
|
29578
30539
|
], SlTryIt);
|
|
29579
|
-
var __defProp$
|
|
29580
|
-
var __getOwnPropDesc$
|
|
29581
|
-
var __decorateClass$
|
|
29582
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
30540
|
+
var __defProp$3 = Object.defineProperty;
|
|
30541
|
+
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
30542
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
30543
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
29583
30544
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
29584
30545
|
if (decorator = decorators[i3])
|
|
29585
30546
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
29586
|
-
if (kind && result) __defProp$
|
|
30547
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
29587
30548
|
return result;
|
|
29588
30549
|
};
|
|
29589
30550
|
let SlAuth = class extends i$1 {
|
|
@@ -30029,120 +30990,613 @@ SlAuth.styles = [
|
|
|
30029
30990
|
transition: all var(--sl-transition-fast);
|
|
30030
30991
|
}
|
|
30031
30992
|
|
|
30032
|
-
.toggle-visibility:hover {
|
|
30033
|
-
background: var(--sl-color-surface-raised);
|
|
30034
|
-
color: var(--sl-color-text);
|
|
30993
|
+
.toggle-visibility:hover {
|
|
30994
|
+
background: var(--sl-color-surface-raised);
|
|
30995
|
+
color: var(--sl-color-text);
|
|
30996
|
+
}
|
|
30997
|
+
|
|
30998
|
+
.unsupported-card {
|
|
30999
|
+
padding: var(--sl-spacing-md) var(--sl-spacing-lg);
|
|
31000
|
+
border: 1px dashed var(--sl-color-border);
|
|
31001
|
+
border-radius: var(--sl-radius-lg);
|
|
31002
|
+
background: transparent;
|
|
31003
|
+
display: flex;
|
|
31004
|
+
align-items: center;
|
|
31005
|
+
justify-content: space-between;
|
|
31006
|
+
gap: var(--sl-spacing-md);
|
|
31007
|
+
}
|
|
31008
|
+
|
|
31009
|
+
.unsupported-name {
|
|
31010
|
+
font-size: var(--sl-font-size-sm);
|
|
31011
|
+
font-weight: 600;
|
|
31012
|
+
color: var(--sl-color-text);
|
|
31013
|
+
}
|
|
31014
|
+
|
|
31015
|
+
.unsupported-type {
|
|
31016
|
+
font-size: var(--sl-font-size-xs);
|
|
31017
|
+
color: var(--sl-color-text-muted);
|
|
31018
|
+
margin-top: 2px;
|
|
31019
|
+
}
|
|
31020
|
+
|
|
31021
|
+
.unsupported-badge {
|
|
31022
|
+
font-size: 10px;
|
|
31023
|
+
font-weight: 600;
|
|
31024
|
+
letter-spacing: 0.04em;
|
|
31025
|
+
text-transform: uppercase;
|
|
31026
|
+
padding: 2px 8px;
|
|
31027
|
+
border-radius: var(--sl-radius-full);
|
|
31028
|
+
background: var(--sl-color-surface-raised);
|
|
31029
|
+
color: var(--sl-color-text-muted);
|
|
31030
|
+
white-space: nowrap;
|
|
31031
|
+
flex-shrink: 0;
|
|
31032
|
+
}
|
|
31033
|
+
|
|
31034
|
+
.modal-footer {
|
|
31035
|
+
display: flex;
|
|
31036
|
+
align-items: center;
|
|
31037
|
+
justify-content: space-between;
|
|
31038
|
+
gap: var(--sl-spacing-sm);
|
|
31039
|
+
padding: var(--sl-spacing-md) var(--sl-spacing-xl);
|
|
31040
|
+
border-top: 1px solid var(--sl-color-border);
|
|
31041
|
+
background: var(--sl-color-bg-subtle);
|
|
31042
|
+
flex-shrink: 0;
|
|
31043
|
+
}
|
|
31044
|
+
|
|
31045
|
+
.footer-info {
|
|
31046
|
+
font-size: var(--sl-font-size-xs);
|
|
31047
|
+
color: var(--sl-color-text-muted);
|
|
31048
|
+
}
|
|
31049
|
+
|
|
31050
|
+
.footer-actions {
|
|
31051
|
+
display: flex;
|
|
31052
|
+
align-items: center;
|
|
31053
|
+
gap: var(--sl-spacing-sm);
|
|
31054
|
+
}
|
|
31055
|
+
|
|
31056
|
+
.btn-secondary {
|
|
31057
|
+
padding: 7px 16px;
|
|
31058
|
+
border-radius: var(--sl-radius-md);
|
|
31059
|
+
font-size: var(--sl-font-size-sm);
|
|
31060
|
+
font-weight: 500;
|
|
31061
|
+
color: var(--sl-color-text-secondary);
|
|
31062
|
+
border: 1px solid var(--sl-color-border);
|
|
31063
|
+
transition: all var(--sl-transition-fast);
|
|
31064
|
+
}
|
|
31065
|
+
|
|
31066
|
+
.btn-secondary:hover {
|
|
31067
|
+
background: var(--sl-color-surface-raised);
|
|
31068
|
+
color: var(--sl-color-text);
|
|
31069
|
+
border-color: var(--sl-color-border-hover);
|
|
31070
|
+
}
|
|
31071
|
+
|
|
31072
|
+
.btn-primary {
|
|
31073
|
+
display: flex;
|
|
31074
|
+
align-items: center;
|
|
31075
|
+
gap: 6px;
|
|
31076
|
+
padding: 7px 18px;
|
|
31077
|
+
border-radius: var(--sl-radius-md);
|
|
31078
|
+
font-size: var(--sl-font-size-sm);
|
|
31079
|
+
font-weight: 600;
|
|
31080
|
+
color: var(--sl-color-primary-text);
|
|
31081
|
+
background: var(--sl-color-primary);
|
|
31082
|
+
transition: all var(--sl-transition-fast);
|
|
31083
|
+
box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
|
|
31084
|
+
}
|
|
31085
|
+
|
|
31086
|
+
.btn-primary:hover {
|
|
31087
|
+
background: var(--sl-color-primary-hover);
|
|
31088
|
+
box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
|
|
31089
|
+
}
|
|
31090
|
+
`
|
|
31091
|
+
];
|
|
31092
|
+
__decorateClass$3([
|
|
31093
|
+
n2({ type: Array })
|
|
31094
|
+
], SlAuth.prototype, "securitySchemes", 2);
|
|
31095
|
+
__decorateClass$3([
|
|
31096
|
+
n2({ type: Object })
|
|
31097
|
+
], SlAuth.prototype, "authState", 2);
|
|
31098
|
+
__decorateClass$3([
|
|
31099
|
+
r$1()
|
|
31100
|
+
], SlAuth.prototype, "_localState", 2);
|
|
31101
|
+
__decorateClass$3([
|
|
31102
|
+
r$1()
|
|
31103
|
+
], SlAuth.prototype, "_showTokens", 2);
|
|
31104
|
+
SlAuth = __decorateClass$3([
|
|
31105
|
+
t$1("sl-auth")
|
|
31106
|
+
], SlAuth);
|
|
31107
|
+
var __defProp$2 = Object.defineProperty;
|
|
31108
|
+
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
31109
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
31110
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
31111
|
+
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
31112
|
+
if (decorator = decorators[i3])
|
|
31113
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
31114
|
+
if (kind && result) __defProp$2(target, key, result);
|
|
31115
|
+
return result;
|
|
31116
|
+
};
|
|
31117
|
+
let SlGuideSidebar = class extends i$1 {
|
|
31118
|
+
constructor() {
|
|
31119
|
+
super(...arguments);
|
|
31120
|
+
this.categories = [];
|
|
31121
|
+
this.activeGuideSlug = "";
|
|
31122
|
+
this.open = false;
|
|
31123
|
+
this._collapsedCategories = /* @__PURE__ */ new Set();
|
|
31124
|
+
}
|
|
31125
|
+
_toggleCategory(name) {
|
|
31126
|
+
if (this._collapsedCategories.has(name)) {
|
|
31127
|
+
this._collapsedCategories.delete(name);
|
|
31128
|
+
} else {
|
|
31129
|
+
this._collapsedCategories.add(name);
|
|
31130
|
+
}
|
|
31131
|
+
this.requestUpdate();
|
|
31132
|
+
}
|
|
31133
|
+
_navigateGuide(slug) {
|
|
31134
|
+
this.dispatchEvent(new CustomEvent("navigate-guide", { detail: slug }));
|
|
31135
|
+
this.dispatchEvent(new CustomEvent("close-sidebar"));
|
|
31136
|
+
}
|
|
31137
|
+
render() {
|
|
31138
|
+
return b`
|
|
31139
|
+
<div class="overlay" @click=${() => this.dispatchEvent(new CustomEvent("close-sidebar"))}></div>
|
|
31140
|
+
<nav class="sidebar">
|
|
31141
|
+
<div class="nav-list">
|
|
31142
|
+
${this.categories.map((cat) => {
|
|
31143
|
+
const collapsed = this._collapsedCategories.has(cat.name);
|
|
31144
|
+
return b`
|
|
31145
|
+
<div class="category">
|
|
31146
|
+
<div
|
|
31147
|
+
class="category-header ${collapsed ? "collapsed" : ""}"
|
|
31148
|
+
@click=${() => this._toggleCategory(cat.name)}
|
|
31149
|
+
>
|
|
31150
|
+
<span>${cat.name}</span>
|
|
31151
|
+
<svg class="chevron" width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
31152
|
+
<path d="M3 4.5l3 3 3-3"/>
|
|
31153
|
+
</svg>
|
|
31154
|
+
</div>
|
|
31155
|
+
<div class="category-guides ${collapsed ? "collapsed" : ""}">
|
|
31156
|
+
${cat.guides.map((g2) => b`
|
|
31157
|
+
<a
|
|
31158
|
+
class="guide-link ${g2.slug === this.activeGuideSlug ? "active" : ""}"
|
|
31159
|
+
@click=${() => this._navigateGuide(g2.slug)}
|
|
31160
|
+
>
|
|
31161
|
+
<svg class="guide-icon" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round">
|
|
31162
|
+
<path d="M4 2h8a1 1 0 011 1v10a1 1 0 01-1 1H4a1 1 0 01-1-1V3a1 1 0 011-1z"/>
|
|
31163
|
+
<path d="M6 5h4M6 8h4M6 11h2"/>
|
|
31164
|
+
</svg>
|
|
31165
|
+
<span class="guide-title">${g2.title}</span>
|
|
31166
|
+
</a>
|
|
31167
|
+
`)}
|
|
31168
|
+
</div>
|
|
31169
|
+
</div>
|
|
31170
|
+
`;
|
|
31171
|
+
})}
|
|
31172
|
+
</div>
|
|
31173
|
+
</nav>
|
|
31174
|
+
`;
|
|
31175
|
+
}
|
|
31176
|
+
};
|
|
31177
|
+
SlGuideSidebar.styles = [
|
|
31178
|
+
resetStyles,
|
|
31179
|
+
i$4`
|
|
31180
|
+
:host {
|
|
31181
|
+
display: block;
|
|
31182
|
+
}
|
|
31183
|
+
|
|
31184
|
+
.sidebar {
|
|
31185
|
+
position: sticky;
|
|
31186
|
+
top: var(--sl-header-height);
|
|
31187
|
+
width: var(--sl-sidebar-width);
|
|
31188
|
+
height: calc(100vh - var(--sl-header-height));
|
|
31189
|
+
overflow-y: auto;
|
|
31190
|
+
overflow-x: hidden;
|
|
31191
|
+
background: var(--sl-color-sidebar-bg);
|
|
31192
|
+
border-right: 1px solid var(--sl-color-border);
|
|
31193
|
+
padding: 0;
|
|
31194
|
+
flex-shrink: 0;
|
|
31195
|
+
scrollbar-width: thin;
|
|
31196
|
+
scrollbar-color: var(--sl-color-border) transparent;
|
|
31197
|
+
display: flex;
|
|
31198
|
+
flex-direction: column;
|
|
31199
|
+
}
|
|
31200
|
+
|
|
31201
|
+
.sidebar::-webkit-scrollbar {
|
|
31202
|
+
width: 4px;
|
|
31203
|
+
}
|
|
31204
|
+
.sidebar::-webkit-scrollbar-thumb {
|
|
31205
|
+
background: var(--sl-color-border);
|
|
31206
|
+
border-radius: 2px;
|
|
31207
|
+
}
|
|
31208
|
+
|
|
31209
|
+
.overlay {
|
|
31210
|
+
display: none;
|
|
31211
|
+
}
|
|
31212
|
+
|
|
31213
|
+
@media (max-width: 768px) {
|
|
31214
|
+
.sidebar {
|
|
31215
|
+
position: fixed;
|
|
31216
|
+
top: 0;
|
|
31217
|
+
left: 0;
|
|
31218
|
+
height: 100vh;
|
|
31219
|
+
z-index: 200;
|
|
31220
|
+
transform: translateX(-100%);
|
|
31221
|
+
transition: transform var(--sl-transition-base);
|
|
31222
|
+
box-shadow: var(--sl-shadow-xl);
|
|
31223
|
+
}
|
|
31224
|
+
|
|
31225
|
+
:host([open]) .sidebar {
|
|
31226
|
+
transform: translateX(0);
|
|
31227
|
+
}
|
|
31228
|
+
|
|
31229
|
+
.overlay {
|
|
31230
|
+
display: block;
|
|
31231
|
+
position: fixed;
|
|
31232
|
+
inset: 0;
|
|
31233
|
+
background: var(--sl-color-overlay);
|
|
31234
|
+
z-index: 199;
|
|
31235
|
+
opacity: 0;
|
|
31236
|
+
pointer-events: none;
|
|
31237
|
+
transition: opacity var(--sl-transition-base);
|
|
31238
|
+
}
|
|
31239
|
+
|
|
31240
|
+
:host([open]) .overlay {
|
|
31241
|
+
opacity: 1;
|
|
31242
|
+
pointer-events: auto;
|
|
31243
|
+
}
|
|
31244
|
+
}
|
|
31245
|
+
|
|
31246
|
+
/* ── Nav ───────────────────────────── */
|
|
31247
|
+
.nav-list {
|
|
31248
|
+
flex: 1;
|
|
31249
|
+
overflow-y: auto;
|
|
31250
|
+
padding: var(--sl-spacing-sm) 0 var(--sl-spacing-md);
|
|
31251
|
+
scrollbar-width: thin;
|
|
31252
|
+
scrollbar-color: var(--sl-color-border) transparent;
|
|
31253
|
+
}
|
|
31254
|
+
|
|
31255
|
+
.nav-list::-webkit-scrollbar {
|
|
31256
|
+
width: 4px;
|
|
31257
|
+
}
|
|
31258
|
+
.nav-list::-webkit-scrollbar-thumb {
|
|
31259
|
+
background: var(--sl-color-border);
|
|
31260
|
+
border-radius: 2px;
|
|
31261
|
+
}
|
|
31262
|
+
|
|
31263
|
+
.category {
|
|
31264
|
+
margin-bottom: var(--sl-spacing-xs);
|
|
31265
|
+
}
|
|
31266
|
+
|
|
31267
|
+
.category-header {
|
|
31268
|
+
display: flex;
|
|
31269
|
+
align-items: center;
|
|
31270
|
+
justify-content: space-between;
|
|
31271
|
+
padding: var(--sl-spacing-sm) var(--sl-spacing-lg);
|
|
31272
|
+
font-size: var(--sl-font-size-xs);
|
|
31273
|
+
font-weight: 600;
|
|
31274
|
+
text-transform: uppercase;
|
|
31275
|
+
letter-spacing: 0.05em;
|
|
31276
|
+
color: var(--sl-color-text-muted);
|
|
31277
|
+
cursor: pointer;
|
|
31278
|
+
user-select: none;
|
|
31279
|
+
transition: color var(--sl-transition-fast);
|
|
31280
|
+
}
|
|
31281
|
+
|
|
31282
|
+
.category-header:hover {
|
|
31283
|
+
color: var(--sl-color-text);
|
|
31284
|
+
}
|
|
31285
|
+
|
|
31286
|
+
.category-header .chevron {
|
|
31287
|
+
transition: transform var(--sl-transition-fast);
|
|
31288
|
+
}
|
|
31289
|
+
|
|
31290
|
+
.category-header.collapsed .chevron {
|
|
31291
|
+
transform: rotate(-90deg);
|
|
31292
|
+
}
|
|
31293
|
+
|
|
31294
|
+
.category-guides {
|
|
31295
|
+
overflow: hidden;
|
|
31296
|
+
}
|
|
31297
|
+
|
|
31298
|
+
.category-guides.collapsed {
|
|
31299
|
+
display: none;
|
|
31300
|
+
}
|
|
31301
|
+
|
|
31302
|
+
.guide-link {
|
|
31303
|
+
display: flex;
|
|
31304
|
+
align-items: center;
|
|
31305
|
+
gap: var(--sl-spacing-sm);
|
|
31306
|
+
padding: 7px var(--sl-spacing-lg) 7px calc(var(--sl-spacing-lg) + 4px);
|
|
31307
|
+
font-size: var(--sl-font-size-sm);
|
|
31308
|
+
color: var(--sl-color-text-secondary);
|
|
31309
|
+
cursor: pointer;
|
|
31310
|
+
transition: all var(--sl-transition-fast);
|
|
31311
|
+
text-decoration: none;
|
|
31312
|
+
border-left: 2px solid transparent;
|
|
31313
|
+
}
|
|
31314
|
+
|
|
31315
|
+
.guide-link:hover {
|
|
31316
|
+
background: var(--sl-color-sidebar-hover);
|
|
31317
|
+
color: var(--sl-color-text);
|
|
31318
|
+
text-decoration: none;
|
|
31319
|
+
}
|
|
31320
|
+
|
|
31321
|
+
.guide-link.active {
|
|
31322
|
+
background: var(--sl-color-sidebar-active);
|
|
31323
|
+
color: var(--sl-color-primary);
|
|
31324
|
+
border-left-color: var(--sl-color-primary);
|
|
31325
|
+
}
|
|
31326
|
+
|
|
31327
|
+
.guide-icon {
|
|
31328
|
+
flex-shrink: 0;
|
|
31329
|
+
color: var(--sl-color-text-muted);
|
|
31330
|
+
}
|
|
31331
|
+
|
|
31332
|
+
.guide-link.active .guide-icon {
|
|
31333
|
+
color: var(--sl-color-primary);
|
|
31334
|
+
}
|
|
31335
|
+
|
|
31336
|
+
.guide-title {
|
|
31337
|
+
overflow: hidden;
|
|
31338
|
+
text-overflow: ellipsis;
|
|
31339
|
+
white-space: nowrap;
|
|
31340
|
+
}
|
|
31341
|
+
`
|
|
31342
|
+
];
|
|
31343
|
+
__decorateClass$2([
|
|
31344
|
+
n2({ type: Array })
|
|
31345
|
+
], SlGuideSidebar.prototype, "categories", 2);
|
|
31346
|
+
__decorateClass$2([
|
|
31347
|
+
n2({ type: String })
|
|
31348
|
+
], SlGuideSidebar.prototype, "activeGuideSlug", 2);
|
|
31349
|
+
__decorateClass$2([
|
|
31350
|
+
n2({ type: Boolean, reflect: true })
|
|
31351
|
+
], SlGuideSidebar.prototype, "open", 2);
|
|
31352
|
+
__decorateClass$2([
|
|
31353
|
+
r$1()
|
|
31354
|
+
], SlGuideSidebar.prototype, "_collapsedCategories", 2);
|
|
31355
|
+
SlGuideSidebar = __decorateClass$2([
|
|
31356
|
+
t$1("sl-guide-sidebar")
|
|
31357
|
+
], SlGuideSidebar);
|
|
31358
|
+
var __defProp$1 = Object.defineProperty;
|
|
31359
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
31360
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
31361
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
31362
|
+
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
31363
|
+
if (decorator = decorators[i3])
|
|
31364
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
31365
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
31366
|
+
return result;
|
|
31367
|
+
};
|
|
31368
|
+
let SlGuideView = class extends i$1 {
|
|
31369
|
+
constructor() {
|
|
31370
|
+
super(...arguments);
|
|
31371
|
+
this.guide = null;
|
|
31372
|
+
}
|
|
31373
|
+
render() {
|
|
31374
|
+
if (!this.guide) {
|
|
31375
|
+
return b`
|
|
31376
|
+
<div class="empty">
|
|
31377
|
+
<div class="empty-icon">📖</div>
|
|
31378
|
+
<div class="empty-text">Select a guide from the sidebar to get started.</div>
|
|
31379
|
+
</div>
|
|
31380
|
+
`;
|
|
31381
|
+
}
|
|
31382
|
+
return b`
|
|
31383
|
+
<div class="guide-header">
|
|
31384
|
+
<h1 class="guide-title">${this.guide.title}</h1>
|
|
31385
|
+
${this.guide.category ? b`<div class="guide-category">${this.guide.category}</div>` : null}
|
|
31386
|
+
</div>
|
|
31387
|
+
<div class="guide-content" .innerHTML=${this.guide.htmlContent}></div>
|
|
31388
|
+
`;
|
|
31389
|
+
}
|
|
31390
|
+
};
|
|
31391
|
+
SlGuideView.styles = [
|
|
31392
|
+
resetStyles,
|
|
31393
|
+
i$4`
|
|
31394
|
+
:host {
|
|
31395
|
+
display: block;
|
|
31396
|
+
flex: 1;
|
|
31397
|
+
min-width: 0;
|
|
31398
|
+
padding: var(--sl-spacing-xl) var(--sl-spacing-2xl);
|
|
31399
|
+
max-width: 900px;
|
|
31400
|
+
margin: 0 auto;
|
|
31401
|
+
}
|
|
31402
|
+
|
|
31403
|
+
.guide-header {
|
|
31404
|
+
margin-bottom: var(--sl-spacing-2xl);
|
|
31405
|
+
padding-bottom: var(--sl-spacing-xl);
|
|
31406
|
+
border-bottom: 1px solid var(--sl-color-border);
|
|
31407
|
+
}
|
|
31408
|
+
|
|
31409
|
+
.guide-title {
|
|
31410
|
+
font-size: var(--sl-font-size-2xl);
|
|
31411
|
+
font-weight: 800;
|
|
31412
|
+
color: var(--sl-color-text);
|
|
31413
|
+
margin: 0;
|
|
31414
|
+
line-height: 1.3;
|
|
31415
|
+
}
|
|
31416
|
+
|
|
31417
|
+
.guide-category {
|
|
31418
|
+
font-size: var(--sl-font-size-sm);
|
|
31419
|
+
color: var(--sl-color-text-muted);
|
|
31420
|
+
margin-top: var(--sl-spacing-xs);
|
|
31421
|
+
}
|
|
31422
|
+
|
|
31423
|
+
/* ── Prose styles (mirroring sl-intro-desc) ── */
|
|
31424
|
+
|
|
31425
|
+
.guide-content {
|
|
31426
|
+
font-size: var(--sl-font-size-base);
|
|
31427
|
+
color: var(--sl-color-text-secondary);
|
|
31428
|
+
line-height: 1.7;
|
|
31429
|
+
}
|
|
31430
|
+
|
|
31431
|
+
.guide-content p {
|
|
31432
|
+
margin: 0 0 var(--sl-spacing-md) 0;
|
|
31433
|
+
}
|
|
31434
|
+
.guide-content p:last-child {
|
|
31435
|
+
margin-bottom: 0;
|
|
31436
|
+
}
|
|
31437
|
+
|
|
31438
|
+
.guide-content h1,
|
|
31439
|
+
.guide-content h2,
|
|
31440
|
+
.guide-content h3,
|
|
31441
|
+
.guide-content h4,
|
|
31442
|
+
.guide-content h5,
|
|
31443
|
+
.guide-content h6 {
|
|
31444
|
+
color: var(--sl-color-text);
|
|
31445
|
+
font-weight: 700;
|
|
31446
|
+
margin: var(--sl-spacing-xl) 0 var(--sl-spacing-sm) 0;
|
|
31447
|
+
line-height: 1.3;
|
|
31448
|
+
}
|
|
31449
|
+
.guide-content h1 { font-size: 1.6rem; border-bottom: 2px solid var(--sl-color-border); padding-bottom: var(--sl-spacing-sm); }
|
|
31450
|
+
.guide-content h2 { font-size: 1.3rem; border-bottom: 1px solid var(--sl-color-border); padding-bottom: var(--sl-spacing-xs); }
|
|
31451
|
+
.guide-content h3 { font-size: 1.1rem; }
|
|
31452
|
+
.guide-content h4 { font-size: 1rem; }
|
|
31453
|
+
.guide-content h1:first-child,
|
|
31454
|
+
.guide-content h2:first-child,
|
|
31455
|
+
.guide-content h3:first-child {
|
|
31456
|
+
margin-top: 0;
|
|
31457
|
+
}
|
|
31458
|
+
|
|
31459
|
+
.guide-content code {
|
|
31460
|
+
background: var(--sl-color-code-bg);
|
|
31461
|
+
padding: 2px 7px;
|
|
31462
|
+
border-radius: var(--sl-radius-sm);
|
|
31463
|
+
font-size: 0.85em;
|
|
31464
|
+
font-family: var(--sl-font-mono);
|
|
31465
|
+
border: 1px solid var(--sl-color-border);
|
|
31466
|
+
}
|
|
31467
|
+
|
|
31468
|
+
.guide-content pre {
|
|
31469
|
+
background: #0d1117;
|
|
31470
|
+
border: 1px solid #30363d;
|
|
31471
|
+
border-radius: var(--sl-radius-md);
|
|
31472
|
+
padding: var(--sl-spacing-md);
|
|
31473
|
+
overflow-x: auto;
|
|
31474
|
+
margin: var(--sl-spacing-md) 0;
|
|
31475
|
+
line-height: 1.6;
|
|
31476
|
+
}
|
|
31477
|
+
.guide-content pre code {
|
|
31478
|
+
background: none;
|
|
31479
|
+
border: none;
|
|
31480
|
+
padding: 0;
|
|
31481
|
+
border-radius: 0;
|
|
31482
|
+
color: #e6edf3;
|
|
31483
|
+
font-size: var(--sl-font-size-sm);
|
|
31484
|
+
font-family: var(--sl-font-mono);
|
|
31485
|
+
}
|
|
31486
|
+
|
|
31487
|
+
.guide-content a {
|
|
31488
|
+
color: var(--sl-color-primary);
|
|
31489
|
+
text-decoration: none;
|
|
31490
|
+
font-weight: 500;
|
|
31491
|
+
transition: all var(--sl-transition-fast);
|
|
30035
31492
|
}
|
|
30036
|
-
|
|
30037
|
-
|
|
30038
|
-
padding: var(--sl-spacing-md) var(--sl-spacing-lg);
|
|
30039
|
-
border: 1px dashed var(--sl-color-border);
|
|
30040
|
-
border-radius: var(--sl-radius-lg);
|
|
30041
|
-
background: transparent;
|
|
30042
|
-
display: flex;
|
|
30043
|
-
align-items: center;
|
|
30044
|
-
justify-content: space-between;
|
|
30045
|
-
gap: var(--sl-spacing-md);
|
|
31493
|
+
.guide-content a:hover {
|
|
31494
|
+
text-decoration: underline;
|
|
30046
31495
|
}
|
|
30047
31496
|
|
|
30048
|
-
.
|
|
31497
|
+
.guide-content table {
|
|
31498
|
+
width: 100%;
|
|
31499
|
+
border-collapse: separate;
|
|
31500
|
+
border-spacing: 0;
|
|
31501
|
+
border: 1px solid var(--sl-color-border);
|
|
31502
|
+
border-radius: var(--sl-radius-md);
|
|
31503
|
+
overflow: hidden;
|
|
31504
|
+
margin: var(--sl-spacing-md) 0;
|
|
30049
31505
|
font-size: var(--sl-font-size-sm);
|
|
31506
|
+
}
|
|
31507
|
+
.guide-content thead {
|
|
31508
|
+
background: var(--sl-color-bg-subtle);
|
|
31509
|
+
}
|
|
31510
|
+
.guide-content th {
|
|
31511
|
+
text-align: left;
|
|
31512
|
+
padding: var(--sl-spacing-sm) var(--sl-spacing-md);
|
|
30050
31513
|
font-weight: 600;
|
|
30051
31514
|
color: var(--sl-color-text);
|
|
31515
|
+
border-bottom: 2px solid var(--sl-color-border);
|
|
30052
31516
|
}
|
|
30053
|
-
|
|
30054
|
-
|
|
30055
|
-
|
|
30056
|
-
color: var(--sl-color-text-
|
|
30057
|
-
margin-top: 2px;
|
|
31517
|
+
.guide-content td {
|
|
31518
|
+
padding: var(--sl-spacing-sm) var(--sl-spacing-md);
|
|
31519
|
+
border-bottom: 1px solid var(--sl-color-border);
|
|
31520
|
+
color: var(--sl-color-text-secondary);
|
|
30058
31521
|
}
|
|
30059
|
-
|
|
30060
|
-
|
|
30061
|
-
font-size: 10px;
|
|
30062
|
-
font-weight: 600;
|
|
30063
|
-
letter-spacing: 0.04em;
|
|
30064
|
-
text-transform: uppercase;
|
|
30065
|
-
padding: 2px 8px;
|
|
30066
|
-
border-radius: var(--sl-radius-full);
|
|
30067
|
-
background: var(--sl-color-surface-raised);
|
|
30068
|
-
color: var(--sl-color-text-muted);
|
|
30069
|
-
white-space: nowrap;
|
|
30070
|
-
flex-shrink: 0;
|
|
31522
|
+
.guide-content tr:last-child td {
|
|
31523
|
+
border-bottom: none;
|
|
30071
31524
|
}
|
|
30072
|
-
|
|
30073
|
-
.modal-footer {
|
|
30074
|
-
display: flex;
|
|
30075
|
-
align-items: center;
|
|
30076
|
-
justify-content: space-between;
|
|
30077
|
-
gap: var(--sl-spacing-sm);
|
|
30078
|
-
padding: var(--sl-spacing-md) var(--sl-spacing-xl);
|
|
30079
|
-
border-top: 1px solid var(--sl-color-border);
|
|
31525
|
+
.guide-content tbody tr:hover {
|
|
30080
31526
|
background: var(--sl-color-bg-subtle);
|
|
30081
|
-
flex-shrink: 0;
|
|
30082
31527
|
}
|
|
30083
31528
|
|
|
30084
|
-
.
|
|
30085
|
-
|
|
30086
|
-
|
|
31529
|
+
.guide-content blockquote {
|
|
31530
|
+
border-left: 3px solid var(--sl-color-primary);
|
|
31531
|
+
background: rgba(99, 102, 241, 0.05);
|
|
31532
|
+
margin: var(--sl-spacing-md) 0;
|
|
31533
|
+
padding: var(--sl-spacing-sm) var(--sl-spacing-lg);
|
|
31534
|
+
border-radius: 0 var(--sl-radius-md) var(--sl-radius-md) 0;
|
|
31535
|
+
color: var(--sl-color-text-secondary);
|
|
31536
|
+
}
|
|
31537
|
+
.guide-content blockquote p {
|
|
31538
|
+
margin-bottom: var(--sl-spacing-xs);
|
|
30087
31539
|
}
|
|
30088
31540
|
|
|
30089
|
-
.
|
|
30090
|
-
|
|
30091
|
-
|
|
30092
|
-
|
|
31541
|
+
.guide-content ul,
|
|
31542
|
+
.guide-content ol {
|
|
31543
|
+
margin: var(--sl-spacing-sm) 0;
|
|
31544
|
+
padding-left: var(--sl-spacing-xl);
|
|
31545
|
+
}
|
|
31546
|
+
.guide-content li {
|
|
31547
|
+
margin-bottom: var(--sl-spacing-xs);
|
|
31548
|
+
}
|
|
31549
|
+
.guide-content li strong {
|
|
31550
|
+
color: var(--sl-color-text);
|
|
30093
31551
|
}
|
|
30094
31552
|
|
|
30095
|
-
.
|
|
30096
|
-
|
|
30097
|
-
|
|
30098
|
-
|
|
30099
|
-
|
|
30100
|
-
color: var(--sl-color-text-secondary);
|
|
30101
|
-
border: 1px solid var(--sl-color-border);
|
|
30102
|
-
transition: all var(--sl-transition-fast);
|
|
31553
|
+
.guide-content hr {
|
|
31554
|
+
border: none;
|
|
31555
|
+
height: 1px;
|
|
31556
|
+
background: var(--sl-color-border);
|
|
31557
|
+
margin: var(--sl-spacing-xl) 0;
|
|
30103
31558
|
}
|
|
30104
31559
|
|
|
30105
|
-
.
|
|
30106
|
-
|
|
30107
|
-
|
|
30108
|
-
border-
|
|
31560
|
+
.guide-content img {
|
|
31561
|
+
max-width: 100%;
|
|
31562
|
+
height: auto;
|
|
31563
|
+
border-radius: var(--sl-radius-md);
|
|
31564
|
+
margin: var(--sl-spacing-sm) 0;
|
|
30109
31565
|
}
|
|
30110
31566
|
|
|
30111
|
-
|
|
31567
|
+
/* ── Empty state ───────────────────── */
|
|
31568
|
+
.empty {
|
|
30112
31569
|
display: flex;
|
|
31570
|
+
flex-direction: column;
|
|
30113
31571
|
align-items: center;
|
|
30114
|
-
|
|
30115
|
-
|
|
30116
|
-
|
|
30117
|
-
|
|
30118
|
-
|
|
30119
|
-
color: var(--sl-color-primary-text);
|
|
30120
|
-
background: var(--sl-color-primary);
|
|
30121
|
-
transition: all var(--sl-transition-fast);
|
|
30122
|
-
box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
|
|
31572
|
+
justify-content: center;
|
|
31573
|
+
min-height: 40vh;
|
|
31574
|
+
gap: var(--sl-spacing-md);
|
|
31575
|
+
color: var(--sl-color-text-muted);
|
|
31576
|
+
text-align: center;
|
|
30123
31577
|
}
|
|
30124
31578
|
|
|
30125
|
-
.
|
|
30126
|
-
|
|
30127
|
-
|
|
31579
|
+
.empty-icon {
|
|
31580
|
+
font-size: 2rem;
|
|
31581
|
+
}
|
|
31582
|
+
|
|
31583
|
+
.empty-text {
|
|
31584
|
+
font-size: var(--sl-font-size-base);
|
|
31585
|
+
}
|
|
31586
|
+
|
|
31587
|
+
@media (max-width: 768px) {
|
|
31588
|
+
:host {
|
|
31589
|
+
padding: var(--sl-spacing-md);
|
|
31590
|
+
}
|
|
30128
31591
|
}
|
|
30129
31592
|
`
|
|
30130
31593
|
];
|
|
30131
|
-
__decorateClass$1([
|
|
30132
|
-
n2({ type: Array })
|
|
30133
|
-
], SlAuth.prototype, "securitySchemes", 2);
|
|
30134
31594
|
__decorateClass$1([
|
|
30135
31595
|
n2({ type: Object })
|
|
30136
|
-
],
|
|
30137
|
-
__decorateClass$1([
|
|
30138
|
-
|
|
30139
|
-
],
|
|
30140
|
-
__decorateClass$1([
|
|
30141
|
-
r$1()
|
|
30142
|
-
], SlAuth.prototype, "_showTokens", 2);
|
|
30143
|
-
SlAuth = __decorateClass$1([
|
|
30144
|
-
t$1("sl-auth")
|
|
30145
|
-
], SlAuth);
|
|
31596
|
+
], SlGuideView.prototype, "guide", 2);
|
|
31597
|
+
SlGuideView = __decorateClass$1([
|
|
31598
|
+
t$1("sl-guide-view")
|
|
31599
|
+
], SlGuideView);
|
|
30146
31600
|
var __defProp2 = Object.defineProperty;
|
|
30147
31601
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
30148
31602
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -30161,7 +31615,9 @@ let SpecLensElement = class extends i$1 {
|
|
|
30161
31615
|
this.theme = "auto";
|
|
30162
31616
|
this.hideTryIt = false;
|
|
30163
31617
|
this.hideCodeSamples = false;
|
|
31618
|
+
this.hideAskAi = false;
|
|
30164
31619
|
this.layout = "page";
|
|
31620
|
+
this.guidesUrl = "";
|
|
30165
31621
|
this.config = {};
|
|
30166
31622
|
this._spec = null;
|
|
30167
31623
|
this._loading = false;
|
|
@@ -30172,6 +31628,13 @@ let SpecLensElement = class extends i$1 {
|
|
|
30172
31628
|
this._navigateToId = "";
|
|
30173
31629
|
this._authState = { apiKeys: {}, bearerTokens: {} };
|
|
30174
31630
|
this._tryItOperation = null;
|
|
31631
|
+
this._activeTab = "api";
|
|
31632
|
+
this._guideCategories = [];
|
|
31633
|
+
this._loadedGuides = /* @__PURE__ */ new Map();
|
|
31634
|
+
this._activeGuideSlug = "";
|
|
31635
|
+
this._searchOpen = false;
|
|
31636
|
+
this._tryItAiMenuOpen = false;
|
|
31637
|
+
this._tryItAiMenuRect = null;
|
|
30175
31638
|
this._search = null;
|
|
30176
31639
|
this._router = null;
|
|
30177
31640
|
this._themeManager = null;
|
|
@@ -30179,19 +31642,27 @@ let SpecLensElement = class extends i$1 {
|
|
|
30179
31642
|
this._handleKeyDown = (e2) => {
|
|
30180
31643
|
if ((e2.metaKey || e2.ctrlKey) && e2.key === "k") {
|
|
30181
31644
|
e2.preventDefault();
|
|
30182
|
-
|
|
30183
|
-
sidebar == null ? void 0 : sidebar.focusSearch();
|
|
31645
|
+
this._searchOpen = true;
|
|
30184
31646
|
}
|
|
30185
31647
|
};
|
|
30186
31648
|
}
|
|
31649
|
+
get _hasGuides() {
|
|
31650
|
+
return this._guideCategories.length > 0;
|
|
31651
|
+
}
|
|
30187
31652
|
connectedCallback() {
|
|
30188
31653
|
super.connectedCallback();
|
|
30189
31654
|
this._themeManager = new ThemeManager(this);
|
|
30190
31655
|
this._themeManager.init(this.theme);
|
|
30191
|
-
this._router = new Router((
|
|
30192
|
-
|
|
30193
|
-
|
|
30194
|
-
|
|
31656
|
+
this._router = new Router((route) => {
|
|
31657
|
+
if (route.type === "operation") {
|
|
31658
|
+
this._activeTab = "api";
|
|
31659
|
+
this._activeOperationId = route.id;
|
|
31660
|
+
this._navigateToId = route.id;
|
|
31661
|
+
this._scrollToOperation(route.id);
|
|
31662
|
+
} else if (route.type === "guide") {
|
|
31663
|
+
this._activeTab = "guides";
|
|
31664
|
+
this._activeGuideSlug = route.slug;
|
|
31665
|
+
}
|
|
30195
31666
|
});
|
|
30196
31667
|
this._router.init();
|
|
30197
31668
|
document.addEventListener("keydown", this._handleKeyDown);
|
|
@@ -30209,6 +31680,9 @@ let SpecLensElement = class extends i$1 {
|
|
|
30209
31680
|
if (changed.has("specUrl") || changed.has("config")) {
|
|
30210
31681
|
this._loadSpec();
|
|
30211
31682
|
}
|
|
31683
|
+
if (changed.has("guidesUrl") || changed.has("config")) {
|
|
31684
|
+
this._loadGuides();
|
|
31685
|
+
}
|
|
30212
31686
|
if (changed.has("theme")) {
|
|
30213
31687
|
(_a2 = this._themeManager) == null ? void 0 : _a2.setTheme(this.theme);
|
|
30214
31688
|
}
|
|
@@ -30281,10 +31755,88 @@ let SpecLensElement = class extends i$1 {
|
|
|
30281
31755
|
_handleTryIt(e2) {
|
|
30282
31756
|
this._tryItOperation = e2.detail;
|
|
30283
31757
|
}
|
|
31758
|
+
_toggleTryItAiMenu(e2) {
|
|
31759
|
+
if (!this._tryItAiMenuOpen) {
|
|
31760
|
+
this._tryItAiMenuRect = e2.currentTarget.getBoundingClientRect();
|
|
31761
|
+
}
|
|
31762
|
+
this._tryItAiMenuOpen = !this._tryItAiMenuOpen;
|
|
31763
|
+
if (this._tryItAiMenuOpen) {
|
|
31764
|
+
const close = (ev) => {
|
|
31765
|
+
const path2 = ev.composedPath();
|
|
31766
|
+
const wrapper = this.renderRoot.querySelector(".try-it-ask-ai-wrapper");
|
|
31767
|
+
const menu = this.renderRoot.querySelector(".try-it-ai-menu");
|
|
31768
|
+
if (!path2.includes(wrapper) && !path2.includes(menu)) {
|
|
31769
|
+
this._tryItAiMenuOpen = false;
|
|
31770
|
+
document.removeEventListener("click", close, true);
|
|
31771
|
+
}
|
|
31772
|
+
};
|
|
31773
|
+
requestAnimationFrame(() => document.addEventListener("click", close, true));
|
|
31774
|
+
}
|
|
31775
|
+
}
|
|
31776
|
+
_openTryItAi(target) {
|
|
31777
|
+
this._tryItAiMenuOpen = false;
|
|
31778
|
+
if (!this._tryItOperation) return;
|
|
31779
|
+
const prompt = generateAiPrompt(this._tryItOperation);
|
|
31780
|
+
const url2 = buildAiUrl(prompt, target);
|
|
31781
|
+
window.open(url2, "_blank", "noopener,noreferrer");
|
|
31782
|
+
}
|
|
30284
31783
|
/** Set the color theme programmatically. Useful in embed mode where the header is hidden. */
|
|
30285
31784
|
setTheme(preference) {
|
|
30286
31785
|
this.theme = preference;
|
|
30287
31786
|
}
|
|
31787
|
+
async _loadGuides() {
|
|
31788
|
+
var _a2, _b2;
|
|
31789
|
+
const inlineGuides = (_a2 = this.config) == null ? void 0 : _a2.guides;
|
|
31790
|
+
const url2 = this.guidesUrl || ((_b2 = this.config) == null ? void 0 : _b2.guidesUrl);
|
|
31791
|
+
if (!(inlineGuides == null ? void 0 : inlineGuides.length) && !url2) {
|
|
31792
|
+
this._guideCategories = [];
|
|
31793
|
+
this._loadedGuides = /* @__PURE__ */ new Map();
|
|
31794
|
+
return;
|
|
31795
|
+
}
|
|
31796
|
+
try {
|
|
31797
|
+
const { categories, loaded } = await loadGuides(inlineGuides, url2);
|
|
31798
|
+
this._guideCategories = categories;
|
|
31799
|
+
this._loadedGuides = loaded;
|
|
31800
|
+
if (this._spec) {
|
|
31801
|
+
const allGuides = categories.flatMap((c2) => c2.guides);
|
|
31802
|
+
this._search = buildSearchIndex(this._spec.allOperations, allGuides);
|
|
31803
|
+
}
|
|
31804
|
+
} catch (err) {
|
|
31805
|
+
console.warn("[SpecLens] Failed to load guides:", err);
|
|
31806
|
+
}
|
|
31807
|
+
}
|
|
31808
|
+
_handleTabChange(e2) {
|
|
31809
|
+
var _a2;
|
|
31810
|
+
this._activeTab = e2.detail;
|
|
31811
|
+
if (e2.detail === "api") {
|
|
31812
|
+
if (this._activeOperationId) {
|
|
31813
|
+
window.location.hash = `#/operation/${encodeURIComponent(this._activeOperationId)}`;
|
|
31814
|
+
} else {
|
|
31815
|
+
history.replaceState(null, "", window.location.pathname);
|
|
31816
|
+
}
|
|
31817
|
+
} else if (e2.detail === "guides") {
|
|
31818
|
+
if (!this._activeGuideSlug && this._guideCategories.length) {
|
|
31819
|
+
const firstGuide = this._guideCategories[0].guides[0];
|
|
31820
|
+
if (firstGuide) (_a2 = this._router) == null ? void 0 : _a2.navigateToGuide(firstGuide.slug);
|
|
31821
|
+
}
|
|
31822
|
+
}
|
|
31823
|
+
}
|
|
31824
|
+
_handleGuideNavigate(e2) {
|
|
31825
|
+
var _a2;
|
|
31826
|
+
(_a2 = this._router) == null ? void 0 : _a2.navigateToGuide(e2.detail);
|
|
31827
|
+
}
|
|
31828
|
+
_handleSearchSelectOperation(e2) {
|
|
31829
|
+
var _a2;
|
|
31830
|
+
this._searchOpen = false;
|
|
31831
|
+
this._activeTab = "api";
|
|
31832
|
+
(_a2 = this._router) == null ? void 0 : _a2.navigateTo(e2.detail);
|
|
31833
|
+
}
|
|
31834
|
+
_handleSearchSelectGuide(e2) {
|
|
31835
|
+
var _a2;
|
|
31836
|
+
this._searchOpen = false;
|
|
31837
|
+
this._activeTab = "guides";
|
|
31838
|
+
(_a2 = this._router) == null ? void 0 : _a2.navigateToGuide(e2.detail);
|
|
31839
|
+
}
|
|
30288
31840
|
render() {
|
|
30289
31841
|
var _a2, _b2;
|
|
30290
31842
|
return b`
|
|
@@ -30294,15 +31846,20 @@ let SpecLensElement = class extends i$1 {
|
|
|
30294
31846
|
<sl-header
|
|
30295
31847
|
.spec=${this._spec}
|
|
30296
31848
|
.authOpen=${this._authOpen}
|
|
31849
|
+
.activeTab=${this._activeTab}
|
|
31850
|
+
.showTabs=${this._hasGuides}
|
|
30297
31851
|
@toggle-theme=${this._handleThemeToggle}
|
|
30298
31852
|
@toggle-sidebar=${() => this._sidebarOpen = !this._sidebarOpen}
|
|
30299
31853
|
@toggle-auth=${() => this._authOpen = !this._authOpen}
|
|
31854
|
+
@tab-change=${this._handleTabChange}
|
|
31855
|
+
@open-search=${() => this._searchOpen = true}
|
|
30300
31856
|
>
|
|
30301
31857
|
<slot name="logo" slot="logo"></slot>
|
|
30302
31858
|
<slot name="header-actions" slot="header-actions"></slot>
|
|
30303
31859
|
</sl-header>
|
|
30304
31860
|
` : null}
|
|
30305
31861
|
|
|
31862
|
+
${this._activeTab === "api" ? b`
|
|
30306
31863
|
<div class="sl-body">
|
|
30307
31864
|
<sl-sidebar
|
|
30308
31865
|
.tagGroups=${this._spec.tagGroups}
|
|
@@ -30374,6 +31931,7 @@ let SpecLensElement = class extends i$1 {
|
|
|
30374
31931
|
.activeOperationId=${this._navigateToId}
|
|
30375
31932
|
?hide-try-it=${this.hideTryIt || ((_b3 = this.config) == null ? void 0 : _b3.hideTryIt)}
|
|
30376
31933
|
?hide-code-samples=${this.hideCodeSamples || ((_c = this.config) == null ? void 0 : _c.hideCodeSamples)}
|
|
31934
|
+
?hide-ask-ai=${this.hideAskAi}
|
|
30377
31935
|
@try-it=${this._handleTryIt}
|
|
30378
31936
|
></sl-operation>
|
|
30379
31937
|
`;
|
|
@@ -30382,6 +31940,22 @@ let SpecLensElement = class extends i$1 {
|
|
|
30382
31940
|
`)}
|
|
30383
31941
|
</main>
|
|
30384
31942
|
</div>
|
|
31943
|
+
` : null}
|
|
31944
|
+
|
|
31945
|
+
${this._activeTab === "guides" && this._hasGuides ? b`
|
|
31946
|
+
<div class="sl-body">
|
|
31947
|
+
<sl-guide-sidebar
|
|
31948
|
+
.categories=${this._guideCategories}
|
|
31949
|
+
.activeGuideSlug=${this._activeGuideSlug}
|
|
31950
|
+
.open=${this._sidebarOpen}
|
|
31951
|
+
@navigate-guide=${this._handleGuideNavigate}
|
|
31952
|
+
@close-sidebar=${() => this._sidebarOpen = false}
|
|
31953
|
+
></sl-guide-sidebar>
|
|
31954
|
+
<sl-guide-view
|
|
31955
|
+
.guide=${this._loadedGuides.get(this._activeGuideSlug) ?? null}
|
|
31956
|
+
></sl-guide-view>
|
|
31957
|
+
</div>
|
|
31958
|
+
` : null}
|
|
30385
31959
|
|
|
30386
31960
|
${this._authOpen && this._spec.securitySchemes.length > 0 ? b`
|
|
30387
31961
|
<sl-auth
|
|
@@ -30399,6 +31973,16 @@ let SpecLensElement = class extends i$1 {
|
|
|
30399
31973
|
<div class="try-it-header">
|
|
30400
31974
|
<span class="method-badge method-${this._tryItOperation.method}">${this._tryItOperation.method}</span>
|
|
30401
31975
|
<span class="try-it-path">${this._tryItOperation.path}</span>
|
|
31976
|
+
${!this.hideAskAi ? b`
|
|
31977
|
+
<div class="try-it-ask-ai-wrapper">
|
|
31978
|
+
<button class="try-it-ask-ai-btn" @click=${this._toggleTryItAiMenu}>
|
|
31979
|
+
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
|
|
31980
|
+
<path d="M8 1l1.5 3.5L13 6l-3.5 1.5L8 11 6.5 7.5 3 6l3.5-1.5L8 1zM3 11l.75 1.75L5.5 13.5l-1.75.75L3 16l-.75-1.75L.5 13.5l1.75-.75L3 11zM12.5 10l.75 1.75 1.75.75-1.75.75-.75 1.75-.75-1.75L10 12.5l1.75-.75.75-1.75z"/>
|
|
31981
|
+
</svg>
|
|
31982
|
+
Ask AI
|
|
31983
|
+
</button>
|
|
31984
|
+
</div>
|
|
31985
|
+
` : null}
|
|
30402
31986
|
<button class="try-it-close" @click=${() => this._tryItOperation = null}>
|
|
30403
31987
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
30404
31988
|
<path d="M4 4l8 8M12 4l-8 8" stroke-linecap="round"/>
|
|
@@ -30416,6 +32000,22 @@ let SpecLensElement = class extends i$1 {
|
|
|
30416
32000
|
</div>
|
|
30417
32001
|
</div>
|
|
30418
32002
|
</div>
|
|
32003
|
+
${this._tryItAiMenuOpen && this._tryItAiMenuRect ? b`
|
|
32004
|
+
<div class="try-it-ai-menu" style="top:${this._tryItAiMenuRect.bottom + 4}px;right:${window.innerWidth - this._tryItAiMenuRect.right}px">
|
|
32005
|
+
<button class="try-it-ai-menu-item" @click=${() => this._openTryItAi("chatgpt")}>
|
|
32006
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
32007
|
+
<path d="M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.677l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.612-1.5z"/>
|
|
32008
|
+
</svg>
|
|
32009
|
+
ChatGPT
|
|
32010
|
+
</button>
|
|
32011
|
+
<button class="try-it-ai-menu-item" @click=${() => this._openTryItAi("claude")}>
|
|
32012
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
32013
|
+
<path d="M13.827 3.52h-3.654L5 20.48h3.213l1.436-4.115h4.847l1.367 4.115H19L13.827 3.52zm-3.192 10.6 1.85-5.3 1.744 5.3h-3.594z"/>
|
|
32014
|
+
</svg>
|
|
32015
|
+
Claude
|
|
32016
|
+
</button>
|
|
32017
|
+
</div>
|
|
32018
|
+
` : null}
|
|
30419
32019
|
` : null}
|
|
30420
32020
|
` : null}
|
|
30421
32021
|
|
|
@@ -30433,6 +32033,15 @@ let SpecLensElement = class extends i$1 {
|
|
|
30433
32033
|
<div class="sl-error-detail">${this._error}</div>
|
|
30434
32034
|
</div>
|
|
30435
32035
|
` : null}
|
|
32036
|
+
|
|
32037
|
+
${this._searchOpen ? b`
|
|
32038
|
+
<sl-search
|
|
32039
|
+
.searchEngine=${this._search}
|
|
32040
|
+
@close=${() => this._searchOpen = false}
|
|
32041
|
+
@select-operation=${this._handleSearchSelectOperation}
|
|
32042
|
+
@select-guide=${this._handleSearchSelectGuide}
|
|
32043
|
+
></sl-search>
|
|
32044
|
+
` : null}
|
|
30436
32045
|
</div>
|
|
30437
32046
|
`;
|
|
30438
32047
|
}
|
|
@@ -30950,6 +32559,75 @@ SpecLensElement.styles = [
|
|
|
30950
32559
|
padding: 0;
|
|
30951
32560
|
}
|
|
30952
32561
|
|
|
32562
|
+
/* ── Ask AI in Try-It modal ──────────── */
|
|
32563
|
+
.try-it-ask-ai-wrapper {
|
|
32564
|
+
position: relative;
|
|
32565
|
+
flex-shrink: 0;
|
|
32566
|
+
}
|
|
32567
|
+
|
|
32568
|
+
.try-it-ask-ai-btn {
|
|
32569
|
+
display: inline-flex;
|
|
32570
|
+
align-items: center;
|
|
32571
|
+
gap: 5px;
|
|
32572
|
+
padding: 4px 12px;
|
|
32573
|
+
border-radius: var(--sl-radius-md);
|
|
32574
|
+
font-size: var(--sl-font-size-xs);
|
|
32575
|
+
font-weight: 600;
|
|
32576
|
+
color: var(--sl-color-text-muted);
|
|
32577
|
+
border: 1px solid var(--sl-color-border);
|
|
32578
|
+
background: transparent;
|
|
32579
|
+
cursor: pointer;
|
|
32580
|
+
transition: all var(--sl-transition-fast);
|
|
32581
|
+
white-space: nowrap;
|
|
32582
|
+
}
|
|
32583
|
+
|
|
32584
|
+
.try-it-ask-ai-btn:hover {
|
|
32585
|
+
background: var(--sl-color-surface-raised);
|
|
32586
|
+
color: var(--sl-color-text);
|
|
32587
|
+
border-color: var(--sl-color-text-muted);
|
|
32588
|
+
}
|
|
32589
|
+
|
|
32590
|
+
.try-it-ai-menu {
|
|
32591
|
+
position: fixed;
|
|
32592
|
+
z-index: 9999;
|
|
32593
|
+
min-width: 150px;
|
|
32594
|
+
background: var(--sl-color-surface);
|
|
32595
|
+
border: 1px solid var(--sl-color-border);
|
|
32596
|
+
border-radius: var(--sl-radius-md);
|
|
32597
|
+
box-shadow: var(--sl-shadow-md);
|
|
32598
|
+
padding: 4px 0;
|
|
32599
|
+
animation: sl-menu-in 120ms ease;
|
|
32600
|
+
}
|
|
32601
|
+
|
|
32602
|
+
@keyframes sl-menu-in {
|
|
32603
|
+
from { opacity: 0; transform: translateY(-4px); }
|
|
32604
|
+
to { opacity: 1; transform: translateY(0); }
|
|
32605
|
+
}
|
|
32606
|
+
|
|
32607
|
+
.try-it-ai-menu-item {
|
|
32608
|
+
display: flex;
|
|
32609
|
+
align-items: center;
|
|
32610
|
+
gap: 8px;
|
|
32611
|
+
width: 100%;
|
|
32612
|
+
padding: 8px 14px;
|
|
32613
|
+
font-size: var(--sl-font-size-sm);
|
|
32614
|
+
color: var(--sl-color-text);
|
|
32615
|
+
cursor: pointer;
|
|
32616
|
+
transition: background var(--sl-transition-fast);
|
|
32617
|
+
white-space: nowrap;
|
|
32618
|
+
text-align: left;
|
|
32619
|
+
background: none;
|
|
32620
|
+
border: none;
|
|
32621
|
+
}
|
|
32622
|
+
|
|
32623
|
+
.try-it-ai-menu-item:hover {
|
|
32624
|
+
background: var(--sl-color-bg-subtle);
|
|
32625
|
+
}
|
|
32626
|
+
|
|
32627
|
+
.try-it-ai-menu-item svg {
|
|
32628
|
+
flex-shrink: 0;
|
|
32629
|
+
}
|
|
32630
|
+
|
|
30953
32631
|
@media (max-width: 768px) {
|
|
30954
32632
|
.sl-main {
|
|
30955
32633
|
padding: var(--sl-spacing-md);
|
|
@@ -30978,9 +32656,15 @@ __decorateClass([
|
|
|
30978
32656
|
__decorateClass([
|
|
30979
32657
|
n2({ type: Boolean, attribute: "hide-code-samples" })
|
|
30980
32658
|
], SpecLensElement.prototype, "hideCodeSamples", 2);
|
|
32659
|
+
__decorateClass([
|
|
32660
|
+
n2({ type: Boolean, attribute: "hide-ask-ai" })
|
|
32661
|
+
], SpecLensElement.prototype, "hideAskAi", 2);
|
|
30981
32662
|
__decorateClass([
|
|
30982
32663
|
n2({ reflect: true, attribute: "layout" })
|
|
30983
32664
|
], SpecLensElement.prototype, "layout", 2);
|
|
32665
|
+
__decorateClass([
|
|
32666
|
+
n2({ attribute: "guides-url" })
|
|
32667
|
+
], SpecLensElement.prototype, "guidesUrl", 2);
|
|
30984
32668
|
__decorateClass([
|
|
30985
32669
|
r$1()
|
|
30986
32670
|
], SpecLensElement.prototype, "_spec", 2);
|
|
@@ -31008,6 +32692,27 @@ __decorateClass([
|
|
|
31008
32692
|
__decorateClass([
|
|
31009
32693
|
r$1()
|
|
31010
32694
|
], SpecLensElement.prototype, "_tryItOperation", 2);
|
|
32695
|
+
__decorateClass([
|
|
32696
|
+
r$1()
|
|
32697
|
+
], SpecLensElement.prototype, "_activeTab", 2);
|
|
32698
|
+
__decorateClass([
|
|
32699
|
+
r$1()
|
|
32700
|
+
], SpecLensElement.prototype, "_guideCategories", 2);
|
|
32701
|
+
__decorateClass([
|
|
32702
|
+
r$1()
|
|
32703
|
+
], SpecLensElement.prototype, "_loadedGuides", 2);
|
|
32704
|
+
__decorateClass([
|
|
32705
|
+
r$1()
|
|
32706
|
+
], SpecLensElement.prototype, "_activeGuideSlug", 2);
|
|
32707
|
+
__decorateClass([
|
|
32708
|
+
r$1()
|
|
32709
|
+
], SpecLensElement.prototype, "_searchOpen", 2);
|
|
32710
|
+
__decorateClass([
|
|
32711
|
+
r$1()
|
|
32712
|
+
], SpecLensElement.prototype, "_tryItAiMenuOpen", 2);
|
|
32713
|
+
__decorateClass([
|
|
32714
|
+
r$1()
|
|
32715
|
+
], SpecLensElement.prototype, "_tryItAiMenuRect", 2);
|
|
31011
32716
|
SpecLensElement = __decorateClass([
|
|
31012
32717
|
t$1("spec-lens")
|
|
31013
32718
|
], SpecLensElement);
|
|
@@ -31051,6 +32756,9 @@ const SpecLens = {
|
|
|
31051
32756
|
if (config.hideCodeSamples) {
|
|
31052
32757
|
el.setAttribute("hide-code-samples", "");
|
|
31053
32758
|
}
|
|
32759
|
+
if (config.guidesUrl) {
|
|
32760
|
+
el.setAttribute("guides-url", config.guidesUrl);
|
|
32761
|
+
}
|
|
31054
32762
|
el.config = config;
|
|
31055
32763
|
container.appendChild(el);
|
|
31056
32764
|
return el;
|