@scalar/api-reference 1.52.6 → 1.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/browser/standalone.js +176 -176
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReference.vue.js +1 -1
  6. package/dist/components/ApiReference.vue.js.map +1 -1
  7. package/dist/components/ApiReference.vue.script.js +15 -0
  8. package/dist/components/ApiReference.vue.script.js.map +1 -1
  9. package/dist/components/Content/Schema/LinkButton.vue.d.ts +14 -0
  10. package/dist/components/Content/Schema/LinkButton.vue.d.ts.map +1 -0
  11. package/dist/components/Content/Schema/LinkButton.vue.js +16 -0
  12. package/dist/components/Content/Schema/LinkButton.vue.js.map +1 -0
  13. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  15. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +1 -1
  16. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  17. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  19. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  20. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +2 -0
  21. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  22. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  23. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
  24. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js.map +1 -1
  25. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +13 -13
  26. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -1
  27. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -0
  28. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  29. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  30. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
  31. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +37 -16
  32. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  33. package/dist/components/Content/Schema/helpers/schema-name.d.ts +6 -1
  34. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  35. package/dist/components/Content/Schema/helpers/schema-name.js +13 -4
  36. package/dist/components/Content/Schema/helpers/schema-name.js.map +1 -1
  37. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  38. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  39. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  40. package/dist/features/Operation/components/RequestBody.vue.script.js +11 -4
  41. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  42. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  43. package/dist/style.css +216 -246
  44. package/package.json +13 -13
@@ -2,6 +2,7 @@ import Badge_default from "../../Badge/Badge.vue.js";
2
2
  import ScreenReader_default from "../../ScreenReader.vue.js";
3
3
  import { getSchemaType } from "./helpers/get-schema-type.js";
4
4
  import { getModelNameFromSchema } from "./helpers/schema-name.js";
5
+ import LinkButton_default from "./LinkButton.vue.js";
5
6
  import RenderString_default from "./RenderString.vue.js";
6
7
  import SchemaPropertyDefault_default from "./SchemaPropertyDefault.vue.js";
7
8
  import SchemaPropertyDetail_default from "./SchemaPropertyDetail.vue.js";
@@ -62,7 +63,8 @@ var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PU
62
63
  type: Boolean,
63
64
  default: false
64
65
  },
65
- modelName: {}
66
+ modelName: {},
67
+ eventBus: { default: null }
66
68
  },
67
69
  setup(__props) {
68
70
  const props = __props;
@@ -146,16 +148,25 @@ var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PU
146
148
  }
147
149
  return properties;
148
150
  });
149
- /** Optional schema title/name shown in addition to structural type. */
150
- const displayTitle = computed(() => {
151
+ /** Link data for navigating to the referenced model in the sidebar. */
152
+ const modelLink = computed(() => {
151
153
  if (!props.value) return null;
152
154
  if (props.hideModelNames) return null;
153
- if (props.modelName) return props.modelName;
155
+ if (props.modelName) return {
156
+ schemaKey: props.modelName,
157
+ label: props.modelName
158
+ };
154
159
  const modelName = getModelNameFromSchema(props.value);
155
- if (modelName) return modelName;
160
+ if (modelName) return {
161
+ schemaKey: modelName.schemaKey,
162
+ label: modelName.label
163
+ };
156
164
  if (isArraySchema(props.value) && props.value.items) {
157
165
  const itemName = getModelNameFromSchema(props.value.items);
158
- return itemName ? `${itemName}[]` : null;
166
+ return itemName ? {
167
+ schemaKey: itemName.schemaKey,
168
+ label: `${itemName.label}[]`
169
+ } : null;
159
170
  }
160
171
  return null;
161
172
  });
@@ -189,10 +200,20 @@ var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PU
189
200
  key: 0,
190
201
  truncate: ""
191
202
  }, {
192
- default: withCtx(() => [createVNode(ScreenReader_default, null, {
193
- default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Type: ", -1)])]),
194
- _: 1
195
- }), createTextVNode(toDisplayString(displayType.value) + toDisplayString(displayTitle.value ? ` · ${displayTitle.value}` : ""), 1)]),
203
+ default: withCtx(() => [
204
+ createVNode(ScreenReader_default, null, {
205
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Type: ", -1)])]),
206
+ _: 1
207
+ }),
208
+ createTextVNode(toDisplayString(displayType.value), 1),
209
+ modelLink.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[2] || (_cache[2] = createTextVNode(" · ", -1)), props.eventBus && modelLink.value.schemaKey ? (openBlock(), createBlock(LinkButton_default, {
210
+ key: 0,
211
+ onClick: _cache[0] || (_cache[0] = ($event) => props.eventBus.emit("scroll-to:model-by-name", { name: modelLink.value.schemaKey }))
212
+ }, {
213
+ default: withCtx(() => [createTextVNode(toDisplayString(modelLink.value.label), 1)]),
214
+ _: 1
215
+ })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(modelLink.value.label), 1)], 64))], 64)) : createCommentVNode("", true)
216
+ ]),
196
217
  _: 1
197
218
  })) : createCommentVNode("", true),
198
219
  (openBlock(true), createElementBlock(Fragment, null, renderList(validationProperties.value, (property) => {
@@ -202,10 +223,10 @@ var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PU
202
223
  truncate: property.truncate
203
224
  }, createSlots({
204
225
  default: withCtx(() => [property.key === "format" ? (openBlock(), createBlock(ScreenReader_default, { key: 0 }, {
205
- default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Format:", -1)])]),
226
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("Format:", -1)])]),
206
227
  _: 1
207
228
  })) : property.key === "pattern" ? (openBlock(), createBlock(ScreenReader_default, { key: 1 }, {
208
- default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Pattern: ", -1)])]),
229
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" Pattern: ", -1)])]),
209
230
  _: 1
210
231
  })) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(property.value), 1)]),
211
232
  _: 2
@@ -216,21 +237,21 @@ var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PU
216
237
  } : void 0]), 1032, ["code", "truncate"]);
217
238
  }), 128)),
218
239
  props.enum ? (openBlock(), createBlock(SchemaPropertyDetail_default, { key: 1 }, {
219
- default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("enum", -1)])]),
240
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("enum", -1)])]),
220
241
  _: 1
221
242
  })) : createCommentVNode("", true)
222
243
  ], 64)) : createCommentVNode("", true),
223
244
  props.additional ? (openBlock(), createElementBlock("div", _hoisted_3, [props.value?.["x-additionalPropertiesName"] ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(props.value["x-additionalPropertiesName"]), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode("additional properties")], 64))])) : createCommentVNode("", true),
224
245
  props.value?.deprecated ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(unref(Badge_default), null, {
225
- default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("deprecated", -1)])]),
246
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("deprecated", -1)])]),
226
247
  _: 1
227
248
  })])) : createCommentVNode("", true),
228
249
  constValue.value !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [createVNode(SchemaPropertyDetail_default, { truncate: "" }, {
229
- prefix: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("const: ", -1)])]),
250
+ prefix: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("const: ", -1)])]),
230
251
  default: withCtx(() => [createVNode(RenderString_default, { value: constValue.value }, null, 8, ["value"])]),
231
252
  _: 1
232
253
  })])) : (openBlock(), createElementBlock(Fragment, { key: 6 }, [props.value?.nullable === true ? (openBlock(), createBlock(SchemaPropertyDetail_default, { key: 0 }, {
233
- default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode(" nullable ", -1)])]),
254
+ default: withCtx(() => [..._cache[8] || (_cache[8] = [createTextVNode(" nullable ", -1)])]),
234
255
  _: 1
235
256
  })) : createCommentVNode("", true)], 64)),
236
257
  props.value?.writeOnly ? (openBlock(), createElementBlock("div", _hoisted_6, " write-only ")) : props.value?.readOnly ? (openBlock(), createElementBlock("div", _hoisted_7, " read-only ")) : createCommentVNode("", true),
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaPropertyHeading.vue.script.js","names":["$slots"],"sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport {\n isArraySchema,\n isNumberSchema,\n isStringSchema,\n} from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, toRef } from 'vue'\n\nimport { Badge } from '@/components/Badge'\nimport ScreenReader from '@/components/ScreenReader.vue'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport RenderString from './RenderString.vue'\nimport SchemaPropertyDefault from './SchemaPropertyDefault.vue'\nimport SchemaPropertyDetail from './SchemaPropertyDetail.vue'\nimport SchemaPropertyExamples from './SchemaPropertyExamples.vue'\n\nconst props = withDefaults(\n defineProps<{\n value: SchemaObject | undefined\n enum?: boolean\n isDiscriminator?: boolean\n required?: boolean\n additional?: boolean\n withExamples?: boolean\n hideModelNames?: boolean\n /** When the schema was resolved from a $ref, pass the ref name so it displays as e.g. \"Data\" instead of \"object\". */\n modelName?: string | null\n }>(),\n {\n isDiscriminator: false,\n required: false,\n withExamples: true,\n hideModelNames: false,\n },\n)\n\n// Convert to reactive refs for composables\nconst valueRef = toRef(props, 'value')\n\nconst constValue = computed(() => {\n if (!valueRef.value) {\n return undefined\n }\n\n const schema = valueRef.value\n\n // Direct const value\n if (schema.const !== undefined) {\n return schema.const\n }\n\n // Single-item enum acts as const\n if (schema.enum?.length === 1) {\n return schema.enum[0]\n }\n\n // Check items for const values (for arrays)\n if (isArraySchema(schema) && schema.items) {\n const items = resolve.schema(schema.items)\n\n if (isDefined(items.const)) {\n return items.const\n }\n\n if (items.enum?.length === 1) {\n return items.enum[0]\n }\n }\n\n return undefined\n})\n\nconst validationProperties = computed(() => {\n if (!valueRef.value) {\n return []\n }\n\n const schema = valueRef.value\n const properties = []\n\n // Array validation properties\n if (isArraySchema(schema)) {\n if (schema.minItems || schema.maxItems) {\n properties.push({\n key: 'array-range',\n value: `${schema.minItems || ''}…${schema.maxItems || ''}`,\n })\n }\n\n // Unique items\n if (schema.uniqueItems) {\n properties.push({\n key: 'unique-items',\n value: 'unique!',\n })\n }\n }\n\n // String length properties\n if (isStringSchema(schema)) {\n if (schema.minLength) {\n properties.push({\n key: 'min-length',\n prefix: 'min length: ',\n value: schema.minLength,\n })\n }\n\n if (schema.maxLength) {\n properties.push({\n key: 'max-length',\n prefix: 'max length: ',\n value: schema.maxLength,\n })\n }\n\n // Pattern\n if (schema.pattern) {\n properties.push({\n key: 'pattern',\n value: schema.pattern,\n code: true,\n truncate: true,\n })\n }\n }\n\n // Format\n if (isStringSchema(schema) || isNumberSchema(schema)) {\n if (schema.format) {\n properties.push({\n key: 'format',\n value: schema.format,\n truncate: true,\n })\n }\n }\n\n // Numeric validation properties\n if (isNumberSchema(schema)) {\n if (isDefined(schema.exclusiveMinimum)) {\n properties.push({\n key: 'exclusive-minimum',\n prefix: 'greater than: ',\n value: schema.exclusiveMinimum,\n })\n }\n\n if (isDefined(schema.minimum)) {\n properties.push({\n key: 'minimum',\n prefix: 'min: ',\n value: schema.minimum,\n })\n }\n\n if (isDefined(schema.exclusiveMaximum)) {\n properties.push({\n key: 'exclusive-maximum',\n prefix: 'less than: ',\n value: schema.exclusiveMaximum,\n })\n }\n\n if (isDefined(schema.maximum)) {\n properties.push({\n key: 'maximum',\n prefix: 'max: ',\n value: schema.maximum,\n })\n }\n\n if (isDefined(schema.multipleOf)) {\n properties.push({\n key: 'multiple-of',\n prefix: 'multiple of: ',\n value: schema.multipleOf,\n })\n }\n }\n\n return properties\n})\n\n/** Optional schema title/name shown in addition to structural type. */\nconst displayTitle = computed(() => {\n if (!props.value) {\n return null\n }\n\n if (props.hideModelNames) {\n return null\n }\n\n // Use explicit model name when schema was resolved from a $ref (e.g. in response/param body).\n if (props.modelName) {\n return props.modelName\n }\n\n const modelName = getModelNameFromSchema(props.value)\n if (modelName) {\n return modelName\n }\n\n if (isArraySchema(props.value) && props.value.items) {\n const itemName = getModelNameFromSchema(props.value.items)\n return itemName ? `${itemName}[]` : null\n }\n\n return null\n})\n\n/** Check if we should show the type information */\nconst shouldShowType = computed(() => {\n if (!props.value || !('type' in props.value)) {\n return false\n }\n\n // Always show type for arrays, even when items have const values\n if (props.value.type === 'array') {\n return true\n }\n\n // For non-arrays, only show if no const value at the schema level\n return !constValue.value\n})\n\n/** Get the display type */\nconst displayType = computed(() => {\n if (!props.value) {\n return ''\n }\n return getSchemaType(props.value)\n})\n\nconst exampleValue = computed(() => {\n if (isDefined(props.value?.example)) {\n return props.value.example\n }\n\n if (props.value && isArraySchema(props.value)) {\n const itemsExample = resolve.schema(props.value.items)?.example\n return isDefined(itemsExample) ? itemsExample : undefined\n }\n\n return undefined\n})\n</script>\n<template>\n <div class=\"property-heading\">\n <div\n v-if=\"$slots.name\"\n class=\"property-name\"\n :class=\"{ deprecated: props.value?.deprecated }\">\n <slot name=\"name\" />\n </div>\n <div\n v-if=\"props.isDiscriminator\"\n class=\"property-discriminator\">\n Discriminator\n </div>\n <template v-if=\"props.value\">\n <!-- Type information -->\n <SchemaPropertyDetail\n v-if=\"shouldShowType\"\n truncate>\n <ScreenReader>Type: </ScreenReader>{{ displayType\n }}{{ displayTitle ? ` · ${displayTitle}` : '' }}\n </SchemaPropertyDetail>\n\n <!-- Dynamic validation properties from composable -->\n <SchemaPropertyDetail\n v-for=\"property in validationProperties\"\n :key=\"property.key\"\n :code=\"property.code\"\n :truncate=\"property.truncate\">\n <ScreenReader v-if=\"property.key === 'format'\">Format:</ScreenReader>\n <ScreenReader v-else-if=\"property.key === 'pattern'\">\n Pattern:\n </ScreenReader>\n <template\n v-if=\"property.prefix\"\n #prefix>\n {{ property.prefix }}\n </template>\n {{ property.value }}\n </SchemaPropertyDetail>\n\n <!-- Enum indicator -->\n <SchemaPropertyDetail v-if=\"props.enum\">enum</SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.additional\"\n class=\"property-additional\">\n <template v-if=\"props.value?.['x-additionalPropertiesName']\">\n {{ props.value['x-additionalPropertiesName'] }}\n </template>\n <template v-else>additional properties</template>\n </div>\n <div\n v-if=\"props.value?.deprecated\"\n class=\"property-deprecated\">\n <Badge>deprecated</Badge>\n </div>\n <!-- Don't use `isDefined` here, we want to show `const` when the value is `null` -->\n <div\n v-if=\"constValue !== undefined\"\n class=\"property-const\">\n <SchemaPropertyDetail truncate>\n <template #prefix>const: </template>\n <RenderString :value=\"constValue\" />\n </SchemaPropertyDetail>\n </div>\n <template v-else>\n <!-- Shows only when a composition is used (so props.value?.type is undefined) -->\n <SchemaPropertyDetail v-if=\"(props.value as any)?.nullable === true\">\n nullable\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.value?.writeOnly\"\n class=\"property-write-only\">\n write-only\n </div>\n <div\n v-else-if=\"props.value?.readOnly\"\n class=\"property-read-only\">\n read-only\n </div>\n <div\n v-if=\"props.required\"\n class=\"property-required\">\n required\n </div>\n <SchemaPropertyDefault :value=\"props.value?.default\" />\n <SchemaPropertyExamples\n v-if=\"props.withExamples\"\n :example=\"exampleValue\"\n :examples=\"props.value?.examples\" />\n </div>\n</template>\n<style scoped>\n.property-heading {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n row-gap: 9px;\n white-space: nowrap;\n}\n\n.property-heading:has(+ .children),\n.property-heading:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n.property-heading > * {\n margin-right: 9px;\n}\n\n.property-heading:last-child {\n margin-right: 0;\n}\n\n.property-heading > .property-detail:not(:last-of-type) {\n margin-right: 0;\n}\n\n.property-name {\n max-width: 100%;\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n white-space: normal;\n overflow-wrap: break-word;\n}\n\n.property-additional {\n font-family: var(--scalar-font-code);\n}\n\n.property-required,\n.property-optional {\n color: var(--scalar-color-2);\n}\n\n.property-required {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-orange);\n}\n\n.property-read-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-blue);\n}\n\n.property-write-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-green);\n}\n\n.property-discriminator {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-purple);\n}\n\n.property-detail {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n display: flex;\n align-items: center;\n\n min-width: 0;\n}\n\n.property-const {\n color: var(--scalar-color-1);\n}\n\n.deprecated {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBA,MAAM,QAAQ;EAqBd,MAAM,WAAW,MAAM,OAAO,QAAO;EAErC,MAAM,aAAa,eAAe;AAChC,OAAI,CAAC,SAAS,MACZ;GAGF,MAAM,SAAS,SAAS;AAGxB,OAAI,OAAO,UAAU,KAAA,EACnB,QAAO,OAAO;AAIhB,OAAI,OAAO,MAAM,WAAW,EAC1B,QAAO,OAAO,KAAK;AAIrB,OAAI,cAAc,OAAO,IAAI,OAAO,OAAO;IACzC,MAAM,QAAQ,QAAQ,OAAO,OAAO,MAAK;AAEzC,QAAI,UAAU,MAAM,MAAM,CACxB,QAAO,MAAM;AAGf,QAAI,MAAM,MAAM,WAAW,EACzB,QAAO,MAAM,KAAK;;IAKvB;EAED,MAAM,uBAAuB,eAAe;AAC1C,OAAI,CAAC,SAAS,MACZ,QAAO,EAAC;GAGV,MAAM,SAAS,SAAS;GACxB,MAAM,aAAa,EAAC;AAGpB,OAAI,cAAc,OAAO,EAAE;AACzB,QAAI,OAAO,YAAY,OAAO,SAC5B,YAAW,KAAK;KACd,KAAK;KACL,OAAO,GAAG,OAAO,YAAY,GAAG,GAAG,OAAO,YAAY;KACvD,CAAA;AAIH,QAAI,OAAO,YACT,YAAW,KAAK;KACd,KAAK;KACL,OA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yB,MAAA,cAAA,EAAA,MAAA;4BAAR,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAV,cAAU,GAAA,CAAA,EAAA,CAAA;;;IAIX,WAAA,UAAe,KAAA,KAAA,WAAA,EADvB,mBAOM,OAPN,YAOM,CAJJ,YAGuB,8BAAA,EAHD,UAAA,IAAQ,EAAA;KACjB,QAAM,cAAQ,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAP,WAAO,GAAA,CAAA,EAAA,CAAA;4BACW,CAApC,YAAoC,sBAAA,EAArB,OAAO,WAAA,OAAU,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA,CAAA,CAAA;;0BAGpC,mBAKW,UAAA,EAAA,KAAA,GAAA,EAAA,CAHoB,MAAM,OAAe,aAAQ,QAAA,WAAA,EAA1D,YAEuB,8BAAA,EAAA,KAAA,GAAA,EAAA;4BAAvB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFqE,cAErE,GAAA,CAAA,EAAA,CAAA;;;IAGM,MAAM,OAAO,aAAA,WAAA,EADrB,mBAIM,OAJN,YAE8B,eAE9B,IAEa,MAAM,OAAO,YAAA,WAAA,EAD1B,mBAIM,OAJN,YAE6B,cAE7B,IAAA,mBAAA,IAAA,KAAA;IAEQ,MAAM,YAAA,WAAA,EADd,mBAIM,OAJN,YAE4B,aAE5B,IAAA,mBAAA,IAAA,KAAA;IACA,YAAuD,+BAAA,EAA/B,OAAO,MAAM,OAAO,SAAA,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;IAEpC,MAAM,gBAAA,WAAA,EADd,YAGsC,gCAAA;;KADnC,SAAS,aAAA;KACT,UAAU,MAAM,OAAO"}
1
+ {"version":3,"file":"SchemaPropertyHeading.vue.script.js","names":["$slots"],"sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport {\n isArraySchema,\n isNumberSchema,\n isStringSchema,\n} from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, toRef } from 'vue'\n\nimport { Badge } from '@/components/Badge'\nimport LinkButton from '@/components/Content/Schema/LinkButton.vue'\nimport ScreenReader from '@/components/ScreenReader.vue'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport RenderString from './RenderString.vue'\nimport SchemaPropertyDefault from './SchemaPropertyDefault.vue'\nimport SchemaPropertyDetail from './SchemaPropertyDetail.vue'\nimport SchemaPropertyExamples from './SchemaPropertyExamples.vue'\n\nconst props = withDefaults(\n defineProps<{\n value: SchemaObject | undefined\n enum?: boolean\n isDiscriminator?: boolean\n required?: boolean\n additional?: boolean\n withExamples?: boolean\n hideModelNames?: boolean\n /** When the schema was resolved from a $ref, pass the ref name so it displays as e.g. \"Data\" instead of \"object\". */\n modelName?: string | null\n eventBus?: WorkspaceEventBus | null\n }>(),\n {\n isDiscriminator: false,\n required: false,\n withExamples: true,\n hideModelNames: false,\n eventBus: null,\n },\n)\n\n// Convert to reactive refs for composables\nconst valueRef = toRef(props, 'value')\n\nconst constValue = computed(() => {\n if (!valueRef.value) {\n return undefined\n }\n\n const schema = valueRef.value\n\n // Direct const value\n if (schema.const !== undefined) {\n return schema.const\n }\n\n // Single-item enum acts as const\n if (schema.enum?.length === 1) {\n return schema.enum[0]\n }\n\n // Check items for const values (for arrays)\n if (isArraySchema(schema) && schema.items) {\n const items = resolve.schema(schema.items)\n\n if (isDefined(items.const)) {\n return items.const\n }\n\n if (items.enum?.length === 1) {\n return items.enum[0]\n }\n }\n\n return undefined\n})\n\nconst validationProperties = computed(() => {\n if (!valueRef.value) {\n return []\n }\n\n const schema = valueRef.value\n const properties = []\n\n // Array validation properties\n if (isArraySchema(schema)) {\n if (schema.minItems || schema.maxItems) {\n properties.push({\n key: 'array-range',\n value: `${schema.minItems || ''}…${schema.maxItems || ''}`,\n })\n }\n\n // Unique items\n if (schema.uniqueItems) {\n properties.push({\n key: 'unique-items',\n value: 'unique!',\n })\n }\n }\n\n // String length properties\n if (isStringSchema(schema)) {\n if (schema.minLength) {\n properties.push({\n key: 'min-length',\n prefix: 'min length: ',\n value: schema.minLength,\n })\n }\n\n if (schema.maxLength) {\n properties.push({\n key: 'max-length',\n prefix: 'max length: ',\n value: schema.maxLength,\n })\n }\n\n // Pattern\n if (schema.pattern) {\n properties.push({\n key: 'pattern',\n value: schema.pattern,\n code: true,\n truncate: true,\n })\n }\n }\n\n // Format\n if (isStringSchema(schema) || isNumberSchema(schema)) {\n if (schema.format) {\n properties.push({\n key: 'format',\n value: schema.format,\n truncate: true,\n })\n }\n }\n\n // Numeric validation properties\n if (isNumberSchema(schema)) {\n if (isDefined(schema.exclusiveMinimum)) {\n properties.push({\n key: 'exclusive-minimum',\n prefix: 'greater than: ',\n value: schema.exclusiveMinimum,\n })\n }\n\n if (isDefined(schema.minimum)) {\n properties.push({\n key: 'minimum',\n prefix: 'min: ',\n value: schema.minimum,\n })\n }\n\n if (isDefined(schema.exclusiveMaximum)) {\n properties.push({\n key: 'exclusive-maximum',\n prefix: 'less than: ',\n value: schema.exclusiveMaximum,\n })\n }\n\n if (isDefined(schema.maximum)) {\n properties.push({\n key: 'maximum',\n prefix: 'max: ',\n value: schema.maximum,\n })\n }\n\n if (isDefined(schema.multipleOf)) {\n properties.push({\n key: 'multiple-of',\n prefix: 'multiple of: ',\n value: schema.multipleOf,\n })\n }\n }\n\n return properties\n})\n\n/** Link data for navigating to the referenced model in the sidebar. */\nconst modelLink = computed(() => {\n if (!props.value) {\n return null\n }\n\n if (props.hideModelNames) {\n return null\n }\n\n if (props.modelName) {\n return { schemaKey: props.modelName, label: props.modelName }\n }\n\n const modelName = getModelNameFromSchema(props.value)\n if (modelName) {\n return { schemaKey: modelName.schemaKey, label: modelName.label }\n }\n\n if (isArraySchema(props.value) && props.value.items) {\n const itemName = getModelNameFromSchema(props.value.items)\n return itemName\n ? { schemaKey: itemName.schemaKey, label: `${itemName.label}[]` }\n : null\n }\n\n return null\n})\n\n/** Check if we should show the type information */\nconst shouldShowType = computed(() => {\n if (!props.value || !('type' in props.value)) {\n return false\n }\n\n // Always show type for arrays, even when items have const values\n if (props.value.type === 'array') {\n return true\n }\n\n // For non-arrays, only show if no const value at the schema level\n return !constValue.value\n})\n\n/** Get the display type */\nconst displayType = computed(() => {\n if (!props.value) {\n return ''\n }\n return getSchemaType(props.value)\n})\n\nconst exampleValue = computed(() => {\n if (isDefined(props.value?.example)) {\n return props.value.example\n }\n\n if (props.value && isArraySchema(props.value)) {\n const itemsExample = resolve.schema(props.value.items)?.example\n return isDefined(itemsExample) ? itemsExample : undefined\n }\n\n return undefined\n})\n</script>\n<template>\n <div class=\"property-heading\">\n <div\n v-if=\"$slots.name\"\n class=\"property-name\"\n :class=\"{ deprecated: props.value?.deprecated }\">\n <slot name=\"name\" />\n </div>\n <div\n v-if=\"props.isDiscriminator\"\n class=\"property-discriminator\">\n Discriminator\n </div>\n <template v-if=\"props.value\">\n <!-- Type information -->\n <SchemaPropertyDetail\n v-if=\"shouldShowType\"\n truncate>\n <ScreenReader>Type: </ScreenReader>{{ displayType\n }}<template v-if=\"modelLink\">\n ·\n <LinkButton\n v-if=\"props.eventBus && modelLink.schemaKey\"\n @click=\"\n props.eventBus.emit('scroll-to:model-by-name', {\n name: modelLink.schemaKey,\n })\n \">\n {{ modelLink.label }}\n </LinkButton>\n <template v-else>{{ modelLink.label }}</template>\n </template>\n </SchemaPropertyDetail>\n\n <!-- Dynamic validation properties from composable -->\n <SchemaPropertyDetail\n v-for=\"property in validationProperties\"\n :key=\"property.key\"\n :code=\"property.code\"\n :truncate=\"property.truncate\">\n <ScreenReader v-if=\"property.key === 'format'\">Format:</ScreenReader>\n <ScreenReader v-else-if=\"property.key === 'pattern'\">\n Pattern:\n </ScreenReader>\n <template\n v-if=\"property.prefix\"\n #prefix>\n {{ property.prefix }}\n </template>\n {{ property.value }}\n </SchemaPropertyDetail>\n\n <!-- Enum indicator -->\n <SchemaPropertyDetail v-if=\"props.enum\">enum</SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.additional\"\n class=\"property-additional\">\n <template v-if=\"props.value?.['x-additionalPropertiesName']\">\n {{ props.value['x-additionalPropertiesName'] }}\n </template>\n <template v-else>additional properties</template>\n </div>\n <div\n v-if=\"props.value?.deprecated\"\n class=\"property-deprecated\">\n <Badge>deprecated</Badge>\n </div>\n <!-- Don't use `isDefined` here, we want to show `const` when the value is `null` -->\n <div\n v-if=\"constValue !== undefined\"\n class=\"property-const\">\n <SchemaPropertyDetail truncate>\n <template #prefix>const: </template>\n <RenderString :value=\"constValue\" />\n </SchemaPropertyDetail>\n </div>\n <template v-else>\n <!-- Shows only when a composition is used (so props.value?.type is undefined) -->\n <SchemaPropertyDetail v-if=\"(props.value as any)?.nullable === true\">\n nullable\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.value?.writeOnly\"\n class=\"property-write-only\">\n write-only\n </div>\n <div\n v-else-if=\"props.value?.readOnly\"\n class=\"property-read-only\">\n read-only\n </div>\n <div\n v-if=\"props.required\"\n class=\"property-required\">\n required\n </div>\n <SchemaPropertyDefault :value=\"props.value?.default\" />\n <SchemaPropertyExamples\n v-if=\"props.withExamples\"\n :example=\"exampleValue\"\n :examples=\"props.value?.examples\" />\n </div>\n</template>\n<style scoped>\n.property-heading {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n row-gap: 9px;\n white-space: nowrap;\n}\n\n.property-heading:has(+ .children),\n.property-heading:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n.property-heading > * {\n margin-right: 9px;\n}\n\n.property-heading:last-child {\n margin-right: 0;\n}\n\n.property-heading > .property-detail:not(:last-of-type) {\n margin-right: 0;\n}\n\n.property-name {\n max-width: 100%;\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n white-space: normal;\n overflow-wrap: break-word;\n}\n\n.property-additional {\n font-family: var(--scalar-font-code);\n}\n\n.property-required,\n.property-optional {\n color: var(--scalar-color-2);\n}\n\n.property-required {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-orange);\n}\n\n.property-read-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-blue);\n}\n\n.property-write-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-green);\n}\n\n.property-discriminator {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-purple);\n}\n\n.property-detail {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n display: flex;\n align-items: center;\n\n min-width: 0;\n}\n\n.property-const {\n color: var(--scalar-color-1);\n}\n\n.deprecated {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,QAAQ;EAuBd,MAAM,WAAW,MAAM,OAAO,QAAO;EAErC,MAAM,aAAa,eAAe;AAChC,OAAI,CAAC,SAAS,MACZ;GAGF,MAAM,SAAS,SAAS;AAGxB,OAAI,OAAO,UAAU,KAAA,EACnB,QAAO,OAAO;AAIhB,OAAI,OAAO,MAAM,WAAW,EAC1B,QAAO,OAAO,KAAK;AAIrB,OAAI,cAAc,OAAO,IAAI,OAAO,OAAO;IACzC,MAAM,QAAQ,QAAQ,OAAO,OAAO,MAAK;AAEzC,QAAI,UAAU,MAAM,MAAM,CACxB,QAAO,MAAM;AAGf,QAAI,MAAM,MAAM,WAAW,EACzB,QAAO,MAAM,KAAK;;IAKvB;EAED,MAAM,uBAAuB,eAAe;AAC1C,OAAI,CAAC,SAAS,MACZ,QAAO,EAAC;GAGV,MAAM,SAAS,SAAS;GACxB,MAAM,aAAa,EAAC;AAGpB,OAAI,cAAc,OAAO,E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EAAA,CAHoB,MAAM,OAAe,aAAQ,QAAA,WAAA,EAA1D,YAEuB,8BAAA,EAAA,KAAA,GAAA,EAAA;4BAAvB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFqE,cAErE,GAAA,CAAA,EAAA,CAAA;;;IAGM,MAAM,OAAO,aAAA,WAAA,EADrB,mBAIM,OAJN,YAE8B,eAE9B,IAEa,MAAM,OAAO,YAAA,WAAA,EAD1B,mBAIM,OAJN,YAE6B,cAE7B,IAAA,mBAAA,IAAA,KAAA;IAEQ,MAAM,YAAA,WAAA,EADd,mBAIM,OAJN,YAE4B,aAE5B,IAAA,mBAAA,IAAA,KAAA;IACA,YAAuD,+BAAA,EAA/B,OAAO,MAAM,OAAO,SAAA,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;IAEpC,MAAM,gBAAA,WAAA,EADd,YAGsC,gCAAA;;KADnC,SAAS,aAAA;KACT,UAAU,MAAM,OAAO"}
@@ -4,5 +4,10 @@ import type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/
4
4
  *
5
5
  * Handles $ref, title, name, type, and schema dictionary lookup
6
6
  */
7
- export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>) => string | null;
7
+ export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>) => {
8
+ /** The key in components.schemas (extracted from $ref), used for sidebar navigation. */
9
+ schemaKey: string | null;
10
+ /** The human-readable name to display (schema.title, schema.name, or ref key). */
11
+ label: string;
12
+ } | null;
8
13
  //# 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;AAIrH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D,MAAM,GAAG,IAyBX,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;IACD,wFAAwF;IACxF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,IAwBH,CAAA"}
@@ -9,11 +9,20 @@ import { resolve } from "@scalar/workspace-store/resolve";
9
9
  var getModelNameFromSchema = (schemaOrRef) => {
10
10
  if (!schemaOrRef) return null;
11
11
  const schema = resolve.schema(schemaOrRef);
12
- if (schema.title) return schema.title;
13
- if (schema.name) return schema.name;
12
+ const schemaKey = "$ref" in schemaOrRef ? getRefName(schemaOrRef.$ref) ?? null : null;
13
+ if (schema.title) return {
14
+ schemaKey,
15
+ label: schema.title
16
+ };
17
+ if (schema.name) return {
18
+ schemaKey,
19
+ label: schema.name
20
+ };
14
21
  if ("$ref" in schemaOrRef) {
15
- const refName = getRefName(schemaOrRef.$ref);
16
- if (refName) return refName;
22
+ if (schemaKey) return {
23
+ schemaKey,
24
+ label: schemaKey
25
+ };
17
26
  }
18
27
  return null;
19
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema-name.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { getRefName } from './get-ref-name'\n\n/**\n * Extract schema name from various schema formats\n *\n * Handles $ref, title, name, type, and schema dictionary lookup\n */\nexport const getModelNameFromSchema = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): string | null => {\n if (!schemaOrRef) {\n return null\n }\n\n const schema = resolve.schema(schemaOrRef)\n\n // Direct title/name properties - use direct property access for better performance\n if (schema.title) {\n return schema.title\n }\n\n if (schema.name) {\n return schema.name\n }\n\n if ('$ref' in schemaOrRef) {\n // Fall back to the schema key when the referenced schema has no human-friendly name.\n const refName = getRefName(schemaOrRef.$ref)\n if (refName) {\n return refName\n }\n }\n\n return null\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,0BACX,gBACkB;AAClB,KAAI,CAAC,YACH,QAAO;CAGT,MAAM,SAAS,QAAQ,OAAO,YAAY;AAG1C,KAAI,OAAO,MACT,QAAO,OAAO;AAGhB,KAAI,OAAO,KACT,QAAO,OAAO;AAGhB,KAAI,UAAU,aAAa;EAEzB,MAAM,UAAU,WAAW,YAAY,KAAK;AAC5C,MAAI,QACF,QAAO;;AAIX,QAAO"}
1
+ {"version":3,"file":"schema-name.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { getRefName } from './get-ref-name'\n\n/**\n * Extract schema name from various schema formats\n *\n * Handles $ref, title, name, type, and schema dictionary lookup\n */\nexport const getModelNameFromSchema = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): {\n /** The key in components.schemas (extracted from $ref), used for sidebar navigation. */\n schemaKey: string | null\n /** The human-readable name to display (schema.title, schema.name, or ref key). */\n label: string\n} | null => {\n if (!schemaOrRef) {\n return null\n }\n\n const schema = resolve.schema(schemaOrRef)\n\n const schemaKey = '$ref' in schemaOrRef ? (getRefName(schemaOrRef.$ref) ?? null) : null\n\n if (schema.title) {\n return { schemaKey, label: schema.title }\n }\n\n if (schema.name) {\n return { schemaKey, label: schema.name }\n }\n\n if ('$ref' in schemaOrRef) {\n if (schemaKey) {\n return { schemaKey, label: schemaKey }\n }\n }\n\n return null\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,0BACX,gBAMU;AACV,KAAI,CAAC,YACH,QAAO;CAGT,MAAM,SAAS,QAAQ,OAAO,YAAY;CAE1C,MAAM,YAAY,UAAU,cAAe,WAAW,YAAY,KAAK,IAAI,OAAQ;AAEnF,KAAI,OAAO,MACT,QAAO;EAAE;EAAW,OAAO,OAAO;EAAO;AAG3C,KAAI,OAAO,KACT,QAAO;EAAE;EAAW,OAAO,OAAO;EAAM;AAG1C,KAAI,UAAU;MACR,UACF,QAAO;GAAE;GAAW,OAAO;GAAW;;AAI1C,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/RequestBody.vue"],"names":[],"mappings":"AAyQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAarG,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE;QACP,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;QACjD,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;QACzD,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;KAChC,CAAA;CACF,CAAC;AAsGF,KAAK,gBAAgB,GAAG;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAsOxD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK7C,QAAA,MAAM,UAAU;;;;kFAGd,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":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/RequestBody.vue"],"names":[],"mappings":"AAoRA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAcrG,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE;QACP,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;QACjD,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;QACzD,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;KAChC,CAAA;CACF,CAAC;AAsGF,KAAK,gBAAgB,GAAG;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAuQxD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK7C,QAAA,MAAM,UAAU;;;;kFAGd,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"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import RequestBody_vue_vue_type_script_setup_true_lang_default from "./RequestBody.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/features/Operation/components/RequestBody.vue
5
- var RequestBody_default = /* @__PURE__ */ _plugin_vue_export_helper_default(RequestBody_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-86d21430"]]);
5
+ var RequestBody_default = /* @__PURE__ */ _plugin_vue_export_helper_default(RequestBody_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-47902614"]]);
6
6
  //#endregion
7
7
  export { RequestBody_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.js","names":[],"sources":["../../../../src/features/Operation/components/RequestBody.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { Schema } from '@/components/Content/Schema'\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getModelNameFromSchema } from '@/components/Content/Schema/helpers/schema-name'\nimport {\n reduceNamesToObject,\n sortPropertyNames,\n} from '@/components/Content/Schema/helpers/sort-property-names'\n\nimport ContentTypeSelect from './ContentTypeSelect.vue'\n\nconst { requestBody, options } = defineProps<{\n breadcrumb?: string[]\n requestBody?: RequestBodyObject\n eventBus: WorkspaceEventBus | null\n options: {\n orderRequiredPropertiesFirst: boolean | undefined\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n hideModels: boolean | undefined\n }\n}>()\n\n/**\n * The maximum number of properties to show in the request body schema.\n */\nconst MAX_VISIBLE_PROPERTIES = 12\n\nconst availableContentTypes = computed(() =>\n Object.keys(requestBody?.content ?? {}),\n)\n\nconst selectedContentType = defineModel<string>('selectedContentType', {\n default: 'application/json',\n})\n\nif (requestBody?.content) {\n if (availableContentTypes.value[0]) {\n selectedContentType.value = availableContentTypes.value[0]\n }\n}\n\n/** Raw schema (possibly with $ref) for the selected content type */\nconst rawSchema = computed(\n () => requestBody?.content?.[selectedContentType.value]?.schema,\n)\n\nconst schema = computed(() => getResolvedRef(rawSchema.value))\n\n/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */\nconst schemaModelName = computed(\n () => (rawSchema.value && getModelNameFromSchema(rawSchema.value)) ?? null,\n)\n\n/**\n * Splits schema properties into visible and collapsed sections when there are more than 12 properties.\n * Returns null for schemas with fewer properties or non-object schemas.\n */\nconst partitionedSchema = computed(() => {\n // Early return if not an object schema\n if (!schema.value || !isTypeObject(schema.value)) {\n return null\n }\n\n // Lets sort the names first\n const sortedNames = sortPropertyNames(\n schema.value,\n schema.value.discriminator,\n {\n hideReadOnly: true,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n },\n )\n\n if (sortedNames.length <= MAX_VISIBLE_PROPERTIES) {\n return null\n }\n\n // Destructure everything except properties\n const { properties, ...schemaMetadata } = schema.value\n if (!properties) {\n return null\n }\n\n return {\n visibleProperties: {\n ...schemaMetadata,\n properties: reduceNamesToObject(\n sortedNames.slice(0, MAX_VISIBLE_PROPERTIES),\n properties,\n ),\n },\n collapsedProperties: {\n ...schemaMetadata,\n properties: reduceNamesToObject(\n sortedNames.slice(MAX_VISIBLE_PROPERTIES),\n properties,\n ),\n },\n }\n})\n\n/**\n * We don't want to render the request body if its completely empty\n * @example\n * {\n * \"content\": {},\n * }\n */\nconst shouldRenderRequestBody = computed(\n () =>\n Object.keys(requestBody?.content ?? {}).length > 0 ||\n requestBody?.description ||\n requestBody?.required,\n)\n</script>\n<template>\n <div\n v-if=\"requestBody && shouldRenderRequestBody\"\n aria-label=\"Request Body\"\n class=\"request-body\"\n role=\"group\">\n <div class=\"request-body-header\">\n <div class=\"request-body-title\">\n <slot name=\"title\" />\n <span\n v-if=\"schemaModelName\"\n class=\"text-c-2 text-xs leading-none font-normal\"\n data-testid=\"request-body-schema-name\">\n <span class=\"text-c-3 mx-1.5\">·</span>{{ schemaModelName }}\n </span>\n </div>\n <div class=\"flex items-center gap-2\">\n <div\n v-if=\"requestBody.required\"\n class=\"request-body-required\">\n required\n </div>\n <ContentTypeSelect\n v-model=\"selectedContentType\"\n :content=\"requestBody.content\" />\n </div>\n <div\n v-if=\"requestBody.description\"\n class=\"request-body-description\">\n <ScalarMarkdown :value=\"requestBody.description\" />\n </div>\n </div>\n\n <!-- For over 12 properties we want to show 12 and collapse the rest -->\n <div\n v-if=\"partitionedSchema\"\n class=\"request-body-schema\">\n <Schema\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n name=\"Request Body\"\n noncollapsible\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"partitionedSchema.visibleProperties\"\n schemaContext=\"requestBody\" />\n\n <Schema\n additionalProperties\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n name=\"Request Body\"\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"partitionedSchema.collapsedProperties\"\n schemaContext=\"requestBody\" />\n </div>\n\n <!-- Show em all 12 and under -->\n <div\n v-else-if=\"schema\"\n class=\"request-body-schema\">\n <Schema\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n :hideReadOnly=\"true\"\n name=\"Request Body\"\n noncollapsible\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"schema\"\n schemaContext=\"requestBody\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.request-body {\n margin-top: 24px;\n}\n.request-body-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 12px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n flex-flow: wrap;\n}\n.request-body-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: var(--scalar-font-size-2);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n}\n.request-body-required {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-orange);\n font-weight: normal;\n border-radius: 16px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 2px 8px;\n height: 20px;\n}\n.request-body-description {\n margin-top: 6px;\n font-size: var(--scalar-small);\n width: 100%;\n}\n\n.request-body-header\n + .request-body-schema:has(> .schema-card > .schema-card-description),\n.request-body-header\n + .request-body-schema:has(\n > .schema-card > .schema-properties > * > .property--level-0\n ) {\n /** Add a bit of space between the heading border and the schema description or properties */\n padding-top: 8px;\n}\n.request-body-description :deep(.markdown) * {\n color: var(--scalar-color-2) !important;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestBody.vue.js","names":[],"sources":["../../../../src/features/Operation/components/RequestBody.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { Schema } from '@/components/Content/Schema'\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getModelNameFromSchema } from '@/components/Content/Schema/helpers/schema-name'\nimport {\n reduceNamesToObject,\n sortPropertyNames,\n} from '@/components/Content/Schema/helpers/sort-property-names'\nimport LinkButton from '@/components/Content/Schema/LinkButton.vue'\n\nimport ContentTypeSelect from './ContentTypeSelect.vue'\n\nconst { requestBody, options } = defineProps<{\n breadcrumb?: string[]\n requestBody?: RequestBodyObject\n eventBus: WorkspaceEventBus | null\n options: {\n orderRequiredPropertiesFirst: boolean | undefined\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n hideModels: boolean | undefined\n }\n}>()\n\n/**\n * The maximum number of properties to show in the request body schema.\n */\nconst MAX_VISIBLE_PROPERTIES = 12\n\nconst availableContentTypes = computed(() =>\n Object.keys(requestBody?.content ?? {}),\n)\n\nconst selectedContentType = defineModel<string>('selectedContentType', {\n default: 'application/json',\n})\n\nif (requestBody?.content) {\n if (availableContentTypes.value[0]) {\n selectedContentType.value = availableContentTypes.value[0]\n }\n}\n\n/** Raw schema (possibly with $ref) for the selected content type */\nconst rawSchema = computed(\n () => requestBody?.content?.[selectedContentType.value]?.schema,\n)\n\nconst schema = computed(() => getResolvedRef(rawSchema.value))\n\n/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */\nconst modelLink = computed(\n () => (rawSchema.value && getModelNameFromSchema(rawSchema.value)) ?? null,\n)\n\n/**\n * Splits schema properties into visible and collapsed sections when there are more than 12 properties.\n * Returns null for schemas with fewer properties or non-object schemas.\n */\nconst partitionedSchema = computed(() => {\n // Early return if not an object schema\n if (!schema.value || !isTypeObject(schema.value)) {\n return null\n }\n\n // Lets sort the names first\n const sortedNames = sortPropertyNames(\n schema.value,\n schema.value.discriminator,\n {\n hideReadOnly: true,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n },\n )\n\n if (sortedNames.length <= MAX_VISIBLE_PROPERTIES) {\n return null\n }\n\n // Destructure everything except properties\n const { properties, ...schemaMetadata } = schema.value\n if (!properties) {\n return null\n }\n\n return {\n visibleProperties: {\n ...schemaMetadata,\n properties: reduceNamesToObject(\n sortedNames.slice(0, MAX_VISIBLE_PROPERTIES),\n properties,\n ),\n },\n collapsedProperties: {\n ...schemaMetadata,\n properties: reduceNamesToObject(\n sortedNames.slice(MAX_VISIBLE_PROPERTIES),\n properties,\n ),\n },\n }\n})\n\n/**\n * We don't want to render the request body if its completely empty\n * @example\n * {\n * \"content\": {},\n * }\n */\nconst shouldRenderRequestBody = computed(\n () =>\n Object.keys(requestBody?.content ?? {}).length > 0 ||\n requestBody?.description ||\n requestBody?.required,\n)\n</script>\n<template>\n <div\n v-if=\"requestBody && shouldRenderRequestBody\"\n aria-label=\"Request Body\"\n class=\"request-body\"\n role=\"group\">\n <div class=\"request-body-header\">\n <div class=\"request-body-title\">\n <slot name=\"title\" />\n <span\n v-if=\"modelLink\"\n class=\"text-c-2 text-xs leading-none font-normal\"\n data-testid=\"request-body-schema-name\">\n <span class=\"text-c-3 mx-1.5\">·</span>\n <LinkButton\n v-if=\"eventBus && modelLink.schemaKey\"\n @click=\"\n eventBus.emit('scroll-to:model-by-name', {\n name: modelLink.schemaKey,\n })\n \">\n {{ modelLink.label }}\n </LinkButton>\n <template v-else>{{ modelLink.label }}</template>\n </span>\n </div>\n <div class=\"flex items-center gap-2\">\n <div\n v-if=\"requestBody.required\"\n class=\"request-body-required\">\n required\n </div>\n <ContentTypeSelect\n v-model=\"selectedContentType\"\n :content=\"requestBody.content\" />\n </div>\n <div\n v-if=\"requestBody.description\"\n class=\"request-body-description\">\n <ScalarMarkdown :value=\"requestBody.description\" />\n </div>\n </div>\n\n <!-- For over 12 properties we want to show 12 and collapse the rest -->\n <div\n v-if=\"partitionedSchema\"\n class=\"request-body-schema\">\n <Schema\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n name=\"Request Body\"\n noncollapsible\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"partitionedSchema.visibleProperties\"\n schemaContext=\"requestBody\" />\n\n <Schema\n additionalProperties\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n name=\"Request Body\"\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"partitionedSchema.collapsedProperties\"\n schemaContext=\"requestBody\" />\n </div>\n\n <!-- Show em all 12 and under -->\n <div\n v-else-if=\"schema\"\n class=\"request-body-schema\">\n <Schema\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n :hideReadOnly=\"true\"\n name=\"Request Body\"\n noncollapsible\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"schema\"\n schemaContext=\"requestBody\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.request-body {\n margin-top: 24px;\n}\n.request-body-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 12px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n flex-flow: wrap;\n}\n.request-body-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: var(--scalar-font-size-2);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n}\n.request-body-required {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-orange);\n font-weight: normal;\n border-radius: 16px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 2px 8px;\n height: 20px;\n}\n.request-body-description {\n margin-top: 6px;\n font-size: var(--scalar-small);\n width: 100%;\n}\n\n.request-body-header\n + .request-body-schema:has(> .schema-card > .schema-card-description),\n.request-body-header\n + .request-body-schema:has(\n > .schema-card > .schema-properties > * > .property--level-0\n ) {\n /** Add a bit of space between the heading border and the schema description or properties */\n padding-top: 8px;\n}\n.request-body-description :deep(.markdown) * {\n color: var(--scalar-color-2) !important;\n}\n</style>\n"],"mappings":""}
@@ -1,9 +1,10 @@
1
1
  import { isTypeObject } from "../../../components/Content/Schema/helpers/is-type-object.js";
2
2
  import { reduceNamesToObject, sortPropertyNames } from "../../../components/Content/Schema/helpers/sort-property-names.js";
3
3
  import { getModelNameFromSchema } from "../../../components/Content/Schema/helpers/schema-name.js";
4
+ import LinkButton_default from "../../../components/Content/Schema/LinkButton.vue.js";
4
5
  import Schema_default from "../../../components/Content/Schema/Schema.vue.js";
5
6
  import ContentTypeSelect_default from "./ContentTypeSelect.vue.js";
6
- import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, openBlock, renderSlot, toDisplayString, unref, useModel } from "vue";
7
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, openBlock, renderSlot, toDisplayString, unref, useModel, withCtx } from "vue";
7
8
  import { ScalarMarkdown } from "@scalar/components";
8
9
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
9
10
  //#region src/features/Operation/components/RequestBody.vue?vue&type=script&setup=true&lang.ts
@@ -63,7 +64,7 @@ var RequestBody_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
63
64
  const rawSchema = computed(() => __props.requestBody?.content?.[selectedContentType.value]?.schema);
64
65
  const schema = computed(() => getResolvedRef(rawSchema.value));
65
66
  /** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */
66
- const schemaModelName = computed(() => (rawSchema.value && getModelNameFromSchema(rawSchema.value)) ?? null);
67
+ const modelLink = computed(() => (rawSchema.value && getModelNameFromSchema(rawSchema.value)) ?? null);
67
68
  /**
68
69
  * Splits schema properties into visible and collapsed sections when there are more than 12 properties.
69
70
  * Returns null for schemas with fewer properties or non-object schemas.
@@ -99,10 +100,16 @@ var RequestBody_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
99
100
  const shouldRenderRequestBody = computed(() => Object.keys(__props.requestBody?.content ?? {}).length > 0 || __props.requestBody?.description || __props.requestBody?.required);
100
101
  return (_ctx, _cache) => {
101
102
  return __props.requestBody && shouldRenderRequestBody.value ? (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [
102
- createElementVNode("div", _hoisted_3, [renderSlot(_ctx.$slots, "title", {}, void 0, true), schemaModelName.value ? (openBlock(), createElementBlock("span", _hoisted_4, [_cache[1] || (_cache[1] = createElementVNode("span", { class: "text-c-3 mx-1.5" }, "·", -1)), createTextVNode(toDisplayString(schemaModelName.value), 1)])) : createCommentVNode("", true)]),
103
+ createElementVNode("div", _hoisted_3, [renderSlot(_ctx.$slots, "title", {}, void 0, true), modelLink.value ? (openBlock(), createElementBlock("span", _hoisted_4, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "text-c-3 mx-1.5" }, "·", -1)), __props.eventBus && modelLink.value.schemaKey ? (openBlock(), createBlock(LinkButton_default, {
104
+ key: 0,
105
+ onClick: _cache[0] || (_cache[0] = ($event) => __props.eventBus.emit("scroll-to:model-by-name", { name: modelLink.value.schemaKey }))
106
+ }, {
107
+ default: withCtx(() => [createTextVNode(toDisplayString(modelLink.value.label), 1)]),
108
+ _: 1
109
+ })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(modelLink.value.label), 1)], 64))])) : createCommentVNode("", true)]),
103
110
  createElementVNode("div", _hoisted_5, [__props.requestBody.required ? (openBlock(), createElementBlock("div", _hoisted_6, " required ")) : createCommentVNode("", true), createVNode(ContentTypeSelect_default, {
104
111
  modelValue: selectedContentType.value,
105
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedContentType.value = $event),
112
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedContentType.value = $event),
106
113
  content: __props.requestBody.content
107
114
  }, null, 8, ["modelValue", "content"])]),
108
115
  __props.requestBody.description ? (openBlock(), createElementBlock("div", _hoisted_7, [createVNode(unref(ScalarMarkdown), { value: __props.requestBody.description }, null, 8, ["value"])])) : createCommentVNode("", true)
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.script.js","names":[],"sources":["../../../../src/features/Operation/components/RequestBody.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { Schema } from '@/components/Content/Schema'\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getModelNameFromSchema } from '@/components/Content/Schema/helpers/schema-name'\nimport {\n reduceNamesToObject,\n sortPropertyNames,\n} from '@/components/Content/Schema/helpers/sort-property-names'\n\nimport ContentTypeSelect from './ContentTypeSelect.vue'\n\nconst { requestBody, options } = defineProps<{\n breadcrumb?: string[]\n requestBody?: RequestBodyObject\n eventBus: WorkspaceEventBus | null\n options: {\n orderRequiredPropertiesFirst: boolean | undefined\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n hideModels: boolean | undefined\n }\n}>()\n\n/**\n * The maximum number of properties to show in the request body schema.\n */\nconst MAX_VISIBLE_PROPERTIES = 12\n\nconst availableContentTypes = computed(() =>\n Object.keys(requestBody?.content ?? {}),\n)\n\nconst selectedContentType = defineModel<string>('selectedContentType', {\n default: 'application/json',\n})\n\nif (requestBody?.content) {\n if (availableContentTypes.value[0]) {\n selectedContentType.value = availableContentTypes.value[0]\n }\n}\n\n/** Raw schema (possibly with $ref) for the selected content type */\nconst rawSchema = computed(\n () => requestBody?.content?.[selectedContentType.value]?.schema,\n)\n\nconst schema = computed(() => getResolvedRef(rawSchema.value))\n\n/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */\nconst schemaModelName = computed(\n () => (rawSchema.value && getModelNameFromSchema(rawSchema.value)) ?? null,\n)\n\n/**\n * Splits schema properties into visible and collapsed sections when there are more than 12 properties.\n * Returns null for schemas with fewer properties or non-object schemas.\n */\nconst partitionedSchema = computed(() => {\n // Early return if not an object schema\n if (!schema.value || !isTypeObject(schema.value)) {\n return null\n }\n\n // Lets sort the names first\n const sortedNames = sortPropertyNames(\n schema.value,\n schema.value.discriminator,\n {\n hideReadOnly: true,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n },\n )\n\n if (sortedNames.length <= MAX_VISIBLE_PROPERTIES) {\n return null\n }\n\n // Destructure everything except properties\n const { properties, ...schemaMetadata } = schema.value\n if (!properties) {\n return null\n }\n\n return {\n visibleProperties: {\n ...schemaMetadata,\n properties: reduceNamesToObject(\n sortedNames.slice(0, MAX_VISIBLE_PROPERTIES),\n properties,\n ),\n },\n collapsedProperties: {\n ...schemaMetadata,\n properties: reduceNamesToObject(\n sortedNames.slice(MAX_VISIBLE_PROPERTIES),\n properties,\n ),\n },\n }\n})\n\n/**\n * We don't want to render the request body if its completely empty\n * @example\n * {\n * \"content\": {},\n * }\n */\nconst shouldRenderRequestBody = computed(\n () =>\n Object.keys(requestBody?.content ?? {}).length > 0 ||\n requestBody?.description ||\n requestBody?.required,\n)\n</script>\n<template>\n <div\n v-if=\"requestBody && shouldRenderRequestBody\"\n aria-label=\"Request Body\"\n class=\"request-body\"\n role=\"group\">\n <div class=\"request-body-header\">\n <div class=\"request-body-title\">\n <slot name=\"title\" />\n <span\n v-if=\"schemaModelName\"\n class=\"text-c-2 text-xs leading-none font-normal\"\n data-testid=\"request-body-schema-name\">\n <span class=\"text-c-3 mx-1.5\">·</span>{{ schemaModelName }}\n </span>\n </div>\n <div class=\"flex items-center gap-2\">\n <div\n v-if=\"requestBody.required\"\n class=\"request-body-required\">\n required\n </div>\n <ContentTypeSelect\n v-model=\"selectedContentType\"\n :content=\"requestBody.content\" />\n </div>\n <div\n v-if=\"requestBody.description\"\n class=\"request-body-description\">\n <ScalarMarkdown :value=\"requestBody.description\" />\n </div>\n </div>\n\n <!-- For over 12 properties we want to show 12 and collapse the rest -->\n <div\n v-if=\"partitionedSchema\"\n class=\"request-body-schema\">\n <Schema\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n name=\"Request Body\"\n noncollapsible\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"partitionedSchema.visibleProperties\"\n schemaContext=\"requestBody\" />\n\n <Schema\n additionalProperties\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n name=\"Request Body\"\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"partitionedSchema.collapsedProperties\"\n schemaContext=\"requestBody\" />\n </div>\n\n <!-- Show em all 12 and under -->\n <div\n v-else-if=\"schema\"\n class=\"request-body-schema\">\n <Schema\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n :hideReadOnly=\"true\"\n name=\"Request Body\"\n noncollapsible\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"schema\"\n schemaContext=\"requestBody\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.request-body {\n margin-top: 24px;\n}\n.request-body-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 12px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n flex-flow: wrap;\n}\n.request-body-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: var(--scalar-font-size-2);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n}\n.request-body-required {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-orange);\n font-weight: normal;\n border-radius: 16px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 2px 8px;\n height: 20px;\n}\n.request-body-description {\n margin-top: 6px;\n font-size: var(--scalar-small);\n width: 100%;\n}\n\n.request-body-header\n + .request-body-schema:has(> .schema-card > .schema-card-description),\n.request-body-header\n + .request-body-schema:has(\n > .schema-card > .schema-properties > * > .property--level-0\n ) {\n /** Add a bit of space between the heading border and the schema description or properties */\n padding-top: 8px;\n}\n.request-body-description :deep(.markdown) * {\n color: var(--scalar-color-2) !important;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,yBAAyB;;;;;;;;;;;;;;;;;EAE/B,MAAM,wBAAwB,eAC5B,OAAO,KAAK,QAAA,aAAa,WAAW,EAAE,CAAC,CACzC;EAEA,MAAM,sBAAsB,SAAmB,SAAC,sBAE/C;AAED,MAAI,QAAA,aAAa;OACX,sBAAsB,MAAM,GAC9B,qBAAoB,QAAQ,sBAAsB,MAAM;;;EAK5D,MAAM,YAAY,eACV,QAAA,aAAa,UAAU,oBAAoB,QAAQ,OAC3D;EAEA,MAAM,SAAS,eAAe,eAAe,UAAU,MAAM,CAAA;;EAG7D,MAAM,kBAAkB,gBACf,UAAU,SAAS,uBAAuB,UAAU,MAAM,KAAK,KACxE;;;;;EAMA,MAAM,oBAAoB,eAAe;AAEvC,OAAI,CAAC,OAAO,SAAS,CAAC,aAAa,OAAO,MAAM,CAC9C,QAAO;GAIT,MAAM,cAAc,kBAClB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QAAA,YAAY,aAAA,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;OAMhC,kBAAA,SAAA,WAAA,EADR,mBAgCM,OAhCN,YAgCM,CA7BJ,YAagC,MAAA,eAAA,EAAA;IAZ7B,YAAA,QAAA;IACD,SAAA;IACC,iBAAiB,CAAA,cAAe;IAChC,UAAU,QAAA;IACX,MAAK;IACL,gBAAA;IACC,SAAO;;mCAA0E,QAAA,QAAQ;8BAAiE,QAAA,QAAQ;;IAKlK,QAAQ,kBAAA,MAAkB;IAC3B,eAAc;;;;;;OAEhB,YAagC,MAAA,eAAA,EAAA;IAZ9B,sBAAA;IACC,YAAA,QAAA;IACD,SAAA;IACC,iBAAiB,CAAA,cAAe;IAChC,UAAU,QAAA;IACX,MAAK;IACJ,SAAO;;mCAA0E,QAAA,QAAQ;8BAAiE,QAAA,QAAQ;;IAKlK,QAAQ,kBAAA,MAAkB;IAC3B,eAAc;;;;;;WAKL,OAAA,SAAA,WAAA,EADb,mBAkBM,OAlBN,YAkBM,CAfJ,YAcgC,MAAA,eAAA,EAAA;IAb7B,YAAA,QAAA;IACD,SAAA;IACC,iBAAiB,CAAA,cAAe;IAChC,UAAU,QAAA;IACV,cAAc;IACf,MAAK;IACL,gBAAA;IACC,SAAO;;mCAA0E,QAAA,QAAQ;8BAAiE,QAAA,QAAQ;;IAKlK,QAAQ,OAAA;IACT,eAAc"}
1
+ {"version":3,"file":"RequestBody.vue.script.js","names":[],"sources":["../../../../src/features/Operation/components/RequestBody.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { Schema } from '@/components/Content/Schema'\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getModelNameFromSchema } from '@/components/Content/Schema/helpers/schema-name'\nimport {\n reduceNamesToObject,\n sortPropertyNames,\n} from '@/components/Content/Schema/helpers/sort-property-names'\nimport LinkButton from '@/components/Content/Schema/LinkButton.vue'\n\nimport ContentTypeSelect from './ContentTypeSelect.vue'\n\nconst { requestBody, options } = defineProps<{\n breadcrumb?: string[]\n requestBody?: RequestBodyObject\n eventBus: WorkspaceEventBus | null\n options: {\n orderRequiredPropertiesFirst: boolean | undefined\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n hideModels: boolean | undefined\n }\n}>()\n\n/**\n * The maximum number of properties to show in the request body schema.\n */\nconst MAX_VISIBLE_PROPERTIES = 12\n\nconst availableContentTypes = computed(() =>\n Object.keys(requestBody?.content ?? {}),\n)\n\nconst selectedContentType = defineModel<string>('selectedContentType', {\n default: 'application/json',\n})\n\nif (requestBody?.content) {\n if (availableContentTypes.value[0]) {\n selectedContentType.value = availableContentTypes.value[0]\n }\n}\n\n/** Raw schema (possibly with $ref) for the selected content type */\nconst rawSchema = computed(\n () => requestBody?.content?.[selectedContentType.value]?.schema,\n)\n\nconst schema = computed(() => getResolvedRef(rawSchema.value))\n\n/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */\nconst modelLink = computed(\n () => (rawSchema.value && getModelNameFromSchema(rawSchema.value)) ?? null,\n)\n\n/**\n * Splits schema properties into visible and collapsed sections when there are more than 12 properties.\n * Returns null for schemas with fewer properties or non-object schemas.\n */\nconst partitionedSchema = computed(() => {\n // Early return if not an object schema\n if (!schema.value || !isTypeObject(schema.value)) {\n return null\n }\n\n // Lets sort the names first\n const sortedNames = sortPropertyNames(\n schema.value,\n schema.value.discriminator,\n {\n hideReadOnly: true,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n },\n )\n\n if (sortedNames.length <= MAX_VISIBLE_PROPERTIES) {\n return null\n }\n\n // Destructure everything except properties\n const { properties, ...schemaMetadata } = schema.value\n if (!properties) {\n return null\n }\n\n return {\n visibleProperties: {\n ...schemaMetadata,\n properties: reduceNamesToObject(\n sortedNames.slice(0, MAX_VISIBLE_PROPERTIES),\n properties,\n ),\n },\n collapsedProperties: {\n ...schemaMetadata,\n properties: reduceNamesToObject(\n sortedNames.slice(MAX_VISIBLE_PROPERTIES),\n properties,\n ),\n },\n }\n})\n\n/**\n * We don't want to render the request body if its completely empty\n * @example\n * {\n * \"content\": {},\n * }\n */\nconst shouldRenderRequestBody = computed(\n () =>\n Object.keys(requestBody?.content ?? {}).length > 0 ||\n requestBody?.description ||\n requestBody?.required,\n)\n</script>\n<template>\n <div\n v-if=\"requestBody && shouldRenderRequestBody\"\n aria-label=\"Request Body\"\n class=\"request-body\"\n role=\"group\">\n <div class=\"request-body-header\">\n <div class=\"request-body-title\">\n <slot name=\"title\" />\n <span\n v-if=\"modelLink\"\n class=\"text-c-2 text-xs leading-none font-normal\"\n data-testid=\"request-body-schema-name\">\n <span class=\"text-c-3 mx-1.5\">·</span>\n <LinkButton\n v-if=\"eventBus && modelLink.schemaKey\"\n @click=\"\n eventBus.emit('scroll-to:model-by-name', {\n name: modelLink.schemaKey,\n })\n \">\n {{ modelLink.label }}\n </LinkButton>\n <template v-else>{{ modelLink.label }}</template>\n </span>\n </div>\n <div class=\"flex items-center gap-2\">\n <div\n v-if=\"requestBody.required\"\n class=\"request-body-required\">\n required\n </div>\n <ContentTypeSelect\n v-model=\"selectedContentType\"\n :content=\"requestBody.content\" />\n </div>\n <div\n v-if=\"requestBody.description\"\n class=\"request-body-description\">\n <ScalarMarkdown :value=\"requestBody.description\" />\n </div>\n </div>\n\n <!-- For over 12 properties we want to show 12 and collapse the rest -->\n <div\n v-if=\"partitionedSchema\"\n class=\"request-body-schema\">\n <Schema\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n name=\"Request Body\"\n noncollapsible\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"partitionedSchema.visibleProperties\"\n schemaContext=\"requestBody\" />\n\n <Schema\n additionalProperties\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n name=\"Request Body\"\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"partitionedSchema.collapsedProperties\"\n schemaContext=\"requestBody\" />\n </div>\n\n <!-- Show em all 12 and under -->\n <div\n v-else-if=\"schema\"\n class=\"request-body-schema\">\n <Schema\n :breadcrumb\n compact\n :compositionPath=\"['requestBody']\"\n :eventBus=\"eventBus\"\n :hideReadOnly=\"true\"\n name=\"Request Body\"\n noncollapsible\n :options=\"{\n hideReadOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :schema=\"schema\"\n schemaContext=\"requestBody\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.request-body {\n margin-top: 24px;\n}\n.request-body-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-bottom: 12px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n flex-flow: wrap;\n}\n.request-body-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: var(--scalar-font-size-2);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-1);\n}\n.request-body-required {\n font-size: var(--scalar-micro);\n color: var(--scalar-color-orange);\n font-weight: normal;\n border-radius: 16px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 2px 8px;\n height: 20px;\n}\n.request-body-description {\n margin-top: 6px;\n font-size: var(--scalar-small);\n width: 100%;\n}\n\n.request-body-header\n + .request-body-schema:has(> .schema-card > .schema-card-description),\n.request-body-header\n + .request-body-schema:has(\n > .schema-card > .schema-properties > * > .property--level-0\n ) {\n /** Add a bit of space between the heading border and the schema description or properties */\n padding-top: 8px;\n}\n.request-body-description :deep(.markdown) * {\n color: var(--scalar-color-2) !important;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,yBAAyB;;;;;;;;;;;;;;;;;EAE/B,MAAM,wBAAwB,eAC5B,OAAO,KAAK,QAAA,aAAa,WAAW,EAAE,CAAC,CACzC;EAEA,MAAM,sBAAsB,SAAmB,SAAC,sBAE/C;AAED,MAAI,QAAA,aAAa;OACX,sBAAsB,MAAM,GAC9B,qBAAoB,QAAQ,sBAAsB,MAAM;;;EAK5D,MAAM,YAAY,eACV,QAAA,aAAa,UAAU,oBAAoB,QAAQ,OAC3D;EAEA,MAAM,SAAS,eAAe,eAAe,UAAU,MAAM,CAAA;;EAG7D,MAAM,YAAY,gBACT,UAAU,SAAS,uBAAuB,UAAU,MAAM,KAAK,KACxE;;;;;EAMA,MAAM,oBAAoB,eAAe;AAEvC,OAAI,CAAC,OAAO,SAAS,CAAC,aAAa,OAAO,MAAM,CAC9C,QAAO;GAIT,MAAM,cAAc,kBAClB,OAAO,OACP,OAAO,MAAM,eACb;IACE,cAAc;IACd,yBAAyB,QAAA,QAAQ;IACjC,8BAA8B,QAAA,QAAQ;IACvC,CACH;AAEA,OAAI,YAAY,UAAU,uBACxB,QAAO;GAIT,MAAM,EAAE,YAAY,GAAG,mBAAmB,OAAO;AACjD,OAAI,CAAC,WACH,QAAO;AAGT,UAAO;IACL,mBAAmB;KACjB,GAAG;KACH,YAAY,oBACV,YAAY,MAAM,GAAG,uBAAuB,EAC5C,WACD;KACF;IACD,qBAAqB;KACnB,GAAG;KACH,YAAY,oBACV,YAAY,MAAM,uBAAuB,EACzC,WACD;KACF;IACH;IACD;;;;;;;;EASD,MAAM,0BAA0B,eAE5B,OAAO,KAAK,QAAA,aAAa,W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YAgCM,CA7BJ,YAagC,MAAA,eAAA,EAAA;IAZ7B,YAAA,QAAA;IACD,SAAA;IACC,iBAAiB,CAAA,cAAe;IAChC,UAAU,QAAA;IACX,MAAK;IACL,gBAAA;IACC,SAAO;;mCAA0E,QAAA,QAAQ;8BAAiE,QAAA,QAAQ;;IAKlK,QAAQ,kBAAA,MAAkB;IAC3B,eAAc;;;;;;OAEhB,YAagC,MAAA,eAAA,EAAA;IAZ9B,sBAAA;IACC,YAAA,QAAA;IACD,SAAA;IACC,iBAAiB,CAAA,cAAe;IAChC,UAAU,QAAA;IACX,MAAK;IACJ,SAAO;;mCAA0E,QAAA,QAAQ;8BAAiE,QAAA,QAAQ;;IAKlK,QAAQ,kBAAA,MAAkB;IAC3B,eAAc;;;;;;WAKL,OAAA,SAAA,WAAA,EADb,mBAkBM,OAlBN,YAkBM,CAfJ,YAcgC,MAAA,eAAA,EAAA;IAb7B,YAAA,QAAA;IACD,SAAA;IACC,iBAAiB,CAAA,cAAe;IAChC,UAAU,QAAA;IACV,cAAc;IACf,MAAK;IACL,gBAAA;IACC,SAAO;;mCAA0E,QAAA,QAAQ;8BAAiE,QAAA,QAAQ;;IAKlK,QAAQ,OAAA;IACT,eAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ModernLayout.vue.script.js","names":[],"sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { OperationCodeSample } from '@scalar/api-client/blocks/operation-code-sample'\nimport { ScalarErrorBoundary, ScalarMarkdown } from '@scalar/components'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, provide, ref, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Badge } from '@/components/Badge'\nimport { LinkList } from '@/components/LinkList'\nimport OperationPath from '@/components/OperationPath.vue'\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport AskAgentButton from '@/features/ask-agent-button/AskAgentButton.vue'\nimport { ExampleResponses } from '@/features/example-responses'\nimport { ExternalDocs } from '@/features/external-docs'\nimport Callbacks from '@/features/Operation/components/callbacks/Callbacks.vue'\nimport OperationParameters from '@/features/Operation/components/OperationParameters.vue'\nimport OperationResponses from '@/features/Operation/components/OperationResponses.vue'\nimport {\n getOperationStability,\n getOperationStabilityColor,\n isOperationDeprecated,\n} from '@/features/Operation/helpers/operation-stability'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport SpecificationExtension from '@/features/specification-extension/SpecificationExtension.vue'\nimport { TestRequestButton } from '@/features/test-request-button'\nimport { XBadges } from '@/features/x-badges'\n\nconst {\n clientOptions,\n eventBus,\n isWebhook,\n method,\n operation,\n options,\n path,\n selectedServer,\n selectedSecuritySchemes,\n selectedClient,\n} = defineProps<\n Omit<\n OperationProps,\n | 'document'\n | 'pathValue'\n | 'server'\n | 'isCollapsed'\n | 'securitySchemes'\n | 'authStore'\n > & {\n /** Operation object with path params */\n operation: OperationObject\n /** The selected server for the operation */\n selectedServer: ServerObject | null\n /** The selected security schemes for the operation */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n }\n>()\n\nconst operationTitle = computed(() => operation.summary || path || '')\n\nconst labelId = useId()\n\nconst operationExtensions = computed(() => getXKeysFromObject(operation))\n\n/** Track the selected request body content type so the code sample stays in sync */\nconst selectedRequestBodyContentType = ref<string | undefined>()\n\n/** Selected request body oneOf/anyOf variants; synced with schema dropdowns and code sample */\nconst requestBodyCompositionSelection = ref<RequestBodyCompositionSelection>({})\n\nconst requestBodyCompositionSelectionForCodeSample = computed(\n (): RequestBodyCompositionSelection => ({\n ...requestBodyCompositionSelection.value,\n }),\n)\n\nconst requestBodyCompositionSelectionKey = computed(() =>\n JSON.stringify(requestBodyCompositionSelectionForCodeSample.value),\n)\n\nprovide(REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, requestBodyCompositionSelection)\n</script>\n\n<template>\n <Section\n :id=\"id\"\n :aria-labelledby=\"labelId\"\n :label=\"operationTitle\"\n tabindex=\"-1\"\n @intersecting=\"() => eventBus?.emit('intersecting:nav-item', { id })\">\n <SectionContent>\n <div class=\"flex flex-row justify-between gap-1\">\n <!-- Left -->\n <div class=\"flex gap-1\">\n <!-- Operation ID -->\n <Badge v-if=\"options?.showOperationId && operation.operationId\">\n {{ operation.operationId }}\n </Badge>\n <!-- Stability badge -->\n <Badge\n v-if=\"getOperationStability(operation)\"\n class=\"capitalize\"\n :class=\"getOperationStabilityColor(operation)\">\n {{ getOperationStability(operation) }}\n </Badge>\n <!-- Webhook badge -->\n <Badge\n v-if=\"isWebhook\"\n class=\"font-code text-green flex w-fit items-center justify-center gap-1\">\n <ScalarIconWebhooksLogo weight=\"bold\" />Webhook\n </Badge>\n <!-- x-badges before -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"before\" />\n </div>\n <!-- Right -->\n <div class=\"flex gap-1\">\n <!-- x-badges after -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"after\" />\n </div>\n </div>\n <div :class=\"isOperationDeprecated(operation) ? 'deprecated' : ''\">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"() => eventBus?.emit('copy-url:nav-item', { id })\">\n <SectionHeaderTag\n :id=\"labelId\"\n :level=\"3\">\n {{ operationTitle }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n </div>\n <SectionColumns>\n <SectionColumn>\n <div class=\"operation-details\">\n <SpecificationExtension :value=\"operationExtensions\" />\n <ScalarMarkdown\n :anchorPrefix=\"id\"\n aria-label=\"Operation Description\"\n role=\"group\"\n transformType=\"heading\"\n :value=\"operation.description\"\n withAnchors\n withImages />\n <OperationParameters\n :breadcrumb=\"[id]\"\n :eventBus\n :options\n v-model:selectedContentType=\"selectedRequestBodyContentType\"\n :parameters=\"operation.parameters\"\n :requestBody=\"getResolvedRef(operation.requestBody)\" />\n <OperationResponses\n :breadcrumb=\"[id]\"\n :collapsableItems=\"!options.expandAllResponses\"\n :eventBus\n :options\n :responses=\"operation.responses\" />\n\n <!-- Callbacks -->\n <ScalarErrorBoundary>\n <Callbacks\n v-if=\"operation.callbacks\"\n :callbacks=\"operation.callbacks\"\n class=\"mt-6\"\n :eventBus\n :options\n :path />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n <SectionColumn>\n <div class=\"examples\">\n <!-- External Docs -->\n <LinkList v-if=\"operation.externalDocs\">\n <ExternalDocs :value=\"operation.externalDocs\" />\n </LinkList>\n\n <!-- New Example Request -->\n <ScalarErrorBoundary>\n <OperationCodeSample\n :key=\"requestBodyCompositionSelectionKey\"\n :clientOptions\n :eventBus\n fallback\n :isWebhook\n :method\n :operation\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \"\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedContentType=\"selectedRequestBodyContentType\"\n :selectedServer>\n <template #header>\n <OperationPath\n class=\"font-code text-c-2 [&_em]:text-c-1 [&_em]:not-italic\"\n :deprecated=\"operation?.deprecated\"\n :path=\"path\" />\n </template>\n <template\n v-if=\"!isWebhook\"\n #footer=\"{ exampleName }\">\n <div class=\"flex\">\n <AskAgentButton />\n <TestRequestButton\n v-if=\"!options.hideTestRequestButton\"\n :id\n :eventBus\n :exampleName\n :method\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \" />\n </div>\n </template>\n </OperationCodeSample>\n </ScalarErrorBoundary>\n\n <ScalarErrorBoundary>\n <ExampleResponses\n v-if=\"operation.responses\"\n :responses=\"operation.responses\"\n style=\"margin-top: 12px\" />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n </SectionColumns>\n </SectionContent>\n </Section>\n</template>\n\n<style scoped>\n.examples {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n\n.examples > * {\n max-height: calc((var(--refs-viewport-height) - 60px) / 2);\n position: relative;\n}\n\n.examples > *:first-of-type:last-of-type {\n max-height: calc((var(--refs-viewport-height) - 60px));\n}\n\n/*\n * Don't constrain card height on mobile\n * (or zoomed in screens)\n */\n@media (max-width: 600px) {\n .examples > * {\n max-height: unset;\n }\n}\n.deprecated * {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EA,MAAM,iBAAiB,eAAe,QAAA,UAAU,WAAW,QAAA,QAAQ,GAAE;EAErE,MAAM,UAAU,OAAM;EAEtB,MAAM,sBAAsB,eAAe,mBAAmB,QAAA,UAAU,CAAA;;EAGxE,MAAM,iCAAiC,KAAwB;;EAG/D,MAAM,kCAAkC,IAAqC,EAAE,CAAA;EAE/E,MAAM,+CAA+C,gBACX,EACtC,GAAG,gCAAgC,OACpC,EACH;EAEA,MAAM,qCAAqC,eACzC,KAAK,UAAU,6CAA6C,MAAM,CACpE;AAEA,UAAQ,uCAAuC,gCAA+B;;uBAI5E,YAuJU,MAAA,gBAAA,EAAA;IAtJP,IAAI,QAAA;IACJ,mBAAiB,MAAA,QAAO;IACxB,OAAO,eAAA;IACR,UAAS;IACR,gBAAY,OAAA,OAAA,OAAA,WAAQ,QAAA,UAAU,KAAI,yBAAA,EAAA,IAA4B,QAAA,IAAE,CAAA;;2BAiJhD,CAhJjB,YAgJiB,MAAA,uBAAA,EAAA,MAAA;4BA/GT;MAhCN,mBAgCM,OAhCN,YAgCM,CA9BJ,mBAsBM,OAtBN,YAsBM;OApBS,QAAA,SAAS,mBAAmB,QAAA,UAAU,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nB,KAAK,mCAAA;WACL,eAAA,QAAA;WACA,UAAA,QAAA;WACD,UAAA;WACC,WAAA,QAAA;WACA,QAAA,QAAA;WACA,WAAA,QAAA;WACA,MAAA,QAAA;WACA,iCAAoD,6CAAA;WAGpD,iBAAiB,QAAA;WACjB,gBAAA,QAAA;WACA,qBAAqB,+BAAA;WACrB,gBAAA,QAAA;;WACU,QAAM,cAIE,CAHjB,YAGiB,uBAAA;YAFf,OAAM;YACL,YAAY,QAAA,WAAW;YACvB,MAAM,QAAA;;;eAGF,QAAA,YAAA;iBACN;wBAaK,EAbK,kBAAW,CACtB,mBAYM,OAZN,YAYM,CAXJ,YAAkB,uBAAA,EAAA,CAET,QAAA,QAAQ,yBAAA,WAAA,EADjB,YASM,MAAA,0BAAA,EAAA;;YAPH,IAAA,QAAA;YACA,UAAA,QAAA;YACA;YACA,QAAA,QAAA;YACA,MAAA,QAAA;YACA,iCAA0D,6CAAA;;;;;;;;;;;;;;;;;;;;;;;;;SAQrE,YAKsB,MAAA,oBAAA,EAAA,MAAA;iCADS,CAFrB,QAAA,UAAU,aAAA,WAAA,EADlB,YAG6B,MAAA,yBAAA,EAAA;;WAD1B,WAAW,QAAA,UAAU;WACtB,OAAA,EAAA,cAAA,QAAwB"}
1
+ {"version":3,"file":"ModernLayout.vue.script.js","names":[],"sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { OperationCodeSample } from '@scalar/api-client/blocks/operation-code-sample'\nimport { ScalarErrorBoundary, ScalarMarkdown } from '@scalar/components'\nimport { ScalarIconWebhooksLogo } from '@scalar/icons'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport type {\n OperationObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, provide, ref, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\nimport { Badge } from '@/components/Badge'\nimport { LinkList } from '@/components/LinkList'\nimport OperationPath from '@/components/OperationPath.vue'\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport AskAgentButton from '@/features/ask-agent-button/AskAgentButton.vue'\nimport { ExampleResponses } from '@/features/example-responses'\nimport { ExternalDocs } from '@/features/external-docs'\nimport Callbacks from '@/features/Operation/components/callbacks/Callbacks.vue'\nimport OperationParameters from '@/features/Operation/components/OperationParameters.vue'\nimport OperationResponses from '@/features/Operation/components/OperationResponses.vue'\nimport {\n getOperationStability,\n getOperationStabilityColor,\n isOperationDeprecated,\n} from '@/features/Operation/helpers/operation-stability'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\nimport { getXKeysFromObject } from '@/features/specification-extension'\nimport SpecificationExtension from '@/features/specification-extension/SpecificationExtension.vue'\nimport { TestRequestButton } from '@/features/test-request-button'\nimport { XBadges } from '@/features/x-badges'\n\nconst {\n clientOptions,\n eventBus,\n isWebhook,\n method,\n operation,\n options,\n path,\n selectedServer,\n selectedSecuritySchemes,\n selectedClient,\n} = defineProps<\n Omit<\n OperationProps,\n | 'document'\n | 'pathValue'\n | 'server'\n | 'isCollapsed'\n | 'securitySchemes'\n | 'authStore'\n > & {\n /** Operation object with path params */\n operation: OperationObject\n /** The selected server for the operation */\n selectedServer: ServerObject | null\n /** The selected security schemes for the operation */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n }\n>()\n\nconst operationTitle = computed(() => operation.summary || path || '')\n\nconst labelId = useId()\n\nconst operationExtensions = computed(() => getXKeysFromObject(operation))\n\n/** Track the selected request body content type so the code sample stays in sync */\nconst selectedRequestBodyContentType = ref<string | undefined>()\n\n/** Selected request body oneOf/anyOf variants; synced with schema dropdowns and code sample */\nconst requestBodyCompositionSelection = ref<RequestBodyCompositionSelection>({})\n\nconst requestBodyCompositionSelectionForCodeSample = computed(\n (): RequestBodyCompositionSelection => ({\n ...requestBodyCompositionSelection.value,\n }),\n)\n\nconst requestBodyCompositionSelectionKey = computed(() =>\n JSON.stringify(requestBodyCompositionSelectionForCodeSample.value),\n)\n\nprovide(REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, requestBodyCompositionSelection)\n</script>\n\n<template>\n <Section\n :id=\"id\"\n :aria-labelledby=\"labelId\"\n :label=\"operationTitle\"\n tabindex=\"-1\"\n @intersecting=\"() => eventBus?.emit('intersecting:nav-item', { id })\">\n <SectionContent>\n <div class=\"flex flex-row justify-between gap-1\">\n <!-- Left -->\n <div class=\"flex gap-1\">\n <!-- Operation ID -->\n <Badge v-if=\"options?.showOperationId && operation.operationId\">\n {{ operation.operationId }}\n </Badge>\n <!-- Stability badge -->\n <Badge\n v-if=\"getOperationStability(operation)\"\n class=\"capitalize\"\n :class=\"getOperationStabilityColor(operation)\">\n {{ getOperationStability(operation) }}\n </Badge>\n <!-- Webhook badge -->\n <Badge\n v-if=\"isWebhook\"\n class=\"font-code text-green flex w-fit items-center justify-center gap-1\">\n <ScalarIconWebhooksLogo weight=\"bold\" />Webhook\n </Badge>\n <!-- x-badges before -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"before\" />\n </div>\n <!-- Right -->\n <div class=\"flex gap-1\">\n <!-- x-badges after -->\n <XBadges\n :badges=\"operation['x-badges']\"\n position=\"after\" />\n </div>\n </div>\n <div :class=\"isOperationDeprecated(operation) ? 'deprecated' : ''\">\n <SectionHeader>\n <Anchor\n @copyAnchorUrl=\"() => eventBus?.emit('copy-url:nav-item', { id })\">\n <SectionHeaderTag\n :id=\"labelId\"\n :level=\"3\">\n {{ operationTitle }}\n </SectionHeaderTag>\n </Anchor>\n </SectionHeader>\n </div>\n <SectionColumns>\n <SectionColumn>\n <div class=\"operation-details\">\n <SpecificationExtension :value=\"operationExtensions\" />\n <ScalarMarkdown\n :anchorPrefix=\"id\"\n aria-label=\"Operation Description\"\n role=\"group\"\n transformType=\"heading\"\n :value=\"operation.description\"\n withAnchors\n withImages />\n <OperationParameters\n :breadcrumb=\"[id]\"\n :eventBus\n :options\n v-model:selectedContentType=\"selectedRequestBodyContentType\"\n :parameters=\"operation.parameters\"\n :requestBody=\"getResolvedRef(operation.requestBody)\" />\n <OperationResponses\n :breadcrumb=\"[id]\"\n :collapsableItems=\"!options.expandAllResponses\"\n :eventBus\n :options\n :responses=\"operation.responses\" />\n\n <!-- Callbacks -->\n <ScalarErrorBoundary>\n <Callbacks\n v-if=\"operation.callbacks\"\n :callbacks=\"operation.callbacks\"\n class=\"mt-6\"\n :eventBus\n :options\n :path />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n <SectionColumn>\n <div class=\"examples\">\n <!-- External Docs -->\n <LinkList v-if=\"operation.externalDocs\">\n <ExternalDocs :value=\"operation.externalDocs\" />\n </LinkList>\n\n <!-- New Example Request -->\n <ScalarErrorBoundary>\n <OperationCodeSample\n :key=\"requestBodyCompositionSelectionKey\"\n :clientOptions\n :eventBus\n fallback\n :isWebhook\n :method\n :operation\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \"\n :securitySchemes=\"selectedSecuritySchemes\"\n :selectedClient\n :selectedContentType=\"selectedRequestBodyContentType\"\n :selectedServer>\n <template #header>\n <OperationPath\n class=\"font-code text-c-2 [&_em]:text-c-1 [&_em]:not-italic\"\n :deprecated=\"operation?.deprecated\"\n :path=\"path\" />\n </template>\n <template\n v-if=\"!isWebhook\"\n #footer=\"{ exampleName }\">\n <div class=\"flex\">\n <AskAgentButton />\n <TestRequestButton\n v-if=\"!options.hideTestRequestButton\"\n :id\n :eventBus\n :exampleName\n :method\n :path\n :requestBodyCompositionSelection=\"\n requestBodyCompositionSelectionForCodeSample\n \" />\n </div>\n </template>\n </OperationCodeSample>\n </ScalarErrorBoundary>\n\n <ScalarErrorBoundary>\n <ExampleResponses\n v-if=\"operation.responses\"\n :responses=\"operation.responses\"\n style=\"margin-top: 12px\" />\n </ScalarErrorBoundary>\n </div>\n </SectionColumn>\n </SectionColumns>\n </SectionContent>\n </Section>\n</template>\n\n<style scoped>\n.examples {\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n\n.examples > * {\n max-height: calc((var(--refs-viewport-height) - 60px) / 2);\n position: relative;\n}\n\n.examples > *:first-of-type:last-of-type {\n max-height: calc((var(--refs-viewport-height) - 60px));\n}\n\n/*\n * Don't constrain card height on mobile\n * (or zoomed in screens)\n */\n@media (max-width: 600px) {\n .examples > * {\n max-height: unset;\n }\n}\n.deprecated * {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EA,MAAM,iBAAiB,eAAe,QAAA,UAAU,WAAW,QAAA,QAAQ,GAAE;EAErE,MAAM,UAAU,OAAM;EAEtB,MAAM,sBAAsB,eAAe,mBAAmB,QAAA,UAAU,CAAA;;EAGxE,MAAM,iCAAiC,KAAwB;;EAG/D,MAAM,kCAAkC,IAAqC,EAAE,CAAA;EAE/E,MAAM,+CAA+C,gBACX,EACtC,GAAG,gCAAgC,OACpC,EACH;EAEA,MAAM,qCAAqC,eACzC,KAAK,UAAU,6CAA6C,MAAM,CACpE;AAEA,UAAQ,uCAAuC,gCAA+B;;uBAI5E,YAuJU,MAAA,gBAAA,EAAA;IAtJP,IAAI,QAAA;IACJ,mBAAiB,MAAA,QAAO;IACxB,OAAO,eAAA;IACR,UAAS;IACR,gBAAY,OAAA,OAAA,OAAA,WAAQ,QAAA,UAAU,KAAI,yBAAA,EAAA,IAA4B,QAAA,IAAE,CAAA;;2BAiJhD,CAhJjB,YAgJiB,MAAA,uBAAA,EAAA,MAAA;4BA/GT;MAhCN,mBAgCM,OAhCN,YAgCM,CA9BJ,mBAsBM,OAtBN,YAsBM;OApBS,QAAA,SAAS,mBAAmB,QAAA,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