@scalar/api-reference 1.44.25 → 1.44.26

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.d.ts.map +1 -1
  3. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
  4. package/dist/blocks/scalar-info-block/components/InfoDescription.vue2.js +7 -3
  5. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.d.ts +2 -1
  6. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.d.ts.map +1 -1
  7. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +3 -1
  8. package/dist/browser/standalone.js +10492 -10487
  9. package/dist/browser/webpack-stats.json +1 -1
  10. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  11. package/dist/components/ApiReference.vue.js +1 -1
  12. package/dist/components/ApiReference.vue2.js +12 -10
  13. package/dist/components/ClassicHeader.vue.d.ts.map +1 -1
  14. package/dist/components/ClassicHeader.vue.js +1 -1
  15. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Schema/SchemaComposition.vue.js +6 -4
  17. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  19. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +16 -5
  20. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +4 -6
  21. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -1
  22. package/dist/components/Content/Schema/helpers/get-schema-type.js +1 -14
  23. package/dist/components/Content/Schema/helpers/schema-name.d.ts +0 -5
  24. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  25. package/dist/components/Content/Schema/helpers/schema-name.js +0 -36
  26. package/dist/style.css +44 -42
  27. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AA0uCA,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;AAqzCF,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"}
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;AA20CF,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-2a5231c6"]]);
7
+ const ApiReference = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9cc2ab84"]]);
8
8
  export {
9
9
  ApiReference as default
10
10
  };
@@ -42,7 +42,7 @@ import AgentScalarDrawer from "./AgentScalar/AgentScalarDrawer.vue.js";
42
42
  import _sfc_main$4 from "./AgentScalar/AgentScalarButton.vue.js";
43
43
  const _hoisted_1 = {
44
44
  key: 1,
45
- class: "flex gap-1.5 p-3 pt-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 handleSelectItem = (id, caller) => {
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 }) => handleSelectItem(id));
477
- eventBus.on("scroll-to:nav-item", ({ id }) => handleSelectItem(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[2] || (_cache[2] = () => isSidebarOpen.value = !isSidebarOpen.value)
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) => handleSelectItem(id, "sidebar"))
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, {
@@ -654,7 +656,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
654
656
  unref(workspaceStore).workspace.activeDocument && unref(mediaQueries).lg.value ? (openBlock(), createBlock(_sfc_main$6, {
655
657
  key: 0,
656
658
  overrides: configurationOverrides.value,
657
- "onUpdate:overrides": _cache[3] || (_cache[3] = ($event) => configurationOverrides.value = $event),
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[4] || (_cache[4] = () => unref(toggleColorMode)())
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":"AA8EA,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"}
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-9198d025"]]);
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":"AA6JA,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;AAGtE,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;AAoNJ,QAAA,MAAM,YAAY;aA7NJ,OAAO;iBAEH,OAAO;6EA8NvB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
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
- id: String(index),
42
- label: getSchemaType(resolve.schema(schema.original)) || "Schema"
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]
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"AAqbA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAiBhG,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;AAsgBJ,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;cAjhBD,OAAO;oBAGD,OAAO;qBAJN,OAAO;kBAGV,OAAO;6EAkhBxB,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
+ {"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"AAocA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAiBhG,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;AAuhBJ,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;cAliBD,OAAO;oBAGD,OAAO;qBAJN,OAAO;kBAGV,OAAO;6EAmiBxB,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-f1f4255a"]]);
4
+ const SchemaPropertyHeading = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0bec998b"]]);
5
5
  export {
6
6
  SchemaPropertyHeading as default
7
7
  };
@@ -4,7 +4,7 @@ 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 { getModelName } from "./helpers/schema-name.js";
7
+ import { getModelNameFromSchema } from "./helpers/schema-name.js";
8
8
  import _sfc_main$1 from "./RenderString.vue.js";
9
9
  import SchemaPropertyDetail from "./SchemaPropertyDetail.vue.js";
10
10
  import SchemaPropertyExamples from "./SchemaPropertyExamples.vue.js";
@@ -166,11 +166,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
166
166
  }
167
167
  return properties;
168
168
  });
169
- const modelName = computed(() => {
169
+ const displayTitle = computed(() => {
170
170
  if (!props.value) {
171
171
  return null;
172
172
  }
173
- return getModelName(props.value, props.hideModelNames);
173
+ if (props.hideModelNames) {
174
+ return null;
175
+ }
176
+ const modelName = getModelNameFromSchema(props.value);
177
+ if (modelName) {
178
+ return modelName;
179
+ }
180
+ if (isArraySchema(props.value) && props.value.items) {
181
+ const itemName = getModelNameFromSchema(props.value.items);
182
+ return itemName ? `${itemName}[]` : null;
183
+ }
184
+ return null;
174
185
  });
175
186
  const shouldShowType = computed(() => {
176
187
  if (!props.value || !("type" in props.value)) {
@@ -185,7 +196,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
185
196
  if (!props.value) {
186
197
  return "";
187
198
  }
188
- return modelName.value || getSchemaType(props.value);
199
+ return getSchemaType(props.value);
189
200
  });
190
201
  const flattenedDefaultValue = computed(() => {
191
202
  const value = props.value;
@@ -227,7 +238,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
227
238
  ])]),
228
239
  _: 1
229
240
  }),
230
- createTextVNode(toDisplayString(displayType.value), 1)
241
+ createTextVNode(toDisplayString(displayType.value) + toDisplayString(displayTitle.value ? ` · ${displayTitle.value}` : ""), 1)
231
242
  ]),
232
243
  _: 1
233
244
  })) : createCommentVNode("", true),
@@ -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 human-readable type for a schema.
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. title property
9
- * 4. xml.name property
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;AAoC/G;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,KAAG,MA0DtF,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 isUnionType ? "array" : value.title || value.xml?.name || "array";
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;AAKrH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D,MAAM,GAAG,IAyBX,CAAA;AAQD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,YAAY,EAAE,wBAAsB,KAAG,MAAM,GAAG,IA+CnF,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
  };
package/dist/style.css CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- .references-classic-header[data-v-9198d025] {
2
+ .references-classic-header[data-v-8a3822ca] {
3
3
  display: flex;
4
4
  align-items: center;
5
5
  gap: 12px;
@@ -8,23 +8,24 @@
8
8
  margin: auto;
9
9
  padding: 12px 0;
10
10
  }
11
- .references-classic-header-content[data-v-9198d025] {
11
+ .references-classic-header-content[data-v-8a3822ca] {
12
12
  display: flex;
13
13
  gap: 12px;
14
14
  flex-grow: 1;
15
15
  }
16
- .references-classic-header-container[data-v-9198d025] {
16
+ .references-classic-header-container[data-v-8a3822ca] {
17
+ position: relative;
17
18
  padding: 0 60px;
18
19
  }
19
20
  @container narrow-references-container (max-width: 900px) {
20
- .references-classic-header[data-v-9198d025] {
21
+ .references-classic-header[data-v-8a3822ca] {
21
22
  padding: 12px 24px;
22
23
  }
23
- .references-classic-header-container[data-v-9198d025] {
24
+ .references-classic-header-container[data-v-8a3822ca] {
24
25
  padding: 0;
25
26
  }
26
27
  }
27
- .references-classic-header-icon[data-v-9198d025] {
28
+ .references-classic-header-icon[data-v-8a3822ca] {
28
29
  height: 24px;
29
30
  color: var(--scalar-color-1);
30
31
  }
@@ -461,27 +462,27 @@ code.property-detail-value[data-v-1295f965] {
461
462
  border: transparent;
462
463
  }
463
464
 
464
- .property-heading[data-v-f1f4255a] {
465
+ .property-heading[data-v-0bec998b] {
465
466
  display: flex;
466
467
  flex-wrap: wrap;
467
468
  align-items: baseline;
468
469
  row-gap: 9px;
469
470
  white-space: nowrap;
470
471
  }
471
- .property-heading[data-v-f1f4255a]:has(+ .children),
472
- .property-heading[data-v-f1f4255a]:has(+ .property-rule) {
472
+ .property-heading[data-v-0bec998b]:has(+ .children),
473
+ .property-heading[data-v-0bec998b]:has(+ .property-rule) {
473
474
  margin-bottom: 9px;
474
475
  }
475
- .property-heading[data-v-f1f4255a] > * {
476
+ .property-heading[data-v-0bec998b] > * {
476
477
  margin-right: 9px;
477
478
  }
478
- .property-heading[data-v-f1f4255a]:last-child {
479
+ .property-heading[data-v-0bec998b]:last-child {
479
480
  margin-right: 0;
480
481
  }
481
- .property-heading > .property-detail[data-v-f1f4255a]:not(:last-of-type) {
482
+ .property-heading > .property-detail[data-v-0bec998b]:not(:last-of-type) {
482
483
  margin-right: 0;
483
484
  }
484
- .property-name[data-v-f1f4255a] {
485
+ .property-name[data-v-0bec998b] {
485
486
  max-width: 100%;
486
487
  font-family: var(--scalar-font-code);
487
488
  font-weight: var(--scalar-bold);
@@ -489,30 +490,30 @@ code.property-detail-value[data-v-1295f965] {
489
490
  white-space: normal;
490
491
  overflow-wrap: break-word;
491
492
  }
492
- .property-additional[data-v-f1f4255a] {
493
+ .property-additional[data-v-0bec998b] {
493
494
  font-family: var(--scalar-font-code);
494
495
  }
495
- .property-required[data-v-f1f4255a],
496
- .property-optional[data-v-f1f4255a] {
496
+ .property-required[data-v-0bec998b],
497
+ .property-optional[data-v-0bec998b] {
497
498
  color: var(--scalar-color-2);
498
499
  }
499
- .property-required[data-v-f1f4255a] {
500
+ .property-required[data-v-0bec998b] {
500
501
  font-size: var(--scalar-mini);
501
502
  color: var(--scalar-color-orange);
502
503
  }
503
- .property-read-only[data-v-f1f4255a] {
504
+ .property-read-only[data-v-0bec998b] {
504
505
  font-size: var(--scalar-mini);
505
506
  color: var(--scalar-color-blue);
506
507
  }
507
- .property-write-only[data-v-f1f4255a] {
508
+ .property-write-only[data-v-0bec998b] {
508
509
  font-size: var(--scalar-mini);
509
510
  color: var(--scalar-color-green);
510
511
  }
511
- .property-discriminator[data-v-f1f4255a] {
512
+ .property-discriminator[data-v-0bec998b] {
512
513
  font-size: var(--scalar-mini);
513
514
  color: var(--scalar-color-purple);
514
515
  }
515
- .property-detail[data-v-f1f4255a] {
516
+ .property-detail[data-v-0bec998b] {
516
517
  font-size: var(--scalar-mini);
517
518
  color: var(--scalar-color-2);
518
519
  display: flex;
@@ -520,10 +521,10 @@ code.property-detail-value[data-v-1295f965] {
520
521
 
521
522
  min-width: 0;
522
523
  }
523
- .property-const[data-v-f1f4255a] {
524
+ .property-const[data-v-0bec998b] {
524
525
  color: var(--scalar-color-1);
525
526
  }
526
- .deprecated[data-v-f1f4255a] {
527
+ .deprecated[data-v-0bec998b] {
527
528
  text-decoration: line-through;
528
529
  }
529
530
 
@@ -2117,7 +2118,7 @@ button.headers-card-title[data-v-ab19704d]:hover {
2117
2118
  margin-top: 0;
2118
2119
  }
2119
2120
 
2120
- .references-classic .introduction-description[data-v-fe80002d] img {
2121
+ .references-classic .introduction-description[data-v-5065bb4a] img {
2121
2122
  max-width: 720px;
2122
2123
  }
2123
2124
 
@@ -3704,9 +3705,6 @@ body {
3704
3705
  .scalar-app .py-2\.25 {
3705
3706
  padding-block: 9px;
3706
3707
  }
3707
- .scalar-app .pt-1\.5 {
3708
- padding-top: 6px;
3709
- }
3710
3708
  .scalar-app .pb-12 {
3711
3709
  padding-bottom: 48px;
3712
3710
  }
@@ -8616,6 +8614,10 @@ to {
8616
8614
  --tw-leading: var(--scalar-line-height-5);
8617
8615
  line-height: var(--scalar-line-height-5);
8618
8616
  }
8617
+ .scalar-app .leading-5\.5 {
8618
+ --tw-leading: 22px;
8619
+ line-height: 22px;
8620
+ }
8619
8621
  .scalar-app .leading-\[1\.44\] {
8620
8622
  --tw-leading: 1.44;
8621
8623
  line-height: 1.44;
@@ -12109,7 +12111,7 @@ to {
12109
12111
 
12110
12112
  /* Configurable Layout Variables */
12111
12113
  @layer scalar-config {
12112
- .scalar-api-reference[data-v-2a5231c6] {
12114
+ .scalar-api-reference[data-v-9cc2ab84] {
12113
12115
  /* The header height */
12114
12116
  --refs-header-height: calc(
12115
12117
  var(--scalar-custom-header-height, 0px) + var(--scalar-header-height, 0px)
@@ -12131,20 +12133,20 @@ to {
12131
12133
  /* The maximum width of the content column */
12132
12134
  --refs-content-max-width: var(--scalar-content-max-width, 1540px);
12133
12135
  }
12134
- .scalar-api-reference.references-classic[data-v-2a5231c6] {
12136
+ .scalar-api-reference.references-classic[data-v-9cc2ab84] {
12135
12137
  /* Classic layout is wider */
12136
12138
  --refs-content-max-width: var(--scalar-content-max-width, 1420px);
12137
12139
  min-height: 100dvh;
12138
12140
  --refs-sidebar-width: 0;
12139
12141
  }
12140
12142
  }
12141
- .t-doc__sidebar[data-v-2a5231c6] {
12143
+ .t-doc__sidebar[data-v-9cc2ab84] {
12142
12144
  z-index: 10;
12143
12145
  }
12144
12146
 
12145
12147
  /* ----------------------------------------------------- */
12146
12148
  /* References Layout */
12147
- .references-layout[data-v-2a5231c6] {
12149
+ .references-layout[data-v-9cc2ab84] {
12148
12150
  /* Try to fill the container */
12149
12151
  min-height: 100dvh;
12150
12152
  min-width: 100%;
@@ -12168,39 +12170,39 @@ to {
12168
12170
 
12169
12171
  background: var(--scalar-background-1);
12170
12172
  }
12171
- .references-editor[data-v-2a5231c6] {
12173
+ .references-editor[data-v-9cc2ab84] {
12172
12174
  grid-area: editor;
12173
12175
  display: flex;
12174
12176
  min-width: 0;
12175
12177
  background: var(--scalar-background-1);
12176
12178
  }
12177
- .references-rendered[data-v-2a5231c6] {
12179
+ .references-rendered[data-v-9cc2ab84] {
12178
12180
  position: relative;
12179
12181
  grid-area: rendered;
12180
12182
  min-width: 0;
12181
12183
  background: var(--scalar-background-1);
12182
12184
  }
12183
- .scalar-api-reference.references-classic[data-v-2a5231c6],
12184
- .references-classic .references-rendered[data-v-2a5231c6] {
12185
+ .scalar-api-reference.references-classic[data-v-9cc2ab84],
12186
+ .references-classic .references-rendered[data-v-9cc2ab84] {
12185
12187
  height: initial !important;
12186
12188
  max-height: initial !important;
12187
12189
  }
12188
12190
  @layer scalar-config {
12189
- .references-sidebar[data-v-2a5231c6] {
12191
+ .references-sidebar[data-v-9cc2ab84] {
12190
12192
  /* Set a default width if references are enabled */
12191
12193
  --refs-sidebar-width: var(--scalar-sidebar-width, 288px);
12192
12194
  }
12193
12195
  }
12194
12196
 
12195
12197
  /* Footer */
12196
- .references-footer[data-v-2a5231c6] {
12198
+ .references-footer[data-v-9cc2ab84] {
12197
12199
  grid-area: footer;
12198
12200
  }
12199
12201
  /* ----------------------------------------------------- */
12200
12202
  /* Responsive / Mobile Layout */
12201
12203
  @media (max-width: 1000px) {
12202
12204
  /* Stack view on mobile */
12203
- .references-layout[data-v-2a5231c6] {
12205
+ .references-layout[data-v-9cc2ab84] {
12204
12206
  /* Adjust the sidebar height to the viewport height minus the header height */
12205
12207
  --refs-sidebar-height: calc(
12206
12208
  var(--full-height, 100dvh) - var(--scalar-custom-header-height, 0px)
@@ -12215,13 +12217,13 @@ to {
12215
12217
  'rendered'
12216
12218
  'footer';
12217
12219
  }
12218
- .references-editable[data-v-2a5231c6] {
12220
+ .references-editable[data-v-9cc2ab84] {
12219
12221
  grid-template-areas:
12220
12222
  'header'
12221
12223
  'navigation'
12222
12224
  'editor';
12223
12225
  }
12224
- .references-rendered[data-v-2a5231c6] {
12226
+ .references-rendered[data-v-9cc2ab84] {
12225
12227
  position: static;
12226
12228
  }
12227
12229
  }
@@ -12232,12 +12234,12 @@ to {
12232
12234
  * when the new elements are available
12233
12235
  */
12234
12236
  @media (max-width: 1000px) {
12235
- .scalar-api-references-standalone-mobile[data-v-2a5231c6]:not(.references-classic) {
12237
+ .scalar-api-references-standalone-mobile[data-v-9cc2ab84]:not(.references-classic) {
12236
12238
  --scalar-header-height: 50px;
12237
12239
  }
12238
12240
  }
12239
12241
 
12240
- .darklight-reference[data-v-2a5231c6] {
12242
+ .darklight-reference[data-v-9cc2ab84] {
12241
12243
  width: 100%;
12242
12244
  margin-top: auto;
12243
12245
  }