@scalar/api-reference 1.44.25 → 1.44.27
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/CHANGELOG.md +78 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue2.js +7 -3
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.d.ts +2 -1
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +3 -1
- package/dist/browser/standalone.js +13967 -13903
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue2.js +2 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue2.js +14 -12
- package/dist/components/ClassicHeader.vue.d.ts.map +1 -1
- package/dist/components/ClassicHeader.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +6 -4
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.d.ts +7 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue2.js +45 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +24 -40
- package/dist/components/Content/Schema/helpers/format-value.d.ts +5 -0
- package/dist/components/Content/Schema/helpers/format-value.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/format-value.js +35 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +4 -6
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/get-schema-type.js +1 -14
- package/dist/components/Content/Schema/helpers/schema-name.d.ts +0 -5
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +0 -36
- package/dist/features/{toolbar/ApiReferenceToolbar.vue.d.ts → developer-tools/DeveloperTools.vue.d.ts} +1 -1
- package/dist/features/developer-tools/DeveloperTools.vue.d.ts.map +1 -0
- package/dist/features/{toolbar/ApiReferenceToolbar.vue.js → developer-tools/DeveloperTools.vue.js} +11 -11
- package/dist/features/developer-tools/DeveloperTools.vue2.js +4 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.d.ts.map +1 -0
- package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarBlurb.vue.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.d.ts.map +1 -0
- package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts +2 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -0
- package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigLayoutOptions.vue.js +35 -17
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.d.ts.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.d.ts.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -0
- package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarRegisterButton.vue.js +2 -2
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -0
- package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarShareRegister.vue.js +12 -8
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js +73 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.d.ts.map +1 -0
- package/dist/features/{toolbar/ApiReferenceToolbarSdks.vue.d.ts → developer-tools/components/DeployApiReference.vue.d.ts} +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.d.ts.map +1 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.js +35 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue2.js +4 -0
- package/dist/features/{toolbar/ApiReferenceToolbarConfig.vue.d.ts → developer-tools/components/ModifyConfiguration.vue.d.ts} +1 -1
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.d.ts.map +1 -0
- package/dist/features/{toolbar/ApiReferenceToolbarConfig.vue.js → developer-tools/components/ModifyConfiguration.vue.js} +1 -1
- package/dist/features/developer-tools/components/ModifyConfiguration.vue2.js +4 -0
- package/dist/features/{toolbar/ApiReferenceToolbarShare.vue.d.ts → developer-tools/components/ShareApiReference.vue.d.ts} +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.d.ts.map +1 -0
- package/dist/features/{toolbar/ApiReferenceToolbarShare.vue.js → developer-tools/components/ShareApiReference.vue.js} +4 -13
- package/dist/features/developer-tools/components/ShareApiReference.vue2.js +4 -0
- package/dist/features/developer-tools/index.d.ts +2 -0
- package/dist/features/developer-tools/index.d.ts.map +1 -0
- package/dist/features/index.d.ts +0 -1
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +2 -4
- package/dist/style.css +115 -45
- package/package.json +19 -19
- package/dist/features/toolbar/ApiReferenceToolbar.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbar.vue2.js +0 -4
- package/dist/features/toolbar/ApiReferenceToolbarBlurb.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarConfig.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarConfig.vue2.js +0 -4
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayout.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarConfigTheme.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarPopover.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarRegisterButton.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarSdks.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarSdks.vue.js +0 -89
- package/dist/features/toolbar/ApiReferenceToolbarSdks.vue2.js +0 -4
- package/dist/features/toolbar/ApiReferenceToolbarShare.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarShare.vue2.js +0 -4
- package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarShareTemporary.vue.d.ts.map +0 -1
- package/dist/features/toolbar/ApiReferenceToolbarShareTemporary.vue.js +0 -90
- package/dist/features/toolbar/ApiReferenceToolbarTitle.vue.d.ts.map +0 -1
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarBlurb.vue.d.ts +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigLayout.vue.d.ts +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigLayout.vue.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigLayout.vue2.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigLayoutOptions.vue2.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigTheme.vue.d.ts +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigTheme.vue.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarConfigTheme.vue2.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarPopover.vue.d.ts +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarPopover.vue.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarPopover.vue2.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarRegisterButton.vue.d.ts +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarRegisterButton.vue2.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarShareRegister.vue.d.ts +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarShareRegister.vue2.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarShareTemporary.vue.d.ts +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarShareTemporary.vue2.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarTitle.vue.d.ts +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarTitle.vue.js +0 -0
- /package/dist/features/{toolbar → developer-tools/components}/ApiReferenceToolbarTitle.vue2.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentScalarChatInterface.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AgentScalar/AgentScalarChatInterface.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentScalarChatInterface.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AgentScalar/AgentScalarChatInterface.vue"],"names":[],"mappings":"AAoCA,OAAO,EAAE,KAAK,mCAAmC,EAAE,MAAM,6BAA6B,CAAA;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAI9B,KAAK,WAAW,GAAG;IACf,wBAAwB,EAAE,mCAAmC,CAAC,OAAO,CAAC,CAAA;IACtE,cAAc,EAAE,cAAc,CAAA;IAC9B,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC/B,CAAC;AAiEJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -15,11 +15,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
dashboardUrl: unref(DASHBOARD_URL),
|
|
16
16
|
getActiveDocumentJson: () => __props.workspaceStore.exportActiveDocument("json"),
|
|
17
17
|
getAgentKey: __props.agentScalarConfiguration?.key ? () => __props.agentScalarConfiguration?.key ?? "" : void 0,
|
|
18
|
+
hideAddApi: __props.agentScalarConfiguration?.hideAddApi,
|
|
18
19
|
mode: __props.agentScalarConfiguration?.key ? "full" : "preview",
|
|
19
20
|
prefilledMessage: __props.prefilledMessage,
|
|
20
21
|
registryDocuments: [],
|
|
21
22
|
registryUrl: unref(REGISTRY_URL)
|
|
22
|
-
}, null, 8, ["baseUrl", "dashboardUrl", "getActiveDocumentJson", "getAgentKey", "mode", "prefilledMessage", "registryUrl"]);
|
|
23
|
+
}, null, 8, ["baseUrl", "dashboardUrl", "getActiveDocumentJson", "getAgentKey", "hideAddApi", "mode", "prefilledMessage", "registryUrl"]);
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AA4vCA,OAAO,EAEL,KAAK,4BAA4B,EAGlC,MAAM,6BAA6B,CAAA;AAOpC,OAAO,KAAK,EACV,cAAc,EAEf,MAAM,4CAA4C,CAAA;AAkBnD,OAAO,8BAA8B,CAAA;AAiCrC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,4BAA4B,CAAA;CAC7C,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,eAAe,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,aAAa,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,oBAAoB,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,MAAM,CAAC,IAAI;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;CAClC,CAAC;AA80CF,QAAA,MAAM,UAAU;;;;oPAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -4,7 +4,7 @@ import _sfc_main from "./ApiReference.vue2.js";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
-
const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
7
|
+
const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-94d6fca6"]]);
|
|
8
8
|
export {
|
|
9
9
|
ApiReference as default
|
|
10
10
|
};
|
|
@@ -25,7 +25,6 @@ import _sfc_main$5 from "./Content/Content.vue.js";
|
|
|
25
25
|
import _sfc_main$1 from "./MobileHeader.vue.js";
|
|
26
26
|
import _sfc_main$2 from "../features/multiple-documents/DocumentSelector.vue.js";
|
|
27
27
|
import _sfc_main$3 from "../features/Search/components/SearchButton.vue.js";
|
|
28
|
-
import _sfc_main$6 from "../features/toolbar/ApiReferenceToolbar.vue.js";
|
|
29
28
|
import { getSystemModePreference } from "../helpers/color-mode.js";
|
|
30
29
|
import { downloadDocument } from "../helpers/download.js";
|
|
31
30
|
import { getIdFromUrl, makeUrlFromId } from "../helpers/id-routing.js";
|
|
@@ -40,9 +39,10 @@ import { PLUGIN_MANAGER_SYMBOL } from "../plugins/hooks/usePluginManager.js";
|
|
|
40
39
|
import { createPluginManager } from "../plugins/plugin-manager.js";
|
|
41
40
|
import AgentScalarDrawer from "./AgentScalar/AgentScalarDrawer.vue.js";
|
|
42
41
|
import _sfc_main$4 from "./AgentScalar/AgentScalarButton.vue.js";
|
|
42
|
+
import _sfc_main$6 from "../features/developer-tools/DeveloperTools.vue.js";
|
|
43
43
|
const _hoisted_1 = {
|
|
44
44
|
key: 1,
|
|
45
|
-
class: "flex gap-1.5
|
|
45
|
+
class: "flex gap-1.5 px-3 pt-3"
|
|
46
46
|
};
|
|
47
47
|
const _hoisted_2 = { key: 1 };
|
|
48
48
|
const _hoisted_3 = ["aria-label"];
|
|
@@ -325,7 +325,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
325
325
|
})();
|
|
326
326
|
if (elementId && elementId !== slug) {
|
|
327
327
|
scrollToLazyElement(elementId);
|
|
328
|
-
} else {
|
|
328
|
+
} else if (config.defaultOpenFirstTag) {
|
|
329
329
|
const firstTag = sidebarItems.value.find((item) => item.type === "tag");
|
|
330
330
|
if (firstTag) {
|
|
331
331
|
sidebarState.setExpanded(firstTag.id, true);
|
|
@@ -450,9 +450,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
450
450
|
}
|
|
451
451
|
downloadDocument(document2, activeSlug.value ?? "openapi", format);
|
|
452
452
|
});
|
|
453
|
-
const
|
|
453
|
+
const handleSelectSidebarEntry = (id, caller) => {
|
|
454
454
|
const item = sidebarState.getEntryById(id);
|
|
455
|
-
if ((item?.type === "tag" || item?.type === "models") && sidebarState.isExpanded(id)
|
|
455
|
+
if ((item?.type === "tag" || item?.type === "models" || item?.type === "text") && sidebarState.isExpanded(id) && // Only close if the item is expanded
|
|
456
|
+
sidebarState.selectedItem.value === id) {
|
|
456
457
|
const unblock = blockIntersection();
|
|
457
458
|
sidebarState.setExpanded(id, false);
|
|
458
459
|
unblock();
|
|
@@ -473,8 +474,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
473
474
|
agent.closeAgent();
|
|
474
475
|
}
|
|
475
476
|
};
|
|
476
|
-
eventBus.on("select:nav-item", ({ id }) =>
|
|
477
|
-
eventBus.on("scroll-to:nav-item", ({ id }) =>
|
|
477
|
+
eventBus.on("select:nav-item", ({ id }) => handleSelectSidebarEntry(id));
|
|
478
|
+
eventBus.on("scroll-to:nav-item", ({ id }) => handleSelectSidebarEntry(id));
|
|
478
479
|
eventBus.on("intersecting:nav-item", ({ id }) => {
|
|
479
480
|
if (!intersectionEnabled.value) {
|
|
480
481
|
return;
|
|
@@ -561,7 +562,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
561
562
|
breadcrumb: breadcrumb.value,
|
|
562
563
|
isSidebarOpen: isSidebarOpen.value,
|
|
563
564
|
showSidebar: mergedConfig.value.showSidebar,
|
|
564
|
-
onToggleSidebar: _cache[
|
|
565
|
+
onToggleSidebar: _cache[3] || (_cache[3] = () => isSidebarOpen.value = !isSidebarOpen.value)
|
|
565
566
|
}, {
|
|
566
567
|
search: withCtx(() => [
|
|
567
568
|
!mergedConfig.value.hideSearch ? (openBlock(), createBlock(_sfc_main$3, {
|
|
@@ -585,7 +586,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
585
586
|
layout: "reference",
|
|
586
587
|
options: mergedConfig.value,
|
|
587
588
|
role: "navigation",
|
|
588
|
-
onSelectItem: _cache[1] || (_cache[1] = (id) =>
|
|
589
|
+
onSelectItem: _cache[1] || (_cache[1] = (id) => handleSelectSidebarEntry(id, "sidebar")),
|
|
590
|
+
onToggleGroup: _cache[2] || (_cache[2] = (id) => unref(sidebarState).setExpanded(id, !unref(sidebarState).isExpanded(id)))
|
|
589
591
|
}, {
|
|
590
592
|
header: withCtx(() => [
|
|
591
593
|
documentOptionList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$2, {
|
|
@@ -651,10 +653,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
651
653
|
xScalarDefaultClient: unref(workspaceStore).workspace["x-scalar-default-client"]
|
|
652
654
|
}, createSlots({
|
|
653
655
|
start: withCtx(() => [
|
|
654
|
-
unref(workspaceStore).workspace.activeDocument && unref(mediaQueries).lg.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
656
|
+
unref(workspaceStore).workspace.activeDocument && unref(mediaQueries).lg.value ? (openBlock(), createBlock(unref(_sfc_main$6), {
|
|
655
657
|
key: 0,
|
|
656
658
|
overrides: configurationOverrides.value,
|
|
657
|
-
"onUpdate:overrides": _cache[
|
|
659
|
+
"onUpdate:overrides": _cache[4] || (_cache[4] = ($event) => configurationOverrides.value = $event),
|
|
658
660
|
configuration: mergedConfig.value,
|
|
659
661
|
workspace: unref(workspaceStore)
|
|
660
662
|
}, null, 8, ["overrides", "configuration", "workspace"])) : createCommentVNode("", true),
|
|
@@ -670,7 +672,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
670
672
|
mode: colorMode.value,
|
|
671
673
|
style: { "transform": "scale(1.4)" },
|
|
672
674
|
variant: "icon",
|
|
673
|
-
onClick: _cache[
|
|
675
|
+
onClick: _cache[5] || (_cache[5] = () => unref(toggleColorMode)())
|
|
674
676
|
}, null, 8, ["mode"])) : createCommentVNode("", true)
|
|
675
677
|
]),
|
|
676
678
|
default: withCtx(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/ClassicHeader.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClassicHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/ClassicHeader.vue"],"names":[],"mappings":"AA+EA,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG1D,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -15,7 +15,7 @@ function _sfc_render(_ctx, _cache) {
|
|
|
15
15
|
])
|
|
16
16
|
]);
|
|
17
17
|
}
|
|
18
|
-
const ClassicHeader = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
18
|
+
const ClassicHeader = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8a3822ca"]]);
|
|
19
19
|
export {
|
|
20
20
|
ClassicHeader as default
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAkKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAItE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAItE,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,MAAM,EAAE,YAAY,CAAA;IACpB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAA;CACvB,CAAC;AAwNJ,QAAA,MAAM,YAAY;aAjOJ,OAAO;iBAEH,OAAO;6EAkOvB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -5,6 +5,7 @@ import { ScalarIconCaretDown } from "@scalar/icons";
|
|
|
5
5
|
import { resolve } from "@scalar/workspace-store/resolve";
|
|
6
6
|
import { getSchemaType } from "./helpers/get-schema-type.js";
|
|
7
7
|
import { mergeAllOfSchemas } from "./helpers/merge-all-of-schemas.js";
|
|
8
|
+
import { getModelNameFromSchema } from "./helpers/schema-name.js";
|
|
8
9
|
import Schema from "./Schema.vue.js";
|
|
9
10
|
const _hoisted_1 = { class: "property-rule" };
|
|
10
11
|
const _hoisted_2 = {
|
|
@@ -37,10 +38,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
38
|
() => [props.schema[props.composition]].flat().map((schema) => ({ value: resolve.schema(schema), original: schema })).filter((it) => isDefined(it.value))
|
|
38
39
|
);
|
|
39
40
|
const listboxOptions = computed(
|
|
40
|
-
() => composition.value.map((schema, index) =>
|
|
41
|
-
|
|
42
|
-
label
|
|
43
|
-
|
|
41
|
+
() => composition.value.map((schema, index) => {
|
|
42
|
+
const resolved = resolve.schema(schema.original);
|
|
43
|
+
const label = (getModelNameFromSchema(schema.original) ?? getSchemaType(resolved)) || "Schema";
|
|
44
|
+
return { id: String(index), label };
|
|
45
|
+
})
|
|
44
46
|
);
|
|
45
47
|
const selectedOption = ref(
|
|
46
48
|
listboxOptions.value[0]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
value?: unknown;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=SchemaPropertyDefault.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaPropertyDefault.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyDefault.vue"],"names":[],"mappings":"AAwHA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAC;AA+FF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from "./SchemaPropertyDefault.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const SchemaPropertyDefault = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4da5c70a"]]);
|
|
5
|
+
export {
|
|
6
|
+
SchemaPropertyDefault as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent, createElementBlock, createCommentVNode, openBlock, createElementVNode, unref, createVNode, toDisplayString } from "vue";
|
|
2
|
+
import { ScalarIcon } from "@scalar/components";
|
|
3
|
+
import { useClipboard } from "@scalar/use-hooks/useClipboard";
|
|
4
|
+
import { formatValue } from "./helpers/format-value.js";
|
|
5
|
+
const _hoisted_1 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "property-default"
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_2 = { class: "property-default-value-list" };
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "SchemaPropertyDefault",
|
|
12
|
+
props: {
|
|
13
|
+
value: {}
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const { copyToClipboard } = useClipboard();
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
return __props.value !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
19
|
+
_cache[1] || (_cache[1] = createElementVNode("button", {
|
|
20
|
+
class: "property-default-label",
|
|
21
|
+
type: "button"
|
|
22
|
+
}, [
|
|
23
|
+
createElementVNode("span", null, "Default")
|
|
24
|
+
], -1)),
|
|
25
|
+
createElementVNode("div", _hoisted_2, [
|
|
26
|
+
createElementVNode("button", {
|
|
27
|
+
class: "property-default-value group",
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(copyToClipboard)(unref(formatValue)(__props.value)))
|
|
30
|
+
}, [
|
|
31
|
+
createElementVNode("span", null, toDisplayString(unref(formatValue)(__props.value)), 1),
|
|
32
|
+
createVNode(unref(ScalarIcon), {
|
|
33
|
+
class: "group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3",
|
|
34
|
+
icon: "Clipboard",
|
|
35
|
+
size: "xs"
|
|
36
|
+
})
|
|
37
|
+
])
|
|
38
|
+
])
|
|
39
|
+
])) : createCommentVNode("", true);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
_sfc_main as default
|
|
45
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"AAiaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAkBhG,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC;AA6eJ,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK5C,QAAA,MAAM,UAAU;cAxfD,OAAO;oBAGD,OAAO;qBAJN,OAAO;kBAGV,OAAO;6EAyfxB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./SchemaPropertyHeading.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const SchemaPropertyHeading = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const SchemaPropertyHeading = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b69e3089"]]);
|
|
5
5
|
export {
|
|
6
6
|
SchemaPropertyHeading as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent, toRef, computed, createElementBlock, openBlock, createCommentVNode, createBlock, normalizeClass, renderSlot, Fragment, withCtx,
|
|
1
|
+
import { defineComponent, toRef, computed, createElementBlock, openBlock, createCommentVNode, createVNode, createBlock, normalizeClass, renderSlot, Fragment, withCtx, createTextVNode, toDisplayString, renderList, createSlots, unref } from "vue";
|
|
2
2
|
import { isDefined } from "@scalar/helpers/array/is-defined";
|
|
3
3
|
import { resolve } from "@scalar/workspace-store/resolve";
|
|
4
4
|
import { isArraySchema, isStringSchema, isNumberSchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
5
5
|
import ScreenReader from "../../ScreenReader.vue.js";
|
|
6
6
|
import { getSchemaType } from "./helpers/get-schema-type.js";
|
|
7
|
-
import {
|
|
7
|
+
import { getModelNameFromSchema } from "./helpers/schema-name.js";
|
|
8
8
|
import _sfc_main$1 from "./RenderString.vue.js";
|
|
9
|
+
import SchemaPropertyDefault from "./SchemaPropertyDefault.vue.js";
|
|
9
10
|
import SchemaPropertyDetail from "./SchemaPropertyDetail.vue.js";
|
|
10
11
|
import SchemaPropertyExamples from "./SchemaPropertyExamples.vue.js";
|
|
11
12
|
import Badge from "../../Badge/Badge.vue.js";
|
|
@@ -166,11 +167,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
166
167
|
}
|
|
167
168
|
return properties;
|
|
168
169
|
});
|
|
169
|
-
const
|
|
170
|
+
const displayTitle = computed(() => {
|
|
170
171
|
if (!props.value) {
|
|
171
172
|
return null;
|
|
172
173
|
}
|
|
173
|
-
|
|
174
|
+
if (props.hideModelNames) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
const modelName = getModelNameFromSchema(props.value);
|
|
178
|
+
if (modelName) {
|
|
179
|
+
return modelName;
|
|
180
|
+
}
|
|
181
|
+
if (isArraySchema(props.value) && props.value.items) {
|
|
182
|
+
const itemName = getModelNameFromSchema(props.value.items);
|
|
183
|
+
return itemName ? `${itemName}[]` : null;
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
174
186
|
});
|
|
175
187
|
const shouldShowType = computed(() => {
|
|
176
188
|
if (!props.value || !("type" in props.value)) {
|
|
@@ -185,26 +197,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
185
197
|
if (!props.value) {
|
|
186
198
|
return "";
|
|
187
199
|
}
|
|
188
|
-
return
|
|
189
|
-
});
|
|
190
|
-
const flattenedDefaultValue = computed(() => {
|
|
191
|
-
const value = props.value;
|
|
192
|
-
if (value?.default === null) {
|
|
193
|
-
return "null";
|
|
194
|
-
}
|
|
195
|
-
if (Array.isArray(value?.default) && value?.default.length === 1) {
|
|
196
|
-
return String(value?.default[0]);
|
|
197
|
-
}
|
|
198
|
-
if (typeof value?.default === "string") {
|
|
199
|
-
return JSON.stringify(value.default);
|
|
200
|
-
}
|
|
201
|
-
if (Array.isArray(value?.default)) {
|
|
202
|
-
return JSON.stringify(value?.default);
|
|
203
|
-
}
|
|
204
|
-
if (typeof value?.default === "object") {
|
|
205
|
-
return JSON.stringify(value?.default);
|
|
206
|
-
}
|
|
207
|
-
return value?.default;
|
|
200
|
+
return getSchemaType(props.value);
|
|
208
201
|
});
|
|
209
202
|
return (_ctx, _cache) => {
|
|
210
203
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -227,7 +220,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
227
220
|
])]),
|
|
228
221
|
_: 1
|
|
229
222
|
}),
|
|
230
|
-
createTextVNode(toDisplayString(displayType.value), 1)
|
|
223
|
+
createTextVNode(toDisplayString(displayType.value) + toDisplayString(displayTitle.value ? ` · ${displayTitle.value}` : ""), 1)
|
|
231
224
|
]),
|
|
232
225
|
_: 1
|
|
233
226
|
})) : createCommentVNode("", true),
|
|
@@ -267,18 +260,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
267
260
|
createTextVNode("enum", -1)
|
|
268
261
|
])]),
|
|
269
262
|
_: 1
|
|
270
|
-
})) : createCommentVNode("", true),
|
|
271
|
-
flattenedDefaultValue.value !== void 0 ? (openBlock(), createBlock(SchemaPropertyDetail, {
|
|
272
|
-
key: 2,
|
|
273
|
-
truncate: ""
|
|
274
|
-
}, {
|
|
275
|
-
prefix: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
276
|
-
createTextVNode("default:", -1)
|
|
277
|
-
])]),
|
|
278
|
-
default: withCtx(() => [
|
|
279
|
-
createTextVNode(toDisplayString(flattenedDefaultValue.value), 1)
|
|
280
|
-
]),
|
|
281
|
-
_: 1
|
|
282
263
|
})) : createCommentVNode("", true)
|
|
283
264
|
], 64)) : createCommentVNode("", true),
|
|
284
265
|
props.additional ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
@@ -290,7 +271,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
290
271
|
])) : createCommentVNode("", true),
|
|
291
272
|
props.value?.deprecated ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
292
273
|
createVNode(unref(Badge), null, {
|
|
293
|
-
default: withCtx(() => [..._cache[
|
|
274
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
294
275
|
createTextVNode("deprecated", -1)
|
|
295
276
|
])]),
|
|
296
277
|
_: 1
|
|
@@ -298,7 +279,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
298
279
|
])) : createCommentVNode("", true),
|
|
299
280
|
constValue.value !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
300
281
|
createVNode(SchemaPropertyDetail, { truncate: "" }, {
|
|
301
|
-
prefix: withCtx(() => [..._cache[
|
|
282
|
+
prefix: withCtx(() => [..._cache[5] || (_cache[5] = [
|
|
302
283
|
createTextVNode("const: ", -1)
|
|
303
284
|
])]),
|
|
304
285
|
default: withCtx(() => [
|
|
@@ -308,7 +289,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
308
289
|
})
|
|
309
290
|
])) : (openBlock(), createElementBlock(Fragment, { key: 6 }, [
|
|
310
291
|
props.value?.nullable === true ? (openBlock(), createBlock(SchemaPropertyDetail, { key: 0 }, {
|
|
311
|
-
default: withCtx(() => [..._cache[
|
|
292
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [
|
|
312
293
|
createTextVNode(" nullable ", -1)
|
|
313
294
|
])]),
|
|
314
295
|
_: 1
|
|
@@ -316,6 +297,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
316
297
|
], 64)),
|
|
317
298
|
props.value?.writeOnly ? (openBlock(), createElementBlock("div", _hoisted_6, " write-only ")) : props.value?.readOnly ? (openBlock(), createElementBlock("div", _hoisted_7, " read-only ")) : createCommentVNode("", true),
|
|
318
299
|
props.required ? (openBlock(), createElementBlock("div", _hoisted_8, " required ")) : createCommentVNode("", true),
|
|
300
|
+
createVNode(SchemaPropertyDefault, {
|
|
301
|
+
value: props.value?.default
|
|
302
|
+
}, null, 8, ["value"]),
|
|
319
303
|
props.withExamples ? (openBlock(), createBlock(SchemaPropertyExamples, {
|
|
320
304
|
key: 10,
|
|
321
305
|
example: props.value?.example || props.value && unref(isArraySchema)(props.value) && unref(resolve).schema(props.value?.items)?.example,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-value.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/format-value.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CA0C3D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function formatValue(value) {
|
|
2
|
+
if (Array.isArray(value)) {
|
|
3
|
+
return `[${value.map((item) => {
|
|
4
|
+
if (typeof item === "string") {
|
|
5
|
+
return `"${item.toString().trim()}"`;
|
|
6
|
+
}
|
|
7
|
+
if (typeof item === "object") {
|
|
8
|
+
return JSON.stringify(item);
|
|
9
|
+
}
|
|
10
|
+
if (item === void 0) {
|
|
11
|
+
return "undefined";
|
|
12
|
+
}
|
|
13
|
+
if (item === null) {
|
|
14
|
+
return "null";
|
|
15
|
+
}
|
|
16
|
+
return item;
|
|
17
|
+
}).join(", ")}]`;
|
|
18
|
+
}
|
|
19
|
+
if (value === null) {
|
|
20
|
+
return "null";
|
|
21
|
+
}
|
|
22
|
+
if (typeof value === "object") {
|
|
23
|
+
return JSON.stringify(value);
|
|
24
|
+
}
|
|
25
|
+
if (value === void 0) {
|
|
26
|
+
return "undefined";
|
|
27
|
+
}
|
|
28
|
+
if (typeof value === "string") {
|
|
29
|
+
return value.trim();
|
|
30
|
+
}
|
|
31
|
+
return value.toString().trim();
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
formatValue
|
|
35
|
+
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
2
|
/**
|
|
3
|
-
* Computes the
|
|
3
|
+
* Computes the structural type for a schema.
|
|
4
|
+
* This helper always returns type information, never schema titles or ref names.
|
|
4
5
|
*
|
|
5
6
|
* Priority order:
|
|
6
7
|
* 1. const values
|
|
7
8
|
* 2. Array types (with special handling for items)
|
|
8
|
-
* 3.
|
|
9
|
-
* 4.
|
|
10
|
-
* 5. type with contentEncoding
|
|
11
|
-
* 6. $ref names
|
|
12
|
-
* 7. raw type
|
|
9
|
+
* 3. type with contentEncoding
|
|
10
|
+
* 4. raw type
|
|
13
11
|
*/
|
|
14
12
|
export declare const getSchemaType: (valueOrRef: SchemaObject | ReferenceType<SchemaObject>) => string;
|
|
15
13
|
//# sourceMappingURL=get-schema-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;
|
|
1
|
+
{"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAkC/G;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MAwCtF,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { resolve } from "@scalar/workspace-store/resolve";
|
|
2
2
|
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
|
-
import { getRefName } from "./get-ref-name.js";
|
|
4
3
|
const formatArrayType = (itemType) => {
|
|
5
4
|
if (!itemType) {
|
|
6
5
|
return "array";
|
|
@@ -10,7 +9,7 @@ const formatArrayType = (itemType) => {
|
|
|
10
9
|
};
|
|
11
10
|
const processArrayType = (value, isUnionType = false) => {
|
|
12
11
|
if (!value.items) {
|
|
13
|
-
return
|
|
12
|
+
return "array";
|
|
14
13
|
}
|
|
15
14
|
const itemType = getSchemaType(resolve.schema(value.items));
|
|
16
15
|
const baseType = formatArrayType(itemType);
|
|
@@ -38,21 +37,9 @@ const getSchemaType = (valueOrRef) => {
|
|
|
38
37
|
if (isArraySchema(value)) {
|
|
39
38
|
return processArrayType(value, false);
|
|
40
39
|
}
|
|
41
|
-
if (value.title) {
|
|
42
|
-
return value.title;
|
|
43
|
-
}
|
|
44
|
-
if (value.xml?.name) {
|
|
45
|
-
return value.xml.name;
|
|
46
|
-
}
|
|
47
40
|
if ("type" in value && value.type && value.contentEncoding) {
|
|
48
41
|
return `${value.type} • ${value.contentEncoding}`;
|
|
49
42
|
}
|
|
50
|
-
if ("$ref" in valueOrRef) {
|
|
51
|
-
const refName = getRefName(valueOrRef.$ref);
|
|
52
|
-
if (refName) {
|
|
53
|
-
return refName;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
43
|
return "type" in value ? value.type : "";
|
|
57
44
|
};
|
|
58
45
|
export {
|
|
@@ -5,9 +5,4 @@ import type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/
|
|
|
5
5
|
* Handles $ref, title, name, type, and schema dictionary lookup
|
|
6
6
|
*/
|
|
7
7
|
export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>) => string | null;
|
|
8
|
-
/**
|
|
9
|
-
* Get the model name for a schema property
|
|
10
|
-
* e.g. User | Admin | array of User | array of Admin
|
|
11
|
-
*/
|
|
12
|
-
export declare const getModelName: (value: SchemaObject, hideModelNames?: boolean) => string | null;
|
|
13
8
|
//# sourceMappingURL=schema-name.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;
|
|
1
|
+
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAIrH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D,MAAM,GAAG,IAyBX,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { resolve } from "@scalar/workspace-store/resolve";
|
|
2
|
-
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
2
|
import { getRefName } from "./get-ref-name.js";
|
|
4
3
|
const getModelNameFromSchema = (schemaOrRef) => {
|
|
5
4
|
if (!schemaOrRef) {
|
|
@@ -20,41 +19,6 @@ const getModelNameFromSchema = (schemaOrRef) => {
|
|
|
20
19
|
}
|
|
21
20
|
return null;
|
|
22
21
|
};
|
|
23
|
-
const formatTypeWithModel = (type, modelName) => `${type} ${modelName}${type === "array" ? "[]" : ""}`;
|
|
24
|
-
const getModelName = (value, hideModelNames = false) => {
|
|
25
|
-
if (!("type" in value) || hideModelNames) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
const valueType = value.type;
|
|
29
|
-
const modelName = getModelNameFromSchema(value);
|
|
30
|
-
if (modelName && value.title) {
|
|
31
|
-
return valueType === "array" ? `array ${modelName}[]` : modelName;
|
|
32
|
-
}
|
|
33
|
-
if (isArraySchema(value) && value.items) {
|
|
34
|
-
const items = resolve.schema(value.items);
|
|
35
|
-
const itemName = items.title;
|
|
36
|
-
if (itemName) {
|
|
37
|
-
return formatTypeWithModel(valueType, itemName);
|
|
38
|
-
}
|
|
39
|
-
const itemModelName = getModelNameFromSchema(items);
|
|
40
|
-
if (itemModelName && "type" in items && itemModelName !== items.type) {
|
|
41
|
-
return formatTypeWithModel(valueType, itemModelName);
|
|
42
|
-
}
|
|
43
|
-
if ("type" in items) {
|
|
44
|
-
return formatTypeWithModel(valueType, Array.isArray(items.type) ? items.type.join(" | ") : items.type);
|
|
45
|
-
}
|
|
46
|
-
return formatTypeWithModel(valueType, "object");
|
|
47
|
-
}
|
|
48
|
-
if (modelName && modelName !== valueType) {
|
|
49
|
-
if (modelName.startsWith("Array of ")) {
|
|
50
|
-
const itemType = modelName.slice(9);
|
|
51
|
-
return `array ${itemType}[]`;
|
|
52
|
-
}
|
|
53
|
-
return modelName;
|
|
54
|
-
}
|
|
55
|
-
return null;
|
|
56
|
-
};
|
|
57
22
|
export {
|
|
58
|
-
getModelName,
|
|
59
23
|
getModelNameFromSchema
|
|
60
24
|
};
|
|
@@ -15,4 +15,4 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
15
15
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
17
17
|
export default _default;
|
|
18
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=DeveloperTools.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeveloperTools.vue.d.ts","sourceRoot":"","sources":["../../../src/features/developer-tools/DeveloperTools.vue"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAQpE,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;CACnD,CAAC;AAuBF,KAAK,gBAAgB,GAAG;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;CAChD,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAsFxD,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/features/{toolbar/ApiReferenceToolbar.vue.js → developer-tools/DeveloperTools.vue.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent, mergeModels, useModel, computed, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode, Fragment } from "vue";
|
|
2
2
|
import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
|
|
3
|
-
import _sfc_main$
|
|
4
|
-
import _sfc_main$
|
|
5
|
-
import _sfc_main$2 from "./
|
|
6
|
-
import _sfc_main$
|
|
3
|
+
import _sfc_main$1 from "./components/ApiReferenceToolbarTitle.vue.js";
|
|
4
|
+
import _sfc_main$4 from "./components/DeployApiReference.vue.js";
|
|
5
|
+
import _sfc_main$2 from "./components/ModifyConfiguration.vue.js";
|
|
6
|
+
import _sfc_main$3 from "./components/ShareApiReference.vue.js";
|
|
7
7
|
const _hoisted_1 = {
|
|
8
8
|
key: 0,
|
|
9
9
|
"aria-label": "Developer Tools",
|
|
@@ -12,7 +12,7 @@ const _hoisted_1 = {
|
|
|
12
12
|
const _hoisted_2 = { class: "-mx-2 flex max-w-(--refs-content-max-width) flex-1 items-center" };
|
|
13
13
|
const _hoisted_3 = { class: "flex flex-1 items-center" };
|
|
14
14
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
-
__name: "
|
|
15
|
+
__name: "DeveloperTools",
|
|
16
16
|
props: /* @__PURE__ */ mergeModels({
|
|
17
17
|
workspace: {},
|
|
18
18
|
configuration: {}
|
|
@@ -41,15 +41,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
createElementVNode("div", _hoisted_3, [
|
|
42
42
|
createVNode(_sfc_main$1)
|
|
43
43
|
]),
|
|
44
|
-
|
|
45
|
-
createVNode(_sfc_main$2, { workspace: __props.workspace }, null, 8, ["workspace"]),
|
|
46
|
-
createVNode(_sfc_main$3, { workspace: __props.workspace }, null, 8, ["workspace"])
|
|
47
|
-
], 64)) : createCommentVNode("", true),
|
|
48
|
-
createVNode(_sfc_main$4, {
|
|
44
|
+
createVNode(_sfc_main$2, {
|
|
49
45
|
overrides: overrides.value,
|
|
50
46
|
"onUpdate:overrides": _cache[0] || (_cache[0] = ($event) => overrides.value = $event),
|
|
51
47
|
configuration: __props.configuration
|
|
52
|
-
}, null, 8, ["overrides", "configuration"])
|
|
48
|
+
}, null, 8, ["overrides", "configuration"]),
|
|
49
|
+
__props.workspace ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
50
|
+
createVNode(_sfc_main$3, { workspace: __props.workspace }, null, 8, ["workspace"]),
|
|
51
|
+
createVNode(_sfc_main$4, { workspace: __props.workspace }, null, 8, ["workspace"])
|
|
52
|
+
], 64)) : createCommentVNode("", true)
|
|
53
53
|
])
|
|
54
54
|
])) : createCommentVNode("", true);
|
|
55
55
|
};
|