@michaelmishin/speclens 0.1.2 → 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 +126 -5
- package/dist/speclens.iife.js +1323 -134
- package/dist/speclens.iife.js.map +1 -1
- package/dist/speclens.js +2058 -278
- 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``;
|
|
@@ -20292,12 +20500,50 @@ let SlHeader = class extends i$1 {
|
|
|
20292
20500
|
</button>
|
|
20293
20501
|
|
|
20294
20502
|
<div class="title-area">
|
|
20295
|
-
<
|
|
20296
|
-
|
|
20503
|
+
<slot name="logo">
|
|
20504
|
+
<span class="title">${this.spec.title}</span>
|
|
20505
|
+
<span class="version">${this.spec.version}</span>
|
|
20506
|
+
</slot>
|
|
20297
20507
|
</div>
|
|
20298
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
|
+
|
|
20299
20534
|
<div class="spacer"></div>
|
|
20300
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
|
+
|
|
20301
20547
|
<div class="actions">
|
|
20302
20548
|
${this.spec.securitySchemes.length > 0 ? b`
|
|
20303
20549
|
<button
|
|
@@ -20312,6 +20558,8 @@ let SlHeader = class extends i$1 {
|
|
|
20312
20558
|
</button>
|
|
20313
20559
|
` : null}
|
|
20314
20560
|
|
|
20561
|
+
<slot name="header-actions"></slot>
|
|
20562
|
+
|
|
20315
20563
|
<button class="action-btn" @click=${() => this.dispatchEvent(new CustomEvent("toggle-theme"))} title="Toggle theme">
|
|
20316
20564
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
20317
20565
|
<circle cx="9" cy="9" r="4"/>
|
|
@@ -20322,6 +20570,10 @@ let SlHeader = class extends i$1 {
|
|
|
20322
20570
|
</div>
|
|
20323
20571
|
`;
|
|
20324
20572
|
}
|
|
20573
|
+
_switchTab(tab) {
|
|
20574
|
+
if (tab === this.activeTab) return;
|
|
20575
|
+
this.dispatchEvent(new CustomEvent("tab-change", { detail: tab }));
|
|
20576
|
+
}
|
|
20325
20577
|
};
|
|
20326
20578
|
SlHeader.styles = [
|
|
20327
20579
|
resetStyles,
|
|
@@ -20385,8 +20637,115 @@ SlHeader.styles = [
|
|
|
20385
20637
|
white-space: nowrap;
|
|
20386
20638
|
}
|
|
20387
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
|
+
|
|
20388
20693
|
.spacer { flex: 1; }
|
|
20389
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
|
+
|
|
20390
20749
|
.actions {
|
|
20391
20750
|
display: flex;
|
|
20392
20751
|
align-items: center;
|
|
@@ -20445,23 +20804,29 @@ SlHeader.styles = [
|
|
|
20445
20804
|
}
|
|
20446
20805
|
`
|
|
20447
20806
|
];
|
|
20448
|
-
__decorateClass$
|
|
20807
|
+
__decorateClass$d([
|
|
20449
20808
|
n2({ type: Object })
|
|
20450
20809
|
], SlHeader.prototype, "spec", 2);
|
|
20451
|
-
__decorateClass$
|
|
20810
|
+
__decorateClass$d([
|
|
20452
20811
|
n2({ type: Boolean })
|
|
20453
20812
|
], SlHeader.prototype, "authOpen", 2);
|
|
20454
|
-
|
|
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([
|
|
20455
20820
|
t$1("sl-header")
|
|
20456
20821
|
], SlHeader);
|
|
20457
|
-
var __defProp$
|
|
20458
|
-
var __getOwnPropDesc$
|
|
20459
|
-
var __decorateClass$
|
|
20460
|
-
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;
|
|
20461
20826
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
20462
20827
|
if (decorator = decorators[i3])
|
|
20463
20828
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20464
|
-
if (kind && result) __defProp$
|
|
20829
|
+
if (kind && result) __defProp$c(target, key, result);
|
|
20465
20830
|
return result;
|
|
20466
20831
|
};
|
|
20467
20832
|
let SlSidebar = class extends i$1 {
|
|
@@ -20471,6 +20836,8 @@ let SlSidebar = class extends i$1 {
|
|
|
20471
20836
|
this.activeOperationId = "";
|
|
20472
20837
|
this.open = false;
|
|
20473
20838
|
this.searchEngine = null;
|
|
20839
|
+
this.layout = "page";
|
|
20840
|
+
this.securitySchemes = [];
|
|
20474
20841
|
this._searchQuery = "";
|
|
20475
20842
|
this._searchResults = [];
|
|
20476
20843
|
}
|
|
@@ -20481,7 +20848,7 @@ let SlSidebar = class extends i$1 {
|
|
|
20481
20848
|
_handleSearchInput(e2) {
|
|
20482
20849
|
this._searchQuery = e2.target.value;
|
|
20483
20850
|
if (this.searchEngine && this._searchQuery.trim()) {
|
|
20484
|
-
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);
|
|
20485
20852
|
} else {
|
|
20486
20853
|
this._searchResults = [];
|
|
20487
20854
|
}
|
|
@@ -20559,9 +20926,22 @@ let SlSidebar = class extends i$1 {
|
|
|
20559
20926
|
`)}
|
|
20560
20927
|
`}
|
|
20561
20928
|
</div>
|
|
20562
|
-
|
|
20563
|
-
|
|
20564
|
-
|
|
20929
|
+
|
|
20930
|
+
${this.layout === "embed" && this.securitySchemes.length > 0 ? b`
|
|
20931
|
+
<button
|
|
20932
|
+
class="sidebar-auth-btn"
|
|
20933
|
+
@click=${() => this.dispatchEvent(new CustomEvent("toggle-auth", { bubbles: true, composed: true }))}
|
|
20934
|
+
>
|
|
20935
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
|
|
20936
|
+
<rect x="3" y="7" width="10" height="7" rx="1.5"/>
|
|
20937
|
+
<path d="M5.5 7V5a2.5 2.5 0 015 0v2"/>
|
|
20938
|
+
</svg>
|
|
20939
|
+
Authorize
|
|
20940
|
+
</button>
|
|
20941
|
+
` : null}
|
|
20942
|
+
</nav>
|
|
20943
|
+
`;
|
|
20944
|
+
}
|
|
20565
20945
|
};
|
|
20566
20946
|
SlSidebar.styles = [
|
|
20567
20947
|
resetStyles,
|
|
@@ -20804,40 +21184,381 @@ SlSidebar.styles = [
|
|
|
20804
21184
|
color: var(--sl-color-text-muted);
|
|
20805
21185
|
text-align: center;
|
|
20806
21186
|
}
|
|
21187
|
+
|
|
21188
|
+
/* ── Embed-mode auth button ───────────── */
|
|
21189
|
+
.sidebar-auth-btn {
|
|
21190
|
+
display: flex;
|
|
21191
|
+
align-items: center;
|
|
21192
|
+
gap: 8px;
|
|
21193
|
+
margin: var(--sl-spacing-sm) var(--sl-spacing-md) var(--sl-spacing-md);
|
|
21194
|
+
padding: 8px 14px;
|
|
21195
|
+
border-radius: var(--sl-radius-md);
|
|
21196
|
+
border: 1.5px solid var(--sl-color-border);
|
|
21197
|
+
color: var(--sl-color-text-secondary);
|
|
21198
|
+
background: transparent;
|
|
21199
|
+
font-size: var(--sl-font-size-sm);
|
|
21200
|
+
font-weight: 600;
|
|
21201
|
+
cursor: pointer;
|
|
21202
|
+
transition: all var(--sl-transition-fast);
|
|
21203
|
+
flex-shrink: 0;
|
|
21204
|
+
width: calc(100% - var(--sl-spacing-xl));
|
|
21205
|
+
}
|
|
21206
|
+
|
|
21207
|
+
.sidebar-auth-btn:hover {
|
|
21208
|
+
border-color: var(--sl-color-primary);
|
|
21209
|
+
color: var(--sl-color-primary);
|
|
21210
|
+
background: var(--sl-color-sidebar-active);
|
|
21211
|
+
}
|
|
20807
21212
|
`
|
|
20808
21213
|
];
|
|
20809
|
-
__decorateClass$
|
|
21214
|
+
__decorateClass$c([
|
|
20810
21215
|
n2({ type: Array })
|
|
20811
21216
|
], SlSidebar.prototype, "tagGroups", 2);
|
|
20812
|
-
__decorateClass$
|
|
21217
|
+
__decorateClass$c([
|
|
20813
21218
|
n2({ type: String })
|
|
20814
21219
|
], SlSidebar.prototype, "activeOperationId", 2);
|
|
20815
|
-
__decorateClass$
|
|
21220
|
+
__decorateClass$c([
|
|
20816
21221
|
n2({ type: Boolean, reflect: true })
|
|
20817
21222
|
], SlSidebar.prototype, "open", 2);
|
|
20818
|
-
__decorateClass$
|
|
21223
|
+
__decorateClass$c([
|
|
20819
21224
|
n2({ type: Object })
|
|
20820
21225
|
], SlSidebar.prototype, "searchEngine", 2);
|
|
20821
|
-
__decorateClass$
|
|
21226
|
+
__decorateClass$c([
|
|
21227
|
+
n2()
|
|
21228
|
+
], SlSidebar.prototype, "layout", 2);
|
|
21229
|
+
__decorateClass$c([
|
|
21230
|
+
n2({ type: Array })
|
|
21231
|
+
], SlSidebar.prototype, "securitySchemes", 2);
|
|
21232
|
+
__decorateClass$c([
|
|
20822
21233
|
r$1()
|
|
20823
21234
|
], SlSidebar.prototype, "_searchQuery", 2);
|
|
20824
|
-
__decorateClass$
|
|
21235
|
+
__decorateClass$c([
|
|
20825
21236
|
r$1()
|
|
20826
21237
|
], SlSidebar.prototype, "_searchResults", 2);
|
|
20827
|
-
__decorateClass$
|
|
21238
|
+
__decorateClass$c([
|
|
20828
21239
|
e$2(".search-input")
|
|
20829
21240
|
], SlSidebar.prototype, "_searchInput", 2);
|
|
20830
|
-
SlSidebar = __decorateClass$
|
|
21241
|
+
SlSidebar = __decorateClass$c([
|
|
20831
21242
|
t$1("sl-sidebar")
|
|
20832
21243
|
], SlSidebar);
|
|
20833
|
-
var __defProp$
|
|
20834
|
-
var __getOwnPropDesc$
|
|
20835
|
-
var __decorateClass$
|
|
20836
|
-
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;
|
|
20837
21248
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
20838
21249
|
if (decorator = decorators[i3])
|
|
20839
21250
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20840
|
-
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);
|
|
20841
21562
|
return result;
|
|
20842
21563
|
};
|
|
20843
21564
|
let SlParameters = class extends i$1 {
|
|
@@ -20877,7 +21598,7 @@ let SlParameters = class extends i$1 {
|
|
|
20877
21598
|
</div>
|
|
20878
21599
|
<div class="param-type">${this._getType(param.schema)}</div>
|
|
20879
21600
|
<div>
|
|
20880
|
-
<div class="param-desc"
|
|
21601
|
+
<div class="param-desc" .innerHTML=${marked.parse(param.description || "")}></div>
|
|
20881
21602
|
${param.example !== void 0 ? b`
|
|
20882
21603
|
<div class="param-example">Example: <code>${JSON.stringify(param.example)}</code></div>
|
|
20883
21604
|
` : null}
|
|
@@ -20966,17 +21687,122 @@ SlParameters.styles = [
|
|
|
20966
21687
|
line-height: 1.5;
|
|
20967
21688
|
}
|
|
20968
21689
|
|
|
20969
|
-
.param-
|
|
20970
|
-
|
|
20971
|
-
color: var(--sl-color-text-muted);
|
|
20972
|
-
margin-top: 2px;
|
|
21690
|
+
.param-desc p {
|
|
21691
|
+
margin: 0 0 var(--sl-spacing-xs) 0;
|
|
20973
21692
|
}
|
|
20974
21693
|
|
|
20975
|
-
.param-
|
|
21694
|
+
.param-desc p:last-child {
|
|
21695
|
+
margin-bottom: 0;
|
|
21696
|
+
}
|
|
21697
|
+
|
|
21698
|
+
.param-desc code {
|
|
20976
21699
|
background: var(--sl-color-code-bg);
|
|
20977
|
-
padding: 1px
|
|
21700
|
+
padding: 1px 5px;
|
|
20978
21701
|
border-radius: var(--sl-radius-sm);
|
|
20979
|
-
font-size:
|
|
21702
|
+
font-size: 0.85em;
|
|
21703
|
+
border: 1px solid var(--sl-color-border);
|
|
21704
|
+
}
|
|
21705
|
+
|
|
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;
|
|
21713
|
+
}
|
|
21714
|
+
|
|
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);
|
|
21721
|
+
}
|
|
21722
|
+
|
|
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);
|
|
20980
21806
|
}
|
|
20981
21807
|
|
|
20982
21808
|
.param-enum {
|
|
@@ -21003,10 +21829,10 @@ SlParameters.styles = [
|
|
|
21003
21829
|
}
|
|
21004
21830
|
`
|
|
21005
21831
|
];
|
|
21006
|
-
__decorateClass$
|
|
21832
|
+
__decorateClass$a([
|
|
21007
21833
|
n2({ type: Array })
|
|
21008
21834
|
], SlParameters.prototype, "parameters", 2);
|
|
21009
|
-
SlParameters = __decorateClass$
|
|
21835
|
+
SlParameters = __decorateClass$a([
|
|
21010
21836
|
t$1("sl-parameters")
|
|
21011
21837
|
], SlParameters);
|
|
21012
21838
|
const SKIP_SYMBOL = Symbol("skip");
|
|
@@ -23199,14 +24025,14 @@ _registerSampler("integer", sampleNumber);
|
|
|
23199
24025
|
_registerSampler("number", sampleNumber);
|
|
23200
24026
|
_registerSampler("object", sampleObject);
|
|
23201
24027
|
_registerSampler("string", sampleString);
|
|
23202
|
-
var __defProp$
|
|
23203
|
-
var __getOwnPropDesc$
|
|
23204
|
-
var __decorateClass$
|
|
23205
|
-
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;
|
|
23206
24032
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
23207
24033
|
if (decorator = decorators[i3])
|
|
23208
24034
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23209
|
-
if (kind && result) __defProp$
|
|
24035
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
23210
24036
|
return result;
|
|
23211
24037
|
};
|
|
23212
24038
|
let SlRequestBody = class extends i$1 {
|
|
@@ -23361,13 +24187,13 @@ SlRequestBody.styles = [
|
|
|
23361
24187
|
}
|
|
23362
24188
|
`
|
|
23363
24189
|
];
|
|
23364
|
-
__decorateClass$
|
|
24190
|
+
__decorateClass$9([
|
|
23365
24191
|
n2({ type: Object })
|
|
23366
24192
|
], SlRequestBody.prototype, "requestBody", 2);
|
|
23367
|
-
__decorateClass$
|
|
24193
|
+
__decorateClass$9([
|
|
23368
24194
|
r$1()
|
|
23369
24195
|
], SlRequestBody.prototype, "_activeMediaType", 2);
|
|
23370
|
-
SlRequestBody = __decorateClass$
|
|
24196
|
+
SlRequestBody = __decorateClass$9([
|
|
23371
24197
|
t$1("sl-request-body")
|
|
23372
24198
|
], SlRequestBody);
|
|
23373
24199
|
/**
|
|
@@ -23413,14 +24239,14 @@ class e extends i2 {
|
|
|
23413
24239
|
}
|
|
23414
24240
|
e.directiveName = "unsafeHTML", e.resultType = 1;
|
|
23415
24241
|
const o = e$1(e);
|
|
23416
|
-
var __defProp$
|
|
23417
|
-
var __getOwnPropDesc$
|
|
23418
|
-
var __decorateClass$
|
|
23419
|
-
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;
|
|
23420
24246
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
23421
24247
|
if (decorator = decorators[i3])
|
|
23422
24248
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23423
|
-
if (kind && result) __defProp$
|
|
24249
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
23424
24250
|
return result;
|
|
23425
24251
|
};
|
|
23426
24252
|
let SlResponses = class extends i$1 {
|
|
@@ -23676,13 +24502,13 @@ SlResponses.styles = [
|
|
|
23676
24502
|
.hl-kw { color: #569cd6; }
|
|
23677
24503
|
`
|
|
23678
24504
|
];
|
|
23679
|
-
__decorateClass$
|
|
24505
|
+
__decorateClass$8([
|
|
23680
24506
|
n2({ type: Array })
|
|
23681
24507
|
], SlResponses.prototype, "responses", 2);
|
|
23682
|
-
__decorateClass$
|
|
24508
|
+
__decorateClass$8([
|
|
23683
24509
|
r$1()
|
|
23684
24510
|
], SlResponses.prototype, "_activeTab", 2);
|
|
23685
|
-
SlResponses = __decorateClass$
|
|
24511
|
+
SlResponses = __decorateClass$8([
|
|
23686
24512
|
t$1("sl-responses")
|
|
23687
24513
|
], SlResponses);
|
|
23688
24514
|
const globalObject = (function() {
|
|
@@ -27259,14 +28085,14 @@ class HTTPSnippet {
|
|
|
27259
28085
|
return results.length === 1 ? results[0] : results;
|
|
27260
28086
|
}
|
|
27261
28087
|
}
|
|
27262
|
-
var __defProp$
|
|
27263
|
-
var __getOwnPropDesc$
|
|
27264
|
-
var __decorateClass$
|
|
27265
|
-
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;
|
|
27266
28092
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
27267
28093
|
if (decorator = decorators[i3])
|
|
27268
28094
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
27269
|
-
if (kind && result) __defProp$
|
|
28095
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
27270
28096
|
return result;
|
|
27271
28097
|
};
|
|
27272
28098
|
const LANGUAGES = [
|
|
@@ -28068,44 +28894,44 @@ SlCodeSamples.styles = [
|
|
|
28068
28894
|
.hl-key { color: #9cdcfe; }
|
|
28069
28895
|
`
|
|
28070
28896
|
];
|
|
28071
|
-
__decorateClass$
|
|
28897
|
+
__decorateClass$7([
|
|
28072
28898
|
n2({ type: Object })
|
|
28073
28899
|
], SlCodeSamples.prototype, "operation", 2);
|
|
28074
|
-
__decorateClass$
|
|
28900
|
+
__decorateClass$7([
|
|
28075
28901
|
n2({ type: Array })
|
|
28076
28902
|
], SlCodeSamples.prototype, "servers", 2);
|
|
28077
|
-
__decorateClass$
|
|
28903
|
+
__decorateClass$7([
|
|
28078
28904
|
n2({ type: Object })
|
|
28079
28905
|
], SlCodeSamples.prototype, "authState", 2);
|
|
28080
|
-
__decorateClass$
|
|
28906
|
+
__decorateClass$7([
|
|
28081
28907
|
n2({ type: Array })
|
|
28082
28908
|
], SlCodeSamples.prototype, "securitySchemes", 2);
|
|
28083
|
-
__decorateClass$
|
|
28909
|
+
__decorateClass$7([
|
|
28084
28910
|
r$1()
|
|
28085
28911
|
], SlCodeSamples.prototype, "_activeTab", 2);
|
|
28086
|
-
__decorateClass$
|
|
28912
|
+
__decorateClass$7([
|
|
28087
28913
|
r$1()
|
|
28088
28914
|
], SlCodeSamples.prototype, "_snippets", 2);
|
|
28089
|
-
__decorateClass$
|
|
28915
|
+
__decorateClass$7([
|
|
28090
28916
|
r$1()
|
|
28091
28917
|
], SlCodeSamples.prototype, "_copied", 2);
|
|
28092
|
-
__decorateClass$
|
|
28918
|
+
__decorateClass$7([
|
|
28093
28919
|
r$1()
|
|
28094
28920
|
], SlCodeSamples.prototype, "_overflowStart", 2);
|
|
28095
|
-
__decorateClass$
|
|
28921
|
+
__decorateClass$7([
|
|
28096
28922
|
r$1()
|
|
28097
28923
|
], SlCodeSamples.prototype, "_moreOpen", 2);
|
|
28098
|
-
SlCodeSamples = __decorateClass$
|
|
28924
|
+
SlCodeSamples = __decorateClass$7([
|
|
28099
28925
|
t$1("sl-code-samples")
|
|
28100
28926
|
], SlCodeSamples);
|
|
28101
|
-
var __defProp$
|
|
28102
|
-
var __getOwnPropDesc$
|
|
28103
|
-
var __decorateClass$
|
|
28104
|
-
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;
|
|
28105
28931
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
28106
28932
|
if (decorator = decorators[i3])
|
|
28107
28933
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
28108
|
-
if (kind && result) __defProp$
|
|
28934
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
28109
28935
|
return result;
|
|
28110
28936
|
};
|
|
28111
28937
|
let SlSchema = class extends i$1 {
|
|
@@ -28415,26 +29241,26 @@ SlSchema.styles = [
|
|
|
28415
29241
|
}
|
|
28416
29242
|
`
|
|
28417
29243
|
];
|
|
28418
|
-
__decorateClass$
|
|
29244
|
+
__decorateClass$6([
|
|
28419
29245
|
n2({ type: Object })
|
|
28420
29246
|
], SlSchema.prototype, "schema", 2);
|
|
28421
|
-
__decorateClass$
|
|
29247
|
+
__decorateClass$6([
|
|
28422
29248
|
n2({ type: Number })
|
|
28423
29249
|
], SlSchema.prototype, "depth", 2);
|
|
28424
|
-
__decorateClass$
|
|
29250
|
+
__decorateClass$6([
|
|
28425
29251
|
r$1()
|
|
28426
29252
|
], SlSchema.prototype, "_expanded", 2);
|
|
28427
|
-
SlSchema = __decorateClass$
|
|
29253
|
+
SlSchema = __decorateClass$6([
|
|
28428
29254
|
t$1("sl-schema")
|
|
28429
29255
|
], SlSchema);
|
|
28430
|
-
var __defProp$
|
|
28431
|
-
var __getOwnPropDesc$
|
|
28432
|
-
var __decorateClass$
|
|
28433
|
-
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;
|
|
28434
29260
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
28435
29261
|
if (decorator = decorators[i3])
|
|
28436
29262
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
28437
|
-
if (kind && result) __defProp$
|
|
29263
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
28438
29264
|
return result;
|
|
28439
29265
|
};
|
|
28440
29266
|
let SlOperation = class extends i$1 {
|
|
@@ -28446,8 +29272,12 @@ let SlOperation = class extends i$1 {
|
|
|
28446
29272
|
this.proxyUrl = "";
|
|
28447
29273
|
this.hideTryIt = false;
|
|
28448
29274
|
this.hideCodeSamples = false;
|
|
29275
|
+
this.hideAskAi = false;
|
|
28449
29276
|
this.activeOperationId = "";
|
|
28450
29277
|
this._expanded = false;
|
|
29278
|
+
this._routeCopied = false;
|
|
29279
|
+
this._aiMenuOpen = false;
|
|
29280
|
+
this._aiMenuRect = null;
|
|
28451
29281
|
}
|
|
28452
29282
|
willUpdate(changed) {
|
|
28453
29283
|
var _a2;
|
|
@@ -28473,6 +29303,40 @@ let SlOperation = class extends i$1 {
|
|
|
28473
29303
|
composed: true
|
|
28474
29304
|
}));
|
|
28475
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
|
+
}
|
|
28476
29340
|
render() {
|
|
28477
29341
|
const op = this.operation;
|
|
28478
29342
|
if (!op) return b``;
|
|
@@ -28481,8 +29345,30 @@ let SlOperation = class extends i$1 {
|
|
|
28481
29345
|
<div class="op-header" @click=${this._toggle}>
|
|
28482
29346
|
<span class="method-badge method-${op.method}">${op.method}</span>
|
|
28483
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>
|
|
28484
29360
|
<span class="op-summary">${op.summary}</span>
|
|
28485
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}
|
|
28486
29372
|
${!this.hideTryIt ? b`
|
|
28487
29373
|
<button class="try-it-btn" @click=${this._openTryIt}>
|
|
28488
29374
|
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
|
|
@@ -28561,6 +29447,22 @@ let SlOperation = class extends i$1 {
|
|
|
28561
29447
|
</div>
|
|
28562
29448
|
` : null}
|
|
28563
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}
|
|
28564
29466
|
`;
|
|
28565
29467
|
}
|
|
28566
29468
|
};
|
|
@@ -28797,6 +29699,103 @@ SlOperation.styles = [
|
|
|
28797
29699
|
color: var(--sl-color-text);
|
|
28798
29700
|
}
|
|
28799
29701
|
|
|
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;
|
|
29712
|
+
}
|
|
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
|
+
|
|
28800
29799
|
@media (max-width: 900px) {
|
|
28801
29800
|
.op-body {
|
|
28802
29801
|
grid-template-columns: 1fr;
|
|
@@ -28811,44 +29810,56 @@ SlOperation.styles = [
|
|
|
28811
29810
|
}
|
|
28812
29811
|
`
|
|
28813
29812
|
];
|
|
28814
|
-
__decorateClass$
|
|
29813
|
+
__decorateClass$5([
|
|
28815
29814
|
n2({ type: Object })
|
|
28816
29815
|
], SlOperation.prototype, "operation", 2);
|
|
28817
|
-
__decorateClass$
|
|
29816
|
+
__decorateClass$5([
|
|
28818
29817
|
n2({ type: Array })
|
|
28819
29818
|
], SlOperation.prototype, "servers", 2);
|
|
28820
|
-
__decorateClass$
|
|
29819
|
+
__decorateClass$5([
|
|
28821
29820
|
n2({ type: Array })
|
|
28822
29821
|
], SlOperation.prototype, "securitySchemes", 2);
|
|
28823
|
-
__decorateClass$
|
|
29822
|
+
__decorateClass$5([
|
|
28824
29823
|
n2({ type: Object })
|
|
28825
29824
|
], SlOperation.prototype, "authState", 2);
|
|
28826
|
-
__decorateClass$
|
|
29825
|
+
__decorateClass$5([
|
|
28827
29826
|
n2({ type: String })
|
|
28828
29827
|
], SlOperation.prototype, "proxyUrl", 2);
|
|
28829
|
-
__decorateClass$
|
|
29828
|
+
__decorateClass$5([
|
|
28830
29829
|
n2({ type: Boolean, attribute: "hide-try-it" })
|
|
28831
29830
|
], SlOperation.prototype, "hideTryIt", 2);
|
|
28832
|
-
__decorateClass$
|
|
29831
|
+
__decorateClass$5([
|
|
28833
29832
|
n2({ type: Boolean, attribute: "hide-code-samples" })
|
|
28834
29833
|
], SlOperation.prototype, "hideCodeSamples", 2);
|
|
28835
|
-
__decorateClass$
|
|
29834
|
+
__decorateClass$5([
|
|
29835
|
+
n2({ type: Boolean, attribute: "hide-ask-ai" })
|
|
29836
|
+
], SlOperation.prototype, "hideAskAi", 2);
|
|
29837
|
+
__decorateClass$5([
|
|
28836
29838
|
n2({ type: String })
|
|
28837
29839
|
], SlOperation.prototype, "activeOperationId", 2);
|
|
28838
|
-
__decorateClass$
|
|
29840
|
+
__decorateClass$5([
|
|
28839
29841
|
r$1()
|
|
28840
29842
|
], SlOperation.prototype, "_expanded", 2);
|
|
28841
|
-
|
|
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([
|
|
28842
29853
|
t$1("sl-operation")
|
|
28843
29854
|
], SlOperation);
|
|
28844
|
-
var __defProp$
|
|
28845
|
-
var __getOwnPropDesc$
|
|
28846
|
-
var __decorateClass$
|
|
28847
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
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;
|
|
28848
29859
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
28849
29860
|
if (decorator = decorators[i3])
|
|
28850
29861
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
28851
|
-
if (kind && result) __defProp$
|
|
29862
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
28852
29863
|
return result;
|
|
28853
29864
|
};
|
|
28854
29865
|
let SlTryIt = class extends i$1 {
|
|
@@ -29481,59 +30492,59 @@ SlTryIt.styles = [
|
|
|
29481
30492
|
}
|
|
29482
30493
|
`
|
|
29483
30494
|
];
|
|
29484
|
-
__decorateClass$
|
|
30495
|
+
__decorateClass$4([
|
|
29485
30496
|
n2({ type: Object })
|
|
29486
30497
|
], SlTryIt.prototype, "operation", 2);
|
|
29487
|
-
__decorateClass$
|
|
30498
|
+
__decorateClass$4([
|
|
29488
30499
|
n2({ type: Array })
|
|
29489
30500
|
], SlTryIt.prototype, "servers", 2);
|
|
29490
|
-
__decorateClass$
|
|
30501
|
+
__decorateClass$4([
|
|
29491
30502
|
n2({ type: Array })
|
|
29492
30503
|
], SlTryIt.prototype, "securitySchemes", 2);
|
|
29493
|
-
__decorateClass$
|
|
30504
|
+
__decorateClass$4([
|
|
29494
30505
|
n2({ type: Object })
|
|
29495
30506
|
], SlTryIt.prototype, "authState", 2);
|
|
29496
|
-
__decorateClass$
|
|
30507
|
+
__decorateClass$4([
|
|
29497
30508
|
n2({ type: String })
|
|
29498
30509
|
], SlTryIt.prototype, "proxyUrl", 2);
|
|
29499
|
-
__decorateClass$
|
|
30510
|
+
__decorateClass$4([
|
|
29500
30511
|
r$1()
|
|
29501
30512
|
], SlTryIt.prototype, "_paramValues", 2);
|
|
29502
|
-
__decorateClass$
|
|
30513
|
+
__decorateClass$4([
|
|
29503
30514
|
r$1()
|
|
29504
30515
|
], SlTryIt.prototype, "_bodyValue", 2);
|
|
29505
|
-
__decorateClass$
|
|
30516
|
+
__decorateClass$4([
|
|
29506
30517
|
r$1()
|
|
29507
30518
|
], SlTryIt.prototype, "_formFields", 2);
|
|
29508
|
-
__decorateClass$
|
|
30519
|
+
__decorateClass$4([
|
|
29509
30520
|
r$1()
|
|
29510
30521
|
], SlTryIt.prototype, "_selectedServer", 2);
|
|
29511
|
-
__decorateClass$
|
|
30522
|
+
__decorateClass$4([
|
|
29512
30523
|
r$1()
|
|
29513
30524
|
], SlTryIt.prototype, "_response", 2);
|
|
29514
|
-
__decorateClass$
|
|
30525
|
+
__decorateClass$4([
|
|
29515
30526
|
r$1()
|
|
29516
30527
|
], SlTryIt.prototype, "_loading", 2);
|
|
29517
|
-
__decorateClass$
|
|
30528
|
+
__decorateClass$4([
|
|
29518
30529
|
r$1()
|
|
29519
30530
|
], SlTryIt.prototype, "_error", 2);
|
|
29520
|
-
__decorateClass$
|
|
30531
|
+
__decorateClass$4([
|
|
29521
30532
|
r$1()
|
|
29522
30533
|
], SlTryIt.prototype, "_showResponseHeaders", 2);
|
|
29523
|
-
__decorateClass$
|
|
30534
|
+
__decorateClass$4([
|
|
29524
30535
|
r$1()
|
|
29525
30536
|
], SlTryIt.prototype, "_initialized", 2);
|
|
29526
|
-
SlTryIt = __decorateClass$
|
|
30537
|
+
SlTryIt = __decorateClass$4([
|
|
29527
30538
|
t$1("sl-try-it")
|
|
29528
30539
|
], SlTryIt);
|
|
29529
|
-
var __defProp$
|
|
29530
|
-
var __getOwnPropDesc$
|
|
29531
|
-
var __decorateClass$
|
|
29532
|
-
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;
|
|
29533
30544
|
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
29534
30545
|
if (decorator = decorators[i3])
|
|
29535
30546
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
29536
|
-
if (kind && result) __defProp$
|
|
30547
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
29537
30548
|
return result;
|
|
29538
30549
|
};
|
|
29539
30550
|
let SlAuth = class extends i$1 {
|
|
@@ -29984,115 +30995,608 @@ SlAuth.styles = [
|
|
|
29984
30995
|
color: var(--sl-color-text);
|
|
29985
30996
|
}
|
|
29986
30997
|
|
|
29987
|
-
.unsupported-card {
|
|
29988
|
-
padding: var(--sl-spacing-md) var(--sl-spacing-lg);
|
|
29989
|
-
border: 1px dashed var(--sl-color-border);
|
|
29990
|
-
border-radius: var(--sl-radius-lg);
|
|
29991
|
-
background: transparent;
|
|
29992
|
-
display: flex;
|
|
29993
|
-
align-items: center;
|
|
29994
|
-
justify-content: space-between;
|
|
29995
|
-
gap: var(--sl-spacing-md);
|
|
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);
|
|
31492
|
+
}
|
|
31493
|
+
.guide-content a:hover {
|
|
31494
|
+
text-decoration: underline;
|
|
29996
31495
|
}
|
|
29997
31496
|
|
|
29998
|
-
.
|
|
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;
|
|
29999
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);
|
|
30000
31513
|
font-weight: 600;
|
|
30001
31514
|
color: var(--sl-color-text);
|
|
31515
|
+
border-bottom: 2px solid var(--sl-color-border);
|
|
30002
31516
|
}
|
|
30003
|
-
|
|
30004
|
-
|
|
30005
|
-
|
|
30006
|
-
color: var(--sl-color-text-
|
|
30007
|
-
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);
|
|
30008
31521
|
}
|
|
30009
|
-
|
|
30010
|
-
|
|
30011
|
-
font-size: 10px;
|
|
30012
|
-
font-weight: 600;
|
|
30013
|
-
letter-spacing: 0.04em;
|
|
30014
|
-
text-transform: uppercase;
|
|
30015
|
-
padding: 2px 8px;
|
|
30016
|
-
border-radius: var(--sl-radius-full);
|
|
30017
|
-
background: var(--sl-color-surface-raised);
|
|
30018
|
-
color: var(--sl-color-text-muted);
|
|
30019
|
-
white-space: nowrap;
|
|
30020
|
-
flex-shrink: 0;
|
|
31522
|
+
.guide-content tr:last-child td {
|
|
31523
|
+
border-bottom: none;
|
|
30021
31524
|
}
|
|
30022
|
-
|
|
30023
|
-
.modal-footer {
|
|
30024
|
-
display: flex;
|
|
30025
|
-
align-items: center;
|
|
30026
|
-
justify-content: space-between;
|
|
30027
|
-
gap: var(--sl-spacing-sm);
|
|
30028
|
-
padding: var(--sl-spacing-md) var(--sl-spacing-xl);
|
|
30029
|
-
border-top: 1px solid var(--sl-color-border);
|
|
31525
|
+
.guide-content tbody tr:hover {
|
|
30030
31526
|
background: var(--sl-color-bg-subtle);
|
|
30031
|
-
flex-shrink: 0;
|
|
30032
31527
|
}
|
|
30033
31528
|
|
|
30034
|
-
.
|
|
30035
|
-
|
|
30036
|
-
|
|
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);
|
|
30037
31539
|
}
|
|
30038
31540
|
|
|
30039
|
-
.
|
|
30040
|
-
|
|
30041
|
-
|
|
30042
|
-
|
|
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);
|
|
30043
31551
|
}
|
|
30044
31552
|
|
|
30045
|
-
.
|
|
30046
|
-
|
|
30047
|
-
|
|
30048
|
-
|
|
30049
|
-
|
|
30050
|
-
color: var(--sl-color-text-secondary);
|
|
30051
|
-
border: 1px solid var(--sl-color-border);
|
|
30052
|
-
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;
|
|
30053
31558
|
}
|
|
30054
31559
|
|
|
30055
|
-
.
|
|
30056
|
-
|
|
30057
|
-
|
|
30058
|
-
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;
|
|
30059
31565
|
}
|
|
30060
31566
|
|
|
30061
|
-
|
|
31567
|
+
/* ── Empty state ───────────────────── */
|
|
31568
|
+
.empty {
|
|
30062
31569
|
display: flex;
|
|
31570
|
+
flex-direction: column;
|
|
30063
31571
|
align-items: center;
|
|
30064
|
-
|
|
30065
|
-
|
|
30066
|
-
|
|
30067
|
-
|
|
30068
|
-
|
|
30069
|
-
color: var(--sl-color-primary-text);
|
|
30070
|
-
background: var(--sl-color-primary);
|
|
30071
|
-
transition: all var(--sl-transition-fast);
|
|
30072
|
-
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;
|
|
30073
31577
|
}
|
|
30074
31578
|
|
|
30075
|
-
.
|
|
30076
|
-
|
|
30077
|
-
|
|
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
|
+
}
|
|
30078
31591
|
}
|
|
30079
31592
|
`
|
|
30080
31593
|
];
|
|
30081
|
-
__decorateClass$1([
|
|
30082
|
-
n2({ type: Array })
|
|
30083
|
-
], SlAuth.prototype, "securitySchemes", 2);
|
|
30084
31594
|
__decorateClass$1([
|
|
30085
31595
|
n2({ type: Object })
|
|
30086
|
-
],
|
|
30087
|
-
__decorateClass$1([
|
|
30088
|
-
|
|
30089
|
-
],
|
|
30090
|
-
__decorateClass$1([
|
|
30091
|
-
r$1()
|
|
30092
|
-
], SlAuth.prototype, "_showTokens", 2);
|
|
30093
|
-
SlAuth = __decorateClass$1([
|
|
30094
|
-
t$1("sl-auth")
|
|
30095
|
-
], SlAuth);
|
|
31596
|
+
], SlGuideView.prototype, "guide", 2);
|
|
31597
|
+
SlGuideView = __decorateClass$1([
|
|
31598
|
+
t$1("sl-guide-view")
|
|
31599
|
+
], SlGuideView);
|
|
30096
31600
|
var __defProp2 = Object.defineProperty;
|
|
30097
31601
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
30098
31602
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -30111,6 +31615,9 @@ let SpecLensElement = class extends i$1 {
|
|
|
30111
31615
|
this.theme = "auto";
|
|
30112
31616
|
this.hideTryIt = false;
|
|
30113
31617
|
this.hideCodeSamples = false;
|
|
31618
|
+
this.hideAskAi = false;
|
|
31619
|
+
this.layout = "page";
|
|
31620
|
+
this.guidesUrl = "";
|
|
30114
31621
|
this.config = {};
|
|
30115
31622
|
this._spec = null;
|
|
30116
31623
|
this._loading = false;
|
|
@@ -30121,6 +31628,13 @@ let SpecLensElement = class extends i$1 {
|
|
|
30121
31628
|
this._navigateToId = "";
|
|
30122
31629
|
this._authState = { apiKeys: {}, bearerTokens: {} };
|
|
30123
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;
|
|
30124
31638
|
this._search = null;
|
|
30125
31639
|
this._router = null;
|
|
30126
31640
|
this._themeManager = null;
|
|
@@ -30128,19 +31642,27 @@ let SpecLensElement = class extends i$1 {
|
|
|
30128
31642
|
this._handleKeyDown = (e2) => {
|
|
30129
31643
|
if ((e2.metaKey || e2.ctrlKey) && e2.key === "k") {
|
|
30130
31644
|
e2.preventDefault();
|
|
30131
|
-
|
|
30132
|
-
sidebar == null ? void 0 : sidebar.focusSearch();
|
|
31645
|
+
this._searchOpen = true;
|
|
30133
31646
|
}
|
|
30134
31647
|
};
|
|
30135
31648
|
}
|
|
31649
|
+
get _hasGuides() {
|
|
31650
|
+
return this._guideCategories.length > 0;
|
|
31651
|
+
}
|
|
30136
31652
|
connectedCallback() {
|
|
30137
31653
|
super.connectedCallback();
|
|
30138
31654
|
this._themeManager = new ThemeManager(this);
|
|
30139
31655
|
this._themeManager.init(this.theme);
|
|
30140
|
-
this._router = new Router((
|
|
30141
|
-
|
|
30142
|
-
|
|
30143
|
-
|
|
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
|
+
}
|
|
30144
31666
|
});
|
|
30145
31667
|
this._router.init();
|
|
30146
31668
|
document.addEventListener("keydown", this._handleKeyDown);
|
|
@@ -30158,6 +31680,9 @@ let SpecLensElement = class extends i$1 {
|
|
|
30158
31680
|
if (changed.has("specUrl") || changed.has("config")) {
|
|
30159
31681
|
this._loadSpec();
|
|
30160
31682
|
}
|
|
31683
|
+
if (changed.has("guidesUrl") || changed.has("config")) {
|
|
31684
|
+
this._loadGuides();
|
|
31685
|
+
}
|
|
30161
31686
|
if (changed.has("theme")) {
|
|
30162
31687
|
(_a2 = this._themeManager) == null ? void 0 : _a2.setTheme(this.theme);
|
|
30163
31688
|
}
|
|
@@ -30230,31 +31755,126 @@ let SpecLensElement = class extends i$1 {
|
|
|
30230
31755
|
_handleTryIt(e2) {
|
|
30231
31756
|
this._tryItOperation = e2.detail;
|
|
30232
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
|
+
}
|
|
31783
|
+
/** Set the color theme programmatically. Useful in embed mode where the header is hidden. */
|
|
31784
|
+
setTheme(preference) {
|
|
31785
|
+
this.theme = preference;
|
|
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
|
+
}
|
|
30233
31840
|
render() {
|
|
30234
31841
|
var _a2, _b2;
|
|
30235
31842
|
return b`
|
|
30236
31843
|
<div class="sl-root" data-theme=${((_a2 = this._themeManager) == null ? void 0 : _a2.resolved) ?? "light"}>
|
|
30237
31844
|
${this._spec ? b`
|
|
30238
|
-
|
|
30239
|
-
|
|
30240
|
-
|
|
30241
|
-
|
|
30242
|
-
|
|
30243
|
-
|
|
30244
|
-
|
|
31845
|
+
${this.layout === "page" ? b`
|
|
31846
|
+
<sl-header
|
|
31847
|
+
.spec=${this._spec}
|
|
31848
|
+
.authOpen=${this._authOpen}
|
|
31849
|
+
.activeTab=${this._activeTab}
|
|
31850
|
+
.showTabs=${this._hasGuides}
|
|
31851
|
+
@toggle-theme=${this._handleThemeToggle}
|
|
31852
|
+
@toggle-sidebar=${() => this._sidebarOpen = !this._sidebarOpen}
|
|
31853
|
+
@toggle-auth=${() => this._authOpen = !this._authOpen}
|
|
31854
|
+
@tab-change=${this._handleTabChange}
|
|
31855
|
+
@open-search=${() => this._searchOpen = true}
|
|
31856
|
+
>
|
|
31857
|
+
<slot name="logo" slot="logo"></slot>
|
|
31858
|
+
<slot name="header-actions" slot="header-actions"></slot>
|
|
31859
|
+
</sl-header>
|
|
31860
|
+
` : null}
|
|
30245
31861
|
|
|
31862
|
+
${this._activeTab === "api" ? b`
|
|
30246
31863
|
<div class="sl-body">
|
|
30247
31864
|
<sl-sidebar
|
|
30248
31865
|
.tagGroups=${this._spec.tagGroups}
|
|
30249
31866
|
.activeOperationId=${this._activeOperationId}
|
|
30250
31867
|
.open=${this._sidebarOpen}
|
|
30251
31868
|
.searchEngine=${this._search}
|
|
31869
|
+
.layout=${this.layout}
|
|
31870
|
+
.securitySchemes=${this._spec.securitySchemes}
|
|
30252
31871
|
@navigate=${(e2) => {
|
|
30253
31872
|
var _a3;
|
|
30254
31873
|
return (_a3 = this._router) == null ? void 0 : _a3.navigateTo(e2.detail);
|
|
30255
31874
|
}}
|
|
30256
31875
|
@navigate-intro=${() => this._scrollToIntro()}
|
|
30257
31876
|
@close-sidebar=${() => this._sidebarOpen = false}
|
|
31877
|
+
@toggle-auth=${() => this._authOpen = !this._authOpen}
|
|
30258
31878
|
></sl-sidebar>
|
|
30259
31879
|
|
|
30260
31880
|
<main class="sl-main">
|
|
@@ -30311,6 +31931,7 @@ let SpecLensElement = class extends i$1 {
|
|
|
30311
31931
|
.activeOperationId=${this._navigateToId}
|
|
30312
31932
|
?hide-try-it=${this.hideTryIt || ((_b3 = this.config) == null ? void 0 : _b3.hideTryIt)}
|
|
30313
31933
|
?hide-code-samples=${this.hideCodeSamples || ((_c = this.config) == null ? void 0 : _c.hideCodeSamples)}
|
|
31934
|
+
?hide-ask-ai=${this.hideAskAi}
|
|
30314
31935
|
@try-it=${this._handleTryIt}
|
|
30315
31936
|
></sl-operation>
|
|
30316
31937
|
`;
|
|
@@ -30319,6 +31940,22 @@ let SpecLensElement = class extends i$1 {
|
|
|
30319
31940
|
`)}
|
|
30320
31941
|
</main>
|
|
30321
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}
|
|
30322
31959
|
|
|
30323
31960
|
${this._authOpen && this._spec.securitySchemes.length > 0 ? b`
|
|
30324
31961
|
<sl-auth
|
|
@@ -30336,6 +31973,16 @@ let SpecLensElement = class extends i$1 {
|
|
|
30336
31973
|
<div class="try-it-header">
|
|
30337
31974
|
<span class="method-badge method-${this._tryItOperation.method}">${this._tryItOperation.method}</span>
|
|
30338
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}
|
|
30339
31986
|
<button class="try-it-close" @click=${() => this._tryItOperation = null}>
|
|
30340
31987
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
30341
31988
|
<path d="M4 4l8 8M12 4l-8 8" stroke-linecap="round"/>
|
|
@@ -30353,6 +32000,22 @@ let SpecLensElement = class extends i$1 {
|
|
|
30353
32000
|
</div>
|
|
30354
32001
|
</div>
|
|
30355
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}
|
|
30356
32019
|
` : null}
|
|
30357
32020
|
` : null}
|
|
30358
32021
|
|
|
@@ -30370,6 +32033,15 @@ let SpecLensElement = class extends i$1 {
|
|
|
30370
32033
|
<div class="sl-error-detail">${this._error}</div>
|
|
30371
32034
|
</div>
|
|
30372
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}
|
|
30373
32045
|
</div>
|
|
30374
32046
|
`;
|
|
30375
32047
|
}
|
|
@@ -30887,11 +32559,86 @@ SpecLensElement.styles = [
|
|
|
30887
32559
|
padding: 0;
|
|
30888
32560
|
}
|
|
30889
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
|
+
|
|
30890
32631
|
@media (max-width: 768px) {
|
|
30891
32632
|
.sl-main {
|
|
30892
32633
|
padding: var(--sl-spacing-md);
|
|
30893
32634
|
}
|
|
30894
32635
|
}
|
|
32636
|
+
|
|
32637
|
+
/* ── Embed mode ──────────────────────── */
|
|
32638
|
+
:host([layout="embed"]) {
|
|
32639
|
+
--sl-header-height: 0px;
|
|
32640
|
+
min-height: unset;
|
|
32641
|
+
}
|
|
30895
32642
|
`
|
|
30896
32643
|
];
|
|
30897
32644
|
__decorateClass([
|
|
@@ -30909,6 +32656,15 @@ __decorateClass([
|
|
|
30909
32656
|
__decorateClass([
|
|
30910
32657
|
n2({ type: Boolean, attribute: "hide-code-samples" })
|
|
30911
32658
|
], SpecLensElement.prototype, "hideCodeSamples", 2);
|
|
32659
|
+
__decorateClass([
|
|
32660
|
+
n2({ type: Boolean, attribute: "hide-ask-ai" })
|
|
32661
|
+
], SpecLensElement.prototype, "hideAskAi", 2);
|
|
32662
|
+
__decorateClass([
|
|
32663
|
+
n2({ reflect: true, attribute: "layout" })
|
|
32664
|
+
], SpecLensElement.prototype, "layout", 2);
|
|
32665
|
+
__decorateClass([
|
|
32666
|
+
n2({ attribute: "guides-url" })
|
|
32667
|
+
], SpecLensElement.prototype, "guidesUrl", 2);
|
|
30912
32668
|
__decorateClass([
|
|
30913
32669
|
r$1()
|
|
30914
32670
|
], SpecLensElement.prototype, "_spec", 2);
|
|
@@ -30936,6 +32692,27 @@ __decorateClass([
|
|
|
30936
32692
|
__decorateClass([
|
|
30937
32693
|
r$1()
|
|
30938
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);
|
|
30939
32716
|
SpecLensElement = __decorateClass([
|
|
30940
32717
|
t$1("spec-lens")
|
|
30941
32718
|
], SpecLensElement);
|
|
@@ -30979,6 +32756,9 @@ const SpecLens = {
|
|
|
30979
32756
|
if (config.hideCodeSamples) {
|
|
30980
32757
|
el.setAttribute("hide-code-samples", "");
|
|
30981
32758
|
}
|
|
32759
|
+
if (config.guidesUrl) {
|
|
32760
|
+
el.setAttribute("guides-url", config.guidesUrl);
|
|
32761
|
+
}
|
|
30982
32762
|
el.config = config;
|
|
30983
32763
|
container.appendChild(el);
|
|
30984
32764
|
return el;
|